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 # additional binary resource copies performed based on BINCOPYDIRS |
120 # additional binary resource copies performed based on BINCOPYDIRS |
121 RSCCOPYDIRS:= |
121 RSCCOPYDIRS:= |
123 RSCCOPYDIRS:=$(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS))) |
123 RSCCOPYDIRS:=$(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS))) |
124 CREATABLEPATHS:=$(CREATABLEPATHS) $(RSCCOPYDIRS) |
124 CREATABLEPATHS:=$(CREATABLEPATHS) $(RSCCOPYDIRS) |
125 endif |
125 endif |
126 |
126 |
127 ############################################################################### |
127 ############################################################################### |
|
128 |
|
129 |
128 define preprocessresource |
130 define preprocessresource |
129 # $(1) is the RPPFILE (eg. /epoc32/build/xxx/b_sc.rpp) |
131 # $(1) is the RPPFILE (eg. /epoc32/build/xxx/b_sc.rpp) |
130 # $(2) is the related RESOURCEFILE if any (eg. /a/b.rsc) |
132 # $(2) is the related RESOURCEFILE if any (eg. /a/b.rsc) |
131 # $(3) is the LANGUAGE (eg. sc or 01 or 02 ...) |
133 # $(3) is the LANGUAGE (eg. sc or 01 or 02 ...) |
132 |
134 |
133 ifeq ($(TARGET_$(call sanitise,$1)),) |
135 ifeq ($(TARGET_$(call sanitise,$1)),) |
134 TARGET_$(call sanitise,$1):=1 |
136 TARGET_$(call sanitise,$1):=1 |
135 $(if $(FLMDEBUG),$(info preprocessresource: $(1) for $(2) LANG:$(3))) |
137 $(if $(FLMDEBUG),$(info preprocessresource: $(1) for $(2) LANG:$(3))) |
|
138 |
|
139 |
|
140 # Correct dependency information when a header file can't be found: |
|
141 # assume its in epoc32\include |
|
142 |
|
143 ifneq ($(NO_DEPEND_GENERATE),) |
|
144 # This version minimises the size of dependency files, to contain only enough information |
|
145 # to allow the ordering to be correct. |
|
146 DEPENDENCY_CORRECTOR:={ $(GNUSED) -n -r '1 p;\# [^ \/]+\.((rsg)|(mbg))#I {s#([^ \/]+\.((rsg)|(mbg)))(.*[\\\\])?$$$$$$$$# $(EPOCROOT)\/epoc32\/include\/\1 [\\\\]#ig; p}' && echo "" ; } |
|
147 else |
|
148 # Generate full dependency information with correction only |
|
149 DEPENDENCY_CORRECTOR:=$(GNUSED) -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig' |
|
150 endif |
|
151 |
136 |
152 |
137 RESOURCE_DEPS:: $(1).d |
153 RESOURCE_DEPS:: $(1).d |
138 $(1).d: $(SOURCE) |
154 $(1).d: $(SOURCE) |
139 $(call startrule,resourcedependencies,FORCESUCCESS) \ |
155 $(call startrule,resourcedependencies,FORCESUCCESS) \ |
140 $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
156 $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
141 $(CPPOPT) $(SOURCE) -M -MG -MT"$(1)" | \ |
157 $(CPPOPT) $(SOURCE) -M -MG -MT"$(1)" | \ |
142 $(GNUSED) -r 's# ([^ \/]+\.((rsg)|(mbg)))# $(EPOCROOT)\/epoc32\/include\/\1#ig' > $(1).d \ |
158 $(DEPENDENCY_CORRECTOR) >$$@ \ |
143 $(call endrule,resourcedependencies) |
159 $(call endrule,resourcedependencies) |
144 |
160 |
145 $(1): $(1).d |
161 $(1): $(1).d |
146 $(call startrule,resourcepreprocess,FORCESUCCESS) \ |
162 $(call startrule,resourcepreprocess,FORCESUCCESS) \ |
147 $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
163 $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\ |
154 $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
170 $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
155 |
171 |
156 CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
172 CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
157 ifneq "$(DEPENDFILE)" "" |
173 ifneq "$(DEPENDFILE)" "" |
158 ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" "" |
174 ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" "" |
159 -include $(DEPENDFILE) |
175 ifeq "$(filter RESOURCE_DEPS,$(call uppercase,$(MAKECMDGOALS)))" "" |
|
176 -include $(DEPENDFILE) |
|
177 endif |
160 endif |
178 endif |
161 endif |
179 endif |
162 |
180 |
163 endif |
181 endif |
164 endef # preprocessresource # |
182 endef # preprocessresource # |