-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (24 loc) · 891 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.ONESHELL: build
.PHONY: build windows linux
.DEFAULT_GOAL=build
ifeq ($(OS),Windows_NT)
SHELL=C:/Program Files/Git/bin/bash.exe
build: windows
else
SHELL=/usr/bin/bash
build: linux
endif
prepare:
cp -n ./configs/dist.example.yaml ./configs/example.yaml
windows: prepare
export GOOS=windows
export GOARCH=amd64
export CGO_ENABLED=1
#go build -a -tags "osusergo,netgo,sqlite_omit_load_extension" -trimpath -ldflags '-s -w -extldflags "-static"' -o example.exe ./cmd/example
go build -tags "osusergo,netgo,sqlite_omit_load_extension" -trimpath -o example.exe ./cmd/example
linux: prepare
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=1
#go build -a -tags "osusergo,netgo,sqlite_omit_load_extension" -trimpath -ldflags '-s -w -extldflags "-static"' -o example ./cmd/example
go build -tags="osusergo,netgo,sqlite_omit_load_extension" -trimpath -o example ./cmd/example