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