changeset 4263:efb49258f4f0

Make dependency generation threaded.
author Jonathan Schleifer <js-audacious@webkeks.org>
date Sun, 10 Feb 2008 10:21:33 +0100
parents 9a55e8237988
children 49740df2ccca
files buildsys.mk.in
diffstat 1 files changed, 13 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/buildsys.mk.in	Sat Feb 09 19:56:50 2008 +0100
+++ b/buildsys.mk.in	Sun Feb 10 10:21:33 2008 +0100
@@ -73,9 +73,10 @@
 OBJS4 = ${OBJS3:.d=.o}
 OBJS5 = ${OBJS4:.erl=.beam}
 OBJS += ${OBJS5:.m=.o}
+DEPS += ${OBJS:.o=.dep}
 
 .SILENT:
-.SUFFIXES: .beam .c .cc .cxx .d .erl .m
+.SUFFIXES: .beam .c .cc .cxx .d .dep .erl .m
 .PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean
 
 all:
@@ -95,24 +96,21 @@
 	test -f .deps || regen=1; \
 	for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \
 	if test x"$$regen" = x"1"; then \
-		list=""; \
 		${DEPEND_STATUS}; \
-		for i in ${SRCS}; do \
-			case $${i##*.} in \
-			c|cc|cxx|m) \
-				list="$$list $$i"; \
-				;; \
-			esac; \
-		done; \
-		if test x"$$list" != "x"; then \
-			if ${CC} ${CPPFLAGS} -M $$list >.deps; then \
-				${DEPEND_OK}; \
-			else \
-				${DEPEND_FAILED}; \
-			fi; \
+		rm -f .deps; \
+		if ${MAKE} ${MFLAGS} ${DEPS}; then \
+			${DEPEND_OK}; \
+		else \
+			rm -f .deps; \
+			${DEPEND_FAILED}; \
 		fi; \
 	fi
 
+.c.dep .cc.dep .cxx.dep .m.dep:
+	${CPP} ${CPPFLAGS} -M $< >>.deps
+
+.d.dep:
+
 pre-depend:
 
 ${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS}