@@ -70,13 +70,14 @@ OBJS2 = ${OBJS1:.cc=.o} OBJS3 = ${OBJS2:.cxx=.o} 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: for i in subdirs depend ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST}; do \ ${MAKE} ${MFLAGS} $$i || exit 1; \ @@ -92,27 +93,24 @@ depend: pre-depend ${SRCS} regen=0; \ 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 ${CPP} ${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} ${LINK_STATUS}