4 bindir= ${exec_prefix}/${BINSUBDIR}
6 bin_PROGRAMS= ntpd @MAKE_NTPDSIM@
8 noinst_LIBRARIES= libntpd.a
10 AM_CPPFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
11 -I$(top_srcdir)/lib/isc/nothreads/include \
12 -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS)
14 # LDADD might need RESLIB and ADJLIB.
15 LDADD= version.o libntpd.a @LIBPARSE@
16 AM_YFLAGS= -d -t -r all
22 CHECK_SAVECONFIG= check-saveconfig
24 else !SAVECONFIG_ENABLED
29 NTP_KEYWORD_OUT=ntp_keyword.dummy
31 NTP_KEYWORD_OUT=ntp_keyword.out
35 # VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as
36 # BSD make) to work around issues specific to compiling
37 # ntp_parser.y into ntp_parser.h and ntp_parser.c in a vPATH
38 # configuration where we would like (for a change) the output
39 # files ntp_parser.[ch] to be placed in the source directory,
40 # as opposed to the build directory. This allows a single
41 # host of a flock configured with Bison to update ntp_parser.[ch]
47 VPHACK_AFTER= vphack_after
54 test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c .
55 test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h .
58 # ylwrap script which invokes Bison replaces ntp_parser.h
59 # symlink with the updated file, when ntp_parser.h changes.
60 # vphack_after detects this and copies the updated file to srcdir
61 # and re-creates the ntp_parser.h symlink in its place.
65 test -L ntp_parser.h || ( \
66 mv ntp_parser.h $(srcdir)/ntp_parser.h && \
67 ln -s $(srcdir)/ntp_parser.h . \
70 BUILT_SOURCES= $(VPHACK) ntp_parser.c ntp_parser.h $(VPHACK_AFTER) \
71 ntp_keyword.h ntpd-opts.c ntpd-opts.h ntpd.1 ntpd-opts.texi \
76 # ntpdsim.1 is a remnant along with all the ntpdsim-opts.* files, the
77 # simulator currently uses ntpd-opts.[ch]. This also means there is no
78 # longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def.
81 # log10 refclock_wwv.o
83 # floor refclock_wwv.o
84 # which are (usually) provided by -lm.
85 keyword_gen_LDADD = ../libntp/libntp.a
86 ntpd_LDADD = $(LDADD) -lm @LCRYPTO@ @LSCF@ $(LIBOPTS_LDADD) ../libntp/libntp.a
87 ntpdsim_LDADD = $(LDADD) -lm @LCRYPTO@ @LSCF@ $(LIBOPTS_LDADD) ../libntp/libntpsim.a
88 ntpdsim_CFLAGS = $(CFLAGS) -DSIM
89 check_y2k_LDADD = $(LDADD) ../libntp/libntp.a
90 DISTCLEANFILES = keyword-gen .version version.c
91 CLEANFILES = check-saveconfig compsave.conf ntp_keyword.out \
102 ETAGS_ARGS = Makefile.am
104 check_PROGRAMS = @MAKE_CHECK_Y2K@
105 EXTRA_PROGRAMS = check_y2k ntpdsim keyword-gen
106 run_ag= cd $(srcdir) && \
107 env PATH="$(abs_builddir):$(PATH)" \
108 autogen -L ../include --writable
109 std_def_list= $(top_srcdir)/include/autogen-version.def \
110 $(top_srcdir)/include/copyright.def \
111 $(top_srcdir)/include/version.def
113 check-local: @MAKE_CHECK_Y2K@ $(CHECK_SAVECONFIG)
114 test -z "@MAKE_CHECK_Y2K@" || ./@MAKE_CHECK_Y2K@
119 ntp_data_structures.c \
134 # libntpd_a_SOURCES do not use #ifdef SIM
136 libntpd_a_SOURCES = \
159 refclock_chronolog.c \
163 refclock_dumbclock.c \
176 refclock_neoclock4x.c \
179 refclock_palisade.c \
180 refclock_palisade.h \
195 ntp_keyword.out: keyword-gen
196 ./keyword-gen $(srcdir)/ntp_parser.h > $@
197 grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp1
198 grep -v diff_ignore_line < $@ > cmp2
199 cmp cmp1 cmp2 > /dev/null || cp $@ $(srcdir)/ntp_keyword.h
205 $(srcdir)/ntp_keyword.h: $(NTP_KEYWORD_OUT)
206 @: do-nothing action to avoid default SCCS get
207 @: .h updated if needed by ntp_keyword.out rule
209 $(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c
210 @: do-nothing action to avoid default SCCS get, .h built with .c
212 $(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
213 $(run_ag) ntpd-opts.def
215 $(srcdir)/ntpd.1: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
216 $(run_ag) -Tagman1.tpl -bntpd ntpd-opts.def
218 $(srcdir)/ntpd-opts.texi $(srcdir)/ntpd-opts.menu: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
219 $(MAKE) ntpd # aginfo.tpl runs the binary to extract --help usage text
220 $(run_ag) -Taginfo.tpl -DLEVEL=section ntpd-opts.def
222 $(PROGRAMS): $(LDADD)
224 compsave.conf: ntpd $(srcdir)/complete.conf
225 ./ntpd --configfile $(srcdir)/complete.conf --saveconfigquit $@
227 check-saveconfig: $(srcdir)/complete.conf compsave.conf
228 cmp $(srcdir)/complete.conf compsave.conf && echo stamp > $@
231 cd ../libntp && $(MAKE) libntp.a
233 ../libparse/libparse.a:
234 cd ../libparse && $(MAKE)
236 $(top_srcdir)/version :
237 cd $(top_srcdir) && $(MAKE) version
239 version.o: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/version
240 env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpd
241 $(COMPILE) -c version.c
243 include $(top_srcdir)/bincheck.mf
244 include $(top_srcdir)/depsver.mf