formelsammlung/Makefile

38 lines
939 B
Makefile
Raw Normal View History

2025-01-02 18:12:26 +01:00
# Makefile for lualatex
# Paths and filenames
SRC_DIR = src
OUT_DIR = out
2025-01-12 14:20:02 +01:00
MAIN_TEX = main.tex # in SRC_DIR
MAIN_PDF = main.pdf # in OUT_DIR
2025-01-02 18:12:26 +01:00
# LaTeX and Biber commands
LATEX = lualatex
BIBER = biber
LATEX_OPTS := -output-directory=$(OUT_DIR) -interaction=nonstopmode -shell-escape
.PHONY: default release clean
default: english
release: german english
# Default target
english:
2025-01-12 14:20:02 +01:00
sed -r -i 's/usepackage\[[^]]+\]\{babel\}/usepackage[english]{babel}/' $(SRC_DIR)/$(MAIN_TEX)
2025-01-10 09:59:07 +01:00
-cd $(SRC_DIR) && latexmk -lualatex -g main.tex
2025-01-12 14:20:02 +01:00
mv $(OUT_DIR)/$(MAIN_PDF) $(OUT_DIR)/$(shell date -I)_en_Formulary.pdf
2025-01-02 18:12:26 +01:00
german:
2025-01-12 14:20:02 +01:00
sed -r -i 's/usepackage\[[^]]+\]\{babel\}/usepackage[german]{babel}/' $(SRC_DIR)/$(MAIN_TEX)
2025-01-10 09:59:07 +01:00
-cd $(SRC_DIR) && latexmk -lualatex -g main.tex
2025-01-12 14:20:02 +01:00
mv $(OUT_DIR)/$(MAIN_PDF) $(OUT_DIR)/$(shell date -I)_de_Formelsammlung.pdf
2025-01-02 18:12:26 +01:00
# Clean auxiliary and output files
clean:
rm -r $(OUT_DIR)
# Phony targets
.PHONY: all clean biber