1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
############################################################-*-Makefile-*-####
# CSC - Compile C# Files
##############################################################################
# $Id$
##############################################################################
# Usage
#
# make csc [target=<target>] {<VARIABLE>=<value>}
#
##############################################################################
# Variables
#
# CSC_COMPILER = compiler name, for example CSC
# $(CSC_COMPILER) = compiler command
# $(CSC_COMPILER)_FLAGS = compiler-specific compilation flags
# CSC_FLAGS += compilation flags
# 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 = 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
# 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 ?= $(MSIL_PLATFORM)_CSC
CYGWIN_PATH ?= $(1)
CYGWIN_FILE ?= $(1)
MONO_CSC ?= mcs
MSCLR_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:%=/r:$(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:
$(strip $(csc))
.PHONY : csc
##############################################################################
|