summaryrefslogtreecommitdiff
path: root/Makefile
blob: 2f9fab40719ee102f2970f84e9d5099fd02130b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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