Makefile.am revision 310419
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 $(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### 165test_ntp_scanner_CFLAGS = \ 166 -I$(top_srcdir)/sntp/unity \ 167 $(NULL) 168 169test_ntp_scanner_LDADD = \ 170 $(unity_tests_LDADD) \ 171 $(top_builddir)/ntpd/ntp_config.o \ 172 $(top_builddir)/ntpd/ntp_parser.o \ 173 $(NULL) 174 175test_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 185TESTS = 186 187if !NTP_CROSSCOMPILE 188TESTS += $(check_PROGRAMS) 189endif 190 191## check-libntp.mf - automake fragment 192## slightly adapted for deeper directory 193 194BUILT_SOURCES += check-libntpd check-libntp check-libunity 195CLEANFILES += check-libntpd check-libntp check-libunity 196 197check-libntpd: ../../ntpd/libntpd.a 198 @echo stamp > $@ 199 200../../ntpd/libntpd.a: 201 cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a 202 203 204check-libntp: ../../libntp/libntp.a 205 @echo stamp > $@ 206 207../../libntp/libntp.a: 208 cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a 209 210 211check-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 220include $(top_srcdir)/depsver.mf 221include $(top_srcdir)/includes.mf 222