diff --git a/content/conception_formelle/99-DM_framac/Makefile b/content/conception_formelle/99-DM_framac/Makefile new file mode 100644 index 0000000..d1aa13f --- /dev/null +++ b/content/conception_formelle/99-DM_framac/Makefile @@ -0,0 +1,38 @@ +PDF_APP = zathura +TEX_FILE = TD-TP.tex +OUTPUT_DIR = output +GENERATED_IMAGES_DIR = images/generated +SVG_FILES_DIR=images/svg +svgfiles = $(wildcard $(SVG_FILES_DIR)/*.svg) +figures = $(subst svg/,generated/,$(subst .svg,.png,$(svgfiles))) +pdf_file = $(subst tex,pdf,$(TEX_FILE)) + +default: build + +images: $(figures) + +clean: + rm -rf $(GENERATED_IMAGES_DIR)/* + rm -rf $(OUTPUT_DIR)/* + +build: $(OUTPUT_DIR)/$(pdf_file) + +$(OUTPUT_DIR)/$(pdf_file): $(TEX_FILE) + $(shell mkdir -p $(OUTPUT_DIR)) + lualatex --interaction=nonstopmode --output-directory $(OUTPUT_DIR) $< + +buildall: images build + +$(GENERATED_IMAGES_DIR)/%.png : images/svg/%.svg + @echo build $@ + @mkdir -p $(GENERATED_IMAGES_DIR) + @inkscape --export-type=png --export-dpi=300 -o $@ $< + +echo: + @echo "svg files: $(svgfiles)" + @echo "generated figures: $(figures)" + +view: build + $(PDF_APP) $(OUTPUT_DIR)/$(pdf_file) + +.PHONY: echo view clean