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

43 lines
1.2 KiB
Makefile
Raw Normal View History

2019-01-05 17:21:24 +01:00
2019-01-11 10:49:19 +01:00
STATIC_VFS=vfs/static.go
2019-01-23 09:11:55 +01:00
OUT_DIR=output
2019-01-24 19:20:11 +01:00
ENV=GO111MODULE=on
2019-01-11 10:49:19 +01:00
2019-01-28 10:09:11 +01:00
GO_LDFLAGS=-ldflags "-linkmode external -extldflags -static"
2019-01-23 09:11:55 +01:00
all: build
$(OUT_DIR):
mkdir $@
2019-02-14 09:09:04 +01:00
fmt:
go fmt ./...
2019-02-13 14:42:53 +01:00
test: $(OUT_DIR)
go generate
go build
2019-01-24 19:20:11 +01:00
$(ENV) go test ./...
2019-01-05 17:21:24 +01:00
2019-01-21 19:18:07 +01:00
clean:
2019-01-22 20:19:04 +01:00
rm -rf $(STATIC_VFS)
2019-01-23 09:11:55 +01:00
rm -rf $(OUT_DIR)
2019-01-21 19:18:07 +01:00
2019-01-31 13:22:06 +01:00
build-docker:
2019-02-08 21:38:08 +01:00
sudo docker run --rm -it -v $(shell pwd)/:/app -v mapserver-volume:/root/go -w /app mapserver-builder make
2019-01-31 13:22:06 +01:00
2019-02-13 14:42:53 +01:00
build: $(OUT_DIR)
go generate
2019-01-28 10:09:11 +01: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 13:22:06 +01: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 09:50:25 +01: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 09:53:38 +01: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 09:43:58 +01:00
# apt install gcc-5-arm-linux-gnueabihf, TODO: container
2019-01-28 10:09:11 +01: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 15:22:56 +01:00
#go test -cpuprofile cpu.prof -memprofile mem.prof -bench . ./mapblockrenderer/
#go tool pprof cpu.prof
#top