generated from Esonhugh/go-cli-template-v2
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
34 lines (27 loc) · 1.05 KB
/
Makefile
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
31
32
33
34
BUILD_PLUGIN_DIR = bin/plugins
BUILD_DIR = bin
MAIN_PROGRAM_NAME = k8spider
default: build build-static check-size
# build
build:
go build -o $(BUILD_DIR)/$(MAIN_PROGRAM_NAME) main.go
test: build
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) all --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) axfr --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) dns --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) dnssd --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) dnssd ptr --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) dnssd srv --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) metric --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) neighbor --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) neighbor pod --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) neighbor svc --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) whereisdns --help
$(BUILD_DIR)/$(MAIN_PROGRAM_NAME) wild --help
build-static:
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o $(BUILD_DIR)/$(MAIN_PROGRAM_NAME)-linux-static main.go
upx --lzma --brute $(BUILD_DIR)/$(MAIN_PROGRAM_NAME)-linux-static
check-size:
ls -alh $(BUILD_DIR)/$(MAIN_PROGRAM_NAME)*
clean:
rm -rf $(BUILD_DIR)