aboutsummaryrefslogtreecommitdiff
path: root/sntp/Makefile.am
blob: a19d77b27f6dcfa4180e09a76a1797f32e96cf15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# Makefile.am for JMK's SNTP, by Harlan Stenn

NULL =

## LIBOPTS_CHECK_NOBUILD works with Automake 1.10 now
AUTOMAKE_OPTIONS = foreign 1.10
ACLOCAL_AMFLAGS = -I ../m4 -I libopts/m4

AM_CPPFLAGS = $(LIBOPTS_CFLAGS) -I$(top_srcdir)/../include \
	-I$(top_srcdir)/../lib/isc/include \
	-I$(top_srcdir)/../lib/isc/nothreads/include \
	-I$(top_srcdir)/../lib/isc/unix/include

LDADD =	$(LIBOPTS_LDADD) $(LIBM) ../libntp/libntp.a @LCRYPTO@

run_ag =	cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)"	\
		autogen -L ../include --writable

if NTP_BINSUBDIR_IS_BIN
bin_PROGRAMS =	sntp
else
sbin_PROGRAMS =	sntp
endif

CLEANFILES = check-COPYRIGHT-submake

SUBDIRS =
if NEED_LIBOPTS
SUBDIRS += libopts
endif

sntp_SOURCES =		\
	crypto.c	\
	crypto.h	\
	data_formats.h	\
	header.h	\
	kod_management.c \
	kod_management.h \
	log.c		\
	log.h		\
	main.c		\
	main.h		\
	networking.c	\
	networking.h	\
	sntp.c		\
	sntp-opts.c	\
	sntp-opts.h	\
	utilities.c	\
	utilities.h	\
	$(NULL)

EXTRA_DIST =				\
	$(srcdir)/autogen-version.def	\
	bincheck.mf			\
	$(srcdir)/COPYRIGHT		\
	deps-ver			\
	depsver.mf			\
	sntp-opts.def			\
	sntp-opts.menu			\
	sntp-opts.texi			\
	sntp.1				\
	sntp.html			\
	sntp.texi			\
	$(srcdir)/version.def		\
	$(srcdir)/version.m4		\
	$(srcdir)/version.texi		\
	$(NULL)

OLD_EXTRA_DIST=		\
		autogen-version.def version.def version.m4 version.texi

BUILT_SOURCES=				\
	check-autogen-version.def	\
	check-version.def		\
	check-version.m4		\
	check-version.texi		\
	$(srcdir)/COPYRIGHT		\
	libtool				\
	$(srcdir)/sntp-opts.c		\
	$(srcdir)/sntp-opts.h		\
	$(NULL)

man_MANS=	$(srcdir)/sntp.1

# HMS: Real Soon Now...
#info_TEXINFOS=	sntp.texi
#sntp_TEXINFOS=	sntp-opts.texi

noinst_DATA=				\
	$(srcdir)/sntp.html		\
	$(srcdir)/sntp-opts.texi	\
	$(srcdir)/sntp-opts.menu	\
	$(NULL)

FRC:
	@: do-nothing action to prevent default SCCS get
	@: FRC "force" depends on nothing and is not a file, so is
	@: always out-of-date causing targets which depend on it to
	@: similarly always be outdated causing their rules to fire
	@: each time they or a dependent is built.

check-autogen-version.def: FRC
	@cd $(srcdir)							\
	&& test -r ../include/autogen-version.def			\
	&& ( if cmp -s ../include/autogen-version.def autogen-version.def; \
	   then : ;							\
	   else cp ../include/autogen-version.def autogen-version.def;	 \
		echo "Installing new sntp/autogen-version.def file";	\
	   fi )

$(srcdir)/autogen-version.def:
	$(MAKE) check-autogen-version.def

check-version.def: FRC
	@cd $(srcdir)					\
	&& test -r ../include/version.def		\
	&& ( if cmp -s ../include/version.def version.def;	\
	   then : ;						\
	   else cp ../include/version.def version.def;		\
		echo "Installing new sntp/version.def file";	\
	   fi )

$(srcdir)/version.def:
	$(MAKE) check-version.def

check-version.m4: FRC
	@cd $(srcdir)					\
	&& test -r ../version.m4			\
	&& ( if cmp -s ../version.m4 version.m4;	\
	   then : ;					\
	   else cp ../version.m4 version.m4;		\
		echo "Installing new sntp/version.m4 file";	\
	   fi )

$(srcdir)/version.m4:
	$(MAKE) check-version.m4

check-version.texi: FRC
	@cd $(srcdir)					\
	&& test -r ../include/version.texi			\
	&& ( if cmp -s ../include/version.texi version.texi;	\
	   then : ;					\
	   else cp ../include/version.texi version.texi;	\
		echo "Installing new sntp/version.texi file";	\
	   fi )

$(srcdir)/version.texi:
	$(MAKE) check-version.texi

$(srcdir)/../COPYRIGHT:
	cd .. && $(MAKE) COPYRIGHT-please

check-COPYRIGHT-submake: $(srcdir)/../COPYRIGHT
	@cmp -s $(srcdir)/../COPYRIGHT $(srcdir)/COPYRIGHT	\
	 || { cp $(srcdir)/../COPYRIGHT $(srcdir)		\
	      && echo 'updated sntp/COPYRIGHT installed' ;}
	@echo 'submake avoided if this file is newer than parent COPYRIGHT' > $@

check-COPYRIGHT: FRC
	[ ! -r $(srcdir)/../COPYRIGHT ]					\
	|| [ check-COPYRIGHT-submake -nt $(srcdir)/../COPYRIGHT ]	\
	|| $(MAKE) check-COPYRIGHT-submake

$(srcdir)/COPYRIGHT: check-COPYRIGHT
	@: do-nothing action to prevent any default

$(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c
	@: do-nothing action to avoid default SCCS get, .h built with .c
	
$(srcdir)/sntp-opts.c: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def
	$(run_ag) sntp-opts.def

$(srcdir)/sntp.1: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def
	$(run_ag) -Tagman1.tpl -bsntp sntp-opts.def

$(srcdir)/sntp-opts.menu: $(srcdir)/sntp-opts.texi
	@: do-nothing action to avoid default SCCS get, .menu built with .texi
	
$(srcdir)/sntp-opts.texi: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def
	$(run_ag) -Taginfo.tpl -DLEVEL=section sntp-opts.def
	$(top_srcdir)/../scripts/check--help $@

$(srcdir)/sntp.html: $(srcdir)/sntp-opts.menu $(srcdir)/sntp-opts.texi $(srcdir)/sntp.texi $(srcdir)/version.texi
	cd $(srcdir) && ( makeinfo --force --html --no-split -o sntp.html sntp.texi || true )

../libntp/libntp.a:
	cd ../libntp && $(MAKE) libntp.a

libtool: $(LIBTOOL_DEPS)
	./config.status --recheck

include $(top_srcdir)/bincheck.mf
include $(top_srcdir)/depsver.mf