2007-10-25 Jb Evain <jbevain@novell.com>
[mono.git] / mcs / tools / tuner / Makefile
1 thisdir = tools/tuner
2 SUBDIRS =
3 include ../../build/rules.make
4
5 LINKER = ../linker/monolinker.exe
6
7 TUNER_SOURCES = \
8         Mono.Tuner/TunerAnnotations.cs  \
9         Mono.Tuner/PrintStatus.cs       \
10         Mono.Tuner/RemoveSerialization.cs       \
11         Mono.Tuner/AdjustVisibility.cs  \
12         Mono.Tuner/CheckVisibility.cs   \
13
14 TUNER_DESCS =   \
15         Descriptors/mscorlib.xml        \
16         Descriptors/smcs.xml    \
17         Descriptors/System.xml  \
18
19 TUNER_MASTERS = \
20         masterinfos/silverlight/mscorlib.info   \
21         masterinfos/silverlight/System.info     \
22         masterinfos/silverlight/System.Core.info        \
23         masterinfos/silverlight/System.Xml.Core.info    \
24
25 LOCAL_MCS_FLAGS = -r:$(LINKER) -r:Mono.Cecil.dll
26
27 DISTFILES = README $(TUNER_SOURCES) $(TUNER_DESCS) $(TUNER_MASTERS)
28
29 WORKING_DIR = $(topdir)/class/lib/net_2_1
30 OUTPUT_DIR = $(topdir)/class/lib/net_2_1_tuned
31
32 ifneq (net_2_1, $(PROFILE))
33 all-local:
34         $(CSCOMPILE) /out:Mono.Tuner.dll /t:library $(TUNER_SOURCES)
35
36 install-local:
37
38 clean-local:
39         rm -f *.dll *.mdb *.pdb
40
41 else
42 all-local: tune
43
44 install-local: end-install
45
46 clean-local:
47         rm -rf $(OUTPUT_DIR)
48
49 endif
50
51 uninstall-local:
52
53 dist-local: dist-default
54
55 test-local:
56
57 run-test-local run-test-ondotnet-local:
58
59 TUNER_FLAGS = -d $(WORKING_DIR) -o $(OUTPUT_DIR)        \
60         -l none         \
61         -c link         \
62         -a smcs         \
63         -b true         \
64         -m display_internalized false   \
65
66 TUNER_STEPS = \
67         Mono.Tuner.AdjustVisibility,Mono.Tuner:OutputStep       \
68         Mono.Tuner.PrintStatus,Mono.Tuner:OutputStep    \
69         Mono.Tuner.RemoveSerialization,Mono.Tuner:OutputStep    \
70         Mono.Tuner.CheckVisibility,Mono.Tuner   \
71
72 tune:
73         MONO_PATH=".$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/default$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) --debug $(LINKER) $(TUNER_FLAGS) $(TUNER_DESCS:%=-x %) $(TUNER_STEPS:%=-s %) $(TUNER_MASTERS:%=-i %)
74
75 gacutil = $(topdir)/class/lib/net_1_1_bootstrap/gacutil.exe
76 GACUTIL = MONO_PATH="$(topdir)/class/lib/net_1_1_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(gacutil)
77
78 TUNER_INSTALL_DIR = $(DESTDIR)$(mono_libdir)/mono/2.1
79
80 end-install: check-install-dir inst-mscorlib.dll inst-smcs.exe gac-System gac-System.Xml.Core gac-System.Core
81
82 check-install-dir:
83         [ -d $(TUNER_INSTALL_DIR) ] || mkdir $(TUNER_INSTALL_DIR)
84
85 inst-%:
86         $(INSTALL_LIB) $(OUTPUT_DIR)/$* $(TUNER_INSTALL_DIR)/$*
87         test ! -f $(OUTPUT_DIR)/$*.mdb || $(INSTALL_LIB) $(OUTPUT_DIR)/$*.mdb $(TUNER_INSTALL_DIR)/$*.mdb
88
89 gac-%:
90         $(GACUTIL) /i $(OUTPUT_DIR)/$*.dll /f /root $(DESTDIR)$(mono_libdir) /package 2.1
91