Most build system modules and targets deal within the context of the current directory, however the Component module deals with components as a whole, so many of the targets produced by this module are stored in a location known to all subdirectories within a component build at the COMPONENT_ROOT level.
Since the rules governing how a component from the component repository will be placed in COMPONENT_IMPORT_TARGET_ROOT, the function COMPONENT_FUNC_IMPORT_COMPUTE_TARGETDIR should be used by point make files that need to access imported files. This function takes the name of the import target as it appears in the IMPORT_TARGETS list as its only argument, and returns the directory into which that component was imported. Note: this behavior is changed considerably from previous versions of this build system. While Mentok imported all components into one flat dir, version 3.5 and upward changed to importing each component into its own directory. This chage was done to better accomodate cross compiling, multi-platform comiling, importing more than one revision of a component, etc. without the problems of colbbering files and other conflicts that plagued the old system.
IMPORT_TARGETS will be built during the "target" phase of a build. IMPORT_TARGETS may be built in isolation by requesting the "component_import" target.
In addition to pushing the contents of a component to the component repository, DIST_TARGETS pattern targets also cause a XML component descriptor file to be generated and pushed to the repository. The component descriptor for components pushed to the repository will chain the component descriptors of all imported components found in the current IMPORT_TARGETS before being pushed to the component repository. This is done to track the full dependency tree of a component even if components used in its construction are not re-packaged in its dist or hidden by static linking.
COMPONENT_ROOT=../.. BS_ROOT=$(COMPONENT_ROOT)/../build3 include $(BS_ROOT)/defines.mk IMPORT_TARGETS=mhnet mhnet-crossplatform blackbird-mh # this_component_doesnt_exist this_component_doesnt_exist_REV=2003-07-18 blackbird-mh_REV=4.0.4-2005-03-28_blackbird-404-endc-204-branch mhnet_REV=2003-04-03 #mhnet_DISTROOT=foo #mhnet_FROM=foobar mhnet-crossplatform_REV=2003-04-03 mhnet-crossplatform_PLATFORM=SunOS-5.9-sparcv9 mhnet-crossplatform_DISTNAME=mhnet #mhnet_DISTROOT=foo #mhnet_FROM=foobar SUBDIR_TARGETS= EXPORT_DESC_TARGETS=test_descriptor DIST_TARGETS=foo # DISTROOT// COMPONENT_DISTTAG/ / foo_FROM=/home/carlalex/eng-home/src/blackbird-trunk/src/bbi/cmi/stdio #foo_TO=/tmp/foo/bar/some-other-path foo_DISTROOT=/tmp/testdist foo_DISTNAME=moof foo_SCRUB=CVS BUILDTARGETS\* foo_PLATFORM=$(BS_PLATFORM_NOARCH) foo_PLATFORMLINKS=fake-platform foo_REV=3.1 foo_COMMENT=Mentok build system test component # Note: this is probably a dumb thing to do in a real make file... # the two platforms of the one component would clobber # each other. If you wanted to roll up a multi-platform component # to dist, you should stage the merge of plarforms with package rules, # then dist your package dir. foo_REEXPORT=mhnet mhnet-crossplatform #COMPONENT_DISTTAG=test_dist_tag include $(BS_ROOT)/rules.mk
<?xml version="1.0"?> <ComponentDesc> <Name>foo</Name> <Revision>3.1</Revision> <Comment>foo component DIST created at 2003-06-13 14:28:42 on firsttime.int.recourse.net</Comment> <Platform>Linux-2.4.20-13-i686-libc-2.3.2</Platform> <ReferenceDist>/usr/local/test-dist/foo/3.1/Linux-2.4.20-13-i686-libc-2.3.2</ReferenceDist> <CompatibilityPlatform>Linux</CompatibilityPlatform> <CompatibilityPlatform>Linux-2.4-i686</CompatibilityPlatform> <CompatibilityPlatform>Linux-2.4-i686-libc-2.3.2</CompatibilityPlatform> <CompatibilityPlatform>Linux-2.4.20-13-i686</CompatibilityPlatform> <CompatibilityPlatform>Linux-i686</CompatibilityPlatform> <Import> <ComponentDesc> <Name>mhnet</Name> <Revision>2003-04-03</Revision> <Comment>Imported Component did not provide a component.xml file; This stub was auto generated by the importing rules.</Comment> <Platform>Linux-2.4.20-13-i686-libc-2.3.2</Platform> <ImportDist>/usr/local/test-dist/mhnet/2003-04-03/Linux-2.4-i686</ImportDist> </ComponentDesc> <ComponentDesc> <Name>mhjava</Name> <Revision>2003-04-07</Revision> <Comment>MH java component descriptor.</Comment> <Platform>noarch</Platform> <Import> <ComponentDesc> <Name>Test sub component</Name> <Revision>1.0</Revision> </ComponentDesc> </Import> <ImportDist>/usr/local/test-dist/mhjava/2003-04-07/Linux-2.4-i686</ImportDist> </ComponentDesc> </Import> </ComponentDesc>