-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
55 lines (46 loc) · 1.1 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
CURRENT_REVISION = $(shell git rev-parse --short HEAD)
BUILD_LDFLAGS = "-s -w -X github.com/akiym/akitools/cli.revision=$(CURRENT_REVISION)"
GOBIN ?= $(shell go env GOPATH)/bin
COMMANDS = \
binary2png \
command-wrapper \
d \
gadgets \
gistwrapper \
git-branch-recent \
jwt \
libc-offsets \
noln \
o \
random_string \
rotn \
shellcode \
tobin \
tohex
.PHONY: build
build: bin $(COMMANDS)
.PHONY: bin
bin:
GOOS=darwin GOARCH=arm64 go build -ldflags=$(BUILD_LDFLAGS) -o bin/darwin-arm64/akitools
GOOS=darwin GOARCH=amd64 go build -ldflags=$(BUILD_LDFLAGS) -o bin/darwin-amd64/akitools
GOOS=linux GOARCH=amd64 go build -ldflags=$(BUILD_LDFLAGS) -o bin/linux-amd64/akitools
.PHONY: $(COMMANDS)
$(COMMANDS):
ln -sf akitools bin/darwin-arm64/$@
ln -sf akitools bin/darwin-amd64/$@
ln -sf akitools bin/linux-amd64/$@
.PHONY: clean
clean:
rm -rf bin/*
.PHONY: install
install:
go install -ldflags=$(BUILD_LDFLAGS)
.PHONY: test
test:
go test -v -race ./...
.PHONY: lint
lint: $(GOBIN)/staticcheck
go vet ./...
staticcheck ./...
$(GOBIN)/staticcheck:
go install honnef.co/go/tools/cmd/staticcheck@latest