From a3ad9e134949e14cc0ab4785f001c6740a0c8a93 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Mon, 19 Nov 2007 23:36:24 +0000 Subject: [PATCH] Support added for building for AMD64 Windows git-svn-id: svn://svn.equi4.com/kitgen/trunk@1847 9e558909-932a-0410-a563-af77432da1eb --- Makefile.vc | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Makefile.vc b/Makefile.vc index 20d3109..f80ae68 100644 --- a/Makefile.vc +++ b/Makefile.vc @@ -36,6 +36,14 @@ UPX=0 !endif !endif +!ifndef MACHINE +!if "$(CPU)" == "" || "$(CPU)" == "i386" +MACHINE = IX86 +!else +MACHINE = $(CPU) +!endif +!endif + MAKE = $(MAKE) -nologo CPY = xcopy /i /y >NUL COPY = copy /y >NUL @@ -49,14 +57,18 @@ BUILD = $(MAKEDIR)\build PARTS = vqtcl zlib vfs OPTS = static,msvcrt X = sx +!ifndef KITOPTS KITOPTS = +!endif LIBS = user32.lib gdi32.lib comdlg32.lib comctl32.lib \ shell32.lib imm32.lib advapi32.lib !else PARTS = vqtcl zlib vfs threaddyn OPTS = static,msvcrt,threads X = tsx +!ifndef KITOPTS KITOPTS = -t +!endif LIBS = user32.lib gdi32.lib !endif @@ -67,13 +79,19 @@ CFLAGS = -MDd -Od -Zi -D_DEBUG $(CFLAGS) LDFLAGS = -debug UPXCOMP = !else -CFLAGS = -MD -O2 -DNDEBUG $(CFLAGS) -LDFLAGS = -release +CFLAGS = -MD -Zi -O2 -DNDEBUG $(CFLAGS) +LDFLAGS = -debug !if $(UPX) UPXCOMP = upx -q9 $@ >NUL !endif !endif +# Avoid 'unresolved external symbol __security_cookie' errors. +# c.f. http://support.microsoft.com/?id=894573 +!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" +LIBS = $(LIBS) bufferoverflowU.lib +!endif + #------------------------------------------------------------------------- # MSVC8 (ships with Visual Studio 2005) generates a manifest # file that we should link into the binaries. This is how. @@ -83,8 +101,10 @@ _VC_MANIFEST_EMBED_EXE= _VC_MANIFEST_EMBED_DLL= VCVER=0 !if ![echo VCVERSION=_MSC_VER > vercl.x] \ - && ![cl -nologo -TC -P vercl.x $(ERRNULL)] + && ![cl -nologo -TC -P vercl.x >NUL] !include vercl.i +!if ![del /q vercl.i vercl.x >NUL] +!endif !if $(VCVERSION) >= 1400 VCVER=8 _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 @@ -150,7 +170,7 @@ $(BUILD)\lib\tcl$V$X.lib: OUT_DIR=$(BUILD)\tcl release & \ $(MAKE) -f Makefile.vc INSTALLDIR=$(BUILD) \ OPTS=$(OPTS) TMP_DIR=$(BUILD)\tcl \ - OUT_DIR=$(BUILD)\tcl install + OUT_DIR=$(BUILD)\tcl install-binaries install-libraries tk: $(BUILD)\lib\tk$V$X.lib $(BUILD)\lib\tk$V$X.lib: @@ -187,7 +207,7 @@ $(BUILD)\vfs.obj: zlib: $(BUILD)\lib\zlib.lib $(BUILD)\lib\zlib.lib: - pushd ..\..\8.x\zlib & $(MAKE) -f win32/makefile.msc zlib.lib \ + pushd ..\..\8.x\zlib & $(MAKE) -f win32/makefile.msc clean zlib.lib \ & $(COPY) zlib.lib $(BUILD)\lib\zlib.lib $(BUILD)\pwb.obj: ..\..\pwb.c -- 2.23.0