-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (40 loc) · 940 Bytes
/
Makefile
File metadata and controls
41 lines (40 loc) · 940 Bytes
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
# Binary name
BINARY=eve
GOBUILD=go build -ldflags "-s -w" -o ${BINARY}
GOCLEAN=go clean
RMTARGZ=rm -rf *.gz
# Builds the project
build:
$(GOBUILD)
go test -v
# Installs our project: copies binaries
install:
go install
release:
# Clean
$(GOCLEAN)
$(RMTARGZ)
# Build for mac
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD)
tar czvf ${BINARY}-mac64-${VERSION}.tar.gz ./${BINARY}
# Build for arm
$(GOCLEAN)
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GOBUILD)
tar czvf ${BINARY}-arm64-${VERSION}.tar.gz ./${BINARY}
# Build for linux
$(GOCLEAN)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD)
tar czvf ${BINARY}-linux64-${VERSION}.tar.gz ./${BINARY}
# Build for win
$(GOCLEAN)
#CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD)
#tar czvf ${BINARY}-win64-${VERSION}.tar.gz ./${BINARY}.exe
#$(GOCLEAN)
#$(GOBUILD)
# Cleans our projects: deletes binaries
clean:
$(GOCLEAN)
$(RMTARGZ)
test:
go test -v
.PHONY: clean build