Date: Sun, 4 Nov 90 23:21:53 EST
From: Doug Peterson <doug@usan.consult.com>
Message-Id: <9011050421.AA02446@USAN.consult.com>
To: sun-managers@eecs.nwu.edu
Subject: make
I'm looking for a version of make() (source) that can handle hidden
dependencies, such as those generated by #include statements in source code.
The object file is dependent on the include file, but not the source file.
*** Late note: The previous sentence MEANS the object file is dependent
on the include file as well as the source file, but unless the
relationship between the include file and object file is known to
Make, a new object file will not be made if only the include file is
changed. Sorry if that confused anyone.
Sun has this capability in their vesion of make(), but is there another
out there?
Please reply directly to me. I'll summarize to the net, if anything
useful comes about.
Thanks.
Doug Peterson
****************************************************************
Thanks to all who replied. I checked my uunet file index, and lo &
behold, there were several versions of mkdep. I've tried a couple, and
the results were amazing. Mkdep.append seemed to do what I need very
nicely.
Summary follows:
From: Aydin Edguer <edguer@alpha.ces.cwru.edu>
Most people use mkdep (Berkeley) or makedepend (X11R[34]) to generate the
#include dependency rules. This will work with any make.
From: corbet@stout.atd.ucar.EDU (Jonathan Corbet)
I just use "makedepend", which will go through and automatically add all of
the #include dependencies to the end of a Makefile. Works great. My version
came with the X distribution.
From: Mitch Wright <mitch@hq.af.mil>
It sounds like you need to use mkdep to generate the header file dependencies.
You could also grab GNU make and modify it if it doesn't do what you are
expecting.
From: Adri Verhoef <ccea3@rivm05.rivm.nl>
Here at the RIVM exists this tool makemake(1).
It builds a makefile for make(1) depending on a 'layoutfile',
which is a kind of Makefile with some macros that are substituted
by makemake(1).
makemake(1) has to be called whenever the makefile should be changed,
i.e. sourcefile gets deleted, renamed, or added, or
when the dependencies of the include files have changed.
'Personal taste' changes have to be made inside the 'layoutfile',
as every new makefile is built from the layoutfile.
There also exists a 'recursive' flag (for Makefiles in subdirectories).
From: steve@umiacs.UMD.EDU (Steve D. Miller)
In any case, doing this is actually pretty easy. What you need is a
dependency generator (i.e., cc -M, or cc -Em (if I remember correctly) under
VAX but not RISC Ultrix), then something that massages that information a
bit (see the mkdep that comes with the BIND distribution, for example), and
then some way to take advantage of those dependencies. The final BSD make
(which may be slightly post-4.3-tahoe, so it may or may not have seen the
light of day) and the massively useful pmake program that replaces it both
look for a .depend file and automatically suck that in; alternatively,
around here (for the cases where we don't feel OK about ripping out the
vendor-supplied make in favor of pmake), we have a /usr/local/bin/make that
runs /bin/make -f Makefile -f .depend (plus the other args). That seems to
work for Ultrix, SunOS, and Encore's UMAX 4.3.
I don't know what it takes to get a copy of pmake, but it is really
wonderfully useful. It's nice to have Makefiles that look like:
PROG=foobar
SRCS=foo.c bar.c baz.c
.include <local.prog.mk>
and that automatically handle make {clean,depend,all,install}, and that put
their objects into an obj directory if present, so that once you've pmakeified
your Makefiles, you can NFS-mount your sources on all your architectures...
>From snoopy!tots.Logicon.COM!louis@ucsd.edu Tue Nov 6 19:13:41 1990
You might take a look at the "depend" target in a sysgen makefile.
I believe this target uses only features of standard (not Sun) make to
compute dependencies such as you are looking for.
For example, if your operating system config file is named TOAD, then
directory /usr/sys/sun{whatever}/TOAD/makefile is what you'll browse.
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:05:59 CDT