Greatly improve build method
This commit is contained in:
parent
fffb14b3ec
commit
f5ed064d9e
1 changed files with 26 additions and 25 deletions
51
Makefile
51
Makefile
|
@ -1,34 +1,35 @@
|
|||
PDF_APP = zathura
|
||||
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_APP ?= zathura
|
||||
OUTPUT ?= output
|
||||
GEN_DIR ?= images/generated
|
||||
SVG_DIR ?= images/svg
|
||||
PIX_DIR ?= images/bitmap
|
||||
|
||||
SVG_FILES = $(wildcard $(SVG_DIR)/*.svg)
|
||||
GEN_FILES = $(subst $(SVG_DIR), $(GEN_DIR),$(subst .svg,.pdf,$(SVG_FILES)))
|
||||
PIX_FILES = $(wildcard $(PIX_DIR)/*.*)
|
||||
|
||||
default: build
|
||||
build: $(OUTPUT)/resume_fr.pdf
|
||||
images: $(GEN_FILES)
|
||||
|
||||
images: $(figures)
|
||||
$(OUTPUT)/%.pdf: %.tex $(GEN_FILES) $(PIX_FILES)
|
||||
@$(shell mkdir -p $(OUTPUT))
|
||||
@lualatex --interaction=nonstopmode --output-directory $(OUTPUT) $<
|
||||
|
||||
clean:
|
||||
rm -rf $(GENERATED_IMAGES_DIR)/*
|
||||
rm -rf $(OUTPUT_DIR)/*
|
||||
|
||||
build:
|
||||
$(shell mkdir -p $(OUTPUT_DIR))
|
||||
lualatex --interaction=nonstopmode --output-directory $(OUTPUT_DIR) resume_fr.tex
|
||||
|
||||
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 $@ $<
|
||||
$(GEN_DIR)/%.pdf : $(SVG_DIR)/%.svg
|
||||
@echo export PDF from $@
|
||||
@inkscape --export-type=pdf --export-pdf-version=1.4 -o $@ $<
|
||||
|
||||
.PHONY: echo
|
||||
echo:
|
||||
@echo "svg files: $(svgfiles)"
|
||||
@echo "generated figures: $(figures)"
|
||||
@echo "bitmap images files: $(PIX_FILES)"
|
||||
@echo "svg files: $(SVG_FILES)"
|
||||
@echo "generated figures: $(GEN_FILES)"
|
||||
|
||||
.PHONY: view
|
||||
view:
|
||||
$(PDF_APP) $(OUTPUT_DIR)/resume_fr.pdf
|
||||
$(PDF_APP) $(OUTPUT)/resume_fr.pdf
|
||||
|
||||
.PHONY: echo view clean
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(GEN_DIR)/* $(OUTPUT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue