@ -80,7 +80,7 @@ USE_WATT32 = 0
# Verify that current subdir is the c-ares source one
# Verify that current subdir is the c-ares source one
# ----------------------------------------------------
# ----------------------------------------------------
! I F ! E X I S T ( . \ a r e s _ i n i t . c )
! I F ! E X I S T ( . \ s r c \ l i b \ a r e s _ i n i t . c )
! M E S S A G E C a n n o t p r o c e s s M a k e f i l e . m s v c f r o m o u t s i d e o f c - a r e s s o u r c e s u b d i r e c t o r y .
! M E S S A G E C a n n o t p r o c e s s M a k e f i l e . m s v c f r o m o u t s i d e o f c - a r e s s o u r c e s u b d i r e c t o r y .
! M E S S A G E C h a n g e t o t h e s u b d i r e c t o r y w h e r e M a k e f i l e . m s v c i s f o u n d , a n d t r y a g a i n .
! M E S S A G E C h a n g e t o t h e s u b d i r e c t o r y w h e r e M a k e f i l e . m s v c i s f o u n d , a n d t r y a g a i n .
! E R R O R S e e p r e v i o u s m e s s a g e .
! E R R O R S e e p r e v i o u s m e s s a g e .
@ -212,7 +212,7 @@ RT_ERROR_CHECKING = /RTCsu
CC_CMD_REL = cl.exe /nologo $( RTLIB) /DNDEBUG /O2
CC_CMD_REL = cl.exe /nologo $( RTLIB) /DNDEBUG /O2
CC_CMD_DBG = cl.exe /nologo $( RTLIBD) /D_DEBUG /Od /Zi $( RT_ERROR_CHECKING)
CC_CMD_DBG = cl.exe /nologo $( RTLIBD) /D_DEBUG /Od /Zi $( RT_ERROR_CHECKING)
CC_CFLAGS = $( CFLAGS) /I. /W3 /EHsc /FD
CC_CFLAGS = $( CFLAGS) /I.\s rc\l ib /I.\i nclude /W3 /EHsc /FD
RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"
@ -280,7 +280,8 @@ RC_CMD = $(RC_CMD_DBG)
# Makefile.inc provides lists of source files
# Makefile.inc provides lists of source files
# --------------------------------------------
# --------------------------------------------
! 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
! I N C L U D E . \ s r c \ t o o l s \ M a k e f i l e . i n c
# ----------------------------
# ----------------------------
# Build lists of object files
# Build lists of object files
@ -308,6 +309,7 @@ CARES_OBJS = $(CARES_OBJS) $(CARES_OBJDIR)\cares.res
! E R R O R P r o b l e m g e n e r a t i n g P R O G 1 _ O B J S l i s t .
! E R R O R P r o b l e m g e n e r a t i n g P R O G 1 _ O B J S l i s t .
! E N D I F
! E N D I F
PROG1_OBJS = $( PROG1_OBJS:.c= .obj)
PROG1_OBJS = $( PROG1_OBJS:.c= .obj)
PROG1_OBJS = $( PROG1_OBJS:/= \)
PROG1_OBJS = $( PROG1_OBJS) $( PROG1_OBJDIR) \a country.obj
PROG1_OBJS = $( PROG1_OBJS) $( PROG1_OBJDIR) \a country.obj
!IF [ECHO PROG2_OBJS=^$(PROG2_OBJDIR)\$(SAMPLESOURCES : = $( PROG 2_OBJDIR ^) \) > .\prog 2_objs .inc ] == 0
!IF [ECHO PROG2_OBJS=^$(PROG2_OBJDIR)\$(SAMPLESOURCES : = $( PROG 2_OBJDIR ^) \) > .\prog 2_objs .inc ] == 0
@ -318,6 +320,7 @@ PROG1_OBJS = $(PROG1_OBJS) $(PROG1_OBJDIR)\acountry.obj
! E R R O R P r o b l e m g e n e r a t i n g P R O G 2 _ O B J S l i s t .
! E R R O R P r o b l e m g e n e r a t i n g P R O G 2 _ O B J S l i s t .
! E N D I F
! E N D I F
PROG2_OBJS = $( PROG2_OBJS:.c= .obj)
PROG2_OBJS = $( PROG2_OBJS:.c= .obj)
PROG2_OBJS = $( PROG2_OBJS:/= \)
PROG2_OBJS = $( PROG2_OBJS) $( PROG2_OBJDIR) \a dig.obj
PROG2_OBJS = $( PROG2_OBJS) $( PROG2_OBJDIR) \a dig.obj
!IF [ECHO PROG3_OBJS=^$(PROG3_OBJDIR)\$(SAMPLESOURCES : = $( PROG 3_OBJDIR ^) \) > .\prog 3_objs .inc ] == 0
!IF [ECHO PROG3_OBJS=^$(PROG3_OBJDIR)\$(SAMPLESOURCES : = $( PROG 3_OBJDIR ^) \) > .\prog 3_objs .inc ] == 0
@ -328,10 +331,12 @@ PROG2_OBJS = $(PROG2_OBJS) $(PROG2_OBJDIR)\adig.obj
! E R R O R P r o b l e m g e n e r a t i n g P R O G 3 _ O B J S l i s t .
! E R R O R P r o b l e m g e n e r a t i n g P R O G 3 _ O B J S l i s t .
! E N D I F
! E N D I F
PROG3_OBJS = $( PROG3_OBJS:.c= .obj)
PROG3_OBJS = $( PROG3_OBJS:.c= .obj)
PROG3_OBJS = $( PROG3_OBJS:/= \)
PROG3_OBJS = $( PROG3_OBJS) $( PROG3_OBJDIR) \a host.obj
PROG3_OBJS = $( PROG3_OBJS) $( PROG3_OBJDIR) \a host.obj
! E N D I F
! E N D I F
# --------------------------------
# --------------------------------
# Only our custom inference rules
# Only our custom inference rules
# --------------------------------
# --------------------------------
@ -339,21 +344,33 @@ PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj
.SUFFIXES :
.SUFFIXES :
.SUFFIXES : .c .rc
.SUFFIXES : .c .rc
{$(SRCDIR)}.rc{$(CARES_OBJDIR)}.res :
{$(SRCDIR)\src\lib }.rc{$(CARES_OBJDIR)}.res :
$( RC_CMD) /Fo $@ $<
$( RC_CMD) /Fo $@ $<
{$(SRCDIR)}.c{$(CARES_OBJDIR)}.obj :
{$(SRCDIR)\src\lib }.c{$(CARES_OBJDIR)}.obj :
$( CC_CMD) $( CC_CFLAGS) $( CARES_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
$( CC_CMD) $( CC_CFLAGS) $( CARES_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
{$(SRCDIR)}.c{$(PROG1_OBJDIR)}.obj :
{$(SRCDIR)\src\tools }.c{$(PROG1_OBJDIR)}.obj :
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
{$(SRCDIR)}.c{$(PROG2_OBJDIR)}.obj :
{$(SRCDIR)\src\tools }.c{$(PROG2_OBJDIR)}.obj :
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
{$(SRCDIR)}.c{$(PROG3_OBJDIR)}.obj :
{$(SRCDIR)\src\tools }.c{$(PROG3_OBJDIR)}.obj :
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
# Hack Alert! we reference ../lib/ files in the Makefile.inc for tools as they
# share some files with the library itself. We need to hack around that here.
{$(SRCDIR)\src\lib}.c{$(PROG1_OBJDIR)\..\lib}.obj :
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$( PROG1_OBJDIR) \$ ( @F) /Fd$( PROG1_OBJDIR) \ /c $<
{$(SRCDIR)\src\lib}.c{$(PROG2_OBJDIR)\..\lib}.obj :
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$( PROG2_OBJDIR) \$ ( @F) /Fd$( PROG2_OBJDIR) \ /c $<
{$(SRCDIR)\src\lib}.c{$(PROG3_OBJDIR)\..\lib}.obj :
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$( PROG3_OBJDIR) \$ ( @F) /Fd$( PROG3_OBJDIR) \ /c $<
# ------------------------------------------------------------- #
# ------------------------------------------------------------- #
# ------------------------------------------------------------- #
# ------------------------------------------------------------- #
# Default target when no CFG library type has been specified, #
# Default target when no CFG library type has been specified, #
@ -389,22 +406,26 @@ install:
ALL : c -ares acountry adig ahost
ALL : c -ares acountry adig ahost
@
@
c-ares : $( HHEADERS ) $( CSOURCES ) $( CARES_OBJDIR ) $( CARES_OBJS ) $( CARES_OUTDIR )
# $(HHEADERS) $(CSOURCES)
c-ares : $( CARES_OBJDIR ) $( CARES_OBJS ) $( CARES_OUTDIR )
$( CARES_LINK) $( CARES_LFLAGS) /out:$( CARES_OUTDIR) \$ ( CARES_TARGET) $( CARES_OBJS)
$( CARES_LINK) $( CARES_LFLAGS) /out:$( CARES_OUTDIR) \$ ( CARES_TARGET) $( CARES_OBJS)
! I F "$(USE_RES_FILE)" = = "TRUE"
! I F "$(USE_RES_FILE)" = = "TRUE"
@if exist $( CARES_OUTDIR) \$ ( CARES_TARGET) .manifest mt -nologo -manifest $( CARES_OUTDIR) \$ ( CARES_TARGET) .manifest -outputresource:$( CARES_OUTDIR) \$ ( CARES_TARGET) ; 2
@if exist $( CARES_OUTDIR) \$ ( CARES_TARGET) .manifest mt -nologo -manifest $( CARES_OUTDIR) \$ ( CARES_TARGET) .manifest -outputresource:$( CARES_OUTDIR) \$ ( CARES_TARGET) ; 2
! E N D I F
! E N D I F
acountry : c -ares acountry .c $( SAMPLESOURCES ) $( SAMPLEHEADERS ) $( PROG 1_OBJDIR ) $( PROG 1_OBJS ) $( PROG 1_OUTDIR )
# acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
$( SPROG_LINK) $( SPROG_LFLAGS) /out:$( PROG1_OUTDIR) \a country.exe $( PROG1_OBJS)
acountry : c -ares $( PROG 1_OBJDIR ) $( PROG 1_OBJS ) $( PROG 1_OUTDIR )
$( SPROG_LINK) $( SPROG_LFLAGS) /out:$( PROG1_OUTDIR) \a country.exe $( PROG1_OBJS:..\l ib= )
@if exist $( PROG1_OUTDIR) \a country.exe.manifest mt -nologo -manifest $( PROG1_OUTDIR) \a country.exe.manifest -outputresource:$( PROG1_OUTDIR) \a country.exe; 1
@if exist $( PROG1_OUTDIR) \a country.exe.manifest mt -nologo -manifest $( PROG1_OUTDIR) \a country.exe.manifest -outputresource:$( PROG1_OUTDIR) \a country.exe; 1
adig : c -ares adig .c $( SAMPLESOURCES ) $( SAMPLEHEADERS ) $( PROG 2_OBJDIR ) $( PROG 2_OBJS ) $( PROG 2_OUTDIR )
# adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
$( SPROG_LINK) $( SPROG_LFLAGS) /out:$( PROG2_OUTDIR) \a dig.exe $( PROG2_OBJS)
adig : c -ares $( PROG 2_OBJDIR ) $( PROG 2_OBJS ) $( PROG 2_OUTDIR )
$( SPROG_LINK) $( SPROG_LFLAGS) /out:$( PROG2_OUTDIR) \a dig.exe $( PROG2_OBJS:..\l ib= )
@if exist $( PROG2_OUTDIR) \a dig.exe.manifest mt -nologo -manifest $( PROG2_OUTDIR) \a dig.exe.manifest -outputresource:$( PROG2_OUTDIR) \a dig.exe; 1
@if exist $( PROG2_OUTDIR) \a dig.exe.manifest mt -nologo -manifest $( PROG2_OUTDIR) \a dig.exe.manifest -outputresource:$( PROG2_OUTDIR) \a dig.exe; 1
ahost : c -ares ahost .c $( SAMPLESOURCES ) $( SAMPLEHEADERS ) $( PROG 3_OBJDIR ) $( PROG 3_OBJS ) $( PROG 3_OUTDIR )
# ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
$( SPROG_LINK) $( SPROG_LFLAGS) /out:$( PROG3_OUTDIR) \a host.exe $( PROG3_OBJS)
ahost : c -ares $( PROG 3_OBJDIR ) $( PROG 3_OBJS ) $( PROG 3_OUTDIR )
$( SPROG_LINK) $( SPROG_LFLAGS) /out:$( PROG3_OUTDIR) \a host.exe $( PROG3_OBJS:..\l ib= )
@if exist $( PROG3_OUTDIR) \a host.exe.manifest mt -nologo -manifest $( PROG3_OUTDIR) \a host.exe.manifest -outputresource:$( PROG3_OUTDIR) \a host.exe; 1
@if exist $( PROG3_OUTDIR) \a host.exe.manifest mt -nologo -manifest $( PROG3_OUTDIR) \a host.exe.manifest -outputresource:$( PROG3_OUTDIR) \a host.exe; 1
$(CARES_OUTDIR) : $( CARES_DIR )
$(CARES_OUTDIR) : $( CARES_DIR )
@ -444,10 +465,10 @@ install:
@if not exist " $( INSTALL_DIR_LIB) " mkdir " $( INSTALL_DIR_LIB) "
@if not exist " $( INSTALL_DIR_LIB) " mkdir " $( INSTALL_DIR_LIB) "
@if not exist " $( INSTALL_DIR_INC) " mkdir " $( INSTALL_DIR_INC) "
@if not exist " $( INSTALL_DIR_INC) " mkdir " $( INSTALL_DIR_INC) "
@copy /y $( CARES_OUTDIR) \* .* " $( INSTALL_DIR_LIB) " >NUL
@copy /y $( CARES_OUTDIR) \* .* " $( INSTALL_DIR_LIB) " >NUL
@copy /y $( SRCDIR) \a res.h " $( INSTALL_DIR_INC) " >NUL
@copy /y $( SRCDIR) \i nclude\ a res.h " $( INSTALL_DIR_INC) " >NUL
@copy /y $( SRCDIR) \a res_build.h " $( INSTALL_DIR_INC) " >NUL
@copy /y $( SRCDIR) \i nclude\ a res_build.h " $( INSTALL_DIR_INC) " >NUL
@copy /y $( SRCDIR) \a res_rules.h " $( INSTALL_DIR_INC) " >NUL
@copy /y $( SRCDIR) \i nclude\ a res_rules.h " $( INSTALL_DIR_INC) " >NUL
@copy /y $( SRCDIR) \a res_version.h " $( INSTALL_DIR_INC) " >NUL
@copy /y $( SRCDIR) \i nclude\ a res_version.h " $( INSTALL_DIR_INC) " >NUL
@echo Installed c-ares $( CFG)
@echo Installed c-ares $( CFG)
! E N D I F
! E N D I F