diff options
author | Vincent Batts <vbatts@hashbangbash.com> | 2011-05-23 10:42:47 -0400 |
---|---|---|
committer | Vincent Batts <vbatts@hashbangbash.com> | 2011-05-23 10:42:47 -0400 |
commit | 4af8163c5a3386e8dc517b0c3ea7786ddc0f61e5 (patch) | |
tree | 5dbc8360a97fa0b49a4b72ff138a1f3b43c5d434 | |
parent | 52f66278589666914a66b54daaad00f4724c921e (diff) | |
download | slackbook-4af8163c5a3386e8dc517b0c3ea7786ddc0f61e5.tar.xz |
makefile stuffs, to generate pngs
-rw-r--r-- | Makefile | 47 |
1 files changed, 41 insertions, 6 deletions
@@ -1,12 +1,34 @@ # $Id$ -chapters = chapter_*.xml +chapters := $(wildcard chapter_*.xml) -book.html: build.sh main.xml $(chapters) +imgs_ps := $(wildcard ps-imgs/*.eps) +imgs_png := $(addsuffix .png,$(addprefix png/,$(basename $(notdir $(imgs_ps))))) + + +list_imgs: + @echo $(imgs_ps) + @echo $(imgs_png) + +define png_template +$(1): $(2) + mkdir -p $(CWD)png && \ + convert $(2) -antialias -flatten $(1) +endef + +# this is a little voodoo, to iterate over the *.eps files, +# and create a make target of the png output name, that will +# build those *.png files +# :) --vbatts +$(foreach ps,$(imgs_ps),$(eval $(call png_template,$(addsuffix .png,$(addprefix png/,$(basename $(notdir $(ps))))),$(ps)))) + +images: $(imgs_png) + +book.html: build.sh main.xml $(chapters) $(imgs_png) .clean.html sh build.sh && \ ls -l $@ -book.pdf: main.xml $(chapters) .dblatex +book.pdf: main.xml $(chapters) $(imgs_png) .dblatex .clean.pdf dblatex \ --pdf \ -x'-xinclude' \ @@ -20,11 +42,24 @@ view.html: book.html xdg-open $< .dblatex: - $(shell which dblatex 2>/dev/null || echo "ERROR: 'dblatex' REQUIRED, SEE http://github.com/vbatts/SlackBuilds/ FOR THE SlackBuild") + $(shell which dblatex 2>/dev/null >/dev/null || echo "ERROR: 'dblatex' REQUIRED, SEE http://github.com/vbatts/SlackBuilds/ FOR THE SlackBuild") + + +.PHONY: .clean.html +.clean.html: + rm -f book.html +.PHONY: .clean.pdf +.clean.pdf: + rm -f book.pdf + +.PHONY: .clean.images +.clean.images: + rm -fr png/ .PHONY: clean -clean: - rm -f book.html book.pdf +clean: .clean.pdf .clean.html .clean.images + .DEFAULT_GOAL := book.html + |