Advertisement
mteodorovic

Untitled

Feb 13th, 2019
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.61 KB | None | 0 0
  1. BUILD_DIR = build
  2. CGO_ENABLED ?= 0
  3. GOOS ?= linux
  4.  
  5. define compile_service
  6.         CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build -ldflags "-s -w" -o ${BUILD_DIR}/edgex-app cmd/main.go
  7. endef
  8.  
  9. all:  edgex-app
  10.  
  11. .PHONY: all
  12.  
  13.  
  14. edgex-app:
  15.         $(call compile_service,$(@))
  16.  
  17. clean:
  18.         rm -rf ${BUILD_DIR}
  19.  
  20. install:
  21.         cp ${BUILD_DIR}/* $(GOBIN)
  22.  
  23. test:
  24.         GOCACHE=off go test -v -race -tags test $(shell go list ./... | grep -v 'vendor\|cmd')
  25.  
  26.  
  27.  
  28. release:
  29.         $(eval version = $(shell git describe --abbrev=0 --tags))
  30.         git checkout $(version)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement