-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (21 loc) · 839 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
# Disable CGO since we have no Go code that calls into C.
export CGO_ENABLED := 0
gobuild = mkdir -p dist/$$GOOS-$$GOARCH && go build -o dist/$$GOOS-$$GOARCH ./serveit
tar = (cd dist && tar -czvf $$GOOS-$$GOARCH.tar.gz $$GOOS-$$GOARCH/*)
zip = (cd dist && zip -r $$GOOS-$$GOARCH.zip $$GOOS-$$GOARCH/*)
build:
mkdir -p dist && go build -o dist ./serveit
build.all:
export GOOS=linux; export GOARCH=386; $(gobuild) && $(tar)
export GOOS=linux; export GOARCH=amd64; $(gobuild) && $(tar)
export GOOS=windows; export GOARCH=amd64; $(gobuild) && $(zip)
export GOOS=windows; export GOARCH=386; $(gobuild) && $(zip)
lint:
staticcheck -checks=all ./...
test:
CGO_ENABLED=1 go test ./... -race -cover
clean:
rm -rf dist
# Resources:
# List of available target OSs and architectures:
# https://golang.org/doc/install/source#environment