merge r98600
[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         ilasm1                  \
28         mcs1                    \
29         mkbundle1               \
30         mono-api-info1          \
31         monop1                  \
32         resgen1                 \
33         wsdl1
34
35 scripts_1_0 = \
36         caspol                  \
37         cert2spc                \
38         certmgr                 \
39         chktrust                \
40         cilc                    \
41         disco                   \
42         dtd2xsd                 \
43         dtd2rng                 \
44         gacutil                 \
45         genxs                   \
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         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         ilasm                   \
94         mkbundle                \
95         mono-api-info           \
96         monop                   \
97         resgen                  \
98         wsdl
99
100 scripts_2_1 = smcs
101 scripts_service = mono-service mono-service2
102 scripts_nunit = nunit-console nunit-console2
103 scripts_rpmhelpers = mono-find-provides mono-find-requires
104
105 pkgconfigdir = $(libdir)/pkgconfig
106 pkgconfig_DATA= mono-nunit.pc
107
108 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
109 DISTCLEANFILES = $(pkgconfig_DATA) $(scripts_rpmhelpers)
110
111 EXTRA_DIST =                   \
112         script.in              \
113         script_umask.in        \
114         smcs.in                 \
115         mono-service.in        \
116         mono-nunit.pc.in       \
117         mono-find-provides.in  \
118         mono-find-requires.in   \
119         mono-test-install
120
121 if USE_JIT
122 mono_interp = mono
123 else
124 mono_interp = mint
125 endif
126
127 if PLATFORM_WIN32
128 plat_bindir = $(shell cygpath -m $(libdir))
129 mono_instdir = $(shell cygpath -m $(libdir))/mono
130 else
131 plat_bindir = $(bindir)
132 mono_instdir = $(prefix)/lib/mono
133 endif
134
135 REWRITE_COMMON = sed \
136         -e 's,@''bindir@,$(bindir),g'                           \
137         -e 's,@''plat_bindir@,$(plat_bindir),g'                 \
138         -e 's,@''mono_instdir@,$(mono_instdir),g'               \
139         -e 's,@''gtkdir@,$(gtkdir),g'
140
141 REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g'
142 REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g'
143
144 REWRITE1 = $(REWRITE) -e 's,@''framework_version@,1.0,g'
145 REWRITE2 = $(REWRITE) -e 's,@''framework_version@,2.0,g'
146 REWRITE2_1 = $(REWRITE) -e 's,@''framework_version@,2.1,g'
147 REWRITE1_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,1.0,g'
148 REWRITE2_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,2.0,g'
149
150 mono-service: mono-service.in Makefile
151         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
152         mv $@.tmp $@
153
154 mono-service2: mono-service.in Makefile
155         $(REWRITE2) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
156         mv $@.tmp $@
157
158 nunit-console: script.in Makefile
159         $(REWRITE1_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
160         mv $@.tmp $@
161
162 nunit-console2: script.in Makefile
163         $(REWRITE2_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
164         mv $@.tmp $@
165
166 smcs: smcs.in Makefile
167         $(REWRITE2_1) -e "s,@""exe_name@,smcs,g" $(srcdir)/smcs.in > $@.tmp
168         mv $@.tmp $@
169
170 $(scripts_1_0): script.in Makefile
171         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script.in > $@.tmp
172         mv $@.tmp $@
173
174 $(scripts_1_0_umask): script_umask.in Makefile
175         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script_umask.in > $@.tmp
176         mv $@.tmp $@
177
178 $(scripts_1_0_compat): script.in Makefile
179         t=`basename $@ 1`; $(REWRITE1) -e "s,@exe_name@,$$t,g" $(srcdir)/script.in > $@.tmp
180         mv $@.tmp $@
181
182 $(scripts_defaults): script.in Makefile
183         $(REWRITE2) -e "s,@exe_name@,$@,g" $(srcdir)/script.in > $@.tmp
184         mv $@.tmp $@
185
186 $(scripts_2_0): script.in Makefile
187         n=`echo $@ | sed 's,2$$,,'`; \
188         $(REWRITE2) -e "s,@""exe_name@,$$n,g" $(srcdir)/script.in > $@.tmp
189         mv $@.tmp $@
190