@@ -16,11 +16,11 @@ # Copyright (c) 2001 ActiveState Corporation. # Copyright (c) 2001-2002 David Gravereaux. # Copyright (c) 2003-2006 Pat Thoyts # #------------------------------------------------------------------------- -# RCS: @(#)$Id: makefile.vc,v 1.4 2007/09/06 21:01:55 patthoyts Exp $ +# RCS: @(#)$Id: makefile.vc,v 1.5 2008/03/19 02:34:21 patthoyts Exp $ #------------------------------------------------------------------------- # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define # VCINSTALLDIR instead. The MSVC Toolkit release defines yet another. @@ -171,11 +171,13 @@ DLLOBJS = \ $(TMP_DIR)\tls.obj \ $(TMP_DIR)\tlsBIO.obj \ $(TMP_DIR)\tlsIO.obj \ $(TMP_DIR)\tlsX509.obj \ +!if !$(STATIC_BUILD) $(TMP_DIR)\tls.res +!endif #------------------------------------------------------------------------- # Locate the OpenSSL library and headers #------------------------------------------------------------------------- @@ -248,20 +250,13 @@ !else cdebug = -Zi -WX $(DEBUGFLAGS) !endif ### Declarations common to all compiler options -cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE +cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ -# Warning level -!if $(FULLWARNINGS) -cflags = $(cflags) -W4 -!else -cflags = $(cflags) -W3 -!endif - !if $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else crt = -MD @@ -304,14 +299,10 @@ !endif ### Declarations common to all linker options lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) -!if $(FULLWARNINGS) -lflags = $(lflags) -warn:3 -!endif - !if $(PROFILE) lflags = $(lflags) -profile !endif !if $(ALIGN98_HACK) && !$(STATIC_BUILD) @@ -337,11 +328,13 @@ !endif # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" +!if $(VCVERSION) >= 1400 && $(VCVERSION) < 1500 baselibs = $(baselibs) bufferoverflowU.lib +!endif !endif baselibs = $(baselibs) $(SSL_LIBS) ws2_32.lib user32.lib gdi32.lib advapi32.lib #--------------------------------------------------------------------- @@ -355,39 +348,38 @@ #--------------------------------------------------------------------- # Project specific targets (EDIT) #--------------------------------------------------------------------- all: setup $(PROJECT) -$(PROJECT): setup $(PRJLIB) +$(PROJECT): setup $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\tls.tcl $(PRJLIB) install: install-binaries install-libraries install-docs -# Tests need to ensure we load the right dll file we -# have to handle the output differently on Win9x. -# -!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" test: setup $(PROJECT) - set TCL_LIBRARY=$(ROOT)/library - $(TCLSH) << -load $(PRJLIB:\=/) -source [file join $(LIBDIR) tls.tcl] -cd "$(ROOT)/tests" -set argv "$(TESTFLAGS)" -source all.tcl -<< + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TCLLIBPATH=$(OUT_DIR:\=/) +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif +!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" + $(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) +!else + @echo Please wait while the tests are collected... + $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log + type tests.log | more +!endif + +shell: setup $(PROJECT) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TCLLIBPATH=$(OUT_DIR:\=/) +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) !else -test: setup $(PROJECT) - echo Please wait while the test results are collected - set TCL_LIBRARY=$(ROOT)/library - $(TCLSH) << >tests.log -load $(PRJLIB:\=/) -source [file normalize [file join $(LIBDIR) tls.tcl]] -cd "$(ROOT)/tests" -set argv "$(TESTFLAGS)" -source all.tcl -<< - type tests.log | more + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif + $(DEBUGGER) $(TCLSH) setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) @@ -449,15 +441,19 @@ #------------------------------------------------------------------------- # Explicit dependency rules # #------------------------------------------------------------------------- -$(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in - nmakehlp -s << $** > $@ -@PACKAGE_VERSION@ $(DOTVERSION) -@PACKAGE_NAME@ $(PROJECT) -@PKG_LIB_FILE@ $(PRJLIBNAME) +.PHONY: $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\tls.tcl + +$(OUT_DIR)\tls.tcl: $(GENERICDIR)\tls.tcl + @$(COPY) $** $@ + +$(OUT_DIR)\pkgIndex.tcl: + @type << > $@ +if {![package vsatisfies [package provide Tcl] 8.3]} {return} +package ifneeded $(PROJECT) $(DOTVERSION) "source \[file join [list $$dir] tls.tcl\] ; tls::initlib [list $$dir] $(PRJLIBNAME)" << #--------------------------------------------------------------------- # Installation. (EDIT) # @@ -473,15 +469,11 @@ install-libraries: @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)' @if exist $(LIBDIR) $(CPY) $(LIBDIR)\tls.tcl "$(SCRIPT_INSTALL_DIR)" > NUL @echo Installing package index in '$(SCRIPT_INSTALL_DIR)' - @type << >"$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" -# pkgIndex.tcl - -if {![package vsatisfies [package provide Tcl] 8.3]} {return} -package ifneeded $(PROJECT) $(DOTVERSION) "[list load [file join $$dir $(PROJECT)$(VERSION).$(EXT)] Tls] ; [list source [file join $$dir tls.tcl]]" -<< + @$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)" install-docs: @echo Installing documentation files to '$(DOC_INSTALL_DIR)' @if exist $(DOCDIR) $(CPY) $(DOCDIR)\tls.htm "$(DOC_INSTALL_DIR)" >NUL