-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
39 lines (27 loc) · 1.07 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
# Lumen Makefile
DIST = `pwd`/dist
SRC=lumen.go cli/*.go store/*.go main/main.go
BUILDSRC=main/main.go
default: all
clean:
mkdir -p dist
rm -rf $(DIST)/*
test: $(SRC)
go test -v ./...
update: Gopkg.toml $(SRC)
dep ensure -update
all: $(DIST)/lumen.linux.amd64 $(DIST)/lumen.linux.arm $(DIST)/lumen.linux.arm64 $(DIST)/lumen.macos $(DIST)/lumen.windows
.PHONY: clean all default
# Linux builds
$(DIST)/lumen.linux.amd64: $(SRC)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o $@ $(BUILDSRC)
$(DIST)/lumen.linux.arm: $(SRC)
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -a -ldflags '-extldflags "-static"' -o $@ $(BUILDSRC)
$(DIST)/lumen.linux.arm64:: $(SRC)
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -ldflags '-extldflags "-static"' -o $@ $(BUILDSRC)
# MacOS
$(DIST)/lumen.macos: $(SRC)
CGO_ENABLED=0 GOOS=darwin go build -a -ldflags '-extldflags "-static"' -o $@ $(BUILDSRC)
# Windows
$(DIST)/lumen.windows: $(SRC)
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o $@ $(BUILDSRC)