@ -22,7 +22,7 @@
# Usage: nmake /f makefile.msvc CFG=<config> <target>
# Usage: nmake /f makefile.msvc CFG=<config> <target>
#
#
# <config> must be one of: [ lib-release | lib-debug | dll-release | dll-debug }
# <config> must be one of: [ lib-release | lib-debug | dll-release | dll-debug }
# <target> must be one of: [ ALL | c-ares | acountry | a dig | ahost | clean }
# <target> must be one of: [ ALL | c-ares | adig | ahost | clean }
#
#
# If a <target> other than ALL or clean is given, <config> becomes mandatory.
# If a <target> other than ALL or clean is given, <config> becomes mandatory.
#
#
@ -132,7 +132,7 @@ VALID_CFGSET = TRUE
! MESSAGE Usage : nmake /f makefile .msvc CFG =<config > <target >
! MESSAGE Usage : nmake /f makefile .msvc CFG =<config > <target >
! M E S S A G E
! M E S S A G E
! MESSAGE <config> must be one of : [ lib -release | lib -debug | dll -release | dll -debug }
! MESSAGE <config> must be one of : [ lib -release | lib -debug | dll -release | dll -debug }
! MESSAGE <target> must be one of : [ ALL | c -ares | acountry | a dig | ahost | clean }
! MESSAGE <target> must be one of : [ ALL | c -ares | adig | ahost | clean }
! M E S S A G E
! M E S S A G E
! M E S S A G E I f a < t a r g e t > o t h e r t h a n A L L o r c l e a n i s g i v e n , < c o n f i g > b e c o m e s m a n d a t o r y .
! M E S S A G E I f a < t a r g e t > o t h e r t h a n A L L o r c l e a n i s g i v e n , < c o n f i g > b e c o m e s m a n d a t o r y .
! M E S S A G E
! M E S S A G E
@ -147,7 +147,6 @@ VALID_CFGSET = TRUE
# --------------------------------------------------------
# --------------------------------------------------------
CARES_DIR = $( BASE_DIR) \c ares
CARES_DIR = $( BASE_DIR) \c ares
PROG1_DIR = $( BASE_DIR) \a country
PROG2_DIR = $( BASE_DIR) \a dig
PROG2_DIR = $( BASE_DIR) \a dig
PROG3_DIR = $( BASE_DIR) \a host
PROG3_DIR = $( BASE_DIR) \a host
@ -158,20 +157,16 @@ PROG3_DIR = $(BASE_DIR)\ahost
! I F "$(VALID_CFGSET)" = = "TRUE"
! I F "$(VALID_CFGSET)" = = "TRUE"
CARES_OUTDIR = $( CARES_DIR) \$ ( CFG)
CARES_OUTDIR = $( CARES_DIR) \$ ( CFG)
PROG1_OUTDIR = $( PROG1_DIR) \$ ( CFG)
PROG2_OUTDIR = $( PROG2_DIR) \$ ( CFG)
PROG2_OUTDIR = $( PROG2_DIR) \$ ( CFG)
PROG3_OUTDIR = $( PROG3_DIR) \$ ( CFG)
PROG3_OUTDIR = $( PROG3_DIR) \$ ( CFG)
CARES_OBJDIR = $( CARES_OUTDIR) \o bj
CARES_OBJDIR = $( CARES_OUTDIR) \o bj
PROG1_OBJDIR = $( PROG1_OUTDIR) \o bj
PROG2_OBJDIR = $( PROG2_OUTDIR) \o bj
PROG2_OBJDIR = $( PROG2_OUTDIR) \o bj
PROG3_OBJDIR = $( PROG3_OUTDIR) \o bj
PROG3_OBJDIR = $( PROG3_OUTDIR) \o bj
! E L S E
! E L S E
! U N D E F C A R E S _ O U T D I R
! U N D E F C A R E S _ O U T D I R
! U N D E F P R O G 1 _ O U T D I R
! U N D E F P R O G 2 _ O U T D I R
! U N D E F P R O G 2 _ O U T D I R
! U N D E F P R O G 3 _ O U T D I R
! U N D E F P R O G 3 _ O U T D I R
! U N D E F C A R E S _ O B J D I R
! U N D E F C A R E S _ O B J D I R
! U N D E F P R O G 1 _ O B J D I R
! U N D E F P R O G 2 _ O B J D I R
! U N D E F P R O G 2 _ O B J D I R
! U N D E F P R O G 3 _ O B J D I R
! U N D E F P R O G 3 _ O B J D I R
! E N D I F
! E N D I F
@ -303,17 +298,6 @@ CARES_OBJS = $(CARES_OBJS:.c=.obj)
CARES_OBJS = $( CARES_OBJS) $( CARES_OBJDIR) \c ares.res
CARES_OBJS = $( CARES_OBJS) $( CARES_OBJDIR) \c ares.res
! E N D I F
! E N D I F
!IF [ECHO PROG1_OBJS=^$(PROG1_OBJDIR)\$(SAMPLESOURCES : = $( PROG 1_OBJDIR ^) \) > .\prog 1_objs .inc ] == 0
! I N C L U D E . \ p r o g 1 _ o b j s . i n c
! I F [ D E L . \ p r o g 1 _ o b j s . i n c ]
! E N D I F
! E L S E
! 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
PROG1_OBJS = $( PROG1_OBJS:.c= .obj)
PROG1_OBJS = $( PROG1_OBJS:/= \)
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
! I N C L U D E . \ p r o g 2 _ o b j s . i n c
! I N C L U D E . \ p r o g 2 _ o b j s . i n c
! I F [ D E L . \ p r o g 2 _ o b j s . i n c ]
! I F [ D E L . \ p r o g 2 _ o b j s . i n c ]
@ -352,9 +336,6 @@ PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj
{$(SRCDIR)\src\lib}.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)\src\tools}.c{$(PROG1_OBJDIR)}.obj :
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$@ /Fd$( @D) \ /c $<
{$(SRCDIR)\src\tools}.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 $<
@ -364,9 +345,6 @@ PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj
# Hack Alert! we reference ../lib/ files in the Makefile.inc for tools as they
# 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.
# 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 :
{$(SRCDIR)\src\lib}.c{$(PROG2_OBJDIR)\..\lib}.obj :
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$( PROG2_OBJDIR) \$ ( @F) /Fd$( PROG2_OBJDIR) \ /c $<
$( CC_CMD) $( CC_CFLAGS) $( SPROG_CFLAGS) /Fo$( PROG2_OBJDIR) \$ ( @F) /Fd$( PROG2_OBJDIR) \ /c $<
@ -405,7 +383,7 @@ install:
! I F "$(VALID_CFGSET)" = = "TRUE"
! I F "$(VALID_CFGSET)" = = "TRUE"
ALL : c -ares acountry a dig ahost
ALL : c -ares adig ahost
@
@
# $(HHEADERS) $(CSOURCES)
# $(HHEADERS) $(CSOURCES)
@ -415,11 +393,6 @@ c-ares: $(CARES_OBJDIR) $(CARES_OBJS) $(CARES_OUTDIR)
@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 $(SAMPLESOURCES) $(SAMPLEHEADERS)
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
# adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
# adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
adig : c -ares $( PROG 2_OBJDIR ) $( PROG 2_OBJS ) $( PROG 2_OUTDIR )
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= )
$( SPROG_LINK) $( SPROG_LFLAGS) /out:$( PROG2_OUTDIR) \a dig.exe $( PROG2_OBJS:..\l ib= )
@ -433,9 +406,6 @@ ahost: c-ares $(PROG3_OBJDIR) $(PROG3_OBJS) $(PROG3_OUTDIR)
$(CARES_OUTDIR) : $( CARES_DIR )
$(CARES_OUTDIR) : $( CARES_DIR )
@if not exist $( CARES_OUTDIR) mkdir $( CARES_OUTDIR)
@if not exist $( CARES_OUTDIR) mkdir $( CARES_OUTDIR)
$(PROG1_OUTDIR) : $( PROG 1_DIR )
@if not exist $( PROG1_OUTDIR) mkdir $( PROG1_OUTDIR)
$(PROG2_OUTDIR) : $( PROG 2_DIR )
$(PROG2_OUTDIR) : $( PROG 2_DIR )
@if not exist $( PROG2_OUTDIR) mkdir $( PROG2_OUTDIR)
@if not exist $( PROG2_OUTDIR) mkdir $( PROG2_OUTDIR)
@ -445,9 +415,6 @@ $(PROG3_OUTDIR): $(PROG3_DIR)
$(CARES_OBJDIR) : $( CARES_OUTDIR )
$(CARES_OBJDIR) : $( CARES_OUTDIR )
@if not exist $( CARES_OBJDIR) mkdir $( CARES_OBJDIR)
@if not exist $( CARES_OBJDIR) mkdir $( CARES_OBJDIR)
$(PROG1_OBJDIR) : $( PROG 1_OUTDIR )
@if not exist $( PROG1_OBJDIR) mkdir $( PROG1_OBJDIR)
$(PROG2_OBJDIR) : $( PROG 2_OUTDIR )
$(PROG2_OBJDIR) : $( PROG 2_OUTDIR )
@if not exist $( PROG2_OBJDIR) mkdir $( PROG2_OBJDIR)
@if not exist $( PROG2_OBJDIR) mkdir $( PROG2_OBJDIR)
@ -456,7 +423,6 @@ $(PROG3_OBJDIR): $(PROG3_OUTDIR)
clean :
clean :
@-RMDIR /S /Q $( CARES_OUTDIR) >NUL 2>& 1
@-RMDIR /S /Q $( CARES_OUTDIR) >NUL 2>& 1
@-RMDIR /S /Q $( PROG1_OUTDIR) >NUL 2>& 1
@-RMDIR /S /Q $( PROG2_OUTDIR) >NUL 2>& 1
@-RMDIR /S /Q $( PROG2_OUTDIR) >NUL 2>& 1
@-RMDIR /S /Q $( PROG3_OUTDIR) >NUL 2>& 1
@-RMDIR /S /Q $( PROG3_OUTDIR) >NUL 2>& 1
@ -481,9 +447,6 @@ $(BASE_DIR):
$(CARES_DIR) : $( BASE_DIR )
$(CARES_DIR) : $( BASE_DIR )
@if not exist $( CARES_DIR) mkdir $( CARES_DIR)
@if not exist $( CARES_DIR) mkdir $( CARES_DIR)
$(PROG1_DIR) : $( BASE_DIR )
@if not exist $( PROG1_DIR) mkdir $( PROG1_DIR)
$(PROG2_DIR) : $( BASE_DIR )
$(PROG2_DIR) : $( BASE_DIR )
@if not exist $( PROG2_DIR) mkdir $( PROG2_DIR)
@if not exist $( PROG2_DIR) mkdir $( PROG2_DIR)