summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Batts <vbatts@hashbangbash.com>2011-10-18 20:19:31 -0400
committerVincent Batts <vbatts@hashbangbash.com>2011-10-18 20:19:31 -0400
commit1b60c4c25a2f3f65860b3e3b2a4b3ce3b727f2b0 (patch)
tree5f98d2109bfff71792d8e8aea2aa5632a1ab8899
parent094749bd8e63d3a1c09ca499e68de22af154252e (diff)
downloadslackbook-1b60c4c25a2f3f65860b3e3b2a4b3ce3b727f2b0.tar.xz
revisiting the Makefile-fu
-rw-r--r--Makefile33
1 files changed, 19 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 48560bb..3905eb0 100644
--- a/Makefile
+++ b/Makefile
@@ -10,22 +10,20 @@ list_imgs:
@echo $(imgs_ps)
@echo $(imgs_png)
-define png_template
-$(1): $(2)
+# cleaning up the voodoo a bit.
+# now it matches a pattern instead of generating a bunch of rules
+# -- vbatts
+png/%.png: ps-imgs/%.eps .convert
mkdir -p $(CWD)png && \
- convert -channel RGBA -density 196 $(2) -resample 72 -geometry 800x600 -trim +repage -flatten $(1)
-endef
- #convert $(2) -geometry 800x600 -quality 100 -depth 24 -weight 10 -render -flatten $(1)
+ convert -channel RGBA -density 196 $< -resample 72 -geometry 800x600 -trim +repage -flatten $@
-# 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))))
+dummy:
+ convert $(2) -geometry 800x600 -quality 100 -depth 24 -weight 10 -render -flatten $(1)
-images: $(imgs_png)
+images: $(imgs_ps)
-book.html: build.sh main.xml $(chapters) $(imgs_png) .clean.html
+#book.html: build.sh main.xml $(chapters) $(imgs_png) .clean.html
+book.html: build.sh main.xml $(chapters) $(imgs_png)
sh build.sh && \
ls -l $@
@@ -42,8 +40,11 @@ view.pdf: book.pdf
view.html: book.html
xdg-open $<
+.convert:
+ @which convert 2>/dev/null >/dev/null || echo "ERROR: 'convert' REQUIRED, this is in imagemagick" && touch $@
+
.dblatex:
- $(shell which dblatex 2>/dev/null >/dev/null || echo "ERROR: 'dblatex' REQUIRED, SEE http://github.com/vbatts/SlackBuilds/ FOR THE SlackBuild")
+ @which dblatex 2>/dev/null >/dev/null || echo "ERROR: 'dblatex' REQUIRED, SEE http://github.com/vbatts/SlackBuilds/ FOR THE SlackBuild" && touch $@
.PHONY: .clean.html
@@ -54,12 +55,16 @@ view.html: book.html
.clean.pdf:
rm -f book.pdf
+.PHONY: .clean.stuff
+.clean.stuff:
+ rm -fr .convert .dblatex
+
.PHONY: .clean.images
.clean.images:
rm -fr png/
.PHONY: clean
-clean: .clean.pdf .clean.html
+clean: .clean.pdf .clean.html .clean.images .clean.stuff
.DEFAULT_GOAL := book.html