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: [EMAIL PROTECTED] _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make