diff options
author | Karl Berry <karl@freefriends.org> | 2011-02-13 23:32:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-02-13 23:32:08 +0000 |
commit | 8c01e7e9bb109cc006bac6234088ef1c55a7d072 (patch) | |
tree | 6d178cec11a53580e36daffd12b0a1b36cc42459 /Master/texmf-dist/source/latex/unicode-math/Makefile | |
parent | ab5d6cd04710c0e8333450c51d13797d8d72aff0 (diff) |
unicode-math 0.5d (13feb11)
git-svn-id: svn://tug.org/texlive/trunk@21391 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/unicode-math/Makefile')
-rw-r--r-- | Master/texmf-dist/source/latex/unicode-math/Makefile | 300 |
1 files changed, 257 insertions, 43 deletions
diff --git a/Master/texmf-dist/source/latex/unicode-math/Makefile b/Master/texmf-dist/source/latex/unicode-math/Makefile index 379dd680d70..c8c6e60b096 100644 --- a/Master/texmf-dist/source/latex/unicode-math/Makefile +++ b/Master/texmf-dist/source/latex/unicode-math/Makefile @@ -66,23 +66,10 @@ CTANFILES = $(PKGSOURCE) $(DOC) $(testdir) BUILDCTAN = $(addprefix $(builddir)/,$(CTANFILES)) BUILDDOC = $(addprefix $(builddir)/,$(DOC)) -# these are what's needed to compile and make stuff: +# LTXSOURCE = $(PKG).sty $(TBL) -SUITESOURCE = \ - umtest-preamble.tex \ - umtest-suite-X.tex \ - umtest-suite-L.tex - -TESTOUT = $(shell ls $(testdir)/*.safe.pdf) -BUILDTESTSRC = $(subst $(testdir)/,$(builddir)/,$(subst .safe.pdf,.ltx,$(TESTOUT))) -BUILDTESTTARGET = $(subst $(testdir)/,$(builddir)/,$(subst .safe.pdf,.diff.pdf,$(TESTOUT))) - -BUILDSOURCE = $(addprefix $(builddir)/,$(LTXSOURCE)) -BUILDSUITE = $(addprefix $(builddir)/,$(SUITESOURCE)) -BUILDFILES = $(BUILDSOURCE) $(BUILDSUITE) $(BUILDTESTSRC) - # and this is how the TDS zip file is produced: INSFILES = \ @@ -127,17 +114,17 @@ $(builddir)/$(PKG).dtx: $(PKG).dtx $(builddir)/$(PKG).sty: $(builddir)/$(PKG).dtx echo "Updating $@" - cd $(builddir); \ + cd $(builddir) && \ tex $(PKG).dtx > /dev/null ; $(builddir)/$(PKG).pdf: $(builddir)/$(PKG).dtx $(BUILDSOURCE) - cd $(builddir); \ + cd $(builddir) && \ xelatex $(PKG).dtx && \ makeindex -s gind.ist $(PKG) && \ xelatex $(PKG).dtx; $(builddir)/$(SYM).pdf: $(builddir)/$(SYM).ltx - cd $(builddir); \ + cd $(builddir) && \ xelatex $(SYM).ltx && \ xelatex $(SYM).ltx; @@ -160,7 +147,7 @@ $(builddir)/README: $(builddir)/README.markdown # Test suite PDF $(builddir)/$(SUITE).pdf: $(builddir)/$(SUITE).ltx $(BUILDSUITE) $(builddir)/$(testdir) - cd $(builddir); \ + cd $(builddir) && \ xelatex $(SUITE).ltx @@ -168,9 +155,11 @@ $(builddir)/$(SUITE).pdf: $(builddir)/$(SUITE).ltx $(BUILDSUITE) $(builddir)/$(t ##### CTAN INSTALLATION ##### -tds: $(builddir)/$(PKG).tds.zip +TDS = $(builddir)/$(PKG).tds.zip -$(builddir)/$(PKG).tds.zip: $(tds)/$(PKG).tds.zip +tds: $(TDS) + +$(TDS): $(tds)/$(PKG).tds.zip $(COPY) $< $@ $(tds)/$(PKG).tds.zip: $(TDSFILES) @@ -242,46 +231,271 @@ lfile: $(F) $(BUILDSOURCE) # TESTSUITE # ############# +#### Needed to compile and make stuff #### + +builddir=build +testdir=testfiles +lprefix=L +xprefix=X +both=F +NAME=unicode-math + +COPY = cp -a +MOVE = mv -f +COMPARE_OPTS = -density 300x300 -metric ae -fuzz 35% + +# Redefine this to print output if you need: +REDIRECT = > /dev/null + +LTXSOURCE = $(NAME).sty + +TESTLIST = umtest-suite-X.tex umtest-suite-L.tex umtest-suite-F.tex + +SUITESOURCE = \ + $(testdir)/umtest-preamble.tex \ + $(testdir)/$(TESTLIST) + +TESTOUT = $(wildcard $(testdir)/*.safe.pdf) +BUILDTESTSRC = $(subst $(testdir)/,$(builddir)/,$(subst .safe.pdf,.ltx,$(TESTOUT))) + +BUILDTESTTARGET1 = $(TESTOUT) +BUILDTESTTARGET2 = $(subst $(testdir)/,$(builddir)/,$(BUILDTESTTARGET1)) +BUILDTESTTARGET3 = $(subst .Xsafe.pdf,-X.diff.pdf,$(BUILDTESTTARGET2)) +BUILDTESTTARGET4 = $(subst .Lsafe.pdf,-L.diff.pdf,$(BUILDTESTTARGET3)) +BUILDTESTTARGET5 = $(subst .safe.pdf,.diff.pdf,$(BUILDTESTTARGET4)) +BUILDTESTTARGET = $(BUILDTESTTARGET5) + +BUILDSOURCE = $(addprefix $(builddir)/,$(LTXSOURCE)) +BUILDSUITE = $(subst $(testdir)/,$(builddir)/,$(SUITESOURCE)) + +BUILDFILES = $(BUILDSOURCE) $(BUILDSUITE) $(BUILDTESTSRC) $(BUILDTESTTARGET) #### All tests #### -check: $(BUILDFILES) $(BUILDTESTTARGET) - cd $(testdir); \ - ls X*.ltx | sed -e 's/\(.*\).ltx/\\inserttest{\1}/g' > umtest-suite-X.tex; \ - ls L*.ltx | sed -e 's/\(.*\).ltx/\\inserttest{\1}/g' > umtest-suite-L.tex; +foo: + echo $(BUILDTESTTARGET) + +check: $(TESTLIST) + +$(TESTLIST): $(BUILDFILES) + cd $(testdir) && \ + ls X*.ltx | sed -e 's/\(.*\).ltx/\\inserttest{\1}/g' > umtest-suite-X.tex && \ + ls L*.ltx | sed -e 's/\(.*\).ltx/\\inserttest{\1}/g' > umtest-suite-L.tex && \ + ls F*.ltx | sed -e 's/\(.*\).ltx/\\inserttest{\1}/g' > umtest-suite-F.tex; + +$(builddir)/%: $(testdir)/% + @mkdir -p $(builddir); \ + $(COPY) $< $@ + +$(builddir)/%: % + @mkdir -p $(builddir); \ + $(COPY) -f $< $@ + + +#### Generating new tests #### + +lonelystub = $(shell cd $(testdir); ls | egrep '[XL].(.*\.ltx)|[XL].(.*\.safe\.pdf)' | cut -d . -f 1 | uniq -u ) +lonelyfile = $(addsuffix .safe.pdf,$(lonelystub)) +lonelypath = $(addprefix $(testdir)/,$(lonelyfile)) +lonelytest = $(addprefix $(builddir)/,$(addsuffix .pdf,$(lonelystub))) + +Xlonelystub = $(shell cd $(testdir); ls | egrep -o '(F.*\.ltx)|(F.*-X\.safe\.pdf)' | sed -e s/-X.safe.pdf// -e s/.ltx// | uniq -u | uniq ) +Xlonelyfile = $(addsuffix -X.safe.pdf,$(Xlonelystub)) +Xlonelypath = $(addprefix $(testdir)/,$(Xlonelyfile)) +Xlonelytest = $(addprefix $(builddir)/,$(addsuffix -X.pdf,$(Xlonelystub))) + +Llonelystub = $(shell cd $(testdir); ls | egrep -o '(F.*\.ltx)|(F.*-L\.safe\.pdf)' | sed -e s/-L.safe.pdf// -e s/.ltx// | uniq -u | uniq ) +Llonelyfile = $(addsuffix -L.safe.pdf,$(Llonelystub)) +Llonelypath = $(addprefix $(testdir)/,$(Llonelyfile)) +Llonelytest = $(addprefix $(builddir)/,$(addsuffix -L.pdf,$(Llonelystub))) + +initest: $(lonelypath) $(Xlonelypath) $(Llonelypath) + +$(lonelypath): $(lonelytest) + $(COPY) `echo $@ | sed -e s/$(testdir)/$(builddir)/ -e s/.safe.pdf/.pdf/` $@ +$(Xlonelypath): $(Xlonelytest) + $(COPY) `echo $@ | sed -e s/$(testdir)/$(builddir)/ -e s/-X.safe.pdf/-X.pdf/` $@ -#### Each step of the process #### +$(Llonelypath): $(Llonelytest) + $(COPY) `echo $@ | sed -e s/$(testdir)/$(builddir)/ -e s/-L.safe.pdf/-L.pdf/` $@ -COMPARE_OPTS = -metric AE -density 300x300 -PIXEL_TOLERANCE = 1 -$(builddir)/%.diff.pdf: $(builddir)/%.pdf - echo '$*: Comparing with reference PDF.' - if [ ${shell compare $(COMPARE_OPTS) $(builddir)/$*.pdf $(testdir)/$*.safe.pdf $(builddir)/$*.diff.pdf 2>&1} -le $(PIXEL_TOLERANCE) ] ; then \ - echo '$*: Test passed.' ; \ +#### TESTS FOR BOTH ENGINES #### + +$(builddir)/F%-L.diff.pdf: $(builddir)/F%-L.pdf + @echo 'F$*: Comparing PDF from LuaLaTeX against reference output.' + if test $(shell compare \ + $(COMPARE_OPTS) \ + $(builddir)/F$*-L.pdf \ + $(testdir)/F$*-L.safe.pdf \ + $(builddir)/F$*-L.diff.pdf 2>&1) -le 1 ; then \ + echo 'F$*: Test passed.' ; \ + else \ + echo 'F$*: Test failed.' ; \ + false ; \ + fi + +$(builddir)/F%-X.diff.pdf: $(builddir)/F%-X.pdf + @echo 'F$*: Comparing PDF from XeLaTeX against reference output.' + if test $(shell compare \ + $(COMPARE_OPTS) \ + $(builddir)/F$*-X.pdf \ + $(testdir)/F$*-X.safe.pdf \ + $(builddir)/F$*-X.diff.pdf 2>&1) -le 1 ; then \ + echo 'F$*: Test passed.' ; \ else \ - echo '$*: Test failed.' ; \ + echo 'F$*: Test failed.' ; \ + false ; \ + fi + +$(builddir)/F%-L.pdf: $(BUILDSOURCE) $(builddir)/F%-L.ltx + @echo 'F$*: Generating PDF output with LuaLaTeX.' + @cd $(builddir); lualatex -interaction=nonstopmode F$*-L.ltx $(REDIRECT) + +$(builddir)/F%-X.pdf: $(BUILDSOURCE) $(builddir)/F%-X.ltx + @echo 'F$*: Generating PDF output with XeLaTeX.' + @cd $(builddir); xelatex -interaction=nonstopmode F$*-X.ltx $(REDIRECT) + +$(builddir)/F%-L.ltx: $(builddir)/F%.ltx + $(COPY) $< $@ + +$(builddir)/F%-X.ltx: $(builddir)/F%.ltx + $(COPY) $< $@ + + +#### TEST FOR EACH ENGINE INDIVIDUALLY #### + +$(builddir)/L%.diff.pdf: $(builddir)/L%.pdf + @echo 'L$*: Comparing PDF against reference output.' + if test $(shell compare $(COMPARE_OPTS) \ + $(builddir)/L$*.pdf $(testdir)/L$*.safe.pdf \ + $(builddir)/L$*.diff.pdf 2>&1) -le 1 ; then \ + echo 'L$*: Test passed.' ; \ + else \ + echo 'L$*: Test failed.' ; \ + false ; \ + fi + +$(builddir)/X%.diff.pdf: $(builddir)/X%.pdf + @echo 'X$*: Comparing PDF against reference output.' + if test $(shell compare \ + $(COMPARE_OPTS) \ + $(builddir)/X$*.pdf \ + $(testdir)/X$*.safe.pdf \ + $(builddir)/X$*.diff.pdf 2>&1) -le 1 ; then \ + echo 'X$*: Test passed.' ; \ + else \ + echo 'X$*: Test failed.' ; \ false ; \ fi $(builddir)/X%.pdf: $(BUILDSOURCE) $(BUILDSUITE) $(builddir)/X%.ltx - echo 'X$*: Generating PDF output from XeLaTeX.' - cd $(builddir); xelatex -interaction=batchmode X$*.ltx > /dev/null + @echo 'X$*: Generating PDF output with XeLaTeX.' + @cd $(builddir); xelatex -interaction=nonstopmode X$*.ltx $(REDIRECT) $(builddir)/L%.pdf: $(BUILDSOURCE) $(BUILDSUITE) $(builddir)/L%.ltx - echo 'L$*: Generating PDF output from LuaLaTeX.' - cd $(builddir); lualatex -interaction=batchmode L$*.ltx > /dev/null + @echo 'L$*: Generating PDF output with LuaLaTeX.' + @cd $(builddir); lualatex -interaction=nonstopmode L$*.ltx $(REDIRECT) +#### HACK: allow `make <foobar>` run that test. -#### Generating new tests #### +L%: build/L%.ltx + make build/L$*.diff.pdf -lonelystub = $(shell cd $(testdir); ls | egrep '(.*\.ltx)|(.*\.safe.pdf)' | cut -d . -f 1 | uniq -u) -lonelytest = $(addprefix $(testdir)/,$(addsuffix .safe.pdf,$(lonelystub))) -lonelytesttarget = $(addprefix $(builddir)/,$(addsuffix .pdf,$(lonelystub))) +X%: build/X%.ltx + make build/X$*.diff.pdf -initest: $(lonelytest) +F%: build/F%.ltx + make build/F$*-L.diff.pdf + make build/F$*-X.diff.pdf -$(lonelytest): $(lonelytesttarget) - $(COPY) `echo $@ | sed -e s/$(testdir)/$(builddir)/ -e s/.safe.pdf/.pdf/` $@ + + + + + + +############################ +###### NIGHTLY BUILDS ###### +############################ + +UNAME_S := $(shell uname -s) + +# Mac OS X: +ifeq ($(UNAME_S),Darwin) + MD5 = md5 +endif + +# Linux: +ifeq ($(UNAME_S),Linux) + MD5 = md5sum +endif + +BRANCH = tdsbuild + +TMP = /tmp +LOG = $(TMP)/gitlog.tmp + + +checkbranch: + @if git branch | grep $(BRANCH) > /dev/null ; \ + then echo "TDS branch exists"; \ + else \ + echo "TDS branch does not exist; doing so will remove all untracked files from your working directory. Create the TDS branch with\n make createbranch"; \ + false; \ + fi; + +createbranch: $(TDS) + cp -f $(TDS) $(TMP)/ + git symbolic-ref HEAD refs/heads/$(BRANCH) + rm .git/index + git clean -fdx + unzip -o $(TMP)/$(TDS) -d . + rm $(TMP)/$(TDS) + git add --all + git commit -m "Initial TDS commit" + git checkout master + git push origin $(BRANCH) master + @echo "\nTDS branch creation was successful.\n" + @echo "Now create a new package at TLContrib: http://tlcontrib.metatex.org/" + @echo "Use the following metadata:" + @echo " Package ID: $(PKG)" + @echo " BRANCH: $(BRANCH)" + @echo "\nAfter this process, use \`make tdsbuild\` to" + @echo " (a) push your recent work on the master branch," + @echo " (b) automatically create a TDS snapshot," + @echo " (c) send the TDS snapshot to TLContrib." + + +ifeq ($(UNAME_S),Darwin) + tlclogin: USERNAME = $(shell security find-internet-password -s tlcontrib.metatex.org | grep "acct" | cut -f 4 -d \") + tlclogin: PASSWORD = $(shell security 2>&1 >/dev/null find-internet-password -gs tlcontrib.metatex.org | cut -f 2 -d ' ') +endif + +ifeq ($(UNAME_S),Linux) + tlclogin: USERNAME = "" + tlclogin: PASSWORD = "" +endif + +tlclogin: VERSION = $(shell date "+%Y-%m-%d@%H:%M") +tlclogin: ; + +tdsbuild: checkbranch tlclogin $(TDS) + cp -f $(TDS) $(TMP)/ + @echo "Constructing commit history for snapshot build" + date "+TDS snapshot %Y-%m-%d %H:%M" > $(LOG) + echo '\n\nApproximate commit history since last snapshot:\n' >> $(LOG) + git log --after="`git log -b $(BRANCH) -n 1 --pretty=format:"%aD"`" --pretty=format:"%+H%+s%+b" >> $(LOG) + @echo "Committing TDS snapshot to separate branch" + git checkout $(BRANCH) + unzip -o $(TMP)/$(TDS) -d . + rm $(TMP)/$(TDS) + git commit --all --file=$(LOG) + git clean -df + @echo "Pushing TDS and master branch" + git checkout master + git push origin $(BRANCH) master + @echo "Pinging TLContrib for automatic update" + curl http://tlcontrib.metatex.org/cgi-bin/package.cgi/action=notify/key=$(PKG)/check=$(shell echo $(USERNAME)/$(PASSWORD)/$(VERSION) | $(MD5) )?version=$(VERSION) > /dev/null 2>&1 |