[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a way to work around the following oddity with % in GNU Mak
Re: Is there a way to work around the following oddity with % in GNU Make?
Thu, 29 Sep 2005 17:38:38 GMT
Andrew <firstname.lastname@example.org> wrote on 09/28/05 at 18:31:
> %.exe: %.o
> $(CC) -o $@ $^
> Subsequently in the same makefile, I would like to add lib.o as a
> dependency to every .exe file in this directory, which one would think
> I could do by saying
> %.exe: lib.o
> This doesn't work because it overrides the previous rule.
Have you tried wildcard expansions? If foo.exe exists and is older
than lib.o, this works as expected:
$(wildcard *.exe): lib.o