commit a2be6ce9aeb1425066673636daa5867aef798b2c
parent 3b02f6f7e8ed2945ec611b256702c8640ba0bc58
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sat, 18 Jan 2020 21:47:04 +0100
libc: Fix multi-conf generation
Depending of libc.lst is not a good idea because it is
modified by every Makefile. It is much better to depend
only of libc.a.
Diffstat:
19 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/src/libc/Makefile b/src/libc/Makefile
@@ -15,10 +15,8 @@ DIRS =\
all: $(LIBC)
-$(LIBC): $(LIBCLST)
- mklib -o $@ `cat $(LIBCLST)`
-
-$(LIBCLST): $(DIRS)
+$(LIBC): $(DIRS)
+ mklib -o $@ `cat $(LIBCLST)`;\
$(DIRS): rm-lst
+@cd $@ && $(MAKE)
diff --git a/src/libc/arch/amd64/Makefile b/src/libc/arch/amd64/Makefile
@@ -8,7 +8,7 @@ DIRS = netbsd openbsd dragonfly linux darwin
all: $(LIBC) $(SYS)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
$(SYS): FORCE
diff --git a/src/libc/arch/amd64/darwin/Makefile b/src/libc/arch/amd64/darwin/Makefile
@@ -30,7 +30,7 @@ OBJS =\
all: $(LIBC) $(CRT)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
crt.$O: ../crt-posix.s
diff --git a/src/libc/arch/amd64/dragonfly/Makefile b/src/libc/arch/amd64/dragonfly/Makefile
@@ -31,7 +31,7 @@ OBJS =\
all: $(LIBC) $(CRT)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
crt.$O: ../crt-posix.s
diff --git a/src/libc/arch/amd64/linux/Makefile b/src/libc/arch/amd64/linux/Makefile
@@ -32,7 +32,7 @@ OBJS = \
all: $(LIBC) $(CRT)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
crt.$O: ../crt-posix.s
diff --git a/src/libc/arch/amd64/netbsd/Makefile b/src/libc/arch/amd64/netbsd/Makefile
@@ -31,7 +31,7 @@ OBJS =\
all: $(LIBC) $(CRT)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
crt.$O: ../crt-posix.s ../../crt-netbsd.s
diff --git a/src/libc/arch/amd64/openbsd/Makefile b/src/libc/arch/amd64/openbsd/Makefile
@@ -29,7 +29,7 @@ OBJS =\
all: $(LIBC) $(CRT)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
crt.$O: ../crt-posix.s ../../crt-openbsd.s
diff --git a/src/libc/arch/arm32/Makefile b/src/libc/arch/arm32/Makefile
@@ -8,7 +8,7 @@ DIRS = linux
all: $(LIBC) $(SYS)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
$(SYS): FORCE
diff --git a/src/libc/arch/arm32/linux/Makefile b/src/libc/arch/arm32/linux/Makefile
@@ -31,7 +31,7 @@ OBJS =\
all: $(LIBC) $(CRT)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
crt.o: ../crt-posix.s
diff --git a/src/libc/arch/arm64/Makefile b/src/libc/arch/arm64/Makefile
@@ -8,7 +8,7 @@ DIRS = linux
all: $(LIBC) $(SYS)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
$(SYS): FORCE
diff --git a/src/libc/arch/arm64/linux/Makefile b/src/libc/arch/arm64/linux/Makefile
@@ -3,38 +3,42 @@ PROJECTDIR =../../../../..
include $(PROJECTDIR)/scripts/rules.mk
include ../../../rules.mk
-OBJS = _Exit.o \
- _close.o \
- _brk.o \
- _getpid.o \
- _kill.o \
- _lseek.o \
- _openat.o \
- _read.o \
- _write.o \
- _getheap.o \
- _cerrno.o \
- _open.o \
- _sigaction.o \
- _tzone.o \
- getenv.o \
- raise.o \
- signal.o \
- time.o \
- _sys_errlist.o \
- crt.o \
-
-all: syscall
- $(MAKE) objs
-
-objs: $(OBJS)
-
-crt.o: ../crt-posix.s
-
-syscall: syscall.lst
- gensys.sh syscall.lst
- touch syscall
+GENOBJS =\
+ _Exit.$O\
+ _close.$O\
+ _brk.$O\
+ _getpid.$O\
+ _kill.$O\
+ _lseek.$O\
+ _openat.$O\
+ _read.$O\
+ _write.$O\
+ _sigaction.$O\
+
+GENSRC = $(GENOBJS:.$O=.s)
+
+OBJS =\
+ $(GENOBJS)\
+ getenv.$O\
+ raise.$O\
+ signal.$O\
+ time.$O\
+ _tzone.$O\
+ _open.$O\
+ _getheap.$O\
+ _cerrno.$O\
+ _sys_errlist.$O\
+
+all: $(LIBC) $(CRT)
+
+$(LIBC): $(OBJS)
+ $(MKLST)
+
+crt.$O: ../crt-posix.s
+
+%(GENSRC): syscall.lst
+ gensys.sh $(@:.s=)
clean:
- rm -f `awk '/[0-9]* _/ {print $$2".s"}' syscall.lst`
+ rm -f $(GENSRC)
rm -f syscall _sys_errlist.c
diff --git a/src/libc/arch/i386/Makefile b/src/libc/arch/i386/Makefile
@@ -8,7 +8,7 @@ DIRS = linux
all: $(LIBC) $(SYS)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
$(SYS): FORCE
diff --git a/src/libc/arch/i386/linux/Makefile b/src/libc/arch/i386/linux/Makefile
@@ -30,7 +30,7 @@ all: $(LIBC) $(CRT)
$(LIBCLST): $(OBJS)
$(MKLST)
-crt.o: ../crt-posix.s
+crt.$O: ../crt-posix.s
$(GENSRC): syscall.lst
gensys.sh $(@:.s=)
diff --git a/src/libc/assert/Makefile b/src/libc/assert/Makefile
@@ -9,7 +9,7 @@ OBJS =\
all: $(LIBC)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
dep: inc-dep
diff --git a/src/libc/locale/Makefile b/src/libc/locale/Makefile
@@ -9,7 +9,7 @@ OBJS =\
all: $(LIBC)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
dep: inc-dep
diff --git a/src/libc/rules.mk b/src/libc/rules.mk
@@ -22,8 +22,6 @@ MKLST = \
_sys_errlist.c: $(SYSERRNO)
../../mkerrstr $(SYSERRNO)
-$(LIBC): $(LIBCLST)
-
$(CRT): crt.$O
cp crt.$O $@
diff --git a/src/libc/stdio/Makefile b/src/libc/stdio/Makefile
@@ -46,7 +46,7 @@ OBJS =\
all: $(LIBC)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
dep: inc-dep
diff --git a/src/libc/stdlib/Makefile b/src/libc/stdlib/Makefile
@@ -28,7 +28,7 @@ OBJS =\
all: $(LIBC)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
dep: inc-dep
diff --git a/src/libc/string/Makefile b/src/libc/string/Makefile
@@ -30,7 +30,7 @@ OBJS = \
all: $(LIBC)
-$(LIBCLST): $(OBJS)
+$(LIBC): $(OBJS)
$(MKLST)
dep: inc-dep