clean better
[heimdal.git] / lib / roken / NTMakefile
blob3c626f79c4d89c39499a217bb0d79117af868117
1 ########################################################################
3 # Copyright (c) 2009, Secure Endpoints Inc.
4 # All rights reserved.
5
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9
10 # - Redistributions of source code must retain the above copyright
11 #   notice, this list of conditions and the following disclaimer.
12
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
16 #   distribution.
17
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.
30
32 RELDIR=lib\roken
34 !include ../../windows/NTMakefile.w32
36 libroken_la_OBJS =                      \
37         $(OBJ)\base64.obj               \
38         $(OBJ)\bswap.obj                \
39         $(OBJ)\concat.obj               \
40         $(OBJ)\cloexec.obj              \
41         $(OBJ)\ct.obj                   \
42         $(OBJ)\dirent.obj               \
43         $(OBJ)\dlfcn_w32.obj            \
44         $(OBJ)\dumpdata.obj             \
45         $(OBJ)\ecalloc.obj              \
46         $(OBJ)\emalloc.obj              \
47         $(OBJ)\environment.obj          \
48         $(OBJ)\eread.obj                \
49         $(OBJ)\erealloc.obj             \
50         $(OBJ)\err.obj                  \
51         $(OBJ)\errx.obj                 \
52         $(OBJ)\esetenv.obj              \
53         $(OBJ)\estrdup.obj              \
54         $(OBJ)\ewrite.obj               \
55         $(OBJ)\flock.obj                \
56         $(OBJ)\fnmatch.obj              \
57         $(OBJ)\getaddrinfo_hostspec.obj \
58         $(OBJ)\get_default_username.obj \
59         $(OBJ)\get_window_size.obj      \
60         $(OBJ)\getarg.obj               \
61         $(OBJ)\getifaddrs_w32.obj       \
62         $(OBJ)\getnameinfo_verified.obj \
63         $(OBJ)\getprogname.obj          \
64         $(OBJ)\gettimeofday.obj         \
65         $(OBJ)\hex.obj                  \
66         $(OBJ)\hostent_find_fqdn.obj    \
67         $(OBJ)\inet_aton.obj            \
68         $(OBJ)\issuid.obj               \
69         $(OBJ)\lstat.obj                \
70         $(OBJ)\mini_inetd.obj           \
71         $(OBJ)\mkstemp.obj              \
72         $(OBJ)\net_read.obj             \
73         $(OBJ)\net_write.obj            \
74         $(OBJ)\parse_bytes.obj          \
75         $(OBJ)\parse_time.obj           \
76         $(OBJ)\parse_units.obj          \
77         $(OBJ)\realloc.obj              \
78         $(OBJ)\resolve.obj              \
79         $(OBJ)\roken_gethostby.obj      \
80         $(OBJ)\rtbl.obj                 \
81         $(OBJ)\sendmsg.obj              \
82         $(OBJ)\setenv.obj               \
83         $(OBJ)\setprogname.obj          \
84         $(OBJ)\simple_exec_w32.obj      \
85         $(OBJ)\sleep.obj                \
86         $(OBJ)\snprintf.obj             \
87         $(OBJ)\socket.obj               \
88         $(OBJ)\sockstartup_w32.obj      \
89         $(OBJ)\strcollect.obj           \
90         $(OBJ)\strerror_r.obj           \
91         $(OBJ)\strlcat.obj              \
92         $(OBJ)\strlcpy.obj              \
93         $(OBJ)\strpool.obj              \
94         $(OBJ)\strptime.obj             \
95         $(OBJ)\strsep.obj               \
96         $(OBJ)\strsep_copy.obj          \
97         $(OBJ)\strtok_r.obj             \
98         $(OBJ)\syslogc.obj              \
99         $(OBJ)\timegm.obj               \
100         $(OBJ)\timeval.obj              \
101         $(OBJ)\tm2time.obj              \
102         $(OBJ)\unvis.obj                \
103         $(OBJ)\verr.obj                 \
104         $(OBJ)\verrx.obj                \
105         $(OBJ)\vis.obj                  \
106         $(OBJ)\vwarn.obj                \
107         $(OBJ)\vwarnx.obj               \
108         $(OBJ)\warn.obj                 \
109         $(OBJ)\warnerr.obj              \
110         $(OBJ)\warnx.obj                \
111         $(OBJ)\xfree.obj
113 !if $(NMAKE_WINVER) < 0x0600
114 libroken_la_OBJS=$(libroken_la_OBJS) \
115         $(OBJ)\inet_ntop.obj            \
116         $(OBJ)\inet_pton.obj
117 !endif
119 {}.c{$(OBJ)}.obj::
120         $(C2OBJ_P) -DBUILD_ROKEN_LIB
122 $(LIBROKEN): $(libroken_la_OBJS)
123         $(LIBCON_C) -out:$@ @<<
124 $(**: =
128 $(OBJ)\make-roken.exe: $(OBJ)\make-roken.obj
129         $(EXECONLINK)
131 $(OBJ)\make-roken.c: roken.h.in roken.awk $(INCDIR)\config.h
132         $(AWK) -f roken.awk roken.h.in > $(OBJ)\make-roken.c || $(RM) $(OBJ)\make-roken.c
134 $(INCDIR)\roken.h: $(OBJ)\make-roken.exe
135         $(OBJ)\make-roken.exe > $@ || $(RM) $@
137 INCFILES =                              \
138         $(INCDIR)\base64.h      \
139         $(INCDIR)\dirent.h      \
140         $(INCDIR)\dlfcn.h       \
141         $(INCDIR)\err.h         \
142         $(INCDIR)\fnmatch.h     \
143         $(INCDIR)\getarg.h      \
144         $(INCDIR)\glob.h        \
145         $(INCDIR)\hex.h         \
146         $(INCDIR)\ifaddrs.h     \
147         $(INCDIR)\parse_bytes.h \
148         $(INCDIR)\parse_time.h  \
149         $(INCDIR)\parse_units.h \
150         $(INCDIR)\resolve.h     \
151         $(INCDIR)\roken.h       \
152         $(INCDIR)\roken-common.h        \
153         $(INCDIR)\rtbl.h        \
154         $(INCDIR)\syslog.h      \
155         $(INCDIR)\vis.h         \
156         $(INCDIR)\xdbm.h
158 clean::
159         -$(RM) $(XHEADERS)
161 all:: $(INCFILES) $(LIBROKEN)
163 clean::
164         -$(RM) $(LIBROKEN)
166 TMP_PROGS = $(OBJ)\snprintf-test.exe $(OBJ)\resolve-test.exe
168 # Tests
170 TEST_PROGS =                        \
171         $(OBJ)\base64-test.exe      \
172         $(OBJ)\getaddrinfo-test.exe \
173         $(OBJ)\getifaddrs-test.exe  \
174         $(OBJ)\hex-test.exe         \
175         $(OBJ)\test-readenv.exe     \
176         $(OBJ)\parse_bytes-test.exe \
177         $(OBJ)\parse_reply-test.exe \
178         $(OBJ)\parse_time-test.exe  \
179         $(OBJ)\snprintf-test.exe    \
180         $(OBJ)\strpftime-test.exe   \
181         $(OBJ)\dirent-test.exe      \
182         $(OBJ)\test-mini_inetd.exe
184 $(OBJ)\strftime_test.obj: strftime.c
185         $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
187 $(OBJ)\strptime_test.obj: strptime.c
188         $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
190 $(OBJ)\snprintf_test.obj: snprintf.c
191         $(C2OBJ) -DTEST_SNPRINTF -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
193 $(OBJ)\libtest.lib: $(OBJ)\strftime_test.obj $(OBJ)\strptime_test.obj $(OBJ)\snprintf_test.obj
194         $(LIBCON)
196 $(OBJ)\parse_reply-test.obj: parse_reply-test.c
197         $(C2OBJ) -DTEST_RESOLVE -DBUILD_ROKEN_LIB
199 $(OBJ)\resolve_test.obj: resolve.c
200         $(C2OBJ) -DTEST_RESOLVE -DBUILD_ROKEN_LIB
202 $(OBJ)\parse_reply-test.exe: $(OBJ)\parse_reply-test.obj $(OBJ)\resolve_test.obj $(LIBROKEN)
203         $(EXECONLINK) DnsAPI.lib
205 $(OBJ)\test-readenv.exe: $(OBJ)\test-readenv.obj $(OBJ)\test-mem.obj $(LIBROKEN)
206         $(EXECONLINK)
208 $(OBJ)\parse_time-test.exe: $(OBJ)\parse_time-test.obj $(OBJ)\test-mem.obj $(LIBROKEN)
209         $(EXECONLINK)
211 $(OBJ)\strpftime-test.obj: strpftime-test.c
212         $(C2OBJ) -DTEST_STRPFTIME -DBUILD_ROKEN_LIB
214 $(OBJ)\strpftime-test.exe: $(OBJ)\strpftime-test.obj $(OBJ)\libtest.lib $(LIBROKEN)
215         $(EXECONLINK)
217 $(OBJ)\snprintf-test.obj: snprintf-test.c
218         $(C2OBJ) -DTEST_SNPRINTF -DBUILD_ROKEN_LIB
220 $(OBJ)\snprintf-test.exe: $(OBJ)\snprintf-test.obj $(OBJ)\libtest.lib $(LIBROKEN)
221         $(EXECONLINK)
223 $(OBJ)\resolve-test.exe: $(OBJ)\resolve-test.obj $(LIBROKEN)
224         $(EXECONLINK) DnsAPI.lib
226 $(OBJ)\base64-test.exe: $(OBJ)\base64-test.obj $(OBJ)\base64.obj
227         $(EXECONLINK)
229 $(OBJ)\getaddrinfo-test.exe: $(OBJ)\getaddrinfo-test.obj $(LIBROKEN)
230         $(EXECONLINK)
232 $(OBJ)\hex-test.exe: $(OBJ)\hex-test.obj $(LIBROKEN)
233         $(EXECONLINK)
235 $(OBJ)\parse_bytes-test.exe: $(OBJ)\parse_bytes-test.obj $(LIBROKEN)
236         $(EXECONLINK)
238 $(OBJ)\dirent-test.exe: $(OBJ)\dirent-test.obj $(LIBROKEN)
239         $(EXECONLINK)
241 $(OBJ)\getifaddrs-test.exe: $(OBJ)\getifaddrs-test.obj $(LIBROKEN)
242         $(EXECONLINK)
244 $(OBJ)\test-mini_inetd.exe: $(OBJ)\test-mini_inetd.obj $(LIBROKEN)
245         $(EXECONLINK)
247 test-binaries: $(TEST_PROGS) $(TMP_PROGS)
249 test-run:
250         cd $(OBJ)
251         test-mini_inetd.exe
252         dirent-test.exe
253         base64-test.exe
254         getaddrinfo-test.exe
255         getifaddrs-test.exe
256         hex-test.exe
257         test-readenv.exe
258         parse_bytes-test.exe
259 # Need to rewrite this test:
260 #       parse_reply-test.exe
261         parse_time-test.exe
262         snprintf-test.exe
263         strpftime-test.exe
264         cd $(SRCDIR)
266 test:: test-binaries test-run