-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (36 loc) · 1.64 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
##----------------------------------------------------------------------------##
## Variables ##
##----------------------------------------------------------------------------##
OUTPUT = ./bin/
BINARY = systags
##----------------------------------------------------------------------------##
## Help ##
##----------------------------------------------------------------------------##
.PHONY: help
help:
@echo
@echo "WELCOME TO SYSTAGS"
@echo "------------------"
@echo
@echo "MAKE"
@echo " $$ make help - Prints out these help instructions"
@echo " $$ make build - Builds systags binary for this OS"
@echo " $$ make clean - Cleans and removes generated files"
@echo " $$ make publish - Builds artifacts for a new release"
@echo
@echo "DOCS"
@echo " Visit https://github.com/StackAdapt/systags for more"
@echo
##----------------------------------------------------------------------------##
## Build ##
##----------------------------------------------------------------------------##
.PHONY: build clean publish
build:
go build -o "$(OUTPUT)$(BINARY)"
clean:
rm -rf "$(OUTPUT)"
publish: clean
env GOOS=linux GOARCH=amd64 go build -o "$(OUTPUT)$(BINARY)_linux_amd64/$(BINARY)"
env GOOS=linux GOARCH=arm64 go build -o "$(OUTPUT)$(BINARY)_linux_arm64/$(BINARY)"
tar -czf "$(OUTPUT)$(BINARY)_linux_amd64.tar.gz" -C "$(OUTPUT)" "$(BINARY)_linux_amd64"
tar -czf "$(OUTPUT)$(BINARY)_linux_arm64.tar.gz" -C "$(OUTPUT)" "$(BINARY)_linux_arm64"