-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
58 lines (49 loc) · 2.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
SHELL := /bin/bash
ifndef VERBOSE
.SILENT:
endif
# main build target. compiles the teamserver and client
all: ts-build client-build
# teamserver building target
ts-build:
@ echo "[*] building teamserver"
@ cd teamserver; GO111MODULE="on" go build -ldflags="-s -w -X cmd.VersionCommit=$(git rev-parse HEAD)" -o ../havoc main.go
@ sudo setcap 'cap_net_bind_service=+ep' havoc # this allows you to run the server as a regular user
dev-ts-compile:
@ echo "[*] compile teamserver"
@ cd teamserver; GO111MODULE="on" go build -ldflags="-s -w -X cmd.VersionCommit=$(git rev-parse HEAD)" -o ../havoc main.go
ts-cleanup:
@ echo "[*] teamserver cleanup"
@ rm -rf ./teamserver/bin
@ rm -rf ./data/loot
@ rm -rf ./data/x86_64-w64-mingw32-cross
@ rm -rf ./data/havoc.db
@ rm -rf ./data/server.*
@ rm -rf ./teamserver/.idea
@ rm -rf ./havoc
# client building and cleanup targets
client-build:
@ echo "[*] building client"
@ git submodule update --init --recursive
@ mkdir -p client/Build; cd client/Build; cmake ..
@ if [ -d "client/Modules" ]; then echo "Modules installed"; else git clone --recurse-submodules https://github.com/HavocFramework/Modules client/Modules --single-branch --branch `git rev-parse --abbrev-ref HEAD`; fi
@ cmake --build client/Build -- -j 4
client-build-mac:
@ echo "[*] building client"
@ mkdir -p client/Build; cd client/Build; cmake ..
@ if [ -d "client/Modules" ]; then echo "Modules installed"; else git clone --recurse-submodules https://github.com/HavocFramework/Modules client/Modules --single-branch --branch `git rev-parse --abbrev-ref HEAD`; fi
@ rm client/external/toml/toml/exception.hpp ; cp exception_mac.hpp client/external/toml/toml/exception.hpp
@ cmake --build client/Build -- -j 4
client-cleanup:
@ echo "[*] client cleanup"
@ rm -rf ./client/Build
@ rm -rf ./client/Bin/*
@ rm -rf ./client/Data/database.db
@ rm -rf ./client/.idea
@ rm -rf ./client/cmake-build-debug
@ rm -rf ./client/Havoc
@ rm -rf ./client/Modules
# cleanup target
clean: ts-cleanup client-cleanup
@ rm -rf ./data/*.db
@ rm -rf payloads/Demon/.idea