[cpp-msbuild] 01/04: SSPCPP-765 build zlib via an nmake file
Rod Widdowson
rdw at steadingsoftware.com
Fri Nov 24 11:31:30 EST 2017
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch master
in repository cpp-msbuild.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-msbuild.git;a=commit;h=08525341d64bfe046d015ccc76ca58b7939ff1b3
commit 08525341d64bfe046d015ccc76ca58b7939ff1b3
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri Nov 24 13:21:04 2017 +0000
SSPCPP-765 build zlib via an nmake file
https://issues.shibboleth.net/jira/browse/SSPCPP-765
---
dependencies/dependency.make | 130 +++++++++++++++++++++++++++++++++++++------
1 file changed, 114 insertions(+), 16 deletions(-)
diff --git a/dependencies/dependency.make b/dependencies/dependency.make
index 5282298..a87b8dc 100644
--- a/dependencies/dependency.make
+++ b/dependencies/dependency.make
@@ -8,20 +8,35 @@
!if "$(VSCMD_ARG_TGT_ARCH)" == "x86"
!message Building x86
OpenSSLName=WIN32
+ZlibTargetDir=.
!elseif "$(VSCMD_ARG_TGT_ARCH)" == "x64"
!message Building x64
OpenSSLName=WIN64A
-
+ZlibTargetDir=x64
!else
!error "Target architecture must be x86 or x64"
!endif
+
!if "$(ROOT_DIR)" == ""
- !error ROOT_DIR not defined
+!error ROOT_DIR not defined
!endif
+
!if "$(VISUALSTUDIOVERSION)" != "15.0"
- !error this code only known to work with VC15
+!error this code only known to work with VC15
!endif
+!if "$(ZLIB_SHAREDLIB)" == ""
+!error ZLIB_SHAREDLIB not defined
+!endif
+
+!if "$(ZLIB_IMPLIB)" == ""
+!error ZLIB_IMPLIB not defined
+!endif
+
+
+##
+## TARGETS
+##
help:
@cls
@echo "TARGETS: clean all
@@ -33,16 +48,106 @@ help:
clean: openssl-clean
-all: openssl
+all: openssl zlib
test-env:
#
+# Zlib
+#
+zlib: zlib-debug zlib-release
+
+zlib-release: zlib-test zlib-release-configure zlib-release-build
+
+zlib-debug: zlib-test zlib-debug-configure zlib-debug-build
+
+zlib-test: test-env $(ROOT_DIR)\$(ZLIB_DIR)\win32\makefile.msc
+
+zlib-clean: zlib-test
+ cd $(ROOT_DIR)\$(ZLIB_DIR)
+ -2 nmake /f win32\makefile.shib clean
+ -2 nmake /f win32\makefile.shib.debug clean
+ -2 del zlib1.sed zlib2.sed zlib3.sed zlib4.sed zlib1d.sed zlib2d.sed
+ -2 rd /s /q Debug
+ -2 rd /s /q Release
+ -2 rd /s /q x64
+ -2 del win32\makefile.shib
+ -2 del win32\makefile.shib.debug
+
+zlib-release-configure: $(ROOT_DIR)\$(ZLIB_DIR)\win32\makefile.shib $(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Release
+
+zlib-debug-configure: $(ROOT_DIR)\$(ZLIB_DIR)\win32\makefile.shib.debug $(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Debug
+
+zlib-release-build: $(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Release\$(ZLIB_SHAREDLIB).dll \
+ $(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Release\$(ZLIB_IMPLIB).lib
+
+zlib-debug-build: $(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Debug\$(ZLIB_SHAREDLIB)D.dll \
+ $(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Debug\$(ZLIB_IMPLIB)D.lib
+
+$(ROOT_DIR)\$(ZLIB_DIR)\win32\makefile.shib: $(ROOT_DIR)\$(ZLIB_DIR)\zlib1.sed \
+ $(ROOT_DIR)\$(ZLIB_DIR)\zlib2.sed \
+ $(ROOT_DIR)\$(ZLIB_DIR)\zlib3.sed \
+ $(ROOT_DIR)\$(ZLIB_DIR)\zlib4.sed
+ cd $(ROOT_DIR)\$(ZLIB_DIR)
+ sed win32\makefile.msc -f zlib1.sed -f zlib2.sed > $@
+
+$(ROOT_DIR)\$(ZLIB_DIR)\win32\makefile.shib.debug: $(ROOT_DIR)\$(ZLIB_DIR)\zlib1d.sed \
+ $(ROOT_DIR)\$(ZLIB_DIR)\zlib2d.sed \
+ $(ROOT_DIR)\$(ZLIB_DIR)\zlib3.sed \
+ $(ROOT_DIR)\$(ZLIB_DIR)\zlib4.sed
+ cd $(ROOT_DIR)\$(ZLIB_DIR)
+ sed win32\makefile.msc -f zlib1d.sed -f zlib2d.sed -f zlib3.sed -f zlib4.sed > $@
+
+$(ROOT_DIR)\$(ZLIB_DIR)\zlib1.sed:
+ echo s/SHAREDLIB =.*$$/SHAREDLIB=$(ZLIB_SHAREDLIB).dll/ > $@
+
+$(ROOT_DIR)\$(ZLIB_DIR)\zlib2.sed:
+ echo s/IMPLIB .*$$/IMPLIB=$(ZLIB_IMPLIB).lib/ > $@
+
+$(ROOT_DIR)\$(ZLIB_DIR)\zlib3.sed $(ROOT_DIR)\$(ZLIB_DIR)\zlib4.sed: $$(@F)
+ copy $(@F) $(ROOT_DIR)\$(ZLIB_DIR)
+
+$(ROOT_DIR)\$(ZLIB_DIR)\zlib1d.sed:
+ echo s/SHAREDLIB =.*$$/SHAREDLIB=$(ZLIB_SHAREDLIB)D.dll/ > $@
+
+$(ROOT_DIR)\$(ZLIB_DIR)\zlib2d.sed:
+ echo s/IMPLIB .*$$/IMPLIB=$(ZLIB_IMPLIB)D.lib/ > $@
+
+$(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Release $(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Debug:
+ mkdir $@
+
+$(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Release\$(ZLIB_IMPLIB).lib: $$(@D)\$(ZLIB_SHAREDLIB).dll
+ copy $(ROOT_DIR)\$(ZLIB_DIR)\$(ZLIB_IMPLIB).lib $(@D)
+
+$(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\Debug\$(ZLIB_IMPLIB)D.lib: $$(@D)\$(ZLIB_SHAREDLIB)D.dll
+ copy $(ROOT_DIR)\$(ZLIB_DIR)\$(ZLIB_IMPLIB)D.lib $(@D)
+
+
+$(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\release\$(ZLIB_SHAREDLIB).dll: $(ROOT_DIR)\$(ZLIB_DIR)\win32\makefile.shib
+ cd $(ROOT_DIR)\$(ZLIB_DIR)
+ nmake/f win32\makefile.shib clean
+ nmake/f win32\makefile.shib
+ copy $(@F) $@
+
+$(ROOT_DIR)\$(ZLIB_DIR)\$(ZlibTargetDir)\debug\$(ZLIB_SHAREDLIB)D.dll: $(ROOT_DIR)\$(ZLIB_DIR)\win32\makefile.shib.debug
+ cd $(ROOT_DIR)\$(ZLIB_DIR)
+ nmake/f win32\makefile.shib.debug clean
+ nmake/f win32\makefile.shib.debug
+ copy $(@F) $@
+
+
+#
# OpenSSL
#
-test-openssl: test-env $(ROOT_DIR)\$(OPENSSL_DIR)
+openssl: openssl-debug openssl-release
+
+openssl-release: openssl-test openssl-release-configure openssl-build
+
+openssl-debug: openssl-test openssl-debug-configure openssl-build
-openssl-clean: test-openssl openssl-clean-configure
+openssl-test: test-env $(ROOT_DIR)\$(OPENSSL_DIR)
+
+openssl-clean: openssl-test openssl-clean-configure
cd $(ROOT_DIR)\$(OPENSSL_DIR)
-2 nmake distclean
-2 rd/s/q x64
@@ -50,16 +155,16 @@ openssl-clean: test-openssl openssl-clean-configure
-2 rd/s/q x86
-2 rd/s/q x86Debug
-openssl-clean-configure:
+openssl-clean-configure: openssl-test
cd $(ROOT_DIR)\$(OPENSSL_DIR)
-2 nmake distclean
-openssl-release-configure: test-openssl $(ROOT_DIR)\$(OPENSSL_DIR)\Configure openssl-clean-configure
+openssl-release-configure: openssl-test $(ROOT_DIR)\$(OPENSSL_DIR)\Configure openssl-clean-configure
title Build OpenSSL $(VSCMD_ARG_TGT_ARCH) Release
cd $(ROOT_DIR)\$(OPENSSL_DIR)
perl Configure VC-$(OpenSSLName) --prefix=%ROOT_DIR%\%OPENSSL_DIR%\$(VSCMD_ARG_TGT_ARCH)
-openssl-debug-configure: test-openssl $(ROOT_DIR)\$(OPENSSL_DIR)\ConfigureD openssl-clean-configure
+openssl-debug-configure: openssl-test $(ROOT_DIR)\$(OPENSSL_DIR)\ConfigureD openssl-clean-configure
title Build OpenSSL $(VSCMD_ARG_TGT_ARCH) Debug
cd $(ROOT_DIR)\$(OPENSSL_DIR)
perl ConfigureD debug-VC-$(OpenSSLName) --prefix=%ROOT_DIR%\%OPENSSL_DIR%\$(VSCMD_ARG_TGT_ARCH)Debug
@@ -68,13 +173,6 @@ openssl-build: $(ROOT_DIR)\$(OPENSSL_DIR)\makefile
cd $(ROOT_DIR)\$(OPENSSL_DIR)
nmake install_sw
-openssl: openssl-debug openssl-release
-
-openssl-release: test-openssl openssl-release-configure openssl-build
-
-openssl-debug: test-openssl openssl-debug-configure openssl-build
-
-curl-clean:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list