-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (21 loc) · 695 Bytes
/
Makefile
File metadata and controls
30 lines (21 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
BIN_FILE=iptables-server
SRCS=./
# git commit hash
COMMIT_HASH=$(shell git rev-parse --short HEAD || echo "GitNotFound")
# git tag
# VERSION_TAG=$(shell git describe --tags `git rev-list --tags --max-count=1`)
# 编译日期
BUILD_DATE=$(shell date '+%Y-%m-%d %H:%M:%S')
# 编译条件
CFLAGS = -ldflags "-s -w -X \"main.BuildVersion=${COMMIT_HASH}\" -X \"main.BuildDate=$(BUILD_DATE)\""
# CFLAGS = -ldflags "-s -w -X \"main.BuildDate=$(BUILD_DATE)\""
GOPROXY=https://goproxy.cn,direct
release:
go build $(CFLAGS) -o $(BIN_FILE) $(SRCS)
run:
go run main.go
images:
docker build -t pretty66/iptables-web:1.1.2 -t pretty66/iptables-web:latest .
# docker push
clean:
rm -f $(BIN_FILE)