3
|
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 |
# FLM to copy pre-built binaries into the right release locations
|
|
17 |
|
|
18 |
# parameters
|
|
19 |
#
|
|
20 |
# PRE_PLATFORM the target of the binaries, e.g. armv5
|
|
21 |
# PRE_TYPE the build variant of the binaries, e.g. urel
|
|
22 |
# BINARIES the list of binary files, relative to EXTENSION_ROOT
|
|
23 |
|
|
24 |
# The filenames in the list BINARIES may optionally have an appended "->name"
|
|
25 |
# when the destination basename should be different from the source. For
|
|
26 |
# example, ../bin/deb_codec66.lib->codec66.lib will create files
|
|
27 |
# called "codec66.lib" and not "deb_codec66.lib"
|
|
28 |
|
|
29 |
# ensure that there are no nasty leading or trailing spaces
|
|
30 |
PRE_PLATFORM:=$(strip $(PRE_PLATFORM))
|
|
31 |
PRE_TYPE:=$(strip $(PRE_TYPE))
|
|
32 |
|
|
33 |
# don't do anything unless the prebuilt binaries match what we are building
|
|
34 |
#
|
|
35 |
ifeq ($(PRE_PLATFORM),$(VARIANTPLATFORM))
|
|
36 |
ifeq ($(PRE_TYPE),$(VARIANTTYPE))
|
|
37 |
|
|
38 |
# the feature Invariant directory for binaries of this ilk
|
|
39 |
INV:=$(RELEASEPATH)/$(VARIANTPLATFORM)/$(VARIANTTYPE)
|
|
40 |
|
|
41 |
CREATABLEPATHS:=
|
|
42 |
RELEASABLES:=
|
|
43 |
|
|
44 |
# for any configuration (feature variant or not) add rules to copy the
|
|
45 |
# prebuilt binaries from the source directory to the Invariant directory.
|
|
46 |
#
|
|
47 |
# For example,
|
|
48 |
# cp /src/armv5/urel/my.lib /epoc32/release/armv5/urel/my.lib
|
|
49 |
#
|
|
50 |
# Without this you would always have to build the invariant configuration
|
|
51 |
# before (or alongside) any feature variant configuration.
|
|
52 |
|
|
53 |
define copyprebuilt
|
|
54 |
#
|
|
55 |
# $1 is the source file
|
|
56 |
# $2 is the destination file
|
|
57 |
|
|
58 |
ALL:: $(2)
|
|
59 |
|
|
60 |
$(2): $(1)
|
|
61 |
$(call startrule,copyprebuilt) \
|
|
62 |
$(GNUCP) $(1) $(2) && \
|
|
63 |
$(GNUCHMOD) a+rw $(2) \
|
|
64 |
$(call endrule,copyprebuilt)
|
|
65 |
|
|
66 |
CREATABLEPATHS:=$(INV)
|
|
67 |
RELEASABLES:=$$(RELEASABLES) $(2)
|
|
68 |
|
|
69 |
endef # copyprebuilt
|
|
70 |
|
|
71 |
define copyprebuiltfile
|
|
72 |
#
|
|
73 |
# $1 is "name" or "name->name"
|
|
74 |
|
|
75 |
ifeq ($(findstring ->,$(1)),)
|
|
76 |
$(call copyprebuilt,$(EXTENSION_ROOT)/$(1),$(INV)/$(notdir $(1)))
|
|
77 |
else
|
|
78 |
$(call copyprebuilt,$(EXTENSION_ROOT)/$(word 1,$(subst ->, ,$(1))),$(INV)/$(word 2,$(subst ->, ,$(1))))
|
|
79 |
endif
|
|
80 |
endef # copyprebuiltfile
|
|
81 |
|
|
82 |
$(eval $(foreach B,$(BINARIES),$(call copyprebuiltfile,$(B))))
|
|
83 |
|
|
84 |
|
|
85 |
# housekeeping
|
|
86 |
|
|
87 |
# make the output directories while reading the makefile,
|
|
88 |
# as some build engines prefer this.
|
|
89 |
$(call makepath,$(CREATABLEPATHS))
|
|
90 |
|
|
91 |
# clean
|
|
92 |
$(eval $(call GenerateStandardCleanTarget,$(RELEASABLES),$(CREATABLEPATHS)))
|
|
93 |
|
|
94 |
# what
|
|
95 |
$(eval $(call whatmacro,$(RELEASABLES)))
|
|
96 |
|
|
97 |
|
|
98 |
endif # PRE_TYPE == VARIANTTYPE
|
|
99 |
endif # PRE_PLATFORM == VARIANTPLATFORM
|
|
100 |
|
|
101 |
|
|
102 |
# the end
|
|
103 |
|