1 ########################################################################
3 # Copyright (c) 2009, Secure Endpoints Inc.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # - Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
13 # - Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
34 !include ../../windows/NTMakefile.w32
43 $(OBJ)\dlfcn_w32.obj \
47 $(OBJ)\environment.obj \
57 $(OBJ)\getaddrinfo_hostspec.obj \
58 $(OBJ)\get_default_username.obj \
59 $(OBJ)\get_window_size.obj \
61 $(OBJ)\getifaddrs_w32.obj \
62 $(OBJ)\getnameinfo_verified.obj \
64 $(OBJ)\getprogname.obj \
65 $(OBJ)\gettimeofday.obj \
67 $(OBJ)\hostent_find_fqdn.obj \
68 $(OBJ)\inet_aton.obj \
70 $(OBJ)\localtime_r.obj \
72 $(OBJ)\mini_inetd.obj \
75 $(OBJ)\net_write.obj \
76 $(OBJ)\parse_bytes.obj \
77 $(OBJ)\parse_time.obj \
78 $(OBJ)\parse_units.obj \
83 $(OBJ)\roken_gethostby.obj \
87 $(OBJ)\setprogname.obj \
88 $(OBJ)\simple_exec_w32.obj \
92 $(OBJ)\sockstartup_w32.obj \
93 $(OBJ)\strcollect.obj \
94 $(OBJ)\strerror_r.obj \
100 $(OBJ)\strsep_copy.obj \
101 $(OBJ)\strtok_r.obj \
118 !if $(NMAKE_WINVER) < 0x0600
119 libroken_la_OBJS=$(libroken_la_OBJS) \
120 $(OBJ)\inet_ntop.obj \
125 $(C2OBJ_P) -DBUILD_ROKEN_LIB
127 $(LIBROKEN): $(libroken_la_OBJS)
128 $(LIBCON_C) -out:$@ @<<
133 $(OBJ)\make-roken.exe: $(OBJ)\make-roken.obj
136 $(OBJ)\make-roken.c: roken.h.in roken.awk $(INCDIR)\config.h
137 $(AWK) -f roken.awk roken.h.in > $(OBJ)\make-roken.c || $(RM) $(OBJ)\make-roken.c
139 $(INCDIR)\roken.h: $(OBJ)\make-roken.exe
140 $(OBJ)\make-roken.exe > $@ || $(RM) $@
147 $(INCDIR)\fnmatch.h \
151 $(INCDIR)\ifaddrs.h \
152 $(INCDIR)\parse_bytes.h \
153 $(INCDIR)\parse_time.h \
154 $(INCDIR)\parse_units.h \
155 $(INCDIR)\resolve.h \
157 $(INCDIR)\roken-common.h \
160 $(INCDIR)\stdbool.h \
168 all:: $(INCFILES) $(LIBROKEN)
173 TMP_PROGS = $(OBJ)\snprintf-test.exe $(OBJ)\resolve-test.exe
178 $(OBJ)\base64-test.exe \
179 $(OBJ)\getaddrinfo-test.exe \
180 $(OBJ)\getifaddrs-test.exe \
181 $(OBJ)\hex-test.exe \
182 $(OBJ)\test-readenv.exe \
183 $(OBJ)\parse_bytes-test.exe \
184 $(OBJ)\parse_reply-test.exe \
185 $(OBJ)\parse_time-test.exe \
186 $(OBJ)\snprintf-test.exe \
187 $(OBJ)\strpftime-test.exe \
188 $(OBJ)\dirent-test.exe \
189 $(OBJ)\test-mini_inetd.exe
191 $(OBJ)\strftime_test.obj: strftime.c
192 $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
194 $(OBJ)\strptime_test.obj: strptime.c
195 $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
197 $(OBJ)\snprintf_test.obj: snprintf.c
198 $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
200 $(OBJ)\libtest.lib: $(OBJ)\strftime_test.obj $(OBJ)\strptime_test.obj $(OBJ)\snprintf_test.obj
203 $(OBJ)\parse_reply-test.obj: parse_reply-test.c
204 $(C2OBJ) -DTEST_RESOLVE -DBUILD_ROKEN_LIB
206 $(OBJ)\resolve_test.obj: resolve.c
207 $(C2OBJ) -DTEST_RESOLVE -DBUILD_ROKEN_LIB
209 $(OBJ)\parse_reply-test.exe: $(OBJ)\parse_reply-test.obj $(OBJ)\resolve_test.obj $(LIBROKEN)
210 $(EXECONLINK) DnsAPI.lib
212 $(OBJ)\test-readenv.exe: $(OBJ)\test-readenv.obj $(OBJ)\test-mem.obj $(LIBROKEN)
215 $(OBJ)\parse_time-test.exe: $(OBJ)\parse_time-test.obj $(OBJ)\test-mem.obj $(LIBROKEN)
218 $(OBJ)\strpftime-test.obj: strpftime-test.c
219 $(C2OBJ) -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
221 $(OBJ)\strpftime-test.exe: $(OBJ)\strpftime-test.obj $(OBJ)\libtest.lib $(LIBROKEN)
224 $(OBJ)\snprintf-test.obj: snprintf-test.c
225 $(C2OBJ) -DTEST_SNPRINTF -DBUILD_ROKEN_LIB
227 $(OBJ)\snprintf-test.exe: $(OBJ)\snprintf-test.obj $(OBJ)\libtest.lib $(LIBROKEN)
230 $(OBJ)\resolve-test.exe: $(OBJ)\resolve-test.obj $(LIBROKEN)
231 $(EXECONLINK) DnsAPI.lib
233 $(OBJ)\base64-test.exe: $(OBJ)\base64-test.obj $(OBJ)\base64.obj
236 $(OBJ)\getaddrinfo-test.exe: $(OBJ)\getaddrinfo-test.obj $(LIBROKEN)
239 $(OBJ)\hex-test.exe: $(OBJ)\hex-test.obj $(LIBROKEN)
242 $(OBJ)\parse_bytes-test.exe: $(OBJ)\parse_bytes-test.obj $(LIBROKEN)
245 $(OBJ)\dirent-test.exe: $(OBJ)\dirent-test.obj $(LIBROKEN)
248 $(OBJ)\getifaddrs-test.exe: $(OBJ)\getifaddrs-test.obj $(LIBROKEN)
251 $(OBJ)\test-mini_inetd.exe: $(OBJ)\test-mini_inetd.obj $(LIBROKEN)
254 test-binaries: $(TEST_PROGS) $(TMP_PROGS)
266 # Need to rewrite this test:
267 # parse_reply-test.exe
273 test:: test-binaries test-run