From 46f294dbb02b0973abf29bd65b3410acaaa52a79 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 9 Nov 2009 13:24:11 +0000 Subject: [PATCH] Updated MSVC makefile that allows building dynamic and static c-ares libraries in debug and release flavours. Additionally each of the three sample programs is built against each of the four possible c-ares libraries, generating all this a total number of 12 executables and 4 libraries. --- ares/Makefile.am | 2 +- ares/Makefile.msvc | 453 +++++++++++++++++++++++++++++++++++++++++++++ ares/Makefile.vc6 | 275 --------------------------- 3 files changed, 454 insertions(+), 276 deletions(-) create mode 100644 ares/Makefile.msvc delete mode 100644 ares/Makefile.vc6 diff --git a/ares/Makefile.am b/ares/Makefile.am index df0f8780a..45203b307 100644 --- a/ares/Makefile.am +++ b/ares/Makefile.am @@ -52,7 +52,7 @@ noinst_PROGRAMS =$(PROGS) # adig and ahost are just sample programs and thus not mentioned with the # regular sources and headers EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \ - Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES) \ + Makefile.m32 Makefile.netware Makefile.msvc $(man_MANS) $(MSVCFILES) \ config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \ TODO ares_build.h.in $(PDFPAGES) cares.rc diff --git a/ares/Makefile.msvc b/ares/Makefile.msvc new file mode 100644 index 000000000..a4b1e2d2a --- /dev/null +++ b/ares/Makefile.msvc @@ -0,0 +1,453 @@ +# $Id$ + +# Copyright (C) 2009 by Daniel Stenberg +# +# Permission to use, copy, modify, and distribute this +# software and its documentation for any purpose and without +# fee is hereby granted, provided that the above copyright +# notice appear in all copies and that both that copyright +# notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in +# advertising or publicity pertaining to distribution of the +# software without specific, written prior permission. +# M.I.T. makes no representations about the suitability of +# this software for any purpose. It is provided "as is" +# without express or implied warranty. + +# ------------------------------------------------------------------------------ +# +# Makefile for building c-ares libraries and sample programs with MSVC. +# +# Usage: nmake /f makefile.msvc CFG= +# +# must be one of: [ lib-release | lib-debug | dll-release | dll-debug } +# must be one of: [ ALL | c-ares | acountry | adig | ahost | clean } +# +# If a other than ALL or clean is given, becomes mandatory. +# +# If neither nor are specified this results in +# all targets being built for all c-ares library types. +# +# This makefile must be processed from the subdir where it is located. +# +# All results are generated below a subdirectory named msvcXXX. +# +# ------------------------------------------------------------------------------ + +# ------------------------------------------------ +# c-ares static and dynamic libraries common base +# file names for release and debug configurations +# ------------------------------------------------ + +LIB_BASENAME = cares +LIB_BASENAME_DEBUG = caresd + +# ------------------------------------------- +# Base names for c-ares DLL import libraries +# ------------------------------------------- + +IMPLIB_BASENAME = $(LIB_BASENAME)_imp +IMPLIB_BASENAME_DEBUG = $(LIB_BASENAME_DEBUG)_imp + +# -------------------------- +# Runtime library selection +# -------------------------- + +RTLIB = /MD +RTLIBD = /MDd + +!IF "$(RTLIBCFG)" == "static" +RTLIB = /MT +RTLIBD = /MTd +!ENDIF + +# -------------------------------------------------------- +# Define USE_WATT32 to 1 to use the Watt-32 tcp/ip stack, +# otherwise Winsock tcp/ip stack will be used as default. +# -------------------------------------------------------- + +USE_WATT32 = 0 + +# ------------------------------------------- +# Detect NMAKE version deducing MSVC version +# ------------------------------------------- + +!IFNDEF _NMAKE_VER +! MESSAGE Macro _NMAKE_VER not defined. +! MESSAGE Use MSVC's NMAKE to process this makefile. +! ERROR See previous message. +!ENDIF + +!IF "$(_NMAKE_VER)" == "6.00.8168.0" +CC_VERS_NUM = 60 +!ELSEIF "$(_NMAKE_VER)" == "6.00.9782.0" +CC_VERS_NUM = 60 +!ELSEIF "$(_NMAKE_VER)" == "7.00.9466" +CC_VERS_NUM = 70 +!ELSEIF "$(_NMAKE_VER)" == "7.00.9955" +CC_VERS_NUM = 70 +!ELSEIF "$(_NMAKE_VER)" == "7.10.3077" +CC_VERS_NUM = 71 +!ELSEIF "$(_NMAKE_VER)" == "8.00.40607.16" +CC_VERS_NUM = 80 +!ELSEIF "$(_NMAKE_VER)" == "8.00.50727.42" +CC_VERS_NUM = 80 +!ELSEIF "$(_NMAKE_VER)" == "8.00.50727.762" +CC_VERS_NUM = 80 +!ELSEIF "$(_NMAKE_VER)" == "9.00.21022.08" +CC_VERS_NUM = 90 +!ELSEIF "$(_NMAKE_VER)" == "9.00.30729.01" +CC_VERS_NUM = 90 +!ELSEIF "$(_NMAKE_VER)" == "10.00.20506.01" +CC_VERS_NUM = 100 +!ELSE +! MESSAGE Unknown value for _NMAKE_VER macro: "$(_NMAKE_VER)" +! MESSAGE Please, report this condition on the c-ares development +! MESSAGE mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/ +! ERROR See previous message. +!ENDIF + +CC_VERS_STR = msvc$(CC_VERS_NUM) + +# ---------------------------------------------------- +# Verify that current subdir is the c-ares source one +# ---------------------------------------------------- + +!IF ! EXIST(.\ares_init.c) +! MESSAGE Can not process Makefile.msvc from outside of c-ares source subdirectory. +! MESSAGE Change to the subdirectory where Makefile.msvc is found, and try again. +! ERROR See previous message. +!ENDIF + +# ------------------------------------------------------------------ +# Base subdir is the common root from which other subdirs will hang, +# the name depends on MSVC version being used when building c-ares. +# ------------------------------------------------------------------ + +BASE_DIR = .\$(CC_VERS_STR) + +# ---------------------------------------- +# Subdir holding sources for all projects +# ---------------------------------------- + +SRCDIR = . + +# ------------------------- +# Configuration validation +# ------------------------- + +VALID_CFGSET = FALSE +!IF "$(CFG)" == "lib-release" || "$(CFG)" == "lib-debug" || \ + "$(CFG)" == "dll-release" || "$(CFG)" == "dll-debug" +VALID_CFGSET = TRUE +!ENDIF + +!IF "$(VALID_CFGSET)" == "FALSE" && "$(CFG)" != "" +! MESSAGE MSVC c-ares makefile +! MESSAGE +! MESSAGE Usage: nmake /f makefile.msvc CFG= +! MESSAGE +! MESSAGE must be one of: [ lib-release | lib-debug | dll-release | dll-debug } +! MESSAGE must be one of: [ ALL | c-ares | acountry | adig | ahost | clean } +! MESSAGE +! MESSAGE If a other than ALL or clean is given, becomes mandatory. +! MESSAGE +! MESSAGE If neither nor are specified this results in +! MESSAGE all targets being built for all c-ares library types. +! MESSAGE +! ERROR Choose a valid configuration. +!ENDIF + +# -------------------------------------------------------- +# Project subdirs independent of configuration being used +# -------------------------------------------------------- + +CARES_DIR = $(BASE_DIR)\cares +PROG1_DIR = $(BASE_DIR)\acountry +PROG2_DIR = $(BASE_DIR)\adig +PROG3_DIR = $(BASE_DIR)\ahost + +# --------------------------------------------------- +# Subdirs which are configuration dependent are only +# defined when a valid configuration has been given. +# --------------------------------------------------- + +!IF "$(VALID_CFGSET)" == "TRUE" +CARES_OUTDIR = $(CARES_DIR)\$(CFG) +PROG1_OUTDIR = $(PROG1_DIR)\$(CFG) +PROG2_OUTDIR = $(PROG2_DIR)\$(CFG) +PROG3_OUTDIR = $(PROG3_DIR)\$(CFG) +CARES_OBJDIR = $(CARES_OUTDIR)\obj +PROG1_OBJDIR = $(PROG1_OUTDIR)\obj +PROG2_OBJDIR = $(PROG2_OUTDIR)\obj +PROG3_OBJDIR = $(PROG3_OUTDIR)\obj +!ELSE +!UNDEF CARES_OUTDIR +!UNDEF PROG1_OUTDIR +!UNDEF PROG2_OUTDIR +!UNDEF PROG3_OUTDIR +!UNDEF CARES_OBJDIR +!UNDEF PROG1_OBJDIR +!UNDEF PROG2_OBJDIR +!UNDEF PROG3_OBJDIR +!ENDIF + +# ------------------------------------- +# Settings that depend on tcp/ip stack +# ------------------------------------- + +!IF "$(USE_WATT32)" == "1" +CFLAGS = /UWIN32 /DWATT32 /I$(WATT_ROOT)\inc +EX_LIBS = $(WATT_ROOT)\lib\wattcpvc_imp.lib +!ELSE +CFLAGS = /DWIN32 +EX_LIBS = ws2_32.lib advapi32.lib +!ENDIF + +# ----------------------------------------- +# Switches that depend on compiler version +# ----------------------------------------- + +!IF $(CC_VERS_NUM) == 60 +PDB_NONE = /pdb:none +PDBTYPE_CONSOLIDATE = /pdbtype:consolidate +!ELSE +!UNDEF PDB_NONE +!UNDEF PDBTYPE_CONSOLIDATE +!ENDIF + +# ---------------------------- +# Assorted commands and flags +# ---------------------------- + +CC_CMD_NODBG = cl.exe /nologo $(RTLIB) /DNDEBUG /O2 +CC_CMD_DEBUG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi /GZ +CC_CFLAGS = $(CFLAGS) /I. /W3 /GX /FD + +RC_CMD_NODBG = rc.exe /l 0x409 /d "NDEBUG" +RC_CMD_DEBUG = rc.exe /l 0x409 /d "_DEBUG" + +LINK_CMD_LIB = link.exe /lib /nologo +LINK_CMD_DLL = link.exe /dll /nologo /incremental:no /fixed:no +LINK_CMD_EXE = link.exe /nologo /incremental:no /fixed:no /subsystem:console + +LINK_CMD_EXE_NODBG = $(LINK_CMD_EXE) /release $(PDB_NONE) +LINK_CMD_EXE_DEBUG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE) + +# --------------------------------- +# Configuration dependent settings +# --------------------------------- + +!IF "$(CFG)" == "lib-release" +CARES_TARGET = $(LIB_BASENAME).lib +CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB +CARES_LFLAGS = +SPROG_CFLAGS = /DCARES_STATICLIB +SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS) $(LIB_BASENAME).lib +CARES_LINK = $(LINK_CMD_LIB) +SPROG_LINK = $(LINK_CMD_EXE_NODBG) +CC_CMD = $(CC_CMD_NODBG) +!ENDIF + +!IF "$(CFG)" == "lib-debug" +CARES_TARGET = $(LIB_BASENAME_DEBUG).lib +CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD +CARES_LFLAGS = +SPROG_CFLAGS = /DCARES_STATICLIB +SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS) $(LIB_BASENAME_DEBUG).lib +CARES_LINK = $(LINK_CMD_LIB) +SPROG_LINK = $(LINK_CMD_EXE_DEBUG) +CC_CMD = $(CC_CMD_DEBUG) +!ENDIF + +!IF "$(CFG)" == "dll-release" +CARES_TARGET = $(LIB_BASENAME).dll +CARES_CFLAGS = /DCARES_BUILDING_LIBRARY +CARES_LFLAGS = /release $(EX_LIBS) /implib:$(CARES_OUTDIR)\$(IMPLIB_BASENAME).lib $(PDB_NONE) +SPROG_CFLAGS = +SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS) $(IMPLIB_BASENAME).lib +CARES_LINK = $(LINK_CMD_DLL) +SPROG_LINK = $(LINK_CMD_EXE_NODBG) +CC_CMD = $(CC_CMD_NODBG) +USE_RES_FILE = TRUE +RC_CMD = $(RC_CMD_NODBG) +!ENDIF + +!IF "$(CFG)" == "dll-debug" +CARES_TARGET = $(LIB_BASENAME_DEBUG).dll +CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD +CARES_LFLAGS = /debug $(EX_LIBS) /implib:$(CARES_OUTDIR)\$(IMPLIB_BASENAME_DEBUG).lib /pdb:$(CARES_OUTDIR)\$(LIB_BASENAME_DEBUG).pdb $(PDBTYPE_CONSOLIDATE) +SPROG_CFLAGS = +SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS) $(IMPLIB_BASENAME_DEBUG).lib +CARES_LINK = $(LINK_CMD_DLL) +SPROG_LINK = $(LINK_CMD_EXE_DEBUG) +CC_CMD = $(CC_CMD_DEBUG) +USE_RES_FILE = TRUE +RC_CMD = $(RC_CMD_DEBUG) +!ENDIF + +# -------------------------------------------- +# Makefile.inc provides lists of source files +# -------------------------------------------- + +!INCLUDE .\Makefile.inc + +# ---------------------------- +# Build lists of object files +# ---------------------------- + +!IF "$(VALID_CFGSET)" == "TRUE" + +!IF [ECHO CARES_OBJS=^$(CARES_OBJDIR)\$(CSOURCES: = $(CARES_OBJDIR^)\) > .\cares_objs.inc] == 0 +!INCLUDE .\cares_objs.inc +!IF [DEL .\cares_objs.inc] +!ENDIF +!ELSE +!ERROR Problem generating CARES_OBJS list. +!ENDIF +CARES_OBJS = $(CARES_OBJS:.c=.obj) +!IF "$(USE_RES_FILE)" == "TRUE" +CARES_OBJS = $(CARES_OBJS) $(CARES_OBJDIR)\cares.res +!ENDIF + +!IF [ECHO PROG1_OBJS=^$(PROG1_OBJDIR)\$(SAMPLESOURCES: = $(PROG1_OBJDIR^)\) > .\prog1_objs.inc] == 0 +!INCLUDE .\prog1_objs.inc +!IF [DEL .\prog1_objs.inc] +!ENDIF +!ELSE +!ERROR Problem generating PROG1_OBJS list. +!ENDIF +PROG1_OBJS = $(PROG1_OBJS:.c=.obj) +PROG1_OBJS = $(PROG1_OBJS) $(PROG1_OBJDIR)\acountry.obj + +!IF [ECHO PROG2_OBJS=^$(PROG2_OBJDIR)\$(SAMPLESOURCES: = $(PROG2_OBJDIR^)\) > .\prog2_objs.inc] == 0 +!INCLUDE .\prog2_objs.inc +!IF [DEL .\prog2_objs.inc] +!ENDIF +!ELSE +!ERROR Problem generating PROG2_OBJS list. +!ENDIF +PROG2_OBJS = $(PROG2_OBJS:.c=.obj) +PROG2_OBJS = $(PROG2_OBJS) $(PROG2_OBJDIR)\adig.obj + +!IF [ECHO PROG3_OBJS=^$(PROG3_OBJDIR)\$(SAMPLESOURCES: = $(PROG3_OBJDIR^)\) > .\prog3_objs.inc] == 0 +!INCLUDE .\prog3_objs.inc +!IF [DEL .\prog3_objs.inc] +!ENDIF +!ELSE +!ERROR Problem generating PROG3_OBJS list. +!ENDIF +PROG3_OBJS = $(PROG3_OBJS:.c=.obj) +PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj + +!ENDIF + +# -------------------------------- +# Only our custom inference rules +# -------------------------------- + +.SUFFIXES: +.SUFFIXES: .c .rc + +{$(SRCDIR)}.rc{$(CARES_OBJDIR)}.res: + $(RC_CMD) /Fo $@ $< + +{$(SRCDIR)}.c{$(CARES_OBJDIR)}.obj: + $(CC_CMD) $(CC_CFLAGS) $(CARES_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< + +{$(SRCDIR)}.c{$(PROG1_OBJDIR)}.obj: + $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< + +{$(SRCDIR)}.c{$(PROG2_OBJDIR)}.obj: + $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< + +{$(SRCDIR)}.c{$(PROG3_OBJDIR)}.obj: + $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< + +# ------------------------------------------------------------- # +# ------------------------------------------------------------- # +# Default target when no CFG library type has been specified, # +# results in building target ALL for all c-ares library types. # +# ------------------------------------------------------------- # +# ------------------------------------------------------------- # + +!IF "$(VALID_CFGSET)" == "FALSE" + +ALL: + $(MAKE) /f .\Makefile.msvc CFG=lib-release ALL + $(MAKE) /f .\Makefile.msvc CFG=lib-debug ALL + $(MAKE) /f .\Makefile.msvc CFG=dll-release ALL + $(MAKE) /f .\Makefile.msvc CFG=dll-debug ALL + +clean: + @-RMDIR /S /Q $(BASE_DIR) >NUL 2>&1 + +!ENDIF + +# --------------------------------------------------------------------- +# Targets only available when a proper CFG library type has been given +# --------------------------------------------------------------------- + +!IF "$(VALID_CFGSET)" == "TRUE" + +ALL: c-ares acountry adig ahost + @ + +c-ares: $(HHEADERS) $(CSOURCES) $(CARES_OBJDIR) $(CARES_OBJS) $(CARES_OUTDIR) + $(CARES_LINK) $(CARES_LFLAGS) /out:$(CARES_OUTDIR)\$(CARES_TARGET) $(CARES_OBJS) + +acountry: c-ares acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG1_OBJDIR) $(PROG1_OBJS) $(PROG1_OUTDIR) + $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG1_OUTDIR)\acountry.exe $(PROG1_OBJS) + +adig: c-ares adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG2_OBJDIR) $(PROG2_OBJS) $(PROG2_OUTDIR) + $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG2_OUTDIR)\adig.exe $(PROG2_OBJS) + +ahost: c-ares ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG3_OBJDIR) $(PROG3_OBJS) $(PROG3_OUTDIR) + $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG3_OUTDIR)\ahost.exe $(PROG3_OBJS) + +$(CARES_OUTDIR): $(CARES_DIR) + @if not exist $(CARES_OUTDIR) mkdir $(CARES_OUTDIR) + +$(PROG1_OUTDIR): $(PROG1_DIR) + @if not exist $(PROG1_OUTDIR) mkdir $(PROG1_OUTDIR) + +$(PROG2_OUTDIR): $(PROG2_DIR) + @if not exist $(PROG2_OUTDIR) mkdir $(PROG2_OUTDIR) + +$(PROG3_OUTDIR): $(PROG3_DIR) + @if not exist $(PROG3_OUTDIR) mkdir $(PROG3_OUTDIR) + +$(CARES_OBJDIR): $(CARES_OUTDIR) + @if not exist $(CARES_OBJDIR) mkdir $(CARES_OBJDIR) + +$(PROG1_OBJDIR): $(PROG1_OUTDIR) + @if not exist $(PROG1_OBJDIR) mkdir $(PROG1_OBJDIR) + +$(PROG2_OBJDIR): $(PROG2_OUTDIR) + @if not exist $(PROG2_OBJDIR) mkdir $(PROG2_OBJDIR) + +$(PROG3_OBJDIR): $(PROG3_OUTDIR) + @if not exist $(PROG3_OBJDIR) mkdir $(PROG3_OBJDIR) + +clean: + @-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 $(PROG3_OUTDIR) >NUL 2>&1 + +!ENDIF + +$(BASE_DIR): + @if not exist $(BASE_DIR) mkdir $(BASE_DIR) + +$(CARES_DIR): $(BASE_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) + @if not exist $(PROG2_DIR) mkdir $(PROG2_DIR) + +$(PROG3_DIR): $(BASE_DIR) + @if not exist $(PROG3_DIR) mkdir $(PROG3_DIR) diff --git a/ares/Makefile.vc6 b/ares/Makefile.vc6 deleted file mode 100644 index 4d68f3718..000000000 --- a/ares/Makefile.vc6 +++ /dev/null @@ -1,275 +0,0 @@ -# $Id$ -# -# C-ares makefile for MSVC6+ -# G. Vanem . -# - -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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_setup.h setup_once.h \ - ares.h ares_build.h ares_rules.h - -$(OBJ_DIR)\ares_search.obj: ares_search.c ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_setup.h setup_once.h ares.h \ - ares_build.h ares_rules.h - -$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c ares_setup.h setup_once.h ares.h \ - ares_build.h ares_rules.h - -$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_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 ares_setup.h setup_once.h ares.h \ - ares_writev.h ares_build.h ares_rules.h