# -*- 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 # # -mapcs32 Generate code for a processor running with a 32-bit program # counter, and conforming to the function calling standards for # the APCS 32-bit option. # -mcpu specifies the name of the target ARM processor. # -msoft-float Generate output containing library calls for floating point. # -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_flags = \ $(patsubst %,%,$(CFLAGS)) \ $(patsubst %,-D%,$(cc_defines)) \ $(patsubst %,%,$(gcc_flags)) \ $(patsubst %,-I %,$(INCDIRS)) \ $(patsubst %,-I %,$(cc_includes)) \ $(patsubst %,-I %,$(gcc_includes)) cc_term = ; # ';' forces use of 'sh.exe' gcc_includes += $(MPTLIB)/genlib/asc/src # Src/xxx.h gcc_includes += $(MPTLIB)/genlib/com/src gcc_includes += $(MPTLIB)/genlib/dat/src gcc_includes += $(MPTLIB)/genlib/lwip/src gcc_includes += $(MPTLIB)/genlib/pcc/src gcc_includes += $(MPTLIB)/genlib/tmr/src gcc_includes += $(MPTLIB)/genlib/tsk/src gcc_includes += $(MPTLIB)/genlib/xtr/src gcc_includes += $(MPTLIB)/lib # Include/xxx.h, must be prior to GNU gcc_includes += $(MPTLIB)/stdclib/include gcc_includes += $(MPTLIB)/lib/include gcc_flags = -mapcs-32 -mcpu=arm7tdmi -msoft-float gcc_flags += -c -Wall -ffloat-store 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..' endef define cc_post endef ############################################################################### #.. C/C++ dependencies # # -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 += --gstabs 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 #