some initial code
This commit is contained in:
46
Makefile
Normal file
46
Makefile
Normal file
@ -0,0 +1,46 @@
|
||||
# make
|
||||
# make GOARCH=386
|
||||
# make GOARCH=amd64
|
||||
# make GOOS=linux GOARCH=mips
|
||||
#
|
||||
# 'go tool dist list' for available os and architextures
|
||||
|
||||
NAME=haza
|
||||
VERSION=1.0.0
|
||||
|
||||
SRCS=\
|
||||
haza.go \
|
||||
iface.go \
|
||||
server.go
|
||||
|
||||
CMD_SRCS=\
|
||||
cmd/logger.go \
|
||||
cmd/main.go
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
$(NAME): $(DATA) $(SRCS) $(CMD_DATA) $(CMD_SRCS)
|
||||
CGO_ENABLED=0 go build -x -ldflags "-X 'main.HAZA_NAME=$(NAME)' -X 'main.HAZA_VERSION=$(VERSION)'" -o $@ $(CMD_SRCS)
|
||||
##CGO_ENABLED=1 go build -x -ldflags "-X 'main.HAZA_NAME=$(NAME)' -X 'main.HAZA_VERSION=$(VERSION)'" -o $@ $(CMD_SRCS)
|
||||
##CGO_ENABLED=1 go build -x -ldflags "-X 'main.HAZA_NAME=$(NAME)' -X 'main.HAZA_VERSION=$(VERSION)' -linkmode external -extldflags=-static" -o $@ $(CMD_SRCS)
|
||||
|
||||
$(NAME).debug: $(DATA) $(SRCS) $(CMD_DATA) $(CMD_SRCS)
|
||||
CGO_ENABLED=1 go build -race -x -ldflags "-X 'main.HAZA_NAME=$(NAME)' -X 'main.HAZA_VERSION=$(VERSION)'" -o $@ $(CMD_SRCS)
|
||||
|
||||
clean:
|
||||
go clean -x -i
|
||||
rm -f $(NAME) $(NAME).debug
|
||||
|
||||
check:
|
||||
go test -x
|
||||
|
||||
cmd/tls.crt:
|
||||
openssl req -x509 -newkey rsa:4096 -keyout cmd/tls.key -out cmd/tls.crt -sha256 -days 36500 -nodes -subj "/CN=$(NAME)" --addext "subjectAltName=DNS:$(NAME),IP:127.0.0.1,IP:::1"
|
||||
|
||||
cmd/tls.key:
|
||||
openssl req -x509 -newkey rsa:4096 -keyout cmd/tls.key -out cmd/tls.crt -sha256 -days 36500 -nodes -subj "/CN=$(NAME)" --addext "subjectAltName=DNS:$(NAME),IP:127.0.0.1,IP:::1"
|
||||
|
||||
cmd/rsa.key:
|
||||
openssl genrsa -traditional -out cmd/rsa.key 2048
|
||||
|
||||
.PHONY: all clean test
|
Reference in New Issue
Block a user