Eeek. This is how you have done dependencies? hmmm.
A few things:
1. go to www.freshmeat.net and get the "fastdep" program. It is FAST!! 10
times faster, and seems to solve the dependency drop include problem.
2.
Some basic psuedocode for you to create individual dependency files. This
allows you to compile only a single file at a time.
for file in $SRCS
do
BASEFILE=`basename $file .c`
gcc -MM $CFLAGS $file > $DEPEND/$BASEFILE
echo "$OBJ/$BASEFILE.o : $DEPEND/$BASEFILE" >> $DEPEND/$BASEFILE
echo " \$(CC) \$(CFLAGS) -o $OBJ/$BASEFILE.o -c $file" >>
$DEPEND/$BASEFILE
done
3. To get the objects out of a sourcelist
OBJ= $(addsuffix .o, $(addprefix ${OBJDIR}/, $(basename $(notdir ${SRCS}))))
Those things should help you on your way to an advanced dependency system.
Edwin is right, use sed -e for your case of the .depend.
Winston
----- Original Message -----
From: "Peter Nyhan" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, September 17, 2002 12:09 AM
Subject: Make depend troubles
> I am working on a Red Hat 7.3 machine and have been trying to come up
> with a form of make depend.
> I searched through the archives and came up with this:
> depend:
> $(CC) -MM $(C_FILES) $(CFLAGS) > .depend
> cat .depend | sed 's/^\(.*\):/$(OBJDIR)\/\1:/' > .depend
> #Thanks to Kender from the ROM Mailing List
>
> This applies to me since the object files are not located in the actual
> src directory.
> I get an error when I try and run make depend, the error is as follows:
> cat .depend | sed 's/^\(.*\):/$(OBJDIR)\/\1:/' > .depend
> Sed: -e expression #1, char 15: Unknown option to 's'
> Make: *** [depend] Error 1
>
> Anyone know what is going on or am I missing something specific?
> Thank you in advance for the help.
>
> -PNyhan
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
>