1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

add Makefile

This commit is contained in:
Timothy 2017-09-15 16:13:08 +08:00
parent c302352cc9
commit 9d1c325e2a
3 changed files with 33 additions and 0 deletions

1
.gitignore vendored
View File

@ -24,6 +24,7 @@ _testmain.go
config.json
*.log
*.swp
*.gz
godns
vendor/*

View File

@ -3,6 +3,9 @@ go:
- 1.7
- 1.8
install:
go get -v
script:
- cp ./config_sample.json ./config.json
- go test -v ./...

29
Makefile Normal file
View File

@ -0,0 +1,29 @@
# Binary name
BINARY=godns
# Builds the project
build:
go build -o ${BINARY}
# Installs our project: copies binaries
install:
go install
release:
# Clean
go clean
rm -rf *.gz
# Build for mac
go build
tar czvf ${BINARY}-mac64-${VERSION}.tar.gz ./${BINARY}
# Build for linux
go clean
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
tar czvf ${BINARY}-linux64-${VERSION}.tar.gz ./${BINARY}
# Build for win
go clean
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build
tar czvf ${BINARY}-win64-${VERSION}.tar.gz ./${BINARY}.exe
go clean
# Cleans our projects: deletes binaries
clean:
go clean
.PHONY: clean build