-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (44 loc) · 1.11 KB
/
Makefile
File metadata and controls
50 lines (44 loc) · 1.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
SUBDIRS := 01-hello-world \
02-char-device-driver \
03-char-dev-multibuf \
04-char-dev-ioctl \
05-char-dev-auto-node \
06-char-dev-blocking \
07-char-dev-poll \
08-block-dev-ramdisk-basic \
09-platform-driver \
10-platform-instance
all:
@for dir in $(SUBDIRS); do \
echo "Building $$dir..."; \
$(MAKE) -C $$dir || exit 1; \
done
clean:
@for dir in $(SUBDIRS); do \
echo "Cleaning $$dir..."; \
$(MAKE) -C $$dir clean; \
done
example:
@if [ -z "$(ex)" ]; then \
echo "Usage: make example ex=01-hello-world"; \
exit 1; \
fi
$(MAKE) -C $(ex)
clean-example:
@if [ -z "$(ex)" ]; then \
echo "Usage: make clean-example ex=01-hello-world"; \
exit 1; \
fi
$(MAKE) -C $(ex) clean
help:
@echo "Available targets:"
@echo " make all - Build all examples"
@echo " make clean - Clean all examples"
@echo " make example ex=DIR - Build specific example"
@echo " make clean-example ex=DIR - Clean specific example"
@echo ""
@echo "Available examples:"
@for dir in $(SUBDIRS); do \
echo " - $$dir"; \
done
.PHONY: all clean example clean-example help