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