Rev 367 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
# -*- mode: mak -*-################################################################################ File: TOOLSET/mri68k.rul[e]# Contents: MRI 68k rules# Make definitions for the Microtec tools.## Version Who Date Description# APY 10/03/00 Error filtering# 20/03/00 LEAVETMP shall leave .src files# 22/03/00 NODEPDIRS# 05/06/00 __SOURCE__# 26/02/02 Build system +v2 support.# - ; appended to several directives, forcing use of# 'sh.exe' during execution. Required by WIN32# toolsets (see xx_term variables),# - added depend post processing to append OBJDIR# 27/05/02 - realpath# - quoted __SOURCE__, unquoted broke MRI 4.4# 12/03/04 mkdepend -b -o -p################################################################################################################################################################.. Remove "undef" warnings#cc_includes +=cc_defines +=as_includes +=as_defines +=cxx_includes +=cxx_defines +=################################################################################.. C Compiler definition## -v detects and issue warnings for features in source files# that can cause problems.# -Gf Generate fully qualified pathnames for input files.# -nOc Pop stack after each function call.# -nQ Dont terminate compile based on error count.# -Kf Generate stack frame for all functions.# -Z4 4 byte alignment.# -Feo Writes diagnostic message to stdout.## -nOl Disable local optimisation.# -nOR Disable automatic register variable assignment.## -Og Enables global-flow optimisation.# -Or Enables intruction scheduling optimisation.# -Ob Assume memory will not be changed externally.# -Oe Generate only one from a return.# -Os Favor code size.#cc = mcc68kcc_init =cc_o_switch =cc_object = -o$@cc_source =cc_cmdfile = $(basename $@).cmdcc_flags = -d$(cc_cmdfile)cc_term = ; # ';' forces use of 'sh.exe'cc_filter := "$(notdir $(wildcard $(GBE_ROOT)/warnings.mri*))"ifeq ($(strip $(cc_filter)), "warnings.mri") # doscc_redirect = 1cc_error_filter = $(awk) -f $(GBE_ROOT)/warnings.mrimri_flags += -nFee # Dont Output to stderr.endifcc_filter := "$(notdir $(wildcard $(GBE_ROOT)/WARNINGS.MRI*))"ifeq ($(strip $(cc_filter)), "WARNINGS.MRI") # WIN32 mixed casecc_redirect = 1cc_error_filter = $(awk) -f $(GBE_ROOT)/WARNINGS.MRImri_flags += -nFee # Dont Output to stderr.endifmri_includes += $(mri)mri_flags += -pCPU32 -c # Compile onlymri_flags += -v -Gf -nOc -nQ -Kf -Z4 -Feoifdef LEAVETMPmri_flags += -H -Fsm # Save assembly (with comments)endififdef MRI_NONANSImri_flags += -nv # Non ANSIendififeq "$(DEBUG)" "1"mri_flags += -g -DDEBUG # Full debugmri_flags += -nOl -nOR -nOg # no optimisationelseifdef MRI_OPTIMmri_flags += -Og -Or -Ob -Oe -Os # Full optimisationelsemri_flags += -nOl -nOR -nOg # Disable optimisationendifendififdef ALVLmri_flags += -DALVL=$(ALVL)endififdef DLVLmri_flags += -DDLVL=$(DLVL)endifmri_flags += -D__SOURCE__=\"$(notdir $<)\"define cc_pre@$(echo) [\$<] compiling.. ; \$(cmdfile) -ko$(cc_cmdfile) "\$(patsubst %,%\\n,$(CFLAGS)) \$(patsubst %,-D%\\n,$(cc_defines)) \$(patsubst %,%\\n,$(mri_flags)) \-J$(subst /,\\\\,$(dir $<))\\n \$(patsubst %,-J%\\n,$(subst /,\\\\,$(INCDIRS))) \$(patsubst %,-J%\\n,$(subst /,\\\\,$(cc_includes))) \$(patsubst %,-J%\\n,$(subst /,\\\\,$(mri_includes))) \$(subst /,\\\\,$(cc_object))\\n\@(realpath,$(subst /,\\,$<))"endefifndef LEAVETMPdefine cc_post@$(rm) -f $(cc_cmdfile)endefelsedefine cc_postendefendifcxx =cxx_init =cxx_o_switch =cxx_object =cxx_source =cxx_cmdfile =cxx_flags =cxx_term = ; # ';' forces use of 'sh.exe'################################################################################.. C/C++ dependencies# depend and depend.err#mri_depend = -D__STDC__ -D_MCC68Kifeq "$(DEBUG)" "1"mri_depend += -DDEBUGendififdef ALVLmri_depend += -DALVL=$(ALVL)endififdef DLVLmri_depend += -DDLVL=$(DLVL)endifmri_depend += -D__SOURCE__=$(notdir $<)ccdep = $(XX_PRE) $(GBE_BIN)/mkdependccdep_init =ccdep_o_switch = -f -#ccdep_source = $(filter %.c %.cc %.cpp, $+) > $(subst /,/,$@).tmp 2> $@.errccdep_source = $(filter %.c %.cc %.cpp, $+) > $@ 2> $@.errccdep_flags = -MM -b -p '$$(OBJDIR)/' -o ".$(o)" \$(patsubst %,%,$(CFLAGS)) \$(patsubst %,-D%,$(cc_defines)) \$(patsubst %,%,$(mri_depend)) \$(patsubst %,-I %,$(INCDIRS)) \$(patsubst %,-Y %,$(cc_includes)) \$(patsubst %,-Y %,$(mri_includes)) \$(patsubst %,-Y %,$(NODEPDIRS))ccdep_pre =ccdep_post =#ifndef LEAVETMP#define ccdep_post# -sed s/\^/\$$\(OBJDIR\)\\// $(subst /,/,$@).tmp | \# grep \\.${o} > $(subst /,/,$@)# @rm $(subst /,/,$@).tmp#endef#else#define ccdep_post# -sed s/\^/\$$\(OBJDIR\)\\// $(subst /,/,$@).tmp | \# grep \\.${o} > $(subst /,/,$@)#endef#endif################################################################################.. Assembler definition## Note: All the options go on the command line at present, as# such passes a minimal set of definitions. (v4.3 and v4.4)## Switchs should be embedded within the target source.#as = asm68kas_init =as_i_switch = -Ias_o_switch = -o$@as_source = <$<as_cmdfile =as_term = ; # ';' forces use of 'sh.exe'asm68_flags = -f"P=CPU32,d" # embedded debug info#asm68_flags += -f"NOPCR"#ifeq "$(DEBUG)" "1"#asm68_flags += -DDEBUG#endififdef ASFLAGSasm68_flags += $(ASFLAGS)endififdef as_definesasm68_flags += $(addprefix -D,$(as_defines))endifas_flags = $(asm68_flags)#ifdef INCDIRS#as_flags += "-I$(subst $(space),;,$(strip $(INCDIRS)))"#endififdef as_includesas_flags += "-I$(subst $(space),;,$(strip $(as_includes)))"endifdefine as_preendefdefine as_postendef#.. Archiver#ar = lib68kar_init =ar_cmdfile = $(basename $@).arar_flags =ar_o_switch = < $(ar_cmdfile)ar_term = ; # ';' forces use of 'sh.exe'define ar_pre-$(rm) -f $@@$(cmdfile) -ko$(ar_cmdfile) \create $@\\n\$(patsubst %,addmod %\\n,$(filter %.obj, $^))\save\\n end\\nendefifndef LEAVETMPdefine ar_post@$(rm) -f $(ar_cmdfile)endefelsedefine ar_postendefendif#.. Linker#ld = lnk68kld_cmdfile = $(basename $@).ldldabs_flags = -m -c$(ld_cmdfile)ldabs_o_switch = -o$@ > $(basename $@).mapldhex_flags = -m -Fs -c$(ld_cmdfile)ldhex_o_switch = -o$(basename $@).s > $(basename $@).mapld_term = ; # ';' forces use of 'sh.exe'rel_ld_term = ;define ld_pre@export MRI_LIB; \MRI_LIB="$(subst $(space),;,$(LIBDIRS))"; \$(cmdfile) -ko$(ld_cmdfile) "$($(notdir $(basename $@))_ld)"endefdefine ldabs_post@if [ -n "$$VISIONCLICK" ]; then \$(est32)/convert "$@" -c -m arm -b; \fiendefdefine ldhex_postendefifndef LEAVETMPdefine ld_post@$(rm) -f $(ld_cmdfile)endefelsedefine ld_postendefendifdefine LDDEPEND@export MRI_LIB; \MRI_LIB="$(subst $(space),;,$(LIBDIRS))"; \$(cmdfile) -ko$(BINDIR)/$(notdir $(basename $@)).dep "$($(notdir $(basename $@))_dp)"endefdefine LDABS@$(show_environment)$(ld_pre)$(ld) $(ldabs_flags) $(ldabs_o_switch) $(ld_term)$(ldabs_post)$(ld_post)endefdefine LDBIN@$(show_environment)$(ld_pre)$(ld) $(ldhex_flags) $(ldhex_o_switch) $(ld_term)$(ldhex_post)$(ld_post)endef#