Makefile

Sun, 06 Oct 2019 11:09:29 +0200

author
David Demelier <markand@malikania.fr>
date
Sun, 06 Oct 2019 11:09:29 +0200
changeset 26
89a5b4240372
parent 25
2549facbedfb
child 28
a8dc1565c470
permissions
-rw-r--r--

cleanup makefile and update for 3.0.3

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 PANDOC= pandoc
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 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
21 MANDOC= mandoc
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
22 MANDOC_PDF= -T pdf
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
23 MANDOC_HTML= -T html -O man=%N.html
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
24 VERSION= 3.0.3
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
25 SOURCE= irccd-${VERSION}.tar.xz
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
26 WRKDIR= irccd-${VERSION}
22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
27
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
28 MAN1= irccd-${VERSION}/man/irccd.1 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
29 irccd-${VERSION}/man/irccdctl.1 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
30 irccd-${VERSION}/man/irccd-test.1
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
31 MAN5= irccd-${VERSION}/man/irccd.conf.5 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
32 irccd-${VERSION}/man/irccdctl.conf.5
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
33 MAN7= irccd-${VERSION}/man/irccd-api.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
34 irccd-${VERSION}/man/irccd-ipc.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
35 irccd-${VERSION}/man/irccd-templates.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
36 irccd-${VERSION}/plugins/ask/ask.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
37 irccd-${VERSION}/plugins/auth/auth.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
38 irccd-${VERSION}/plugins/hangman/hangman.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
39 irccd-${VERSION}/plugins/history/history.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
40 irccd-${VERSION}/plugins/joke/joke.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
41 irccd-${VERSION}/plugins/links/links.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
42 irccd-${VERSION}/plugins/logger/logger.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
43 irccd-${VERSION}/plugins/plugin/plugin.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
44 irccd-${VERSION}/plugins/roulette/roulette.7 \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
45 irccd-${VERSION}/plugins/tictactoe/tictactoe.7
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
46
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
47 MAN1HTML= ${MAN1:.1=.html}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
48 MAN1PDF= ${MAN1:.1=.pdf}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
49 MAN5HTML= ${MAN5:.5=.html}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
50 MAN5PDF= ${MAN5:.5=.pdf}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
51 MAN7HTML= ${MAN7:.7=.html}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
52 MAN7PDF= ${MAN7:.7=.pdf}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
53
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
54 SITE_SRCS= index.md \
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
55 versioning.md
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
56 SITE_HTML= ${SITE_SRCS:.md=.html}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
57
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
58 .SUFFIXES:
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
59 .SUFFIXES: .html .pdf .md .1 .5 .7
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
60
25
2549facbedfb add doxygen API
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
61 all: site man doxygen
22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
62
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
63 ${SITE_HTML}: templates/template.html
22
e49c41217e6e create new minimal website
David Demelier <markand@malikania.fr>
parents:
diff changeset
64
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
65 ${SOURCE}:
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
66 wget -q http://releases.malikania.fr/irccd/${VERSION}/$@ -O $@
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
67
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
68 ${WRKDIR}: ${SOURCE}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
69 tar xJf ${SOURCE}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
70
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
71 .md.html:
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
72 ${PANDOC} ${PANDOC_FLAGS} -o $@ $<
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
73
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
74 .1.html .5.html .7.html:
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
75 sed "s/@IRCCD_MAN_DATE@/October 06, 2019/" $< | ${MANDOC} ${MANDOC_HTML} > $@
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
76
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
77 .1.pdf .5.pdf .7.pdf:
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
78 sed "s/@IRCCD_MAN_DATE@/October 06, 2019/" $< | ${MANDOC} ${MANDOC_PDF} > $@
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
79
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
80 site: ${SITE_HTML}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
81
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
82 man: ${WRKDIR} ${MAN1HTML} ${MAN5HTML} ${MAN7HTML} ${MAN1PDF} ${MAN5PDF} ${MAN7PDF}
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
83
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
84 doxygen: ${WKRDIR}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
85 mkdir -p irccd-${VERSION}/build
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
86 cmake -S irccd-${VERSION} -B irccd-${VERSION}/build > /dev/null 2>&1
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
87 cmake --build irccd-${VERSION}/build --target doxygen > /dev/null
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
88 rsync -a --delete irccd-${VERSION}/build/doc/doxygen/html/ doxygen
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
89
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
90 publish: site man doxygen
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
91 rm -rf out
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
92 mkdir out
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
93 cp -R css out
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
94 cp -R webfonts out
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
95 cp -R doxygen out/api
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
96 cp ${MAN1HTML} ${MAN5HTML} ${MAN7HTML} out
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
97 cp ${MAN1PDF} ${MAN5PDF} ${MAN7PDF} out
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
98 cp ${SITE_HTML} out
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
99 rsync -av out/ ${DESTINATION}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
100 rm -rf out
23
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
101
3e21222edcfd update for 3.0.0
David Demelier <markand@malikania.fr>
parents: 22
diff changeset
102 clean:
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
103 rm -f ${MAN1HTML} ${MAN5HTML} ${MAN7HTML}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
104 rm -f ${MAN1PDF} ${MAN5PDF} ${MAN7PDF}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
105 rm -f ${SITE_HTML}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
106 rm -f ${SOURCE}
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
107 rm -rf doxygen
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
108 rm -rf ${WRKDIR}
25
2549facbedfb add doxygen API
David Demelier <markand@malikania.fr>
parents: 23
diff changeset
109
26
89a5b4240372 cleanup makefile and update for 3.0.3
David Demelier <markand@malikania.fr>
parents: 25
diff changeset
110 .PHONY: all clean man publish site

mercurial