[Top][All Lists]

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

out-of-date "include"d files

From: Robert P. J. Day
Subject: out-of-date "include"d files
Date: Wed, 17 Dec 2003 09:05:40 -0500 (GMT-05:00)

  i'm reading the paper "recursive make considered harmful" and noticed a
feature on "include" that i didn't see mentioned in the gnu make manual.  
that is,

  "once a Makefile has been read in, if any of its included files were out of
date (or do not yet exist), they are re-built, and then make starts again,
which has the result that make is now working with up-to-date include files."

  consider the example given in that paper (ignoring any obvious
transcription errors):
SRC := $(wildcard *.c)
OBJ := $(SRC:.c=.o)
test: $(OBJ)
    $(CC) -o $@ $(OBJ)
include dependencies
dependencies: $(SRC) $(CFLAGS) $(SRC) > $@  # generate dependencies list

  just to clarify the order of processing, let's say there were a number of
these included files, some of which were out of date WRT their prereqs.
does make read the *entire* makefile, and only *then* check if any of the
included files were out of date, rebuild just those files, and start all over 
again from the top, throwing away the results of the first pass?


p.s.  i'm aware that there is a flaw in the logic of the above -- i'm just 
specifically about the make processing order.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]