fix dependencies in object dirs

This commit is contained in:
ariclone 2002-06-13 17:55:52 +00:00
parent fcb969ef14
commit a5d38fc897
2 changed files with 15 additions and 3 deletions

View file

@ -28,16 +28,18 @@ all: $(OBJS)
doc: $(SRCS:.c=.doc) $(CPPSRCS.cpp=.doc) $(HDRS:.h=.doc)
DEPOBJS = $(addprefix $(OBJDIR)/, $(SRCS:.c=.dep)) $(addprefix $(OBJDIR)/, $(CPPSRCS:.cpp=.dep))
clean::
$(RM) $(OBJS) core *.doc
clobber: clean
$(RM) .depend .#* *~ *.$(OE)
depend::
depend:: $(DEPOBJS)
@echo -n >.depend
@for i in $(SRCS) $(CPPSRCS) ; do\
$(CC) -MM $(IFLAGS) $(DFLAGS) $(CFLAGS) $$i >>.depend ; done
@for i in $(DEPOBJS) ; do\
cat $$i >>.depend ; $(RM) $$i ; done
tags::
for i in $(SRCS) $(CPPSRCS) ; do\

10
setup
View file

@ -940,6 +940,16 @@ if [ "$DARWIN" = "1" ] ; then
fi
echo >> $RULESFILE
echo "\$(OBJDIR)/%.dep: %.c" >> $RULESFILE
echo " @echo -n \"\$(OBJDIR)/\" >\$@" >> $RULESFILE
echo " @\$(CC) -MM \$(IFLAGS) \$(DFLAGS) \$(CFLAGS) \$< >>\$@" >> $RULESFILE
echo >> $RULESFILE
echo "\$(OBJDIR)/%.dep: %.cpp" >> $RULESFILE
echo " @echo -n \"\$(OBJDIR)/\" >\$@" >> $RULESFILE
echo " @\$(CC) -MM \$(IFLAGS) \$(DFLAGS) \$(CFLAGS) \$< >>\$@" >> $RULESFILE
echo >> $RULESFILE
#
# Source code documentation