Update Makefile

This commit is contained in:
Yorick Barbanneau 2023-07-31 00:42:09 +02:00
parent f5ed064d9e
commit e1838960c9

View file

@ -3,33 +3,33 @@ OUTPUT ?= output
GEN_DIR ?= images/generated GEN_DIR ?= images/generated
SVG_DIR ?= images/svg SVG_DIR ?= images/svg
PIX_DIR ?= images/bitmap PIX_DIR ?= images/bitmap
DOCUMENT ?= $(patsubst %.tex,%.pdf,$(wildcard *.tex))
SVG_FILES = $(wildcard $(SVG_DIR)/*.svg) SVG_FILES = $(wildcard $(SVG_DIR)/*.svg)
GEN_FILES = $(subst $(SVG_DIR), $(GEN_DIR),$(subst .svg,.pdf,$(SVG_FILES))) GEN_FILES = $(subst $(SVG_DIR), $(GEN_DIR),$(patsubst %.svg,%.pdf,$(SVG_FILES)))
PIX_FILES = $(wildcard $(PIX_DIR)/*.*) PIX_FILES = $(wildcard $(PIX_DIR)/*.*)
default: build default: build
build: $(OUTPUT)/resume_fr.pdf build: $(addprefix $(OUTPUT)/, $(DOCUMENT))
images: $(GEN_FILES) images: $(GEN_FILES)
$(OUTPUT)/%.pdf: %.tex $(GEN_FILES) $(PIX_FILES) $(OUTPUT)/%.pdf: %.tex $(GEN_FILES) $(PIX_FILES)
@$(shell mkdir -p $(OUTPUT)) @$(shell mkdir -p $(OUTPUT))
@lualatex --interaction=nonstopmode --output-directory $(OUTPUT) $< lualatex --interaction=nonstopmode --output-directory $(OUTPUT) $<
$(GEN_DIR)/%.pdf : $(SVG_DIR)/%.svg $(GEN_DIR)/%.pdf : $(SVG_DIR)/%.svg
@echo export PDF from $@ @echo export PDF from $@
@inkscape --export-type=pdf --export-pdf-version=1.4 -o $@ $< @inkscape --export-type=pdf --export-pdf-version=1.4 -o $@ $<
.PHONY: echo .PHONY: echo view clean
echo: echo:
@echo "bitmap images files: $(PIX_FILES)" @echo "document: $(DOCUMENT)"
@echo "svg files: $(SVG_FILES)" @echo "bitmap images: $(PIX_FILES)"
@echo "generated figures: $(GEN_FILES)" @echo "svg images: $(SVG_FILES)"
@echo "generated images: $(GEN_FILES)"
.PHONY: view
view: view:
$(PDF_APP) $(OUTPUT)/resume_fr.pdf $(PDF_APP) $(addprefix $(OUTPUT)/, $(DOCUMENT))
.PHONY: clean
clean: clean:
rm -rf $(GEN_DIR)/* $(OUTPUT) rm -rf $(GEN_DIR)/* $(OUTPUT)