diff options
Diffstat (limited to 'Build/source/utils/m-tx')
-rw-r--r-- | Build/source/utils/m-tx/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/utils/m-tx/Makefile.am | 14 | ||||
-rw-r--r-- | Build/source/utils/m-tx/Makefile.in | 202 | ||||
-rw-r--r-- | Build/source/utils/m-tx/aclocal.m4 | 6 | ||||
-rwxr-xr-x | Build/source/utils/m-tx/m-tx.lua | 174 |
5 files changed, 44 insertions, 357 deletions
diff --git a/Build/source/utils/m-tx/ChangeLog b/Build/source/utils/m-tx/ChangeLog index c80769c6b70..a7403da577a 100644 --- a/Build/source/utils/m-tx/ChangeLog +++ b/Build/source/utils/m-tx/ChangeLog @@ -1,3 +1,8 @@ +2012-11-20 Peter Breitenlohner <peb@mppmu.mpg.de> + + * Makefile.am: Drop m-tx.lua, + now in ../../texk/texlive/linked_scripts/m-tx. + 2012-10-04 Peter Breitenlohner <peb@mppmu.mpg.de> * Makefile.am: Drop libp2c.a (multiple definitions). diff --git a/Build/source/utils/m-tx/Makefile.am b/Build/source/utils/m-tx/Makefile.am index 4f1f2e466c6..452ef4735a0 100644 --- a/Build/source/utils/m-tx/Makefile.am +++ b/Build/source/utils/m-tx/Makefile.am @@ -54,20 +54,6 @@ prepmx_SOURCES = \ ## We can not use $(MTX_TREE)/libp2c/p2clib.c (multiple definitions). -lua_scripts = m-tx - -scriptsdir = texmf-dist/scripts/m-tx -nodist_bin_SCRIPTS = - -include $(srcdir)/../../texk/am/script_links.am - -texmfdir = $(datarootdir)/$(scriptsdir) -dist_texmf_SCRIPTS = $(lua_scripts:=.lua) - -install-data-hook: install-lua-links - -uninstall-hook: uninstall-links - dist_man1_MANS = m-tx.1 prepmx.1 ## Tests diff --git a/Build/source/utils/m-tx/Makefile.in b/Build/source/utils/m-tx/Makefile.in index 362394ad226..c46c8eb9bfb 100644 --- a/Build/source/utils/m-tx/Makefile.in +++ b/Build/source/utils/m-tx/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.4 from Makefile.am. +# Makefile.in generated by automake 1.12.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -14,7 +14,6 @@ @SET_MAKE@ - VPATH = @srcdir@ am__make_dryrun = \ { \ @@ -50,8 +49,8 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = prepmx$(EXEEXT) +subdir = . DIST_COMMON = $(am__configure_deps) $(dist_man1_MANS) \ - $(dist_texmf_SCRIPTS) $(srcdir)/../../texk/am/script_links.am \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/../../build-aux/depcomp \ $(top_srcdir)/../../build-aux/install-sh \ @@ -60,8 +59,6 @@ DIST_COMMON = $(am__configure_deps) $(dist_man1_MANS) \ ../../build-aux/depcomp ../../build-aux/install-sh \ ../../build-aux/ltmain.sh ../../build-aux/missing \ ../../build-aux/texinfo.tex ../../build-aux/ylwrap ChangeLog -@WIN32_TRUE@@WIN32_WRAP_TRUE@am__append_1 = $(wrappers) -subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-warnings.m4 \ $(top_srcdir)/../../m4/kpse-win32.m4 $(top_srcdir)/version.ac \ @@ -73,8 +70,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" \ - "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_prepmx_OBJECTS = analyze.$(OBJEXT) cfuncs.$(OBJEXT) \ control.$(OBJEXT) files.$(OBJEXT) globals.$(OBJEXT) \ @@ -84,6 +80,21 @@ am_prepmx_OBJECTS = analyze.$(OBJEXT) cfuncs.$(OBJEXT) \ utility.$(OBJEXT) prepmx_OBJECTS = $(am_prepmx_OBJECTS) prepmx_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(prepmx_SOURCES) +DIST_SOURCES = $(prepmx_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -111,22 +122,6 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -SCRIPTS = $(dist_texmf_SCRIPTS) $(nodist_bin_SCRIPTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(prepmx_SOURCES) -DIST_SOURCES = $(prepmx_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) @@ -248,8 +243,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I ../../m4 -EXTRA_DIST = $(MTX_TREE) $(MTX_TREE)-PATCHES ../../build-aux/relpath \ - $(TESTS) tests/mozart.mtx tests/mozart.pmx +EXTRA_DIST = $(MTX_TREE) $(MTX_TREE)-PATCHES $(TESTS) tests/mozart.mtx \ + tests/mozart.pmx AM_CPPFLAGS = -I$(srcdir)/$(MTX_TREE)/libp2c -DNO_DECLARE_MALLOC AM_CFLAGS = #$(WARNING_CFLAGS) prepmx_SOURCES = \ @@ -285,14 +280,6 @@ prepmx_SOURCES = \ $(MTX_TREE)/utility.c \ $(MTX_TREE)/utility.h -lua_scripts = m-tx -scriptsdir = texmf-dist/scripts/m-tx -nodist_bin_SCRIPTS = $(am__append_1) -all_scripts = $(lua_scripts) $(perl_scripts) $(shell_scripts) -@WIN32_TRUE@@WIN32_WRAP_TRUE@wrappers = $(all_scripts:=.exe) -@WIN32_TRUE@@WIN32_WRAP_TRUE@runscript = $(top_srcdir)/../../texk/texlive/w32_wrapper/runscript.exe -texmfdir = $(datarootdir)/$(scriptsdir) -dist_texmf_SCRIPTS = $(lua_scripts:=.lua) dist_man1_MANS = m-tx.1 prepmx.1 TESTS = m-tx.test DISTCLEANFILES = mozart* @@ -302,7 +289,7 @@ all: all-am .SUFFIXES: .c .o .obj am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../texk/am/script_links.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -325,7 +312,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/../../texk/am/script_links.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -378,76 +364,6 @@ clean-binPROGRAMS: prepmx$(EXEEXT): $(prepmx_OBJECTS) $(prepmx_DEPENDENCIES) $(EXTRA_prepmx_DEPENDENCIES) @rm -f prepmx$(EXEEXT) $(LINK) $(prepmx_OBJECTS) $(prepmx_LDADD) $(LIBS) -install-dist_texmfSCRIPTS: $(dist_texmf_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(dist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(texmfdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(texmfdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(texmfdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(texmfdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_texmfSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(texmfdir)'; $(am__uninstall_files_from_dir) -install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-nodist_binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -1080,9 +996,9 @@ distcleancheck: distclean check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) +all-am: Makefile $(PROGRAMS) $(MANS) installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1139,14 +1055,13 @@ info: info-am info-am: -install-data-am: install-dist_texmfSCRIPTS install-man - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-data-am: install-man + install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-nodist_binSCRIPTS +install-exec-am: install-binPROGRAMS install-html: install-html-am @@ -1187,13 +1102,11 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-dist_texmfSCRIPTS \ - uninstall-man uninstall-nodist_binSCRIPTS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +uninstall-am: uninstall-binPROGRAMS uninstall-man + uninstall-man: uninstall-man1 -.MAKE: check-am install-am install-data-am install-strip uninstall-am +.MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \ clean clean-binPROGRAMS clean-cscope clean-generic cscope \ @@ -1202,63 +1115,20 @@ uninstall-man: uninstall-man1 distclean distclean-compile distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-data-hook \ - install-dist_texmfSCRIPTS install-dvi install-dvi-am \ + install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ - install-nodist_binSCRIPTS install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-dist_texmfSCRIPTS \ - uninstall-hook uninstall-man uninstall-man1 \ - uninstall-nodist_binSCRIPTS + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-man uninstall-man1 # in case of an SVN repository dist-hook: rm -rf `find $(distdir) -name .svn` -.PHONY: install-lua-links install-perl-links install-shell-links install-sh-links \ - install-links uninstall-links -@WIN32_TRUE@@WIN32_WRAP_TRUE@$(wrappers): $(runscript) -@WIN32_TRUE@@WIN32_WRAP_TRUE@ $(LN_S) $(runscript) $@ - -install-lua-links: -@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=lua EXT=lua install-links - -install-perl-links: -@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=perl EXT=pl install-links - -install-shell-links: -@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=shell EXT=sh install-links - -install-sh-links: -@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=sh EXT=sh install-links - -# We support native builds, multiplatform or not, as well as distro builds. -install-links: - @REL=`$(SHELL) $(srcdir)/../../build-aux/relpath '$(DESTDIR)' '$(bindir)' '$(datarootdir)'`; \ - if test -z "$$REL"; then \ - echo 'unable to compute relative path for linked $(TYPE) scripts' >&2; \ - exit 1; \ - fi; \ - cd $(DESTDIR)$(bindir) && \ - for f in $($(TYPE)_scripts); do \ - rm -f $$f; \ - echo "creating link '$$f' -> '$$REL/$(scriptsdir)/$$f.$(EXT)'"; \ - $(LN_S) $$REL/$(scriptsdir)/$$f.$(EXT) $$f || exit 1; \ - done - -uninstall-links: -@WIN32_FALSE@ @for f in $(all_scripts) $(sh_scripts); do \ -@WIN32_FALSE@ echo "rm -f '$(DESTDIR)$(bindir)/$$f'"; \ -@WIN32_FALSE@ rm -f "$(DESTDIR)$(bindir)/$$f"; \ -@WIN32_FALSE@ done - -install-data-hook: install-lua-links - -uninstall-hook: uninstall-links # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/Build/source/utils/m-tx/aclocal.m4 b/Build/source/utils/m-tx/aclocal.m4 index 70c97706594..9dde02f1d6e 100644 --- a/Build/source/utils/m-tx/aclocal.m4 +++ b/Build/source/utils/m-tx/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.12.4 -*- Autoconf -*- +# generated automatically by aclocal 1.12.5 -*- Autoconf -*- # Copyright (C) 1996-2012 Free Software Foundation, Inc. @@ -34,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.12' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.12.4], [], +m4_if([$1], [1.12.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,7 +50,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.12.4])dnl +[AM_AUTOMAKE_VERSION([1.12.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff --git a/Build/source/utils/m-tx/m-tx.lua b/Build/source/utils/m-tx/m-tx.lua deleted file mode 100755 index 3ed578563ed..00000000000 --- a/Build/source/utils/m-tx/m-tx.lua +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env texlua - -VERSION = "0.3" - ---[[ - m-tx.lua: processes MusiXTeX files using prepmx and pmxab as pre-processors (and deletes intermediate files) - - (c) Copyright 2011-2012 Bob Tennent rdt@cs.queensu.ca - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - ---]] - ---[[ - - ChangeLog: - version 0.3 2012-04-09 RDT - Change name to m-tx to avoid clash with another program. - - version 0.2 2011-11-28 RDT - Added -i (retain intermediate files) option - - version 0.1.1 2011-07-18 RDT - - Removed a file check that caused it to fail (only on Windows!) - - version 0.1 2011-07-15 RDT - ---]] - -function usage() - print("Usage: [texlua] m-tx.lua { option | basename[.mtx] } ... ") - print("options: -v version") - print(" -h help") - print(" -l latex (or pdflatex)") - print(" -p pdfetex (or pdflatex)") - print(" -d dvipdfm") - print(" -s stop at dvi") - print(" -t stop at tex/mid") - print(" -m stop at pmx") - print(" -i retain intermediate files") - print(" -f restore default processing") -end - -function whoami () - print("This is m-tx.lua version ".. VERSION .. ".") -end - -whoami() -if #arg == 0 then - usage() - os.exit(0) -end - --- defaults: -prepmx = "prepmx" -pmx = "pmxab" -tex = "etex" -musixflx = "musixflx" -dvi = "dvips" -ps2pdf = "ps2pdf" -intermediate = 1 - -exit_code = 0 -narg = 1 -repeat - this_arg = arg[narg] - if this_arg == "-v" then - os.exit(0) - elseif this_arg == "-h" then - usage() - os.exit(0) - elseif this_arg == "-l" then - if tex == "pdfetex" then - tex = "pdflatex" - else - tex = "latex" - end - elseif this_arg == "-p" then - if tex == "latex" then - tex = "pdflatex" - else - tex = "pdfetex" - end - dvi = ""; ps2pdf = "" - elseif this_arg == "-d" then - dvi = "dvipdfm"; ps2pdf = "" - elseif this_arg == "-s" then - dvi = ""; ps2pdf = "" - elseif this_arg == "-i" then - intermediate = 0 - elseif this_arg == "-f" then - pmx = "pmxab"; tex = "etex"; dvi = "dvips"; ps2pdf = "ps2pdf"; intermediate = 1 - elseif this_arg == "-t" then - tex = ""; dvi = ""; ps2pdf = "" - elseif this_arg == "-m" then - pmx = ""; tex = ""; dvi = ""; ps2pdf = "" - else - filename = this_arg - if filename ~= "" and string.sub(filename, -4, -1) == ".mtx" then - filename = string.sub(filename, 1, -5) - end - print("Processing ".. filename .. ".mtx.") - OK = true - if ( os.execute(prepmx .. " " .. filename ) ~= 0 ) then - OK = false - end - if (OK and pmx ~= "") then - os.execute(pmx .. " " .. filename) -- does pmx return an error code? - pmxaerr = io.open("pmxaerr.dat", "r") - if (not pmxaerr) then - print("No log file.") - OK = false - else - linebuf = pmxaerr:read() - err = tonumber(linebuf) - if (err ~= 0) then - OK = false - end - pmxaerr:close() - end - end - os.remove( filename .. ".mx2" ) - if ( OK ) and - ((tex == "") or os.execute(tex .. " " .. filename) == 0) and - ((tex == "") or os.execute(musixflx .. " " .. filename) == 0) and - ((tex == "") or os.execute(tex .. " " .. filename) == 0) and - ((tex ~= "latex" and tex ~= "pdflatex") - or (os.execute(tex .. " " .. filename) == 0)) and - (dvi == "" or (os.execute(dvi .. " " .. filename) == 0)) and - (ps2pdf == "" or (os.execute(ps2pdf .. " " .. filename .. ".ps") == 0) ) - then - if ps2pdf ~= "" then - print(filename .. ".pdf generated by " .. ps2pdf .. ".") - end - if intermediate == 1 then -- clean-up: - os.remove( "pmxaerr.dat" ) - os.remove( filename .. ".mx1" ) - os.remove( filename .. ".mx2" ) - if pmx ~= "" then - os.remove( filename .. ".pmx" ) - end - if dvi ~= "" then - os.remove( filename .. ".dvi" ) - end - if ps2pdf ~= "" then - os.remove( filename .. ".ps" ) - end - end - else - print("M-Tx/pmx/MusiXTeX processing of " .. filename .. ".mtx fails.\n") - exit_code = 2 - --[[ uncomment for debugging - print("tex = ", tex) - print("dvi = ", dvi) - print("ps2pdf = ", ps2pdf) - --]] - end - end --if this_arg == ... - narg = narg+1 -until narg > #arg -os.exit( exit_code ) |