57 |
57 |
58 # If there are multiple LANGUAGES then it is the last one in the list |
58 # If there are multiple LANGUAGES then it is the last one in the list |
59 # which produces the header. |
59 # which produces the header. |
60 HEADLANG:=$(lastword $(LANGUAGES:SC=sc)) |
60 HEADLANG:=$(lastword $(LANGUAGES:SC=sc)) |
61 else |
61 else |
62 HEADLANG:= |
62 HEADLANG:= |
63 RESOURCEHEADER:= |
63 RESOURCEHEADER:= |
64 endif |
64 endif |
65 |
65 |
66 # we create intermediate .rpp and .d files |
66 # we create intermediate .rpp and .d files |
67 INTERBASE:=$(OUTPUTPATH)/$(TARGET_lower) |
67 INTERBASE:=$(OUTPUTPATH)/$(TARGET_lower) |
117 |
117 |
118 CREATABLEPATHS:=$(RSCDIR) $(RSGDIR) $(OUTPUTPATH) |
118 CREATABLEPATHS:=$(RSCDIR) $(RSGDIR) $(OUTPUTPATH) |
119 |
119 |
120 # We intend to generate the resource in an intermediate locationand copy to the final destination to |
120 # We intend to generate the resource in an intermediate locationand copy to the final destination to |
121 # ensure that when the "same" resource is built into separare locations it is |
121 # ensure that when the "same" resource is built into separare locations it is |
122 RSCCOPYDIRS:=$(RESBASE) |
122 RSCCOPYDIRS:=$(RSCDIR) |
123 # additional binary resource copies performed based on BINCOPYDIRS |
123 # additional binary resource copies performed based on BINCOPYDIRS |
124 ifneq ($(BINCOPYDIRS),) |
124 ifneq ($(BINCOPYDIRS),) |
125 RSCCOPYDIRS:=$(RSCCOPYDIRS) $(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS))) |
125 RSCCOPYDIRS:=$(RSCCOPYDIRS) $(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS))) |
126 endif |
126 endif |
127 CREATABLEPATHS:=$(CREATABLEPATHS) $(RSCCOPYDIRS) |
127 CREATABLEPATHS:=$(CREATABLEPATHS) $(RSCCOPYDIRS) |
134 # $(2) is the related RESOURCEFILE if any (eg. /a/b.rsc) |
134 # $(2) is the related RESOURCEFILE if any (eg. /a/b.rsc) |
135 # $(3) is the LANGUAGE (eg. sc or 01 or 02 ...) |
135 # $(3) is the LANGUAGE (eg. sc or 01 or 02 ...) |
136 |
136 |
137 ifeq ($(TARGET_$(call sanitise,$1)),) |
137 ifeq ($(TARGET_$(call sanitise,$1)),) |
138 TARGET_$(call sanitise,$1):=1 |
138 TARGET_$(call sanitise,$1):=1 |
139 $(if $(FLMDEBUG),$(info preprocessresource: $(1) for $(2) LANG:$(3))) |
139 $(if $(FLMDEBUG),$(info <debug>preprocessresource: $(1) for $(2) LANG:$(3)</debug>)) |
140 |
140 |
141 |
141 |
142 # Correct dependency information when a header file can't be found: |
142 # Correct dependency information when a header file can't be found. |
143 # assume its in epoc32\include |
143 # If the c preprocessor can't find a dependency it appears as it did in the #include statement |
144 |
144 # e.g. "filename.mbg" or "filename.rsg" in the dependency file. |
145 ifneq ($(NO_DEPEND_GENERATE),) |
145 # we can correct the dependencies by assuming that the file will be in epoc32\include as this is the default |
146 # This version minimises the size of dependency files, to contain only enough information |
146 ifneq ($(NO_DEPEND_GENERATE),) |
147 # to allow the ordering to be correct. |
147 # This version minimises the size of dependency files, to contain only .mbg and .rsg deps. |
148 DEPENDENCY_CORRECTOR:={ $(GNUSED) -n -r '1 p;\# [^ \/]+\.((rsg)|(mbg))#I {s#([^ \/]+\.((rsg)|(mbg)))(.*[\\\\])?$$$$$$$$# $(EPOCROOT)\/epoc32\/include\/\1 [\\\\]#ig; p}' && echo "" ; } |
148 # It allows resources to be built in the right order but doesn't impose the weight of |
149 else |
149 # of full dependency information which can overwhelm make in large builds. |
150 # Generate full dependency information with correction only |
150 DEPENDENCY_CORRECTOR:={ $(GNUSED) -n -r '1 p;\% [^ \/]+\.((rsg)|(mbg))%I {s% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig; p}' && echo "" ; } |
151 DEPENDENCY_CORRECTOR:=$(GNUSED) -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig' |
151 else |
152 endif |
152 # Generate full dependency information |
|
153 DEPENDENCY_CORRECTOR:=$(GNUSED) -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig' |
|
154 endif |
153 |
155 |
154 |
156 |
155 RESOURCE_DEPS:: $(1).d |
157 RESOURCE_DEPS:: $(1).d |
156 $(1).d: $(SOURCE) |
158 $(1).d: $(SOURCE) |
157 $(call startrule,resourcedependencies,FORCESUCCESS) \ |
159 $(call startrule,resourcedependencies,FORCESUCCESS) \ |
174 CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
176 CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
175 ifneq "$(DEPENDFILE)" "" |
177 ifneq "$(DEPENDFILE)" "" |
176 ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" "" |
178 ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" "" |
177 ifeq "$(filter RESOURCE_DEPS,$(call uppercase,$(MAKECMDGOALS)))" "" |
179 ifeq "$(filter RESOURCE_DEPS,$(call uppercase,$(MAKECMDGOALS)))" "" |
178 -include $(DEPENDFILE) |
180 -include $(DEPENDFILE) |
179 endif |
181 endif |
180 endif |
182 endif |
181 endif |
183 endif |
182 |
184 |
183 endif |
185 endif |
184 endef # preprocessresource # |
186 endef # preprocessresource # |
232 endif |
234 endif |
233 # Whether or not we have generated this resource for some other variant, check if there |
235 # Whether or not we have generated this resource for some other variant, check if there |
234 # are any new copies to be made for this variant. e.g. winscw requires that we make |
236 # are any new copies to be made for this variant. e.g. winscw requires that we make |
235 # some extra copies. |
237 # some extra copies. |
236 |
238 |
|
239 $(if $(FLMDEBUG),$(info <debug>resource copies of $(notdir $1) in: $(RSCCOPYDIRS)</debug>)) |
|
240 $(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(call copyresource,$(1),$(F))) |
237 $(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(call copyresource,$(1),$(F))) |
241 $(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(call copyresource,$(1),$(F))) |
238 |
242 |
239 # individual source file compilation |
243 # individual source file compilation |
240 SOURCETARGET_$(call sanitise,$(SOURCE)): $(1) |
244 SOURCETARGET_$(call sanitise,$(SOURCE)): $(1) |
241 |
245 |
250 |
254 |
251 RELEASABLES:= $$(RELEASABLES) $(1) |
255 RELEASABLES:= $$(RELEASABLES) $(1) |
252 |
256 |
253 ifeq ($(TARGET_$(call sanitise,$1)),) |
257 ifeq ($(TARGET_$(call sanitise,$1)),) |
254 TARGET_$(call sanitise,$1):=1 |
258 TARGET_$(call sanitise,$1):=1 |
255 $(if $(FLMDEBUG),$(info resourceheader: $(1) from $(2) LANG:$(3))) |
259 $(if $(FLMDEBUG),$(info <debug>resourceheader: $(1) from $(2) LANG:$(3)</debug>)) |
256 |
260 |
257 RESOURCE:: $(1) |
261 RESOURCE:: $(1) |
258 |
262 |
259 $(1): $(2) $(RCOMP) |
263 $(1): $(2) $(RCOMP) |
260 $(call startrule,resourceheader,FORCESUCCESS) \ |
264 $(call startrule,resourceheader,FORCESUCCESS) \ |