mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 04:35:12 +02:00

make only evaluates $? of an entire shell invocation. As such, if any command in the chain can fail, $? needs to be thrown, and early so.
41 lines
1.0 KiB
Makefile
41 lines
1.0 KiB
Makefile
# -*- Makefile -*-
|
|
# MANUAL
|
|
|
|
srcdir := @srcdir@
|
|
|
|
wcman_matches := $(shell find "${srcdir}" -name 'libxt_[a-z]*.man' | sort)
|
|
wcman_targets := $(shell find "${srcdir}" -name 'libxt_[A-Z]*.man' | 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}" >$@.tmp; \
|
|
cmp -s $@ $@.tmp || mv $@.tmp $@; \
|
|
rm -f $@.tmp;
|
|
|
|
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.8
|
|
|
|
xtables-addons.8: ${srcdir}/xtables-addons.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})
|