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

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

Revision 1.12, Thu Mar 19 09:53:35 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +5 -5 lines

zap trailing whitespace; verified with diff -b;
patch from Svyatoslav Mishyn <juef at openmailbox dot org>

VERSION  = 0.1.2

CFLAGS	+= -g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
OBJS	 = main.o util.o
SRCS	 = main.c util.c
AFLS	 = afl/in/test01.texi \
	   afl/in/test02.texi
VERSIONS = version_0_1_1.xml \
	   version_0_1_2.xml
PREFIX	 = /usr/local

all: texi2mdoc

www: index.html texi2mdoc.1.html texi2mdoc.tgz texi2mdoc.tgz.sha512

afl: afl/texi2mdoc

texi2mdoc: $(OBJS)
	$(CC) -o $@ $(OBJS)

install: all
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	mkdir -p $(DESTDIR)$(PREFIX)/man/man1
	install -m 0755 texi2mdoc $(DESTDIR)$(PREFIX)/bin
	install -m 0444 texi2mdoc.1 $(DESTDIR)$(PREFIX)/man/man1

installwww: www
	mkdir -p $(PREFIX)/snapshots
	install -m 0444 index.html texi2mdoc.1.html $(PREFIX)
	install -m 0444 texi2mdoc.tgz texi2mdoc.tgz.sha512 $(PREFIX)/snapshots
	install -m 0444 texi2mdoc.tgz $(PREFIX)/snapshots/texi2mdoc-$(VERSION).tgz
	install -m 0444 texi2mdoc.tgz.sha512 $(PREFIX)/snapshots/texi2mdoc-$(VERSION).tgz.sha512

$(OBJS): extern.h

afl/texi2mdoc: extern.h $(SRCS)
	$(CC) -o $@ $(SRCS)

index.html: index.xml $(VERSIONS)
	sblg -o- -t index.xml $(VERSIONS) | sed "s!@VERSION@!$(VERSION)!g" >$@

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

texi2mdoc.tgz:
	mkdir -p .dist/texi2mdoc-$(VERSION)
	mkdir -p .dist/texi2mdoc-$(VERSION)/afl
	mkdir -p .dist/texi2mdoc-$(VERSION)/afl/in
	install -m 0644 $(SRCS) extern.h Makefile texi2mdoc.1 .dist/texi2mdoc-$(VERSION)
	install -m 0644 $(AFLS) .dist/texi2mdoc-$(VERSION)/afl/in
	install -m 0644 afl/mkdict.sh afl/README .dist/texi2mdoc-$(VERSION)/afl
	(cd .dist && tar zcf ../$@ texi2mdoc-$(VERSION))
	rm -rf .dist

texi2mdoc.tgz.sha512: texi2mdoc.tgz
	openssl dgst -sha512 texi2mdoc.tgz >$@

clean:
	rm -f $(OBJS)
	rm -f texi2mdoc afl/texi2mdoc
	rm -rf texi2mdoc.dSYM afl/texi2mdoc.dSYM
	rm -f index.html texi2mdoc.1.html texi2mdoc.tgz texi2mdoc.tgz.sha512