625
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
1 |
#
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
2 |
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
3 |
# All rights reserved.
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
4 |
# This component and the accompanying materials are made available
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
5 |
# under the terms of the License "Eclipse Public License v1.0"
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
6 |
# which accompanies this distribution, and is available
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
8 |
#
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
9 |
# Initial Contributors:
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
10 |
# Nokia Corporation - initial contribution.
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
11 |
#
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
12 |
# Contributors:
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
13 |
#
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
14 |
# Description:
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
15 |
#
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
16 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
17 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
18 |
# Macros for creating Standard targets
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
19 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
20 |
ifeq ($(_METAFLM_MK_),)
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
21 |
_METAFLM_MK_:=1
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
22 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
23 |
## path creation #########################
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
24 |
# Make the destination directory if neccessary. For some
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
25 |
# make engines we must do this outside the rule or they
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
26 |
# get confused by the apparent way in which different rules
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
27 |
# can create a particular directory and they infer some kind
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
28 |
# of dependency.
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
29 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
30 |
# Makepath. Copyright (C) 2008 Symbian Software Ltd.
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
31 |
# buffering with repeat prevention, makes directories after every 30 calls. Any more might overload
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
32 |
# the createprocess limit on arguments.
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
33 |
#
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
34 |
# makepathLIST is initialised in globals.mk
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
35 |
define makepath_single
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
36 |
$(if $(findstring $1,$(makepathLIST)),,$(eval makepathLIST:=$(makepathLIST) $1))
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
37 |
$(if $(subst 90,,$(words $(makepathLIST))),,$(shell $(GNUMKDIR) -p $(makepathLIST))$(eval makepathLIST:=))
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
38 |
endef
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
39 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
40 |
# The following turns out to be extremely slow - something to do with using eval
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
41 |
# or to do with creating huge numbers of TARGET_ variables? BTW, this is an attempt
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
42 |
# to not make things that we have already made.
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
43 |
# define makepath
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
44 |
# $(info makepath_start)$(foreach DIR,$1,$(if $(TARGET_$(1)),,$(call makepath_single,$(DIR))$(eval TARGET_$(1):=1)))$(info makepath_end)
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
45 |
# endef
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
46 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
47 |
# In general, makepath creates directories during FLM evaluation.
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
48 |
# However, if the WHAT target is being processed then it should do nothing.
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
49 |
define makepath
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
50 |
$(strip $(foreach DIR,$(sort $1),$(call makepath_single,$(DIR))))
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
51 |
endef
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
52 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
53 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
54 |
define makepathfor
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
55 |
$(call makepath,$(dir $1))
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
56 |
endef
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
57 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
58 |
# Make any remaining paths in the path buffer
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
59 |
define makepathfinalise
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
60 |
$(strip $(if $(makepathLIST),$(shell $(GNUMKDIR) $(makepathLIST))$(eval makepathLIST:=),))
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
61 |
endef
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
62 |
|
Richard Taylor <richard.i.taylor@nokia.com>
parents:
diff
changeset
|
63 |
## END TEST BATCH FILES MACRO
|