-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (39 loc) · 1.02 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
40
41
42
43
44
45
46
47
48
49
VERSION := $(shell cat VERSION)
GOPATH ?= $(HOME)/go
CGO_ENABLED := 1
DEP := $(GOPATH)/bin/dep
PACKR := $(GOPATH)/bin/packr
TAGS := json1
.PHONY: dist
all:
cd webapp && $(MAKE) $@
$(PACKR) -z
CGO_ENABLED=1 go build --tags "$(TAGS)"
install-deps:
cd webapp && $(MAKE) $@
go get -u github.com/gobuffalo/packr/...
go get -u github.com/golang/dep/cmd/dep
$(DEP) ensure
dist: GOOS=$(shell go env GOOS)
dist: GOARCH=$(shell go env GOARCH)
dist: GOEXE=$(shell go env GOEXE)
dist: OUTDIR=maker-$(VERSION)-$(GOOS)-$(GOARCH)
dist: OUTBIN=maker$(GOEXE)
dist:
$(GOPATH)/bin/dep ensure
rm -rf dist/$(OUTDIR)
mkdir -p dist/$(OUTDIR)
cd webapp && $(MAKE)
$(PACKR) -z
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) \
go build --tags "$(TAGS)" -o dist/$(OUTDIR)/$(OUTBIN)
(cd dist && zip -r $(OUTDIR).zip $(OUTDIR))
clean:
rm -f maker maker.exe
rm -rf dist
cd webapp && $(MAKE) $@
distclean: clean
rm -rf vendor
cd webapp && $(MAKE) $@
dev-server:
reflex -d none -s -r \.go$$ -- go run --tags "json1" ./main.go server