Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (85 loc) Β· 3.11 KB
/
Copy pathMakefile
File metadata and controls
98 lines (85 loc) Β· 3.11 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
# Event Reservation Platform - Global Makefile
# Redes de Computadores 2025/2026
# LEIC Alameda
.PHONY: all client server clean clean-client clean-server run-server run-client help rebuild test
# Default target: build both client and server
all: client server
# Build client application
client:
@echo "========================================"
@echo "Building Client (User Application)..."
@echo "========================================"
@$(MAKE) -C client
@echo ""
# Build server application
server:
@echo "========================================"
@echo "Building Server (ES)..."
@echo "========================================"
@$(MAKE) -C server
@echo ""
# Clean all build artifacts
clean: clean-client clean-server
@echo "========================================"
@echo "Global clean complete"
@echo "========================================"
# Clean client build artifacts
clean-client:
@echo "Cleaning client..."
@$(MAKE) -C client clean
# Clean server build artifacts
clean-server:
@echo "Cleaning server..."
@$(MAKE) -C server clean
# Rebuild everything
rebuild: clean all
# Run server (default port 58053)
run-server: server
@echo "========================================"
@echo "Starting Event Server (ES)..."
@echo "========================================"
@cd server && ./ES -v
# Run client (connects to localhost:58053)
run-client: client
@echo "========================================"
@echo "Starting User Application..."
@echo "========================================"
@cd client && ./user
# Run server in background
server-bg: server
@echo "Starting Event Server in background..."
@cd server && ./ES -v &
@echo "Server started (PID: $$!)"
# Test: build both and run basic checks
test: all
@echo "========================================"
@echo "Running basic checks..."
@echo "========================================"
@test -f server/ES && echo "β Server executable exists" || echo "β Server build failed"
@test -f client/user && echo "β Client executable exists" || echo "β Client build failed"
@echo ""
# Display help information
help:
@echo "Event Reservation Platform - Makefile"
@echo "======================================"
@echo ""
@echo "Available targets:"
@echo " all - Build both client and server (default)"
@echo " client - Build only the client application"
@echo " server - Build only the server application"
@echo " clean - Remove all build artifacts"
@echo " clean-client - Remove only client build artifacts"
@echo " clean-server - Remove only server build artifacts"
@echo " rebuild - Clean and rebuild everything"
@echo " run-server - Build and run the server in verbose mode"
@echo " run-client - Build and run the client"
@echo " server-bg - Build and run server in background"
@echo " test - Build and verify executables"
@echo " help - Display this help message"
@echo ""
@echo "Examples:"
@echo " make # Build everything"
@echo " make clean # Clean all builds"
@echo " make run-server # Start the server"
@echo " make run-client # Start the client"
@echo ""