aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2025-10-02 15:44:30 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2025-10-02 15:48:04 +0200
commit9be656dfed53783036c7ae1edae04060b451d6df (patch)
tree7e53f32d47d304ded736b733dff4b8cb2697c1eb
parenta13b91d64c96670caff1ea9830b7e4a90ad81eaa (diff)
examples/Makefile: Increase flexibility
The former implementation required redundant code for every new directory.
-rw-r--r--examples/Makefile21
1 files changed, 9 insertions, 12 deletions
diff --git a/examples/Makefile b/examples/Makefile
index 6d99b4f..e6030ac 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -1,22 +1,19 @@
.POSIX:
-all: \
+DIRS = \
+ form \
headers \
hello \
html \
put
-clean:
- +cd hello && $(MAKE) clean
- +cd html && $(MAKE) clean
+all: FORCE
+ +for d in $(DIRS); do (cd $$d && $(MAKE)); done
-FORCE:
-
-headers: FORCE
- +cd headers && $(MAKE)
+clean: FORCE
+ +for d in $(DIRS); do (cd $$d && $(MAKE) clean); done
-hello: FORCE
- +cd hello && $(MAKE)
+$(DIRS): FORCE
+ +cd $@ && $(MAKE)
-html: FORCE
- +cd html && $(MAKE)
+FORCE: