111 # make the output directories while reading makefile - some build engines prefer this |
111 # make the output directories while reading makefile - some build engines prefer this |
112 $(call makepath,$(INTERBASE)) |
112 $(call makepath,$(INTERBASE)) |
113 |
113 |
114 # common pre-processor options |
114 # common pre-processor options |
115 CPPOPT:=-nostdinc -undef -Wno-trigraphs -D_UNICODE -include $(PRODUCT_INCLUDE)\ |
115 CPPOPT:=-nostdinc -undef -Wno-trigraphs -D_UNICODE -include $(PRODUCT_INCLUDE)\ |
116 -I$(dir $(SOURCE)) $(foreach I, $(USERINCLUDE),-I$(I) ) -I- $(foreach J,$(SYSTEMINCLUDE),-I$(J) ) |
116 -I$(dir $(SOURCE)) $(foreach I, $(USERINCLUDE),-iquote $(I) ) $(foreach J,$(SYSTEMINCLUDE),-I $(J) ) |
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 |
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) |
128 |
128 |
129 ############################################################################### |
129 ############################################################################### |
|
130 |
|
131 |
130 define preprocessresource |
132 define preprocessresource |
131 # $(1) is the RPPFILE (eg. /epoc32/build/xxx/b_sc.rpp) |
133 # $(1) is the RPPFILE (eg. /epoc32/build/xxx/b_sc.rpp) |
132 # $(2) is the related RESOURCEFILE if any (eg. /a/b.rsc) |
134 # $(2) is the related RESOURCEFILE if any (eg. /a/b.rsc) |
133 # $(3) is the LANGUAGE (eg. sc or 01 or 02 ...) |
135 # $(3) is the LANGUAGE (eg. sc or 01 or 02 ...) |
134 |
136 |
135 ifeq ($(TARGET_$(call sanitise,$1)),) |
137 ifeq ($(TARGET_$(call sanitise,$1)),) |
136 TARGET_$(call sanitise,$1):=1 |
138 TARGET_$(call sanitise,$1):=1 |
137 $(if $(FLMDEBUG),$(info preprocessresource: $(1) for $(2) LANG:$(3))) |
139 $(if $(FLMDEBUG),$(info preprocessresource: $(1) for $(2) LANG:$(3))) |
|
140 |
|
141 |
|
142 # Correct dependency information when a header file can't be found: |
|
143 # assume its in epoc32\include |
|
144 |
|
145 ifneq ($(NO_DEPEND_GENERATE),) |
|
146 # This version minimises the size of dependency files, to contain only enough information |
|
147 # to allow the ordering to be correct. |
|
148 DEPENDENCY_CORRECTOR:={ $(GNUSED) -n -r '1 p;\# [^ \/]+\.((rsg)|(mbg))#I {s#([^ \/]+\.((rsg)|(mbg)))(.*[\\\\])?$$$$$$$$# $(EPOCROOT)\/epoc32\/include\/\1 [\\\\]#ig; p}' && echo "" ; } |
|
149 else |
|
150 # Generate full dependency information with correction only |
|
151 DEPENDENCY_CORRECTOR:=$(GNUSED) -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig' |
|
152 endif |
|
153 |
138 |
154 |
139 RESOURCE_DEPS:: $(1).d |
155 RESOURCE_DEPS:: $(1).d |
140 $(1).d: $(SOURCE) |
156 $(1).d: $(SOURCE) |
141 $(call startrule,resourcedependencies,FORCESUCCESS) \ |
157 $(call startrule,resourcedependencies,FORCESUCCESS) \ |
142 $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
158 $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
143 $(CPPOPT) $(SOURCE) -M -MG -MT"$(1)" | \ |
159 $(CPPOPT) $(SOURCE) -M -MG -MT"$(1)" | \ |
144 $(GNUSED) -r 's# ([^ \/]+\.((rsg)|(mbg)))# $(EPOCROOT)\/epoc32\/include\/\1#ig' > $(1).d \ |
160 $(DEPENDENCY_CORRECTOR) >$$@ \ |
145 $(call endrule,resourcedependencies) |
161 $(call endrule,resourcedependencies) |
146 |
162 |
147 $(1): $(1).d |
163 $(1): $(1).d |
148 $(call startrule,resourcepreprocess,FORCESUCCESS) \ |
164 $(call startrule,resourcepreprocess,FORCESUCCESS) \ |
149 $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
165 $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
156 $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
172 $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
157 |
173 |
158 CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
174 CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
159 ifneq "$(DEPENDFILE)" "" |
175 ifneq "$(DEPENDFILE)" "" |
160 ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" "" |
176 ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" "" |
161 -include $(DEPENDFILE) |
177 ifeq "$(filter RESOURCE_DEPS,$(call uppercase,$(MAKECMDGOALS)))" "" |
|
178 -include $(DEPENDFILE) |
|
179 endif |
162 endif |
180 endif |
163 endif |
181 endif |
164 |
182 |
165 endif |
183 endif |
166 endef # preprocessresource # |
184 endef # preprocessresource # |