xref: /freebsd/contrib/ntp/ntpdc/Makefile.am (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1NULL=
2
3bin_PROGRAMS=	$(NTPDC_DB)
4libexec_PROGRAMS=	$(NTPDC_DL)
5sbin_PROGRAMS=	$(NTPDC_DS)
6
7EXTRA_PROGRAMS=	ntpdc ntpdc-layout
8EXTRA_DATA=	check-layout
9BUILT_SOURCES=	@MAKE_CHECK_LAYOUT@ ntpdc-opts.c ntpdc-opts.h
10
11AM_CFLAGS = $(CFLAGS_NTP)
12AM_CFLAGS += $(NTP_HARD_CFLAGS)
13
14AM_CPPFLAGS  = $(NTP_INCS)
15AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
16AM_CPPFLAGS += $(CPPFLAGS_NTP)
17AM_CPPFLAGS += $(NTP_HARD_CPPFLAGS)
18
19AM_LDFLAGS = $(LDFLAGS_NTP)
20AM_LDFLAGS += $(NTP_HARD_LDFLAGS)
21
22# LDADD might need RESLIB and ADJLIB
23ntpdc_LDADD  = $(LIBOPTS_LDADD)
24ntpdc_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
25ntpdc_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS)
26ntpdc_LDADD += $(LDADD_NTP)
27# ntpdc-layout doesn't need any additional libraries at all
28ntpdc_layout_LDADD=
29
30DISTCLEANFILES =	\
31	$(man_MANS)	\
32	config.log	\
33	$(NULL)
34
35CLEANFILES =		\
36	check-layout	\
37	layout.here	\
38	nl.c		\
39	ntpdc-layout	\
40	.version	\
41	version.c	\
42	$(NULL)
43
44noinst_HEADERS=	ntpdc.h
45ETAGS_ARGS= 	Makefile.am
46EXTRA_DIST=			\
47	invoke-ntpdc.menu	\
48	invoke-ntpdc.texi	\
49	layout.std		\
50	nl_in.c			\
51	nl.pl			\
52	ntpdc-opts.def		\
53	ntpdc.1ntpdcman		\
54	ntpdc.1ntpdcmdoc	\
55	ntpdc.man.in		\
56	ntpdc.mdoc.in		\
57	ntpdc.html		\
58	ntpdc.texi		\
59	$(NULL)
60
61man1_MANS=
62man8_MANS=
63man_MANS=	ntpdc.$(NTPDC_MS)
64
65## HMS: Real Soon Now...
66##info_TEXINFOS=	ntpdc.texi
67##ntpdc_TEXINFOS=	ntpdc-opts.texi
68
69html_DATA=				\
70	$(srcdir)/ntpdc.html		\
71	$(NULL)
72
73noinst_DATA=				\
74	$(srcdir)/invoke-ntpdc.menu	\
75	$(srcdir)/invoke-ntpdc.texi	\
76	$(srcdir)/ntpdc.man.in		\
77	$(srcdir)/ntpdc.mdoc.in		\
78	$(NULL)
79
80install-data-local: install-html
81
82run_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D	\
83		autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
84
85std_def_list =							\
86	$(top_srcdir)/sntp/include/debug-opt.def		\
87	$(top_srcdir)/sntp/include/autogen-version.def 		\
88	$(top_srcdir)/sntp/include/copyright.def 		\
89	$(top_srcdir)/sntp/include/homerc.def 			\
90	$(top_srcdir)/sntp/include/ntp.lic			\
91	$(top_srcdir)/sntp/include/version.def			\
92	$(NULL)
93
94$(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c
95	@: do-nothing action to avoid default SCCS get, .h built with .c
96
97$(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list)
98	$(AM_V_GEN)$(run_ag) ntpdc-opts.def
99
100###
101
102$(srcdir)/ntpdc.1ntpdcman: $(srcdir)/ntpdc-opts.def $(std_def_list)
103	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdcman -Tagman-cmd.tpl ntpdc-opts.def
104
105$(srcdir)/ntpdc.man.in: $(srcdir)/ntpdc.1ntpdcman $(top_srcdir)/sntp/scripts/mansec2subst.sed
106	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcman > $(srcdir)/ntpdc.man.in+
107	mv $(srcdir)/ntpdc.man.in+ $(srcdir)/ntpdc.man.in
108
109###
110
111$(srcdir)/ntpdc.1ntpdcmdoc: $(srcdir)/ntpdc-opts.def $(std_def_list)
112	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdcmdoc -Tagmdoc-cmd.tpl ntpdc-opts.def
113
114$(srcdir)/ntpdc.mdoc.in: $(srcdir)/ntpdc.1ntpdcmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
115	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcmdoc > $(srcdir)/ntpdc.mdoc.in+
116	mv $(srcdir)/ntpdc.mdoc.in+ $(srcdir)/ntpdc.mdoc.in
117
118###
119
120ntpdc.$(NTPDC_MS): $(srcdir)/ntpdc.$(MANTAGFMT).in $(top_builddir)/config.status
121	$(top_builddir)/config.status --file=ntpdc.$(NTPDC_MS)+:$(srcdir)/ntpdc.$(MANTAGFMT).in
122	mv ntpdc.$(NTPDC_MS)+ ntpdc.$(NTPDC_MS)
123
124###
125
126$(srcdir)/invoke-ntpdc.menu: $(srcdir)/invoke-ntpdc.texi
127	@: do-nothing action to avoid default SCCS get, .menu built with .texi
128
129$(srcdir)/invoke-ntpdc.texi: $(srcdir)/ntpdc-opts.def $(std_def_list)
130	$(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpdc-opts.def
131	$(top_srcdir)/scripts/build/check--help $@
132
133$(srcdir)/ntpdc.html: $(srcdir)/invoke-ntpdc.texi $(srcdir)/ntpdc.texi $(top_srcdir)/sntp/include/version.texi
134	cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpdc.html ntpdc.texi || true )
135
136ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h
137nodist_ntpdc_SOURCES = version.c
138
139ntpdc-layout.o: nl.c
140
141layout.here: ntpdc-layout
142	$(AM_V_at)./ntpdc-layout > $@
143
144check-layout: ntpdc-layout $(srcdir)/layout.std layout.here
145	$(AM_V_at)cmp $(srcdir)/layout.std layout.here && echo stamp > $@
146
147version.c: Makefile $(top_srcdir)/sntp/scm-rev
148	$(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdc
149
150# I ran nl_in.c (attached, to be installed into ntpdc) through
151# $(CC) -E nl_in.c | nl.pl > nl.c
152nl.c: nl_in.c nl.pl Makefile.am ../config.h ../include/ntp_request.h ntpdc.h
153	$(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
154		$(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > $@
155
156
157include $(top_srcdir)/bincheck.mf
158include $(top_srcdir)/check-libopts.mf
159include $(top_srcdir)/check-libntp.mf
160include $(top_srcdir)/check-scm-rev.mf
161include $(top_srcdir)/depsver.mf
162include $(top_srcdir)/includes.mf
163