-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.mans.in
43 lines (32 loc) · 1.13 KB
/
Makefile.mans.in
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
# -*- Makefile -*-
# MANUAL
srcdir := @srcdir@
wcman_matches := $(shell find "${srcdir}/extensions" -name 'libxt_[a-z]*.man' -print | sort)
wcman_targets := $(shell find "${srcdir}/extensions" -name 'libxt_[A-Z]*.man' -print | sort)
wlist_matches := $(patsubst ${srcdir}/libxt_%.man,%,${wcman_matches})
wlist_targets := $(patsubst ${srcdir}/libxt_%.man,%,${wcman_targets})
.PHONY: FORCE
FORCE:
.manpages.lst: FORCE
@echo "${wlist_targets} ${wlist_matches}" >[email protected]; \
cmp -s $@ [email protected] || mv [email protected] $@; \
rm -f [email protected];
man_run = \
${AM_V_GEN}for ext in $(1); do \
name="$${ext%.man}"; \
name="$${name\#\#*/libxt_}"; \
if [ -f "$$ext" ]; then \
echo ".SS $$name"; \
cat "$$ext" || exit $$?; \
continue; \
fi; \
done >$@;
all: xtables-addons-asn.8
xtables-addons-asn.8: ${srcdir}/xtables-addons-asn.8.in matches.man targets.man
${AM_V_GEN}sed -e '/@MATCHES@/ r matches.man' -e '/@TARGET@/ r targets.man' $< >$@;
matches.man: .manpages.lst ${wcman_matches}
$(call man_run,${wlist_matches})
targets.man: .manpages.lst ${wcman_targets}
$(call man_run,${wlist_targets})
clean:
rm -f xtables-addons-asn.8 matches.man targets.man