# file settings BUILD_DIR := build DOCUMENT := essence_of_electronics.tex # tex settings TEX := lualatex \ -interaction=nonstopmode \ -halt-on-error \ -output-directory=$(BUILD_DIR) # automated stuff _DOCUMENT := $(BUILD_DIR)/$(DOCUMENT) _DOCUMENT_SRC := $(patsubst %.pdf,%.tex,$(DOCUMENT)) # recipes .PHONY: build_dir all: $(_DOCUMENT) $(_DOCUMENT): $(_DOCUMENT_SRC) build_dir $(TEX) $< build_dir: mkdir -p $(BUILD_DIR)/tex