forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (48 loc) · 1.51 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
56
57
all: build
test:
go test ./...
# Add some build time constants to make sure the binary knows about itself.
COMMIT := $(shell git rev-parse HEAD)
DATE := $(shell date -Iseconds)
LDFLAGS := \
-s -w \
-X www.velocidex.com/golang/velociraptor/config.build_time=$(DATE) \
-X www.velocidex.com/golang/velociraptor/config.commit_hash=$(COMMIT)
# Devel tag means we read everything from the local filesystem. We
# assume the devel binary is run from the source tree.
# Just regular binaries for local testing. The GUI will be serving
# files from the filesystem.
build:
GOOS=linux GOARCH=amd64 \
go build \
-tags devel \
-ldflags "$(LDFLAGS)" \
-o output/velociraptor ./bin/
windows:
fileb0x artifacts/b0x.yaml
GOOS=windows GOARCH=amd64 \
go build \
-ldflags "$(LDFLAGS)" \
-o output/velociraptor.exe ./bin/
darwin:
fileb0x gui/b0x.yaml artifacts/b0x.yaml
GOOS=darwin GOARCH=amd64 \
go build \
-tags release \
-ldflags "$(LDFLAGS)" \
-o output/velociraptor.darwin ./bin/
# Build release binaries. The GUI will embed assets and ship with
# everything in it.
release:
fileb0x gui/b0x.yaml artifacts/b0x.yaml
GOOS=linux GOARCH=amd64 \
go build \
-ldflags "$(LDFLAGS)" \
-tags release \
-o output/velociraptor ./bin/
strip output/velociraptor
install: release
install -D output/velociraptor \
$(DESTDIR)$(prefix)/usr/bin/velociraptor
clean:
rm -f gui/assets/ab0x.go