view Makefile @ 23:3e21222edcfd

update for 3.0.0
author David Demelier <markand@malikania.fr>
date Fri, 16 Aug 2019 11:52:15 +0200
parents e49c41217e6e
children 2549facbedfb
line wrap: on
line source

#
# Makefile -- basic BSD Makefile for irccd-www
#
# Copyright (c) 2013-2019 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.
#

FILES=          index.html \
                versioning.html
PANDOC=         pandoc
PANDOC_FLAGS=   -f markdown -t html5 --template templates/template.html
MANDOC=         mandoc
MANDOC_PDF=     -T pdf
MANDOC_HTML=    -T html -O man=%N.html
RM=             rm -f
VERSION=        3.0.0
SOURCE=         irccd-${VERSION}.tar.xz
MANSRCS=        irccd-api.7 \
                irccd-ipc.7 \
                irccd-templates.7 \
                irccd-test.1 \
                irccd.1 \
                irccd.conf.5 \
                irccdctl.1 \
                irccdctl.conf.5
PLUGINS=        ask \
                auth \
                hangman \
                history \
                joke \
                links \
                logger \
                plugin \
                roulette \
                tictactoe

.SUFFIXES: .html .md

all: site man

${FILES}: templates/template.html

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

site: ${FILES}

man: ${SOURCE}
	@tar xf ${SOURCE}
.for m in ${MANSRCS}
	@echo GEN ${m:C/[0-9]$/pdf/:_}
	@${MANDOC} ${MANDOC_PDF} irccd-${VERSION}/man/$m > ${_}
.endfor
.for p in ${PLUGINS}
	@echo GEN irccd-plugin-${p}.pdf
	@${MANDOC} ${MANDOC_PDF} irccd-${VERSION}/plugins/${p}/${p}.7 > irccd-plugin-${p}.pdf
.endfor
.for m in ${MANSRCS}
	@echo GEN ${m:C/[0-9]$/html/:_}
	@${MANDOC} ${MANDOC_HTML} irccd-${VERSION}/man/$m > ${_}
.endfor
.for p in ${PLUGINS}
	@echo GEN irccd-plugin-${p}.html
	@${MANDOC} ${MANDOC_HTML} irccd-${VERSION}/plugins/${p}/${p}.7 > irccd-plugin-${p}.html
.endfor
	@rm -rf irccd-${VERSION}

clean:
	@${RM} ${SOURCE} *.html *.pdf

publish: site man
	@rsync -av css webfonts *.html *.pdf ${DESTINATION}

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

.PHONY: all clean download man publish site