[interp] Small fixes (#11667)
[mono-project.git] / scripts / Makefile.am
blobea3a0ce5a8bef8e05a60e4f29e02968f60d0802f
2 # Scripts that we install
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)
13 if USE_BATCH_FILES
14 SCRIPT_IN=script.bat.in
15 FILTER=sed -e 's,\.bat\.exe,\.exe,g' -e 's,/,\\,g'
16 SCRIPT_SUFFIX=.bat
17 else
18 SCRIPT_IN=script.in
19 FILTER=cat
20 SCRIPT_SUFFIX=
21 endif
23 COMPAT_1_0_SUFFIX=1$(SCRIPT_SUFFIX)
24 COMPAT_2_0_SUFFIX=2$(SCRIPT_SUFFIX)
25 COMPAT_4_0_SUFFIX=4$(SCRIPT_SUFFIX)
27 bin_SCRIPTS = \
28         $(scripts_4_0_umask)    \
29         $(scripts_defaults)     \
30         $(scripts_2_0)          \
31         $(scripts_service)      \
32         $(scripts_nunit)        \
33         $(scripts_rpmhelpers)   \
34         $(MDOC_SUBCOMMANDS)     \
35         $(MDOC_COMPAT)          \
36         mono-test-install       \
37         peverify                \
38         mcs                     \
39         csc                     \
40         csc-dim         \
41         vbc                     \
42         csi                     \
43         mono-package-runtime    \
44         mono-heapviz            \
45         $(scripts_mono_configuration_crypto)
47 if INSTALL_4_x
48 bin_SCRIPTS += $(scripts_4_0)
49 bin_SCRIPTS += dmcs
50 bin_SCRIPTS += xbuild
51 endif
53 scripts_4_0_umask = \
54         makecert$(SCRIPT_SUFFIX)                \
55         sn$(SCRIPT_SUFFIX)
57 deprecated =                                    \
58         cilc(SCRIPT_SUFFIX)                     \
59         mjs(SCRIPT_SUFFIX)
61 scripts_2_0 = \
62         al2$(SCRIPT_SUFFIX)                     \
63         gacutil2$(SCRIPT_SUFFIX)                \
64         monop2$(SCRIPT_SUFFIX)                  \
65         resgen2$(SCRIPT_SUFFIX)                 \
66         wsdl2$(SCRIPT_SUFFIX)
68 scripts_4_0 = \
69         disco$(SCRIPT_SUFFIX)                   \
70         dtd2xsd$(SCRIPT_SUFFIX)                 \
71         dtd2rng$(SCRIPT_SUFFIX)                 \
72         installvst$(SCRIPT_SUFFIX)              \
73         genxs$(SCRIPT_SUFFIX)                   \
74         macpack$(SCRIPT_SUFFIX)                 \
75         mdoc$(SCRIPT_SUFFIX)                    \
76         mono-cil-strip$(SCRIPT_SUFFIX)          \
77         soapsuds$(SCRIPT_SUFFIX)                \
78         caspol$(SCRIPT_SUFFIX)                  \
79         cert-sync$(SCRIPT_SUFFIX)               \
80         cert2spc$(SCRIPT_SUFFIX)                \
81         certmgr$(SCRIPT_SUFFIX)                 \
82         chktrust$(SCRIPT_SUFFIX)                \
83         crlupdate$(SCRIPT_SUFFIX)               \
84         csharp$(SCRIPT_SUFFIX)                  \
85         httpcfg$(SCRIPT_SUFFIX)                 \
86         illinkanalyzer$(SCRIPT_SUFFIX)          \
87         lc$(SCRIPT_SUFFIX)                      \
88         mconfig$(SCRIPT_SUFFIX)                 \
89         mod$(SCRIPT_SUFFIX)                     \
90         monolinker$(SCRIPT_SUFFIX)              \
91         mono-api-info$(SCRIPT_SUFFIX)           \
92         mono-api-html$(SCRIPT_SUFFIX)           \
93         mono-shlib-cop$(SCRIPT_SUFFIX)          \
94         mozroots$(SCRIPT_SUFFIX)                \
95         permview$(SCRIPT_SUFFIX)                \
96         pdb2mdb$(SCRIPT_SUFFIX)                 \
97         xsd$(SCRIPT_SUFFIX)                     \
98         mono-xmltool$(SCRIPT_SUFFIX)            \
99         setreg$(SCRIPT_SUFFIX)                  \
100         secutil$(SCRIPT_SUFFIX)                 \
101         signcode$(SCRIPT_SUFFIX)                \
102         sgen$(SCRIPT_SUFFIX)                    \
103         sqlmetal$(SCRIPT_SUFFIX)                \
104         sqlsharp$(SCRIPT_SUFFIX)                \
105         svcutil$(SCRIPT_SUFFIX)                 \
106         ccrewrite$(SCRIPT_SUFFIX)               \
107         cccheck$(SCRIPT_SUFFIX)                 \
108         mdbrebase$(SCRIPT_SUFFIX)               \
109         ikdasm$(SCRIPT_SUFFIX)                  \
110         mono-symbolicate$(SCRIPT_SUFFIX)
112 MDOC_SUBCOMMANDS = \
113         mdoc-assemble \
114         mdoc-export-html \
115         mdoc-export-msxdoc \
116         mdoc-update \
117         mdoc-validate
119 MDOC_COMPAT = \
120         mdassembler             \
121         mdvalidater             \
122         monodocer               \
123         monodocs2html           \
124         monodocs2slashdoc
127 # these are the new defaults, 2.0 profile-based commands
129 # we can move scripts_1_0 scripts here as we see fit, if we need to
130 # keep a 1.0 command available, we should additionally put it on
131 # the scripts_1_0_compat list
133 scripts_defaults =              \
134         al$(SCRIPT_SUFFIX)                      \
135         ilasm$(SCRIPT_SUFFIX)                   \
136         gacutil$(SCRIPT_SUFFIX)                 \
137         mkbundle$(SCRIPT_SUFFIX)                \
138         monop$(SCRIPT_SUFFIX)                   \
139         resgen$(SCRIPT_SUFFIX)                  \
140         wsdl$(SCRIPT_SUFFIX)
142 scripts_service = mono-service mono-service2
143 scripts_nunit = nunit-console$(SCRIPT_SUFFIX) nunit-console2$(SCRIPT_SUFFIX) nunit-console4$(SCRIPT_SUFFIX)
144 scripts_rpmhelpers = mono-find-provides mono-find-requires
145 scripts_mono_configuration_crypto = mono-configuration-crypto$(SCRIPT_SUFFIX)
147 CLEANFILES = $(scripts_mono_configuration_crypto) $(scripts_4_0_umask) $(scripts_2_0) $(scripts_defaults) $(scripts_4_0) mono-service mono-service2 nunit-console nunit-console2 nunit-console4 mono-find-provides mono-find-requires mod $(MDOC_SUBCOMMANDS)
148 DISTCLEANFILES = $(pkgconfig_DATA) $(scripts_rpmhelpers)
150 EXTRA_DIST =                    \
151         script.in               \
152         script.bat.in           \
153         script_umask.in         \
154         script_umask.bat.in     \
155         mod.in                  \
156         mono-service.in         \
157         mono-find-provides.in   \
158         mono-find-requires.in   \
159         peverify.in                     \
160         xbuild.in                       \
161         update_submodules.sh    \
162         mcs.in                          \
163         csc.in                          \
164         csc-dim.in                              \
165         vbc.in                          \
166         dmcs.in                         \
167         csi.in                  \
168         mono-package-runtime    \
169         mono-test-install       \
170         mono-heapviz            \
171         $(MDOC_COMPAT)          \
172         mono-configuration-crypto.in    \
173         submodules/versions.mk  \
174         submodules/versions.py
176 mono_interp = mono
178 if HOST_WIN32
179 if CROSS_COMPILING
180 plat_bindir = $(bindir)
181 mono_instdir = $(prefix)/lib/mono
182 else
183 plat_bindir = $(shell cygpath -m $(libdir))
184 mono_instdir = $(shell cygpath -m $(libdir))/mono
185 endif
186 else
187 plat_bindir = $(bindir)
188 mono_instdir = $(prefix)/lib/mono
189 endif
192 REWRITE_COMMON = sed \
193         -e 's,@''bindir@,$(bindir),g'                           \
194         -e 's,@''plat_bindir@,$(plat_bindir),g'                 \
195         -e 's,@''mono_instdir@,$(mono_instdir),g'               \
196         -e 's,@''gtkdir@,$(gtkdir),g'
198 REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g'
199 REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g'
201 REWRITE4 = $(REWRITE) -e 's,@''framework_version@,4.5,g'
202 REWRITE4_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,4.5,g'
204 peverify: peverify.in Makefile
205         $(REWRITE_COMMON) $(srcdir)/peverify.in > $@.tmp
206         mv -f $@.tmp $@
208 mcs: mcs.in Makefile
209         $(REWRITE_COMMON) $(srcdir)/mcs.in > $@.tmp
210         mv -f $@.tmp $@
212 csc: csc.in Makefile
213         $(REWRITE_COMMON) $(srcdir)/csc.in > $@.tmp
214         mv -f $@.tmp $@
216 csc-dim: csc-dim.in Makefile
217         $(REWRITE_COMMON) $(srcdir)/csc-dim.in > $@.tmp
218         mv -f $@.tmp $@
220 vbc: vbc.in Makefile
221         $(REWRITE_COMMON) $(srcdir)/vbc.in > $@.tmp
222         mv -f $@.tmp $@
224 dmcs: dmcs.in Makefile
225         $(REWRITE_COMMON) $(srcdir)/dmcs.in > $@.tmp
226         mv -f $@.tmp $@
228 csi: csi.in Makefile
229         $(REWRITE_COMMON) $(srcdir)/csi.in > $@.tmp
230         mv -f $@.tmp $@
232 mono-service: mono-service.in Makefile
233         $(REWRITE4) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
234         mv -f $@.tmp $@
236 mono-service2: mono-service.in Makefile
237         $(REWRITE4) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
238         mv -f $@.tmp $@
240 nunit-console$(SCRIPT_SUFFIX): $(SCRIPT_IN) Makefile
241         $(REWRITE4_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
242         mv -f $@.tmp $@
244 nunit-console2$(SCRIPT_SUFFIX): $(SCRIPT_IN) Makefile
245         $(REWRITE4_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
246         mv -f $@.tmp $@
248 nunit-console4$(SCRIPT_SUFFIX): $(SCRIPT_IN) Makefile
249         $(REWRITE4_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
250         mv -f $@.tmp $@
252 xbuild: xbuild.in Makefile
253         $(REWRITE_COMMON) $(srcdir)/xbuild.in > $@.tmp
254         mv -f $@.tmp $@
256 #FIXME: this is not the correct rule for mod.bat.
257 mod$(SCRIPT_SUFFIX): mod.in Makefile
258         $(REWRITE4) -e "s,@""exe_name@,mod,g" $(srcdir)/mod.in > $@.tmp
259         mv -f $@.tmp $@
261 #FIXME: this is not the correct rule for bat files.
262 $(scripts_4_0_umask): script_umask.in Makefile
263         n=`echo $@ | sed 's,$(COMPAT_4_0_SUFFIX)$$,,'`; \
264         $(REWRITE4) -e "s,@""exe_name@,$$n,g" $(srcdir)/script_umask.in | $(FILTER) > $@.tmp
265         mv -f $@.tmp $@
267 $(scripts_defaults): $(SCRIPT_IN) Makefile
268         n=`echo $@ | sed 's,$(COMPAT_4_0_SUFFIX)$$,,'`; \
269         $(REWRITE4) -e "s,@""exe_name@,$$n,g" $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
270         mv -f $@.tmp $@
272 $(scripts_2_0): $(SCRIPT_IN) Makefile
273         n=`echo $@ | sed 's,$(COMPAT_2_0_SUFFIX)$$,,'`; \
274         $(REWRITE4) -e "s,@""exe_name@,$$n,g" $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
275         mv -f $@.tmp $@
277 $(scripts_4_0): $(SCRIPT_IN) Makefile
278         n=`echo $@ | sed 's,$(COMPAT_4_0_SUFFIX)$$,,'`; \
279         $(REWRITE4) -e "s,@""exe_name@,$$n,g" $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp
280         mv -f $@.tmp $@
282 $(scripts_mono_configuration_crypto): mono-configuration-crypto.in
283         $(REWRITE4)  -e "s,@exe_name@,mono-configuration-crypto,g" $(srcdir)/mono-configuration-crypto.in > $@.tmp
284         mv -f $@.tmp $@
286 $(MDOC_SUBCOMMANDS): Makefile
287         for script in $(MDOC_SUBCOMMANDS) ; do                  \
288                 cmd=`echo $$script | sed 's/mdoc-//'` ;         \
289                 echo "#!/bin/sh" > $$script ;                   \
290                 echo "exec mdoc $$cmd \"\$$@\"" >> $$script;    \
291         done