-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.23 KB
/
Copy pathMakefile
File metadata and controls
58 lines (46 loc) · 1.23 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
# Compiler
CXX = g++
# Compiler flags
CXXFLAGS = -std=c++23 -Wall -Wextra -Icommon -Iprotocol
# Output directory
BIN = exe
# Common source files
SERVER_SRC = src/server.cpp
AGENT_SRC = src/agent.cpp src/PersistentShell.cpp
# Standalone local demo (not linked into agent or server)
DEMO_SRC = src/process_demo.cpp src/PersistentShell.cpp
DEMO = $(BIN)/process_demo
# Targets
SERVER = $(BIN)/server_main
AGENT = $(BIN)/agent_main
all: $(SERVER) $(AGENT)
# -----------------------
# Server
# -----------------------
$(SERVER): server_main.cpp $(SERVER_SRC)
@mkdir -p $(BIN)
$(CXX) $(CXXFLAGS) server_main.cpp $(SERVER_SRC) -o $(SERVER)
# -----------------------
# Agent
# -----------------------
$(AGENT): agent_main.cpp $(AGENT_SRC)
@mkdir -p $(BIN)
$(CXX) $(CXXFLAGS) agent_main.cpp $(AGENT_SRC) -o $(AGENT)
# -----------------------
# Standalone process demo
# (local POSIX test only — no networking)
# -----------------------
demo: $(DEMO)
$(DEMO): $(DEMO_SRC)
@mkdir -p $(BIN)
$(CXX) $(CXXFLAGS) $(DEMO_SRC) -o $(DEMO)
# -----------------------
# Clean
# -----------------------
clean:
rm -f $(SERVER) $(AGENT) $(DEMO)
# -----------------------
# Rebuild
# -----------------------
rebuild: clean all
.PHONY: all demo clean rebuild