-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (100 loc) · 3.8 KB
/
Makefile
File metadata and controls
113 lines (100 loc) · 3.8 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
102
103
104
105
106
107
108
109
110
111
112
113
# Master Makefile for Embedded Systems Learning Guide
# Builds all concept modules
.PHONY: all clean help threads mutex condvar semaphores atomic spinlocks rwlock eventfd signals
# Default target - build all modules
all: threads mutex condvar semaphores atomic spinlocks rwlock eventfd signals
@echo ""
@echo "✓ All modules built successfully!"
@echo ""
@echo "To run examples:"
@echo " cd concepts/01_threads && ./01_basic_thread"
@echo " cd concepts/02_mutex && ./01_race_condition"
@echo " cd concepts/03_condition_variables && ./02_condvar_good"
@echo " cd concepts/04_semaphores && ./01_binary_semaphore"
@echo " cd concepts/05_atomic_operations && ./01_atomic_counter"
@echo " cd concepts/06_spinlocks && ./02_atomic_spinlock"
@echo " cd concepts/07_rwlock && ./01_mutex_vs_rwlock"
@echo " cd concepts/08_eventfd && ./01_basic_eventfd"
@echo " cd concepts/09_signals && ./01_basic_signal"
# Build threads module
threads:
@echo "Building threads module..."
@$(MAKE) -C concepts/01_threads
# Build mutex module
mutex:
@echo "Building mutex module..."
@$(MAKE) -C concepts/02_mutex
# Build condition variables module
condvar:
@echo "Building condition variables module..."
@$(MAKE) -C concepts/03_condition_variables
# Build semaphores module
semaphores:
@echo "Building semaphores module..."
@$(MAKE) -C concepts/04_semaphores
# Build atomic operations module
atomic:
@echo "Building atomic operations module..."
@$(MAKE) -C concepts/05_atomic_operations
# Build spinlocks module
spinlocks:
@echo "Building spinlocks module..."
@$(MAKE) -C concepts/06_spinlocks
# Build rwlock module
rwlock:
@echo "Building rwlock module..."
@$(MAKE) -C concepts/07_rwlock
# Build eventfd module
eventfd:
@echo "Building eventfd module..."
@$(MAKE) -C concepts/08_eventfd
# Build signals module
signals:
@echo "Building signals module..."
@$(MAKE) -C concepts/09_signals
# Clean all modules
clean:
@echo "Cleaning all modules..."
@$(MAKE) -C concepts/01_threads clean
@$(MAKE) -C concepts/02_mutex clean
@$(MAKE) -C concepts/03_condition_variables clean
@$(MAKE) -C concepts/04_semaphores clean
@$(MAKE) -C concepts/05_atomic_operations clean
@$(MAKE) -C concepts/06_spinlocks clean
@$(MAKE) -C concepts/07_rwlock clean
@$(MAKE) -C concepts/08_eventfd clean
@$(MAKE) -C concepts/09_signals clean
@echo "✓ All modules cleaned"
# Show help
help:
@echo "Embedded Systems Learning Guide - Master Makefile"
@echo ""
@echo "Available targets:"
@echo " make - Build all modules"
@echo " make threads - Build only threads module"
@echo " make mutex - Build only mutex module"
@echo " make condvar - Build only condition variables module"
@echo " make semaphores - Build only semaphores module"
@echo " make atomic - Build only atomic operations module"
@echo " make spinlocks - Build only spinlocks module"
@echo " make rwlock - Build only rwlock module"
@echo " make eventfd - Build only eventfd module"
@echo " make signals - Build only signals module"
@echo " make clean - Clean all build artifacts"
@echo " make help - Show this help"
@echo ""
@echo "Current modules:"
@echo " ✓ 01_threads - POSIX Threads"
@echo " ✓ 02_mutex - Mutual Exclusion"
@echo " ✓ 03_condition_variables - Efficient Synchronization"
@echo " ✓ 04_semaphores - Resource Management"
@echo " ✓ 05_atomic_operations - Lock-Free Programming"
@echo " ✓ 06_spinlocks - Busy-Wait Synchronization"
@echo " ✓ 07_rwlock - Read-Write Locks"
@echo " ✓ 08_eventfd - Event Notification"
@echo " ✓ 09_signals - Signal Handling"
@echo ""
@echo "To get started:"
@echo " 1. make"
@echo " 2. cd concepts/01_threads"
@echo " 3. ./01_basic_thread"