# -*- mode: mak -*- ############################################################################### # File: TOOLSET/cygnus_thyron.rul[e] # Contents: Cygnus Thyron rules # # Revision History: # 17/10/02 APY Created from gcc toolset ################################################################### ############################################################################### #.. Remove "undef" warnings # cc_includes += cc_defines += cxx_include += cxx_defines += as_includes += as_defines += ############################################################################### #.. C Compiler definition # # -mh Generate code for the H8/300H chip. # -c Compile only # -0 Optimize # -ffloat-store Do not store floating point variables in registers # and inhabit other options that might change whether # floating point value is taken from register or # memory. # -g3 The compiler debugging option, followed by the level. # Level 3 included extra information. # -Wall Issue warnings. # -r Elimates the use of built-in implicit rules. # -save-temps Do not delete intermediate files # cc = gcc cc_init = cc_o_switch = -o $@ cc_source = $< cc_cmdfile = $(basename $@).cmd cc_flags = @$(cc_cmdfile) cc_term = gcc_includes += $(MPTLIB)/Lib/ # Include/xxx.h, must be prior to cygnus gcc_includes += $(MPTLIB)/StdCLib/Include gcc_flags = -mh -c -Wall -ffloat-store -r ifeq "$(DEBUG)" "1" gcc_flags += -g3 -O -DDEBUG else gcc_flags += -O endif ifdef ALVL gcc_flags += -DALVL=$(ALVL) endif ifdef DLVL gcc_flags += -DDLVL=$(DLVL) endif gcc_flags += -D__SOURCE__=\"$(notdir $<)\" ifdef LEAVETMP gcc_flags += -save-temps endif define cc_pre @echo '[$<] compiling..' ; \ $(cmdfile) -ko$(cc_cmdfile) "\ $(patsubst %,%,$(CFLAGS)) \ $(patsubst %,-D%,$(cc_defines)) \ $(patsubst %,%,$(gcc_flags)) \ $(patsubst %,-I %,$(INCDIRS)) \ $(patsubst %,-I %,$(cc_includes)) \ $(patsubst %,-I %,$(gcc_includes))"; endef define cc_post @$(rm) -f $(cc_cmdfile) endef ############################################################################### #.. C/C++ dependencies # depend and depend.err # # -M Generate make dependencies # -MM As -M, but ignore system header files # -MG Treat missing header files as generated # ifeq "$(DEBUG)" "1" gcc_depend += -DDEBUG endif ifdef ALVL gcc_depend += -DALVL=$(ALVL) endif ifdef DLVL gcc_depend += -DDLVL=$(DLVL) endif #ccdep = gcc -MG ccdep = $(GBE_BIN)/mkdepend ccdep_o_switch = -f - ccdep_init = ccdep_source = $(filter %.c %.cc %.cpp, $+) > $(subst /,/,$@).tmp 2> $@.err ccdep_flags = -MM \ $(patsubst %,%,$(CFLAGS)) \ $(patsubst %,-D%,$(cc_defines)) \ $(patsubst %,%,$(gcc_depend)) \ $(patsubst %,-I %,$(INCDIRS)) \ $(patsubst %,-I %,$(cc_includes)) \ $(patsubst %,-Y %,$(gcc_includes)) ccdep_pre = 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 ############################################################################### #.. C++ Compiler definition # cxx = gcc cxx_init = cxx_switch = -o $@ cxx_source = $< cxx_flags = \ $(patsubst %,%,$(CXXFLAGS)) \ $(patsubst %,-d%,$(cxx_defines)) \ $(patsubst %,%,$(gcc_flags)) \ $(patsubst %,-I %,$(INCDIRS)) \ $(patsubst %,-I %,$(cxx_includes)) \ $(patsubst %,-I %,$(gcc_includes)) cxx_term = ; # ';' forces use of 'sh.exe' define cxx_pre @echo '[$<] compiling..' endef define cxx_post endef ############################################################################### #.. Assembler definition # as = @as as_init = as_i_switch = -I$(space) as_o_switch = as_object = # BROKEN as_source = $< as_cmdfile = $(basename $@).cmd as_flags = $(as_object) @$(as_cmdfile) as_term = ; # ';' forces use of 'sh.exe' as_flags = -Wall ifeq "$(DEBUG)" "1" as_flags += -g as_defines += DEBUG=1 endif ifdef DLVL as_defines += DLVL=$(DLVL) endif ifdef ALVL as_defines += ALVL=$(ALVL) endif as_defines += $(as_flags) define as_pre @$(cmdfile) -ko$(as_cmdfile) "\ $(patsubst %,%\\n,$(ASFLAGS))\ $(patsubst %,--defsym %\\n,$(as_defines))\ $(patsubst %,$(as_i_switch)%\\n,$(INCDIRS))\ $(patsubst %,$(as_i_switch)%\\n,$(as_includes))" endef ifndef LEAVETMP define as_post @rm -f $@; mv a.out $@ @$(rm) -f $(as_cmdfile) endef else define as_post @rm -f $@; mv a.out $@ endef endif ############################################################################### #.. Archiver # ar = @ar ar_cmdfile = $(basename $@).ar ar_flags = -cvr ar_o_switch = $@ @$(ar_cmdfile) ar_term = ; # ';' forces use of 'sh.exe' define ar_pre @rm -f $@ @$(cmdfile) -ko$(ar_cmdfile) \ $(patsubst %,%\\n,$^) endef ifndef LEAVETMP define ar_post @$(rm) -f $(ar_cmdfile) endef else define ar_post endef endif ############################################################################### #.. Linker # ld = @ld ld_init = ld_cmdfile = $(basename $@).ld ld_o_switch = @$(ld_cmdfile) ld_term = ; # ';' forces use of 'sh.exe' ld_flags = define LDDEPEND @export GCC_LIB; \ GCC_LIB="$(subst $(space),;,$(LIBDIRS))"; \ $(cmdfile) -o$(BINDIR)/$(notdir $(basename $@)).dep "$($(notdir $(basename $@))_dp)" endef # define ld_pre @export GCC_LIB; \ GCC_LIB="$(subst $(space),;,$(LIBDIRS))"; \ $(cmdfile) -o$(ld_cmdfile) "$($(notdir $(basename $@))_ld)"; \ echo '[$@] Linking image ..' endef ifndef LEAVETMP define ld_post @$(rm) -f $(ld_cmdfile) endef else define ld_post endef endif define LDBIN @$(show_environment) $(ld_pre) $(ld) $(ld_flags) $(ld_o_switch) $(ld_term) $(ld_post) endef #