Help with automatic prrequisite generation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with automatic prrequisite generation

Cort Stratton
I'm having a problem with automatic prerequisite generation as described in
section 4.14 of the make manual.  I've implemented the technique as
described, and it works great.  However, I run into problems if I remove or
rename a header file; the file is still listed as a prerequisite in the
existing .d files, which causes make to issue an error and abort before
building ANY target.  Ideally, I'd like to add a "depclean" target which
would delete all the .d files, but even that target would fail to build
because of the missing prerequisite!

I can work around the problem using conditionals (e.g. Only include the .d
files if the NODEPS variable isn't defined), but that requires the user to
run "make depclean NODEPS=1", and I'm looking for a more transparent
solution.

How is this problem generally dealt with? Is there a way to tell make to
always ignore missing prerequisites for a particular target, without
requiring the user to pass any special command-line options?

Thanks,
 - cort


_______________________________________________
Help-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

Re: Help with automatic prrequisite generation

Paul Smith-20
%% Cort Stratton <[hidden email]> writes:

  cs> I can work around the problem using conditionals (e.g. Only
  cs> include the .d files if the NODEPS variable isn't defined), but
  cs> that requires the user to run "make depclean NODEPS=1", and I'm
  cs> looking for a more transparent solution.

The MAKECMDGOALS variable contains any goals that the user specified on
the command line.

--
-------------------------------------------------------------------------------
 Paul D. Smith <[hidden email]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-make