1NULL =
2BUILT_SOURCES =
3CLEANFILES =
4DISTCLEANFILES =
5
6std_unity_list =                                                                \
7          $(abs_top_srcdir)/sntp/unity/auto/generate_test_runner.rb   \
8          $(abs_srcdir)/testconf.yml                                            \
9          $(NULL)
10
11run_unity =         ruby $(std_unity_list)
12
13EXTRA_DIST =                                      \
14          testconf.yml                            \
15          $(NULL)
16
17check_PROGRAMS =              \
18          test-leapsec                  \
19          test-ntp_prio_q               \
20          $(NULL)
21if BUILD_TEST_NTP_RESTRICT
22check_PROGRAMS += test-ntp_restrict
23endif
24if BUILD_TEST_NTP_SCANNER
25check_PROGRAMS += test-ntp_scanner
26endif
27if BUILD_TEST_NTP_SIGND
28check_PROGRAMS += test-ntp_signd
29endif
30check_PROGRAMS +=             \
31          test-rc_cmdlength   \
32          $(NULL)
33
34EXTRA_PROGRAMS =              \
35          test-ntp_restrict   \
36          test-ntp_scanner    \
37          test-ntp_signd                \
38          $(NULL)
39
40
41LDADD =                                           \
42          $(top_builddir)/ntpd/libntpd.a          \
43          $(top_builddir)/libntp/libntp.a         \
44          $(LDADD_LIBNTP)                         \
45          $(PTHREAD_LIBS)                         \
46          $(LDADD_NTP)                            \
47          $(NULL)
48
49unity_tests_LDADD =                               \
50          $(LDADD)                                \
51          $(top_builddir)/sntp/unity/libunity.a   \
52          $(LIBM)                                           \
53          $(NULL)
54
55AM_CFLAGS   = $(CFLAGS_NTP)
56AM_CFLAGS += $(NTP_HARD_CFLAGS)
57
58AM_CPPFLAGS  = $(NTP_INCS)
59AM_CPPFLAGS += -I$(top_srcdir)/sntp
60AM_CPPFLAGS += -I$(top_srcdir)/ntpd
61AM_CPPFLAGS += -I$(top_srcdir)/tests/libntp
62AM_CPPFLAGS += $(CPPFLAGS_NTP)
63AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
64AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
65AM_CPPFLAGS += $(NTP_HARD_CPPFLAGS)
66
67AM_LDFLAGS  = $(LDFLAGS_NTP)
68AM_LDFLAGS += $(NTP_HARD_LDFLAGS)
69
70BUILT_SOURCES +=                        \
71          $(srcdir)/run-leapsec.c                 \
72          $(srcdir)/run-ntp_prio_q.c    \
73          $(srcdir)/run-ntp_restrict.c  \
74          $(srcdir)/run-rc_cmdlength.c  \
75          $(srcdir)/run-t-ntp_signd.c   \
76          $(NULL)
77
78###
79
80test_leapsec_CFLAGS =                             \
81          $(AM_CFLAGS)                            \
82          -I$(top_srcdir)/sntp/unity    \
83          $(NULL)
84
85# Might need pthread support
86test_leapsec_LDADD =                              \
87          $(unity_tests_LDADD)                    \
88          $(NULL)
89
90test_leapsec_SOURCES =                            \
91          leapsec.c                     \
92          run-leapsec.c                           \
93          test-libntp.c                           \
94          $(NULL)
95
96$(srcdir)/run-leapsec.c: $(srcdir)/leapsec.c $(std_unity_list)
97          $(run_unity) $< $@
98
99###
100test_ntp_prio_q_CFLAGS =                \
101          $(AM_CFLAGS)                            \
102          -I$(top_srcdir)/sntp/unity    \
103          $(NULL)
104
105test_ntp_prio_q_LDADD =                           \
106          $(unity_tests_LDADD)                    \
107          ../../ntpd/ntpdsim-ntp_prio_q.o         \
108          $(NULL)
109
110test_ntp_prio_q_SOURCES =                         \
111          ntp_prio_q.c                                      \
112          run-ntp_prio_q.c                        \
113          test-libntp.c                                     \
114          $(NULL)
115
116$(srcdir)/run-ntp_prio_q.c: $(srcdir)/ntp_prio_q.c $(std_unity_list)
117          $(run_unity) $< $@
118
119../../ntpd/ntpdsim-ntp_prio_q.o:
120          cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) ntpdsim-ntp_prio_q.o
121
122###
123test_ntp_restrict_CFLAGS =              \
124          $(AM_CFLAGS)                            \
125          -I$(top_srcdir)/sntp/unity    \
126          $(NULL)
127
128test_ntp_restrict_LDADD =               \
129          $(unity_tests_LDADD)                    \
130          $(NULL)
131
132test_ntp_restrict_SOURCES =             \
133          ntp_restrict.c                          \
134          run-ntp_restrict.c            \
135          test-libntp.c                           \
136          $(NULL)
137
138$(srcdir)/run-ntp_restrict.c: $(srcdir)/ntp_restrict.c $(std_unity_list)
139          $(run_unity) $< $@
140
141
142
143###
144test_rc_cmdlength_CFLAGS =              \
145          $(AM_CFLAGS)                            \
146          -I$(top_srcdir)/sntp/unity    \
147          $(NULL)
148
149test_rc_cmdlength_LDADD =               \
150          $(unity_tests_LDADD)                    \
151          $(NULL)
152
153test_rc_cmdlength_SOURCES =             \
154          rc_cmdlength.c                          \
155          run-rc_cmdlength.c            \
156          test-libntp.c                           \
157          $(NULL)
158
159$(srcdir)/run-rc_cmdlength.c: $(srcdir)/rc_cmdlength.c $(std_unity_list)
160          $(run_unity) $< $@
161
162###
163
164test_ntp_signd_LDADD =                            \
165          $(unity_tests_LDADD)                    \
166          $(top_builddir)/ntpd/ntp_config.o       \
167          $(top_builddir)/ntpd/ntp_io.o \
168          $(NULL)
169
170test_ntp_signd_SOURCES =                          \
171          t-ntp_signd.c                                     \
172          run-t-ntp_signd.c                       \
173          test-libntp.c       \
174          $(NULL)
175
176$(srcdir)/run-t-ntp_signd.c: $(srcdir)/t-ntp_signd.c $(std_unity_list)
177          $(run_unity) $< $@
178
179###
180test_ntp_scanner_CFLAGS =               \
181          $(AM_CFLAGS)                            \
182          -I$(top_srcdir)/sntp/unity    \
183          $(NULL)
184
185test_ntp_scanner_LDADD =                \
186          $(unity_tests_LDADD)                    \
187          $(top_builddir)/ntpd/ntp_config.o       \
188          $(top_builddir)/ntpd/ntp_io.o           \
189          $(top_builddir)/ntpd/ntp_parser.o       \
190          $(NULL)
191
192test_ntp_scanner_SOURCES =                        \
193          t-ntp_scanner.c                                   \
194          run-t-ntp_scanner.c                     \
195          test-libntp.c                                     \
196          $(NULL)
197
198$(srcdir)/run-t-ntp_scanner.c: $(srcdir)/t-ntp_scanner.c $(std_unity_list)
199          $(run_unity) $< $@
200
201
202TESTS =
203
204if !NTP_CROSSCOMPILE
205TESTS += $(check_PROGRAMS)
206endif
207
208include $(top_srcdir)/check-libntp.mf
209include $(top_srcdir)/check-libntpd.mf
210include $(top_srcdir)/check-libunity.mf
211include $(top_srcdir)/depsver.mf
212include $(top_srcdir)/includes.mf
213