The files in doc/misc requires all the BIND 9 libraries to be built
before the documentation can be built. One of the extra automake
features is maintainer mode that allows to conditionally build and clean
files that require special tools. Make use of the automake maintainer
mode to not rebuild the files in doc/misc under normal circumstances.
include $(top_srcdir)/Makefile.top
include $(top_srcdir)/Makefile.docs
-noinst_PROGRAMS = cfg_test
-
-cfg_test_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBISC_CFLAGS) \
- $(LIBDNS_CFLAGS) \
- $(LIBISCCFG_CFLAGS)
-
-cfg_test_LDADD = \
- $(LIBISC_LIBS) \
- $(LIBDNS_LIBS) \
- $(LIBISCCFG_LIBS)
-
-BUILT_SOURCES = \
+OPTIONS_FILES = \
options \
options.active \
master.zoneopt \
managed-keys.grammar.rst \
trusted-keys.grammar.rst
-EXTRA_DIST = \
- $(BUILT_SOURCES) \
+EXTRA_DIST = \
+ $(OPTIONS_FILES) \
format-options.pl \
rst-grammars.pl \
rst-options.pl \
rst-zoneopt.pl \
sort-options.pl
-MAINTAINERCLEANFILES = $(BUILT_SOURCES)
+if MAINTAINER_MODE
+
+MAINTAINERCLEANFILES = $(OPTIONS_FILES)
+
+noinst_PROGRAMS = cfg_test
+
+cfg_test_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(LIBISC_CFLAGS) \
+ $(LIBDNS_CFLAGS) \
+ $(LIBISCCFG_CFLAGS)
+
+cfg_test_LDADD = \
+ $(LIBISC_LIBS) \
+ $(LIBDNS_LIBS) \
+ $(LIBISCCFG_LIBS)
+
+BUILT_SOURCES = \
+ $(OPTIONS_FILES)
options: cfg_test
$(AM_V_CFG_TEST)$(builddir)/cfg_test --named --grammar | $(PERL) $(srcdir)/sort-options.pl | $(PERL) $(srcdir)/format-options.pl --strip-not-configured > $@
trusted-keys.grammar.rst: options.active
$(AM_V_RST_GRAMMARS)$(PERL) $(srcdir)/rst-grammars.pl options.active trusted-keys > $@
+
+endif