-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (21 loc) · 1.04 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
# note: call scripts from /scripts
# A phony target is one that is not really the name of a file; rather it is just a name for a recipe to be executed when you make an explicit request. There are two reasons to use a phony target: to avoid a conflict with a file of the same name, and to improve performance.
# If you write a rule whose recipe will not create the target file, the recipe will be executed every time the target comes up for remaking.
.PHONY: build
build:
# go build -o . main.go
go mod tidy
go build -v
run:
./crawl
dev: build run
release: rls-win rls-linux rls-mac
rls-linux:
cd build && GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o ./crawl ..
cd build && tar -czf crawl.linux-amd64.tar.gz ./crawl ./configs
rls-mac:
cd build && GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o ./crawl ..
cd build && tar -czf crawl.darwin-amd64.tar.gz ./crawl ./configs
rls-win:
cd build && GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o ./crawl.exe ..
cd build && tar -czf crawl.windows-amd64.tar.gz ./crawl.exe ./configs