diff options
Diffstat (limited to 'doc/paper/Makefile')
-rw-r--r-- | doc/paper/Makefile | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/doc/paper/Makefile b/doc/paper/Makefile index 4826882..4c6be00 100644 --- a/doc/paper/Makefile +++ b/doc/paper/Makefile @@ -29,6 +29,12 @@ ECHO_CMD=$(shell which echo) RM_CMD=$(shell which rm) +# The svgbob compiler +SVGBOBC=$(shell which svgbob) + +# Inkscape path to compile svg to tex +INKSCAPEC=$(shell which inkscape) + ## ## Flags ## @@ -42,7 +48,7 @@ export MAKE_FLAGS # # Flags for the latex compilre # -LATEX_FLAGS=-halt-on-error +LATEX_FLAGS=-halt-on-error -shell-escape export LATEX_FLAGS # @@ -56,6 +62,9 @@ export ECHO_FLAGS # RM_FLAGS=-f +# Inkscape flags +INKSCAPE_FLAGS=-D -o + ## ## Standard commands @@ -70,6 +79,8 @@ export ECHO RM=$(RM_CMD) $(RM_FLAGS) export RM +SVGBOB=$(SVGBOBC) +INKSCAPE=$(INKSCAPEC) $(INKSCAPE_FLAGS) ## ## Files @@ -103,6 +114,10 @@ MAKELOG=make.log export MAKELOG +# All svgbob files +SVGBOB_ALL_SOURCES=$(shell find gen -name *.bob -type f) +SVGBOB_FILES=$(patsubst gen/%.bob,%,$(SVGBOB_ALL_SOURCES)) + ## @@ -116,6 +131,13 @@ export MAKELOG SCRIPTS=scripts export SCRIPTS +# +# The directory where are the generator scripts +# +GEN_DIR=gen +export GEN_DIR + + ## @@ -153,7 +175,14 @@ all: $(PDF_FILE) # test one_time: $(AUX_FILE) +gen_tex: $(SVGBOB_FILES) +# Generate pictures with svgbob +$(SVGBOB_FILES): %: $(SVGBOB_ALL_SOURCES) + @$(ECHO) "\t[SVGBOB]\t$@\t$(GEN_DIR)/$@.svg" + @$(SVGBOB) $(GEN_DIR)/$@.bob -o $(GEN_DIR)/$@.svg + @$(ECHO) "\t[INKSCAPE]\t$@.svg\t$(GEN_DIR)/$@.pdf" + @$(INKSCAPEC) $(INKSCAPE_FLAGS) $(GEN_DIR)/$@.png $(GEN_DIR)/$@.svg 2> /dev/null ## @@ -164,7 +193,7 @@ test one_time: $(AUX_FILE) # # Generate main.aux from TeX sources # -$(AUX_FILE): $(LATEX_MAIN_SOURCE) +$(AUX_FILE): $(LATEX_MAIN_SOURCE) gen_tex @$(ECHO) "\t[LATEX]" @$(LATEX) $(LATEX_FLAGS) -draftmode $< >> $(MAKELOG) |