forked from botherder/pcqf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (45 loc) · 1.74 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
58
59
60
BUILD_FOLDER = $(shell pwd)/build
ASSETS_FOLDER = $(shell pwd)/assets
FLAGS_DARWIN = GOOS=darwin
FLAGS_WINDOWS = GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc CGO_ENABLED=1
WINPMEM_URL = https://github.com/google/rekall/releases/download/v1.5.1/winpmem-2.1.post4.exe
OSXPMEM_URL = https://github.com/google/rekall/releases/download/v1.5.1/osxpmem-2.1.post4.zip
lint:
@echo "[lint] Running linter on codebase"
@golint ./...
deps:
@echo "[deps] Installing dependencies..."
go mod download
go get github.com/akavel/rsrc
go get -u github.com/jteeuwen/go-bindata/...
@echo "[deps] Dependencies installed."
darwin:
@mkdir -p $(BUILD_FOLDER)/darwin
@mkdir -p $(ASSETS_FOLDER)
@if [ ! -f $(ASSETS_FOLDER)/osxpmem.zip ]; then \
echo "[builder] Downloading OSXPmem"; \
wget $(OSXPMEM_URL) -O $(ASSETS_FOLDER)/osxpmem.zip; \
fi
@echo "[builder] Preparing assets"
@go-bindata -prefix $(ASSETS_FOLDER) $(ASSETS_FOLDER)/
@echo "[builder] Building Darwin executable"
@go build --ldflags '-s -w' -o $(BUILD_FOLDER)/darwin/snoopdigg
@echo "[builder] Done!"
windows:
@mkdir -p $(BUILD_FOLDER)/windows
@mkdir -p $(ASSETS_FOLDER)
@if [ ! -f $(ASSETS_FOLDER)/winpmem.exe ]; then \
echo "[builder] Downloading WinPmem"; \
wget $(WINPMEM_URL) -O $(ASSETS_FOLDER)/winpmem.exe; \
fi
@echo "[builder] Preparing assets"
@go-bindata -prefix $(ASSETS_FOLDER) $(ASSETS_FOLDER)/
@rsrc -manifest snoopdigg.manifest -ico snoopdigg.ico -o rsrc.syso
@echo "[builder] Building Windows executable"
@$(FLAGS_WINDOWS) go build --ldflags '-s -w -extldflags "-static"' -o $(BUILD_FOLDER)/windows/snoopdigg.exe
@echo "[builder] Done!"
clean:
rm -f bindata.go
rm -f rsrc.syso
rm -rf $(ASSETS_FOLDER)
rm -rf $(BUILD_FOLDER)