LIBDIR = $(PREFIX)/lib
MANDIR = $(PREFIX)/man
EXAMPLEDIR = $(PREFIX)/share/examples/mandoc
-INSTALL_PROGRAM = install -m 0755
-INSTALL_DATA = install -m 0444
-INSTALL_LIB = install -m 0644
+INSTALL ?= install
+INSTALL_PROGRAM = $(INSTALL) -m 0755
+INSTALL_DATA = $(INSTALL) -m 0444
+INSTALL_LIB = $(INSTALL) -m 0644
INSTALL_MAN = $(INSTALL_DATA)
VERSION = 1.9.23
BINS = mandoc
TESTS = test-strlcat.c test-strlcpy.c
CONFIGS = config.h.pre config.h.post
-CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
+DOCLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
$(TARGZS) tags $(MD5S) $(XMLS) $(TEXTS) $(GSGMLS) \
$(GHTMLS) config.h config.log
-INSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
+DOINSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
$(DATAS) $(XSLS) $(EXAMPLES) $(TESTS) $(CONFIGS)
all: $(BINS)
lint: $(LLNS)
clean:
- rm -f $(CLEAN)
+ rm -f $(DOCLEAN)
cleanlint:
rm -f $(LNS) $(LLNS)
htmls: all $(GSGMLS) $(GHTMLS)
installwww: www
- install -m 0444 $(GHTMLS) $(HTMLS) $(TEXTS) $(STATICS) $(PREFIX)/
- install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
- install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/
- install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
- install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/mdocml.md5
+ $(INSTALL_DATA) $(GHTMLS) $(HTMLS) $(TEXTS) $(STATICS) $(PREFIX)/
+ $(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
+ $(INSTALL_DATA) mdocml-$(VERSION).md5 $(PREFIX)/snapshots/
+ $(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
+ $(INSTALL_DATA) mdocml-$(VERSION).md5 $(PREFIX)/snapshots/mdocml.md5
install:
mkdir -p $(BINDIR)
ChangeLog.html: ChangeLog.xml ChangeLog.xsl
xsltproc -o $@ ChangeLog.xsl ChangeLog.xml
-mdocml-$(VERSION).tar.gz: $(INSTALL)
+mdocml-$(VERSION).tar.gz: $(DOINSTALL)
mkdir -p .dist/mdocml/mdocml-$(VERSION)/
- cp -f $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
+ cp -f $(DOINSTALL) .dist/mdocml/mdocml-$(VERSION)/
( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
rm -rf .dist/
-/* $Id: mdoc_macro.c,v 1.53 2010/05/07 05:34:56 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.54 2010/05/07 05:39:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
if (ARGS_EOLN == ac)
break;
- if (MDOC_MAX != (ntok = lookup(tok, p))) {
- if ( ! flushed) {
- if ( ! rew_sub(MDOC_BLOCK, m, tok, line, ppos))
- return(0);
- flushed = 1;
- }
- if ( ! mdoc_macro(m, ntok, line, lastarg, pos, buf))
+ ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+
+ if (MDOC_MAX == ntok) {
+ if ( ! mdoc_word_alloc(m, line, lastarg, p))
return(0);
- break;
- }
+ continue;
+ }
- if ( ! mdoc_word_alloc(m, line, lastarg, p))
+ if ( ! flushed) {
+ if ( ! rew_sub(MDOC_BLOCK, m, tok, line, ppos))
+ return(0);
+ flushed = 1;
+ }
+ if ( ! mdoc_macro(m, ntok, line, lastarg, pos, buf))
return(0);
+ break;
}
if ( ! flushed && ! rew_sub(MDOC_BLOCK, m, tok, line, ppos))
if (ARGS_PUNCT == ac)
break;
- /* Quoted words shouldn't be looked-up. */
-
ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
/*
continue;
}
- if (MDOC_MAX == (ntok = lookup(tok, p))) {
+ ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+
+ if (MDOC_MAX == ntok) {
if ( ! mdoc_word_alloc(m, line, la, p))
return(0);
continue;
body = m->last;
}
- if (MDOC_MAX == (ntok = lookup(tok, p))) {
+ ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+
+ if (MDOC_MAX == ntok) {
if ( ! mdoc_word_alloc(m, line, la, p))
return(0);
continue;
assert(NULL != head && NULL != body);
- if (MDOC_MAX == (ntok = lookup(tok, p))) {
+ ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+
+ if (MDOC_MAX == ntok) {
if ( ! mdoc_word_alloc(m, line, la, p))
return(0);
continue;
flushed = 1;
}
- if (MDOC_MAX != (ntok = lookup(tok, p))) {
+ ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+
+ if (MDOC_MAX != ntok) {
if ( ! flushed && ! rew_elem(m, tok))
return(0);
flushed = 1;