1# Makefile.am for JMK's SNTP, by Harlan Stenn 2 3NULL = 4 5## LIBOPTS_CHECK_NOBUILD works with Automake 1.10 now 6AUTOMAKE_OPTIONS = foreign 1.10 7ACLOCAL_AMFLAGS = -I ../m4 -I libopts/m4 8 9AM_CPPFLAGS = $(LIBOPTS_CFLAGS) -I$(top_srcdir)/../include \ 10 -I$(top_srcdir)/../lib/isc/include \ 11 -I$(top_srcdir)/../lib/isc/nothreads/include \ 12 -I$(top_srcdir)/../lib/isc/unix/include 13 14LDADD = $(LIBOPTS_LDADD) $(LIBM) ../libntp/libntp.a @LCRYPTO@ 15 16run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ 17 autogen -L ../include --writable 18 19if NTP_BINSUBDIR_IS_BIN 20bin_PROGRAMS = sntp 21else 22sbin_PROGRAMS = sntp 23endif 24 25CLEANFILES = check-COPYRIGHT-submake 26 27SUBDIRS = 28if NEED_LIBOPTS 29SUBDIRS += libopts 30endif 31 32sntp_SOURCES = \ 33 crypto.c \ 34 crypto.h \ 35 data_formats.h \ 36 header.h \ 37 kod_management.c \ 38 kod_management.h \ 39 log.c \ 40 log.h \ 41 main.c \ 42 main.h \ 43 networking.c \ 44 networking.h \ 45 sntp.c \ 46 sntp-opts.c \ 47 sntp-opts.h \ 48 utilities.c \ 49 utilities.h \ 50 $(NULL) 51 52EXTRA_DIST = \ 53 $(srcdir)/autogen-version.def \ 54 bincheck.mf \ 55 $(srcdir)/COPYRIGHT \ 56 deps-ver \ 57 depsver.mf \ 58 sntp-opts.def \ 59 sntp-opts.menu \ 60 sntp-opts.texi \ 61 sntp.1 \ 62 sntp.html \ 63 sntp.texi \ 64 $(srcdir)/version.def \ 65 $(srcdir)/version.m4 \ 66 $(srcdir)/version.texi \ 67 $(NULL) 68 69OLD_EXTRA_DIST= \ 70 autogen-version.def version.def version.m4 version.texi 71 72BUILT_SOURCES= \ 73 check-autogen-version.def \ 74 check-version.def \ 75 check-version.m4 \ 76 check-version.texi \ 77 $(srcdir)/COPYRIGHT \ 78 libtool \ 79 $(srcdir)/sntp-opts.c \ 80 $(srcdir)/sntp-opts.h \ 81 $(NULL) 82 83man_MANS= $(srcdir)/sntp.1 84 85# HMS: Real Soon Now... 86#info_TEXINFOS= sntp.texi 87#sntp_TEXINFOS= sntp-opts.texi 88 89noinst_DATA= \ 90 $(srcdir)/sntp.html \ 91 $(srcdir)/sntp-opts.texi \ 92 $(srcdir)/sntp-opts.menu \ 93 $(NULL) 94 95FRC: 96 @: do-nothing action to prevent default SCCS get 97 @: FRC "force" depends on nothing and is not a file, so is 98 @: always out-of-date causing targets which depend on it to 99 @: similarly always be outdated causing their rules to fire 100 @: each time they or a dependent is built. 101 102check-autogen-version.def: FRC 103 @cd $(srcdir) \ 104 && test -r ../include/autogen-version.def \ 105 && ( if cmp -s ../include/autogen-version.def autogen-version.def; \ 106 then : ; \ 107 else cp ../include/autogen-version.def autogen-version.def; \ 108 echo "Installing new sntp/autogen-version.def file"; \ 109 fi ) 110 111$(srcdir)/autogen-version.def: 112 $(MAKE) check-autogen-version.def 113 114check-version.def: FRC 115 @cd $(srcdir) \ 116 && test -r ../include/version.def \ 117 && ( if cmp -s ../include/version.def version.def; \ 118 then : ; \ 119 else cp ../include/version.def version.def; \ 120 echo "Installing new sntp/version.def file"; \ 121 fi ) 122 123$(srcdir)/version.def: 124 $(MAKE) check-version.def 125 126check-version.m4: FRC 127 @cd $(srcdir) \ 128 && test -r ../version.m4 \ 129 && ( if cmp -s ../version.m4 version.m4; \ 130 then : ; \ 131 else cp ../version.m4 version.m4; \ 132 echo "Installing new sntp/version.m4 file"; \ 133 fi ) 134 135$(srcdir)/version.m4: 136 $(MAKE) check-version.m4 137 138check-version.texi: FRC 139 @cd $(srcdir) \ 140 && test -r ../include/version.texi \ 141 && ( if cmp -s ../include/version.texi version.texi; \ 142 then : ; \ 143 else cp ../include/version.texi version.texi; \ 144 echo "Installing new sntp/version.texi file"; \ 145 fi ) 146 147$(srcdir)/version.texi: 148 $(MAKE) check-version.texi 149 150$(srcdir)/../COPYRIGHT: 151 cd .. && $(MAKE) COPYRIGHT-please 152 153check-COPYRIGHT-submake: $(srcdir)/../COPYRIGHT 154 @cmp -s $(srcdir)/../COPYRIGHT $(srcdir)/COPYRIGHT \ 155 || { cp $(srcdir)/../COPYRIGHT $(srcdir) \ 156 && echo 'updated sntp/COPYRIGHT installed' ;} 157 @echo 'submake avoided if this file is newer than parent COPYRIGHT' > $@ 158 159check-COPYRIGHT: FRC 160 [ ! -r $(srcdir)/../COPYRIGHT ] \ 161 || [ check-COPYRIGHT-submake -nt $(srcdir)/../COPYRIGHT ] \ 162 || $(MAKE) check-COPYRIGHT-submake 163 164$(srcdir)/COPYRIGHT: check-COPYRIGHT 165 @: do-nothing action to prevent any default 166 167$(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c 168 @: do-nothing action to avoid default SCCS get, .h built with .c 169 170$(srcdir)/sntp-opts.c: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def 171 $(run_ag) sntp-opts.def 172 173$(srcdir)/sntp.1: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def 174 $(run_ag) -Tagman1.tpl -bsntp sntp-opts.def 175 176$(srcdir)/sntp-opts.menu: $(srcdir)/sntp-opts.texi 177 @: do-nothing action to avoid default SCCS get, .menu built with .texi 178 179$(srcdir)/sntp-opts.texi: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def 180 $(run_ag) -Taginfo.tpl -DLEVEL=section sntp-opts.def 181 $(top_srcdir)/../scripts/check--help $@ 182 183$(srcdir)/sntp.html: $(srcdir)/sntp-opts.menu $(srcdir)/sntp-opts.texi $(srcdir)/sntp.texi $(srcdir)/version.texi 184 cd $(srcdir) && ( makeinfo --force --html --no-split -o sntp.html sntp.texi || true ) 185 186../libntp/libntp.a: 187 cd ../libntp && $(MAKE) libntp.a 188 189libtool: $(LIBTOOL_DEPS) 190 ./config.status --recheck 191 192include $(top_srcdir)/bincheck.mf 193include $(top_srcdir)/depsver.mf 194