Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] how to use makedepend?



General advice: there's optimization and there's laziness.  You're not
requesting an optimization, you're requesting DWIM.  DWIM is OK for
lusers, but it's lazy programming.

Miles Colman writes:

 > How come makedepend doesn't recursively include included directories?

Because they're not stated explicitly in any of the files (including
system includes) that compose your program, and you didn't tell it to
do so.  That is correct behavior.  There is a standard search path for
C include files, and you must explicitly add other locations to it.

 > How can  I tell makedepend that on Ubuntu 8.10, stdarg.h is located
 > in/usr/lib/gcc/avr/4.3.0/include/stdarg.h without me putting the path,
 > down to the directory, in the Makefile?

Don't try.  Instead, tell your sysadmin that your system is broken.
stdarg.h and stddef.h belong in /usr/include, although they may
consist of nothing but references to GCC- and/or glibc-provided files.
Google for POSIX, there are copies of the standard online somewhere.

If after getting the system fixed, makedepend then complains on
reading /usr/include/stddef.h that it can't find the recursively
included real stddef.h, you've got something to worry about.

 > mcolman@example.com:~/src/tmake$ make depend
 > makedepend   hello.c hello.h
 > makedepend: warning:  hello.c (reading /usr/include/stdio.h, line 34):
 > cannot find include file "stddef.h"
 >         not in /usr/include/stddef.h

This warning tells you that it is reading /usr/include/stdio.h, and
that it looked in only one place for stddef.h.  That place is where it
is *required* to be by the standard.  It seems likely to me that
makedepend is actually quite intelligent about the standard includes.



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links