Makefile

Thu, 17 Dec 2020 12:29:23 +0100

author
David Demelier <markand@malikania.fr>
date
Thu, 17 Dec 2020 12:29:23 +0100
changeset 5
1b128d430637
parent 4
fc87d1928dab
permissions
-rw-r--r--

change manual page styles

0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 # Makefile -- basic Makefile for paster
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 #
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
4 # Copyright (c) 2011-2019 David Demelier <markand@malikania.fr>
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 #
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for any
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 # copyright notice and this permission notice appear in all copies.
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 #
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 #
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 .POSIX:
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 SRCS= index.md
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
22 PROJECT= paster
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
23 VERSION= 0.2.1
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
24 MAN1= paster-${VERSION}/paster.1
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
25 MAN8= paster-${VERSION}/pasterd-clean.8 \
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
26 paster-${VERSION}/pasterd.8
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
27
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 OBJS= ${SRCS:.md=.html}
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 PANDOC= pandoc
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
30 PANDOC_FLAGS= -f markdown -t html5 --no-highlight --template templates/template.html
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 MANDOC= mandoc
5
1b128d430637 change manual page styles
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
32 MANDOC_MD= -T markdown
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 MANDOC_PDF= -T pdf
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
34 DIST= ${PROJECT}-${VERSION}.tar.xz
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
35 WRKDIR= ${PROJECT}-${VERSION}
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
36
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
37 MAN1_HTML= ${MAN1:.1=.html}
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
38 MAN1_PDF= ${MAN1:.1=.pdf}
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
39 MAN8_HTML= ${MAN8:.8=.html}
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
40 MAN8_PDF= ${MAN8:.8=.pdf}
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
41
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
42 MAN_OBJS= ${MAN1_HTML} ${MAN1_PDF} \
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
43 ${MAN8_HTML} ${MAN8_PDF}
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
44
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 .SUFFIXES:
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
46 .SUFFIXES: .1 .8 .html .md .pdf
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
47
3
172d55236ac4 switch to no-class.css
David Demelier <markand@malikania.fr>
parents: 2
diff changeset
48 all: www
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
49
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 .md.html:
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 ${PANDOC} ${PANDOC_FLAGS} -o $@ $<
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
52
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
53 .1.html:
5
1b128d430637 change manual page styles
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
54 ${MANDOC} < $< ${MANDOC_MD} | ${PANDOC} ${PANDOC_FLAGS} -M title=${<F} -o $@
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
55 .8.html:
5
1b128d430637 change manual page styles
David Demelier <markand@malikania.fr>
parents: 4
diff changeset
56 ${MANDOC} < $< ${MANDOC_MD} | ${PANDOC} ${PANDOC_FLAGS} -M title=${<F} -o $@
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
57
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
58 .1.pdf:
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
59 ${MANDOC} < $< ${MANDOC_PDF} > $@
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
60 .8.pdf:
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 ${MANDOC} < $< ${MANDOC_PDF} > $@
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
62
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
63 ${DIST}:
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
64 wget -q http://releases.malikania.fr/${PROJECT}/${VERSION}/$@ -O $@
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
65
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
66 ${WRKDIR}: ${DIST}
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
67 tar -xJf $<
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
68
1
acfb872c93a1 update for 0.2.0
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
69 ${MAN1} ${MAN8}: ${WRKDIR}
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
70 ${MAKE} -C $< ${@F}
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
71
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
72 ${OBJS}: css/no-class.css templates/template.html
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
73
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
74 www: ${OBJS} ${MAN_OBJS}
3
172d55236ac4 switch to no-class.css
David Demelier <markand@malikania.fr>
parents: 2
diff changeset
75 mkdir -p www
172d55236ac4 switch to no-class.css
David Demelier <markand@malikania.fr>
parents: 2
diff changeset
76 cp -R css www
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
77 cp ${OBJS} ${MAN_OBJS} www
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
78
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
79 clean:
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
80 rm -rf www ${WRKDIR}
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
81 rm -f ${DIST}
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
82 rm -f ${OBJS} ${MAN_OBJS}
0
80a2cf045e6a initial website
David Demelier <markand@malikania.fr>
parents:
diff changeset
83
4
David Demelier <markand@malikania.fr>
parents: 3
diff changeset
84 .PHONY: all clean

mercurial