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

Because we are likely to be having more userspace programs soon, and reproducing manual makefiles is a bad idea, make extensions/ ready for automake traversal. The build pattern now is: 1. toplevel Makefile.am starts off with extensions/Makefile.am 2. Makefile.am a. builds programs in current directory b. runs Kbuild - only from extensions/Makefile.am (so it does not get reinvoked from case 2cII) - Kbuild recurses on its own c. runs Mbuild I. builds iptables shared libraries in current directory II. runs Makefile.am in each subdir (goto step 2.)
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')
|
|
wcman_targets := $(shell find "${srcdir}" -name 'libxt_[A-Z]*.man')
|
|
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"; \
|
|
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})
|