forked from ephase/resume
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
|
PDF_APP ?= zathura
|
||||||
OUTPUT_DIR = output
|
OUTPUT ?= output
|
||||||
GENERATED_IMAGES_DIR = images/generated
|
GEN_DIR ?= images/generated
|
||||||
SVG_FILES_DIR=images/svg
|
SVG_DIR ?= images/svg
|
||||||
svgfiles = $(wildcard $(SVG_FILES_DIR)/*.svg)
|
PIX_DIR ?= images/bitmap
|
||||||
figures = $(subst svg/,generated/,$(subst .svg,.png,$(svgfiles)))
|
|
||||||
|
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
|
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:
|
$(GEN_DIR)/%.pdf : $(SVG_DIR)/%.svg
|
||||||
rm -rf $(GENERATED_IMAGES_DIR)/*
|
@echo export PDF from $@
|
||||||
rm -rf $(OUTPUT_DIR)/*
|
@inkscape --export-type=pdf --export-pdf-version=1.4 -o $@ $<
|
||||||
|
|
||||||
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 $@ $<
|
|
||||||
|
|
||||||
|
.PHONY: echo
|
||||||
echo:
|
echo:
|
||||||
@echo "svg files: $(svgfiles)"
|
@echo "bitmap images files: $(PIX_FILES)"
|
||||||
@echo "generated figures: $(figures)"
|
@echo "svg files: $(SVG_FILES)"
|
||||||
|
@echo "generated figures: $(GEN_FILES)"
|
||||||
|
|
||||||
|
.PHONY: view
|
||||||
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