commit 58d1edd3d722b89b325bee5ef3c2994ec6b8dac2
parent f9f434747f348c70f60f06fddab5de2e02616a8c
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 18 Mar 2017 01:19:40 +0100
[libc] Fix Makefiles until POSIX supports -include
Diffstat:
5 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/libc/src/Makefile b/libc/src/Makefile
@@ -6,7 +6,8 @@ include ../../config.mk
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 @@ all.start: libc.a
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 @@ libc.a: $(SYSINC) $(OBJ)
ranlib $@
$(LIBCSYSOBJ):
- cd $(SYSDIR) && $(MAKE) -e
+ cd $(SYSDIR) && $(MAKE)
diff --git a/libc/src/sys/amd64-sysv-linux/Makefile b/libc/src/sys/amd64-sysv-linux/Makefile
@@ -2,8 +2,11 @@
.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 @@ clean.start:
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 =' \
diff --git a/libc/src/sys/i386-sysv-linux/Makefile b/libc/src/sys/i386-sysv-linux/Makefile
@@ -2,8 +2,11 @@
.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 @@ clean.start:
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 =' \
diff --git a/libc/src/sys/qbe-linux/Makefile b/libc/src/sys/qbe-linux/Makefile
@@ -2,8 +2,11 @@
.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 @@ clean.start:
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 =' \
diff --git a/libc/src/sys/z80-linux/Makefile b/libc/src/sys/z80-linux/Makefile
@@ -2,8 +2,11 @@
.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 @@ clean.start:
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 =' \