diff options
author | mihaylov <mihaylov@epfl.ch> | 2005-10-03 22:27:56 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2005-10-03 22:27:56 +0000 |
commit | 526506ee0d5be17e5cabafb2d2a86b3feafd8e08 (patch) | |
tree | 6843fbd041b9ed465a88606b8d02ab009b1f6dbf /support/make | |
parent | 8fa3a68fa36828650100677c22f3369d77a6184b (diff) | |
download | scala-526506ee0d5be17e5cabafb2d2a86b3feafd8e08.tar.gz scala-526506ee0d5be17e5cabafb2d2a86b3feafd8e08.tar.bz2 scala-526506ee0d5be17e5cabafb2d2a86b3feafd8e08.zip |
Added multi-platform support
Diffstat (limited to 'support/make')
-rw-r--r-- | support/make/csc.mk | 23 | ||||
-rw-r--r-- | support/make/ilasm.mk | 93 | ||||
-rw-r--r-- | support/make/ildasm.mk | 85 |
3 files changed, 189 insertions, 12 deletions
diff --git a/support/make/csc.mk b/support/make/csc.mk index 66fcb27846..bfdfad7cd6 100644 --- a/support/make/csc.mk +++ b/support/make/csc.mk @@ -11,18 +11,17 @@ ############################################################################## # Variables # -# CSC_COMPILER = compiler name, for example SCALAC +# CSC_COMPILER = compiler name, for example CSC # $(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_OUTPUTFILE = name of the generated assembly file +# CSC_REFERENCE = list of referenced assenblies # CSC_ENCODING = character encoding used by source files # CSC_SOURCE = version of source code -# CSC_TARGET = version of target bytecode +# CSC_TARGET = compilation target (exe, winexe, library, module) +# CSC_DEFINE = defines the symbols listed by the semicolon +# separated list # CSC_FILES += files to compile # # All variables may have target specific values which override the @@ -55,10 +54,11 @@ ############################################################################## # Defaults -CSC_COMPILER ?= CSC +CSC_COMPILER ?= $(MSIL_PLATFORM)_CSC CYGWIN_PATH ?= $(1) CYGWIN_FILE ?= $(1) -CSC ?= csc +MONO_CSC ?= mcs +MSCLR_CSC ?= csc ############################################################################## # Values @@ -82,7 +82,7 @@ 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_REFERENCE:%=/r:$(call CYGWIN_PATH,%)) csc += $(csc_OUTPUTFILE:%=/out:$(call CYGWIN_FILE,%)) csc += $(csc_ENCODING:%=/codepage:%) csc += $(csc_TARGET:%=/target:%) @@ -97,8 +97,7 @@ CSC_LOOKUP = $(if $($(target)_$(1)),$($(target)_$(1)),$($(1))) ############################################################################## # Rules -csc : -# @[ -d "$(csc_OUTPUTDIR)" ] || $(MKDIR) -p "$(csc_OUTPUTDIR)" +csc: $(strip $(csc)) .PHONY : csc diff --git a/support/make/ilasm.mk b/support/make/ilasm.mk new file mode 100644 index 0000000000..26b48674e0 --- /dev/null +++ b/support/make/ilasm.mk @@ -0,0 +1,93 @@ +############################################################-*-Makefile-*-#### +# ILASM - MSIL Assembler +############################################################################## +# $Id$ + +############################################################################## +# Usage +# +# make ilasm [target=<target>] {<VARIABLE>=<value>} +# +############################################################################## +# Variables +# +# ILASM_ASSEMBLER = assembler name, for example ILASM +# $(ILASM_ASSEMBLER) = assembler command +# $(ILASM_ASSEMBLER)_FLAGS = assembler-specific compilation flags +# ILASM_FLAGS += compilation flags +# ILASM_OUTPUTFILE = name of the output assembly file +# ILASM_KEYFILE = key file +# ILASM_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 "scala.il" +# +# make ilasm ILASM_FILES=scala.il +# +# +############################################################################## + +############################################################################## +# Defaults + +ILASM_ASSEMBLER ?= $(MSIL_PLATFORM)_ILASM +CYGWIN_PATH ?= $(1) +CYGWIN_FILE ?= $(1) +MONO_ILASM ?= ilasm +MSCLR_ILASM ?= ilasm + +############################################################################## +# Values + +ilasm_ASSEMBLER = $(call ILASM_LOOKUP,ILASM_ASSEMBLER) +ilasm_assembler = $(call ILASM_LOOKUP,$(ilasm_ASSEMBLER)) +ilasm_assembler_flags = $(call ILASM_LOOKUP,$(ilasm_ASSEMBLER)_FLAGS) +ilasm_FLAGS = $(call ILASM_LOOKUP,ILASM_FLAGS) +ilasm_OUTPUTFILE = $(call ILASM_LOOKUP,ILASM_OUTPUTFILE) +ilasm_KEYFILE = $(call ILASM_LOOKUP,ILASM_KEYFILE) +ilasm_FILES = $(call ILASM_LOOKUP,ILASM_FILES) + + +############################################################################## + +MONO_OUT_FLAG = /output: +MONO_KEY_FLAG = /key: + +MSCLR_OUT_FLAG = /out= +MSCLR_KEY_FLAG = /key= + +OUT_FLAG = $($(MSIL_PLATFORM)_OUT_FLAG) +KEY_FLAG = $($(MSIL_PLATFORM)_KEY_FLAG) + +############################################################################## +# Command + +ilasm += $(ilasm_assembler) +ilasm += $(ilasm_assembler_flags) +ilasm += $(ilasm_FLAGS) +ilasm += $(ilasm_OUTPUTFILE:%=$(OUT_FLAG)$(call CYGWIN_FILE,%)) +ilasm += $(ilasm_KEYFILE:%=$(KEY_FLAG)$(call CYGWIN_FILE,%)) +ilasm += $(ilasm_FILES:%=$(call CYGWIN_FILE,'%')) + +############################################################################## +# Functions + +ILASM_LOOKUP = $(if $($(target)_$(1)),$($(target)_$(1)),$($(1))) + +############################################################################## +# Rules + +ilasm : + $(strip $(ilasm)) + +.PHONY : ilasm + +############################################################################## diff --git a/support/make/ildasm.mk b/support/make/ildasm.mk new file mode 100644 index 0000000000..f99b7d8603 --- /dev/null +++ b/support/make/ildasm.mk @@ -0,0 +1,85 @@ +############################################################-*-Makefile-*-#### +# ILDASM - MSIL Disassembler +############################################################################## +# $Id$ + +############################################################################## +# Usage +# +# make idlasm [target=<target>] {<VARIABLE>=<value>} +# +############################################################################## +# Variables +# +# ILDASM_ASSEMBLER = assembler name, for example ILDASM +# $(ILDASM_ASSEMBLER) = assembler command +# $(ILDASM_ASSEMBLER)_FLAGS = assembler-specific compilation flags +# ILDASM_FLAGS += compilation flags +# ILDASM_OUTPUTFILE = name of the output assembly file +# ILDASM_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 +# +# Disassembly file "lib/scala.dll" +# +# make ildasm ILDASM_FILES=lib/scala.dll +# +# +############################################################################## + +############################################################################## +# Defaults + +ILDASM_DISASSEMBLER ?= $(MSIL_PLATFORM)_ILDASM +CYGWIN_PATH ?= $(1) +CYGWIN_FILE ?= $(1) +MONO_ILDASM ?= monodis +MSCLR_ILDASM ?= ildasm + +############################################################################## +# Values + +ildasm_DISASSEMBLER = $(call ILDASM_LOOKUP,ILDASM_DISASSEMBLER) +ildasm_disassembler = $(call ILDASM_LOOKUP,$(ildasm_DISASSEMBLER)) +ildasm_disassembler_flags = $(call ILDASM_LOOKUP,$(ildasm_DISASSEMBLER)_FLAGS) +ildasm_FLAGS = $(call ILDASM_LOOKUP,ILDASM_FLAGS) +ildasm_OUTPUTFILE = $(call ILDASM_LOOKUP,ILDASM_OUTPUTFILE) +ildasm_FILES = $(call ILDASM_LOOKUP,ILDASM_FILES) + +############################################################################## + +MONO_OUT_FLAG = --output= +MSCLR_OUT_FLAG = /out= + +OUT_FLAG = $($(MSIL_PLATFORM)_OUT_FLAG) + +############################################################################## +# Command + +ildasm += $(ildasm_disassembler) +ildasm += $(ildasm_disassembler_flags) +ildasm += $(ildasm_FLAGS) +ildasm += $(ildasm_OUTPUTFILE:%=$(OUT_FLAG)$(call CYGWIN_FILE,%)) +ildasm += $(ildasm_FILES:%=$(call CYGWIN_FILE,'%')) + +############################################################################## +# Functions + +ILDASM_LOOKUP = $(if $($(target)_$(1)),$($(target)_$(1)),$($(1))) + +############################################################################## +# Rules + +ildasm : + $(strip $(ildasm)) + +.PHONY : ildasm + +############################################################################## |