makefile 2.86 KB
Newer Older
Michael Murtaugh's avatar
readmes    
Michael Murtaugh committed
1

Michael Murtaugh's avatar
Michael Murtaugh committed
2
3
all: README.html

Michael Murtaugh's avatar
Michael Murtaugh committed
4
5
6
7
8
9
10
11
12
13

################
# RULES TO MAKE THE TOOLS

bin = bin/channel bin/contours bin/houghlines bin/texture

bin: $(bin)

bin/channel:
	$(MAKE) -C channel all
14
	mkdir -p bin
Michael Murtaugh's avatar
Michael Murtaugh committed
15
16
17
18
	cp channel/channel bin

bin/contours:
	$(MAKE) -C contours all
19
	mkdir -p bin
Michael Murtaugh's avatar
Michael Murtaugh committed
20
21
22
23
24
	cp contours/contours bin

bin/houghlines:
	mkdir -p houghlines/build
	cd houghlines/build && cmake .. && make
25
	mkdir -p bin
Michael Murtaugh's avatar
Michael Murtaugh committed
26
27
28
29
30
	cp houghlines/build/houghlines bin

bin/texture:
	mkdir -p texture/build
	cd texture/build && cmake .. && make
31
	mkdir -p bin
Michael Murtaugh's avatar
Michael Murtaugh committed
32
33
34
35
36
	cp texture/build/texture bin

########################

# markdown to HTML (for docs)
Michael Murtaugh's avatar
Michael Murtaugh committed
37
38
39
40
%.html: %.md
	pandoc --self-contained $< -o $@


Michael Murtaugh's avatar
Michael Murtaugh committed
41
42
#################################
# RULES to USE the tools
Michael Murtaugh's avatar
Michael Murtaugh committed
43

Michael Murtaugh's avatar
Michael Murtaugh committed
44
# contours
Michael Murtaugh's avatar
Michael Murtaugh committed
45
46
47
48
49
%.contours.svg: %.png
	contours/contours $< > $@
%.contours.svg: %.jpg
	contours/contours $< > $@

Michael Murtaugh's avatar
Michael Murtaugh committed
50
# texture (& lexicality, textline, para, block
Michael Murtaugh's avatar
Michael Murtaugh committed
51
%.texture.svg: %.png
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
52
	texture/build/texture $< $*.texture.svg $*.lexicality.svg $*.textline.svg $*.para.svg $*.block.svg
Michael Murtaugh's avatar
Michael Murtaugh committed
53
%.texture.svg: %.jpg
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
54
	texture/build/texture $< $*.texture.svg $*.lexicality.svg $*.textline.svg $*.para.svg $*.block.svg
Michael Murtaugh's avatar
Michael Murtaugh committed
55

Michael Murtaugh's avatar
Michael Murtaugh committed
56
# channel
Michael Murtaugh's avatar
Michael Murtaugh committed
57
%.red.png: %.png
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
58
	channel/channel $< $*.red.png $*.green.png $*.blue.png
Michael Murtaugh's avatar
Michael Murtaugh committed
59
%.red.png: %.jpg
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
60
	channel/channel $< $*.red.png $*.green.png $*.blue.png
Michael Murtaugh's avatar
Michael Murtaugh committed
61
%.green.png: %.png
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
62
	channel/channel $< $*.red.png $*.green.png $*.blue.png
Michael Murtaugh's avatar
Michael Murtaugh committed
63
%.green.png: %.jpg
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
64
	channel/channel $< $*.red.png $*.green.png $*.blue.png
Michael Murtaugh's avatar
Michael Murtaugh committed
65
%.blue.png: %.png
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
66
	channel/channel $< $*.red.png $*.green.png $*.blue.png
Michael Murtaugh's avatar
Michael Murtaugh committed
67
%.blue.png: %.jpg
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
68
	channel/channel $< $*.red.png $*.green.png $*.blue.png
Michael Murtaugh's avatar
Michael Murtaugh committed
69

Michael Murtaugh's avatar
Michael Murtaugh committed
70
71
72
# houghlines
# Z3.hough.png <= Z3.png
# Z3.hough.X0Y0.png <= Z3.hough.png
Michael Murtaugh's avatar
Michael Murtaugh committed
73
74
75
76
77
%.hough.svg: %.jpg
	houghlines/build/houghlines $< > $@
%.hough.svg: %.png
	houghlines/build/houghlines $< > $@

Michael Murtaugh's avatar
Michael Murtaugh committed
78
79
80
81
82
83
84
85
86
# gradient: NEEDS WORK
# %.gradient.png: %.jpg
# 	python imagegradient/imagegradient.py --output $*.gradient.png --svg $*.gradient.svg $<
%.gradient.svg: %.jpg
	python imagegradient/imagegradient.py --svg $*.gradient.svg $< 
# %.gradient.png: %.png
# 	python imagegradient/imagegradient.py --output $*.gradient.png --svg $*.gradient.svg $<
%.gradient.svg: %.png
	python imagegradient/imagegradient.py --svg $*.gradient.svg $<
Michael Murtaugh's avatar
Michael Murtaugh committed
87

Michael Murtaugh's avatar
Michael Murtaugh committed
88
89
90
################################
# VIEWER rules
# pyramid rules
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.PRECIOUS: %/Z0.png %/Z1.png %/Z2.png %/Z3.png %/Z4.png %/Z5.png
%/Z0.png: %.png
	mkdir -p $*
	python viewer/pyramid.py $< --output "$*/Z{z}.png"

%/Z0.png: %.jpg
	mkdir -p $*
	python viewer/pyramid.py $< --output "$*/Z{z}.png"

# SVG to png
%.png: %.svg
	inkscape --export-background-opacity=0.0 --export-png=$@ $<

# tile rule
%.X0Y0.png : %.png
	python viewer/tile.py $< --output "$*.X{x}Y{y}.png"

# make the map
109
%.html: %.png
Michael Murtaugh's avatar
latest    
Michael Murtaugh committed
110
111
112
113
114
115
116
117
118
119
120
121
	mkdir -p $*
	python viewer/makeviewer.py \
		--template viewer/map.html \
		--output $@ $<
%.html: %.jpg
	mkdir -p $*
	python viewer/makeviewer.py \
		--template viewer/map.html \
		--output $@ $<

%/error.jpg:
	convert -size 256x256 canvas:red $@