But the generation of x21.o and x22.o will cause them to have a timestamp
greater than that of ../nat.a and should cause make to do the build. x21.o
and x22.o are listed a dependencies of nat.a.

-----Original Message-----
In the Makefile for src2, the default rule is ALL: $(lib) which means that
the default target depends on the $(lib) target which is defined as
../nat.a.
Since the Makefile in src1 already generated ../nat.a, that file is newly
created when Makefile in src2 is processed, and thus it is newer than the
source files x21.c and x22.c.  As such, the make process decides that
nothing
needs to be done to create object files, which results in $? being empty
(since
that variable contains only those dependencies that needed to be generated).

With your second version, you use an immediary target dummy, which forces
the
evaluation of its dependencies since 'dummy' is not an actual file (thus it
does not have a timestamp that make can verify).

Reply via email to