shithub: scc

Download patch

ref: 7f2fdc6dcd531ba10f96d9d70e7612ce9e8330bd
parent: 4f9f652f766f4ba4854889a45f1940737f3856c7
author: Quentin Rameau <quinq@fifth.space>
date: Fri Mar 17 21:19:40 EDT 2017

[libc] Fix Makefiles until POSIX supports -include

--- a/libc/src/Makefile
+++ b/libc/src/Makefile
@@ -6,7 +6,8 @@
 SYSDIR = sys/$(ARCH)-$(SYS)
 SYSINC = $(SYSDIR)/system.mk
 
--include $(SYSINC)
+SYSINCLUDE = /dev/null
+include $(SYSINCLUDE)
 
 LIBCOBJ = assert.o strcpy.o strcmp.o strlen.o strchr.o \
           strrchr.o strcat.o strncmp.o strncpy.o strncat.o strcoll.o \
@@ -27,10 +28,10 @@
 clean: clean.bootstrap
 clean.start:
 	rm -f *.o libc.a
-	cd $(SYSDIR) && $(MAKE) -e clean
+	cd $(SYSDIR) && $(MAKE) clean
 
 all.bootstrap clean.bootstrap: $(SYSINC)
-	$(MAKE) -e $(@:%.bootstrap=%.start)
+	$(MAKE) -e SYSINCLUDE="$(SYSINC)" $(@:%.bootstrap=%.start)
 
 $(SYSINC): $(SYSDIR)/Makefile $(SYSDIR)/syscall.lst
 	cd $(SYSDIR) && $(MAKE) -e system.mk
@@ -40,4 +41,4 @@
 	ranlib $@
 
 $(LIBCSYSOBJ):
-	cd $(SYSDIR) && $(MAKE) -e
+	cd $(SYSDIR) && $(MAKE)
--- a/libc/src/sys/amd64-sysv-linux/Makefile
+++ b/libc/src/sys/amd64-sysv-linux/Makefile
@@ -2,9 +2,12 @@
 .POSIX:
 
 include ../../../../config.mk
--include system.mk
--include sysgen.mk
 
+SYSTEMINC = /dev/null
+include $(SYSTEMINC)
+SYSGENINC = /dev/null
+include $(SYSGENINC)
+
 GENASM = $(GENOBJ:.o=.s)
 OBJ =
 
@@ -16,7 +19,8 @@
 	rm -f *.o $(GENASM) system.mk sysgen.mk
 
 all.bootstrap clean.bootstrap: system.mk sysgen.mk
-	$(MAKE) -e $(@:%.bootstrap=%.start)
+	$(MAKE) -e SYSTEMINC=system.mk SYSGENINC=sysgen.mk \
+	        $(@:%.bootstrap=%.start)
 
 system.mk: Makefile syscall.lst
 	printf '%s ' 'SYSOBJ =' \
--- a/libc/src/sys/i386-sysv-linux/Makefile
+++ b/libc/src/sys/i386-sysv-linux/Makefile
@@ -2,9 +2,12 @@
 .POSIX:
 
 include ../../../../config.mk
--include system.mk
--include sysgen.mk
 
+SYSTEMINC = /dev/null
+include $(SYSTEMINC)
+SYSGENINC = /dev/null
+include $(SYSGENINC)
+
 GENASM = $(GENOBJ:.o=.s)
 OBJ =
 
@@ -16,7 +19,8 @@
 	rm -f *.o $(GENASM) system.mk sysgen.mk
 
 all.bootstrap clean.bootstrap: system.mk sysgen.mk
-	$(MAKE) -e $(@:%.bootstrap=%.start)
+	$(MAKE) -e SYSTEMINC=system.mk SYSGENINC=sysgen.mk \
+	        $(@:%.bootstrap=%.start)
 
 system.mk: Makefile syscall.lst
 	printf '%s ' 'SYSOBJ =' \
--- a/libc/src/sys/qbe-linux/Makefile
+++ b/libc/src/sys/qbe-linux/Makefile
@@ -2,9 +2,12 @@
 .POSIX:
 
 include ../../../../config.mk
--include system.mk
--include sysgen.mk
 
+SYSTEMINC = /dev/null
+include $(SYSTEMINC)
+SYSGENINC = /dev/null
+include $(SYSGENINC)
+
 GENASM = $(GENOBJ:.o=.s)
 OBJ =
 
@@ -16,7 +19,8 @@
 	rm -f *.o $(GENASM) system.mk sysgen.mk
 
 all.bootstrap clean.bootstrap: system.mk sysgen.mk
-	$(MAKE) -e $(@:%.bootstrap=%.start)
+	$(MAKE) -e SYSTEMINC=system.mk SYSGENINC=sysgen.mk \
+	        $(@:%.bootstrap=%.start)
 
 system.mk: Makefile syscall.lst
 	printf '%s ' 'SYSOBJ =' \
--- a/libc/src/sys/z80-linux/Makefile
+++ b/libc/src/sys/z80-linux/Makefile
@@ -2,9 +2,12 @@
 .POSIX:
 
 include ../../../../config.mk
--include system.mk
--include sysgen.mk
 
+SYSTEMINC = /dev/null
+include $(SYSTEMINC)
+SYSGENINC = /dev/null
+include $(SYSGENINC)
+
 GENASM = $(GENOBJ:.o=.s)
 OBJ =
 
@@ -16,7 +19,8 @@
 	rm -f *.o $(GENASM) system.mk sysgen.mk
 
 all.bootstrap clean.bootstrap: system.mk sysgen.mk
-	$(MAKE) -e $(@:%.bootstrap=%.start)
+	$(MAKE) -e SYSTEMINC=system.mk SYSGENINC=sysgen.mk \
+	        $(@:%.bootstrap=%.start)
 
 system.mk: Makefile syscall.lst
 	printf '%s ' 'SYSOBJ =' \