1290000SglebiusNULL=
2182007Sroberto
3290000Sglebiusbin_PROGRAMS=	$(NTPDC_DB)
4290000Sglebiuslibexec_PROGRAMS=	$(NTPDC_DL)
5290000Sglebiussbin_PROGRAMS=	$(NTPDC_DS)
6290000Sglebius
7290000SglebiusEXTRA_PROGRAMS=	ntpdc ntpdc-layout
8132451SrobertoEXTRA_DATA=	check-layout
9290000SglebiusBUILT_SOURCES=	@MAKE_CHECK_LAYOUT@ ntpdc-opts.c ntpdc-opts.h
10290000Sglebius
11290000SglebiusAM_CFLAGS = $(CFLAGS_NTP)
12290000Sglebius
13290000SglebiusAM_CPPFLAGS  = $(NTP_INCS)
14290000SglebiusAM_CPPFLAGS += $(LIBOPTS_CFLAGS)
15290000SglebiusAM_CPPFLAGS += $(CPPFLAGS_NTP)
16290000Sglebius
17290000SglebiusAM_LDFLAGS = $(LDFLAGS_NTP)
18290000Sglebius
1954359Sroberto# LDADD might need RESLIB and ADJLIB
20290000Sglebiusntpdc_LDADD  = version.o $(LIBOPTS_LDADD)
21290000Sglebiusntpdc_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
22290000Sglebiusntpdc_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS)
23290000Sglebiusntpdc_LDADD += $(LDADD_NTP)
24132451Sroberto# ntpdc-layout doesn't need any additional libraries at all
25132451Srobertontpdc_layout_LDADD=
26290000Sglebius
27290000SglebiusDISTCLEANFILES=	.version version.c config.log $(man_MANS)
28132451SrobertoCLEANFILES=	check-layout layout.here nl.c ntpdc-layout
29132451Srobertonoinst_HEADERS=	ntpdc.h
30132451SrobertoETAGS_ARGS= 	Makefile.am
31290000SglebiusEXTRA_DIST=			\
32290000Sglebius	invoke-ntpdc.menu	\
33290000Sglebius	invoke-ntpdc.texi	\
34290000Sglebius	layout.std		\
35290000Sglebius	nl_in.c			\
36290000Sglebius	nl.pl			\
37290000Sglebius	ntpdc-opts.def		\
38290000Sglebius	ntpdc.1ntpdcman		\
39290000Sglebius	ntpdc.1ntpdcmdoc	\
40290000Sglebius	ntpdc.man.in		\
41290000Sglebius	ntpdc.mdoc.in		\
42290000Sglebius	ntpdc.html		\
43290000Sglebius	ntpdc.texi		\
44290000Sglebius	$(NULL)
4554359Sroberto
46290000Sglebiusman1_MANS=
47290000Sglebiusman8_MANS=
48290000Sglebiusman_MANS=	ntpdc.$(NTPDC_MS)
49290000Sglebius
50290000Sglebius## HMS: Real Soon Now...
51290000Sglebius##info_TEXINFOS=	ntpdc.texi
52290000Sglebius##ntpdc_TEXINFOS=	ntpdc-opts.texi
53290000Sglebius
54290000Sglebiushtml_DATA=				\
55290000Sglebius	$(srcdir)/ntpdc.html		\
56290000Sglebius	$(NULL)
57290000Sglebius
58290000Sglebiusnoinst_DATA=				\
59290000Sglebius	$(srcdir)/invoke-ntpdc.menu	\
60290000Sglebius	$(srcdir)/invoke-ntpdc.texi	\
61290000Sglebius	$(srcdir)/ntpdc.man.in		\
62290000Sglebius	$(srcdir)/ntpdc.mdoc.in		\
63290000Sglebius	$(NULL)
64290000Sglebius
65290000Sglebiusinstall-data-local: install-html
66290000Sglebius
67290000Sglebiusrun_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D	\
68290000Sglebius		autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
69290000Sglebius
70290000Sglebiusstd_def_list =							\
71290000Sglebius	$(top_srcdir)/sntp/include/debug-opt.def		\
72290000Sglebius	$(top_srcdir)/sntp/include/autogen-version.def 		\
73290000Sglebius	$(top_srcdir)/sntp/include/copyright.def 		\
74290000Sglebius	$(top_srcdir)/sntp/include/homerc.def 			\
75290000Sglebius	$(top_srcdir)/sntp/include/ntp.lic			\
76290000Sglebius	$(top_srcdir)/sntp/include/version.def			\
77290000Sglebius	$(NULL)
78290000Sglebius
79182007Sroberto$(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c
80290000Sglebius	@: do-nothing action to avoid default SCCS get, .h built with .c
81290000Sglebius	
82182007Sroberto$(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list)
83182007Sroberto	$(run_ag) ntpdc-opts.def
8454359Sroberto
85290000Sglebius###
86132451Sroberto
87290000Sglebius$(srcdir)/ntpdc.1ntpdcman: $(srcdir)/ntpdc-opts.def $(std_def_list)
88290000Sglebius	$(run_ag) -DMAN_SECTION=1ntpdcman -Tagman-cmd.tpl ntpdc-opts.def
89182007Sroberto
90290000Sglebius$(srcdir)/ntpdc.man.in: $(srcdir)/ntpdc.1ntpdcman $(top_srcdir)/sntp/scripts/mansec2subst.sed
91290000Sglebius	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcman > $(srcdir)/ntpdc.man.in+
92290000Sglebius	mv $(srcdir)/ntpdc.man.in+ $(srcdir)/ntpdc.man.in
93290000Sglebius
94290000Sglebius###
95290000Sglebius
96290000Sglebius$(srcdir)/ntpdc.1ntpdcmdoc: $(srcdir)/ntpdc-opts.def $(std_def_list)
97290000Sglebius	$(run_ag) -DMAN_SECTION=1ntpdcmdoc -Tagmdoc-cmd.tpl ntpdc-opts.def
98290000Sglebius
99290000Sglebius$(srcdir)/ntpdc.mdoc.in: $(srcdir)/ntpdc.1ntpdcmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
100290000Sglebius	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcmdoc > $(srcdir)/ntpdc.mdoc.in+
101290000Sglebius	mv $(srcdir)/ntpdc.mdoc.in+ $(srcdir)/ntpdc.mdoc.in
102290000Sglebius
103290000Sglebius###
104290000Sglebius
105290000Sglebiusntpdc.$(NTPDC_MS): $(srcdir)/ntpdc.$(MANTAGFMT).in $(top_builddir)/config.status
106290000Sglebius	$(top_builddir)/config.status --file=ntpdc.$(NTPDC_MS)+:$(srcdir)/ntpdc.$(MANTAGFMT).in
107290000Sglebius	mv ntpdc.$(NTPDC_MS)+ ntpdc.$(NTPDC_MS)
108290000Sglebius
109290000Sglebius###
110290000Sglebius
111290000Sglebius$(srcdir)/invoke-ntpdc.menu: $(srcdir)/invoke-ntpdc.texi
112290000Sglebius	@: do-nothing action to avoid default SCCS get, .menu built with .texi
113290000Sglebius	
114290000Sglebius$(srcdir)/invoke-ntpdc.texi: $(srcdir)/ntpdc-opts.def $(std_def_list)
115290000Sglebius	$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpdc-opts.def
116290000Sglebius	$(top_srcdir)/scripts/build/check--help $@
117290000Sglebius
118290000Sglebius$(srcdir)/ntpdc.html: $(srcdir)/invoke-ntpdc.menu $(srcdir)/invoke-ntpdc.texi $(srcdir)/ntpdc.texi $(top_srcdir)/sntp/include/version.texi
119290000Sglebius	cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpdc.html ntpdc.texi || true )
120290000Sglebius
121182007Srobertontpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h
122182007Sroberto
123132451Srobertontpdc-layout.o: nl.c
124132451Sroberto
125132451Srobertolayout.here: ntpdc-layout
126132451Sroberto	./ntpdc-layout > $@
127132451Sroberto
128290000Sglebiuscheck-layout: ntpdc-layout $(srcdir)/layout.std layout.here
129132451Sroberto	cmp $(srcdir)/layout.std layout.here && echo stamp > $@
130132451Sroberto
131290000Sglebius$(PROGRAMS): version.o
13254359Sroberto
133290000Sglebius$(top_srcdir)/sntp/scm-rev:
134290000Sglebius	cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
13554359Sroberto
136290000Sglebiusversion.c: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
137290000Sglebius	env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdc
138290000Sglebius	
139290000Sglebiusversion.o: version.c
140290000Sglebius	env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
141182007Sroberto
142132451Sroberto# I ran nl_in.c (attached, to be installed into ntpdc) through
143132451Sroberto# $(CC) -E nl_in.c | nl.pl > nl.c
144290000Sglebiusnl.c: nl_in.c nl.pl Makefile.am ../config.h ../include/ntp_request.h ntpdc.h
145182007Sroberto	$(CC) -E $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > nl.c
146182007Sroberto
147290000Sglebiusinclude $(top_srcdir)/bincheck.mf
148290000Sglebiusinclude $(top_srcdir)/check-libopts.mf
149290000Sglebiusinclude $(top_srcdir)/sntp/check-libntp.mf
150290000Sglebiusinclude $(top_srcdir)/depsver.mf
151290000Sglebiusinclude $(top_srcdir)/includes.mf
152