diff --git a/Makefile b/Makefile index 67f12a1..31d1e06 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ OUT_DIR=output MOD_ZIP=$(OUT_DIR)/mapserver-mod.zip all: $(OUT_DIR) $(MOD_ZIP) - $(MAKE) -C server build-docker + $(MAKE) -C server build-all-docker cp server/output/* $(OUT_DIR)/ $(OUT_DIR): diff --git a/server/Makefile b/server/Makefile index e43c4c8..f64753e 100644 --- a/server/Makefile +++ b/server/Makefile @@ -5,7 +5,7 @@ ENV=GO111MODULE=on GO_LDFLAGS=-ldflags "-linkmode external -extldflags -static" -all: build +all: build-all $(OUT_DIR): mkdir $@ @@ -28,12 +28,20 @@ clean-all: clean rm -rf mapserver.json build-docker: - sudo docker run --rm -it -v $(shell pwd)/:/app -v mapserver-volume:/root/go -w /app mapserver-builder make + sudo docker run --rm -it -v $(shell pwd)/:/app -v mapserver-volume:/root/go -w /app mapserver-builder make build + +build-all-docker: + sudo docker run --rm -it -v $(shell pwd)/:/app -v mapserver-volume:/root/go -w /app mapserver-builder make build-all build: $(OUT_DIR) go generate # native CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-x86_64 + +build-all: $(OUT_DIR) + go generate + # native + CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-x86_64 # apt install gcc-8-i686-linux-gnu CGO_ENABLED=1 GOOS=linux GOARCH=386 CC=i686-linux-gnu-gcc-7 go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-x86 # apt install gcc-mingw-w64