trashware-book/Makefile

47 lines
1.0 KiB
Makefile
Raw Permalink Normal View History

2018-02-10 11:49:54 +00:00
### SVG conversion parameters ###
SVG_DIR = ./img/originals
VEC_DIR = ./img/vectors
# Select all SVG filenames
SVG = $(notdir $(wildcard $(SVG_DIR)/*.svg))
# Gets PDF filenames
PDF = $(SVG:.svg=.pdf)
# Where are SVG?
vpath %.svg $(SVG_DIR)
vpath %.pdf $(VEC_DIR)
# Select all raster
RASTER = $(notdir $(wildcard .img/raster/*))
### TEX files ###
TEX_DIR = ./tex
TEX = $(notdir $(wildcard $(TEX_DIR)/*.tex))
# Where are TEX?
vpath %.tex $(TEX_DIR)
all: dist/main.pdf figure
dist/main.pdf: main.tex $(TEX) $(PDF) $(RASTER)
2018-02-02 20:30:14 +00:00
mkdir -p build/tex dist
2020-04-17 11:42:03 +00:00
git rev-parse HEAD > build/commit.tex
2018-02-10 18:43:04 +00:00
pdflatex -output-directory build -synctex=1 -interaction=nonstopmode main.tex
pdflatex -output-directory build -synctex=1 -interaction=nonstopmode main.tex
2018-02-02 20:30:14 +00:00
mv build/main.pdf dist
2018-02-10 18:43:04 +00:00
mv build/main.synctex.gz dist
2018-02-02 20:30:14 +00:00
2018-02-10 11:49:54 +00:00
figure: $(PDF)
%.pdf : %.svg
@mkdir -p $(VEC_DIR)
2018-02-10 11:49:54 +00:00
@echo "Sto generando $@"
# Conversion command
inkscape -z -D --file=$^ --export-pdf=$(VEC_DIR)/$@
2020-04-17 11:42:03 +00:00
2018-02-02 20:30:14 +00:00
clean:
rm -rf build
2018-02-10 11:49:54 +00:00
rm -rf $(VEC_DIR)
2018-02-02 20:30:14 +00:00
mrproper: build
rm -rf dist