xref: /freebsd/contrib/ntp/ntpq/Makefile.am (revision a466cc55373fc3cf86837f09da729535b57e69a1)
12b15cb3dSCy SchubertNULL=
2ea906c41SOllivier Robert
32b15cb3dSCy SchubertEXTRA_PROGRAMS=	ntpq
42b15cb3dSCy Schubertbin_PROGRAMS=	$(NTPQ_DB)
52b15cb3dSCy Schubertlibexec_PROGRAMS=	$(NTPQ_DL)
62b15cb3dSCy Schubertsbin_PROGRAMS=	$(NTPQ_DS)
72b15cb3dSCy Schubert
82b15cb3dSCy SchubertAM_CFLAGS = $(CFLAGS_NTP)
9f0574f5cSXin LIAM_CFLAGS += $(NTP_HARD_CFLAGS)
102b15cb3dSCy Schubert
112b15cb3dSCy SchubertAM_CPPFLAGS  = $(NTP_INCS)
122b15cb3dSCy SchubertAM_CPPFLAGS += $(LIBOPTS_CFLAGS)
132b15cb3dSCy SchubertAM_CPPFLAGS += $(CPPFLAGS_NTP)
14f0574f5cSXin LIAM_CPPFLAGS += $(NTP_HARD_CPPFLAGS)
152b15cb3dSCy Schubert
162b15cb3dSCy SchubertAM_LDFLAGS  = $(LDFLAGS_NTP)
17f0574f5cSXin LIAM_LDFLAGS += $(NTP_HARD_LDFLAGS)
18ea906c41SOllivier Robert
19c0b746e5SOllivier Robert# LDADD might need RESLIB and ADJLIB
20*a466cc55SCy Schubertntpq_LDADD  = $(LIBOPTS_LDADD)
212b15cb3dSCy Schubertntpq_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
222b15cb3dSCy Schubertntpq_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS)
232b15cb3dSCy Schubertntpq_LDADD += $(LDADD_NTP)
2409100258SXin LIntpq_LDADD += $(NTP_HARD_LDFLAGS)
252d4e511cSCy Schubert
26c0b746e5SOllivier Robertnoinst_HEADERS =	ntpq.h
272d4e511cSCy Schubert
282b15cb3dSCy Schubertnoinst_LIBRARIES =	libntpq.a
2909100258SXin LIlibntpq_a_CFLAGS =	$(AM_CFLAGS)
3009100258SXin LIlibntpq_a_CFLAGS +=	-DNO_MAIN_ALLOWED -DBUILD_AS_LIB
3109100258SXin LIlibntpq_a_CPPFLAGS =	$(AM_CPPFLAGS)
322d4e511cSCy Schubert
33*a466cc55SCy SchubertCLEANFILES =		.version version.c
34*a466cc55SCy SchubertDISTCLEANFILES =	config.log $(man_MANS)
35c0b746e5SOllivier RobertETAGS_ARGS =		Makefile.am
36*a466cc55SCy Schubert
372b15cb3dSCy SchubertEXTRA_DIST =			\
382b15cb3dSCy Schubert	invoke-ntpq.menu	\
392b15cb3dSCy Schubert	invoke-ntpq.texi	\
402b15cb3dSCy Schubert	ntpq-opts.def		\
412b15cb3dSCy Schubert	ntpq.1ntpqman		\
422b15cb3dSCy Schubert	ntpq.1ntpqmdoc		\
432b15cb3dSCy Schubert	ntpq.man.in		\
442b15cb3dSCy Schubert	ntpq.mdoc.in		\
452b15cb3dSCy Schubert	ntpq.html		\
462b15cb3dSCy Schubert	ntpq.texi		\
472b15cb3dSCy Schubert	$(NULL)
482b15cb3dSCy Schubert
492b15cb3dSCy SchubertBUILT_SOURCES=	ntpq-opts.c ntpq-opts.h
502b15cb3dSCy Schubert
512b15cb3dSCy Schuberthtml_DATA=				\
522b15cb3dSCy Schubert	$(srcdir)/ntpq.html		\
532b15cb3dSCy Schubert	$(NULL)
542b15cb3dSCy Schubert
552b15cb3dSCy Schubertnoinst_DATA=				\
562b15cb3dSCy Schubert	$(srcdir)/invoke-ntpq.menu	\
572b15cb3dSCy Schubert	$(srcdir)/invoke-ntpq.texi	\
582b15cb3dSCy Schubert	$(srcdir)/ntpq.man.in		\
592b15cb3dSCy Schubert	$(srcdir)/ntpq.mdoc.in		\
602b15cb3dSCy Schubert	$(NULL)
612b15cb3dSCy Schubert
622b15cb3dSCy Schubertinstall-data-local: install-html
632b15cb3dSCy Schubert
642b15cb3dSCy Schubertman1_MANS=
652b15cb3dSCy Schubertman8_MANS=
662b15cb3dSCy Schubertman_MANS=	ntpq.$(NTPQ_MS)
672b15cb3dSCy Schubert
682b15cb3dSCy Schubertrun_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D	\
692b15cb3dSCy Schubert		autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
702b15cb3dSCy Schubertstd_def_list =							\
712b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/debug-opt.def		\
722b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/autogen-version.def 		\
732b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/copyright.def 		\
742b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/homerc.def 			\
752b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/ntp.lic			\
762b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/version.def			\
772b15cb3dSCy Schubert	$(NULL)
78*a466cc55SCy Schubert
79ea906c41SOllivier Robertntpq_SOURCES =		ntpq.c ntpq-subs.c ntpq-opts.c ntpq-opts.h
80*a466cc55SCy Schubertnodist_ntpq_SOURCES =	version.c
81c0b746e5SOllivier Robert
822b15cb3dSCy Schubertlibntpq_a_SOURCES =	libntpq.c libntpq.h libntpq_subs.c
832b15cb3dSCy Schubert
84ea906c41SOllivier Robert$(srcdir)/ntpq-opts.h: $(srcdir)/ntpq-opts.c
852b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get, .h built with .c
862b15cb3dSCy Schubert
87ea906c41SOllivier Robert$(srcdir)/ntpq-opts.c: $(srcdir)/ntpq-opts.def $(std_def_list)
88*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) ntpq-opts.def
89ea906c41SOllivier Robert
902b15cb3dSCy Schubert###
91ea906c41SOllivier Robert
922b15cb3dSCy Schubert$(srcdir)/ntpq.1ntpqman: $(srcdir)/ntpq-opts.def $(std_def_list)
93*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpqman -Tagman-cmd.tpl ntpq-opts.def
94c0b746e5SOllivier Robert
952b15cb3dSCy Schubert$(srcdir)/ntpq.man.in: $(srcdir)/ntpq.1ntpqman $(top_srcdir)/sntp/scripts/mansec2subst.sed
962b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpq.1ntpqman > $(srcdir)/ntpq.man.in+
972b15cb3dSCy Schubert	mv $(srcdir)/ntpq.man.in+ $(srcdir)/ntpq.man.in
98c0b746e5SOllivier Robert
992b15cb3dSCy Schubert###
100c0b746e5SOllivier Robert
1012b15cb3dSCy Schubert$(srcdir)/ntpq.1ntpqmdoc: $(srcdir)/ntpq-opts.def $(std_def_list)
102*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpqmdoc -Tagmdoc-cmd.tpl ntpq-opts.def
103ea906c41SOllivier Robert
1042b15cb3dSCy Schubert$(srcdir)/ntpq.mdoc.in: $(srcdir)/ntpq.1ntpqmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
1052b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpq.1ntpqmdoc > $(srcdir)/ntpq.mdoc.in+
1062b15cb3dSCy Schubert	mv $(srcdir)/ntpq.mdoc.in+ $(srcdir)/ntpq.mdoc.in
1072b15cb3dSCy Schubert
1082b15cb3dSCy Schubert###
1092b15cb3dSCy Schubert
1102b15cb3dSCy Schubertntpq.$(NTPQ_MS): $(srcdir)/ntpq.$(MANTAGFMT).in $(top_builddir)/config.status
1112b15cb3dSCy Schubert	$(top_builddir)/config.status --file=ntpq.$(NTPQ_MS)+:$(srcdir)/ntpq.$(MANTAGFMT).in
1122b15cb3dSCy Schubert	mv ntpq.$(NTPQ_MS)+ ntpq.$(NTPQ_MS)
1132b15cb3dSCy Schubert
1142b15cb3dSCy Schubert###
1152b15cb3dSCy Schubert
1162b15cb3dSCy Schubert$(srcdir)/invoke-ntpq.menu: $(srcdir)/invoke-ntpq.texi
1172b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get, .menu built with .texi
1182b15cb3dSCy Schubert
1192b15cb3dSCy Schubert$(srcdir)/invoke-ntpq.texi: $(srcdir)/ntpq-opts.def $(std_def_list)
120*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpq-opts.def
1212b15cb3dSCy Schubert	$(top_srcdir)/scripts/build/check--help $@
1222b15cb3dSCy Schubert
123*a466cc55SCy Schubert$(srcdir)/ntpq.html: $(srcdir)/invoke-ntpq.texi $(srcdir)/ntpq.texi $(top_srcdir)/sntp/include/version.texi
1242b15cb3dSCy Schubert	cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpq.html ntpq.texi || true )
1252b15cb3dSCy Schubert
1262b15cb3dSCy Schubert###
1272b15cb3dSCy Schubert
128*a466cc55SCy Schubertversion.c: Makefile $(top_srcdir)/sntp/scm-rev
129*a466cc55SCy Schubert	$(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpq
1302b15cb3dSCy Schubert
1312b15cb3dSCy Schubertinclude $(top_srcdir)/bincheck.mf
1322b15cb3dSCy Schubertinclude $(top_srcdir)/check-libopts.mf
133*a466cc55SCy Schubertinclude $(top_srcdir)/check-libntp.mf
134*a466cc55SCy Schubertinclude $(top_srcdir)/check-scm-rev.mf
1352b15cb3dSCy Schubertinclude $(top_srcdir)/depsver.mf
1362b15cb3dSCy Schubertinclude $(top_srcdir)/includes.mf
137