commit much of the virtualization support, stubbed out
[moon.git] / class / tuning / Makefile.am
blob0289ad37a4690e041e8f0f3d33ecb4557b7bf535
1 SUBDIRS=SecurityAttributes
3 LINKER = ../lib/tuner/monolinker.exe
4 #GACUTIL = gacutil /gacdir $(DESTDIR)$(prefix)/lib /root $(DESTDIR)$(prefix)/lib /package 2.1
6 TUNER_DESCS =   \
7         $(srcdir)/Descriptors/mscorlib.xml      \
8         $(srcdir)/Descriptors/smcs.xml  \
9         $(srcdir)/Descriptors/System.xml        \
10         $(srcdir)/Descriptors/System.Net.xml    \
11         $(srcdir)/Descriptors/System.Xml.xml    \
12         $(srcdir)/Descriptors/System.ServiceModel.xml   \
13         $(srcdir)/Descriptors/a11y.xml
15 SECURITY_ATTRIBUTES_INFO = \
16         SecurityAttributes/mscorlib.secattr \
17         SecurityAttributes/System.secattr \
18         SecurityAttributes/System.Core.secattr \
19         SecurityAttributes/System.Net.secattr \
20         SecurityAttributes/System.Runtime.Serialization.secattr \
21         SecurityAttributes/System.ServiceModel.secattr \
22         SecurityAttributes/System.ServiceModel.Web.secattr \
23         SecurityAttributes/System.Windows.Browser.secattr \
24         SecurityAttributes/System.Windows.secattr \
25         SecurityAttributes/System.Xml.secattr \
26         SecurityAttributes/Microsoft.VisualBasic.secattr
28 MCS_ASSEMBLIES = \
29         mscorlib        \
30         System  \
31         System.Net      \
32         System.Core     \
33         System.Xml      \
34         System.Xml.Linq \
35         System.Runtime.Serialization    \
36         System.ServiceModel     \
37         System.ServiceModel.Web \
38         Mono.CompilerServices.SymbolWriter
40 MCS_DLLFILES = $(MCS_ASSEMBLIES:%=$(MCS_PATH)/class/lib/net_2_1_raw/%.dll)
42 if HAVE_MONO_BASIC
43 MONO_BASIC_TUNER_ASSEMBLIES = Microsoft.VisualBasic
44 MONO_BASIC_DLLFILES = $(MONO_BASIC_PATH)/class/lib/2.1/Microsoft.VisualBasic.dll
45 endif
47 TUNER_ASSEMBLIES = $(MCS_ASSEMBLIES) $(MONO_BASIC_TUNER_ASSEMBLIES)
49 TUNER_MASTERS = $(TUNER_ASSEMBLIES:%=$(srcdir)/masterinfos/%.info)
51 EXTRA_DIST = $(TUNER_DESCS) $(TUNER_MASTERS)
53 # We copy all the files to be tuned into our working directory
54 # this way it's easier to tune assemblies which comes from 
55 # different sources (mcs, mono-basic)
56 WORKING_DIR = ../lib/2.1_raw
57 OUTPUT_DIR = ../lib/2.1
58 MCS_OUTPUT_DIR = $(MCS_PATH)/class/lib/net_2_1
60 DLLFILES = $(TUNER_ASSEMBLIES:%=%.dll)
62 FILES = smcs.exe $(DLLFILES)
63 WORKING_FILES = $(FILES:%=$(WORKING_DIR)/%)
64 OUTPUT_FILES = $(FILES:%=$(OUTPUT_DIR)/%)
65 INPUT_FILES = $(MCS_PATH)/class/lib/net_2_1_raw/smcs.exe $(MCS_DLLFILES) $(MONO_BASIC_DLLFILES)
67 TUNER_INSTALL_DIR = $(DESTDIR)$(prefix)/lib/mono/2.1
69 all-local: output.stamp
71 install-data-local: $(TUNER_INSTALL_DIR) end-install
73 clean-local:
74         rm -f $(OUTPUT_FILES) tune.stamp tune.stampt working.stamp output.stamp
76 uninstall-local:
77         for i in $(DLLFILES); do $(GACUTIL) /u $$i; done
78         rm -f 
80 TUNER_FLAGS =   \
81         -d $(WORKING_DIR)       \
82         -o $(OUTPUT_DIR)        \
83         -l none         \
84         -c link         \
85         -a smcs         \
86         -b true         \
87         -g true         \
88         -m secattrs SecurityAttributes  \
89         -m throw_on_visibility_check true       \
90         -m display_internalized false
92 TUNER_STEPS = \
93         Mono.Tuner.InjectSecurityAttributes,Mono.Tuner:OutputStep       \
94         Mono.Tuner.AdjustVisibility,Mono.Tuner:OutputStep       \
95         Mono.Tuner.PrintStatus,Mono.Tuner:OutputStep    \
96         Mono.Tuner.RemoveSerialization,Mono.Tuner:OutputStep    \
97         Mono.Tuner.CheckVisibility,Mono.Tuner
99 if HAVE_MONO_BASIC
100 $(MONO_BASIC_DLLFILES): 
101         $(MAKE) -C $(MONO_BASIC_PATH)/tools/moonlight tune
102 endif
104 working.stamp: $(INPUT_FILES)
105         -mkdir -p $(WORKING_DIR)
106         for i in $(INPUT_FILES); do cp -p $$i $$i.mdb $(WORKING_DIR); done
107         -rm $(WORKING_DIR)/Microsoft.VisualBasic.dll.mdb
108         touch $(WORKING_FILES) working.stamp
110 output.stamp: working.stamp $(SECURITY_ATTRIBUTES_INFO)
111         MONO_PATH="../lib/tuner:$$MONO_PATH" mono --debug $(LINKER) $(TUNER_FLAGS) $(TUNER_DESCS:%=-x %) $(TUNER_STEPS:%=-s %) $(TUNER_MASTERS:%=-i %)
112         for i in $(DLLFILES); do sn -q -R $(OUTPUT_DIR)/$$i $(srcdir)/../mono.snk; done
113         -mkdir -p $(MCS_OUTPUT_DIR)
114         for i in $(OUTPUT_FILES); do cp -p $$i $(MCS_OUTPUT_DIR); done
115         for i in $(OUTPUT_FILES); do cp -p $$i.mdb $(MCS_OUTPUT_DIR) || true; done
116         touch output.stamp
118 $(TUNER_INSTALL_DIR):
119         -mkdir -p $(TUNER_INSTALL_DIR)
121 END_INSTALL_TARGETS = \
122         inst-mscorlib.dll       \
123         inst-mono-smcs.exe      \
124         inst-System.dll \
125         inst-System.Net.dll     \
126         inst-System.Xml.dll     \
127         inst-System.Core.dll    \
128         inst-System.Runtime.Serialization.dll   \
129         inst-System.ServiceModel.dll    \
130         inst-System.ServiceModel.Web.dll        \
131         inst-mono-System.Xml.Linq.dll   \
132         inst-mono-Mono.CompilerServices.SymbolWriter.dll
134 if HAVE_MONO_BASIC
135 END_INSTALL_TARGETS += inst-Microsoft.VisualBasic.dll
136 endif
138 end-install: $(END_INSTALL_TARGETS)
140 inst-mono-%: $(OUTPUT_DIR)/%
141         -mkdir -p $(DESTDIR)$(prefix)/lib/mono/2.1
142         $(INSTALL) -c -m 755  $(OUTPUT_DIR)/$* $(DESTDIR)$(prefix)/lib/mono/2.1/$*
143         test ! -f $(OUTPUT_DIR)/$*.mdb || $(INSTALL) -c -m 755  $(OUTPUT_DIR)/$*.mdb $(DESTDIR)$(prefix)/lib/mono/2.1/$*.mdb
145 inst-%: $(OUTPUT_DIR)/%
146         -mkdir -p $(DESTDIR)$(pkglibdir)/plugin/
147         $(INSTALL) -c -m 755  $(OUTPUT_DIR)/$* $(DESTDIR)$(pkglibdir)/plugin/$*
148         test ! -f $(OUTPUT_DIR)/$*.mdb || $(INSTALL) -c -m 755  $(OUTPUT_DIR)/$*.mdb $(DESTDIR)$(pkglibdir)/plugin/$*.mdb
150 retune:
151         rm -f output.stamp && $(MAKE) output.stamp