Makefile

Mon, 07 Jun 2021 21:42:09 +0200

author
David Demelier <markand@malikania.fr>
date
Mon, 07 Jun 2021 21:42:09 +0200
changeset 1
30a1f29b3316
parent 0
d450dddcd926
permissions
-rw-r--r--

misc: use mandoc to markdown

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

mercurial