[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
is this a bug or intended behavior
From: |
Samuel Klatchko |
Subject: |
is this a bug or intended behavior |
Date: |
Fri, 3 Aug 2007 12:45:29 -0700 |
I have the following Makefile:
foo: bar
@echo While building $@ MACRO = ${MACRO}
foo: MACRO += foo_specific
bar:
@echo While building $@ MACRO = ${MACRO}
bar: MACRO += bar_specific
MACRO = common
I would expect to get the output:
While building bar MACRO = common bar_specific
While building foo MACRO = common foo_specific
but instead I get:
While building bar MACRO = common foo_specific bar_specific
While building foo MACRO = common foo_specific
Is this a bug or am I misunderstanding how target specific variables
work.
The real use case is when I have a Makefile that is building both an
shared object and an executable that uses it. I want to factor LDLIBS
into common libraries that both use and specific libraries that are only
for the shared object or the executable. But due to this behavior, I
can't have the executable dependent on the shared object.
Thanks,
samuel
--
R Samuel Klatchko
Software Architect
Messaging and Web Security
Symantec Corporation
www.symantec.com
-----------------------------------------------------
Phone: 415-738-2663
Inter-office: 6-415-2663
Email: address@hidden
- is this a bug or intended behavior,
Samuel Klatchko <=