Add a new script to allow some tools, like sn and makecert, to generate files (e...
[mono.git] / scripts / Makefile.am
index ac3df498486973829f3789f52b1203541fc707bb..971729823f7b07dd740f5e9feec06fffba21acb4 100644 (file)
-EXTRA_DIST = mcs.in mbas.in ilasm.in cilc.in monoresgen.in resgen.in secutil.in sqlsharp.in xsd.in wsdl2.in wsdl.in genxs.in soapsuds.in chktrust.in signcode.in disco.in sn.in al.in cert2spc.in setreg.in makecert.in certmgr.in monop.in gacutil.in gmcs.in mono-find-provides.in mono-find-requires.in
+bin_SCRIPTS = $(scripts_1_0) $(scripts_1_0_umask) $(scripts_2_0) gmcs mono-service $(scripts_rpmhelpers)
 
-bin2dir = $(bindir)
+scripts_1_0 = \
+       al                      \
+       caspol                  \
+       cert2spc                \
+       certmgr                 \
+       chktrust                \
+       cilc                    \
+       disco                   \
+       dtd2xsd                 \
+       gacutil                 \
+       genxs                   \
+       ilasm                   \
+       macpack                 \
+       mbas                    \
+       mcs                     \
+       mjs                     \
+       mkbundle                \
+       monop                   \
+       mono-shlib-cop          \
+       mozroots                \
+       nunit-console           \
+       permview                \
+       prj2make                \
+       resgen                  \
+       secutil                 \
+       setreg                  \
+       signcode                \
+       soapsuds                \
+       sqlsharp                \
+       wsdl                    \
+       xsd
 
-bin_SCRIPTS = mcs mbas ilasm cilc monoresgen resgen secutil sqlsharp xsd wsdl al genxs soapsuds chktrust signcode disco sn cert2spc setreg makecert certmgr monop gacutil mono-find-requires mono-find-provides
+scripts_1_0_umask = \
+       makecert                \
+       sn
 
-bin2_SCRIPTS = gmcs wsdl2
+scripts_2_0 = \
+       monop2                  \
+       xbuild                  \
+       wsdl2
 
-CLEANFILES = $(bin_SCRIPTS) $(bin2_SCRIPTS)
+scripts_rpmhelpers = mono-find-provides mono-find-requires
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA= mono-nunit.pc
+
+CLEANFILES = $(scripts_1_0) $(scripts_1_0_umask) $(scripts_2_0) gmcs mono-service
+DISTCLEANFILES = $(pkgconfig_DATA) $(scripts_rpmhelpers)
+
+EXTRA_DIST =                   \
+       script.in              \
+       script_umask.in        \
+       mono-service.in        \
+       mono-nunit.pc.in       \
+       mono-find-provides.in  \
+       mono-find-requires.in
 
 if USE_JIT
-MONO_INTERP = mono
+mono_interp = mono
 else
-MONO_INTERP = mint
+mono_interp = mint
 endif
 
 if PLATFORM_WIN32
 plat_bindir = $(shell cygpath -m $(libdir))
-mono_one_instdir = $(shell cygpath -m $(libdir))/mono/1.0
-mono_two_instdir = $(shell cygpath -m $(libdir))/mono/2.0
+mono_instdir = $(shell cygpath -m $(libdir))/mono
 else
 plat_bindir = $(bindir)
-mono_one_instdir = $(libdir)/mono/1.0
-mono_two_instdir = $(libdir)/mono/2.0
+mono_instdir = $(prefix)/lib/mono
 endif
 
 REWRITE = sed \
        -e 's,@''bindir@,$(bindir),g'                           \
        -e 's,@''plat_bindir@,$(plat_bindir),g'                 \
-       -e 's,@''mono_one_instdir@,$(mono_one_instdir),g'       \
-       -e 's,@''mono_two_instdir@,$(mono_two_instdir),g'       \
+       -e 's,@''mono_instdir@,$(mono_instdir),g'               \
        -e 's,@''gtkdir@,$(gtkdir),g'                           \
-       -e 's,@''exe_file@,$@.exe,g'                            \
-       -e 's,@''mono_interp@,$(MONO_INTERP),g'
+       -e 's,@''mono_interp@,$(mono_interp),g'
 
-$(bin_SCRIPTS): script.in Makefile.am
-       $(REWRITE) $(srcdir)/script.in > $@.tmp
+REWRITE1 = $(REWRITE) -e 's,@''framework_version@,1.0,g'
+REWRITE2 = $(REWRITE) -e 's,@''framework_version@,2.0,g'
+
+mono-service: mono-service.in Makefile
+       $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/mono-service.in > $@.tmp
        mv $@.tmp $@
 
-$(bin2_SCRIPTS): script2.in Makefile.am
-       $(REWRITE) $(srcdir)/script2.in > $@.tmp
+$(scripts_1_0): script.in Makefile
+       $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script.in > $@.tmp
        mv $@.tmp $@
 
+$(scripts_1_0_umask): script_umask.in Makefile
+       $(REWRITE1) -e 's,@''exe_name@,$@,g' $(srcdir)/script_umask.in > $@.tmp
+       mv $@.tmp $@
+
+gmcs: script.in Makefile
+       $(REWRITE2) -e 's,@''exe_name@,$@,g' $(srcdir)/script.in > $@.tmp
+       mv $@.tmp $@
+
+$(scripts_2_0): script.in Makefile
+       n=`echo $@ | sed 's,2$$,,'`; \
+       $(REWRITE2) -e "s,@""exe_name@,$$n,g" $(srcdir)/script.in > $@.tmp
+       mv $@.tmp $@