NTMakefile revision 1.1 1 1.1 elric ########################################################################
2 1.1 elric #
3 1.1 elric # Copyright (c) 2009, Secure Endpoints Inc.
4 1.1 elric # All rights reserved.
5 1.1 elric #
6 1.1 elric # Redistribution and use in source and binary forms, with or without
7 1.1 elric # modification, are permitted provided that the following conditions
8 1.1 elric # are met:
9 1.1 elric #
10 1.1 elric # - Redistributions of source code must retain the above copyright
11 1.1 elric # notice, this list of conditions and the following disclaimer.
12 1.1 elric #
13 1.1 elric # - Redistributions in binary form must reproduce the above copyright
14 1.1 elric # notice, this list of conditions and the following disclaimer in
15 1.1 elric # the documentation and/or other materials provided with the
16 1.1 elric # distribution.
17 1.1 elric #
18 1.1 elric # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 1.1 elric # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 1.1 elric # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 1.1 elric # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 1.1 elric # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 1.1 elric # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 1.1 elric # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 1.1 elric # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 1.1 elric # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1 elric # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 1.1 elric # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 elric # POSSIBILITY OF SUCH DAMAGE.
30 1.1 elric #
31 1.1 elric
32 1.1 elric RELDIR=lib\roken
33 1.1 elric
34 1.1 elric !include ../../windows/NTMakefile.w32
35 1.1 elric
36 1.1 elric libroken_la_OBJS = \
37 1.1 elric $(OBJ)\base64.obj \
38 1.1 elric $(OBJ)\bswap.obj \
39 1.1 elric $(OBJ)\concat.obj \
40 1.1 elric $(OBJ)\cloexec.obj \
41 1.1 elric $(OBJ)\ct.obj \
42 1.1 elric $(OBJ)\dirent.obj \
43 1.1 elric $(OBJ)\dlfcn_w32.obj \
44 1.1 elric $(OBJ)\dumpdata.obj \
45 1.1 elric $(OBJ)\ecalloc.obj \
46 1.1 elric $(OBJ)\emalloc.obj \
47 1.1 elric $(OBJ)\environment.obj \
48 1.1 elric $(OBJ)\eread.obj \
49 1.1 elric $(OBJ)\erealloc.obj \
50 1.1 elric $(OBJ)\err.obj \
51 1.1 elric $(OBJ)\errx.obj \
52 1.1 elric $(OBJ)\esetenv.obj \
53 1.1 elric $(OBJ)\estrdup.obj \
54 1.1 elric $(OBJ)\ewrite.obj \
55 1.1 elric $(OBJ)\flock.obj \
56 1.1 elric $(OBJ)\fnmatch.obj \
57 1.1 elric $(OBJ)\getaddrinfo_hostspec.obj \
58 1.1 elric $(OBJ)\get_default_username.obj \
59 1.1 elric $(OBJ)\get_window_size.obj \
60 1.1 elric $(OBJ)\getarg.obj \
61 1.1 elric $(OBJ)\getifaddrs_w32.obj \
62 1.1 elric $(OBJ)\getnameinfo_verified.obj \
63 1.1 elric $(OBJ)\getopt.obj \
64 1.1 elric $(OBJ)\getprogname.obj \
65 1.1 elric $(OBJ)\gettimeofday.obj \
66 1.1 elric $(OBJ)\hex.obj \
67 1.1 elric $(OBJ)\hostent_find_fqdn.obj \
68 1.1 elric $(OBJ)\inet_aton.obj \
69 1.1 elric $(OBJ)\issuid.obj \
70 1.1 elric $(OBJ)\localtime_r.obj \
71 1.1 elric $(OBJ)\lstat.obj \
72 1.1 elric $(OBJ)\mini_inetd.obj \
73 1.1 elric $(OBJ)\mkstemp.obj \
74 1.1 elric $(OBJ)\net_read.obj \
75 1.1 elric $(OBJ)\net_write.obj \
76 1.1 elric $(OBJ)\parse_bytes.obj \
77 1.1 elric $(OBJ)\parse_time.obj \
78 1.1 elric $(OBJ)\parse_units.obj \
79 1.1 elric $(OBJ)\realloc.obj \
80 1.1 elric $(OBJ)\rename.obj \
81 1.1 elric $(OBJ)\resolve.obj \
82 1.1 elric $(OBJ)\rand.obj \
83 1.1 elric $(OBJ)\roken_gethostby.obj \
84 1.1 elric $(OBJ)\rtbl.obj \
85 1.1 elric $(OBJ)\sendmsg.obj \
86 1.1 elric $(OBJ)\setenv.obj \
87 1.1 elric $(OBJ)\setprogname.obj \
88 1.1 elric $(OBJ)\simple_exec_w32.obj \
89 1.1 elric $(OBJ)\sleep.obj \
90 1.1 elric $(OBJ)\snprintf.obj \
91 1.1 elric $(OBJ)\socket.obj \
92 1.1 elric $(OBJ)\sockstartup_w32.obj \
93 1.1 elric $(OBJ)\strcollect.obj \
94 1.1 elric $(OBJ)\strerror_r.obj \
95 1.1 elric $(OBJ)\strlcat.obj \
96 1.1 elric $(OBJ)\strlcpy.obj \
97 1.1 elric $(OBJ)\strpool.obj \
98 1.1 elric $(OBJ)\strptime.obj \
99 1.1 elric $(OBJ)\strsep.obj \
100 1.1 elric $(OBJ)\strsep_copy.obj \
101 1.1 elric $(OBJ)\strtok_r.obj \
102 1.1 elric $(OBJ)\syslogc.obj \
103 1.1 elric $(OBJ)\timegm.obj \
104 1.1 elric $(OBJ)\timeval.obj \
105 1.1 elric $(OBJ)\tm2time.obj \
106 1.1 elric $(OBJ)\tsearch.obj \
107 1.1 elric $(OBJ)\unvis.obj \
108 1.1 elric $(OBJ)\verr.obj \
109 1.1 elric $(OBJ)\verrx.obj \
110 1.1 elric $(OBJ)\vis.obj \
111 1.1 elric $(OBJ)\vwarn.obj \
112 1.1 elric $(OBJ)\vwarnx.obj \
113 1.1 elric $(OBJ)\warn.obj \
114 1.1 elric $(OBJ)\warnerr.obj \
115 1.1 elric $(OBJ)\warnx.obj \
116 1.1 elric $(OBJ)\xfree.obj
117 1.1 elric
118 1.1 elric !if $(NMAKE_WINVER) < 0x0600
119 1.1 elric libroken_la_OBJS=$(libroken_la_OBJS) \
120 1.1 elric $(OBJ)\inet_ntop.obj \
121 1.1 elric $(OBJ)\inet_pton.obj
122 1.1 elric !endif
123 1.1 elric
124 1.1 elric {}.c{$(OBJ)}.obj::
125 1.1 elric $(C2OBJ_P) -DBUILD_ROKEN_LIB
126 1.1 elric
127 1.1 elric $(LIBROKEN): $(libroken_la_OBJS)
128 1.1 elric $(LIBCON_C) -out:$@ @<<
129 1.1 elric $(**: =
130 1.1 elric )
131 1.1 elric <<
132 1.1 elric
133 1.1 elric $(OBJ)\make-roken.exe: $(OBJ)\make-roken.obj
134 1.1 elric $(EXECONLINK)
135 1.1 elric
136 1.1 elric $(OBJ)\make-roken.c: roken.h.in roken.awk $(INCDIR)\config.h
137 1.1 elric $(AWK) -f roken.awk roken.h.in > $(OBJ)\make-roken.c || $(RM) $(OBJ)\make-roken.c
138 1.1 elric
139 1.1 elric $(INCDIR)\roken.h: $(OBJ)\make-roken.exe
140 1.1 elric $(OBJ)\make-roken.exe > $@ || $(RM) $@
141 1.1 elric
142 1.1 elric INCFILES = \
143 1.1 elric $(INCDIR)\base64.h \
144 1.1 elric $(INCDIR)\dirent.h \
145 1.1 elric $(INCDIR)\dlfcn.h \
146 1.1 elric $(INCDIR)\err.h \
147 1.1 elric $(INCDIR)\fnmatch.h \
148 1.1 elric $(INCDIR)\getarg.h \
149 1.1 elric $(INCDIR)\glob.h \
150 1.1 elric $(INCDIR)\hex.h \
151 1.1 elric $(INCDIR)\ifaddrs.h \
152 1.1 elric $(INCDIR)\parse_bytes.h \
153 1.1 elric $(INCDIR)\parse_time.h \
154 1.1 elric $(INCDIR)\parse_units.h \
155 1.1 elric $(INCDIR)\resolve.h \
156 1.1 elric $(INCDIR)\roken.h \
157 1.1 elric $(INCDIR)\roken-common.h \
158 1.1 elric $(INCDIR)\rtbl.h \
159 1.1 elric $(INCDIR)\search.h \
160 1.1 elric $(INCDIR)\stdbool.h \
161 1.1 elric $(INCDIR)\syslog.h \
162 1.1 elric $(INCDIR)\vis.h \
163 1.1 elric $(INCDIR)\xdbm.h
164 1.1 elric
165 1.1 elric clean::
166 1.1 elric -$(RM) $(XHEADERS)
167 1.1 elric
168 1.1 elric all:: $(INCFILES) $(LIBROKEN)
169 1.1 elric
170 1.1 elric clean::
171 1.1 elric -$(RM) $(LIBROKEN)
172 1.1 elric
173 1.1 elric TMP_PROGS = $(OBJ)\snprintf-test.exe $(OBJ)\resolve-test.exe
174 1.1 elric
175 1.1 elric # Tests
176 1.1 elric
177 1.1 elric TEST_PROGS = \
178 1.1 elric $(OBJ)\base64-test.exe \
179 1.1 elric $(OBJ)\getaddrinfo-test.exe \
180 1.1 elric $(OBJ)\getifaddrs-test.exe \
181 1.1 elric $(OBJ)\hex-test.exe \
182 1.1 elric $(OBJ)\test-readenv.exe \
183 1.1 elric $(OBJ)\parse_bytes-test.exe \
184 1.1 elric $(OBJ)\parse_reply-test.exe \
185 1.1 elric $(OBJ)\parse_time-test.exe \
186 1.1 elric $(OBJ)\snprintf-test.exe \
187 1.1 elric $(OBJ)\strpftime-test.exe \
188 1.1 elric $(OBJ)\dirent-test.exe \
189 1.1 elric $(OBJ)\test-mini_inetd.exe
190 1.1 elric
191 1.1 elric $(OBJ)\strftime_test.obj: strftime.c
192 1.1 elric $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
193 1.1 elric
194 1.1 elric $(OBJ)\strptime_test.obj: strptime.c
195 1.1 elric $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
196 1.1 elric
197 1.1 elric $(OBJ)\snprintf_test.obj: snprintf.c
198 1.1 elric $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
199 1.1 elric
200 1.1 elric $(OBJ)\libtest.lib: $(OBJ)\strftime_test.obj $(OBJ)\strptime_test.obj $(OBJ)\snprintf_test.obj
201 1.1 elric $(LIBCON)
202 1.1 elric
203 1.1 elric $(OBJ)\parse_reply-test.obj: parse_reply-test.c
204 1.1 elric $(C2OBJ) -DTEST_RESOLVE -DBUILD_ROKEN_LIB
205 1.1 elric
206 1.1 elric $(OBJ)\resolve_test.obj: resolve.c
207 1.1 elric $(C2OBJ) -DTEST_RESOLVE -DBUILD_ROKEN_LIB
208 1.1 elric
209 1.1 elric $(OBJ)\parse_reply-test.exe: $(OBJ)\parse_reply-test.obj $(OBJ)\resolve_test.obj $(LIBROKEN)
210 1.1 elric $(EXECONLINK) DnsAPI.lib
211 1.1 elric
212 1.1 elric $(OBJ)\test-readenv.exe: $(OBJ)\test-readenv.obj $(OBJ)\test-mem.obj $(LIBROKEN)
213 1.1 elric $(EXECONLINK)
214 1.1 elric
215 1.1 elric $(OBJ)\parse_time-test.exe: $(OBJ)\parse_time-test.obj $(OBJ)\test-mem.obj $(LIBROKEN)
216 1.1 elric $(EXECONLINK)
217 1.1 elric
218 1.1 elric $(OBJ)\strpftime-test.obj: strpftime-test.c
219 1.1 elric $(C2OBJ) -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
220 1.1 elric
221 1.1 elric $(OBJ)\strpftime-test.exe: $(OBJ)\strpftime-test.obj $(OBJ)\libtest.lib $(LIBROKEN)
222 1.1 elric $(EXECONLINK)
223 1.1 elric
224 1.1 elric $(OBJ)\snprintf-test.obj: snprintf-test.c
225 1.1 elric $(C2OBJ) -DTEST_SNPRINTF -DBUILD_ROKEN_LIB
226 1.1 elric
227 1.1 elric $(OBJ)\snprintf-test.exe: $(OBJ)\snprintf-test.obj $(OBJ)\libtest.lib $(LIBROKEN)
228 1.1 elric $(EXECONLINK)
229 1.1 elric
230 1.1 elric $(OBJ)\resolve-test.exe: $(OBJ)\resolve-test.obj $(LIBROKEN)
231 1.1 elric $(EXECONLINK) DnsAPI.lib
232 1.1 elric
233 1.1 elric $(OBJ)\base64-test.exe: $(OBJ)\base64-test.obj $(OBJ)\base64.obj
234 1.1 elric $(EXECONLINK)
235 1.1 elric
236 1.1 elric $(OBJ)\getaddrinfo-test.exe: $(OBJ)\getaddrinfo-test.obj $(LIBROKEN)
237 1.1 elric $(EXECONLINK)
238 1.1 elric
239 1.1 elric $(OBJ)\hex-test.exe: $(OBJ)\hex-test.obj $(LIBROKEN)
240 1.1 elric $(EXECONLINK)
241 1.1 elric
242 1.1 elric $(OBJ)\parse_bytes-test.exe: $(OBJ)\parse_bytes-test.obj $(LIBROKEN)
243 1.1 elric $(EXECONLINK)
244 1.1 elric
245 1.1 elric $(OBJ)\dirent-test.exe: $(OBJ)\dirent-test.obj $(LIBROKEN)
246 1.1 elric $(EXECONLINK)
247 1.1 elric
248 1.1 elric $(OBJ)\getifaddrs-test.exe: $(OBJ)\getifaddrs-test.obj $(LIBROKEN)
249 1.1 elric $(EXECONLINK)
250 1.1 elric
251 1.1 elric $(OBJ)\test-mini_inetd.exe: $(OBJ)\test-mini_inetd.obj $(LIBROKEN)
252 1.1 elric $(EXECONLINK)
253 1.1 elric
254 1.1 elric test-binaries: $(TEST_PROGS) $(TMP_PROGS)
255 1.1 elric
256 1.1 elric test-run:
257 1.1 elric cd $(OBJ)
258 1.1 elric test-mini_inetd.exe
259 1.1 elric dirent-test.exe
260 1.1 elric base64-test.exe
261 1.1 elric getaddrinfo-test.exe
262 1.1 elric getifaddrs-test.exe
263 1.1 elric hex-test.exe
264 1.1 elric test-readenv.exe
265 1.1 elric parse_bytes-test.exe
266 1.1 elric # Need to rewrite this test:
267 1.1 elric # parse_reply-test.exe
268 1.1 elric parse_time-test.exe
269 1.1 elric snprintf-test.exe
270 1.1 elric strpftime-test.exe
271 1.1 elric cd $(SRCDIR)
272 1.1 elric
273 1.1 elric test:: test-binaries test-run
274 1.1 elric
275