There is a limitation of make when setting up automatic dependency info
generation.  Say I auto-generated a dependency of the form:

        main.o : main.c head1.h head2.h

and have built main.o successfully.  Then later during development I delete
head2.h (and delete the corresponding #include from, say, head1.h).  When I
try to make, make tries to find head2.h (because it's in a dependency), and
fails so it aborts the make.  I believe a similar thing will happen with
auto-dependencies of the form:

        main.o main.d : main.c head1.h head2.h

(see the make documentation for auto-dependency generation) because before
make can find out it has to rebuild main.d, it will try to find head2.h and
fail.

It seems the proper thing to fix this would be to have a separate class of
depencies which, if missing, don't cause an immediate error but instead
simply cause a rebuild of the target.  I'm not sure what the syntax would be
like, but let's say it's some keyword in the dependency list, then the
original auto-generated dependency above might be written as:

        main.o : --ignore-- main.c head1.h head2.h

where "--ignore--" tells make that any following dependencies should not
cause failure, but instead just a rebuild of the target, should they be
missing.  (I don't like "--ignore--" per se because a file could be named
that way, so some appropriate special character should probably be
involved.)

Is this easy to implement?  Last time I looked at make source code it was so
hairy to follow, I'd have to let this go to someone with experience with
make source code.

-Marc

Reply via email to