Rev 255 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
################################################################################ File: TOOLSET/csharp.rul[e]# Contents: Visual C/C++ CSHARP rules##............................................................................#################################################################################.. Remove "undef" warnings#################################################################################.. Parse user options# Global options already parsed# These options extend the global options#ifdef OPTIONSifneq "$(findstring wall,$(OPTIONS))" "" # Enable all warningsUSE_WALL = 1endifendif################################################################################ Standard library paths# Export LIB as this is used by the library generation process to determine# the locations of libraries. cmdfile will use 'LIB" for vglob resolving## Take care of spaces##..vc_libs =\$(subst ;,$(space),$(subst \,/,$(subst $(space),$(spacealt),$(VC_LIB))))ALL_LIBDIRS = $(LIBDIRS);$(vc_libs)LIB =\$(subst $(spacealt),$(space),$(subst $(space),$(empty),$(patsubst %,%;,$(subst /,\,$(ALL_LIBDIRS)))))export LIB#################################################################################.. Resource Genorator#define RESGEN@$(echo) [$@] Compile Resource ..@$(show_environment)$(XX_PRE) resgen $(subst /,\\,$(filter %.resx,$^)) $(subst /,\\,$@)endef##.. CSharp Compiler# Used to create Programs a DLLs#define CSC$(AA_PRE)$(csc_pre)@$(show_environment)$(csc) $(csc_flags) $(csc_o_switch)$(AA_PRE)$(csc_post)endef## Definitions for the CSharp Compiler Macro# csc_pre - Before the CSC command# csc - The CSC command# csc_flags - Command line options (visible)# csc_o_switch - Command line output options (visible)# csc_post - CSC command cleanup# csc_cmdfile - Name of the generated response file# csc_defines - Local definitions will be placed on cmd line#csc_pre =csc = $(CC_PRE) csccsc_flags =csc_o_switch = $(csc_flags) @$(csc_cmdfile)csc_post =csc_cmdfile = $(basename $@).ldcsc_defines =define csc_pre$(cmdfile) -wkWeo$(csc_cmdfile) \"$(vc_ldflags)$($(notdir $(basename $@))_ld)"; \echo [$@] Compile CSharp Program ..;endef## Command line flags#csc_flags += /nologocsc_flags += /out:$@ifndef ADDLINKLIBScsc_flags += /noconfigendififdef NOWARNLISTcsc_flags += /nowarn:$(NOWARNLIST)endif## Command line flags#ifdef ALVLcsc_defines += -DALVL=$(ALVL)endififdef DLVLcsc_defines += -DDLVL=$(DLVL)endififdef USE_WALLcsc_flags += /warn:4elsecsc_flags += /warn:3endififdef USE_OPTIMISE # default for productioncsc_flags += # Don't optimise production code. Ship what we testelsecsc_flags +=endififdef USE_DEBUGINFO # default for debugcsc_flags += /debug /debug:fullcsc_defines += -DDEBUGelsecsc_flags += /debug /debug:pdbonlycsc_flags +=endififeq "$(DEBUG)" "1" # debug/prod specificcsc_defines += -D_DEBUGelsecsc_defines += -DNDEBUGendif## Convert Definitions to a suitable format# Many users use -Dxxxx for Compiler definitions# Maintain this and convert them to a correct form#csc_flags += $(patsubst -D%,/define:%,$(CFLAGS)$(csc_defines))## Insert the library search paths into the start of the command file#vc_ldflags = \$(subst $(spacealt),$(space),$(patsubst %,/lib:\"%\"\\n,$(subst /,\\\\,$(LIBDIRS))))\$(subst $(spacealt),$(space),$(patsubst %,/lib:\"%\"\\n,$(subst /,\\\\,$(vc_libs))))## Cleanup definitions#ifndef LEAVETMPdefine csc_post$(rm) -f $(csc_cmdfile)endefelsedefine csc_postendefendif## Recipes to support the creation of Linker Dependency files# These will generate .dep files## The dependancy list is based an a makefile definition# The definition is named after the target#define LDDEPEND$(AA_PRE)$(cmdfile) -wkWeo$(@) \"$($(notdir $(basename $@))_dp)";endefdefine SHLDDEPEND$(AA_PRE)$(cmdfile) -wkWeo$(@) \"$($(notdir $(SHNAME))_shdp)";endef## Recipe to create a file that contains the StrongNameKey assembly# Args: $1 Tag of the definitiosn that will go into the file##define GenSnkWrapper@$(echo) "[$@] Create StrongKey Wrapper.."$(AA_PRE)$(cmdfile) -wkWeo$(@) "$($1)";endef