@ -1,6 +1,7 @@
#
# Watcom / OpenWatcom / Win32 makefile for cares.
# Quick hack by Guenter; comments to: /dev/nul
# Updated by Douglas R. Reno, comments to: renodr2002@gmail.com. 2023
#
! i f n d e f % w a t c o m
@ -38,9 +39,9 @@ MD = mkdir
RD = rmdir /q /s 2>NUL
CP = copy
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr= con -w2 -fpi -oilrtfm &
-wcd= 201 -bt= nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY &
-dNTDDI_VERSION= 0x05010000 -I. $( SYS_INCL)
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr= con -w2 -fpi -oilrtfm -aa &
-wcd= 201 -bt= nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY &
-dNTDDI_VERSION= 0x06000000 -I. -I.\i nclude -I.\s rc\l ib $( SYS_INCL)
LFLAGS = option quiet, map, caseexact, eliminate
@ -69,7 +70,7 @@ LIB_ARG = $(OBJ_BASE)\stat\wlib.arg
! i f n e q _ _ M A K E O P T S _ _ - u
! e r r o r Y o u M U S T c a l l w m a k e w i t h t h e - u s w i t c h !
! e l s e
! i n c l u d e M a k e f i l e . i n c
! i n c l u d e s r c \ l i b \ M a k e f i l e . i n c
! e n d i f
OBJS = $( CSOURCES:.c= .obj)
@ -82,10 +83,11 @@ OBJ_DIR = $(OBJ_BASE)\stat
OBJS_STAT = $+ $( OBJS) $-
OBJ_DIR = $( OBJ_BASE) \d yn
OBJS_DYN = $+ $( OBJS) $-
OBJS_DYN + = $( OBJS) $-
ARESBUILDH = ares_build.h
RESOURCE = $( OBJ_BASE) \d yn\c ares.res
ARESBUILDH = include\a res_build.h
all : $( ARESBUILDH ) $( OBJ_BASE ) $( TARGETS ) $( DEMOS ) .SYMBOLIC
@echo Welcome to cares
@ -94,10 +96,10 @@ $(OBJ_BASE):
-$( MD) $^@
-$( MD) $^@\s tat
-$( MD) $^@\d yn
-$( MD) $^@\d emo s
-$( MD) $^@\t ool s
$(ARESBUILDH) : .EXISTSONLY
$( CP) $^@.dist $^@
@echo Make sure to run buildconf.bat!
$(LIBNAME).dll : $( OBJS_DYN ) $( RESOURCE ) $( LINK_ARG )
$( LD) name $^@ @$] @
@ -105,14 +107,20 @@ $(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG)
$(LIBNAME).lib : $( OBJS_STAT ) $( LIB_ARG )
$( AR) -q -b -c $^@ @$] @
adig.exe : $( OBJ_BASE ) \demos \adig .obj $( OBJ_BASE ) \demos \ares_getopt .obj $( LIBNAME ) .lib
$( LD) name $^@ system nt $( LFLAGS) file { $( OBJ_BASE) \d emos\a res_getopt.obj $[ @ } library $] @, ws2_32.lib
$(OBJ_BASE)\tools\ares_getopt.obj :
$( CC) $( CFLAGS) -DCARES_STATICLIB .\s rc\t ools\a res_getopt.c -fo= $^@
ahost.exe : $( OBJ_BASE ) \demos \ahost .obj $( OBJ_BASE ) \demos \ares_getopt .obj $( LIBNAME ) .lib
$( LD) name $^@ system nt $( LFLAGS) file { $( OBJ_BASE) \d emos\a res_getopt.obj $[ @ } library $] @, ws2_32.lib
adig.exe : $( OBJ_BASE ) \tools \ares_getopt .obj $( LIBNAME ) .lib
$( CC) $( CFLAGS) src\t ools\a dig.c -fo= $( OBJ_BASE) \t ools\a dig.obj
$( LD) name $^@ system nt $( LFLAGS) file { $( OBJ_BASE) \t ools\a dig.obj $[ @ } library $] @, ws2_32.lib, iphlpapi.lib
acountry.exe : $( OBJ_BASE ) \demos \acountry .obj $( OBJ_BASE ) \demos \ares_getopt .obj $( LIBNAME ) .lib
$( LD) name $^@ system nt $( LFLAGS) file { $( OBJ_BASE) \d emos\a res_getopt.obj $[ @ } library $] @, ws2_32.lib
ahost.exe : $( OBJ_BASE ) \tools \ares_getopt .obj $( LIBNAME ) .lib
$( CC) $( CFLAGS) src\t ools\a host.c -fo= $( OBJ_BASE) \t ools\a host.obj
$( LD) name $^@ system nt $( LFLAGS) file { $( OBJ_BASE) \t ools\a host.obj $[ @ } library $] @, ws2_32.lib, iphlpapi.lib
acountry.exe : $( OBJ_BASE ) \tools \ares_getopt .obj $( LIBNAME ) .lib
$( CC) $( CFLAGS) src\t ools\a country.c -fo= $( OBJ_BASE) \t ools\a country.obj
$( LD) name $^@ system nt $( LFLAGS) file { $( OBJ_BASE) \t ools\a country.obj $[ @ } library $] @, ws2_32.lib, iphlpapi.lib
clean : .SYMBOLIC
-$( RM) $( OBJS_STAT)
@ -124,24 +132,23 @@ vclean realclean: clean .SYMBOLIC
-$( RM) $( DEMOS) $( DEMOS:.exe= .map)
-$( RD) $( OBJ_BASE) \s tat
-$( RD) $( OBJ_BASE) \d yn
-$( RD) $( OBJ_BASE) \d emo s
-$( RD) $( OBJ_BASE) \t ool s
-$( RD) $( OBJ_BASE)
. E R A S E
$(RESOURCE) : cares .rc .AUTODEPEND
.c : .\src \lib
. E R A S E
$(RESOURCE) : src \lib \cares .rc .AUTODEPEND
$( RC) $( DEBUG) -q -r -zm -I..\i nclude $( SYS_INCL) $[ @ -fo= $^@
. E R A S E
.c{$(OBJ_BASE)\dyn}.obj :
$( CC) $( CFLAGS) -bd $[ @ -fo= $^@
$( CC) $( CFLAGS) -bd .\s rc\l ib\$ ^& -fo= $^@
. E R A S E
.c{$(OBJ_BASE)\stat}.obj :
$( CC) $( CFLAGS) -DCARES_STATICLIB $[ @ -fo= $^@
. E R A S E
.c{$(OBJ_BASE)\demos}.obj :
$( CC) $( CFLAGS) -DCARES_STATICLIB $[ @ -fo= $^@
$( CC) $( CFLAGS) -DCARES_STATICLIB .\s rc\l ib\$ ^& -fo= $^@
$(LINK_ARG) : $( __MAKEFILES__ )
%create $^@
@ -155,6 +162,7 @@ $(LINK_ARG): $(__MAKEFILES__)
@%append $^@ library $( %watt_root) \l ib\w attcpw_imp.lib
! e l s e
@%append $^@ library ws2_32.lib
@%append $^@ library iphlpapi.lib
! e n d i f
$(LIB_ARG) : $( __MAKEFILES__ )