xref: /freebsd/contrib/ntp/util/Makefile.am (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
12b15cb3dSCy SchubertNULL=
2c0b746e5SOllivier Robert
32b15cb3dSCy Schubertbin_PROGRAMS=	$(NTP_KEYGEN_DB) $(NTPTIME_DB) $(TICKADJ_DB) $(TIMETRIM_DB)
42b15cb3dSCy Schubertlibexec_PROGRAMS=	$(NTP_KEYGEN_DL) $(NTPTIME_DL) $(TICKADJ_DL) $(TIMETRIM_DL)
52b15cb3dSCy Schubertsbin_PROGRAMS=	$(NTP_KEYGEN_DS) $(NTPTIME_DS) $(TICKADJ_DS) $(TIMETRIM_DS)
6ea906c41SOllivier Robert
7*f5f40dd6SCy SchubertEXTRA_PROGRAMS=	audio-pcm byteorder hist jitter kern longsize lsf-times \
8*f5f40dd6SCy Schubert	ntp-keygen \
92b15cb3dSCy Schubert	ntptime pps-api precision sht testrs6000 tg tg2 tickadj timetrim
102b15cb3dSCy Schubert
112b15cb3dSCy SchubertAM_CFLAGS  = $(CFLAGS_NTP)
12f0574f5cSXin LIAM_CFLAGS += $(NTP_HARD_CFLAGS)
132b15cb3dSCy Schubert
142b15cb3dSCy SchubertAM_CPPFLAGS  = $(NTP_INCS)
152b15cb3dSCy SchubertAM_CPPFLAGS += $(LIBOPTS_CFLAGS)
162b15cb3dSCy SchubertAM_CPPFLAGS += $(CPPFLAGS_NTP)
17f0574f5cSXin LIAM_CPPFLAGS += $(NTP_HARD_CPPFLAGS)
182b15cb3dSCy Schubert
192b15cb3dSCy SchubertAM_LDFLAGS  = $(LDFLAGS_NTP)
20f0574f5cSXin LIAM_LDFLAGS += $(NTP_HARD_LDFLAGS)
212b15cb3dSCy Schubert
22c0b746e5SOllivier Robert# LDADD might need RESLIB and ADJLIB
232b15cb3dSCy SchubertLDADD=		../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
242b15cb3dSCy Schuberttg2_LDADD=	../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
25a466cc55SCy Schubertntp_keygen_LDADD  = $(LIBOPTS_LDADD) ../libntp/libntp.a
262b15cb3dSCy Schubertntp_keygen_LDADD += $(LDADD_LIBEVENT)
272b15cb3dSCy Schubertntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
28ea906c41SOllivier Robertntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
29a466cc55SCy Schubertnodist_ntp_keygen_SOURCES = version.c
30ea906c41SOllivier Robert
312b15cb3dSCy Schuberttickadj_LDADD=	../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NLIST)
322b15cb3dSCy Schubert
332b15cb3dSCy SchubertEXTRA_DIST=				\
342b15cb3dSCy Schubert	invoke-ntp-keygen.menu		\
352b15cb3dSCy Schubert	invoke-ntp-keygen.texi		\
36*f5f40dd6SCy Schubert	lsf-times.c			\
372b15cb3dSCy Schubert	ntp-keygen-opts.def		\
382b15cb3dSCy Schubert	ntp-keygen.1ntp-keygenman	\
392b15cb3dSCy Schubert	ntp-keygen.1ntp-keygenmdoc	\
402b15cb3dSCy Schubert	ntp-keygen.man.in		\
412b15cb3dSCy Schubert	ntp-keygen.mdoc.in		\
422b15cb3dSCy Schubert	ntp-keygen.mdoc.in		\
432b15cb3dSCy Schubert	ntp-keygen.html			\
442b15cb3dSCy Schubert	ntp-keygen.texi			\
452b15cb3dSCy Schubert	$(NULL)
462b15cb3dSCy Schubert
472b15cb3dSCy SchubertBUILT_SOURCES=	ntp-keygen-opts.c ntp-keygen-opts.h
48a466cc55SCy SchubertCLEANFILES =	.version version.c
49a466cc55SCy SchubertDISTCLEANFILES=	config.log $(man_MANS)
502b15cb3dSCy Schubert
512b15cb3dSCy Schuberthtml_DATA=				\
522b15cb3dSCy Schubert	$(srcdir)/ntp-keygen.html	\
532b15cb3dSCy Schubert	$(NULL)
542b15cb3dSCy Schubert
552b15cb3dSCy Schubertnoinst_DATA=				\
562b15cb3dSCy Schubert	$(srcdir)/invoke-ntp-keygen.menu	\
572b15cb3dSCy Schubert	$(srcdir)/invoke-ntp-keygen.texi	\
582b15cb3dSCy Schubert	$(srcdir)/ntp-keygen.man.in	\
592b15cb3dSCy Schubert	$(srcdir)/ntp-keygen.mdoc.in	\
602b15cb3dSCy Schubert	$(man_MANS)			\
612b15cb3dSCy Schubert	$(NULL)
622b15cb3dSCy Schubert
632b15cb3dSCy Schubertman1_MANS=
642b15cb3dSCy Schubertman8_MANS=
652b15cb3dSCy Schubertman_MANS=	ntp-keygen.$(NTP_KEYGEN_MS)
662b15cb3dSCy Schubert
672b15cb3dSCy Schubertrun_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D	\
682b15cb3dSCy Schubert		autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
692b15cb3dSCy Schubertstd_def_list =							\
702b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/debug-opt.def		\
712b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/autogen-version.def 		\
722b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/copyright.def 		\
732b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/homerc.def 			\
742b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/ntp.lic 			\
752b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/version.def			\
762b15cb3dSCy Schubert	$(NULL)
77ea906c41SOllivier Robert
78ea906c41SOllivier Robert$(srcdir)/ntp-keygen-opts.h: $(srcdir)/ntp-keygen-opts.c
792b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get, .h built with .c
802b15cb3dSCy Schubert
81ea906c41SOllivier Robert$(srcdir)/ntp-keygen-opts.c: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
82ea906c41SOllivier Robert	$(run_ag) ntp-keygen-opts.def
83ea906c41SOllivier Robert
842b15cb3dSCy Schubert###
85ea906c41SOllivier Robert
862b15cb3dSCy Schubert$(srcdir)/ntp-keygen.1ntp-keygenman: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
872b15cb3dSCy Schubert	$(run_ag) -DMAN_SECTION=1ntp-keygenman -Tagman-cmd.tpl ntp-keygen-opts.def
882b15cb3dSCy Schubert
892b15cb3dSCy Schubert$(srcdir)/ntp-keygen.man.in: $(srcdir)/ntp-keygen.1ntp-keygenman $(top_srcdir)/sntp/scripts/mansec2subst.sed
902b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-keygen.1ntp-keygenman > $(srcdir)/ntp-keygen.man.in+
912b15cb3dSCy Schubert	mv $(srcdir)/ntp-keygen.man.in+ $(srcdir)/ntp-keygen.man.in
922b15cb3dSCy Schubert
932b15cb3dSCy Schubert###
942b15cb3dSCy Schubert
952b15cb3dSCy Schubert$(srcdir)/ntp-keygen.1ntp-keygenmdoc: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
962b15cb3dSCy Schubert	$(run_ag) -DMAN_SECTION=1ntp-keygenmdoc -Tagmdoc-cmd.tpl ntp-keygen-opts.def
972b15cb3dSCy Schubert
982b15cb3dSCy Schubert$(srcdir)/ntp-keygen.mdoc.in: $(srcdir)/ntp-keygen.1ntp-keygenmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
992b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-keygen.1ntp-keygenmdoc > $(srcdir)/ntp-keygen.mdoc.in+
1002b15cb3dSCy Schubert	mv $(srcdir)/ntp-keygen.mdoc.in+ $(srcdir)/ntp-keygen.mdoc.in
1012b15cb3dSCy Schubert
1022b15cb3dSCy Schubert###
1032b15cb3dSCy Schubert
1042b15cb3dSCy Schubertntp-keygen.$(NTP_KEYGEN_MS): $(srcdir)/ntp-keygen.$(MANTAGFMT).in $(top_builddir)/config.status
1052b15cb3dSCy Schubert	$(top_builddir)/config.status --file=ntp-keygen.$(NTP_KEYGEN_MS)+:$(srcdir)/ntp-keygen.$(MANTAGFMT).in
1062b15cb3dSCy Schubert	mv ntp-keygen.$(NTP_KEYGEN_MS)+ ntp-keygen.$(NTP_KEYGEN_MS)
1072b15cb3dSCy Schubert
1082b15cb3dSCy Schubert###
1092b15cb3dSCy Schubert
1102b15cb3dSCy Schubert$(srcdir)/invoke-ntp-keygen.menu: $(srcdir)/invoke-ntp-keygen.texi
1112b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get, .menu built with .texi
1122b15cb3dSCy Schubert
1132b15cb3dSCy Schubert$(srcdir)/invoke-ntp-keygen.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
1142b15cb3dSCy Schubert	$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-keygen-opts.def
1152b15cb3dSCy Schubert	$(top_srcdir)/scripts/build/check--help $@
1162b15cb3dSCy Schubert
117a466cc55SCy Schubert$(srcdir)/ntp-keygen.html: $(srcdir)/invoke-ntp-keygen.texi $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/version.texi
1182b15cb3dSCy Schubert	cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp-keygen.html ntp-keygen.texi || true )
119ea906c41SOllivier Robert
120ea906c41SOllivier Robert
121a25439b6SCy Schubertjitter_SOURCES=	jitter.c
122ea906c41SOllivier Robertjitter_LDADD=
123c0b746e5SOllivier Robert
124c0b746e5SOllivier Robertkern.o: kern.c
125c0b746e5SOllivier Robert	$(COMPILE) -DHAVE_TIMEX_H -c kern.c
1262b15cb3dSCy Schubert
127a466cc55SCy Schubertversion.c: Makefile $(top_srcdir)/sntp/scm-rev
128a466cc55SCy Schubert	$(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen
1292b15cb3dSCy Schubert
1302b15cb3dSCy Schubertinclude $(top_srcdir)/bincheck.mf
131a466cc55SCy Schubertinclude $(top_srcdir)/check-libntp.mf
1322b15cb3dSCy Schubertinclude $(top_srcdir)/check-libopts.mf
133a466cc55SCy Schubertinclude $(top_srcdir)/check-scm-rev.mf
1342b15cb3dSCy Schubertinclude $(top_srcdir)/depsver.mf
1352b15cb3dSCy Schubertinclude $(top_srcdir)/includes.mf
136