sbsv2/raptor/lib/flm/build.flm
author timothy.murphy@nokia.com
Mon, 16 Nov 2009 21:19:12 +0000
branchwip
changeset 7 f9fd2a994239
parent 5 593a8820b912
child 9 b211d87c390a
child 11 ea23b18a2ff6
permissions -rw-r--r--
Minor fix: Ensure that CLI_OPTIONS from the frontend are used.

# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description:
#
#

# Parameters:
# COMPONENT_PATHS
# CONFIGS
#

CREATABLEPATHS:=
CLEANTARGETS:=

.PHONY:: PP_EXPORTS

ifneq ($(filter win,$(HOSTPLATFORM)),)
SBS:=$(subst \,/,$(SBS_HOME)/bin/sbs.bat)
else
SBS:=$(SBS_HOME)/bin/sbs
endif


define doexports
PP_EXPORTS::
	$(call startrule,makefile_generation_exports) \
	$(SBS) --pp=slave --toolcheck=off --export-only $(component_list) $(config_list) -f- -m $(MAKEFILE_PATH).exports $(CLI_OPTIONS)  \
	$(call endrule,makefile_generation_exports)

CLEANTARGETS:=$$(CLEANTARGETS) $(MAKEFILE_PATH).exports 
endef

# Generate makefiles for particular bldinf
# $(1) = source target source target......
define generate_makefiles

ALL:: $(MAKEFILE_PATH)

$(MAKEFILE_PATH): $(COMPONENT_PATHS) | PP_EXPORTS 
	$(call startrule,makefile_generation) \
	$(SBS) --pp=slave --toolcheck=off -n $(CLI_OPTIONS) $(component_list) $(config_list) -m $$@ -f- \
	$(call endrule,makefile_generation)

CLEANTARGETS:=$$(CLEANTARGETS) $(MAKEFILE_PATH) 

endef

# Create config list for commands
config_list:=$(addprefix -c ,$(CONFIGS))
component_list:=$(addprefix -b ,$(COMPONENT_PATHS))
$(info <debug>build.flm: configlist: $(config_list)</debug>)

$(eval $(doexports))

# Create the Makefiles
$(eval $(call generate_makefiles))

CREATABLEPATHS:=$(CREATABLEPATHS) $(dir $(MAKEFILE_PATH))

$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),))
$(call makepath,$(CREATABLEPATHS))