xref: /freebsd/contrib/ntp/util/Makefile.am (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1NULL=
2
3bin_PROGRAMS=	$(NTP_KEYGEN_DB) $(NTPTIME_DB) $(TICKADJ_DB) $(TIMETRIM_DB)
4libexec_PROGRAMS=	$(NTP_KEYGEN_DL) $(NTPTIME_DL) $(TICKADJ_DL) $(TIMETRIM_DL)
5sbin_PROGRAMS=	$(NTP_KEYGEN_DS) $(NTPTIME_DS) $(TICKADJ_DS) $(TIMETRIM_DS)
6
7EXTRA_PROGRAMS=	audio-pcm byteorder hist jitter kern longsize ntp-keygen \
8	ntptime pps-api precision sht testrs6000 tg tg2 tickadj timetrim
9
10AM_CFLAGS = $(CFLAGS_NTP)
11
12AM_CPPFLAGS  = $(NTP_INCS)
13AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
14AM_CPPFLAGS += $(CPPFLAGS_NTP)
15
16AM_LDFLAGS = $(LDFLAGS_NTP)
17
18# LDADD might need RESLIB and ADJLIB
19LDADD=		../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
20tg2_LDADD=	../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
21ntp_keygen_LDADD  = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a
22ntp_keygen_LDADD += $(LDADD_LIBEVENT)
23ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
24ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
25
26tickadj_LDADD=	../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NLIST)
27
28EXTRA_DIST=				\
29	invoke-ntp-keygen.menu		\
30	invoke-ntp-keygen.texi		\
31	ntp-keygen-opts.def		\
32	ntp-keygen.1ntp-keygenman	\
33	ntp-keygen.1ntp-keygenmdoc	\
34	ntp-keygen.man.in		\
35	ntp-keygen.mdoc.in		\
36	ntp-keygen.mdoc.in		\
37	ntp-keygen.html			\
38	ntp-keygen.texi			\
39	$(NULL)
40
41BUILT_SOURCES=	ntp-keygen-opts.c ntp-keygen-opts.h
42CLEANFILES=
43DISTCLEANFILES=	.version version.c config.log $(man_MANS)
44
45html_DATA=				\
46	$(srcdir)/ntp-keygen.html	\
47	$(NULL)
48
49noinst_DATA=				\
50	$(srcdir)/invoke-ntp-keygen.menu	\
51	$(srcdir)/invoke-ntp-keygen.texi	\
52	$(srcdir)/ntp-keygen.man.in	\
53	$(srcdir)/ntp-keygen.mdoc.in	\
54	$(man_MANS)			\
55	$(NULL)
56
57man1_MANS=
58man8_MANS=
59man_MANS=	ntp-keygen.$(NTP_KEYGEN_MS)
60
61run_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D	\
62		autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
63std_def_list =							\
64	$(top_srcdir)/sntp/include/debug-opt.def		\
65	$(top_srcdir)/sntp/include/autogen-version.def 		\
66	$(top_srcdir)/sntp/include/copyright.def 		\
67	$(top_srcdir)/sntp/include/homerc.def 			\
68	$(top_srcdir)/sntp/include/ntp.lic 			\
69	$(top_srcdir)/sntp/include/version.def			\
70	$(NULL)
71
72$(srcdir)/ntp-keygen-opts.h: $(srcdir)/ntp-keygen-opts.c
73	@: do-nothing action to avoid default SCCS get, .h built with .c
74
75$(srcdir)/ntp-keygen-opts.c: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
76	$(run_ag) ntp-keygen-opts.def
77
78###
79
80$(srcdir)/ntp-keygen.1ntp-keygenman: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
81	$(run_ag) -DMAN_SECTION=1ntp-keygenman -Tagman-cmd.tpl ntp-keygen-opts.def
82
83$(srcdir)/ntp-keygen.man.in: $(srcdir)/ntp-keygen.1ntp-keygenman $(top_srcdir)/sntp/scripts/mansec2subst.sed
84	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-keygen.1ntp-keygenman > $(srcdir)/ntp-keygen.man.in+
85	mv $(srcdir)/ntp-keygen.man.in+ $(srcdir)/ntp-keygen.man.in
86
87###
88
89$(srcdir)/ntp-keygen.1ntp-keygenmdoc: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
90	$(run_ag) -DMAN_SECTION=1ntp-keygenmdoc -Tagmdoc-cmd.tpl ntp-keygen-opts.def
91
92$(srcdir)/ntp-keygen.mdoc.in: $(srcdir)/ntp-keygen.1ntp-keygenmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
93	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-keygen.1ntp-keygenmdoc > $(srcdir)/ntp-keygen.mdoc.in+
94	mv $(srcdir)/ntp-keygen.mdoc.in+ $(srcdir)/ntp-keygen.mdoc.in
95
96###
97
98ntp-keygen.$(NTP_KEYGEN_MS): $(srcdir)/ntp-keygen.$(MANTAGFMT).in $(top_builddir)/config.status
99	$(top_builddir)/config.status --file=ntp-keygen.$(NTP_KEYGEN_MS)+:$(srcdir)/ntp-keygen.$(MANTAGFMT).in
100	mv ntp-keygen.$(NTP_KEYGEN_MS)+ ntp-keygen.$(NTP_KEYGEN_MS)
101
102###
103
104$(srcdir)/invoke-ntp-keygen.menu: $(srcdir)/invoke-ntp-keygen.texi
105	@: do-nothing action to avoid default SCCS get, .menu built with .texi
106
107$(srcdir)/invoke-ntp-keygen.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
108	$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-keygen-opts.def
109	$(top_srcdir)/scripts/build/check--help $@
110
111$(srcdir)/ntp-keygen.html: $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/version.texi
112	cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp-keygen.html ntp-keygen.texi || true )
113
114
115jitter_SOURCES=	jitter.c
116jitter_LDADD=
117
118kern.o: kern.c
119	$(COMPILE) -DHAVE_TIMEX_H -c kern.c
120
121$(PROGRAMS): version.o
122
123$(top_srcdir)/sntp/scm-rev:
124	cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
125
126version.c: $(ntp_keygen_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
127	env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen
128
129version.o: version.c
130	env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
131
132include $(top_srcdir)/bincheck.mf
133include $(top_srcdir)/sntp/check-libntp.mf
134include $(top_srcdir)/check-libopts.mf
135include $(top_srcdir)/depsver.mf
136include $(top_srcdir)/includes.mf
137