SparkBuild Community

Pushing the envelope of build performance

Environment variables are not getting passed to sub-makes

I'm trying SparkBuild for the first time. All of our makefiles start with an include of common definitions in file $(__buildTop)/mk/top.mk.

 

This works for the first makefile, but when SparkBuild enters a different directorie's makefile, I get an error "Can't find file /mk/top.mk".

 

So, the first file is picking up the $(__buildTop) environment variable, but the other makefiles are not.

 

Note: This works fine with Accelerator emake and with clearmake so I'm pretty sure it's a SparkBuild emake problem.

Views: 62

Reply to This

Replies to This Discussion

Can you show us the command-line you use to invoke SparkBuild emake?
EM:

Command line (and output):

C:\SparkBuild\i686_win32\bin\emake.exe --win32 --emake-emulation=gmake --emake-autodepend=1 --case-sen
sitive=0 --emake-root="W:\dward_JELProject" buildType=debug

C:/SparkBuild/i686_win32/bin/emake libs
make[2]: Entering directory `common'
Makefile:31: /mk/subdir.mk: No such file or directory
Makefile:128: /rules.mk: No such file or directory
make[2]: *** No rule to make target `/rules.mk'. Stop.
make[2]: Leaving directory `common'
make: *** [subbuild-x86-win32-msvc90/debug/lib] Error 2

The makefile looks like:

#-------------------------------------
# Project-specific definitions.
#-------------------------------------

include $(__buildRoot)/mk/subdir.mk

__buildRoot is defined in the environment and I get the same error even if I pass __buildRoot on the command line to emake.

Thanks for any help.

David
David,

Are you certain this only breaks with SparkBuild emake? I crafted a simple test case based on the information you provided here and it seems to be working correctly as expected, so I think there must be more going on in your environment than you've shown.

Can you generate an annotation log with --emake-annodetail=env and post it here, or email it to support@electric-cloud.com?

Thanks.
EM:

Line 31 of the makefile is:

include $(__buildRoot)/mk/subdir.mk

Note that this is not the makefile that is first executed. This is in a subbuild makefile in a different directory.

And this all works for a build from the top-level down plus local building via either emake or clearmake.

Environment annotation details follow (and __buildRoot is defined). I deleted a bunch of environment variables for security reasons.

David


W:\dward_JELProject\JEL\jel\state\unittest>C:\SparkBuild\i686_win32\bin\emake.exe --emake-subbuild-db=W:\dward_JELProject\JEL\emake.subbuild.db -
-win32 --emake-emulation=gmake --emake-autodepend=1 --case-sensitive=0 --emake-root="W:\dward_EBMP_RMI" buildType=debug
C:/SparkBuild/i686_win32/bin/emake libs
make[2]: Entering directory `W:/dward_JELProject/JEL/jel/common'
Makefile:31: /mk/subdir.mk: No such file or directory
Makefile:128: /rules.mk: No such file or directory
make[2]: *** No rule to make target `/rules.mk'. Stop.
make[2]: Leaving directory `W:/dward_JELProject/JEL/jel/common'
make: *** [subbuild-W:/dward_JELProject/JEL/x86-win32-msvc90/debug/lib] Error 2

W:\dward_JELProject\JEL\jel\state\unittest>C:\SparkBuild\i686_win32\bin\emake.exe --emake-subbuild-db=W:\dward_JELProject\JEL\emake.subbuild.db -
-win32 --emake-emulation=gmake --emake-autodepend=1 --case-sensitive=0 --emake-root="W:\dward_EBMP_RMI" --emake-annodetail=env buildType=debug




C:\SparkBuild\i686_win32\bin\emake.exe --emake-subbuild-db=W:\dward_JELProject\JEL\emake.subbuild.db --win32 --emake
-emulation=gmake --emake-autodepend=1 --case-sensitive=0 --emake-root=W:\dward_EBMP_RMI --emake-annodetail=env buildType=debug
4.6.0.29796 32-bit (build_4.6_29796_OPT_2009.09.20_02:51:18)
W:/dward_JELProject/JEL/jel/state/unittest
48636
emake.data
no
00000000000000000000000000000000
basic,env,waiting









on=gmake --emake-autodepend=1 --case-sensitive=0 --emake-root=W:\dward_EBMP_RMI --emake-annodetail=env buildType=debug" cwd="W:/dward_JELProject/
JEL/jel/state/unittest" mode="gmake">







]]> Makefile:31: /mk/subdir.mk: No such file or directory
Makefile:128: /rules.mk: No such file or directory
make[2]: *** No rule to make target `/rules.mk'. Stop.
make[2]: Leaving directory `W:/dward_JELProject/JEL/jel/common'
]]> ]]>






























mk"">


"">



>


























122" neededby="J00c9d0f0"">



le="W:\dward_JELProject\Radio_Common_GPP\tools\mk/win32-msvc90/rules_compile_cxx.mk" line="46" neededby="J00c9d750">



ile="W:\dward_JELProject\Radio_Common_GPP\tools\mk/win32-msvc90/rules_compile_cxx.mk" line="46" neededby="J00c9d750">



file="W:\dward_JELProject\Radio_Common_GPP\tools\mk/win32-msvc90/rules_link.mk" line="83" neededby="J00c9d0f0">


" line="84"">









28
0
0
0
7
0
0
7
0.884884
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2.61412e-005
0



W:\dward_JELProject\JEL\jel\state\unittest>
Can you attach that XML to your post, rather than pasting it inline? The site seems to have swallowed most of the XML tags. Click the "Upload Files" link beneath the text editing field when you write your reply.

Thanks.

RSS

Share

© 2012   Created by Electric Cloud Administrator.

Badges  |  Report an Issue  |  Terms of Service