xref: /freebsd/contrib/ntp/scripts/ntpsweep/Makefile.am (revision d11f81afd5a4a71d5f725950b0592ca212084780)
1NULL=
2run_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D	\
3		autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
4		--writable
5std_def_list =							\
6	$(top_srcdir)/sntp/include/debug-opt.def		\
7	$(top_srcdir)/sntp/include/autogen-version.def 		\
8	$(top_srcdir)/sntp/include/copyright.def 		\
9	$(top_srcdir)/sntp/include/homerc.def 			\
10	$(top_srcdir)/sntp/include/ntp.lic 			\
11	$(top_srcdir)/sntp/include/version.def			\
12	$(NULL)
13
14bin_SCRIPTS=		$(NTPSWEEP_DB)
15sbin_SCRIPTS=		$(NTPSWEEP_DS)
16libexec_SCRIPTS=	$(NTPSWEEP_DL)
17noinst_SCRIPTS=		$(NTPSWEEP_NI)
18EXTRA_SCRIPTS=		ntpsweep
19
20man1_MANS=
21man8_MANS=
22if INSTALL_NTPSWEEP
23man_MANS=	ntpsweep.$(NTPSWEEP_MS)
24else
25noinst_MANS=	ntpsweep.$(NTPSWEEP_MS)
26endif
27
28EXTRA_DIST =			\
29	ntpsweep.in		\
30	ntpsweep.1ntpsweepman	\
31	ntpsweep.1ntpsweepmdoc	\
32	ntpsweep.man.in		\
33	ntpsweep.mdoc.in	\
34	ntpsweep.texi		\
35	ntpsweep.html		\
36	ntpsweep-opts.def	\
37	ntpsweep-opts		\
38	invoke-ntpsweep.texi	\
39	invoke-ntpsweep.menu	\
40	$(NULL)
41
42html_DATA = ntpsweep.html
43
44CLEANFILES = ntpsweep.1
45DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS)
46
47noinst_DATA =			\
48	ntpsweep.1		\
49	ntpsweep.1ntpsweepman	\
50	ntpsweep.1ntpsweepmdoc	\
51	ntpsweep.man.in		\
52	ntpsweep.mdoc.in	\
53	ntpsweep.texi		\
54	ntpsweep.html		\
55	ntpsweep-opts.def	\
56	ntpsweep-opts		\
57	invoke-ntpsweep.texi	\
58	invoke-ntpsweep.menu	\
59	$(NULL)
60
61ntpsweep: $(srcdir)/ntpsweep-opts
62
63$(srcdir)/ntpsweep-opts: ntpsweep-opts.def $(std_def_list)
64	$(run_ag) ntpsweep-opts.def
65
66### Nroff
67
68$(srcdir)/ntpsweep.1ntpsweepman: ntpsweep-opts.def $(std_def_list)
69	$(run_ag) -DMAN_SECTION=1ntpsweepman -Tagman-cmd.tpl ntpsweep-opts.def
70
71$(srcdir)/ntpsweep.man.in: ntpsweep.1ntpsweepman $(top_srcdir)/sntp/scripts/mansec2subst.sed
72	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepman > $(srcdir)/ntpsweep.man.in+
73	mv $(srcdir)/ntpsweep.man.in+ $(srcdir)/ntpsweep.man.in
74
75### Mdoc
76
77$(srcdir)/ntpsweep.1ntpsweepmdoc: ntpsweep-opts.def $(std_def_list)
78	$(run_ag) -DMAN_SECTION=1ntpsweepmdoc -Tagmdoc-cmd.tpl ntpsweep-opts.def
79
80$(srcdir)/ntpsweep.mdoc.in: ntpsweep.1ntpsweepmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
81	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepmdoc > $(srcdir)/ntpsweep.mdoc.in+
82	mv $(srcdir)/ntpsweep.mdoc.in+ $(srcdir)/ntpsweep.mdoc.in
83
84### Manpage
85
86ntpsweep.1: ntpsweep.$(MANTAGFMT).in $(top_builddir)/config.status
87	$(top_builddir)/config.status --file=ntpsweep.1+:$(srcdir)/ntpsweep.$(MANTAGFMT).in
88	mv ntpsweep.1+ ntpsweep.1
89
90### Texinfo
91
92$(srcdir)/invoke-ntpsweep.menu: invoke-ntpsweep.texi
93	@: do-nothing action to avoid default SCCS get, .menu built with .texi
94
95$(srcdir)/invoke-ntpsweep.texi: ntpsweep-opts ntpsweep-opts.def $(std_def_list)
96	$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsweep-opts.def
97	$(top_srcdir)/scripts/build/check--help $@
98
99### HTML
100
101$(srcdir)/ntpsweep.html: invoke-ntpsweep.menu invoke-ntpsweep.texi ntpsweep.texi $(top_srcdir)/sntp/include/version.texi
102	cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpsweep.html ntpsweep.texi || true )
103