-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (37 loc) · 1.13 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
PROJECT?=go-vue-skeleton
bin-prep:
GO111MODULE=off go get -u github.com/kevinburke/go-bindata/...
bin-migrations:
go-bindata -o data/migrate.go -prefix data/migrations/ data/migrations/
sed -i "s/package main/package data/" data/migrate.go
bin-dist:
go-bindata -o $(PROJECT)/assets.go -prefix dist/ dist/...
binaries:
$(MAKE) binary GOARCH=amd64 GOOS=linux
$(MAKE) binary GOARCH=amd64 GOOS=windows
$(MAKE) binary GOARCH=amd64 GOOS=darwin
$(MAKE) binary GOARCH=386 GOOS=linux
$(MAKE) binary GOARCH=386 GOOS=windows
binary: GOARCH?=amd64
binary: GOOS?=linux
binary:
go build -o build/$(PROJECT).$(GOARCH)-$(GOOS) ./$(PROJECT)
if [ "$(GOOS)" = "windows" ]; then \
mv build/$(PROJECT).$(GOARCH)-$(GOOS) build/$(PROJECT).$(GOARCH)-$(GOOS).exe; \
fi
build-fe:
yarn && yarn build
clean:
rm $(PROJECT)/assets.go
rm data/migrate.go
rm -r dist
# at this time, there's no watch enabled for the go binary
dev-be: bin-prep bin-migrations bin-dist install
$(PROJECT)
# serve is a watch task with built-in node server
dev-fe:
yarn serve
install: build-fe bin-migrations bin-dist
go install ./$(PROJECT)/
test: install
go test -v -race ./...