2006-11-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / scripts / Makefile.am
1 bin_SCRIPTS = \
2         $(scripts_1_0)          \
3         $(scripts_1_0_umask)    \
4         $(scripts_2_0)          \
5         $(scripts_service)      \
6         $(scripts_nunit)        \
7         $(scripts_rpmhelpers)
8
9 scripts_1_0 = \
10         al                      \
11         caspol                  \
12         cert2spc                \
13         certmgr                 \
14         chktrust                \
15         cilc                    \
16         disco                   \
17         dtd2xsd                 \
18         dtd2rng                 \
19         gacutil                 \
20         genxs                   \
21         ilasm                   \
22         macpack                 \
23         mbas                    \
24         mcs                     \
25         mjs                     \
26         mkbundle                \
27         monop                   \
28         mono-shlib-cop          \
29         mono-xmltool            \
30         mozroots                \
31         permview                \
32         prj2make                \
33         resgen                  \
34         secutil                 \
35         setreg                  \
36         signcode                \
37         soapsuds                \
38         sqlsharp                \
39         wsdl                    \
40         xsd
41
42 scripts_1_0_umask = \
43         makecert                \
44         sn
45
46 scripts_2_0 = \
47         gmcs                    \
48         ilasm2                  \
49         mkbundle2               \
50         monop2                  \
51         resgen2                 \
52         wsdl2                   \
53         sgen                    \
54         xbuild
55
56 scripts_service = mono-service mono-service2
57 scripts_nunit = nunit-console nunit-console2
58 scripts_rpmhelpers = mono-find-provides mono-find-requires
59
60 pkgconfigdir = $(libdir)/pkgconfig
61 pkgconfig_DATA= mono-nunit.pc
62
63 CLEANFILES = $(scripts_1_0) $(scripts_1_0_umask) $(scripts_2_0) gmcs mono-service mono-service2
64 DISTCLEANFILES = $(pkgconfig_DATA) $(scripts_rpmhelpers)
65
66 EXTRA_DIST =                   \
67         script.in              \
68         script_umask.in        \
69         mono-service.in        \
70         mono-nunit.pc.in       \
71         mono-find-provides.in  \
72         mono-find-requires.in
73
74 if USE_JIT
75 mono_interp = mono
76 else
77 mono_interp = mint
78 endif
79
80 if PLATFORM_WIN32
81 plat_bindir = $(shell cygpath -m $(libdir))
82 mono_instdir = $(shell cygpath -m $(libdir))/mono
83 else
84 plat_bindir = $(bindir)
85 mono_instdir = $(prefix)/lib/mono
86 endif
87
88 REWRITE_COMMON = sed \
89         -e 's,@''bindir@,$(bindir),g'                           \
90         -e 's,@''plat_bindir@,$(plat_bindir),g'                 \
91         -e 's,@''mono_instdir@,$(mono_instdir),g'               \
92         -e 's,@''gtkdir@,$(gtkdir),g'
93
94 REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g'
95 REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g'
96
97 REWRITE1 = $(REWRITE) -e 's,@''framework_version@,1.0,g'
98 REWRITE2 = $(REWRITE) -e 's,@''framework_version@,2.0,g'
99 REWRITE1_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,1.0,g'
100 REWRITE2_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,2.0,g'
101
102 mono-service: mono-service.in Makefile
103         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
104         mv $@.tmp $@
105
106 mono-service2: mono-service.in Makefile
107         $(REWRITE2) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
108         mv $@.tmp $@
109
110 nunit-console: script.in Makefile
111         $(REWRITE1_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
112         mv $@.tmp $@
113
114 nunit-console2: script.in Makefile
115         $(REWRITE2_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
116         mv $@.tmp $@
117
118 $(scripts_1_0): script.in Makefile
119         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script.in > $@.tmp
120         mv $@.tmp $@
121
122 $(scripts_1_0_umask): script_umask.in Makefile
123         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script_umask.in > $@.tmp
124         mv $@.tmp $@
125
126 $(scripts_2_0): script.in Makefile
127         n=`echo $@ | sed 's,2$$,,'`; \
128         $(REWRITE2) -e "s,@""exe_name@,$$n,g" $(srcdir)/script.in > $@.tmp
129         mv $@.tmp $@