build: depend on gnulib's calloc-gnu, not calloc
[cppi.git] / man / local.mk
blob1e1f134c999bbe798b570f39896509e2186d8229
1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
2 dist_man1_MANS = man/cppi.1
4 man_aux = $(dist_man1_MANS:.1=.x)
5 EXTRA_DIST += $(man_aux)
6 MAINTAINERCLEANFILES += $(dist_man1_MANS)
8 # Depend on .version to get version number changes.
9 common_dep = $(top_srcdir)/.version
11 man/cppi.1: $(common_dep) $(srcdir)/man/cppi.x src/cppi
13 SUFFIXES += .x .1
15 # FIXME: when we depend on GNU make, remove $$prog; use $(*F) in its place
16 # Also, use a %.1: man/%.x pattern rule.
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)
25 check-local: check-x-vs-1 check-programs-vs-x
27 # Sort in traditional ASCII order, regardless of the current locale;
28 # otherwise we may get into trouble with distinct strings that the
29 # current locale considers to be equal.
30 ASSORT = LC_ALL=C sort
32 # Ensure that for each .x file in this directory, there is a
33 # corresponding .1 file in the definition of $(dist_man1_MANS) above.
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
42 programs = \
43 echo 'spy:;@echo $$(PROGRAMS)' \
44 | MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy \
45 | tr -s ' ' '\012' | sed 's,.*/,,' | $(ASSORT) -u
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 || :
56 # This is a kludge to remove man/cppi.1 from a non-srcdir build.
57 distclean-local:
58 test 'x$(srcdir)' = 'x$(builddir)' && : || rm -f $(dist_man1_MANS)