ref: 768a2298d7afc53236e8e162043ff81fbaae68a4
parent: 73b180769110ca05065017952173233ad8bb1c34
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Jan 18 13:40:27 EST 2020
deps: Update dependencies Libc didn't have support for automatic generation of dependencies. This patch adds it and it also updates the dependencies files.
--- a/scripts/mkdep
+++ b/scripts/mkdep
@@ -2,7 +2,8 @@
set -e
-(echo '/^#deps/+;$c'
+(echo '/^#deps/;$c'
+echo '#deps'
for i in `find . -name '*.c'`
do
--- a/src/cmd/as/deps.mk
+++ b/src/cmd/as/deps.mk
@@ -13,6 +13,7 @@
./symbol.o: ./as.h
./target/powerpc/ins.o: $(INCDIR)/scc/scc/scc.h
./target/powerpc/ins.o: ./target/powerpc/../../as.h
+./target/powerpc/ins.o: ./target/powerpc/proc.h
./target/powerpc/powerpc.o: $(INCDIR)/scc/scc/scc.h
./target/powerpc/powerpc.o: ./target/powerpc/../../as.h
./target/powerpc/powerpc.o: ./target/powerpc/proc.h
--- a/src/cmd/deps.mk
+++ b/src/cmd/deps.mk
@@ -14,6 +14,7 @@
./ranlib.o: $(INCDIR)/scc/scc/mach.h
./ranlib.o: $(INCDIR)/scc/scc/scc.h
./ranlib.o: ./sys.h
+./size.o: $(INCDIR)/scc/scc/ar.h
./size.o: $(INCDIR)/scc/scc/arg.h
./size.o: $(INCDIR)/scc/scc/mach.h
./strip.o: $(INCDIR)/scc/scc/arg.h
--- a/src/cmd/ld/deps.mk
+++ b/src/cmd/ld/deps.mk
@@ -1,4 +1,5 @@
#deps
+./main.o: $(INCDIR)/scc/scc/mach.h
./main.o: ./ld.h
./pass1.o: $(INCDIR)/scc/scc/ar.h
./pass1.o: $(INCDIR)/scc/scc/mach.h
@@ -12,6 +13,9 @@
./pass4.o: ./ld.h
./pass5.o: $(INCDIR)/scc/scc/mach.h
./pass5.o: ./ld.h
+./section.o: $(INCDIR)/scc/scc/mach.h
+./section.o: $(INCDIR)/scc/scc/scc.h
+./section.o: ./ld.h
./symbol.o: $(INCDIR)/scc/scc/mach.h
./symbol.o: $(INCDIR)/scc/scc/scc.h
./symbol.o: ./ld.h
--- a/src/libc/Makefile
+++ b/src/libc/Makefile
@@ -26,5 +26,8 @@
rm-lst: FORCE
rm -f $(LIBCLST)
+dep:
+ $(FORALL)
+
clean: rm-lst
$(FORALL)
--- a/src/libc/arch/Makefile
+++ b/src/libc/arch/Makefile
@@ -8,5 +8,5 @@
all:
+@cd $(ARCH) && $(MAKE)
-clean:
+dep clean:
$(FORALL)
--- a/src/libc/arch/amd64/Makefile
+++ b/src/libc/arch/amd64/Makefile
@@ -14,5 +14,5 @@
$(SYS): FORCE
+@cd $@ && $(MAKE)
-clean:
+dep clean:
$(FORALL)
--- a/src/libc/arch/amd64/darwin/Makefile
+++ b/src/libc/arch/amd64/darwin/Makefile
@@ -38,6 +38,10 @@
$(GENSRC): syscall.lst
gensys.sh $*
+dep: inc-dep
+
clean:
rm -f $(GENSRC)
rm -f syscall _sys_errlist.c
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/amd64/darwin/deps.mk
@@ -1,0 +1,6 @@
+#deps
+./_tzone.o: ./../../posix/_tzone.c
+./getenv.o: ./../../posix/getenv.c
+./raise.o: ./../../posix/raise.c
+./signal.o: ./../../posix/signal.c
+./time.o: ./../../posix/time.c
--- a/src/libc/arch/amd64/dragonfly/Makefile
+++ b/src/libc/arch/amd64/dragonfly/Makefile
@@ -39,6 +39,10 @@
$(GENSRC): syscall.lst
gensys.sh $*
+dep: inc-dep
+
clean:
rm -f $(GENSRC)
rm -f _sys_errlist.c
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/amd64/dragonfly/deps.mk
@@ -1,0 +1,7 @@
+#deps
+./_getheap.o: ./../../posix/_getheap.c
+./_tzone.o: ./../../posix/_tzone.c
+./getenv.o: ./../../posix/getenv.c
+./raise.o: ./../../posix/raise.c
+./signal.o: ./../../posix/signal.c
+./time.o: ./../../posix/time.c
--- a/src/libc/arch/amd64/linux/Makefile
+++ b/src/libc/arch/amd64/linux/Makefile
@@ -40,6 +40,10 @@
$(GENSRC): syscall.lst
gensys.sh $*
+dep: inc-dep
+
clean:
rm -f $(GENSRC)
rm -f _sys_errlist.c
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/amd64/linux/deps.mk
@@ -1,0 +1,7 @@
+#deps
+./_getheap.o: ./../../posix/_getheap.c
+./_tzone.o: ./../../posix/_tzone.c
+./getenv.o: ./../../posix/getenv.c
+./raise.o: ./../../posix/raise.c
+./signal.o: ./../../posix/signal.c
+./time.o: ./../../posix/time.c
--- a/src/libc/arch/amd64/netbsd/Makefile
+++ b/src/libc/arch/amd64/netbsd/Makefile
@@ -39,6 +39,10 @@
$(GENSRC): syscall.lst
gensys.sh $*
+deps: inc-dep
+
clean:
rm -f $(GENSRC)
rm -f syscall _sys_errlist.c
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/amd64/netbsd/deps.mk
@@ -1,0 +1,1 @@
+#deps
--- a/src/libc/arch/amd64/openbsd/Makefile
+++ b/src/libc/arch/amd64/openbsd/Makefile
@@ -37,6 +37,10 @@
$(GENSRC): syscall.lst
gensys.sh $*
+dep: inc-dep
+
clean:
rm -f $(GENSRC)
rm -f syscall _sys_errlist.c
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/amd64/openbsd/deps.mk
@@ -1,0 +1,7 @@
+#deps
+./_getheap.o: ./../../posix/_getheap.c
+./_tzone.o: ./../../posix/_tzone.c
+./getenv.o: ./../../posix/getenv.c
+./raise.o: ./../../posix/raise.c
+./signal.o: ./../../posix/signal.c
+./time.o: ./../../posix/time.c
--- a/src/libc/arch/arm32/Makefile
+++ b/src/libc/arch/arm32/Makefile
@@ -14,5 +14,5 @@
$(SYS): FORCE
+@cd $@ && $(MAKE)
-clean:
+dep clean:
$(FORALL)
--- a/src/libc/arch/arm32/linux/Makefile
+++ b/src/libc/arch/arm32/linux/Makefile
@@ -39,6 +39,10 @@
$(GENSRC): syscall.lst
gensys.sh $*
+dep: inc-dep
+
clean:
rm -f $(GENSRC)
rm -f syscall _sys_errlist.c
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/arm32/linux/deps.mk
@@ -1,0 +1,8 @@
+#deps
+./_getheap.o: ./../../posix/_getheap.c
+./_open.o: ./../../../syscall.h
+./_tzone.o: ./../../posix/_tzone.c
+./getenv.o: ./../../posix/getenv.c
+./raise.o: ./../../posix/raise.c
+./signal.o: ./../../posix/signal.c
+./time.o: ./../../posix/time.c
--- a/src/libc/arch/arm64/Makefile
+++ b/src/libc/arch/arm64/Makefile
@@ -14,5 +14,9 @@
$(SYS): FORCE
+@cd $@ && $(MAKE)
+dep: inc-dep
+
clean:
$(FORALL)
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/arm64/deps.mk
@@ -1,0 +1,8 @@
+#deps
+./linux/_getheap.o: ./linux/../../posix/_getheap.c
+./linux/_open.o: ./linux/../../../syscall.h
+./linux/_tzone.o: ./linux/../../posix/_tzone.c
+./linux/getenv.o: ./linux/../../posix/getenv.c
+./linux/raise.o: ./linux/../../posix/raise.c
+./linux/signal.o: ./linux/../../posix/signal.c
+./linux/time.o: ./linux/../../posix/time.c
--- a/src/libc/arch/i386/Makefile
+++ b/src/libc/arch/i386/Makefile
@@ -14,5 +14,5 @@
$(SYS): FORCE
+@cd $@ && $(MAKE)
-clean:
+dep clean:
$(FORALL)
--- a/src/libc/arch/i386/linux/Makefile
+++ b/src/libc/arch/i386/linux/Makefile
@@ -32,13 +32,13 @@
crt.o: ../crt-posix.s
-raise.o: ../../posix/raise.c
-
-signal.o: ../../posix/signal.c
-
$(GENSRC): syscall.lst
gensys.sh $*
+dep: inc-dep
+
clean:
rm -f $(GENSRC)
rm -f syscall _sys_errlist.c
+
+include deps.mk
--- /dev/null
+++ b/src/libc/arch/i386/linux/deps.mk
@@ -1,0 +1,4 @@
+#deps
+./_getheap.o: ./../../posix/_getheap.c
+./raise.o: ./../../posix/raise.c
+./signal.o: ./../../posix/signal.c
--- a/src/libc/assert/Makefile
+++ b/src/libc/assert/Makefile
@@ -8,3 +8,7 @@
assert.$O\
all: $(OBJS)
+
+dep: inc-dep
+
+include deps.mk
--- /dev/null
+++ b/src/libc/assert/deps.mk
@@ -1,0 +1,1 @@
+#deps
--- a/src/libc/ctype/Makefile
+++ b/src/libc/ctype/Makefile
@@ -26,3 +26,7 @@
$(LIBC): $(OBJS)
$(MKLIB)
+
+dep: inc-dep
+
+include deps.mk
--- /dev/null
+++ b/src/libc/ctype/deps.mk
@@ -1,0 +1,1 @@
+#deps
--- a/src/libc/locale/Makefile
+++ b/src/libc/locale/Makefile
@@ -11,3 +11,7 @@
$(LIBC): $(OBJS)
$(MKLIB)
+
+dep: inc-dep
+
+include deps.mk
--- /dev/null
+++ b/src/libc/locale/deps.mk
@@ -1,0 +1,1 @@
+#deps
--- a/src/libc/stdio/Makefile
+++ b/src/libc/stdio/Makefile
@@ -48,3 +48,7 @@
$(LIBC): $(OBJS)
$(MKLIB)
+
+dep: inc-dep
+
+include deps.mk
--- /dev/null
+++ b/src/libc/stdio/deps.mk
@@ -1,0 +1,20 @@
+#deps
+./__getc.o: ./../libc.h
+./__getc.o: ./../syscall.h
+./__putc.o: ./../libc.h
+./_allocbuf.o: ./../libc.h
+./_flsbuf.o: ./../libc.h
+./_flsbuf.o: ./../syscall.h
+./_fpopen.o: ./../libc.h
+./_fpopen.o: ./../syscall.h
+./fclose.o: ./../libc.h
+./fclose.o: ./../syscall.h
+./fopen.o: ./../libc.h
+./fopen.o: ./../syscall.h
+./freopen.o: ./../libc.h
+./freopen.o: ./../syscall.h
+./fseek.o: ./../libc.h
+./fseek.o: ./../syscall.h
+./ftell.o: ./../syscall.h
+./setvbuf.o: ./../libc.h
+./tmpnam.o: ./../syscall.h
--- a/src/libc/stdlib/Makefile
+++ b/src/libc/stdlib/Makefile
@@ -30,3 +30,7 @@
$(LIBC): $(OBJS)
$(MKLIB)
+
+dep: inc-dep
+
+include deps.mk
--- /dev/null
+++ b/src/libc/stdlib/deps.mk
@@ -1,0 +1,12 @@
+#deps
+./atoi.o: ./../libc.h
+./atol.o: ./../libc.h
+./atoll.o: ./../libc.h
+./malloc.o: ./../libc.h
+./malloc.o: ./../syscall.h
+./malloc.o: ./malloc.h
+./realloc.o: ./malloc.h
+./strtol.o: ./../libc.h
+./strtoll.o: ./../libc.h
+./strtoul.o: ./../libc.h
+./strtoull.o: ./../libc.h
--- a/src/libc/string/Makefile
+++ b/src/libc/string/Makefile
@@ -32,3 +32,7 @@
$(LIBC): $(OBJS)
$(MKLIB)
+
+dep: inc-dep
+
+include deps.mk
--- /dev/null
+++ b/src/libc/string/deps.mk
@@ -1,0 +1,1 @@
+#deps
--- a/src/libc/time/Makefile
+++ b/src/libc/time/Makefile
@@ -17,3 +17,7 @@
$(LIBC): $(OBJS)
$(MKLIB)
+
+dep: inc-dep
+
+include deps.mk
--- /dev/null
+++ b/src/libc/time/deps.mk
@@ -1,0 +1,6 @@
+#deps
+./_daysyear.o: ./../libc.h
+./gmtime.o: ./../libc.h
+./localtime.o: ./../libc.h
+./mktime.o: ./../libc.h
+./strftime.o: ./../libc.h
--- a/src/libmach/coff32/deps.mk
+++ b/src/libmach/coff32/deps.mk
@@ -8,9 +8,20 @@
./coff32getidx.o: $(INCDIR)/scc/scc/mach.h
./coff32getidx.o: ./../libmach.h
./coff32getidx.o: ./coff32.h
+./coff32getsec.o: $(INCDIR)/scc/scc/mach.h
+./coff32getsec.o: ./../libmach.h
+./coff32getsec.o: ./coff32.h
+./coff32getsym.o: $(INCDIR)/scc/scc/mach.h
+./coff32getsym.o: ./../libmach.h
+./coff32getsym.o: ./coff32.h
+./coff32loadmap.o: $(INCDIR)/scc/scc/mach.h
+./coff32loadmap.o: ./../libmach.h
+./coff32loadmap.o: ./coff32.h
./coff32new.o: $(INCDIR)/scc/scc/mach.h
./coff32new.o: ./../libmach.h
./coff32new.o: ./coff32.h
+./coff32pc2line.o: $(INCDIR)/scc/scc/mach.h
+./coff32pc2line.o: ./../libmach.h
./coff32probe.o: $(INCDIR)/scc/scc/mach.h
./coff32probe.o: ./../libmach.h
./coff32probe.o: ./coff32.h
@@ -23,8 +34,6 @@
./coff32strip.o: $(INCDIR)/scc/scc/mach.h
./coff32strip.o: ./../libmach.h
./coff32strip.o: ./coff32.h
-./coff32sync.o: $(INCDIR)/scc/scc/mach.h
-./coff32sync.o: ./../libmach.h
./coff32write.o: $(INCDIR)/scc/scc/mach.h
./coff32write.o: ./../libmach.h
./coff32write.o: ./coff32.h
--- a/src/libmach/deps.mk
+++ b/src/libmach/deps.mk
@@ -1,34 +1,90 @@
#deps
-./addr2line.o: $(INCDIR)/scc/scc/mach.h
./archive.o: $(INCDIR)/scc/scc/ar.h
./archive.o: $(INCDIR)/scc/scc/mach.h
./archive.o: ./libmach.h
./armember.o: $(INCDIR)/scc/scc/ar.h
./armember.o: $(INCDIR)/scc/scc/mach.h
-./formember.o: $(INCDIR)/scc/scc/ar.h
-./formember.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32.o: ./coff32/../libmach.h
+./coff32/coff32.o: ./coff32/coff32.h
+./coff32/coff32del.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32del.o: ./coff32/../libmach.h
+./coff32/coff32del.o: ./coff32/coff32.h
+./coff32/coff32getidx.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32getidx.o: ./coff32/../libmach.h
+./coff32/coff32getidx.o: ./coff32/coff32.h
+./coff32/coff32getsec.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32getsec.o: ./coff32/../libmach.h
+./coff32/coff32getsec.o: ./coff32/coff32.h
+./coff32/coff32getsym.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32getsym.o: ./coff32/../libmach.h
+./coff32/coff32getsym.o: ./coff32/coff32.h
+./coff32/coff32loadmap.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32loadmap.o: ./coff32/../libmach.h
+./coff32/coff32loadmap.o: ./coff32/coff32.h
+./coff32/coff32new.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32new.o: ./coff32/../libmach.h
+./coff32/coff32new.o: ./coff32/coff32.h
+./coff32/coff32pc2line.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32pc2line.o: ./coff32/../libmach.h
+./coff32/coff32probe.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32probe.o: ./coff32/../libmach.h
+./coff32/coff32probe.o: ./coff32/coff32.h
+./coff32/coff32read.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32read.o: ./coff32/../libmach.h
+./coff32/coff32read.o: ./coff32/coff32.h
+./coff32/coff32setidx.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32setidx.o: ./coff32/../libmach.h
+./coff32/coff32setidx.o: ./coff32/coff32.h
+./coff32/coff32strip.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32strip.o: ./coff32/../libmach.h
+./coff32/coff32strip.o: ./coff32/coff32.h
+./coff32/coff32write.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32write.o: ./coff32/../libmach.h
+./coff32/coff32write.o: ./coff32/coff32.h
+./coff32/coff32xgetidx.o: $(INCDIR)/scc/scc/cstd.h
+./coff32/coff32xgetidx.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32xgetidx.o: ./coff32/../libmach.h
+./coff32/coff32xgetidx.o: ./coff32/coff32.h
+./coff32/coff32xsetidx.o: $(INCDIR)/scc/scc/mach.h
+./coff32/coff32xsetidx.o: ./coff32/../libmach.h
+./delobj.o: $(INCDIR)/scc/scc/mach.h
+./delobj.o: ./libmach.h
+./findsec.o: $(INCDIR)/scc/scc/mach.h
+./findsec.o: ./libmach.h
+./getindex.o: $(INCDIR)/scc/scc/mach.h
+./getindex.o: ./libmach.h
+./getsec.o: $(INCDIR)/scc/scc/mach.h
+./getsec.o: ./libmach.h
+./getsym.o: $(INCDIR)/scc/scc/mach.h
+./getsym.o: ./libmach.h
+./loadmap.o: $(INCDIR)/scc/scc/mach.h
+./loadmap.o: ./libmach.h
./mach.o: $(INCDIR)/scc/scc/mach.h
./mach.o: ./libmach.h
-./objaddseg.o: $(INCDIR)/scc/scc/mach.h
-./objdel.o: $(INCDIR)/scc/scc/mach.h
-./objdel.o: ./libmach.h
-./objfree.o: $(INCDIR)/scc/scc/mach.h
-./objfree.o: ./libmach.h
-./objlookup.o: $(INCDIR)/scc/scc/mach.h
-./objlookup.o: $(INCDIR)/scc/scc/scc.h
-./objnew.o: $(INCDIR)/scc/scc/mach.h
-./objnew.o: ./libmach.h
+./newmap.o: $(INCDIR)/scc/scc/mach.h
+./newmap.o: ./libmach.h
+./newobj.o: $(INCDIR)/scc/scc/mach.h
+./newobj.o: ./libmach.h
./objpos.o: $(INCDIR)/scc/scc/mach.h
./objpos.o: ./libmach.h
-./objstrip.o: $(INCDIR)/scc/scc/mach.h
-./objstrip.o: ./libmach.h
-./objsync.o: $(INCDIR)/scc/scc/mach.h
-./objsync.o: ./libmach.h
./objtype.o: $(INCDIR)/scc/scc/mach.h
./objtype.o: ./libmach.h
-./objwrite.o: $(INCDIR)/scc/scc/mach.h
-./objwrite.o: ./libmach.h
./pack.o: $(INCDIR)/scc/scc/mach.h
./pack.o: ./libmach.h
+./pc2line.o: $(INCDIR)/scc/scc/mach.h
+./pc2line.o: ./libmach.h
+./readobj.o: $(INCDIR)/scc/scc/mach.h
+./readobj.o: ./libmach.h
+./rebase.o: $(INCDIR)/scc/scc/mach.h
+./rebase.o: ./libmach.h
+./setindex.o: $(INCDIR)/scc/scc/mach.h
+./setindex.o: ./libmach.h
+./setmap.o: $(INCDIR)/scc/scc/mach.h
+./setmap.o: ./libmach.h
+./strip.o: $(INCDIR)/scc/scc/mach.h
+./strip.o: ./libmach.h
./unpack.o: $(INCDIR)/scc/scc/mach.h
./unpack.o: ./libmach.h
+./writeobj.o: $(INCDIR)/scc/scc/mach.h
+./writeobj.o: ./libmach.h