author | Dario Sestito <darios@symbian.org> |
Wed, 15 Sep 2010 17:25:43 +0100 | |
branch | sf-sbs-distribution |
changeset 642 | 3517522ec7aa |
parent 577 | 70a350fada5a |
permissions | -rw-r--r-- |
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
1 |
# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 | 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 |
# Function Like Makefile (FLM) to create a resource header (.rsg) |
|
15 |
# and resource files (.rsc, .r01, .r02 etc.) |
|
16 |
# |
|
17 |
# |
|
18 |
||
19 |
## Parameters that are expected: |
|
20 |
# TARGET |
|
21 |
# TARGETPATH |
|
22 |
# LANGUAGES |
|
23 |
# HEADER |
|
24 |
# HEADERONLY |
|
25 |
# EPOCROOT |
|
26 |
# MMPDEFS |
|
27 |
# PRODUCT_INCLUDE |
|
28 |
# SYSTEMINCLUDE |
|
29 |
# USERINCLUDE |
|
30 |
# GNUCPP |
|
31 |
# GNUSED |
|
32 |
# RCOMP |
|
33 |
# OUTPUTPATH |
|
34 |
# SOURCE |
|
35 |
# BINCOPYDIRS |
|
36 |
||
37 |
||
38 |
# The rss is pre-processed once for each language and results |
|
39 |
# in a file with extension r$(LANGUAGE) where $(LANGUAGE) is |
|
40 |
# either "sc" or a 2 (or more) digit number. |
|
41 |
ifneq ($(TARGETPATH),) |
|
42 |
RSCDIR:=$(subst //,/,$(EPOCROOT)/epoc32/data/z/$(TARGETPATH)) |
|
43 |
else |
|
44 |
RSCDIR:=$(subst //,/,$(EPOCROOT)/epoc32/data) |
|
45 |
endif |
|
46 |
RESBASE:=$(RSCDIR)/$(TARGET_lower) |
|
47 |
||
48 |
# Ensure that RELEASABLES and CLEANTARGETS cannot expand indefinitely in successive calls to this flm: |
|
49 |
CLEANTARGETS:= |
|
50 |
RELEASABLES:= |
|
51 |
||
52 |
# There is only one resource header (.rsg) file and we only |
|
53 |
# make that if we are asked. |
|
54 |
RSGDIR:=$(EPOCROOT)/epoc32/include |
|
55 |
ifneq ($(or $(HEADER),$(HEADERONLY)),) |
|
56 |
RESOURCEHEADER:=$(RSGDIR)/$(HEADER) |
|
57 |
||
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
58 |
# If there are multiple LANGUAGES then it is the last one in the list |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
59 |
# which produces the header. |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
60 |
HEADLANG:=$(lastword $(LANGUAGES:SC=sc)) |
3 | 61 |
else |
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
62 |
HEADLANG:= |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
63 |
RESOURCEHEADER:= |
3 | 64 |
endif |
65 |
||
66 |
# we create intermediate .rpp and .d files |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
67 |
INTERBASE:=$(OUTPUTPATH)/$(TARGET_lower)$(if $(TARGETPATH),_$(subst /,_,$(TARGETPATH)),) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
68 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
69 |
################################## localisation ###########################$(GNUMKDIR)############# |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
70 |
# Only make copies for full resource builds |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
71 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
72 |
# Initialise to prevent RELEASABLES spill-over between calls |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
73 |
DESTRPP:= |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
74 |
INFOFILE:= |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
75 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
76 |
ifeq ($(HEADERONLY),) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
77 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
78 |
RSSBASENAME:=$(call lowercase,$(basename $(notdir $(SOURCE)))) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
79 |
DESTRPP:=$(EPOCROOT)/epoc32/localisation/$(RSSBASENAME)/rsc/$(RSSBASENAME).rpp |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
80 |
$(call makepath,$(EPOCROOT)/epoc32/localisation/$(RSSBASENAME)/rsc) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
81 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
82 |
INFOFILE:=$(EPOCROOT)/epoc32/localisation/group/$(RSSBASENAME).info |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
83 |
# If there are MULTIPLE languages then copy the .rpp for the last one |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
84 |
RPPLANG:=$(lastword $(LANGUAGES:SC=sc)) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
85 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
86 |
# Copy .rpp files from epoc32/build/ to epoc32/localisation/x/rsc/x.rpp and create .info files in localisation |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
87 |
define CreateRppAndInfo |
3 | 88 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
89 |
ifeq ($(RESOURCE_$(call sanitise,$(SOURCE))),) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
90 |
RESOURCE_$(call sanitise,$(SOURCE)):=1 |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
91 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
92 |
RESOURCE:: $(DESTRPP) $(INFOFILE) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
93 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
94 |
$(DESTRPP): $(INTERBASE)_$(RPPLANG).rpp |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
95 |
$(call startrule,rppfilecopy,FORCESUCCESS) \ |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
96 |
$(GNUCP) $$< $$@ \ |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
97 |
$(call endrule,rppfilecopy) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
98 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
99 |
$(INFOFILE):: |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
100 |
@if [ ! -d $(EPOCROOT)/epoc32/localisation/group ]; then $(GNUMKDIR) -p $(EPOCROOT)/epoc32/localisation/group; fi |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
101 |
@if [ ! -f $$@ ]; then echo "DATADIR: /$(RSSBASENAME)" > $$@ ; fi |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
102 |
@echo -e "\n/z$(TARGETPATH)/$(TARGET_lower).rsc : $(RSSBASENAME).rpp" >> $$@ |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
103 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
104 |
endif |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
105 |
endef |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
106 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
107 |
$(eval $(call CreateRppAndInfo)) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
108 |
endif |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
109 |
################################# end of localisation ################################### |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
110 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
111 |
# make the output directories while reading makefile - some build engines prefer this |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
112 |
$(call makepath,$(INTERBASE)) |
542
80c21f026f0a
fix: switch rfi file creation back on
timothy.murphy@nokia.com
parents:
539
diff
changeset
|
113 |
|
3 | 114 |
# common pre-processor options |
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
115 |
CPPOPT:=-nostdinc -undef -D_UNICODE -include $(PRODUCT_INCLUDE)\ |
471
8786668610ae
fix: revert -iquote since older cpps don't understand it
timothy.murphy@nokia.com
parents:
470
diff
changeset
|
116 |
-I$(dir $(SOURCE)) $(foreach I, $(USERINCLUDE),-I$(I) ) -I- $(foreach J,$(SYSTEMINCLUDE),-I$(J) ) |
3 | 117 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
118 |
CREATABLEPATHS:=$(RSCDIR) $(RSGDIR) $(OUTPUTPATH) |
470
f45853a5ce36
comments: better commenting in resource.flm
timothy.murphy@nokia.com
parents:
466
diff
changeset
|
119 |
|
3 | 120 |
# additional binary resource copies performed based on BINCOPYDIRS |
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
121 |
RSCCOPYDIRS:= |
3 | 122 |
ifneq ($(BINCOPYDIRS),) |
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
123 |
RSCCOPYDIRS:=$(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS))) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
124 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(RSCCOPYDIRS) |
3 | 125 |
endif |
126 |
||
127 |
############################################################################### |
|
128 |
define preprocessresource |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
129 |
# $(1) is the RPPFILE (eg. /epoc32/build/xxx/b_sc.rpp) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
130 |
# $(2) is the related RESOURCEFILE if any (eg. /a/b.rsc) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
131 |
# $(3) is the LANGUAGE (eg. sc or 01 or 02 ...) |
3 | 132 |
|
133 |
ifeq ($(TARGET_$(call sanitise,$1)),) |
|
134 |
TARGET_$(call sanitise,$1):=1 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
135 |
$(if $(FLMDEBUG),$(info preprocessresource: $(1) for $(2) LANG:$(3))) |
534
3b10c85868b1
fix resource deps: generate more cleanly - no targets if there are no prereqs. no empty lines.
timothy.murphy@nokia.com
parents:
533
diff
changeset
|
136 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
137 |
RESOURCE_DEPS:: $(1).d |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
138 |
$(1).d: $(SOURCE) |
3 | 139 |
$(call startrule,resourcedependencies,FORCESUCCESS) \ |
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
140 |
$(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
141 |
$(CPPOPT) $(SOURCE) -M -MG -MT"$(1)" | \ |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
142 |
$(GNUSED) -r 's# ([^ \/]+\.((rsg)|(mbg)))# $(EPOCROOT)\/epoc32\/include\/\1#ig' > $(1).d \ |
3 | 143 |
$(call endrule,resourcedependencies) |
144 |
||
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
145 |
$(1): $(1).d |
3 | 146 |
$(call startrule,resourcepreprocess,FORCESUCCESS) \ |
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
147 |
$(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
3 | 148 |
$(CPPOPT) $(SOURCE) -o $$@ \ |
149 |
$(call endrule,resourcepreprocess) |
|
150 |
||
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
151 |
CLEANTARGETS:= $$(CLEANTARGETS) $(1) |
3 | 152 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
153 |
$(eval DEPENDFILENAME:=$(1).d) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
154 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
155 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
156 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
157 |
ifneq "$(DEPENDFILE)" "" |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
158 |
ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" "" |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
159 |
-include $(DEPENDFILE) |
3 | 160 |
endif |
161 |
endif |
|
162 |
||
163 |
endif |
|
164 |
endef # preprocessresource # |
|
165 |
||
166 |
############################################################################### |
|
167 |
define copyresource |
|
168 |
# $(1) is the source |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
169 |
# $(2) is the destination |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
170 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
171 |
RELEASABLES:=$$(RELEASABLES) $(2) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
172 |
|
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
173 |
ifeq ($(TARGET_$(call sanitise,$2)),) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
174 |
TARGET_$(call sanitise,$2):=1 |
3 | 175 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
176 |
RESOURCE:: $2 |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
177 |
## perform additional copies of binaries |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
178 |
# |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
179 |
# Only certain builds require further copies of the generated resource binaries |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
180 |
# |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
181 |
$(2): $(1) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
182 |
$(call startrule,resourcecopy,FORCESUCCESS) \ |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
183 |
$(GNUCP) $$< $$@ \ |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
184 |
$(call endrule,resourcecopy) |
534
3b10c85868b1
fix resource deps: generate more cleanly - no targets if there are no prereqs. no empty lines.
timothy.murphy@nokia.com
parents:
533
diff
changeset
|
185 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
186 |
endif |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
187 |
|
3 | 188 |
endef # copyresource # |
189 |
||
190 |
############################################################################### |
|
191 |
define generateresource |
|
192 |
||
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
193 |
# $(1) is the resource filename e.g. /a/b/resource.rsc |
3 | 194 |
# $(2) is the preprocessed resource to make it from |
195 |
# $(3) is the language e.g. sc or 01 or 02 |
|
196 |
||
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
197 |
RELEASABLES:=$$(RELEASABLES) $(1) |
3 | 198 |
|
199 |
ifeq ($(TARGET_$(call sanitise,$1)),) |
|
200 |
TARGET_$(call sanitise,$1):=1 |
|
201 |
||
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
202 |
$(if $(FLMDEBUG),$(info generateresource: $(1) from $(2) LANG:$(3)),) |
3 | 203 |
|
204 |
||
205 |
RESOURCE:: $(1) |
|
206 |
||
207 |
$(1): $(2) $(RCOMP) |
|
208 |
$(call startrule,resourcecompile,FORCESUCCESS) \ |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
209 |
$(RCOMP) -m045,046,047 -u -o$(1) -s$(2) \ |
3 | 210 |
$(call endrule,resourcecompile) |
211 |
||
212 |
endif |
|
213 |
# Whether or not we have generated this resource for some other variant, check if there |
|
214 |
# are any new copies to be made for this variant. e.g. winscw requires that we make |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
215 |
# some extra copies. |
3 | 216 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
217 |
$(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(call copyresource,$(1),$(F))) |
3 | 218 |
|
219 |
# individual source file compilation |
|
220 |
SOURCETARGET_$(call sanitise,$(SOURCE)): $(1) |
|
221 |
||
222 |
endef # generateresource |
|
223 |
||
224 |
||
225 |
############################################################################### |
|
226 |
define generateresourceheader |
|
227 |
# $(1) is the resource header (eg. /epoc32/include/a.rsg) |
|
228 |
# $(2) is the preprocessed resource to make it from |
|
229 |
# $(3) is the language to use (eg. sc) |
|
230 |
||
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
231 |
RELEASABLES:= $$(RELEASABLES) $(1) |
3 | 232 |
|
233 |
ifeq ($(TARGET_$(call sanitise,$1)),) |
|
234 |
TARGET_$(call sanitise,$1):=1 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
235 |
$(if $(FLMDEBUG),$(info resourceheader: $(1) from $(2) LANG:$(3))) |
3 | 236 |
|
237 |
RESOURCE:: $(1) |
|
238 |
||
239 |
$(1): $(2) $(RCOMP) |
|
240 |
$(call startrule,resourceheader,FORCESUCCESS) \ |
|
241 |
$(RCOMP) -m045,046,047 -u -h$(1) -s$(2) \ |
|
242 |
$(call endrule,resourceheader) |
|
243 |
||
244 |
endif |
|
245 |
||
246 |
||
247 |
# individual source file compilation |
|
248 |
SOURCETARGET_$(call sanitise,$(SOURCE)): $(1) |
|
249 |
||
250 |
endef |
|
251 |
||
252 |
############################################################################### |
|
253 |
## call the generator |
|
254 |
||
255 |
# We always create at least the header |
|
256 |
# even if we sometimes don't create the resources |
|
257 |
ifneq ($(RESOURCEHEADER),) |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
258 |
$(eval $(call generateresourceheader,$(RESOURCEHEADER),$(INTERBASE)_$(HEADLANG).rpp,$(HEADLANG))) |
3 | 259 |
endif |
260 |
||
261 |
ifeq ($(HEADERONLY),) |
|
262 |
# generate a resource file for each language |
|
263 |
# For sc we generate $(RESBASE).rsc and define LANGUAGE_SC and LANGUAGE_sc. |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
264 |
$(foreach L,$(LANGUAGES:SC=sc),$(eval $(call preprocessresource,$(INTERBASE)_$(L).rpp,$(RESBASE).r$(L),$(L)))) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
265 |
$(foreach L,$(LANGUAGES:SC=sc),$(eval $(call generateresource,$(RESBASE).r$(L),$(INTERBASE)_$(L).rpp,$(L)))) |
3 | 266 |
else |
267 |
# No resources are going to be made so unless we specifically ask for it, there will be no |
|
268 |
# preprocessed file from which to create the header: |
|
269 |
||
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
270 |
$(eval $(call preprocessresource,$(INTERBASE)_$(HEADLANG).rpp,,$(HEADLANG))) |
3 | 271 |
|
272 |
endif |
|
273 |
||
274 |
############################################################################### |
|
275 |
## .rfi generation in support of the gccxml build |
|
276 |
## Note that .rfi files are created from the dependency files generated from preprocessing resources to create .rpp files |
|
277 |
ifneq ($(RFIFILE),) |
|
278 |
RESOURCE:: $(RFIFILE) |
|
279 |
RELEASABLES:=$(RELEASABLES) $(RFIFILE) |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
280 |
CREATABLEPATHS:=$(CREATABLEPATHS) $(dir $(RFIFILE)) |
3 | 281 |
|
642
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
282 |
RPPFILES:=$(foreach L,$(LANGUAGES:SC=sc),$(INTERBASE)_$(L).rpp) |
3517522ec7aa
Fix No rule to make SC issue
Dario Sestito <darios@symbian.org>
parents:
577
diff
changeset
|
283 |
$(eval $(call generaterfifile,$(RFIFILE),$(RPPFILES),$(addsuffix .d,$(RPPFILES)))) |
3 | 284 |
endif |
285 |
||
286 |
||
287 |
## Clean up |
|
5 | 288 |
$(call raptor_clean,$(CLEANTARGETS)) |
3 | 289 |
# make the output directories while reading makefile - some build engines prefer this |
290 |
$(call makepath,$(CREATABLEPATHS)) |
|
291 |
||
5 | 292 |
# for the --what option and the log file |
3 | 293 |
RELEASABLES:=$(RELEASABLES) $(DESTRPP) $(INFOFILE) |
5 | 294 |
$(call raptor_release,$(RELEASABLES),RESOURCE) |
3 | 295 |