tags:

views:

26

answers:

1

Since i am not so experienced with the building process / makefiles on linux i ran in follow problem:

the Setup: i have an makefile A, which needs some enviroment variables set before running, this is done by running . ./set_A_vars.sh (set_A_vars.sh contains many export lines) before running make -f A

now i need to make project A within a makefile B. i tried the following setup for makefile B:

all: debug release

A_debug:
    . ./set_A_vars.sh && make -f A DEBUG=1

A_release:
    . ./set_A_vars.sh && make -f A DEBUG=0

debug:   A_debug some_B_stuff_debug
release: A_release some_B_stuff_debug

however i get lots of errors, which sound like the enviroment variables in set_A_vars.sh have not been set for make -f A ... in B.

How can i call makefile A from makefile B with the enviroment variables in set_A_vars.sh set in makefile B ??

Any help appreciated.

A: 
Beta
you missread my Q, its `. ./set_A_vars` not `./set_A_vars.sh`, and before you ask, i am not the author of makefile A and set_A_vars.sh ..
smerlin
@smerlin: I did not misread your question. I noticed the extra dot, which I assumed was simply bad design since it does nothing (because of the space). And I refer to makefile A as `MakefileA` for clarity.
Beta
MakefileA works nicely when done form a shell, and afaik the extra dot does something ... it shoud do the same as the csh `source` command.
smerlin
I stand corrected; I'd never heard of the `.` convention before.
Beta