xref: /freebsd/contrib/ntp/ntpd/Makefile.am (revision a466cc55373fc3cf86837f09da729535b57e69a1)
12b15cb3dSCy SchubertNULL=
2ea906c41SOllivier Robert
32b15cb3dSCy Schubertbin_PROGRAMS=	$(NTPD_DB) $(NTPDSIM_DB)
42b15cb3dSCy Schubertlibexec_PROGRAMS=	$(NTPD_DL) $(NTPDSIM_DL)
52b15cb3dSCy Schubertsbin_PROGRAMS=	$(NTPD_DS) $(NTPDSIM_DS)
6ea906c41SOllivier Robert
79c2daa00SOllivier Robertnoinst_LIBRARIES=	libntpd.a
8ea906c41SOllivier Robert
92b15cb3dSCy SchubertAM_CFLAGS = $(CFLAGS_NTP)
10f0574f5cSXin LIAM_CFLAGS += $(NTP_HARD_CFLAGS)
112b15cb3dSCy Schubert
122b15cb3dSCy SchubertAM_CPPFLAGS  = $(NTP_INCS)
132b15cb3dSCy SchubertAM_CPPFLAGS += $(LIBOPTS_CFLAGS)
142b15cb3dSCy SchubertAM_CPPFLAGS += $(CPPFLAGS_NTP)
15f0574f5cSXin LIAM_CPPFLAGS += $(NTP_HARD_CPPFLAGS)
162b15cb3dSCy Schubert
172b15cb3dSCy SchubertAM_LDFLAGS = $(LDFLAGS_NTP)
18f0574f5cSXin LIAM_LDFLAGS += $(NTP_HARD_LDFLAGS)
192b15cb3dSCy Schubert
209c2daa00SOllivier Robert# LDADD might need RESLIB and ADJLIB.
21*a466cc55SCy SchubertLDADD = libntpd.a $(LIBPARSE)
222b15cb3dSCy SchubertAM_YFLAGS = -d -t -r all
23ea906c41SOllivier Robert
242b15cb3dSCy Schubertif SAVECONFIG_ENABLED
252b15cb3dSCy Schubertif NTP_CROSSCOMPILE
262b15cb3dSCy SchubertCHECK_SAVECONFIG=
272b15cb3dSCy Schubertelse
282d4e511cSCy SchubertCHECK_SAVECONFIG= check-saveconfig check-pslsaveconfig
292b15cb3dSCy Schubertendif
302b15cb3dSCy Schubertelse !SAVECONFIG_ENABLED
312b15cb3dSCy SchubertCHECK_SAVECONFIG=
322b15cb3dSCy Schubertendif
33ea906c41SOllivier Robert
342b15cb3dSCy Schubert#
352b15cb3dSCy Schubert# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as
362b15cb3dSCy Schubert# BSD make) to work around issues specific to compiling
372b15cb3dSCy Schubert# ntp_parser.y into ntp_parser.h and ntp_parser.c in a VPATH
382b15cb3dSCy Schubert# configuration where we would like (for a change) the output
392b15cb3dSCy Schubert# files ntp_parser.[ch] to be placed in the source directory,
402b15cb3dSCy Schubert# as opposed to the build directory.  This allows a single
412b15cb3dSCy Schubert# host of a flock configured with Bison to update ntp_parser.[ch]
422b15cb3dSCy Schubert# used by the rest.
432b15cb3dSCy Schubert#
44ea906c41SOllivier Robert
452b15cb3dSCy Schubertif VPATH_HACK
462b15cb3dSCy SchubertVPHACK=	vphack
472b15cb3dSCy SchubertVPHACK_AFTER= vphack_after
482b15cb3dSCy Schubertelse
492b15cb3dSCy SchubertVPHACK=
502b15cb3dSCy SchubertVPHACK_AFTER=
512b15cb3dSCy Schubertendif
522b15cb3dSCy Schubert
532b15cb3dSCy Schubertvphack:
54*a466cc55SCy Schubert	$(AM_V_at)test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c .
55*a466cc55SCy Schubert	$(AM_V_at)test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h .
562b15cb3dSCy Schubert
572b15cb3dSCy Schubert#
582b15cb3dSCy Schubert# ylwrap script which invokes Bison replaces ntp_parser.h
592b15cb3dSCy Schubert# symlink with the updated file, when ntp_parser.h changes.
602b15cb3dSCy Schubert# vphack_after detects this and copies the updated file to srcdir
612b15cb3dSCy Schubert# and re-creates the ntp_parser.h symlink in its place.
622b15cb3dSCy Schubert#
632b15cb3dSCy Schubert
642b15cb3dSCy Schubertvphack_after:
65*a466cc55SCy Schubert	$(AM_V_at)test -L ntp_parser.h || ( \
662b15cb3dSCy Schubert		mv ntp_parser.h $(srcdir)/ntp_parser.h && \
672b15cb3dSCy Schubert		ln -s $(srcdir)/ntp_parser.h . \
682b15cb3dSCy Schubert		)
692b15cb3dSCy Schubert
702b15cb3dSCy Schubert# BUILT_SOURCES which should also be in EXTRA_DIST
712b15cb3dSCy SchubertB_S_DIST=			\
722b15cb3dSCy Schubert	$(srcdir)/ntpd-opts.c	\
732b15cb3dSCy Schubert	$(srcdir)/ntpd-opts.h	\
742b15cb3dSCy Schubert	$(NULL)
752b15cb3dSCy Schubert
762b15cb3dSCy SchubertBUILT_SOURCES=		\
772b15cb3dSCy Schubert	$(VPHACK)	\
782b15cb3dSCy Schubert	$(LIBPARSE)	\
792b15cb3dSCy Schubert	ntp_parser.c	\
802b15cb3dSCy Schubert	ntp_parser.h	\
812b15cb3dSCy Schubert	$(VPHACK_AFTER)	\
822b15cb3dSCy Schubert	$(B_S_DIST)	\
832b15cb3dSCy Schubert	$(NULL)
842b15cb3dSCy Schubert
852b15cb3dSCy Schubertman1_MANS=
862b15cb3dSCy Schubertman5_MANS=	ntp.conf.5 ntp.keys.5
872b15cb3dSCy Schubertman8_MANS=
882b15cb3dSCy Schubertman_MANS=	ntpd.$(NTPD_MS)
892b15cb3dSCy Schubert
902b15cb3dSCy SchubertLDADD_NTPD_COMMON  = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS)
912b15cb3dSCy SchubertLDADD_NTPD_COMMON += $(LIBM) $(LDADD_NTP) $(LSCF)
922b15cb3dSCy Schubertntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_NTPD_COMMON) $(LDADD_LIBUTIL)
932b15cb3dSCy Schubertntpdsim_LDADD = $(LDADD) ../libntp/libntpsim.a $(LDADD_NTPD_COMMON)
942b15cb3dSCy Schubertntpdsim_CPPFLAGS = $(AM_CPPFLAGS) -DSIM
952b15cb3dSCy Schubertcheck_y2k_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_LIBNTP) $(PTHREAD_LIBS)
962b15cb3dSCy Schubert## we don't want $(LDADD) in keyword_gen_LDADD
972b15cb3dSCy Schubertkeyword_gen_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
982b15cb3dSCy Schubert
992b15cb3dSCy SchubertDISTCLEANFILES =		\
1002b15cb3dSCy Schubert	keyword-gen		\
1012b15cb3dSCy Schubert	config.log		\
1022b15cb3dSCy Schubert	$(man5_MANS)		\
1032b15cb3dSCy Schubert	$(man_MANS)		\
1042b15cb3dSCy Schubert	$(NULL)
1052b15cb3dSCy Schubert
1062b15cb3dSCy SchubertCLEANFILES =			\
1072d4e511cSCy Schubert	check-psl0		\
1082d4e511cSCy Schubert	check-psl1		\
1092d4e511cSCy Schubert	check-psl2		\
1102d4e511cSCy Schubert	check-pslsaveconfig	\
1112b15cb3dSCy Schubert	check-saveconfig	\
1122b15cb3dSCy Schubert	compsave.conf		\
1132d4e511cSCy Schubert	compsave.conf+		\
1142b15cb3dSCy Schubert	k-g-u-submake		\
1152d4e511cSCy Schubert	psl0save.conf		\
1162d4e511cSCy Schubert	psl0save.conf+		\
1172d4e511cSCy Schubert	psl1save.conf		\
1182d4e511cSCy Schubert	psl1save.conf+		\
1192d4e511cSCy Schubert	psl2save.conf		\
1202d4e511cSCy Schubert	psl2save.conf+		\
121*a466cc55SCy Schubert	.version		\
122*a466cc55SCy Schubert	version.c		\
123*a466cc55SCy Schubert	ntpd-version.c		\
124*a466cc55SCy Schubert	sim-version.c		\
1252b15cb3dSCy Schubert	$(EXTRA_PROGRAMS)	\
1262b15cb3dSCy Schubert	$(NULL)
1272b15cb3dSCy Schubert
1282b15cb3dSCy SchubertEXTRA_DIST =			\
1292b15cb3dSCy Schubert	complete.conf.in	\
1302b15cb3dSCy Schubert	invoke-ntp.conf.menu	\
1312b15cb3dSCy Schubert	invoke-ntp.conf.texi	\
1322b15cb3dSCy Schubert	invoke-ntp.keys.menu	\
1332b15cb3dSCy Schubert	invoke-ntp.keys.texi	\
1342b15cb3dSCy Schubert	invoke-ntpd.menu	\
1352b15cb3dSCy Schubert	invoke-ntpd.texi	\
1362b15cb3dSCy Schubert	keyword-gen-utd		\
1372b15cb3dSCy Schubert	ntp.conf.5man		\
1382b15cb3dSCy Schubert	ntp.conf.5mdoc		\
1392b15cb3dSCy Schubert	ntp.conf.def		\
1402b15cb3dSCy Schubert	ntp.conf.man.in		\
1412b15cb3dSCy Schubert	ntp.conf.mdoc.in	\
1422b15cb3dSCy Schubert	ntp.conf.html		\
1432b15cb3dSCy Schubert	ntp.conf.texi		\
1442b15cb3dSCy Schubert	ntp.keys.5man		\
1452b15cb3dSCy Schubert	ntp.keys.5mdoc		\
1462b15cb3dSCy Schubert	ntp.keys.def		\
1472b15cb3dSCy Schubert	ntp.keys.man.in		\
1482b15cb3dSCy Schubert	ntp.keys.mdoc.in	\
1492b15cb3dSCy Schubert	ntp.keys.html		\
1502b15cb3dSCy Schubert	ntp.keys.texi		\
1512b15cb3dSCy Schubert	ntpd-opts.def		\
1522b15cb3dSCy Schubert	ntpd.1ntpdman		\
1532b15cb3dSCy Schubert	ntpd.1ntpdmdoc		\
1542b15cb3dSCy Schubert	ntpd.man.in		\
1552b15cb3dSCy Schubert	ntpd.mdoc.in		\
1562b15cb3dSCy Schubert	ntpd.html		\
1572b15cb3dSCy Schubert	ntpd.texi		\
1582b15cb3dSCy Schubert	ntpdbase-opts.def	\
1592d4e511cSCy Schubert	psl0.conf		\
1602d4e511cSCy Schubert	psl1.conf		\
1612d4e511cSCy Schubert	psl2.conf		\
162ea906c41SOllivier Robert	refclock_msfees.c	\
1632b15cb3dSCy Schubert	$(B_S_DIST)		\
1642b15cb3dSCy Schubert	$(NULL)
1652b15cb3dSCy Schubert
166c0b746e5SOllivier Robert###							Y2Kfixes
167c0b746e5SOllivier Robertcheck_PROGRAMS = @MAKE_CHECK_Y2K@
1682b15cb3dSCy SchubertEXTRA_PROGRAMS = check_y2k keyword-gen ntpd ntpdsim
169c0b746e5SOllivier Robert
1702b15cb3dSCy Schuberthtml_DATA=				\
1712b15cb3dSCy Schubert	$(srcdir)/ntp.conf.html		\
1722b15cb3dSCy Schubert	$(srcdir)/ntp.keys.html		\
1732b15cb3dSCy Schubert	$(srcdir)/ntpd.html		\
1742b15cb3dSCy Schubert	$(NULL)
175c0b746e5SOllivier Robert
1762b15cb3dSCy Schubertnoinst_DATA =				\
1772b15cb3dSCy Schubert	$(srcdir)/invoke-ntp.conf.menu	\
1782b15cb3dSCy Schubert	$(srcdir)/invoke-ntp.conf.texi	\
1792b15cb3dSCy Schubert	$(srcdir)/invoke-ntp.keys.menu	\
1802b15cb3dSCy Schubert	$(srcdir)/invoke-ntp.keys.texi	\
1812b15cb3dSCy Schubert	$(srcdir)/invoke-ntpd.menu	\
1822b15cb3dSCy Schubert	$(srcdir)/invoke-ntpd.texi	\
1832b15cb3dSCy Schubert	$(srcdir)/ntp.conf.man.in	\
1842b15cb3dSCy Schubert	$(srcdir)/ntp.conf.mdoc.in	\
1852b15cb3dSCy Schubert	$(srcdir)/ntp.keys.man.in	\
1862b15cb3dSCy Schubert	$(srcdir)/ntp.keys.mdoc.in	\
1872b15cb3dSCy Schubert	$(srcdir)/ntpd.man.in		\
1882b15cb3dSCy Schubert	$(srcdir)/ntpd.mdoc.in		\
1892b15cb3dSCy Schubert	$(NULL)
1902b15cb3dSCy Schubert
1912b15cb3dSCy Schubertnoinst_HEADERS =			\
1922b15cb3dSCy Schubert	declcond.h			\
193*a466cc55SCy Schubert	ntp_clockdev.h			\
1942b15cb3dSCy Schubert	ntp_leapsec.h			\
1952b15cb3dSCy Schubert	$(NULL)
1962b15cb3dSCy Schubert
1972b15cb3dSCy Schubertinstall-data-local: install-html
1982b15cb3dSCy Schubert
1992b15cb3dSCy Schubertrun_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D	\
2002b15cb3dSCy Schubert		autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
201*a466cc55SCy Schubert
2022b15cb3dSCy Schubertstd_def_list =							\
2032b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/debug-opt.def		\
2042b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/autogen-version.def		\
2052b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/copyright.def		\
2062b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/homerc.def			\
2072b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/ntp.lic			\
2082b15cb3dSCy Schubert	$(top_srcdir)/sntp/include/version.def			\
2092b15cb3dSCy Schubert	$(NULL)
2102b15cb3dSCy Schubert
2112b15cb3dSCy Schubertcheck-local: $(MAKE_CHECK_Y2K) $(CHECK_SAVECONFIG)
2122b15cb3dSCy Schubert	test -z "$(MAKE_CHECK_Y2K)" || ./$(MAKE_CHECK_Y2K)
2132b15cb3dSCy Schubert
214*a466cc55SCy Schubert# ntpd_ntpdsim_SRCS use #ifdef SIM and are included in both
215*a466cc55SCy Schubert
216*a466cc55SCy Schubertntpd_ntpdsim_SRCS =		\
2172b15cb3dSCy Schubert	ntp_config.c		\
2182b15cb3dSCy Schubert	ntp_keyword.h		\
2192b15cb3dSCy Schubert	ntp_io.c		\
2202b15cb3dSCy Schubert	ntp_parser.y		\
2212b15cb3dSCy Schubert	ntp_scanner.c		\
2222b15cb3dSCy Schubert	ntp_scanner.h		\
2232b15cb3dSCy Schubert	ntpd.c			\
2242b15cb3dSCy Schubert	ntpd-opts.c		\
2252b15cb3dSCy Schubert	ntpd-opts.h		\
2262b15cb3dSCy Schubert	$(NULL)
2272b15cb3dSCy Schubert
228*a466cc55SCy Schubertntpd_SOURCES =			\
229*a466cc55SCy Schubert	$(ntpd_ntpdsim_SRCS)	\
230*a466cc55SCy Schubert	$(NULL)
231*a466cc55SCy Schubert
232*a466cc55SCy Schubertnodist_ntpd_SOURCES =		\
233*a466cc55SCy Schubert	ntpd-version.c		\
234*a466cc55SCy Schubert	$(NULL)
235*a466cc55SCy Schubert
2362b15cb3dSCy Schubertntpdsim_SOURCES =		\
237*a466cc55SCy Schubert	$(ntpd_ntpdsim_SRCS)	\
2382b15cb3dSCy Schubert	ntp_prio_q.c		\
2392b15cb3dSCy Schubert	ntpsim.c		\
2402b15cb3dSCy Schubert	$(NULL)
2412b15cb3dSCy Schubert
242*a466cc55SCy Schubertnodist_ntpdsim_SOURCES =	\
243*a466cc55SCy Schubert	sim-version.c		\
244*a466cc55SCy Schubert	$(NULL)
245*a466cc55SCy Schubert
2462b15cb3dSCy Schubert# libntpd_a_SOURCES do not use #ifdef SIM
2472b15cb3dSCy Schubert
2482b15cb3dSCy Schubertlibntpd_a_SOURCES =		\
2492b15cb3dSCy Schubert	cmd_args.c		\
2502b15cb3dSCy Schubert	jupiter.h		\
251*a466cc55SCy Schubert	ntp_clockdev.c		\
2522b15cb3dSCy Schubert	ntp_control.c		\
2532b15cb3dSCy Schubert	ntp_crypto.c		\
2542b15cb3dSCy Schubert	ntp_filegen.c		\
2552b15cb3dSCy Schubert	ntp_leapsec.c		\
2562b15cb3dSCy Schubert	ntp_loopfilter.c	\
2572b15cb3dSCy Schubert	ntp_monitor.c		\
2582b15cb3dSCy Schubert	ntp_peer.c		\
2592b15cb3dSCy Schubert	ntp_proto.c		\
260*a466cc55SCy Schubert	ntp_ppsdev.c		\
2612b15cb3dSCy Schubert	ntp_refclock.c		\
2622b15cb3dSCy Schubert	ntp_request.c		\
2632b15cb3dSCy Schubert	ntp_restrict.c		\
2642b15cb3dSCy Schubert	ntp_signd.c		\
2652b15cb3dSCy Schubert	ntp_timer.c		\
2662b15cb3dSCy Schubert	ntp_util.c		\
267ea906c41SOllivier Robert	ppsapi_timepps.h	\
268276da39aSCy Schubert	rc_cmdlength.c		\
2692b15cb3dSCy Schubert	refclock_acts.c		\
2702b15cb3dSCy Schubert	refclock_arbiter.c	\
2712b15cb3dSCy Schubert	refclock_arc.c		\
2722b15cb3dSCy Schubert	refclock_as2201.c	\
2732b15cb3dSCy Schubert	refclock_atom.c		\
2742b15cb3dSCy Schubert	refclock_bancomm.c	\
2752b15cb3dSCy Schubert	refclock_chronolog.c	\
2762b15cb3dSCy Schubert	refclock_chu.c		\
2772b15cb3dSCy Schubert	refclock_conf.c		\
2782b15cb3dSCy Schubert	refclock_datum.c	\
2792b15cb3dSCy Schubert	refclock_dumbclock.c	\
2802b15cb3dSCy Schubert	refclock_fg.c		\
2812b15cb3dSCy Schubert	refclock_gpsdjson.c	\
2822b15cb3dSCy Schubert	refclock_gpsvme.c	\
2832b15cb3dSCy Schubert	refclock_heath.c	\
2842b15cb3dSCy Schubert	refclock_hopfser.c	\
2852b15cb3dSCy Schubert	refclock_hopfpci.c	\
2862b15cb3dSCy Schubert	refclock_hpgps.c	\
2872b15cb3dSCy Schubert	refclock_irig.c		\
2882b15cb3dSCy Schubert	refclock_jjy.c		\
2892b15cb3dSCy Schubert	refclock_jupiter.c	\
2902b15cb3dSCy Schubert	refclock_leitch.c	\
2912b15cb3dSCy Schubert	refclock_local.c	\
2922b15cb3dSCy Schubert	refclock_mx4200.c	\
2932b15cb3dSCy Schubert	refclock_neoclock4x.c	\
2942b15cb3dSCy Schubert	refclock_nmea.c		\
2952b15cb3dSCy Schubert	refclock_oncore.c	\
2962b15cb3dSCy Schubert	refclock_palisade.c	\
2972b15cb3dSCy Schubert	refclock_palisade.h	\
2982b15cb3dSCy Schubert	refclock_parse.c	\
2992b15cb3dSCy Schubert	refclock_pcf.c		\
3002b15cb3dSCy Schubert	refclock_pst.c		\
3012b15cb3dSCy Schubert	refclock_ripencc.c	\
3022b15cb3dSCy Schubert	refclock_shm.c		\
3032b15cb3dSCy Schubert	refclock_tpro.c		\
3042b15cb3dSCy Schubert	refclock_true.c		\
3052b15cb3dSCy Schubert	refclock_tt560.c	\
3062b15cb3dSCy Schubert	refclock_ulink.c	\
3072b15cb3dSCy Schubert	refclock_wwv.c		\
3082b15cb3dSCy Schubert	refclock_wwvb.c		\
3092b15cb3dSCy Schubert	refclock_zyfer.c	\
3102b15cb3dSCy Schubert	refclock_tsyncpci.c	\
3112b15cb3dSCy Schubert	$(NULL)
3122b15cb3dSCy Schubert
3132b15cb3dSCy Schubertk-g-u-submake: keyword-gen
314*a466cc55SCy Schubert	$(AM_V_at)./keyword-gen $(srcdir)/ntp_parser.h > k-g.out
315*a466cc55SCy Schubert	$(AM_V_at)grep -v diff_ignore_line < k-g.out > cmp1
316*a466cc55SCy Schubert	$(AM_V_at)grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2
317*a466cc55SCy Schubert	$(AM_V_at)cmp cmp1 cmp2 > /dev/null || \
3182b15cb3dSCy Schubert		{ mv -f k-g.out $(srcdir)/ntp_keyword.h && \
3192b15cb3dSCy Schubert		  echo 'Generated changed ntp_keyword.h.' ;}
320*a466cc55SCy Schubert	$(AM_V_at)[ ! -f k-g.out ] || \
3212b15cb3dSCy Schubert		{ rm k-g.out && echo 'ntp_keyword.h is up to date.' ;}
3222b15cb3dSCy Schubert	@rm cmp1 cmp2
3232b15cb3dSCy Schubert	@echo 'keyword-gen and ntp_keyword.h are up to date.' > $@
3242b15cb3dSCy Schubert
3252b15cb3dSCy Schubert$(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h
326*a466cc55SCy Schubert	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) k-g-u-submake	# avoid explicit dependency
327*a466cc55SCy Schubert	$(AM_V_at)grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u
328*a466cc55SCy Schubert	$(AM_V_at)mv -f k-g-u $@
3292b15cb3dSCy Schubert
3302b15cb3dSCy Schubert$(srcdir)/ntp_keyword.h: $(srcdir)/keyword-gen-utd
3312b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get
3322b15cb3dSCy Schubert	@: .h updated if needed by k-g-u-submake rule
333ea906c41SOllivier Robert
334ea906c41SOllivier Robert$(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c
3352b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get, .h built with .c
3362b15cb3dSCy Schubert
337ea906c41SOllivier Robert$(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
338*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) ntpd-opts.def
339ea906c41SOllivier Robert
3402b15cb3dSCy Schubert###
341ea906c41SOllivier Robert
3422b15cb3dSCy Schubert$(srcdir)/ntpd.1ntpdman: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
343*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def
344ea906c41SOllivier Robert
3452b15cb3dSCy Schubert$(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed
3462b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdman > $(srcdir)/ntpd.man.in+
3472b15cb3dSCy Schubert	mv $(srcdir)/ntpd.man.in+ $(srcdir)/ntpd.man.in
348ea906c41SOllivier Robert
3492b15cb3dSCy Schubert###
350ea906c41SOllivier Robert
3512b15cb3dSCy Schubert$(srcdir)/ntpd.1ntpdmdoc: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
352*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def
3532b15cb3dSCy Schubert
3542b15cb3dSCy Schubert$(srcdir)/ntpd.mdoc.in: $(srcdir)/ntpd.1ntpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
3552b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdmdoc > $(srcdir)/ntpd.mdoc.in+
3562b15cb3dSCy Schubert	mv $(srcdir)/ntpd.mdoc.in+ $(srcdir)/ntpd.mdoc.in
3572b15cb3dSCy Schubert
3582b15cb3dSCy Schubert###
3592b15cb3dSCy Schubert
3602b15cb3dSCy Schubertntpd.$(NTPD_MS): $(srcdir)/ntpd.$(MANTAGFMT).in $(top_builddir)/config.status
3612b15cb3dSCy Schubert	$(top_builddir)/config.status --file=ntpd.$(NTPD_MS)+:$(srcdir)/ntpd.$(MANTAGFMT).in
3622b15cb3dSCy Schubert	mv ntpd.$(NTPD_MS)+ ntpd.$(NTPD_MS)
3632b15cb3dSCy Schubert
3642b15cb3dSCy Schubert###
3652b15cb3dSCy Schubert
3662b15cb3dSCy Schubert$(srcdir)/invoke-ntp.conf.menu: $(srcdir)/invoke-ntp.conf.texi
3672b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get, .menu built with .texi
3682b15cb3dSCy Schubert
3692b15cb3dSCy Schubert$(srcdir)/invoke-ntp.conf.texi: $(srcdir)/ntp.conf.def $(std_def_list)
370*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def
3712b15cb3dSCy Schubert
3722b15cb3dSCy Schubert$(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi
3732b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get, .menu built with .texi
3742b15cb3dSCy Schubert
3752b15cb3dSCy Schubert$(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list)
376*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def
3772b15cb3dSCy Schubert
3782d4e511cSCy Schubert$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(srcdir)/invoke-ntp.conf.texi $(top_srcdir)/sntp/include/version.texi
3792b15cb3dSCy Schubert	cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true )
3802b15cb3dSCy Schubert
3812d4e511cSCy Schubert$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(srcdir)/invoke-ntp.keys.texi $(top_srcdir)/sntp/include/version.texi
3822b15cb3dSCy Schubert	cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.keys.html ntp.keys.texi || true )
3832b15cb3dSCy Schubert
3842d4e511cSCy Schubert$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(srcdir)/invoke-ntpd.texi $(top_srcdir)/sntp/include/version.texi
3852b15cb3dSCy Schubert	cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpd.html ntpd.texi || true )
3862b15cb3dSCy Schubert
3872b15cb3dSCy Schubert###
3882b15cb3dSCy Schubert
3892b15cb3dSCy Schubert$(srcdir)/ntp.conf.5man: $(srcdir)/ntp.conf.def $(std_def_list)
390*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def
3912b15cb3dSCy Schubert
3922b15cb3dSCy Schubert$(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed
3932b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5man > $(srcdir)/ntp.conf.man.in+
3942b15cb3dSCy Schubert	mv $(srcdir)/ntp.conf.man.in+ $(srcdir)/ntp.conf.man.in
3952b15cb3dSCy Schubert
3962b15cb3dSCy Schubert###
3972b15cb3dSCy Schubert
3982b15cb3dSCy Schubert$(srcdir)/ntp.conf.5mdoc: $(srcdir)/ntp.conf.def $(std_def_list)
399*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def
4002b15cb3dSCy Schubert
4012b15cb3dSCy Schubert$(srcdir)/ntp.conf.mdoc.in: $(srcdir)/ntp.conf.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
4022b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5mdoc > $(srcdir)/ntp.conf.mdoc.in+
4032b15cb3dSCy Schubert	mv $(srcdir)/ntp.conf.mdoc.in+ $(srcdir)/ntp.conf.mdoc.in
4042b15cb3dSCy Schubert
4052b15cb3dSCy Schubert###
4062b15cb3dSCy Schubert
4072b15cb3dSCy Schubertntp.conf.5: $(srcdir)/ntp.conf.$(MANTAGFMT).in $(top_builddir)/config.status
4082b15cb3dSCy Schubert	$(top_builddir)/config.status --file=ntp.conf.5+:$(srcdir)/ntp.conf.$(MANTAGFMT).in
4092b15cb3dSCy Schubert	mv ntp.conf.5+ ntp.conf.5
4102b15cb3dSCy Schubert
4112b15cb3dSCy Schubert###
4122b15cb3dSCy Schubert
4132b15cb3dSCy Schubert$(srcdir)/ntp.keys.5man: $(srcdir)/ntp.keys.def $(std_def_list)
414*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def
4152b15cb3dSCy Schubert
4162b15cb3dSCy Schubert$(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed
4172b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5man > $(srcdir)/ntp.keys.man.in+
4182b15cb3dSCy Schubert	mv $(srcdir)/ntp.keys.man.in+ $(srcdir)/ntp.keys.man.in
4192b15cb3dSCy Schubert
4202b15cb3dSCy Schubert###
4212b15cb3dSCy Schubert
4222b15cb3dSCy Schubert$(srcdir)/ntp.keys.5mdoc: $(srcdir)/ntp.keys.def $(std_def_list)
423*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def
4242b15cb3dSCy Schubert
4252b15cb3dSCy Schubert$(srcdir)/ntp.keys.mdoc.in: $(srcdir)/ntp.keys.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
4262b15cb3dSCy Schubert	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5mdoc > $(srcdir)/ntp.keys.mdoc.in+
4272b15cb3dSCy Schubert	mv $(srcdir)/ntp.keys.mdoc.in+ $(srcdir)/ntp.keys.mdoc.in
4282b15cb3dSCy Schubert
4292b15cb3dSCy Schubert###
4302b15cb3dSCy Schubert
4312b15cb3dSCy Schubertntp.keys.5: $(srcdir)/ntp.keys.$(MANTAGFMT).in $(top_builddir)/config.status
4322b15cb3dSCy Schubert	$(top_builddir)/config.status --file=ntp.keys.5+:$(srcdir)/ntp.keys.$(MANTAGFMT).in
4332b15cb3dSCy Schubert	mv ntp.keys.5+ ntp.keys.5
4342b15cb3dSCy Schubert
4352b15cb3dSCy Schubert###
4362b15cb3dSCy Schubert
4372b15cb3dSCy Schubert$(srcdir)/invoke-ntpd.menu: $(srcdir)/invoke-ntpd.texi
4382b15cb3dSCy Schubert	@: do-nothing action to avoid default SCCS get, .menu built with .texi
4392b15cb3dSCy Schubert
4402b15cb3dSCy Schubert$(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
441*a466cc55SCy Schubert	$(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def
4422b15cb3dSCy Schubert	$(top_srcdir)/scripts/build/check--help $@
443c0b746e5SOllivier Robert
4442b15cb3dSCy Schubertcheck-saveconfig: complete.conf compsave.conf
4452b15cb3dSCy Schubert	-diff -u complete.conf compsave.conf
4462b15cb3dSCy Schubert	cmp complete.conf compsave.conf && echo stamp > $@
447ea906c41SOllivier Robert
4482d4e511cSCy Schubertcompsave.conf: ntpd complete.conf
4492d4e511cSCy Schubert	./ntpd --configfile complete.conf --saveconfigquit $@+
4502d4e511cSCy Schubert	grep -v '^#' $@+ > $@
4512d4e511cSCy Schubert
4522d4e511cSCy Schubertcheck-pslsaveconfig: check-psl0 check-psl1 check-psl2
4532d4e511cSCy Schubert	echo stamp > $@
4542d4e511cSCy Schubert
4552d4e511cSCy Schubertcheck-psl0: psl0.conf psl0save.conf
456*a466cc55SCy Schubert	-diff -u $(srcdir)/psl0.conf psl0save.conf
457*a466cc55SCy Schubert	cmp $(srcdir)/psl0.conf psl0save.conf && echo stamp > $@
4582d4e511cSCy Schubert
4592d4e511cSCy Schubertpsl0save.conf: psl0.conf ntpd
460*a466cc55SCy Schubert	./ntpd --configfile $(srcdir)/psl0.conf --saveconfigquit $@+
4612d4e511cSCy Schubert	grep -v '^#' $@+ > $@
4622d4e511cSCy Schubert
4632d4e511cSCy Schubertcheck-psl1: psl1.conf psl1save.conf
464*a466cc55SCy Schubert	-diff -u $(srcdir)/psl1.conf psl1save.conf
465*a466cc55SCy Schubert	cmp $(srcdir)/psl1.conf psl1save.conf && echo stamp > $@
4662d4e511cSCy Schubert
4672d4e511cSCy Schubertpsl1save.conf: psl1.conf ntpd
468*a466cc55SCy Schubert	./ntpd --configfile $(srcdir)/psl1.conf --saveconfigquit $@+
4692d4e511cSCy Schubert	grep -v '^#' $@+ > $@
4702d4e511cSCy Schubert
4712d4e511cSCy Schubertcheck-psl2: psl2.conf psl2save.conf
472*a466cc55SCy Schubert	-diff -u $(srcdir)/psl2.conf psl2save.conf
473*a466cc55SCy Schubert	cmp $(srcdir)/psl2.conf psl2save.conf && echo stamp > $@
4742d4e511cSCy Schubert
4752d4e511cSCy Schubertpsl2save.conf: psl2.conf ntpd
476*a466cc55SCy Schubert	./ntpd --configfile $(srcdir)/psl2.conf --saveconfigquit $@+
4772d4e511cSCy Schubert	grep -v '^#' $@+ > $@
4782d4e511cSCy Schubert
479ea906c41SOllivier Robert../libntp/libntpsim.a:
4802b15cb3dSCy Schubert	cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntpsim.a
481c0b746e5SOllivier Robert
482c0b746e5SOllivier Robert../libparse/libparse.a:
4832b15cb3dSCy Schubert	cd ../libparse && $(MAKE) $(AM_MAKEFLAGS) check-libparse
484c0b746e5SOllivier Robert
485*a466cc55SCy Schubertntpd-version.c: Makefile $(top_srcdir)/sntp/scm-rev
486*a466cc55SCy Schubert	$(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd
487*a466cc55SCy Schubert	$(AM_V_at)mv -f version.c $@
488ea906c41SOllivier Robert
489*a466cc55SCy Schubertsim-version.c: Makefile $(top_srcdir)/sntp/scm-rev
490*a466cc55SCy Schubert	$(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdsim
491*a466cc55SCy Schubert	$(AM_V_at)@mv -f version.c $@
4922b15cb3dSCy Schubert
4939034852cSGleb Smirnoff$(srcdir)/Makefile.am:
4949034852cSGleb Smirnoff	@: do-nothing
4959034852cSGleb Smirnoff
4962b15cb3dSCy Schubertinclude $(top_srcdir)/bincheck.mf
4972b15cb3dSCy Schubertinclude $(top_srcdir)/check-libopts.mf
498*a466cc55SCy Schubertinclude $(top_srcdir)/check-libntp.mf
499*a466cc55SCy Schubertinclude $(top_srcdir)/check-scm-rev.mf
5002b15cb3dSCy Schubertinclude $(top_srcdir)/depsver.mf
5012b15cb3dSCy Schubertinclude $(top_srcdir)/includes.mf
502