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

View File

@ -2,7 +2,7 @@
BINARY=godns
# Builds the project
build:
go build -o ${BINARY}
go build -o ${BINARY} -ldflags "-X main.Version=${VERSION}"
# Installs our project: copies binaries
install:
go install
@ -11,19 +11,19 @@ release:
go clean
rm -rf *.gz
# Build for mac
go build
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
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
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
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

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
}

View File

@ -11,6 +11,22 @@ import (
"golang.org/x/net/proxy"
)
var (
Logo = `
GoDNS V%s
https://github.com/TimothyYe/godns
`
)
const (
// PanicMax is the max allowed panic times
PanicMax = 5