Makefile

Wed, 16 Dec 2020 15:18:57 +0100

author
David Demelier <markand@malikania.fr>
date
Wed, 16 Dec 2020 15:18:57 +0100
changeset 3
172d55236ac4
parent 2
0b6c4213f42a
child 4
fc87d1928dab
permissions
-rw-r--r--

switch to no-class.css

#
# Makefile -- basic Makefile for paster
#
# Copyright (c) 2020 David Demelier <markand@malikania.fr>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

.POSIX:

SRCS=           index.md
OBJS=           ${SRCS:.md=.html}
PANDOC=         pandoc
PANDOC_FLAGS=   -f markdown -t html5 --template templates/template.html
MANDOC=         mandoc
MANDOC_HTML=    -T html -O man=%N.html
MANDOC_PDF=     -T pdf
VERSION=        0.2.1
SOURCE=         paster-${VERSION}.tar.xz
WRKDIR=         paster-${VERSION}

MAN1=           paster-${VERSION}/paster.1
MAN8=           paster-${VERSION}/pasterd.8 \
                paster-${VERSION}/pasterd-clean.8

MAN1HTML=       ${MAN1:.1=.html}
MAN1PDF=        ${MAN1:.1=.pdf}
MAN8HTML=       ${MAN8:.8=.html}
MAN8PDF=        ${MAN8:.8=.pdf}

.SUFFIXES:
.SUFFIXES: .html .md .pdf .1 .8 .in

all: www

.md.html:
	${PANDOC} ${PANDOC_FLAGS} -o $@ $<

.1.html .8.html:
	${MANDOC} < $< ${MANDOC_HTML} > $@

.1.pdf .8.pdf:
	${MANDOC} < $< ${MANDOC_PDF} > $@

${MAN1} ${MAN8}: ${WRKDIR}
	${MAKE} -C ${WRKDIR} paster.1 pasterd.8 pasterd-clean.8

${FILES}: templates/template.html

${SOURCE}:
	wget -q http://releases.malikania.fr/paster/${VERSION}/$@ -O $@

${WRKDIR}: ${SOURCE}
	tar -xJf ${SOURCE}

www: ${OBJS} ${MAN1HTML} ${MAN1PDF} ${MAN8HTML} ${MAN8PDF}
	mkdir -p www
	cp -R css www
	cp -R ${OBJS} ${MAN1HTML} ${MAN1PDF} ${MAN8HTML} ${MAN8PDF} www

clean:
	rm -rf www
	rm -f ${OBJS}
	rm -f ${MAN1HTML} ${MAN8HTML}
	rm -f ${MAN1PDF} ${MAN8PDF}
	rm -rf ${WRKDIR} ${SOURCE}

.PHONY: all clean www

mercurial