summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/thuthesis/Makefile
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-06-14 22:17:29 +0000
committerKarl Berry <karl@freefriends.org>2020-06-14 22:17:29 +0000
commitf7e5c5650d2264718d6352ea78e3b5251354b2f1 (patch)
treeecf972e4be9cc35f2b733cbb993145f8b13702e8 /Master/texmf-dist/doc/latex/thuthesis/Makefile
parent47b4d99385889b85a133b06b1da85c6d09088342 (diff)
thuthesis (15jun20)
git-svn-id: svn://tug.org/texlive/trunk@55547 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/thuthesis/Makefile')
-rw-r--r--Master/texmf-dist/doc/latex/thuthesis/Makefile88
1 files changed, 88 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/thuthesis/Makefile b/Master/texmf-dist/doc/latex/thuthesis/Makefile
new file mode 100644
index 00000000000..1b75fed140a
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/thuthesis/Makefile
@@ -0,0 +1,88 @@
+# Makefile for ThuThesis
+
+PACKAGE = thuthesis
+THESIS = thuthesis-example
+SPINE = spine
+
+SOURCES = $(PACKAGE).ins $(PACKAGE).dtx
+CLSFILE = dtx-style.sty $(PACKAGE).cls
+
+LATEXMK = latexmk
+SHELL := /bin/bash
+NPM ?= npm
+
+# make deletion work on Windows
+ifdef SystemRoot
+ RM = del /Q
+else
+ RM = rm -f
+endif
+
+.PHONY: all all-dev clean distclean dist thesis viewthesis spine viewspine doc viewdoc cls check save savepdf test FORCE_MAKE
+
+thesis: $(THESIS).pdf
+
+all: thesis spine
+
+all-dev: doc all
+
+cls: $(CLSFILE)
+
+$(CLSFILE): $(SOURCES)
+ xetex $(PACKAGE).ins
+
+doc: $(PACKAGE).pdf
+
+spine: $(SPINE).pdf
+
+$(PACKAGE).pdf: cls FORCE_MAKE
+ $(LATEXMK) $(PACKAGE).dtx
+
+$(THESIS).pdf: cls FORCE_MAKE
+ $(LATEXMK) $(THESIS)
+
+$(SPINE).pdf: cls FORCE_MAKE
+ $(LATEXMK) $(SPINE)
+
+viewdoc: doc
+ $(LATEXMK) -pv $(PACKAGE).dtx
+
+viewthesis: thesis
+ $(LATEXMK) -pv $(THESIS)
+
+viewspine: spine
+ $(LATEXMK) -pv $(SPINE)
+
+save:
+ bash testfiles/save.sh
+
+savepdf:
+ bash testfiles/save-pdf.sh
+
+test:
+ l3build check
+
+clean:
+ $(LATEXMK) -c $(PACKAGE).dtx $(THESIS) $(SPINE)
+ -@$(RM) -rf *~ main-survey.* main-translation.* _markdown_thuthesis* thuthesis.markdown.*
+
+cleanall: clean
+ -@$(RM) $(PACKAGE).pdf $(THESIS).pdf $(SPINE).pdf
+
+distclean: cleanall
+ -@$(RM) $(CLSFILE)
+ -@$(RM) -r dist
+
+check: FORCE_MAKE
+ifeq ($(version),)
+ @echo "Error: version missing: \"make [check|dist] version=X.Y.Z\""; exit 1
+else
+ @[[ $(shell grep -E -c '$(version) Tsinghua University Thesis Template|\\def\\version\{$(version)\}' thuthesis.dtx) -eq 3 ]] || (echo "update version in thuthesis.dtx before release"; exit 1)
+ @[[ $(shell grep -E -c '"version": "$(version)"' package.json) -eq 1 ]] || (echo "update version in package.json before release"; exit 1)
+endif
+
+dist: check all-dev
+ # use l3build for CTAN release (zip with .tds.zip)
+ l3build ctan --config build-ctan
+ # use gulp for GitHub release (zip with generated file)
+ $(NPM) run build -- --version=$(version)