2008-04-11 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / scripts / Makefile.am
1 #
2 # Scripts that we install
3 #
4 # Starting with Mono 2.0, the majority of the tools default to the 
5 # 2.0 profile.  Commands that support the 1.0 toolchain and must
6 # run under 1.0 have the number 1 appended to their command names
7 # (for example mcs1 is the C# 1.0 compiler) and are listed in the
8 # scripts_1_0 compat variable.
9
10 # To preserve compatibility with old Makefiles and tools we keep the
11 # command names that had the suffix 2 (like wsdl2)
12 #
13 bin_SCRIPTS = \
14         $(scripts_1_0)          \
15         $(scripts_1_0_umask)    \
16         $(scripts_1_0_compat)   \
17         $(scripts_defaults)     \
18         $(scripts_2_0)          \
19         $(scripts_2_1)          \
20         $(scripts_service)      \
21         $(scripts_nunit)        \
22         $(scripts_rpmhelpers)   \
23         mono-test-install
24
25 scripts_1_0_compat = \
26         al1                     \
27         genxs1                  \
28         ilasm1                  \
29         mcs1                    \
30         mkbundle1               \
31         mono-api-info1          \
32         monop1                  \
33         resgen1                 \
34         wsdl1
35
36 scripts_1_0 = \
37         caspol                  \
38         cert2spc                \
39         certmgr                 \
40         chktrust                \
41         cilc                    \
42         disco                   \
43         dtd2xsd                 \
44         dtd2rng                 \
45         gacutil                 \
46         installvst              \
47         macpack                 \
48         mcs                     \
49         mbas                    \
50         mjs                     \
51         monolinker              \
52         mono-api-diff           \
53         mono-shlib-cop          \
54         mono-xmltool            \
55         mozroots                \
56         permview                \
57         prj2make                \
58         secutil                 \
59         setreg                  \
60         signcode                \
61         soapsuds                \
62         sqlsharp                \
63         xsd
64
65 scripts_1_0_umask = \
66         makecert                \
67         sn
68
69 scripts_2_0 = \
70         al2                     \
71         genxs2                  \
72         gmcs                    \
73         httpcfg                 \
74         ilasm2                  \
75         mconfig                 \
76         mkbundle2               \
77         mono-api-info2          \
78         monop2                  \
79         resgen2                 \
80         wsdl2                   \
81         xsd2                    \
82         sgen                    \
83         xbuild
84
85 #
86 # these are the new defaults, 2.0 profile-based commands
87 #
88 # we can move scripts_1_0 scripts here as we see fit, if we need to
89 # keep a 1.0 command available, we should additionally put it on
90 # the scripts_1_0_compat list
91 #
92 scripts_defaults =              \
93         al                      \
94         genxs                   \
95         ilasm                   \
96         mkbundle                \
97         mono-api-info           \
98         monop                   \
99         resgen                  \
100         wsdl
101
102 scripts_2_1 = smcs
103 scripts_service = mono-service mono-service2
104 scripts_nunit = nunit-console nunit-console2
105 scripts_rpmhelpers = mono-find-provides mono-find-requires
106
107 pkgconfigdir = $(libdir)/pkgconfig
108 pkgconfig_DATA= mono-nunit.pc
109
110 CLEANFILES = $(scripts_1_0) $(scripts_1_0_umask) $(scripts_2_0) $(scripts_2_1) $(scripts_defaults) $(scripts_1_0_compat) mono-service mono-service2 nunit-console nunit-console2 mono-find-provides mono-find-requires
111 DISTCLEANFILES = $(pkgconfig_DATA) $(scripts_rpmhelpers)
112
113 EXTRA_DIST =                   \
114         script.in              \
115         script_umask.in        \
116         smcs.in                 \
117         mono-service.in        \
118         mono-nunit.pc.in       \
119         mono-find-provides.in  \
120         mono-find-requires.in   \
121         mono-test-install
122
123 if USE_JIT
124 mono_interp = mono
125 else
126 mono_interp = mint
127 endif
128
129 if PLATFORM_WIN32
130 plat_bindir = $(shell cygpath -m $(libdir))
131 mono_instdir = $(shell cygpath -m $(libdir))/mono
132 else
133 plat_bindir = $(bindir)
134 mono_instdir = $(prefix)/lib/mono
135 endif
136
137 REWRITE_COMMON = sed \
138         -e 's,@''bindir@,$(bindir),g'                           \
139         -e 's,@''plat_bindir@,$(plat_bindir),g'                 \
140         -e 's,@''mono_instdir@,$(mono_instdir),g'               \
141         -e 's,@''gtkdir@,$(gtkdir),g'
142
143 REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g'
144 REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g'
145
146 REWRITE1 = $(REWRITE) -e 's,@''framework_version@,1.0,g'
147 REWRITE2 = $(REWRITE) -e 's,@''framework_version@,2.0,g'
148 REWRITE2_1 = $(REWRITE) -e 's,@''framework_version@,2.1,g'
149 REWRITE1_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,1.0,g'
150 REWRITE2_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,2.0,g'
151
152 mono-service: mono-service.in Makefile
153         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
154         mv $@.tmp $@
155
156 mono-service2: mono-service.in Makefile
157         $(REWRITE2) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
158         mv $@.tmp $@
159
160 nunit-console: script.in Makefile
161         $(REWRITE1_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
162         mv $@.tmp $@
163
164 nunit-console2: script.in Makefile
165         $(REWRITE2_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
166         mv $@.tmp $@
167
168 smcs: smcs.in Makefile
169         $(REWRITE2_1) -e "s,@""exe_name@,smcs,g" $(srcdir)/smcs.in > $@.tmp
170         mv $@.tmp $@
171
172 $(scripts_1_0): script.in Makefile
173         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script.in > $@.tmp
174         mv $@.tmp $@
175
176 $(scripts_1_0_umask): script_umask.in Makefile
177         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script_umask.in > $@.tmp
178         mv $@.tmp $@
179
180 $(scripts_1_0_compat): script.in Makefile
181         t=`basename $@ 1`; $(REWRITE1) -e "s,@exe_name@,$$t,g" $(srcdir)/script.in > $@.tmp
182         mv $@.tmp $@
183
184 $(scripts_defaults): script.in Makefile
185         $(REWRITE2) -e "s,@exe_name@,$@,g" $(srcdir)/script.in > $@.tmp
186         mv $@.tmp $@
187
188 $(scripts_2_0): script.in Makefile
189         n=`echo $@ | sed 's,2$$,,'`; \
190         $(REWRITE2) -e "s,@""exe_name@,$$n,g" $(srcdir)/script.in > $@.tmp
191         mv $@.tmp $@
192