| 1 |
|
| 2 |
dist_man1_MANS = man/cppi.1 |
| 3 |
|
| 4 |
man_aux = $(dist_man1_MANS:.1=.x) |
| 5 |
EXTRA_DIST += $(man_aux) |
| 6 |
MAINTAINERCLEANFILES += $(dist_man1_MANS) |
| 7 |
|
| 8 |
|
| 9 |
common_dep = $(top_srcdir)/.version |
| 10 |
|
| 11 |
man/cppi.1: $(common_dep) $(srcdir)/man/cppi.x src/cppi |
| 12 |
|
| 13 |
SUFFIXES += .x .1 |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
.x.1: |
| 18 |
$(AM_V_GEN):; \ |
| 19 |
PATH=src$(PATH_SEPARATOR)$$PATH; export PATH; \ |
| 20 |
prog=`basename $*`; \ |
| 21 |
$(HELP2MAN) \ |
| 22 |
--include=$(srcdir)/$*.x \ |
| 23 |
--output=$@ $$prog$(EXEEXT) |
| 24 |
|
| 25 |
check-local: check-x-vs-1 check-programs-vs-x |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
ASSORT = LC_ALL=C sort |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
.PHONY: check-x-vs-1 |
| 35 |
check-x-vs-1: |
| 36 |
$(AM_V_GEN)t=ls-files.$$$$; \ |
| 37 |
(cd $(srcdir)/man && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ |
| 38 |
echo $(dist_man1_MANS) | tr -s ' ' '\012' | sed 's,man/,,;s/\.1$$//' \ |
| 39 |
| $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \ |
| 40 |
rm $$t |
| 41 |
|
| 42 |
programs = \ |
| 43 |
echo 'spy:;@echo $$(PROGRAMS)' \ |
| 44 |
| MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy \ |
| 45 |
| tr -s ' ' '\012' | sed 's,.*/,,' | $(ASSORT) -u |
| 46 |
|
| 47 |
.PHONY: check-programs-vs-x |
| 48 |
check-programs-vs-x: |
| 49 |
$(AM_V_GEN)for p in `$(programs)`; do \ |
| 50 |
p=$$(echo $$p|sed 's/$(EXEEXT)$$//'); \ |
| 51 |
test -f $(srcdir)/man/$$p.x \ |
| 52 |
|| { echo missing $$p.x 1>&2; missing=1; }; \ |
| 53 |
done; \ |
| 54 |
test "$$missing" = 1 && exit 1 || : |
| 55 |
|
| 56 |
|
| 57 |
distclean-local: |
| 58 |
test 'x$(srcdir)' = 'x$(builddir)' && : || rm -f $(dist_man1_MANS) |