On Thu, Mar 20, 2003 at 08:24:12PM +0000, Franck Arnaud wrote:
Holger Waechtler:
I had to add '#include <string.h>' for strcmp() to get it compiling...
Thanks, now fixed. Does anyone know of a tool that allows
to check that all the legal includes are there? It's
very easy to forget includes when your setup has .h files
that silently include others for internal purpose.
What about something like this:
depend:
dep:
sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
$(CC) $(CFLAGS) -M $(DEP) >> tmp_make #2>/dev/null
mv tmp_make Makefile
touch .dep
and making .dep a dependency for the program?
This is stolen from some package I don't remember, but I'm using it
for my programs.
You will need a "### Dependencies" line in the Makefile, though, of course.
if CFLAGS include "-MD" this leads to more elegant rules, see the DVB
driver dependency rules/Makefiles for an example.