=================================================================== RCS file: /cvs/pod2mdoc/Makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -u -p -r1.13 -r1.14 --- pod2mdoc/Makefile 2015/02/13 00:44:16 1.13 +++ pod2mdoc/Makefile 2015/02/13 09:56:59 1.14 @@ -1,24 +1,97 @@ -VERSION = 0.1 -CFLAGS += -g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -WWWPREFIX = /usr/vhosts/mdocml.bsd.lv/www/htdocs/pod2mdoc +# $Id: Makefile,v 1.14 2015/02/13 09:56:59 schwarze Exp $ +# +# Copyright (c) 2014 Kristaps Dzonsons +# Copyright (c) 2015 Ingo Schwarze +# +# 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. -pod2mdoc: dict.o pod2mdoc.o - $(CC) $(LDFLAGS) -o $@ dict.o pod2mdoc.o -lutil +VERSION = 0.1 -www: index.html pod2mdoc.1.html pod2mdoc-$(VERSION).tgz +# === USER CONFIGURATION =============================================== -installwww: www - mkdir -p $(WWWPREFIX)/snapshots - install -m 0444 index.html pod2mdoc.1.html $(WWWPREFIX) - install -m 0444 pod2mdoc-$(VERSION).tgz $(WWWPREFIX)/snapshots - install -m 0444 pod2mdoc-$(VERSION).tgz \ - $(WWWPREFIX)/snapshots/pod2mdoc.tgz +CFLAGS += -g +CFLAGS += -W -Wall -Wstrict-prototypes +CFLAGS += -Wno-unused-parameter -Wwrite-strings -dist: pod2mdoc-$(VERSION).tgz +# Change to 0 on systems other than OpenBSD that do not provide +# a native ohash library; compat_ohash.* will be used in that case. -pod2mdoc-$(VERSION).tgz: +CFLAGS += -DHAVE_OHASH=0 + +# 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 0444 pod2mdoc.c Makefile pod2mdoc.1 .dist/pod2mdoc-$(VERSION) + install -m 0644 $(DISTFILES) .dist/pod2mdoc-$(VERSION) (cd .dist && tar zcf ../$@ pod2mdoc-$(VERSION)) rm -rf .dist @@ -27,8 +100,3 @@ index.html: index.xml pod2mdoc.1.html: pod2mdoc.1 mandoc -Thtml pod2mdoc.1 >$@ - -clean: - rm -f pod2mdoc dict.o pod2mdoc.o pod2mdoc-$(VERSION).tgz \ - index.html pod2mdoc.1.html - rm -rf pod2mdoc.dSYM