make depend (part 1 of 3)

Kim Walden kim at enea.UUCP
Thu Apr 11 04:58:15 AEST 1985


In response to all requests for my dependency generating program,
which uses only source files as basis for generation,
(general method described in: K. Walden, "Automatic Generation of
Make Dependencies", Softw. Pract. & Exper., vol. 14(6), 575-585,
June 1984), I am now posting it to net.sources, in the two following
parts.

It was developed for 4.2bsd, and I did not pay any special attention
to portability. System V users must do the usual name changes
CFLAGS="-Dindex=strchar -Drindex=strrchar" etc.

The program deals correctly with included generated files, provided
that the include statements are recognizable in the corresponding
source files, and standard suffix conventions are used.

If conditional includes, like 

#ifdef KERNEL & !defined(LOCORE)
#include "foo"
#else
#include "bar"

appear in the files, it may sometimes be possible to extend the recognition
part so that only the relevant include statements are extracted (the
distributed program uses only grep), but in the general case, only the
C preprocessor may resolve the conditions correctly, and therefore one
may be forced to use the newly added -M option of cpp instead.

But then again, cpp -M cannot handle included generated files correctly.
-- 
	Kim Walden
	ENEA DATA Sweden

	UUCP:	{seismo,decvax,philabs}!{mcvax,ukc,unido}!enea!kim
	ARPA:	decvax!mcvax!enea!kim at berkeley.arpa
		mcvax!enea!kim at seismo.arpa



More information about the Comp.sources.unix mailing list