sbsv2/raptor/lib/flm/build.flm
author Mike Kinghan <mikek@symbian.org>
Wed, 01 Dec 2010 12:02:41 +0000
changeset 42 cf609178ac39
parent 13 c327db0664bb
permissions -rw-r--r--
1) fix_tools_exports.pl need only be run on Windows hosts; was run unnecessarily on Linux too. 2) Need to export modload.pm on Linux as well as Windows hosts.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     1
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     2
# All rights reserved.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     3
# This component and the accompanying materials are made available
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     5
# which accompanies this distribution, and is available
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     7
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     8
# Initial Contributors:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
     9
# Nokia Corporation - initial contribution.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    10
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    11
# Contributors:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    12
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    13
# Description:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    14
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    15
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    16
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    17
# Parameters:
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    18
# COMPONENT_PATHS
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    19
# CONFIGS
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    20
#
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    21
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    22
CREATABLEPATHS:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    23
CLEANTARGETS:=
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    24
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    25
.PHONY:: PP_EXPORTS
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    26
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    27
ifneq ($(filter win,$(HOSTPLATFORM)),)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    28
SBS:=$(subst \,/,$(SBS_HOME)/bin/sbs.bat)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    29
else
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    30
SBS:=$(SBS_HOME)/bin/sbs
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    31
endif
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    32
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    33
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    34
define doexports
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    35
PP_EXPORTS::
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    36
	$(call startrule,makefile_generation_exports) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    37
	$(SBS) --toolcheck=off --export-only $(component_list) $(config_list) -f- -m $(MAKEFILE_PATH).exports $(CLI_OPTIONS)  \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    38
	$(call endrule,makefile_generation_exports)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    39
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    40
CLEANTARGETS:=$$(CLEANTARGETS) $(MAKEFILE_PATH).exports 
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    41
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    42
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    43
# Generate makefiles for particular bldinf
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    44
# $(1) = source target source target......
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    45
define generate_makefiles
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    46
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    47
ALL:: $(MAKEFILE_PATH)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    48
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    49
$(MAKEFILE_PATH): $(COMPONENT_PATHS) $(if $(DOEXPORT),| PP_EXPORTS )
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    50
	$(call startrule,makefile_generation) \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    51
	$(SBS) --noexport --toolcheck=off -n $(CLI_OPTIONS) $(component_list) $(config_list) -m $$@ -f- \
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    52
	$(call endrule,makefile_generation)
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    53
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    54
CLEANTARGETS:=$$(CLEANTARGETS) $(MAKEFILE_PATH) 
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    55
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    56
endef
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    57
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    58
# Create config list for commands
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    59
config_list:=$(addprefix -c ,$(CONFIGS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    60
component_list:=$(addprefix -b ,$(COMPONENT_PATHS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    61
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    62
$(if $(FLMDEBUG),$(info <debug>build.flm: configlist: $(config_list)</debug>))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    63
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    64
# Do exports only if asked. This doesn't work brilliantly in emake
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    65
# since exports are often duplicated in some components - leads to conflicts 
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    66
# and rebuilds.  Better to export before trying to do parallel parsing at all.
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    67
$(if $(DOEXPORT),$(eval $(doexports)),$(if $(FLMDEBUG),$(info <debug>build.flm: Exports off </debug>)))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    68
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    69
# Create the Makefiles
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    70
$(eval $(call generate_makefiles))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    71
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    72
CREATABLEPATHS:=$(CREATABLEPATHS) $(dir $(MAKEFILE_PATH))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    73
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    74
$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    75
$(call makepath,$(CREATABLEPATHS))
c327db0664bb Upgrading Raptor from 2.10 to 2.13
mikek
parents: 2
diff changeset
    76