shithub: scc

Download patch

ref: eb8459e384b8d2597f51e944c4cfff40480c9fff
parent: 2e89286f4ee1ef53e3acb6e4ef4b43909e9fc9e8
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Dec 11 09:45:26 EST 2017

Move FORALL to config.mk.def

It makes easier to reuse it in other Makefiles instead of
copying it everywhere.

--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,10 @@
 # scc - Suckless C Compiler
+
+include config.mk.def
+
 .POSIX:
 
 DIRS  = inc cc1 cc2 driver lib as ar nm objdump
-
-FORALL = @set -e ;\
-	pwd=$$PWD; \
-	for i in $(DIRS); \
-	do \
-		cd $$i; \
-		$(MAKE) $@; \
-		cd $$pwd; \
-	done
 
 all:
 	$(FORALL)
--- a/config.mk.def
+++ b/config.mk.def
@@ -47,4 +47,14 @@
 .c:
 	$(CC) $(SCC_CFLAGS) $(SCC_LDFLAGS) -o $@ $<
 
+# helper macro to run over all the directories
+FORALL = @set -e ;\
+	pwd=$$PWD; \
+	for i in $(DIRS); \
+	do \
+		cd $$i; \
+		$(MAKE) $@; \
+		cd $$pwd; \
+	done
+
 # system specific flags