On Sat, Mar 21, 2009 at 2:54 AM, Mihai Draghicioiu
<[email protected]> wrote:
> Hi guys! I'm making an includable makefile, to use with my projects.
> It works like this: If I have a directory and i want to make a program
> in it, i just put in its Makefile:
>
> programs = foo
> foo_SRCS = foo.cpp bar.cpp
> foo_CXXFLAGS = -g -Wall
>
> include ../common.mk
>
> and it works fine. The same goes for a folder with a library, or more.
>
> But if I have libraries AND programs, I get the following warnings:
>
> ../common.mk:81: warning: overriding commands for target `.cpp.o'
> ../common.mk:81: warning: ignoring old commands for target `.cpp.o'
> ../common.mk:83: warning: overriding commands for target `.cpp.o'
> ../common.mk:81: warning: ignoring old commands for target `.cpp.o'
>
> That's because, in order to take advantage of foo_CXXFLAGS, i need to
> define .cpp.o inside a 'define' block, and I have to do the same for
> the library, so .cpp.o is defined twice, differently.

Use static pattern rules.


Philip Guenther


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

Reply via email to