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