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 BINARY=godns
# Builds the project # Builds the project
build: build:
go build -o ${BINARY} go build -o ${BINARY} -ldflags "-X main.Version=${VERSION}"
# Installs our project: copies binaries # Installs our project: copies binaries
install: install:
go install go install
@ -11,19 +11,19 @@ release:
go clean go clean
rm -rf *.gz rm -rf *.gz
# Build for mac # Build for mac
go build go build -o ${BINARY} -ldflags "-X main.Version=${VERSION}"
tar czvf ${BINARY}-mac64-${VERSION}.tar.gz ./${BINARY} tar czvf ${BINARY}-mac64-${VERSION}.tar.gz ./${BINARY}
# Build for linux # Build for linux
go clean 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} tar czvf ${BINARY}-linux64-${VERSION}.tar.gz ./${BINARY}
# Build for arm # Build for arm
go clean 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} tar czvf ${BINARY}-arm64-${VERSION}.tar.gz ./${BINARY}
# Build for win # Build for win
go clean 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 tar czvf ${BINARY}-win64-${VERSION}.tar.gz ./${BINARY}.exe
go clean go clean
# Cleans our projects: deletes binaries # Cleans our projects: deletes binaries

View File

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

View File

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