File: Makefile.am

package info (click to toggle)
fldigi 4.1.06-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 21,832 kB
  • sloc: cpp: 259,590; ansic: 92,227; sh: 5,006; makefile: 1,102; sed: 16
file content (69 lines) | stat: -rw-r--r-- 2,283 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright (C) 2009 Stelios Bounanos, M0GLD (m0gld AT enotty DOT net)
# License: GPLv3+: GNU GPL version 3 or later.

ASCIIDOC_CONF = asciidoc.conf

ASCIIDOC_SRC = fldigi.1.txt flarq.1.txt guide.txt
ASCIIDOC_MAN_DIST = fldigi.1 flarq.1
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
endif

EXTRA_DIST = $(ASCIIDOC_CONF) $(ASCIIDOC_SRC) $(ASCIIDOC_MAN_DIST)

man_MANS = $(ASCIIDOC_MAN_INST)
MOSTLYCLEANFILES = *.xml
DISTCLEANFILES = $(ASCIIDOC_HTML)
MAINTAINERCLEANFILES = $(ASCIIDOC_MAN_INST)

A2X_ARGS = --format=manpage
if HAVE_ASCIIDOC_NO_XMLLINT
    A2X_ARGS += --no-xmllint
endif

.SECONDEXPANSION:

# Define the custom silent rule function
@SILENT_CMDS@

%.1: $$@.txt $(ASCIIDOC_CONF)
if HAVE_ASCIIDOC
	$(call silent,ADOC  ,$@)TZ=0 $(A2X) $(A2X_ARGS) $<
else
	$(call silent,ADOC  ,$@)echo '.TH "NOT-BUILT" "1" "" "" ""' > $@
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
# 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))))))
# 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
	$(call silent,ADOC  ,$@)TZ=0 $(ASCIIDOC) $(ASCIIDOC_ARGS) --out-file $@ $<

all-local: $(ASCIIDOC_MAN_DIST) $(ASCIIDOC_HTML)

endif