Files
git/compat/vcbuild/Makefile
Jeff Hostetler ec0610e6c8 msvc: add NuGet scripts for building with VS2015
This commit contains a GNU Makefile and NuGet configuration scripts to
download and install the various third-party libraries that we will need
to build/link with when using VS2015 to build Git.

The file "compat/vcbuild/README_VS2015.txt" contains instructions for
using this.

In this commit, "compat/vcbuild/Makefile" contains hard-coded version
numbers of the packages we require.  These are set to the current
versions as of the time of this commit.  We use "nuget restore" to
install them explicitly using a "package.config".  A future improvement
would try to use some of the automatic package management functions and
eliminate the need to specify exact versions.  I tried, but could not
get this to work.  NuGet was happy dowload "minimum requirements" rather
than "lastest" for dependencies -- and only look at one package at a
time.  For example, both curl and openssl depend upon zlib and have
different minimums.  It was unclear which version of zlib would be
installed and seemed to be dependent on the order of the top-level
packages.  So, I'm skipping that for now.

We need to be very precise when specifying NuGet package versions: while
nuget.exe auto-completes a version, say, 1.0.2 to 1.0.2.0, we will want
to parse packages.config ourselves, to generate the Visual Studio
solution, and there we need the exact version number to be able to
generate the exact path to the correct .targets file.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2018-08-28 16:18:12 -04:00

123 lines
3.8 KiB
Makefile

## Makefile to install nuget package dependencies.
##################################################################
INST=GEN.DEPS
INST_INC=$(INST)/include
INST_LIB=$(INST)/lib
INST_BIN=$(INST)/bin
PKGDIR=GEN.PKGS
##################################################################
all: unpack expat libssh libssh_redist curl curl_redist openssl zlib
unpack:
[ -d $(PKGDIR) ] || mkdir $(PKGDIR)
nuget.exe restore packages.config -ConfigFile nuget.config \
-NonInteractive -OutputDirectory $(PKGDIR)
insdir:
[ -d $(INST) ] || mkdir $(INST)
[ -d $(INST_INC) ] || mkdir $(INST_INC)
[ -d $(INST_BIN) ] || mkdir $(INST_BIN)
[ -d $(INST_LIB) ] || mkdir $(INST_LIB)
##################################################################
## We place the expat headers in their own subdirectory.
## The custom is to reference <expat.h>, so compile with:
## -I$(INST_INC)/expat
EXPAT_VER=2.1.0.11
EXPAT_ROOT=$(PKGDIR)/expat.$(EXPAT_VER)/build/native
EXPAT_INC=$(EXPAT_ROOT)/include
EXPAT_LIB=$(EXPAT_ROOT)/lib/v110/x64/Release/dynamic/utf8
expat: insdir
[ -d $(INST_INC)/expat ] || mkdir $(INST_INC)/expat
cp -r $(EXPAT_INC)/* $(INST_INC)/expat/
cp -r $(EXPAT_LIB)/* $(INST_LIB)/
##################################################################
LIBSSH_VER=1.4.3.3
LIBSSH_ROOT=$(PKGDIR)/libssh2.$(LIBSSH_VER)/build/native
LIBSSH_INC=$(LIBSSH_ROOT)/include
LIBSSH_LIB=$(LIBSSH_ROOT)/lib/v110/x64/Release/dynamic/cdecl
libssh: insdir
[ -d $(INST_INC)/libssh2 ] || mkdir $(INST_INC)/libssh2
cp -r $(LIBSSH_INC)/* $(INST_INC)/libssh2
cp -r $(LIBSSH_LIB)/* $(INST_LIB)/
LIBSSH_REDIST_ROOT=$(PKGDIR)/libssh2.redist.$(LIBSSH_VER)/build/native
LIBSSH_REDIST_BIN=$(LIBSSH_REDIST_ROOT)/bin/v110/x64/Release/dynamic/cdecl
libssh_redist: insdir
cp -r $(LIBSSH_REDIST_BIN)/* $(INST_BIN)/
##################################################################
## We place the curl headers in their own subdirectory.
## The custom is to reference <curl/curl.h>, so compile with:
## -I$(INST_INC)
CURL_VER=7.30.0.2
CURL_ROOT=$(PKGDIR)/curl.$(CURL_VER)/build/native
CURL_INC=$(CURL_ROOT)/include/curl
CURL_LIB=$(CURL_ROOT)/lib/v110/x64/Release/dynamic
curl: insdir
[ -d $(INST_INC)/curl ] || mkdir $(INST_INC)/curl
cp -r $(CURL_INC)/* $(INST_INC)/curl
cp -r $(CURL_LIB)/* $(INST_LIB)/
CURL_REDIST_ROOT=$(PKGDIR)/curl.redist.$(CURL_VER)/build/native
CURL_REDIST_BIN=$(CURL_REDIST_ROOT)/bin/v110/x64/Release/dynamic
curl_redist: insdir
cp -r $(CURL_REDIST_BIN)/* $(INST_BIN)/
##################################################################
## We place the openssl headers in their own subdirectory.
## The custom is to reference <openssl/sha.h>, so compile with:
## -I$(INST_INC)
OPENSSL_VER=1.0.2.1
OPENSSL_ROOT=$(PKGDIR)/openssl.v140.windesktop.msvcstl.dyn.rt-dyn.x64.$(OPENSSL_VER)
OPENSSL_INC=$(OPENSSL_ROOT)/build/native/include/openssl
OPENSSL_LIB=$(OPENSSL_ROOT)/lib/native/v140/windesktop/msvcstl/dyn/rt-dyn/x64/release
openssl: insdir
[ -d $(INST_INC)/openssl ] || mkdir $(INST_INC)/openssl
cp -r $(OPENSSL_INC)/* $(INST_INC)/openssl
cp -r $(OPENSSL_LIB)/*.lib $(INST_LIB)/
cp -r $(OPENSSL_LIB)/*.dll $(INST_BIN)/
cp -r $(OPENSSL_LIB)/*.pdb $(INST_BIN)/
##################################################################
## We place the zlib headers in their own subdirectory.
## The custom is to reference <zlib.h>, so compile with:
## -I$(INST_INC)/zlib
ZLIB_VER=1.2.8.8
ZLIB_ROOT=$(PKGDIR)/zlib.v140.windesktop.msvcstl.dyn.rt-dyn.$(ZLIB_VER)
ZLIB_INC=$(ZLIB_ROOT)/build/native/include
ZLIB_LIB=$(ZLIB_ROOT)/lib/native/v140/windesktop/msvcstl/dyn/rt-dyn/x64/Release
zlib: insdir
[ -d $(INST_INC)/zlib ] || mkdir $(INST_INC)/zlib
cp -r $(ZLIB_INC)/* $(INST_INC)/zlib
cp -r $(ZLIB_LIB)/*.lib $(INST_LIB)/
cp -r $(ZLIB_LIB)/*.dll $(INST_BIN)/
##################################################################
clean:
rm -rf $(INST)
clobber: clean
rm -rf $(PKGDIR)