build-all / build

This commit is contained in:
Thomas Rudin 2019-02-22 19:40:26 +01:00
parent 3cfaf9c059
commit f65dde7713
2 changed files with 11 additions and 3 deletions

View File

@ -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):

View File

@ -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