-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
151 lines (128 loc) · 4.26 KB
/
Makefile
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
all: html src chunky chunkytgz htmltgz ps pdf
chapters= $(wildcard chapters/*.sgml)
appendices= $(wildcard appendices/*.sgml)
scripts= $(wildcard scripts/*.txt)
license= $(wildcard licensing/*.sgml)
images_eps= $(patsubst %.gif,%.eps,$(wildcard images/*.gif))
images_jpg= $(patsubst %.gif,%.jpg,$(wildcard images/*.gif))
images_png= $(patsubst %.gif,%.png,$(wildcard images/*.gif))
.PHONY: site
site: all
@echo "Making site..."
-@mkdir html
-@mkdir html/images
-@mkdir html/other
-@mkdir html/scripts
@cp ipsysctl-tutorial.html html/
@cp ipsysctl-tutorial.src.tgz ipsysctl-tutorial.chunky.tgz html/
@cp ipsysctl-tutorial.html.tgz html/
@cp ipsysctl-tutorial.pdf.gz html/
@cp ipsysctl-tutorial.ps.gz html/
@cp -r other/* html/other/
@cp -r images/*.gif html/images/
@cp -r images/*.jpg html/images/
@cp -r scripts/* html/scripts/
@cp TODO ChangeLog html/
@cp -r chunkyhtml html/
-@rm -rf html/scripts/CVS html/other/CVS
@cp mirrors.html index.php html/
@echo "Done."
.PHONY: src
src: ipsysctl-tutorial.src.tgz
.PHONY: ps
ps: $(simages_eps) $(images_eps) $(chapters) $(appendices) $(scripts) $(license) ipsysctl-tutorial.ps.gz
.PHONY: pdf
pdf : $(simages_png) $(images_png) $(chapters) $(appendices) $(scripts) $(license) ipsysctl-tutorial.pdf.gz
.PHONY: html
html: $(simages_png) $(images_png) $(simages_jpg) $(images_jpg) $(chapters) $(appendices) $(scripts) $(license) ipsysctl-tutorial.html
.PHONY: chunky
chunky: $(simages_png) $(images_png) $(simages_jpg) $(images_jpg) $(chapters) $(appendices) $(scripts) $(license) chunkyhtml
.PHONY: chunkytgz
chunkytgz: ipsysctl-tutorial.chunky.tgz
.PHONY: htmltgz
htmltgz: ipsysctl-tutorial.html.tgz
%.chunky.tgz: chunky
@echo "Building chunky tgz version..."
@cp -r chunkyhtml chunkytgz
@cp changes.sh chunkytgz
@cd chunkytgz; sh ./changes.sh
@tar -cf $*.chunky.tar chunkyhtml
@gzip $*.chunky.tar
@mv $*.chunky.tar.gz $*.chunky.tgz
@rm -rf chunkytgz
@echo "Done."
%.html.tgz: html
@echo "Building HTML tgz version..."
-@mkdir $*
-@mkdir $*/images
@cp -r $*.html scripts other $*/
@cp -r images/*.gif images/*.jpg $*/images/
@cat $*/$*.html | sed -e 's/http:\/\/ipsysctl-tutorial.frozentux.net\/scripts\//scripts\//g' > \
$*/$*2.html
@cat $*/$*2.html | sed -e 's/http:\/\/ipsysctl-tutorial.frozentux.net\/other\//other\//g' > \
$*/$*.html
@rm -f $*/$*2.html
@tar -cf $*.html.tar $*
@gzip $*.html.tar
@mv $*.html.tar.gz $*.html.tgz
@rm -rf $*
@echo "Done."
%.src.tgz: %.sgml
@echo "Building source ball"
@tar -cf temp.tar ipsysctl-tutorial.sgml scripts/* TODO \
ChangeLog Makefile images/*.gif images/templates/* styles/* \
addons/* other/* licensing/* chapters/* \
appendices/* addons/* other/* bookinfo.sgml > /dev/null
@gzip temp.tar
@mv temp.tar.gz $*.src.tgz
@echo "Done."
%.html: %.sgml
@echo "Building HTML version..."
@jw --backend html --nostd --cat styles/catalog \
--nochunks ipsysctl-tutorial.sgml
@echo "Done."
chunkyhtml:
@echo "Building Chunky HTML version..."
@rm -rf chunkyhtml
@mkdir chunkyhtml
@mkdir chunkyhtml/images
@jw --backend html --nostd --cat styles/catalog --output chunkyhtml \
ipsysctl-tutorial.sgml
@cp -r images/*.gif chunkyhtml/images/
@cp -r images/*.jpg chunkyhtml/images/
@echo "Done."
%.pdf.gz : %.sgml
@echo "Building PDF version..."
mkdir -p pdf; cp -R images licensing scripts appendices \
chapters styles *.sgml pdf; cd pdf; jw -b \
pdf -d styles/tutorial.dsl $*.sgml; cd ..
mv pdf/$*.pdf ./
rm -rf pdf
gzip $*.pdf
%.ps.gz : %.sgml
@echo "Building PS version..."
@mkdir -p ps; cp -R images licensing scripts appendices \
chapters styles *.sgml ps; cd ps; jw \
--backend ps --nostd --cat styles/catalog $*.sgml; cd ..
@mv ps/$*.ps ./
@rm -rf ps
@gzip $*.ps
%.tex : %.sgml
jw -b tex $*.sgml
images/%.jpg : images/%.gif
convert images/$*.gif images/$*.jpg
images/%.eps : images/%.gif
convert -geometry 70% images/$*.gif images/$*.eps
images/%.png : images/%.gif
convert -geometry 70% images/$*.gif images/$*.png
.PHONY: clean
clean:
rm -rf ipsysctl-tutorial.html ipsysctl-tutorial.ps.gz \
ipsysctl-tutorial.pdf.gz ipsysctl-tutorial.src.tgz *~ \
ipsysctl-tutorial.chunky.tgz ipsysctl-tutorial.html.tgz
rm -rf pdf/ ps/
rm -rf images/*.jpg images/*.png images/*~ images/*.eps *.log *.aux \
*.out *.tex
rm -rf html/
rm -rf chunkytgz/
rm -rf chunkyhtml/