On Sat, Nov 14, 2009 at 11:48 PM, Mark Galeck (CW) <[email protected]> wrote:
>
>>I think your conclusions are a little strong here.
>
> Well yes, I am a perfectionist :) if a tool has a bug, even the smallest
> one, that cannot be fixed withing the realm of that tool, then I say it is a
> flawed tool.
I've been surprised that nobody has mentioned the straightforward and
elegant solution, and figured there must be something wrong with it.
But I just gave it a little try and it seems to work as expected:
.PHONY: all clean
all: foo
CFLAGS := -O2 -g -Dfoo -Dbar -Iinc1 -Iinc2 -W -Wall
incdeps := $(patsubst -I%,%,$(filter -I%,$(CFLAGS)))
foo: $(incdeps)
@echo remaking $@ because of $? in "'$(incdeps)'"
touch $@
clean: ; rm foo
In other words, generate an additional dependency on the DIRECTORIES
in the search path. This works exactly as desired (I think): it
triggers a rebuild whenever a file is added to or deleted from a
directory on the path, but does nothing when the existing files are
modified. Try "touch inc2/foo" for instance.
-David Boyce
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make