[LispM-Hackers] Makefile makedepend query
James A. Crippen
james@unlambda.com
Sun Apr 7 23:38:01 2002
I just did a full clean of my e3 checkout, updated everything, and
then tried to do a make.
make: *** No rule to make target `/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h', needed by `app.o'. Stop.
That sucks. Looking at the depend.mk I see that app.o has a *whole
bunch* of system specific stuff that it suddenly depends on. Stuff
that is definitely *not* system independent. Is this on purpose or on
accident? It looks ultra bad to me. Especially lines like:
app.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
which if you note is the source of the error I mentioned above. I
don't have this file on my system, and I'm even using a Red Hat
install!
I don't quite understand why you need this stuff in the first place.
Is it just a mistake?
Perhaps you're trying to do something with makedepend that you should
be doing with handmade makefiles? Particularly one thing you want to
do is avoid making the system includes a requirement for building.
There's no way make can reasonably handle this.
Instead of using makedepend which is an X11 specific program, could
you maybe use 'gcc -MM'? I think this would do more what you want
anyway... From the gcc info:
`-M'
Tell the preprocessor to output a rule suitable for `make'
describing the dependencies of each object file. For each source
file, the preprocessor outputs one `make'-rule whose target is
the object file name for that source file and whose dependencies
are all the `#include' header files it uses. This rule may be a
single line or may be continued with `\'-newline if it is long.
The list of rules is printed on standard output instead of the
preprocessed C program.
`-M' implies `-E'.
Another way to specify output of a `make' rule is by setting the
environment variable `DEPENDENCIES_OUTPUT' (*note Environment
Variables::.).
`-MM'
Like `-M' but the output mentions only the user header files
included with `#include "FILE"'. System header files included
with `#include <FILE>' are omitted.
`-MD'
Like `-M' but the dependency information is written to a file
made by replacing ".c" with ".d" at the end of the input file
names. This is in addition to compiling the file as
specified--`-MD' does not inhibit ordinary compilation the way
`-M' does.
In Mach, you can use the utility `md' to merge multiple
dependency files into a single dependency file suitable for using
with the `make' command.
`-MMD'
Like `-MD' except mention only user header files, not system
header files.
`-MG'
Treat missing header files as generated files and assume they
live in the same directory as the source file. If you specify
`-MG', you must also specify either `-M' or `-MM'. `-MG' is not
supported with `-MD' or `-MMD'.
I know that this won't work on systems that don't use GCC, but I think
we're considering GCC our current favorite compiler anyway since it's
used on everything we've ported to so far (Linux, *BSD, MacOS X,
Windows+GNU, bare iron).
Once we have to worry about multiple compilers then maybe it'll be
time for me to write a configure.in and Makefile.in and start using
autoconf and automake...
In your bare iron version, if you know where your includes are coming
from then is there a way you could just store these in a special file
instead of having to recompute them?
'james
--
James A. Crippen <james@unlambda.com> ,-./-. Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us | |/ | USA, 61.20939N, -149.767W
Y = \f.(\x.f(xx)) (\x.f(xx)) | |\ | Earth, Sol System,
Y(F) = F(Y(F)) \_,-_/ Milky Way.