Rev 5709 | Blame | Compare with Previous | Last modification | View Log | RSS feed
# -*- mode: mak; -*-################################################################################ COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.## File: TOOLSET/dafbr.rul[e]# Contents: daf br compiler rules## Description:# This file provides Toolset rules for the target makefiles# The file is dropped into the target makefile## Revision History:# 16-Dec-04 DDP Started Work###############################################################################################################################################################.. Remove "undef" warnings#cc_includes +=cc_defines +=brcc_flags +=################################################################################.. Parse user options# Global options already parsed# These options extend the global optionsifdef OPTIONSendif################################################################################.. Compiler definitions#ifdef ALVLcc_defines += -DALVL=$(ALVL)endififdef DLVLcc_defines += -DDLVL=$(DLVL)endifcc_defines += -D__SOURCE__=\"$(notdir $<)\"br_includes = $(DAFBROPCODE_PATH) $(DAFBRCOMPILER_PATH)## Compiler flags:# /g file - payload definition file# /l path - loads the specified opcode table file# /little - output endian# /big - output endian# /d* - All debug files# /d - Define debug maro onlyifeq "$(DEBUG)" "1" # debug/prod specificcc_defines += -D_DEBUGbrcc_flags += /delsecc_defines += -DNDEBUGendifbrcc_flags += /e$(ENDIAN)ifdef USE_OPTIMISE # default for productionbrcc_flags += /oelsebrcc_flags +=endififdef DAFBR_V2 # Version-2 compilerbrcc_flags += /nopayload /g $(BRCC_DEF)endif# Command#..cc = $(CC_PRE) $(DAFBRCOMPILER)cc_init =cc_o_switch = /Fr $(subst /,\,$@)cc_source = $(subst /,\\,$<)cc_flags = \$(brcc_flags) \$(patsubst %,/l %,$(subst /,\,$(DAFBROPCODE))) \$(patsubst %,%,$(CFLAGS)) \$(subst $(spacealt),$(space),$(patsubst %,/I %,$(subst /,\,$(INCDIRS)))) \$(subst $(spacealt),$(space),$(patsubst %,/I %,$(subst /,\,$(cc_includes)))) \$(subst $(spacealt),$(space),$(patsubst %,/I %,$(subst /,\,$(br_includes))))cc_term =define cc_pre@$(echo) '[$<] compiling..'endefcc_post =cc_filter := "$(notdir $(wildcard $(GBE_ROOT)/warnings.dafbr))"ifeq ($(strip $(cc_filter)), "warnings.dafbr")cc_filter = $(GBE_ROOT)/warnings.dafbrelsecc_filter =endififdef cc_filtercc_redirect_stderr = 1cc_error_filter = $(awk) -f $(cc_filter)endif################################################################################.. C/C++ dependencies# depend and depend.err#cc_depend =ccdep = $(XX_PRE) $(GBE_BIN)/mkdependccdep_init =ccdep_o_switch = -f -ccdep_source = $(filter %.c %.cc %.cpp, $+) > $@ 2> $@.errccdep_flags = -MM -b -We -p '$$(OBJDIR)/' \$(foreach shname,$(SHNAMES),-p '$$(OBJDIR)/$(shname)/') \-o ".$(o)" \$(patsubst %,%,$(cc_depend)) \$(patsubst %,%,$(cc_defines)) \$(patsubst %,%,$(CFLAGS)) \$(patsubst %,%,$(CXXFLAGS)) \$(patsubst %,-D%,$(cc_defines)) \$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(subst /,\,$(INCDIRS)))) \$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(subst /,\,$(cc_includes)))) \$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(subst /,\,$(br_includes)))) \$(patsubst %,-Y %,$(NODEPDIRS))ccdep_pre =ccdep_post =#.. Application# Link one or more .rul files into a single .bin file# The individual .rul files are not specified. The compiler is# instructed to look for them in the OBJECT directory## Note: BRLD_FLAGS and BRLD_DEF are target specific variables# They cannot be tested with a "ifdef", but can be used# in substitutions## Default values are set within the makefile and may# be overriden within the recipe#ld = $(CC_PRE) $(DAFBRCOMPILER)ld_o_switch = $(patsubst %,/I %,$(sort $(^D))) /Fp $(subst /,\,$@)ld_term =ld_flags = \/nocompile \$(patsubst %,/%,$(BRLD_FLAGS)) \/e$(ENDIAN) \/g $(subst /,\,$(BRLD_DEF)) \$(subst $(spacealt),$(space),$(patsubst %,/I %,$(subst /,\,$(INCDIRS)))) \$(subst $(spacealt),$(space),$(patsubst %,/I %,$(subst /,\,$(cc_includes)))) \$(subst $(spacealt),$(space),$(patsubst %,/I %,$(subst /,\,$(br_includes))))define ld_preecho '[$@] Generating Payload ..'endefld_post =