Make dependencies and nested include files

Chris Torek chris at mimsy.UUCP
Fri Oct 13 11:50:32 AEST 1989


In article <20139 at mimsy.UUCP> I wrote:
>Now, if test.c included `tconc.h', and tconc.h were to be built by
>concatenating test.h and t12conc.h, and t12conc.h were to be built by
>concatenating test1.h and test2.h, you could correctly write:
>
>	test.c: tconc.h
>	tconc.h: test.h t12conc.h
>		cat test.h t12conc.h > $@
>	t12conc.h: test1.h test2.h
>		cat test1.h test2.h > $@

Oops, I completely missed the fact that it is not test.c, but rather
test.o, which depends on (is built from the changed version of) tconc.h,
so the first line should read

	test.o: tconc.h

Implicit rules add implicit dependencies, so that

	test.o: test.c

is not actually required, unless there is an explicit action below,
such as

		cc -DFOO ${CFLAGS} -c $@.c
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list