Makefile.am revision 290001
1NULL =
2BUILT_SOURCES =
3CLEANFILES =
4
5std_unity_list =						\
6	$(top_srcdir)/sntp/unity/auto/generate_test_runner.rb	\
7	$(NULL)
8
9run_unity =	cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
10
11check_PROGRAMS =		\
12	test-leapsec		\
13	test-ntp_prio_q		\
14	$(NULL)
15if BUILD_TEST_NTP_RESTRICT
16check_PROGRAMS += test-ntp_restrict
17endif
18if BUILD_TEST_NTP_SCANNER
19check_PROGRAMS += test-ntp_scanner
20endif
21if BUILD_TEST_NTP_SIGND
22check_PROGRAMS += test-ntp_signd
23endif
24check_PROGRAMS += 		\
25	test-rc_cmdlength	\
26	$(NULL)
27
28EXTRA_PROGRAMS =		\
29	test-ntp_restrict	\
30	test-ntp_scanner	\
31	test-ntp_signd		\
32	$(NULL)
33
34
35LDADD =					\
36	$(top_builddir)/ntpd/libntpd.a	\
37	$(top_builddir)/libntp/libntp.a	\
38	$(LDADD_LIBNTP)			\
39	$(PTHREAD_LIBS)			\
40	$(LDADD_NTP)			\
41	$(NULL)
42
43unity_tests_LDADD =				\
44	$(LDADD)				\
45	$(top_builddir)/sntp/unity/libunity.a	\
46	$(LIBM)					\
47	$(NULL)
48
49AM_CFLAGS   = $(CFLAGS_NTP)
50
51AM_CPPFLAGS  = $(NTP_INCS)
52AM_CPPFLAGS += -I$(top_srcdir)/sntp
53AM_CPPFLAGS += -I$(top_srcdir)/ntpd
54AM_CPPFLAGS += -I$(top_srcdir)/tests/libntp
55AM_CPPFLAGS += $(CPPFLAGS_NTP)
56AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
57AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
58
59AM_LDFLAGS = $(LDFLAGS_NTP)
60
61BUILT_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
71test_leapsec_CFLAGS =			\
72	-I$(top_srcdir)/sntp/unity	\
73	$(NULL)
74
75# Might need pthread support
76test_leapsec_LDADD =			\
77	$(unity_tests_LDADD)		\
78	$(NULL)
79
80test_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###
90test_ntp_prio_q_CFLAGS =		\
91	-I$(top_srcdir)/sntp/unity	\
92	$(NULL)
93
94test_ntp_prio_q_LDADD =			\
95	$(unity_tests_LDADD)		\
96	../../ntpd/ntpdsim-ntp_prio_q.o	\
97	$(NULL)
98
99test_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###
110test_ntp_restrict_CFLAGS =		\
111	-I$(top_srcdir)/sntp/unity	\
112	$(NULL)
113
114test_ntp_restrict_LDADD =		\
115	$(unity_tests_LDADD)		\
116	$(NULL)
117
118test_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###
130test_rc_cmdlength_CFLAGS =		\
131	-I$(top_srcdir)/sntp/unity	\
132	$(NULL)
133
134test_rc_cmdlength_LDADD =		\
135	$(unity_tests_LDADD)		\
136	$(NULL)
137
138test_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
149test_ntp_signd_LDADD =			\
150	$(unity_tests_LDADD)		\
151	$(top_builddir)/ntpd/ntp_config.o	\
152	$(top_builddir)/ntpd/ntp_io.o	\
153	$(NULL)
154
155test_ntp_signd_SOURCES =			\
156	t-ntp_signd.c				\
157	run-t-ntp_signd.c			\
158	$(srcdir)/../libntp/test-libntp.c	\
159	$(srcdir)/../../ntpd/ntp_signd.c	\
160	$(NULL)
161
162$(srcdir)/run-t-ntp_signd.c: $(srcdir)/t-ntp_signd.c $(std_unity_list)
163	$(run_unity) t-ntp_signd.c run-t-ntp_signd.c
164
165###
166test_ntp_scanner_CFLAGS =		\
167	-I$(top_srcdir)/sntp/unity	\
168	$(NULL)
169
170test_ntp_scanner_LDADD =		\
171	$(unity_tests_LDADD)		\
172	$(top_builddir)/ntpd/ntp_config.o	\
173	$(top_builddir)/ntpd/ntp_parser.o	\
174	$(NULL)
175
176test_ntp_scanner_SOURCES =			\
177	t-ntp_scanner.c				\
178	run-t-ntp_scanner.c			\
179	$(srcdir)/../libntp/test-libntp.c	\
180	$(NULL)
181
182$(srcdir)/run-t-ntp_scanner.c: $(srcdir)/t-ntp_scanner.c $(std_unity_list)
183	$(run_unity) t-ntp_scanner.c run-t-ntp_scanner.c
184
185
186TESTS =
187
188if !NTP_CROSSCOMPILE
189TESTS += $(check_PROGRAMS)
190endif
191
192## check-libntp.mf - automake fragment
193## slightly adapted for deeper directory
194
195BUILT_SOURCES	+= check-libntpd check-libntp check-libunity
196CLEANFILES	+= check-libntpd check-libntp check-libunity
197
198check-libntpd: ../../ntpd/libntpd.a
199	@echo stamp > $@
200
201../../ntpd/libntpd.a:
202	cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a
203
204
205check-libntp: ../../libntp/libntp.a
206	@echo stamp > $@
207
208../../libntp/libntp.a:
209	cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
210
211
212check-libunity: ../../sntp/unity/libunity.a
213	@echo stamp > $@
214
215../../sntp/unity/libunity.a:
216	cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
217
218$(top_builddir)/ntpd/ntpdsim-ntp_prio_q.o:
219	cd ../../ntpd/ && $(MAKE) $(AM_MAKEFLAGS) ntpdsim-ntp_prio_q.o
220
221include $(top_srcdir)/depsver.mf
222include $(top_srcdir)/includes.mf
223