-
Notifications
You must be signed in to change notification settings - Fork 242
/
Makefile
34 lines (28 loc) · 1.02 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
BUILDDATE := $(shell date +%s)
BUILDREV := $(shell git log --pretty=format:'%h' -n 1)
OS := $(shell uname -s| tr '[:upper:]' '[:lower:]')
ARCH := amd64
BINDIR := builds/$(OS)/$(ARCH)
SERVBUILDTAGS := ""
WORKBUILDTAGS := ""
ifdef DEBUG
CFLAGS += -gcflags '-N -l'
endif
build:
mkdir -p builds/
go build -tags "$(WORKBUILDTAGS)" -o $(BINDIR)/gocrack_worker $(CFLAGS) -ldflags \
"-X github.com/mandiant/gocrack/worker.CompileRev=${BUILDREV} \
-X github.com/mandiant/gocrack/worker.CompileTime=${BUILDDATE} \
-X github.com/mandiant/gocrack/worker/engines/hashcat.HashcatVersion=${HASHCAT_VER}" \
cmd/gocrack_worker/*.go
go build -tags "$(SERVBUILDTAGS)" -o $(BINDIR)/gocrack_server $(CFLAGS) -ldflags \
"-X github.com/mandiant/gocrack/server.CompileRev=${BUILDREV} \
-X github.com/mandiant/gocrack/server.CompileTime=${BUILDDATE}" \
cmd/gocrack_server/*.go
static_analysis:
go vet `go list ./...`
test:
go test -cover -v `go list ./...`
clean:
rm -rf builds/
all: static_analysis test build