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