[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: common.mk
From: |
Philip Guenther |
Subject: |
Re: common.mk |
Date: |
Sun, 22 Mar 2009 21:26:58 -0700 |
On Sat, Mar 21, 2009 at 2:54 AM, Mihai Draghicioiu
<address@hidden> 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
- common.mk, Mihai Draghicioiu, 2009/03/21
- Re: common.mk, Harvey Chapman, 2009/03/22
- Re: common.mk,
Philip Guenther <=