|
1 # |
|
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 # All rights reserved. |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Nokia Corporation - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: Implementation of policymanagement components |
|
15 # |
|
16 |
|
17 ## Parameters that are expected: |
|
18 # SOURCEDIR |
|
19 # TARGETDIR |
|
20 # FILEPATTERN *.txt |
|
21 |
|
22 GENERICCOPYDEBUG:=0 |
|
23 ifeq ($(strip $(GENERICCOPYDEBUG)),1) |
|
24 $(info <SOURCEDIR sourcedir='$(SOURCEDIR)'/>) |
|
25 $(info <TARGETDIR targetdir='$(TARGETDIR)'/>) |
|
26 $(info <FILEPATTERN filepattern='$(FILEPATTERN)'/>) |
|
27 endif |
|
28 |
|
29 # Check if all the inputs are present |
|
30 $(if $(SOURCEDIR),,$(error Must define TARGETFILE)) |
|
31 $(if $(TARGETDIR),,$(error Must define GENPATH)) |
|
32 $(if $(FILEPATTERN),,$(error Must define MIFFILE)) |
|
33 |
|
34 GENERICCOPYGUARD:=$(call sanitise,TARGET_$(TARGETDIR)) |
|
35 |
|
36 define genericcopyfiles |
|
37 $(GENERICCOPYGUARD):=1 |
|
38 |
|
39 RESOURCE:: ALL_$(TARGETDIR) |
|
40 |
|
41 ALL_$(TARGETDIR): $(TARGETDIR)_NEW_ENV |
|
42 $(call startrule,copyfiles,FORCESUCCESS) \ |
|
43 $(GNUCP) $(EPOCROOT)/$(SOURCEDIR)/$(FILEPATTERN) $(EPOCROOT)/$(TARGETDIR)/ \ |
|
44 $(call endrule,copyfiles) |
|
45 |
|
46 $(TARGETDIR)_NEW_ENV: RM_$(TARGETDIR) |
|
47 $(GNUMKDIR) -p $(EPOCROOT)/$(TARGETDIR) |
|
48 |
|
49 RM_$(TARGETDIR): |
|
50 -$(GNURM) -f $(EPOCROOT)/$(TARGETDIR)/$(FILEPATTERN) |
|
51 |
|
52 endef |
|
53 |
|
54 ifeq ($($(GENERICCOPYGUARD)),) |
|
55 $(eval $(call genericcopyfiles)) |
|
56 endif |