2009-04-06 21:21:07 +00:00
|
|
|
# Copyright (C) 2009 Stelios Bounanos, M0GLD (m0gld AT enotty DOT net)
|
2010-03-01 12:56:30 +00:00
|
|
|
# License: GPLv3+: GNU GPL version 3 or later.
|
2009-04-06 21:21:07 +00:00
|
|
|
|
|
|
|
ASCIIDOC_CONF = asciidoc.conf
|
2009-05-26 18:57:44 +00:00
|
|
|
|
2015-04-13 09:13:23 +00:00
|
|
|
ASCIIDOC_SRC = fldigi.1.txt flarq.1.txt guide.txt
|
|
|
|
ASCIIDOC_MAN_DIST = fldigi.1 flarq.1
|
2009-05-26 18:57:44 +00:00
|
|
|
ASCIIDOC_MAN_INST =
|
|
|
|
ASCIIDOC_HTML =
|
|
|
|
|
|
|
|
if WANT_FLDIGI
|
|
|
|
ASCIIDOC_MAN_INST += fldigi.1
|
|
|
|
ASCIIDOC_HTML += guide.html
|
|
|
|
endif
|
|
|
|
|
|
|
|
if WANT_FLARQ
|
|
|
|
ASCIIDOC_MAN_INST += flarq.1
|
2009-04-06 21:21:07 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
EXTRA_DIST = $(ASCIIDOC_CONF) $(ASCIIDOC_SRC) $(ASCIIDOC_MAN_DIST)
|
|
|
|
|
|
|
|
man_MANS = $(ASCIIDOC_MAN_INST)
|
|
|
|
MOSTLYCLEANFILES = *.xml
|
|
|
|
DISTCLEANFILES = $(ASCIIDOC_HTML)
|
|
|
|
MAINTAINERCLEANFILES = $(ASCIIDOC_MAN_INST)
|
|
|
|
|
2014-10-06 19:23:09 +00:00
|
|
|
A2X_ARGS = --format=manpage
|
2009-04-06 21:21:07 +00:00
|
|
|
if HAVE_ASCIIDOC_NO_XMLLINT
|
|
|
|
A2X_ARGS += --no-xmllint
|
|
|
|
endif
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
|
2009-09-22 20:02:51 +00:00
|
|
|
# Define the custom silent rule function
|
|
|
|
@SILENT_CMDS@
|
|
|
|
|
2009-04-06 21:21:07 +00:00
|
|
|
%.1: $$@.txt $(ASCIIDOC_CONF)
|
|
|
|
if HAVE_ASCIIDOC
|
2009-09-22 20:02:51 +00:00
|
|
|
$(call silent,ADOC ,$@)$(A2X) $(A2X_ARGS) $<
|
2009-04-06 21:21:07 +00:00
|
|
|
else
|
2009-09-22 20:02:51 +00:00
|
|
|
$(call silent,ADOC ,$@)echo '.TH "NOT-BUILT" "1" "" "" ""' > $@
|
2009-04-06 21:21:07 +00:00
|
|
|
endif
|
|
|
|
# Without .SECONDEXPANSION we would use something like this:
|
|
|
|
#$(ASCIIDOC_MAN_INST): asciidoc.conf
|
|
|
|
# a2x $(A2X_ARGS) $@.txt
|
|
|
|
#fldigi.1: fldigi.1.txt
|
|
|
|
|
|
|
|
# The rest of the Makefile is enabled only if we have asciidoc
|
|
|
|
if HAVE_ASCIIDOC
|
2014-10-06 19:23:09 +00:00
|
|
|
# Try to discover the correct iconsdir. Use the first one that
|
|
|
|
# contains an entry matching `tip.*'.
|
|
|
|
ASCIIDOC_ICONS_DIRS := /etc/asciidoc/icons /etc/asciidoc/images /etc/asciidoc/images/icons /etc/asciidoc/images/../icons \
|
|
|
|
/usr/share/asciidoc/icons /usr/share/asciidoc/images /usr/share/asciidoc/images/icons
|
|
|
|
ASCIIDOC_ICONS_DIR ?= $(dir $(firstword $(strip $(foreach f,$(addsuffix /tip*,$(ASCIIDOC_ICONS_DIRS)),$(wildcard $(f))))))
|
2009-04-06 21:21:07 +00:00
|
|
|
# Additional attributes are defined in guide.conf
|
|
|
|
ASCIIDOC_ARGS = --unsafe -a toc -a data-uri -a badges -a icons -a iconsdir=$(ASCIIDOC_ICONS_DIR)
|
|
|
|
|
|
|
|
%.html: $$*.txt $(ASCIIDOC_CONF)
|
|
|
|
@if ! test -d $(ASCIIDOC_ICONS_DIR); then \
|
|
|
|
echo " *** The default asciidoc icons directory, \"$(ASCIIDOC_ICONS_DIR)\", does not exist." >&2; \
|
|
|
|
echo " *** Please rerun make with the correct ASCIIDOC_ICONS_DIR, e.g.:" >&2; \
|
|
|
|
echo " *** make ASCIIDOC_ICONS_DIR=/path/to/icons" >&2; \
|
|
|
|
false; \
|
|
|
|
fi
|
2009-09-22 20:02:51 +00:00
|
|
|
$(call silent,ADOC ,$@)$(ASCIIDOC) $(ASCIIDOC_ARGS) --out-file $@ $<
|
2009-04-06 21:21:07 +00:00
|
|
|
|
|
|
|
all-local: $(ASCIIDOC_MAN_DIST) $(ASCIIDOC_HTML)
|
|
|
|
|
|
|
|
endif
|