From 4f58d285588e75ed357e588b2bf584068be6a5a9 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 7 Jul 2000 19:42:07 +0000 Subject: Better way of creating .d files, awk is not needed anymore Removed 'make' warnings if .d files are missing git-svn-id: http://svn.leocad.org/trunk@79 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- Makefile | 6 +++--- depend.sh | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f7e78af..4c0b610 100644 --- a/Makefile +++ b/Makefile @@ -46,16 +46,16 @@ bin: ### include the C/C++ include ### dependencies -include $(OBJ:.o=.d) +-include $(OBJ:.o=.d) ### calculate C/C++ include ### dependencies %.d: %.c - @./depend.sh $@ $(CC) $(CFLAGS) $(CPPFLAGS) -w $< + @./depend.sh $@ $(@D) $(CC) $(CFLAGS) $(CPPFLAGS) -w $< @[ -s $@ ] || rm -f $@ %.d: %.cpp - @./depend.sh $@ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -w $< + @./depend.sh $@ $(@D) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -w $< @[ -s $@ ] || rm -f $@ diff --git a/depend.sh b/depend.sh index f1da434..bfc887c 100755 --- a/depend.sh +++ b/depend.sh @@ -1,10 +1,11 @@ #!/bin/sh DEP=$1 -CC=$2 -shift 2 +DIR=$2 +CC=$3 +shift 3 -echo -n "$DEP" | awk '{ ORS = ""; print $1 " "; sub (".d", ".o"); print $1 " "; }' > $DEP +echo -n "$DEP $DIR/" > $DEP ( $CC -MM $* || exit 1 ) >> $DEP #sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' -- cgit v1.2.3