Commit 5974d33f authored by liziwl's avatar liziwl
Browse files

更新makefile

parent cfda26e4
Loading
Loading
Loading
Loading
+5 −64
Original line number Diff line number Diff line
@@ -2,14 +2,10 @@

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
@@ -18,76 +14,21 @@ 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
.PHONY: all clean cleanall thesis viewthesis

thesis: $(THESIS).pdf

all: thesis spine
all: thesis

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
$(THESIS).pdf:
	$(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:
ifeq ($(target),)
	bash testfiles/save.sh
else
	bash testfiles/save.sh $(target)
endif

test:
ifeq ($(target),)
	l3build check
else
	bash testfiles/test.sh $(target)
endif

clean:
	$(LATEXMK) -c $(PACKAGE).dtx $(THESIS) $(SPINE)
	$(LATEXMK) -c $(THESIS)
	-@$(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 with \'l3build tag\" before release"; exit 1)
	@[[ $(shell grep -E -c '"version": "$(version)"' package.json) -eq 1 ]] || (echo "update version with \'l3build tag\" 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)
	-@$(RM) $(THESIS).pdf

clean.bat

0 → 100644
+2 −0
Original line number Diff line number Diff line
latexmk -c thuthesis-example
del /Q *~ main-survey.* main-translation.* _markdown_thuthesis* thuthesis.markdown.*
 No newline at end of file
+7 B (356 KiB)

File changed.

No diff preview for this file type.

thuthesis.pdf

deleted100644 → 0
−1020 KiB

File deleted.