# HG changeset patch # User Tony Vroon # Date 1217455472 -3600 # Node ID b86e9f9663f4d674d02a7ead9e6c9951895c616a # Parent 60d8d8f667edc4525f57e75de3d21d27fb938b4a Parallel dependency resolution by Jonathan Schleifer. diff -r 60d8d8f667ed -r b86e9f9663f4 buildsys.mk.in --- a/buildsys.mk.in Thu Jul 31 00:32:43 2008 +0300 +++ b/buildsys.mk.in Wed Jul 30 23:04:32 2008 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Jonathan Schleifer +# Copyright (c) 2007 - 2008, Jonathan Schleifer # # https://webkeks.org/hg/buildsys/ # @@ -73,11 +73,11 @@ OBJS3 = ${OBJS2:.cxx=.o} OBJS4 = ${OBJS3:.d=.o} OBJS5 = ${OBJS4:.erl=.beam} -OBJS += ${OBJS5:.m=.o} -DEPS += ${OBJS:.o=.dep} +OBJS6 = ${OBJS5:.m=.o} +OBJS += ${OBJS6:.xpm=.o} .SILENT: -.SUFFIXES: .beam .c .cc .cxx .d .dep .erl .m +.SUFFIXES: .beam .c .cc .cxx .d .dep .erl .m .xpm .PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean all: @@ -94,17 +94,25 @@ depend: pre-depend ${SRCS} regen=0; \ + deps=""; \ test -f .deps || regen=1; \ - for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \ - if test x"$$regen" = x"1" -a x"${DEPS}" != "x"; then \ + for i in ${SRCS}; do \ + case $$i in \ + *.o) \ + test $$i -nt .deps && regen=1; \ + deps="$${deps%.o}.dep $$i"; \ + ;; \ + esac; \ + done; \ + if test x"$$regen" = x"1" -a x"$$deps" != "x"; then \ ${DEPEND_STATUS}; \ rm -f .deps; \ - if ${MAKE} ${MFLAGS} ${DEPS}; then \ - cat ${DEPS} >.deps; \ - rm -f ${DEPS}; \ + if ${MAKE} ${MFLAGS} $$deps; then \ + cat $$deps >.deps; \ + rm -f $$deps; \ ${DEPEND_OK}; \ else \ - rm -f .deps ${DEPS}; \ + rm -f .deps $$deps; \ ${DEPEND_FAILED}; \ fi; \ fi @@ -113,6 +121,7 @@ ${CPP} ${CPPFLAGS} -M $< >$@ .d.dep: +.xpm.dep: pre-depend: @@ -196,6 +205,14 @@ ${COMPILE_FAILED}; \ fi +.xpm.o: + ${COMPILE_STATUS} + if ${CC} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + ${COMPILE_OK}; \ + else \ + ${COMPILE_FAILED}; \ + fi + install: ${LIB} ${STATIC_LIB} ${PLUGIN} ${PROG} install-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \