svn path=/trunk/mcs/; revision=104772
[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         mjs                     \
50         monolinker              \
51         mono-api-diff           \
52         mono-shlib-cop          \
53         mono-xmltool            \
54         mozroots                \
55         permview                \
56         prj2make                \
57         secutil                 \
58         setreg                  \
59         signcode                \
60         soapsuds                \
61         sqlsharp                \
62         xsd
63
64 scripts_1_0_umask = \
65         makecert                \
66         sn
67
68 scripts_2_0 = \
69         al2                     \
70         genxs2                  \
71         gmcs                    \
72         httpcfg                 \
73         ilasm2                  \
74         mconfig                 \
75         mkbundle2               \
76         mono-api-info2          \
77         monop2                  \
78         resgen2                 \
79         wsdl2                   \
80         xsd2                    \
81         sgen                    \
82         xbuild
83
84 #
85 # these are the new defaults, 2.0 profile-based commands
86 #
87 # we can move scripts_1_0 scripts here as we see fit, if we need to
88 # keep a 1.0 command available, we should additionally put it on
89 # the scripts_1_0_compat list
90 #
91 scripts_defaults =              \
92         al                      \
93         genxs                   \
94         ilasm                   \
95         mkbundle                \
96         mono-api-info           \
97         monop                   \
98         resgen                  \
99         wsdl
100
101 scripts_2_1 = smcs
102 scripts_service = mono-service mono-service2
103 scripts_nunit = nunit-console nunit-console2
104 scripts_rpmhelpers = mono-find-provides mono-find-requires
105
106 pkgconfigdir = $(libdir)/pkgconfig
107 pkgconfig_DATA= mono-nunit.pc
108
109 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
110 DISTCLEANFILES = $(pkgconfig_DATA) $(scripts_rpmhelpers)
111
112 EXTRA_DIST =                   \
113         script.in              \
114         script_umask.in        \
115         smcs.in                 \
116         mono-service.in        \
117         mono-nunit.pc.in       \
118         mono-find-provides.in  \
119         mono-find-requires.in   \
120         mono-test-install
121
122 if USE_JIT
123 mono_interp = mono
124 else
125 mono_interp = mint
126 endif
127
128 if PLATFORM_WIN32
129 plat_bindir = $(shell cygpath -m $(libdir))
130 mono_instdir = $(shell cygpath -m $(libdir))/mono
131 else
132 plat_bindir = $(bindir)
133 mono_instdir = $(prefix)/lib/mono
134 endif
135
136 REWRITE_COMMON = sed \
137         -e 's,@''bindir@,$(bindir),g'                           \
138         -e 's,@''plat_bindir@,$(plat_bindir),g'                 \
139         -e 's,@''mono_instdir@,$(mono_instdir),g'               \
140         -e 's,@''gtkdir@,$(gtkdir),g'
141
142 REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g'
143 REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g'
144
145 REWRITE1 = $(REWRITE) -e 's,@''framework_version@,1.0,g'
146 REWRITE2 = $(REWRITE) -e 's,@''framework_version@,2.0,g'
147 REWRITE2_1 = $(REWRITE) -e 's,@''framework_version@,2.1,g'
148 REWRITE1_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,1.0,g'
149 REWRITE2_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,2.0,g'
150
151 mono-service: mono-service.in Makefile
152         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
153         mv $@.tmp $@
154
155 mono-service2: mono-service.in Makefile
156         $(REWRITE2) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
157         mv $@.tmp $@
158
159 nunit-console: script.in Makefile
160         $(REWRITE1_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
161         mv $@.tmp $@
162
163 nunit-console2: script.in Makefile
164         $(REWRITE2_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
165         mv $@.tmp $@
166
167 smcs: smcs.in Makefile
168         $(REWRITE2_1) -e "s,@""exe_name@,smcs,g" $(srcdir)/smcs.in > $@.tmp
169         mv $@.tmp $@
170
171 $(scripts_1_0): script.in Makefile
172         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script.in > $@.tmp
173         mv $@.tmp $@
174
175 $(scripts_1_0_umask): script_umask.in Makefile
176         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script_umask.in > $@.tmp
177         mv $@.tmp $@
178
179 $(scripts_1_0_compat): script.in Makefile
180         t=`basename $@ 1`; $(REWRITE1) -e "s,@exe_name@,$$t,g" $(srcdir)/script.in > $@.tmp
181         mv $@.tmp $@
182
183 $(scripts_defaults): script.in Makefile
184         $(REWRITE2) -e "s,@exe_name@,$@,g" $(srcdir)/script.in > $@.tmp
185         mv $@.tmp $@
186
187 $(scripts_2_0): script.in Makefile
188         n=`echo $@ | sed 's,2$$,,'`; \
189         $(REWRITE2) -e "s,@""exe_name@,$$n,g" $(srcdir)/script.in > $@.tmp
190         mv $@.tmp $@
191