From ae65a19a9932ca91ca4c55b084e3f7d498c935fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Mekina?= Date: Fri, 14 Nov 2025 18:52:50 +0100 Subject: [PATCH] add makefile for packed builds --- Makefile | 5 ++++- packed.mk | 13 +++++++++++++ templategen.mk | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 packed.mk diff --git a/Makefile b/Makefile index 374d421..ff1c138 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ BUNDLE_THESES := bp_cs bp_en dp_cs dp_en prj_cs prj_en BUNDLE_TARGETS := $(TO_PACK:%=$(BUNDLEDIR)/%) $(BUNDLEDIR)/citations.bib $(BUNDLEDIR)/bp_cs.typ \ $(BUNDLE_THESES:%=$(BUNDLEDIR)/%.typ) $(BUNDLEDIR)/Makefile PACK_TARGETS := $(TO_PACK:%=$(PACKDIR)/%) $(PACKDIR)/documentation.typ \ - $(PACKDIR)/documentation.pdf $(PACKDIR)/citations.bib + $(PACKDIR)/documentation.pdf $(PACKDIR)/citations.bib $(PACKDIR)/Makefile TEMPLATE_SRCS := $(shell find template -type f) @@ -108,6 +108,9 @@ $(PACKDIR)/template: | $(PACKDIR) $(PACKDIR)/template/LICENSE: LICENSE | $(PACKDIR)/template ln -f $< $@ +$(PACKDIR)/Makefile: packed.mk | $(PACKDIR) + ln -f $< $@ + $(PACKDIR)/template/tul_citace.csl: template/tul_citace.csl | $(PACKDIR)/template $(call minify_csl,$<,$@) diff --git a/packed.mk b/packed.mk new file mode 100644 index 0000000..969c973 --- /dev/null +++ b/packed.mk @@ -0,0 +1,13 @@ +TYPST_FONTPATH := --font-path template/fonts + +.PHONY: watch_% +watch_%: %.pdf + xdg-open $< & typst watch $(TYPST_FONTPATH) $*.typ + +.PHONY: view_% +view_%: %.pdf + xdg-open $< + +.PHONY: %.pdf +%.pdf: %.typ + typst compile $(TYPST_FONTPATH) $< diff --git a/templategen.mk b/templategen.mk index 925770a..466fb8b 100644 --- a/templategen.mk +++ b/templategen.mk @@ -9,5 +9,6 @@ watch: $(THESIS_FILE).pdf view: $(THESIS_FILE).pdf xdg-open $< +.PHONY: %.pdf %.pdf: %.typ typst compile $(TYPST_FONTPATH) $<