In the event that a Makefile itself is changed, a safe bet would be to consider all targets out of date.
Is there a clever way to add this dependency? Are there any alternatives?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A safe bet, but a terrible idea. Example: you’re using automake and update
Makefile.amto add a single source file. The correct response is to compile just the new file and link it in. In your scheme everything would be rebuilt.Moreover, adding the dependency isn’t going to do anything unless you touch the file, something like:
This will then trip up editors that use the mtime to detect concurrent modification (emacs is one example).
If you’re doing something major, just run
make clean allafter doing the change.