1
0
forked from MTSR/mapserver
mapserver/server/Makefile

38 lines
1.4 KiB
Makefile
Raw Normal View History

2019-01-05 19:21:24 +03:00
2019-01-11 12:49:19 +03:00
STATIC_VFS=vfs/static.go
2019-01-23 11:11:55 +03:00
OUT_DIR=output
2019-01-24 21:20:11 +03:00
ENV=GO111MODULE=on
2019-01-11 12:49:19 +03:00
2019-01-28 10:22:45 +03:00
XGO = sudo docker run -it --rm --entrypoint /bin/bash -v "$(shell pwd):/mnt/build"
XGO += -e "http_proxy=$(shell echo ${http_proxy})"
XGO += -e "https_proxy=$(shell echo ${https_proxy})"
XGO += karalabe/xgo-1.11.1 -c
docker-build: $(STATIC_VFS)
$(XGO) "cd /mnt/build && make build"
2019-01-23 11:11:55 +03:00
all: build
$(OUT_DIR):
mkdir $@
test: $(STATIC_VFS) $(OUT_DIR)
2019-01-24 21:20:11 +03:00
$(ENV) go test ./...
2019-01-05 19:21:24 +03:00
2019-01-21 21:18:07 +03:00
clean:
2019-01-22 22:19:04 +03:00
rm -rf $(STATIC_VFS)
2019-01-23 11:11:55 +03:00
rm -rf $(OUT_DIR)
2019-01-21 21:18:07 +03:00
2019-01-11 12:49:19 +03:00
$(STATIC_VFS):
2019-01-24 21:34:58 +03:00
test -f esc || $(ENV) go get github.com/mjibson/esc
2019-01-24 21:37:40 +03:00
${HOME}/go/bin/esc -o $@ -prefix="static/" -pkg vfs static
2019-01-11 12:49:19 +03:00
2019-01-23 11:11:55 +03:00
build: $(STATIC_VFS) $(OUT_DIR)
2019-01-28 10:40:05 +03:00
#CGO_ENABLED=1 GOOS=linux GOARCH=386 go build -o $(OUT_DIR)/mapserver-linux-x86
#CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o $(OUT_DIR)/mapserver-linux-x86_64
CC=arm-linux-gnueabi-gcc-5 CXX=arm-linux-gnueabi-g++-5 HOST=arm-linux-gnueabi PREFIX=/usr/arm-linux-gnueabi CFLAGS="-march=armv5" CXXFLAGS="-march=armv5" CGO_ENABLED=1 GOOS=linux GOARCH=arm go build -o $(OUT_DIR)/mapserver-linux-arm
CGO_ENABLED=1 GOOS=darwin GOARCH=386 go build -o $(OUT_DIR)/mapserver-darwin-x86
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o $(OUT_DIR)/mapserver-darwin-x86_64
CGO_ENABLED=1 GOOS=windows GOARCH=386 go build -o $(OUT_DIR)/mapserver-windows-x86.exe
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -o $(OUT_DIR)/mapserver-windows-x86_64.exe