summaryrefslogtreecommitdiff
path: root/Makefile.vc6
blob: b0af61310df1e733070e977da59963ecbe6062e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# $Id$
#
# C-ares makefile for MSVC6+
# G. Vanem <gvanem@broadpark.no>.
#

CFG_MODEL   = MD
DEBUG_MODEL = d
USE_WATT32  = 0

#
# Configurations:
#  -MD   - msvcrt.dll,  threads, release (normal)
#  -MDd  - msvcrtd.dll, threads, debug
#  -ML   - libc, no threads,     release (not available on VC-2008+)
#  -MLd  - libc, no threads,     debug   (not available on VC-2008+)
#  -MT   - libc, threads,        release
#  -MTd  - libc, threads,        debug

CC = cl

CFLAGS  = -nologo -$(CFG_MODEL)$(DEBUG_MODEL) -W3 -Yd -Zi
LDFLAGS = -machine:i386 -map

OBJ_DIR  = VC6_obj
DEF_FILE = cares.def

!if "$(USE_WATT32)" == "1"
CFLAGS  = $(CFLAGS) -UWIN32 -DWATT32 -I$(WATT_ROOT)\inc
EX_LIBS = $(WATT_ROOT)\lib\wattcpvc_imp.lib

!else
CFLAGS  = $(CFLAGS) -DWIN32 -DWIN32_LEAN_AND_MEAN
EX_LIBS = advapi32.lib ws2_32.lib
!endif

!if "$(DEBUG_MODEL)" == "d"
CFLAGS  = $(CFLAGS) -DDEBUGBUILD -D_DEBUG -GZ
LDFLAGS = $(LDFLAGS) -debug -fixed:no

!else
CFLAGS  = $(CFLAGS) -O2 -Og
LDFLAGS = $(LDFLAGS) -release
!endif

CFLAGS  = $(CFLAGS) -I.\.

OBJECTS = $(OBJ_DIR)\ares_fds.obj              \
          $(OBJ_DIR)\ares_process.obj          \
          $(OBJ_DIR)\ares_free_hostent.obj     \
          $(OBJ_DIR)\ares_query.obj            \
          $(OBJ_DIR)\ares__close_sockets.obj   \
          $(OBJ_DIR)\ares_free_string.obj      \
          $(OBJ_DIR)\ares_search.obj           \
          $(OBJ_DIR)\ares__get_hostent.obj     \
          $(OBJ_DIR)\ares_gethostbyaddr.obj    \
          $(OBJ_DIR)\ares_getsock.obj          \
          $(OBJ_DIR)\ares_send.obj             \
          $(OBJ_DIR)\ares__read_line.obj       \
          $(OBJ_DIR)\ares_gethostbyname.obj    \
          $(OBJ_DIR)\ares_getnameinfo.obj      \
          $(OBJ_DIR)\ares_strcasecmp.obj       \
          $(OBJ_DIR)\ares_strerror.obj         \
          $(OBJ_DIR)\ares_cancel.obj           \
          $(OBJ_DIR)\ares_init.obj             \
          $(OBJ_DIR)\ares_library_init.obj     \
          $(OBJ_DIR)\ares_llist.obj            \
          $(OBJ_DIR)\ares_timeout.obj          \
          $(OBJ_DIR)\ares__timeval.obj         \
          $(OBJ_DIR)\ares_destroy.obj          \
          $(OBJ_DIR)\ares_mkquery.obj          \
          $(OBJ_DIR)\ares_version.obj          \
          $(OBJ_DIR)\ares_expand_name.obj      \
          $(OBJ_DIR)\ares_parse_a_reply.obj    \
          $(OBJ_DIR)\ares_parse_aaaa_reply.obj \
          $(OBJ_DIR)\ares_parse_ns_reply.obj   \
          $(OBJ_DIR)\ares_parse_srv_reply.obj  \
          $(OBJ_DIR)\windows_port.obj          \
          $(OBJ_DIR)\ares_expand_string.obj    \
          $(OBJ_DIR)\ares_parse_ptr_reply.obj  \
          $(OBJ_DIR)\ares_writev.obj           \
          $(OBJ_DIR)\bitncmp.obj               \
          $(OBJ_DIR)\inet_net_pton.obj         \
          $(OBJ_DIR)\inet_ntop.obj

all: $(OBJ_DIR) cares.lib cares.dll cares_imp.lib ahost.exe adig.exe acountry.exe
       @echo Welcome to c-ares library and examples

$(OBJ_DIR):
       mkdir $(OBJ_DIR)

cares.lib: $(OBJ_DIR) $(OBJECTS)
       lib -nologo -out:$@ $(OBJECTS)

cares_imp.lib cares.dll: $(OBJ_DIR) $(DEF_FILE) $(OBJECTS)
       link $(LDFLAGS) -dll -implib:cares_imp.lib -out:cares.dll \
            -def:$(DEF_FILE) $(OBJECTS) $(EX_LIBS)

$(DEF_FILE): $(OBJECTS) Makefile.VC6
       @echo ; Generated. DO NOT EDIT  > $@
       @echo LIBRARY cares.dll        >> $@
       @echo EXPORTS                  >> $@
       @echo   ares_cancel            >> $@
       @echo   ares_destroy           >> $@
       @echo   ares_expand_name       >> $@
       @echo   ares_expand_string     >> $@
       @echo   ares_fds               >> $@
       @echo   ares_free_hostent      >> $@
       @echo   ares_free_string       >> $@
       @echo   ares_gethostbyaddr     >> $@
       @echo   ares_gethostbyname     >> $@
       @echo   ares_getsock           >> $@
       @echo   ares_init              >> $@
       @echo   ares_init_options      >> $@
       @echo   ares_library_init      >> $@
       @echo   ares_library_cleanup   >> $@
       @echo   ares_mkquery           >> $@
       @echo   ares_parse_a_reply     >> $@
       @echo   ares_parse_ptr_reply   >> $@
       @echo   ares_parse_ns_reply    >> $@
       @echo   ares_process           >> $@
       @echo   ares_process_fd        >> $@
       @echo   ares_query             >> $@
       @echo   ares_search            >> $@
       @echo   ares_strerror          >> $@
       @echo   ares_strncasecmp       >> $@
       @echo   ares_strcasecmp        >> $@
       @echo   ares_timeout           >> $@
       @echo   ares_version           >> $@
       @echo   ares_inet_net_pton     >> $@
       @echo   ares_inet_ntop         >> $@
       @echo   ares_inet_pton         >> $@
       @echo   ares_getnameinfo       >> $@
       @echo   ares_parse_aaaa_reply  >> $@
!if "$(USE_WATT32)" == "0"
       @echo   ares_writev            >> $@
!endif

ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
       link $(LDFLAGS) -out:$@ $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)

adig.exe: $(OBJ_DIR) $(OBJ_DIR)\adig.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
       link $(LDFLAGS) -out:$@ $(OBJ_DIR)\adig.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)

acountry.exe: $(OBJ_DIR) $(OBJ_DIR)\acountry.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
       link $(LDFLAGS) -out:$@ $(OBJ_DIR)\acountry.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)

clean:
       - del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map

vclean realclean: clean
       - del $(DEF_FILE) cares.lib cares_imp.* cares.dll
       - del ahost.exe adig.exe acountry.exe
       - rd $(OBJ_DIR)

.c{$(OBJ_DIR)}.obj:
       $(CC) $(CFLAGS) -Fo$*.obj -c $<

#
# Copyright "gcc -MM .."
#
$(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h setup_once.h ares.h ares_private.h \
  ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_process.obj: ares_process.c setup.h setup_once.h nameser.h     \
  ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c setup.h setup_once.h     \
  ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_query.obj: ares_query.c setup.h setup_once.h nameser.h         \
  ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares__close_sockets.obj: ares__close_sockets.c setup.h setup_once.h \
  ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c setup.h setup_once.h       \
  ares.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_search.obj: ares_search.c setup.h setup_once.h nameser.h       \
  ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c setup.h setup_once.h     \
  ares.h ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c setup.h setup_once.h   \
  nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h     \
  ares_rules.h

$(OBJ_DIR)\ares_send.obj: ares_send.c setup.h setup_once.h nameser.h ares.h    \
  ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h setup_once.h ares.h  \
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c setup.h setup_once.h   \
  nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h        \
  ares_build.h ares_rules.h

$(OBJ_DIR)\ares_strcasecmp.obj: ares_strcasecmp.c setup.h setup_once.h ares.h  \
  ares_build.h ares_rules.h

$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h setup_once.h ares.h      \
  ares_build.h ares_rules.h

$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c setup.h setup_once.h ares.h          \
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_init.obj: ares_init.c setup.h setup_once.h nameser.h ares.h    \
  ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h         \
  ares_library_init.h

$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h setup_once.h ares.h        \
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares__timeval.obj: ares__timeval.c setup.h setup_once.h ares.h      \
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h        \
  ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c setup.h setup_once.h nameser.h     \
  ares.h ares_dns.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h setup_once.h ares.h        \
  ares_version.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c setup.h setup_once.h       \
  nameser.h ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c setup.h setup_once.h   \
  nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h          \
  ares_rules.h

$(OBJ_DIR)\windows_port.obj: windows_port.c setup.h setup_once.h nameser.h     \
  ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c setup.h setup_once.h   \
  nameser.h ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c setup.h            \
  setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h          \
  ares_build.h ares_rules.h

$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c setup.h          \
  setup_once.h nameser.h ares.h ares_dns.h inet_net_pton.h ares_private.h      \
  ares_ipv6.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_parse_ns_reply.obj: ares_parse_ns_reply.c setup.h              \
  setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h          \
  ares_build.h ares_rules.h

$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c setup.h setup_once.h       \
  nameser.h ares.h ares_private.h ares_ipv6.h inet_ntop.h ares_build.h         \
  ares_rules.h

$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c setup.h setup_once.h nameser.h   \
  ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h

$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h ares_build.h ares_rules.h

$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h setup_once.h nameser.h           \
  ares_ipv6.h inet_ntop.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h ares_build.h           \
  ares_rules.h

$(OBJ_DIR)\ares_library_init.obj: ares_library_init.c setup.h setup_once.h     \
  ares.h ares_private.h ares_library_init.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_llist.obj: ares_llist.c setup.h setup_once.h ares.h            \
  ares_private.h ares_llist.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_writev.obj: ares_writev.c setup.h setup_once.h ares.h          \
  ares_writev.h ares_build.h ares_rules.h