summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2f9fab4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,46 @@
+Makefiles += gen.sh
+pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH)))))
+pick = $(firstword $(foreach prog,$1,$(call pathsearch,$(prog))) false)
+
+COFFEE = coffee
+CONVERT = convert
+CP = cp
+MKDIRS = mkdir -p
+PHP = $(call pick,php5 php)
+RM = rm -f
+SASS = sass
+
+PDF2PPM = pdftoppm
+PDF2TXT = pdftotext
+PHP2ANY = $(PHP) -f
+PPM2JPG = ppmtojpeg
+SCSS2CSS = $(SASS)
+
+all: PHONY
+ echo */|sed 's@/\s*@\n@g'|sort -n|xargs bash gen.sh
+
+.SECONDARY:
+
+%.ppm: %.pdf $(MAKEFILES)
+ $(PDF2PPM) '$<' > '$@'
+%.jpg: %.ppm $(MAKEFILES)
+ $(PPM2JPG) '$<' > '$@'
+%.txt: %.pdf $(MAKEFILES)
+ $(PDF2TXT) '$<' > '$@'
+%: %.php $(MAKEFILES)
+ $(PHP2ANY) '$<' > '$@'
+%.css: %.scss $(MAKEFILES)
+ $(SCSS2CSS) '$<' > '$@'
+%.js: %.coffee $(MAKEFILES)
+ $(COFFEE) -c '$<'
+%.small.jpg: %.jpg $(MAKEFILES)
+ $(CONVERT) '$<' -resize x700 '$@'
+
+%/index.php: issue.php $(MAKEFILES)
+ $(CP) '$<' '$@'
+%/view.css: view.css $(MAKEFILES)
+ $(CP) '$<' '$@'
+%/view.js: view.js $(MAKEFILES)
+ $(CP) '$<' '$@'
+
+.PHONY: PHONY \ No newline at end of file