-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (82 loc) · 2.44 KB
/
Copy pathMakefile
File metadata and controls
101 lines (82 loc) · 2.44 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
.PHONY: all build run dev clean docker-build docker-up docker-down build-bofs
# Default target
all: build
# Build everything (backend, frontend)
build: build-backend build-frontend
# Build backend
build-backend:
cd backend && go build -o ../bin/server ./cmd/server
# Build frontend
build-frontend:
cd frontend && npm install && npm run build
# Build implant payload
build-implant:
cd implant && zig build -Doptimize=ReleaseSmall
# Build stager payload
build-stager:
cd stager && zig build -Doptimize=ReleaseSmall
# Build BOF files
build-bofs:
cd libs/bofs-src && zig build
mkdir -p backend/bofs
cp libs/bofs-src/zig-out/bin/*.o backend/bofs/
cp libs/bofs-src/zig-out/bof-collection.yaml backend/bofs/
# Run backend in development mode
run-backend:
cd backend && go run ./cmd/server
# Run frontend in development mode
run-frontend:
cd frontend && npm run dev
# Run both in development mode (requires tmux or separate terminals)
dev:
@echo "Run 'make run-backend' and 'make run-frontend' in separate terminals"
# Clean build artifacts
clean:
rm -rf bin/
rm -rf frontend/dist/
rm -rf frontend/node_modules/
rm -rf backend/data/
rm -rf backend/bofs/
rm -rf implant/zig-out/
rm -rf implant/.zig-cache/
rm -rf stager/zig-out/
rm -rf stager/.zig-cache/
rm -rf libs/bofs-src/zig-out/
rm -rf libs/bofs-src/.zig-cache/
# Docker commands
docker-build:
docker-compose build
docker-up:
docker-compose up -d
docker-down:
docker-compose down
docker-logs:
docker-compose logs -f
# Initialize development environment
init:
cd backend && go mod tidy
cd frontend && npm install
# Run tests
test:
cd backend && go test ./...
# Format code
fmt:
cd backend && go fmt ./...
# Help
help:
@echo "Available targets:"
@echo " build - Build backend and frontend"
@echo " build-backend - Build Go backend"
@echo " build-frontend - Build React frontend"
@echo " build-implant - Build implant payload"
@echo " build-stager - Build stager payload"
@echo " build-bofs - Build BOF files"
@echo " run-backend - Run backend in development mode"
@echo " run-frontend - Run frontend in development mode"
@echo " clean - Clean build artifacts"
@echo " docker-build - Build Docker images"
@echo " docker-up - Start Docker containers"
@echo " docker-down - Stop Docker containers"
@echo " init - Initialize development environment"
@echo " test - Run tests"
@echo " fmt - Format code"