summaryrefslogtreecommitdiff
path: root/Makefile.msvc
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-01-17 19:36:41 +0100
committerYang Tse <yangsita@gmail.com>2011-01-17 19:37:21 +0100
commit5a21ba2b661eb77a4167b821af8eddbaeb7290c5 (patch)
treebd7cc50840bae0dc5ed8ec63536cb8aea7ced53a /Makefile.msvc
parentd70721eb65675dd8d85c5cad24ef589eef4b35de (diff)
downloadc-ares-5a21ba2b661eb77a4167b821af8eddbaeb7290c5.tar.gz
c-ares-5a21ba2b661eb77a4167b821af8eddbaeb7290c5.tar.bz2
c-ares-5a21ba2b661eb77a4167b821af8eddbaeb7290c5.zip
build: add install target to Makefile.msvc
Diffstat (limited to 'Makefile.msvc')
-rw-r--r--Makefile.msvc35
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile.msvc b/Makefile.msvc
index 7a2fce0..f72b1be 100644
--- a/Makefile.msvc
+++ b/Makefile.msvc
@@ -139,6 +139,22 @@ BASE_DIR = .\$(CC_VERS_STR)
SRCDIR = .
+# -----------------------------
+# Default installation subdirs
+# -----------------------------
+
+!IFNDEF INSTALL_DIR
+INSTALL_DIR = .
+!ENDIF
+
+!IFNDEF INSTALL_DIR_LIB
+INSTALL_DIR_LIB = $(INSTALL_DIR)\lib
+!ENDIF
+
+!IFNDEF INSTALL_DIR_INC
+INSTALL_DIR_INC = $(INSTALL_DIR)\include
+!ENDIF
+
# -------------------------
# Configuration validation
# -------------------------
@@ -397,6 +413,12 @@ ALL:
clean:
@-RMDIR /S /Q $(BASE_DIR) >NUL 2>&1
+install:
+ @$(MAKE) /nologo /f .\Makefile.msvc CFG=lib-release install
+ @$(MAKE) /nologo /f .\Makefile.msvc CFG=lib-debug install
+ @$(MAKE) /nologo /f .\Makefile.msvc CFG=dll-release install
+ @$(MAKE) /nologo /f .\Makefile.msvc CFG=dll-debug install
+
!ENDIF
# ---------------------------------------------------------------------
@@ -456,6 +478,19 @@ clean:
@-RMDIR /S /Q $(PROG2_OUTDIR) >NUL 2>&1
@-RMDIR /S /Q $(PROG3_OUTDIR) >NUL 2>&1
+install:
+ @if not exist $(CARES_OUTDIR)\$(CARES_TARGET) \
+ $(MAKE) /f .\Makefile.msvc CFG=$(CFG) c-ares
+ @if not exist "$(INSTALL_DIR)" mkdir "$(INSTALL_DIR)"
+ @if not exist "$(INSTALL_DIR_LIB)" mkdir "$(INSTALL_DIR_LIB)"
+ @if not exist "$(INSTALL_DIR_INC)" mkdir "$(INSTALL_DIR_INC)"
+ @copy /y $(CARES_OUTDIR)\*.* "$(INSTALL_DIR_LIB)" >NUL
+ @copy /y $(SRCDIR)\ares.h "$(INSTALL_DIR_INC)" >NUL
+ @copy /y $(SRCDIR)\ares_build.h "$(INSTALL_DIR_INC)" >NUL
+ @copy /y $(SRCDIR)\ares_rules.h "$(INSTALL_DIR_INC)" >NUL
+ @copy /y $(SRCDIR)\ares_version.h "$(INSTALL_DIR_INC)" >NUL
+ @echo Installed c-ares $(CFG)
+
!ENDIF
$(BASE_DIR):