-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (25 loc) · 750 Bytes
/
Makefile
File metadata and controls
28 lines (25 loc) · 750 Bytes
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
EXAMPLES_DIR := examples/*_examples
EXAMPLE_DIRS := $(wildcard $(EXAMPLES_DIR)/*)
OUTPUTS :=
.PHONY: all clean
all:
@echo "Building all examples..."
@for dir in $(EXAMPLE_DIRS); do \
if [ -f $$dir/Makefile ]; then \
echo "→ Building example in $$dir..."; \
$(MAKE) -C $$dir || exit 1; \
fi \
done
@echo ""
@echo "---------------------------------------"
@for dir in $(EXAMPLE_DIRS); do \
if [ -f $$dir/Makefile ]; then \
binary=$$(grep OUTPUT $$dir/Makefile | head -n1 | cut -d= -f2 | tr -d ' '); \
if [ -n "$$binary" ] && [ -f $$dir/$$binary ]; then \
echo "✔ Built $$binary in $$dir"; \
fi \
fi \
done
@echo ""
@echo "✅ All examples built successfully!"
@echo "---------------------------------------"