Makefile

Fri, 16 Aug 2019 11:52:15 +0200

author
David Demelier <markand@malikania.fr>
date
Fri, 16 Aug 2019 11:52:15 +0200
changeset 23
3e21222edcfd
parent 22
e49c41217e6e
child 25
2549facbedfb
permissions
-rw-r--r--

update for 3.0.0

22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
2 # Makefile -- basic BSD Makefile for irccd-www
22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 #
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 # Copyright (c) 2013-2019 David Demelier <markand@malikania.fr>
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 #
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for any
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 # copyright notice and this permission notice appear in all copies.
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 #
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 #
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 FILES= index.html \
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 versioning.html
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 PANDOC= pandoc
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 PANDOC_FLAGS= -f markdown -t html5 --template templates/template.html
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
23 MANDOC= mandoc
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
24 MANDOC_PDF= -T pdf
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
25 MANDOC_HTML= -T html -O man=%N.html
22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 RM= rm -f
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
27 VERSION= 3.0.0
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
28 SOURCE= irccd-${VERSION}.tar.xz
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
29 MANSRCS= irccd-api.7 \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
30 irccd-ipc.7 \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
31 irccd-templates.7 \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
32 irccd-test.1 \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
33 irccd.1 \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
34 irccd.conf.5 \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
35 irccdctl.1 \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
36 irccdctl.conf.5
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
37 PLUGINS= ask \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
38 auth \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
39 hangman \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
40 history \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
41 joke \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
42 links \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
43 logger \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
44 plugin \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
45 roulette \
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
46 tictactoe
22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
47
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
48 .SUFFIXES: .html .md
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
49
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
50 all: site man
22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
51
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 ${FILES}: templates/template.html
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
53
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
54 ${SOURCE}:
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
55 @wget -q http://releases.malikania.fr/irccd/${VERSION}/$@ -O $@
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
56
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
57 site: ${FILES}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
58
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
59 man: ${SOURCE}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
60 @tar xf ${SOURCE}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
61 .for m in ${MANSRCS}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
62 @echo GEN ${m:C/[0-9]$/pdf/:_}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
63 @${MANDOC} ${MANDOC_PDF} irccd-${VERSION}/man/$m > ${_}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
64 .endfor
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
65 .for p in ${PLUGINS}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
66 @echo GEN irccd-plugin-${p}.pdf
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
67 @${MANDOC} ${MANDOC_PDF} irccd-${VERSION}/plugins/${p}/${p}.7 > irccd-plugin-${p}.pdf
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
68 .endfor
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
69 .for m in ${MANSRCS}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
70 @echo GEN ${m:C/[0-9]$/html/:_}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
71 @${MANDOC} ${MANDOC_HTML} irccd-${VERSION}/man/$m > ${_}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
72 .endfor
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
73 .for p in ${PLUGINS}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
74 @echo GEN irccd-plugin-${p}.html
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
75 @${MANDOC} ${MANDOC_HTML} irccd-${VERSION}/plugins/${p}/${p}.7 > irccd-plugin-${p}.html
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
76 .endfor
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
77 @rm -rf irccd-${VERSION}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
78
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
79 clean:
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
80 @${RM} ${SOURCE} *.html *.pdf
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
81
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
82 publish: site man
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
83 @rsync -av css webfonts *.html *.pdf ${DESTINATION}
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
84
22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
85 .md.html:
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
86 @echo GEN $@
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
87 @${PANDOC} ${PANDOC_FLAGS} -o $@ $<
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
88
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
89 .PHONY: all clean download man publish site

mercurial