260 ifeq ($(e32importlib_mk),) |
260 ifeq ($(e32importlib_mk),) |
261 e32importlib_mk:=1 |
261 e32importlib_mk:=1 |
262 include $(FLMHOME)/e32importlib.mk |
262 include $(FLMHOME)/e32importlib.mk |
263 endif |
263 endif |
264 |
264 |
|
265 # A processed .def file is required for: |
|
266 # 1: ABIv2 .dso and ABIv1 .lib import library generation |
|
267 # 2: linking where the build fixes exports using a .exp file |
|
268 # That is, in both cases, unless EXPORTUNFROZEN is being used |
|
269 ifneq ($(or $(IMPORTLIBRARYREQUIRED),$(FIX_EXPORTS_USING_EXP_FILE)),) |
|
270 ifneq ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
|
271 PREPPEDDEFFILE:= |
|
272 ifneq ($(DEFFILE),) |
|
273 ifeq ($(EXPORTUNFROZEN),) |
|
274 PREPPEDDEFFILE:=$(INTERMEDIATEPATH)/$(TARGET).prep |
|
275 CLEANTARGETS:=$(CLEANTARGETS) $(PREPPEDDEFFILE) |
|
276 $(eval $(importlibtarget_prepfile_$(BASE_ARCH))) |
|
277 endif |
|
278 endif |
|
279 endif |
|
280 endif |
|
281 |
265 ifneq ($(IMPORTLIBRARYREQUIRED),) |
282 ifneq ($(IMPORTLIBRARYREQUIRED),) |
266 ifneq ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
283 ifneq ($(or $(DEFFILE),$(EXPORTUNFROZEN)),) |
267 # Both ABIv2 .dso and ABIv1 .lib import library generation require a processed .def file, |
|
268 # unless EXPORTUNFROZEN is being used |
|
269 PREPPEDDEFFILE:= |
|
270 ifneq ($(DEFFILE),) |
|
271 ifeq ($(EXPORTUNFROZEN),) |
|
272 PREPPEDDEFFILE:=$(INTERMEDIATEPATH)/$(TARGET).prep |
|
273 CLEANTARGETS:=$(CLEANTARGETS) $(PREPPEDDEFFILE) |
|
274 $(eval $(importlibtarget_prepfile_$(BASE_ARCH))) |
|
275 endif |
|
276 endif |
|
277 |
|
278 # ABIv2 .dso |
284 # ABIv2 .dso |
279 ifneq ($(IMPORTLIBTARGET_DSO),) # check that we haven't tried to specify this target already |
285 ifneq ($(IMPORTLIBTARGET_DSO),) # check that we haven't tried to specify this target already |
280 |
286 |
281 # By Now we're committed to producing a target for this DSO so it's safe to |
287 # By Now we're committed to producing a target for this DSO so it's safe to |
282 # set the marker that will prevent any further targets from being made. |
288 # set the marker that will prevent any further targets from being made. |
476 # If appropriate, work out what CPP files will be created from the assembler files |
482 # If appropriate, work out what CPP files will be created from the assembler files |
477 CIAFILES:=$(call extractfilesoftype,$(CIAFILEEXTENSIONS),$(SOURCE)) |
483 CIAFILES:=$(call extractfilesoftype,$(CIAFILEEXTENSIONS),$(SOURCE)) |
478 CIA_CPPFILES:= |
484 CIA_CPPFILES:= |
479 ifeq ($(TRANSFORM_CIA),1) |
485 ifeq ($(TRANSFORM_CIA),1) |
480 CIA_CPPFILES:=$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.cpp,$(CIAFILES))) |
486 CIA_CPPFILES:=$(call relocatefiles,$(INTERMEDIATEPATH),$(call extractandmap,$(CIAFILEEXTENSIONS),_.cpp,$(CIAFILES))) |
481 else |
|
482 |
|
483 endif |
487 endif |
484 |
488 |
485 ## LINK ###################################################################### |
489 ## LINK ###################################################################### |
486 # Bring together all the .o files compiled from .cpp, .c, .s and .cia files. |
490 # Bring together all the .o files compiled from .cpp, .c, .s and .cia files. |
487 # These files are stored in the "non-releasable" output diretory. |
491 # These files are stored in the "non-releasable" output diretory. |
557 ifneq ($(ARTARGET),) |
561 ifneq ($(ARTARGET),) |
558 # Assuming that there are no libdeps in this case because this is probably one of the |
562 # Assuming that there are no libdeps in this case because this is probably one of the |
559 # Runtime libraries which has no deps. |
563 # Runtime libraries which has no deps. |
560 |
564 |
561 define artarget_func |
565 define artarget_func |
|
566 |
|
567 # Ensure that, when generating .via files, that they do not start with a blank line - some versions of GCC's AR reject |
|
568 # any further content in the file if the first line is empty |
|
569 |
562 $(ARTARGET): $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(LINKOBJECTS)) $(STDCPPTAGFILE) |
570 $(ARTARGET): $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(LINKOBJECTS)) $(STDCPPTAGFILE) |
563 $(if $(MULTIFILE_ENABLED),,@echo "$(STDCPPTAGFILE)" > $(VIAFILE); |
571 $(if $(MULTIFILE_ENABLED),,@echo $(if $(STDCPPTAGFILE),"$(STDCPPTAGFILE)",-n "") > $(VIAFILE); |
564 $(call groupin10,$(LINKOBJECTS)) ;) |
572 $(call groupin10,$(LINKOBJECTS)) ;) |
565 $(call startrule,ar,FORCESUCCESS) \ |
573 $(call startrule,ar,FORCESUCCESS) \ |
566 $$(call dblquote,$(AR)) $(ARCHIVER_CREATE_OPTION) $$@ $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(COMMANDFILE_OPTION)$(VIAFILE)) \ |
574 $$(call dblquote,$(AR)) $(ARCHIVER_CREATE_OPTION) $$@ $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT),$(COMMANDFILE_OPTION)$(VIAFILE)) \ |
567 $(call endrule,ar) |
575 $(call endrule,ar) |
568 endef |
576 endef |
827 # Evaluate .cpp and .c files in one go for multifile, cannot do in separate steps since we have the same target. |
835 # Evaluate .cpp and .c files in one go for multifile, cannot do in separate steps since we have the same target. |
828 # This implementation means the .c files will always get put at the end of the .via file. Maybe there is a better way to do this? |
836 # This implementation means the .c files will always get put at the end of the .via file. Maybe there is a better way to do this? |
829 $(if $(MULTIFILE_ENABLED),$(eval $(call e32abiv2_compile,$(MULTIFILEOBJECT),$(CPPFILES),$(CFILES),$(CPP_LANG_OPTION))),$(foreach F,$(CPPFILES),$(eval $(call e32abiv2_compile,$(call mapcpp2object,$(F)),$(F),$(CPP_LANG_OPTION))))) |
837 $(if $(MULTIFILE_ENABLED),$(eval $(call e32abiv2_compile,$(MULTIFILEOBJECT),$(CPPFILES),$(CFILES),$(CPP_LANG_OPTION))),$(foreach F,$(CPPFILES),$(eval $(call e32abiv2_compile,$(call mapcpp2object,$(F)),$(F),$(CPP_LANG_OPTION))))) |
830 $(if $(MULTIFILE_ENABLED),,$(foreach F,$(CFILES),$(eval $(call e32abiv2_compile,$(call mapc2object,$(F)),$(F),$(C_LANG_OPTION))))) |
838 $(if $(MULTIFILE_ENABLED),,$(foreach F,$(CFILES),$(eval $(call e32abiv2_compile,$(call mapc2object,$(F)),$(F),$(C_LANG_OPTION))))) |
831 ifneq ($(TRANSFORM_CIA),1) |
839 ifneq ($(TRANSFORM_CIA),1) |
832 $(if $(MULTIFILE_ENABLED),,$(foreach F,$(CIAFILES),$(eval $(call e32abiv2_compile,$(call mapcia2object,$(F)),$(F),$(CPP_LANG_OPTION) $(COMPILER_CIA_FLAGS))))) |
840 $(if $(MULTIFILE_ENABLED),,$(foreach F,$(CIAFILES),$(eval $(call e32abiv2_compile,$(call mapcia2object,$(F)),$(F),$(CPP_LANG_OPTION) $(COMPILER_CIA_FLAGS) $(call makemacrodef,-D,$(CIADEFS)))))) |
833 endif |
841 endif |
834 |
842 |
835 CLEANTARGETS:=$(CLEANTARGETS) $(if $(MULTIFILE_ENABLED),$(MULTIFILE_VIAFILE) $(MULTIFILEOBJECT),$(CPPFILES_LINKOBJECTS) $(CFILES_LINKOBJECTS) $(CIAFILES_LINKOBJECTS)) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) |
843 CLEANTARGETS:=$(CLEANTARGETS) $(if $(MULTIFILE_ENABLED),$(MULTIFILE_VIAFILE) $(MULTIFILEOBJECT),$(CPPFILES_LINKOBJECTS) $(CFILES_LINKOBJECTS) $(CIAFILES_LINKOBJECTS)) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) |
836 |
844 |
837 ## Listing target ################################################### |
845 ## Listing target ################################################### |