From 7811000f32133d7308f835578310e76a10dd0d2c Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 25 Jun 2000 14:21:46 +0000 Subject: Update the dependencies script to correctly handle the directories git-svn-id: http://svn.leocad.org/trunk@77 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- Makefile | 10 +++++----- depend.sh | 13 ++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index fd94b4c..f7e78af 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ -### $Id$ ### ALL CONFIGURATION SHOULD BE IN CONFIG.MK, NOT HERE include config.mk @@ -9,6 +8,7 @@ MODULES := $(OSDIR) common ### each of the modules CPPFLAGS += $(patsubst %,-I%,$(MODULES)) CPPFLAGS += $(OS) -DVERSION=$(VERSION) +CPPFLAGS += -g ### extra libraries if required LIBS := @@ -51,12 +51,12 @@ include $(OBJ:.o=.d) ### calculate C/C++ include ### dependencies %.d: %.c - ./depend.sh $(CC) $(CFLAGS) $(CPPFLAGS) $< > $@ - [ -s $@ ] || rm -f $@ + @./depend.sh $@ $(CC) $(CFLAGS) $(CPPFLAGS) -w $< + @[ -s $@ ] || rm -f $@ %.d: %.cpp - ./depend.sh $(CXX) $(CXXFLAGS) $(CPPFLAGS) $< > $@ - [ -s $@ ] || rm -f $@ + @./depend.sh $@ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -w $< + @[ -s $@ ] || rm -f $@ ### Various cleaning functions diff --git a/depend.sh b/depend.sh index e640888..f1da434 100755 --- a/depend.sh +++ b/depend.sh @@ -1,12 +1,11 @@ #!/bin/sh -# $Id$ -CC=$1 -shift +DEP=$1 +CC=$2 +shift 2 -# $CC -M -MG $* | \ +echo -n "$DEP" | awk '{ ORS = ""; print $1 " "; sub (".d", ".o"); print $1 " "; }' > $DEP +( $CC -MM $* || exit 1 ) >> $DEP -( $CC -MM $* || exit 1 ) | \ -sed \ - -e 's@^\(.*\)\.o:@\1.d \1.o:@' +#sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' -- cgit v1.2.3