3
|
1 |
# Copyright (c) 2007-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 recursively copy one directory into another.
|
|
17 |
|
|
18 |
# parameters
|
|
19 |
#
|
|
20 |
# SOURCE_DIR the source directory, relative to EXTENSION_ROOT
|
|
21 |
# DEST_DIR the destination directory, relative to EPOCROOT
|
|
22 |
|
|
23 |
SOURCEPATH:=$(EXTENSION_ROOT)/$(SOURCE_DIR)
|
|
24 |
DESTPATH:=$(EPOCROOT)/$(DEST_DIR)
|
|
25 |
|
|
26 |
# create the destination directory
|
|
27 |
$(call makepath,$(DESTPATH))
|
|
28 |
|
|
29 |
# macro for copying.
|
|
30 |
define copydirectory
|
|
31 |
|
|
32 |
# everything gets copied every time.
|
|
33 |
ALL::
|
|
34 |
$(call startrule,copydir) \
|
|
35 |
$(GNUCP) -R $(SOURCEPATH)/* $(DESTPATH) && \
|
|
36 |
$(GNUCHMOD) -R a+rw $(DESTPATH) \
|
|
37 |
$(call endrule,copydir)
|
|
38 |
|
|
39 |
# CLEAN removes the whole destination directory.
|
|
40 |
CLEAN::
|
|
41 |
$(call startrule,clean) \
|
|
42 |
$(GNURM) -rf $(DESTPATH) \
|
|
43 |
$(call endrule,clean)
|
|
44 |
|
|
45 |
endef # copydirectory
|
|
46 |
|
|
47 |
$(eval $(copydirectory))
|
|
48 |
|
|
49 |
# for WHAT reporting we have to list every file because CBR
|
|
50 |
# wont just take a directory name and include the contents.
|
|
51 |
|
|
52 |
# normally we would just use the "whatmacro" macro, which
|
|
53 |
# handles everything nicely for us, but we are likely to be
|
|
54 |
# generating long lists of files here and might over-run the
|
|
55 |
# space available for a single variable :-(
|
|
56 |
|
|
57 |
FINDFILES:=$(GNUFIND) $(SOURCEPATH) -type f -print | $(GNUSED) 's!$(SOURCEPATH)!$(DESTPATH)!'
|
|
58 |
|
|
59 |
define whatcopies
|
|
60 |
|
|
61 |
WHAT::
|
|
62 |
@(echo "<whatlog bldinf='$(COMPONENT_META)' mmp='$(PROJECT_META)' config='$(SBS_CONFIGURATION)'>"; \
|
|
63 |
$(FINDFILES) | (read LINE; \
|
|
64 |
while [ $$$$? -eq 0 ]; do \
|
|
65 |
echo "<build>$$$$LINE</build>"; \
|
|
66 |
read LINE; \
|
|
67 |
done); \
|
|
68 |
echo "</whatlog>") $(if $(DESCRAMBLE),2>&1 | $(DESCRAMBLE))
|
|
69 |
|
|
70 |
endef # whatcopies
|
|
71 |
|
|
72 |
$(eval $(whatcopies))
|
|
73 |
|