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 12:09:11 +03:00
|
|
|
GO_LDFLAGS=-ldflags "-linkmode external -extldflags -static"
|
|
|
|
|
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-02-02 18:23:01 +03:00
|
|
|
go run github.com/mjibson/esc -o vfs/static.go -prefix="static/" -pkg vfs static
|
2019-01-11 12:49:19 +03:00
|
|
|
|
2019-01-31 15:22:06 +03:00
|
|
|
build-docker:
|
|
|
|
docker run --rm -it -v /home/thomas/git/mapserver/server/:/app -v mapserver-volume:/root/go -w /app mapserver-builder make
|
|
|
|
|
2019-01-23 11:11:55 +03:00
|
|
|
build: $(STATIC_VFS) $(OUT_DIR)
|
2019-01-28 12:09:11 +03:00
|
|
|
# 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
|
2019-01-31 15:22:06 +03:00
|
|
|
CGO_ENABLED=1 GOOS=linux GOARCH=386 CC=i686-linux-gnu-gcc-7 go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-x86
|
2019-01-28 11:50:25 +03:00
|
|
|
# apt install gcc-mingw-w64
|
|
|
|
GOARCH=386 GOOS=windows CC=i686-w64-mingw32-gcc CGO_ENABLED=1 go build -o $(OUT_DIR)/mapserver-windows-x86.exe
|
2019-01-28 11:53:38 +03:00
|
|
|
GOARCH=amd64 GOOS=windows CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 go build -o $(OUT_DIR)/mapserver-windows-x86-64.exe
|
2019-01-28 11:43:58 +03:00
|
|
|
# apt install gcc-5-arm-linux-gnueabihf, TODO: container
|
2019-01-28 12:09:11 +03:00
|
|
|
GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc-5 CGO_ENABLED=1 go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-arm
|
2019-02-04 17:22:56 +03:00
|
|
|
|
|
|
|
#go test -cpuprofile cpu.prof -memprofile mem.prof -bench . ./mapblockrenderer/
|
|
|
|
#go tool pprof cpu.prof
|
|
|
|
#top
|