diff options
author | mihaylov <mihaylov@epfl.ch> | 2005-09-27 07:36:51 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2005-09-27 07:36:51 +0000 |
commit | 159d71afbe35f71c049edd73889d0f16c5457657 (patch) | |
tree | fb5d7394515de29f2cab73f930bd68d5310de84b /support/make | |
parent | 97cf075c9997ef05a0e66dac4db2e669b63b5be8 (diff) | |
download | scala-159d71afbe35f71c049edd73889d0f16c5457657.tar.gz scala-159d71afbe35f71c049edd73889d0f16c5457657.tar.bz2 scala-159d71afbe35f71c049edd73889d0f16c5457657.zip |
Implemented support for the Microsoft C# compiler
Diffstat (limited to 'support/make')
-rw-r--r-- | support/make/csc.mk | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/support/make/csc.mk b/support/make/csc.mk new file mode 100644 index 0000000000..66fcb27846 --- /dev/null +++ b/support/make/csc.mk @@ -0,0 +1,106 @@ +############################################################-*-Makefile-*-#### +# CSC - Compile C# Files +############################################################################## +# $Id$ + +############################################################################## +# Usage +# +# make csc [target=<target>] {<VARIABLE>=<value>} +# +############################################################################## +# Variables +# +# CSC_COMPILER = compiler name, for example SCALAC +# $(CSC_COMPILER) = compiler command +# $(CSC_COMPILER)_FLAGS = compiler-specific compilation flags +# CSC_FLAGS += compilation flags +# CSC_CLASSPATH = location of user class files +# CSC_SOURCEPATH = location of input source files +# CSC_BOOTCLASSPATH = location of bootstrap class files +# CSC_EXTDIRS = location of installed extensions +# CSC_OUTPUTDIR = directory where to place generated class files +# CSC_ENCODING = character encoding used by source files +# CSC_SOURCE = version of source code +# CSC_TARGET = version of target bytecode +# CSC_FILES += files to compile +# +# All variables may have target specific values which override the +# normal value. Those values are specified by variables whose name is +# prefixed with the target name. For example, to override the value of +# the variable SC_CLASSPATH with target LIBRARY, one may define the +# variable LIBRARY_SC_CLASSPATH. +# +############################################################################## +# Examples +# +# Compile file "sources/scala/AnyVal.cs" +# +# make csc CSC_FILES=sources/scala/AnyVal.cs +# +# +# Compile the whole runtime +# +# make csc target=LIBRARY +# +# +# A Makefile rule that compiles all modified files from the runtime +# +# .latest-library : $(LIBRARY_CSC_FILES) +# @$(MAKE) csc target=LIBRARY LIBRARY_CSC_FILES='$?' +# touch $@ +# +############################################################################## + +############################################################################## +# Defaults + +CSC_COMPILER ?= CSC +CYGWIN_PATH ?= $(1) +CYGWIN_FILE ?= $(1) +CSC ?= csc + +############################################################################## +# Values + +csc_COMPILER = $(call CSC_LOOKUP,CSC_COMPILER) +csc_compiler = $(call CSC_LOOKUP,$(csc_COMPILER)) +csc_compiler_flags = $(call CSC_LOOKUP,$(csc_COMPILER)_FLAGS) +csc_FLAGS = $(call CSC_LOOKUP,CSC_FLAGS) +csc_LIBDIR = $(call CSC_LOOKUP,CSC_LIBDIR) +csc_REFERENCE = $(call CSC_LOOKUP,CSC_REFERENCE) +csc_OUTPUTFILE = $(call CSC_LOOKUP,CSC_OUTPUTFILE) +csc_ENCODING = $(call CSC_LOOKUP,CSC_ENCODING) +csc_TARGET = $(call CSC_LOOKUP,CSC_TARGET) +csc_DEFINE = $(call CSC_LOOKUP,CSC_DEFINE) +csc_FILES = $(call CSC_LOOKUP,CSC_FILES) + +############################################################################## +# Command + +csc += $(csc_compiler) +csc += $(csc_compiler_flags) +csc += $(csc_FLAGS) +csc += $(csc_LIBDIR:%=/lib:$(call CYGWIN_PATH,%)) +csc += $(csc_REFERENCE:%=/reference:$(call CYGWIN_PATH,%)) +csc += $(csc_OUTPUTFILE:%=/out:$(call CYGWIN_FILE,%)) +csc += $(csc_ENCODING:%=/codepage:%) +csc += $(csc_TARGET:%=/target:%) +csc += $(csc_DEFINE:%=/define:%) +csc += $(csc_FILES:%=$(call CYGWIN_FILE,'%')) + +############################################################################## +# Functions + +CSC_LOOKUP = $(if $($(target)_$(1)),$($(target)_$(1)),$($(1))) + +############################################################################## +# Rules + +csc : +# @[ -d "$(csc_OUTPUTDIR)" ] || $(MKDIR) -p "$(csc_OUTPUTDIR)" + $(strip $(csc)) + +.PHONY : csc + +############################################################################## |