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 |
# Header file exporting Function Like Makefile (FLM)
|
|
15 |
# The file destinations relative to EPOCROOT
|
|
16 |
#
|
|
17 |
#
|
|
18 |
|
|
19 |
## Parameters that are expected:
|
|
20 |
# SOURCE
|
|
21 |
# HEADERONLY
|
|
22 |
# OUTPUTPATH
|
|
23 |
# EPOCROOT
|
|
24 |
# EXPORTPATH
|
|
25 |
|
|
26 |
## GLOBAL TARGETS ###############################################
|
|
27 |
.PHONY:: $(ALLTARGET)
|
|
28 |
$(ALLTARGET):: $(RELEASEABLES)
|
|
29 |
|
|
30 |
|
|
31 |
# StringTable FLM
|
|
32 |
|
|
33 |
|
|
34 |
EXPORT::
|
|
35 |
|
|
36 |
|
|
37 |
CLEANTARGETS:=
|
|
38 |
CLEANEXPORTS:=
|
|
39 |
RELEASEEXPORTS:=
|
|
40 |
CREATABLEPATHS:=$(OUTPUTPATH) $(EXPORTPATH)
|
|
41 |
|
|
42 |
# Work out the names of the various output files before
|
|
43 |
# trying to use them in rules and dependencies. Cuts repetition
|
|
44 |
# and avoids mistakes.
|
|
45 |
EXPORTEDSTRINGTABLEHEADER:=$(EXPORTPATH)/$(TARGET).h
|
|
46 |
STRINGTABLECPP:=$(OUTPUTPATH)/$(TARGET).cpp
|
|
47 |
STRINGTABLEHEADER:=$(OUTPUTPATH)/$(TARGET).h
|
|
48 |
STRINGTABLEPHONYTARGET:=$(OUTPUTPATH)_$(TARGET)
|
|
49 |
TEMPSOURCE:=$(OUTPUTPATH)/$(TARGET).st
|
|
50 |
|
|
51 |
# Macro to generate string table targets and rules
|
|
52 |
# Always return true if the make engine doesn't support
|
|
53 |
# the .IGNORE:: target.
|
|
54 |
define exportstringtableheader
|
|
55 |
|
|
56 |
EXPORT:: $(EXPORTEDSTRINGTABLEHEADER)
|
|
57 |
|
|
58 |
$(EXPORTEDSTRINGTABLEHEADER): $(STRINGTABLEHEADER)
|
|
59 |
$(call startrule,exportstringtableheader,FORCESUCCESS) \
|
|
60 |
$(GNUCP) '$(STRINGTABLEHEADER)' '$$@' \
|
|
61 |
$(call endrule,exportstringtableheader)
|
|
62 |
|
|
63 |
CLEANEXPORTS:=$(EXPORTEDSTRINGTABLEHEADER)
|
|
64 |
RELEASEEXPORTS:=$(EXPORTEDSTRINGTABLEHEADER)
|
|
65 |
endef
|
|
66 |
|
|
67 |
define genstringtable
|
|
68 |
$(STRINGTABLECPP) : $(STRINGTABLEHEADER)
|
|
69 |
|
|
70 |
$(STRINGTABLEHEADER): $(SOURCE)
|
|
71 |
$(call startrule,stringtable,FORCESUCCESS) \
|
|
72 |
$(GNUCP) --no-preserve=mode $(SOURCE) $(TEMPSOURCE) && $(GNUCHMOD) a+w $(TEMPSOURCE) && \
|
|
73 |
$(STRINGTABLE) $(TEMPSOURCE) \
|
|
74 |
$(call endrule,stringtable)
|
|
75 |
|
|
76 |
CLEANTARGETS:=$(STRINGTABLEHEADER) $(STRINGTABLECPP)
|
|
77 |
|
|
78 |
endef
|
|
79 |
|
|
80 |
|
|
81 |
$(if $(EXPORTPATH),$(eval $(exportstringtableheader)),)
|
|
82 |
$(if $(EXPORTPATH),,$(eval EXPORT:: $(STRINGTABLEHEADER)))
|
|
83 |
$(eval $(genstringtable))
|
|
84 |
|
|
85 |
|
|
86 |
## Clean up and log releasables (using eval to avoid target specific variables)
|
|
87 |
$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),))
|
|
88 |
$(eval $(call GenerateStandardCleanTarget,$(CLEANEXPORTS),,CLEANEXPORT))
|
|
89 |
# make the output directories while reading makefile - some build engines prefer this
|
|
90 |
$(call makepath,$(CREATABLEPATHS))
|
|
91 |
$(eval $(call whatmacro,$(RELEASEEXPORTS),WHATSTRINGTABLE))
|
|
92 |
|
|
93 |
########################
|
|
94 |
# SBSv1 example:
|
|
95 |
########################
|
|
96 |
# GENERATED_FILES= \
|
|
97 |
# $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.cpp \
|
|
98 |
# $(EPOCROOT)epoc32\include\WspParamConstants.h
|
|
99 |
#
|
|
100 |
# $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.cpp : ..\strings\WspParamConstants.st
|
|
101 |
# perl -S ecopyfile.pl ..\strings\WspParamConstants.st $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.st
|
|
102 |
# perl $(EPOCROOT)epoc32\tools\stringtable.pl $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.st
|
|
103 |
#
|
|
104 |
# $(EPOCROOT)epoc32\include\WspParamConstants.h : $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.cpp
|
|
105 |
# perl -S ecopyfile.pl $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.h $(EPOCROOT)epoc32\include\WspParamConstants.h
|
|
106 |
#
|