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