2007-01-01 Miguel de Icaza <miguel@novell.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         httpcfg                 \
49         ilasm2                  \
50         mkbundle2               \
51         monop2                  \
52         resgen2                 \
53         wsdl2                   \
54         sgen                    \
55         xbuild
56
57 scripts_service = mono-service mono-service2
58 scripts_nunit = nunit-console nunit-console2
59 scripts_rpmhelpers = mono-find-provides mono-find-requires
60
61 pkgconfigdir = $(libdir)/pkgconfig
62 pkgconfig_DATA= mono-nunit.pc
63
64 CLEANFILES = $(scripts_1_0) $(scripts_1_0_umask) $(scripts_2_0) gmcs mono-service mono-service2
65 DISTCLEANFILES = $(pkgconfig_DATA) $(scripts_rpmhelpers)
66
67 EXTRA_DIST =                   \
68         script.in              \
69         script_umask.in        \
70         mono-service.in        \
71         mono-nunit.pc.in       \
72         mono-find-provides.in  \
73         mono-find-requires.in
74
75 if USE_JIT
76 mono_interp = mono
77 else
78 mono_interp = mint
79 endif
80
81 if PLATFORM_WIN32
82 plat_bindir = $(shell cygpath -m $(libdir))
83 mono_instdir = $(shell cygpath -m $(libdir))/mono
84 else
85 plat_bindir = $(bindir)
86 mono_instdir = $(prefix)/lib/mono
87 endif
88
89 REWRITE_COMMON = sed \
90         -e 's,@''bindir@,$(bindir),g'                           \
91         -e 's,@''plat_bindir@,$(plat_bindir),g'                 \
92         -e 's,@''mono_instdir@,$(mono_instdir),g'               \
93         -e 's,@''gtkdir@,$(gtkdir),g'
94
95 REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g'
96 REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g'
97
98 REWRITE1 = $(REWRITE) -e 's,@''framework_version@,1.0,g'
99 REWRITE2 = $(REWRITE) -e 's,@''framework_version@,2.0,g'
100 REWRITE1_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,1.0,g'
101 REWRITE2_DEBUG = $(REWRITE_DEBUG) -e 's,@''framework_version@,2.0,g'
102
103 mono-service: mono-service.in Makefile
104         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
105         mv $@.tmp $@
106
107 mono-service2: mono-service.in Makefile
108         $(REWRITE2) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
109         mv $@.tmp $@
110
111 nunit-console: script.in Makefile
112         $(REWRITE1_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
113         mv $@.tmp $@
114
115 nunit-console2: script.in Makefile
116         $(REWRITE2_DEBUG) -e 's,@''exe_name@,nunit-console,g' $(srcdir)/script.in > $@.tmp
117         mv $@.tmp $@
118
119 $(scripts_1_0): script.in Makefile
120         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script.in > $@.tmp
121         mv $@.tmp $@
122
123 $(scripts_1_0_umask): script_umask.in Makefile
124         $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script_umask.in > $@.tmp
125         mv $@.tmp $@
126
127 $(scripts_2_0): script.in Makefile
128         n=`echo $@ | sed 's,2$$,,'`; \
129         $(REWRITE2) -e "s,@""exe_name@,$$n,g" $(srcdir)/script.in > $@.tmp
130         mv $@.tmp $@