# This how we want to name the binary output BINARY=changer # These are the values we want to pass for VERSION and BUILD # git tag 1.0.1 # git commit -am "One more change after the tags" VERSION=`git describe --always` BUILD=`date +%FT%T%z` # Setup the -ldflags option for go build here, interpolate the variable values LDFLAGS=-ldflags "-w -s -X amuz.es/gogs/infra/changer/util.version=${VERSION} -X amuz.es/gogs/infra/changer/util.buildDate=${BUILD}" CGO_ENABLED=0 # Builds the project build: go build ${LDFLAGS} -o ${BINARY} strip -x ${BINARY} # Builds the project setup: go get -u github.com/kardianos/govendor go get -u github.com/jteeuwen/go-bindata/... # go get -u github.com/gogo/protobuf/proto # go get -u github.com/gogo/protobuf/protoc-gen-gogo # go get -u github.com/gogo/protobuf/gogoproto # go get -u github.com/gogo/protobuf/protoc-gen-gofast # go get -u github.com/gogo/protobuf/protoc-gen-gogofaster # go get -u github.com/golang/protobuf/proto ${GOPATH}/bin/govendor fetch -v +missing #libjpeg-turbo generate: go get -u github.com/gogo/protobuf/proto go get -u github.com/gogo/protobuf/protoc-gen-gogo go get -u github.com/gogo/protobuf/gogoproto go get -u github.com/gogo/protobuf/protoc-gen-gofast go get -u github.com/gogo/protobuf/protoc-gen-gogofaster go get -u github.com/golang/protobuf/proto go get -u github.com/mailru/easyjson protoc --gogofaster_out=. --proto_path=../../:. subsys/redis/app_token_data.proto go-bindata -nomemcopy -ignore .DS_Store -prefix asset/static -o bind/static/data.go -pkg static asset/static/... go-bindata -nomemcopy -ignore .DS_Store -prefix asset/template -o bind/template/data.go -pkg template asset/template/... #${GOPATH}/bin/ffjson subsys/http/iface/rest.go ${GOPATH}/bin/easyjson subsys/http/iface/rest.go # go-bindata -debug -nomemcopy -ignore .DS_Store -prefix asset/static -o bind/static/data.go -pkg static asset/static/... # go-bindata -debug -nomemcopy -ignore .DS_Store -prefix asset/template -o bind/template/data.go -pkg template asset/template/... strip: upx rooibos # Installs our project: copies binaries install: go install ${LDFLAGS} # Cleans our project: deletes binaries clean: if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi .PHONY: clean install