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

move Makefile, add program logo

This commit is contained in:
Timothy
2017-10-30 14:17:18 +08:00
parent f8dac9d4e9
commit bfb7961229
3 changed files with 24 additions and 5 deletions

33
cmd/godns/Makefile Normal file
View File

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

View File

@@ -9,17 +9,20 @@ import (
"github.com/TimothyYe/godns"
"github.com/TimothyYe/godns/handler"
"github.com/fatih/color"
)
var (
configuration godns.Settings
optConf = flag.String("c", "./config.json", "Specify a config file")
optHelp = flag.Bool("h", false, "Show help")
Version = "0.1"
)
func main() {
flag.Parse()
if *optHelp {
color.Cyan(godns.Logo, Version)
flag.Usage()
return
}