1
0
Fork 0
api_skeleton/Makefile

54 lines
1.7 KiB
Makefile

# This how we want to name the binary output
BINARY=api_skeleton
# 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/api_skeleton/util.version=${VERSION} -X amuz.es/gogs/infra/api_skeleton/util.buildDate=${BUILD} "
CGO_ENABLED=0
build:
go build ${LDFLAGS} -tags=jsoniter -o ${BINARY} .
strip -x ${BINARY}
setup:
go get -u github.com/kardianos/govendor
# 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
protoc --gogofaster_out=. --proto_path=../../../../:. subsys/redis/app_token_data.proto
#${GOPATH}/bin/ffjson subsys/http/iface/rest.go
#${GOPATH}/bin/easyjson subsys/http/iface/rest.go
strip:
upx api_skeleton
# 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