[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Chicken-n-the-egg: regen .d file w/ missing header
From: |
Jason Lunz |
Subject: |
Re: Chicken-n-the-egg: regen .d file w/ missing header |
Date: |
Sat, 18 Mar 2006 15:35:50 +0000 (UTC) |
User-agent: |
slrn/0.9.8.1pl1 (Debian) |
address@hidden said:
> But before I write this code, I wanted to check with this email list to see
> if 1) my analysis was correct, and 2) to see if there's any other way to
> skin this cat.
One way to handle it is something like this:
%.h:
test ! -f "$@"
grep -rl "$@" *.d | xargs -r rm
@echo "==================================================="
@echo "Stale dependencies cleaned up. Please restart make."
@false
that is, if a stale .d file declares a dependency on a .h that no longer
exists, this rule tells make it can create the missing .h. But instead,
it looks for .d files with stale references to that header and deletes
them so they'll be regenerated with correct info on the next pass.
Jason