summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2000-06-25 14:21:46 +0000
committerleo2000-06-25 14:21:46 +0000
commit7811000f32133d7308f835578310e76a10dd0d2c (patch)
treee98b08a7526d3d05c87aa090fe2772f21ffa5a09
parent575a0c39467cfc88b17a0aa2171e072467640d72 (diff)
Update the dependencies script to correctly handle the directories
git-svn-id: http://svn.leocad.org/trunk@77 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--Makefile10
-rwxr-xr-xdepend.sh13
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:@'