changeset 3611:6d055449020a

Fix dependencies and other parallel stuff.
author Jonathan Schleifer <js@h3c.de>
date Mon, 24 Sep 2007 20:21:52 +0200
parents a51873dc4052
children 0f57bc33979c
files buildsys.mk.in
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/buildsys.mk.in	Mon Sep 24 20:01:23 2007 +0200
+++ b/buildsys.mk.in	Mon Sep 24 20:21:52 2007 +0200
@@ -74,7 +74,10 @@
 .SUFFIXES: .beam .c .cc .cxx .d .erl .m
 .PHONY: all subdirs depend install uninstall clean distclean
 
-all: subdirs depend ${OBJS} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST}
+all:
+	for i in subdirs depend ${OBJS} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST}; do \
+		${MAKE} ${MFLAGS} $$i; \
+	done
 
 subdirs:
 	for i in ${SUBDIRS}; do \
@@ -87,18 +90,21 @@
 	regen=0; \
 	for i in ${SRCS}; do [ $$i -nt .deps ] && regen=1; done; \
 	if [ $$regen = 1 ]; then \
+		error=0; \
 		${DEPEND_STATUS}; \
 		rm -f .deps; \
 		for i in ${SRCS}; do \
 			case $${i##*.} in \
 			c|cc|cxx|m) \
-				if ${CPP} ${CPPFLAGS} -M $$i >>.deps; then \
-					${DEPEND_OK}; \
-				else \
-					${DEPEND_FAILED}; \
-				fi; \
+				${CPP} ${CPPFLAGS} -M $$i >>.deps || error=1; \
+				;; \
 			esac; \
 		done; \
+		if [ $$error = 0 ]; then \
+			${DEPEND_OK}; \
+		else \
+			${DEPEND_FAILED}; \
+		fi; \
 	fi
 
 pre-depend: