[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / pod2mdoc

File: [cvsweb.bsd.lv] / pod2mdoc / Makefile (download)

Revision 1.16, Tue May 19 20:42:48 2015 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_0_2, HEAD
Changes since 1.15: +2 -2 lines

release 0.2

# $Id: Makefile,v 1.16 2015/05/19 20:42:48 schwarze Exp $
#
# Copyright (c) 2014 Kristaps Dzonsons <kristaps@bsd.lv>
# Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org>
#
# Permission to use, copy, modify, and 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.

VERSION =	0.2

# === USER CONFIGURATION ===============================================

CFLAGS +=	-g
CFLAGS +=	-W -Wall -Wstrict-prototypes
CFLAGS +=	-Wno-unused-parameter -Wwrite-strings

# Change to 0 on systems other than OpenBSD that do not provide
# a native ohash library; compat_ohash.* will be used in that case.

CFLAGS +=	-DHAVE_OHASH=1

# May be needed on systems other than OpenBSD when using HAVE_OHASH=1
# if ohash.h is not in the default header search path and/or
# the library containing the ohash functions is not in the
# default library search path.

#CFLAGS +=	-I/usr/local/include
#LDFLAGS +=	-L/usr/local/lib

# Needed for the ohash library on OpenBSD.
# You may have to comment this out on other systems,
# in particular when using HAVE_OHASH=0.

LDADD +=	-lutil

# === LIST OF FILES ====================================================

SRCS =		compat_ohash.c \
		dict.c \
		pod2mdoc.c

DISTFILES =	Makefile \
		compat_ohash.h \
		dict.h \
		pod2mdoc.1 \
		$(SRCS)

OBJS =		compat_ohash.o \
		dict.o \
		pod2mdoc.o

WWW_HTML =	index.html \
		pod2mdoc.1.html

# === DEPENDENCY HANDLING ==============================================

all: pod2mdoc

dist: $(WWW_HTML) pod2mdoc.tgz

.PHONY: clean installwww

# === TARGETS CONTAINING SHELL COMMANDS ================================

clean:
	rm -f pod2mdoc $(OBJS) $(WWW_HTML) pod2mdoc.tgz
	rm -rf *.dSYM

pod2mdoc: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDADD)

# --- maintainer targets ---

WWWPREFIX = /var/www/vhosts/mdocml.bsd.lv/htdocs/pod2mdoc

installwww: dist
	mkdir -p $(WWWPREFIX)/snapshots
	install -m 0444 $(WWW_HTML) $(WWWPREFIX)
	install -m 0444 pod2mdoc.tgz $(WWWPREFIX)/snapshots
	ln -f $(WWWPREFIX)/snapshots/pod2mdoc.tgz \
		$(WWWPREFIX)/snapshots/pod2mdoc-$(VERSION).tgz

pod2mdoc.tgz: $(DISTFILES)
	mkdir -p .dist/pod2mdoc-$(VERSION)
	install -m 0644 $(DISTFILES) .dist/pod2mdoc-$(VERSION)
	(cd .dist && tar zcf ../$@ pod2mdoc-$(VERSION))
	rm -rf .dist

index.html: index.xml
	sed "s!@VERSION@!$(VERSION)!g" index.xml >$@

pod2mdoc.1.html: pod2mdoc.1
	mandoc -Thtml pod2mdoc.1 >$@