Browse Source

featrue(mcs_api): 增加Makefile,方便编译

sunmiao 3 years ago
parent
commit
3f35517797
1 changed files with 22 additions and 0 deletions
  1. 22 0
      backend/src/dashoo.cn/mcs_api/Makefile

+ 22 - 0
backend/src/dashoo.cn/mcs_api/Makefile

@@ -0,0 +1,22 @@
+.PHONY: build build-win clean help
+
+# const
+GO_CMD=go
+GO_BUILD=$(GO_CMD) build
+SERVICE_NAME=mcs_web_api
+OUTPUT_DIR=./bin/$(SERVICE_NAME)
+
+default: build
+
+build:
+	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO_BUILD) -o $(OUTPUT_DIR)
+
+build-win:
+	CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go $(GO_BUILD) -o $(OUTPUT_DIR).exe
+
+clean:
+	rm -rf $(OUTPUT_DIR)
+
+help:
+    @echo "make: compile packages"
+    @echo "build-win: compile packages under windows"