summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnadkarni@noemail.net>2017-09-28 12:22:41 (GMT)
committerapnadkarni <apnadkarni@noemail.net>2017-09-28 12:22:41 (GMT)
commit537ea3c5f64c6852bf7ec5ecbbc85e35d4d5bfab (patch)
tree7b96b26b0c2b30478dccaf8c08f2f9044408389e
parente2049e96a6f259be435360d105d8dd5186bc57b1 (diff)
downloadtcl-537ea3c5f64c6852bf7ec5ecbbc85e35d4d5bfab.zip
tcl-537ea3c5f64c6852bf7ec5ecbbc85e35d4d5bfab.tar.gz
tcl-537ea3c5f64c6852bf7ec5ecbbc85e35d4d5bfab.tar.bz2
Add pkgcflags, appcflags and stubscflags to reflect different compilation modes.vc-reform-tests-pass
Packages compile (at least) three types of objects files - the shared library extension (e.g. tk86.dll), application programs (e.g. wish) and a static stubs library (tkstub86.lib). Thus we need to construct three different sets of compilation flags accordingly. Also updated makefile header comments to reflect modern usage. FossilOrigin-Name: 796c9fe1ab27bb389adf00d26a49566a0443ea0c753282d45f98cadf1f20f391
-rw-r--r--win/makefile.vc117
-rw-r--r--win/rules.vc99
2 files changed, 133 insertions, 83 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index 99d013e..015f6ba 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -1,7 +1,6 @@
-#-------------------------------------------------------------
-# makefile.vc --
+#------------------------------------------------------------- -*- makefile -*-
#
-# Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+)
+# Microsoft Visual C++ makefile for use with nmake
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -11,27 +10,28 @@
# Copyright (c) 2001-2005 ActiveState Corporation.
# Copyright (c) 2001-2004 David Gravereaux.
# Copyright (c) 2003-2008 Pat Thoyts.
+# Copyright (c) 2017 Ashok P. Nadkarni
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# HOW TO USE this makefile:
#
-# 1) It is now necessary to have MSVCDir, MSDevDir or MSSDK set in the
-# environment. This is used as a check to see if vcvars32.bat had been
-# run prior to running nmake or during the installation of Microsoft
-# Visual C++, MSVCDir had been set globally and the PATH adjusted.
-# Either way is valid.
+# 1) It is necessary to have the appropriate Visual C++ environment
+# set up before invoking nmake. The steps required depend on which
+# version of Visual Studio and/or the Windows SDK you are building
+# against and are not described here. With Visual Studio, the simplest
+# is to start a command shell using one of the installed short cuts.
+# An alternative is to run vcvars32.bat, vcvars64.bat, vcvarsamd64_x86.bat
+# etc. depending on the host and target architectures. If compiling
+# with the Windows SDK instead, run (again depending on the SDK version)
+# the setenv.bat or equivalent batch file from the command prompt.
#
-# You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin
-# directory to setup the proper environment, if needed, for your
-# current setup. This is a needed bootstrap requirement and allows the
-# swapping of different environments to be easier.
-#
-# 2) To use the Platform SDK (not expressly needed), run setenv.bat after
+# NOTE: For older (Visual C++ 6 or the 2003 SDK), to use the Platform
+# SDK (not expressly needed), run setenv.bat after
# vcvars32.bat according to the instructions for it. This can also
# turn on the 64-bit compiler, if your SDK has it.
#
-# 3) Targets are:
+# 2) Targets are:
# release -- Builds the core, the shell and the dlls. (default)
# dlls -- Just builds the windows extensions
# shell -- Just builds the shell and the core.
@@ -51,12 +51,8 @@
# troff manual pages found in $(ROOT)\doc. You need to
# have installed the HTML Help Compiler package from Microsoft
# to produce the .chm file.
-# winhelp -- (deprecated) Builds the windows .hlp file for Tcl from
-# the troff man files found in $(ROOT)\doc. This type of
-# help file is deprecated by Microsoft in favour of html
-# help files (.chm)
#
-# 4) Macros usable on the commandline:
+# 3) Macros usable on the commandline:
# INSTALLDIR=<path>
# Sets where to install Tcl from the built binaries.
# C:\Progra~1\Tcl is assumed when not specified.
@@ -67,7 +63,7 @@
# 'none' will over-ride everything to nothing.
#
# loimpact = Adds a flag for how NT treats the heap to keep memory
-# in use, low. This is said to impact alloc performance.
+# in use, low. Said to impact alloc performance.
# msvcrt = Affects the static option only to switch it from
# using libcmt(d) as the C runtime [by default] to
# msvcrt(d). This is useful for static embedding
@@ -113,15 +109,15 @@
# MACHINE=(AMD64|IX86)
# Set the machine type used for the compiler, linker, and
# resource compiler. This hook is needed to tell the tools
-# when alternate platforms are requested. This should normally
-# NOT be set as it is automatically detected based on the
-# compiler in use.
+# when alternate platforms are requested. THIS SHOULD NORMALLY
+# NOT BE SET AS IT IS AUTOMATICALLY DETECTED BASED ON THE
+# COMPILER IN USE.
#
# TMP_DIR=<path>
# OUT_DIR=<path>
# Hooks to allow the intermediate and output directories to be
# changed. $(OUT_DIR) is assumed to be
-# $(BINROOT)\(Release|Debug) based on if symbols are requested.
+# .\(Release|Debug) based on if symbols are requested.
# $(TMP_DIR) will de $(OUT_DIR)\<buildtype> by default.
#
# TESTPAT=<file>
@@ -131,20 +127,20 @@
# name of encoding for configuration information. Defaults
# to cp1252
#
-# 5) Examples:
+# 4) Examples:
#
# Basic syntax of calling nmake looks like this:
# nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]]
#
# Standard (no frills)
-# c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
-# Setting environment for using Microsoft Visual C++ tools.
# c:\tcl_src\win\>nmake -f makefile.vc release
# c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl
#
-# Building for Win64
-# c:\tcl_src\win\>c:\progra~1\platfo~1\setenv.bat /x64 /RETAIL
-# c:\tcl_src\win\>nmake -f makefile.vc
+# With symbols in release builds
+# c:\tcl_src\win\>nmake -f makefile.vc release OPTS=pdbs
+#
+# Debug build
+# c:\tcl_src\win\>nmake -f makefile.vc release OPTS=symbols
#
#------------------------------------------------------------------------------
#==============================================================================
@@ -219,13 +215,6 @@ DDEVERSION = $(DDEDOTVERSION:.=)
REGDOTVERSION = 1.3
REGVERSION = $(REGDOTVERSION:.=)
-TCLIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
-TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
-TCLLIB = $(OUT_DIR)\$(TCLLIBNAME)
-
-TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
-TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
-
TCLREGLIBNAME = $(PROJECT)reg$(REGVERSION)$(SUFX:t=).$(EXT)
TCLREGLIB = $(OUT_DIR)\$(TCLREGLIBNAME)
@@ -460,26 +449,14 @@ TCLSTUBOBJS = \
TOMMATHDIR = $(ROOT)\libtommath
PKGSDIR = $(ROOT)\pkgs
-#---------------------------------------------------------------------
-# Compile flags
-#---------------------------------------------------------------------
-
-
# Additional include and C macro definitions for the implicit rules
# defined in rules.vc
-PRJ_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" -I"$(TOMMATHDIR)"
+PRJ_INCLUDES = -I"$(TOMMATHDIR)"
PRJ_DEFINES = -DTCL_TOMMATH -DMP_PREC=4 -Dinline=__inline -DHAVE_ZLIB=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
-# Define compiler flags used in our private implicit rules that are
-# not covered by rules.vc
-TCL_CFLAGS = $(cflags) $(crt) $(PRJ_INCLUDES) $(PRJ_DEFINES)
-STUB_CFLAGS = $(cflags)
-
-
# Additional Link libraries needed beyond those in rules.vc
PRJ_LIBS = netapi32.lib user32.lib userenv.lib ws2_32.lib
-
#---------------------------------------------------------------------
# TclTest flags
#---------------------------------------------------------------------
@@ -726,7 +703,7 @@ $(OUT_DIR)\tclConfig.sh: $(WINDIR)\tclConfig.sh.in
@TCL_MINOR_VERSION@ $(TCL_MINOR_VERSION)
@TCL_PATCH_LEVEL@ $(TCL_PATCH_LEVEL)
@CC@ $(CC)
-@DEFS@ $(TCL_CFLAGS)
+@DEFS@ $(pkgcflags)
@CFLAGS_DEBUG@ -nologo -c -W3 -YX -Fp$(TMP_DIR)\ -MDd
@CFLAGS_OPTIMIZE@ -nologo -c -W3 -YX -Fp$(TMP_DIR)\ -MD
@LDFLAGS_DEBUG@ -nologo -machine:$(MACHINE) -debug -debugtype:cv
@@ -794,28 +771,28 @@ gendate:
#---------------------------------------------------------------------
$(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
- $(cc32) $(TCL_CFLAGS) -DTCL_TEST \
+ $(cc32) $(appcflags) -DTCL_TEST \
-DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
$(TMP_DIR)\tclMain2.obj: $(GENERICDIR)\tclMain.c
- $(cc32) $(TCL_CFLAGS) -DBUILD_tcl -DTCL_ASCII_MAIN \
+ $(cc32) $(pkgcflags) -DTCL_ASCII_MAIN \
-Fo$@ $?
$(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c
- $(cc32) $(TCL_CFLAGS) -Fo$@ $?
+ $(cc32) $(appcflags) -Fo$@ $?
$(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
- $(cc32) $(TCL_CFLAGS) -Fo$@ $?
+ $(cc32) $(appcflags) -Fo$@ $?
$(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
- $(cc32) $(TCL_CFLAGS) -Fo$@ $?
+ $(cc32) $(appcflags) -Fo$@ $?
$(TMP_DIR)\tclZlib.obj: $(GENERICDIR)\tclZlib.c
- $(cc32) $(TCL_CFLAGS) -I$(COMPATDIR)\zlib -DBUILD_tcl -Fo$@ $?
+ $(cc32) $(pkgcflags) -I$(COMPATDIR)\zlib -Fo$@ $?
$(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c
- $(cc32) -DBUILD_tcl $(TCL_CFLAGS) \
+ $(cc32) $(pkgcflags) \
-DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR:\=\\)\"" \
-DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \
-DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \
@@ -829,7 +806,7 @@ $(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c
-Fo$@ $?
$(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
- $(cc32) $(TCL_CFLAGS) \
+ $(cc32) $(appcflags) \
-DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
@@ -838,17 +815,17 @@ $(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
$(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
!if $(STATIC_BUILD)
- $(cc32) $(TCL_CFLAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
+ $(cc32) $(appcflags) -DSTATIC_BUILD -Fo$@ $?
!else
- $(cc32) $(TCL_CFLAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
+ $(cc32) $(appcflags) -DUSE_TCL_STUBS -Fo$@ $?
!endif
$(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
!if $(STATIC_BUILD)
- $(cc32) $(TCL_CFLAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
+ $(cc32) $(appcflags) -DSTATIC_BUILD -Fo$@ $?
!else
- $(cc32) $(TCL_CFLAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
+ $(cc32) $(appcflags) -DUSE_TCL_STUBS -Fo$@ $?
!endif
@@ -857,13 +834,13 @@ $(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
### specific C run-time.
$(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c
- $(cc32) $(STUB_CFLAGS) -Zl -DSTATIC_BUILD $(PRJ_INCLUDES) -Fo$@ $?
+ $(cc32) $(stubscflags) -Fo$@ $?
$(TMP_DIR)\tclTomMathStubLib.obj: $(GENERICDIR)\tclTomMathStubLib.c
- $(cc32) $(STUB_CFLAGS) -Zl -DSTATIC_BUILD $(PRJ_INCLUDES) -Fo$@ $?
+ $(cc32) $(stubscflags) -Fo$@ $?
$(TMP_DIR)\tclOOStubLib.obj: $(GENERICDIR)\tclOOStubLib.c
- $(cc32) $(STUB_CFLAGS) -Zl -DSTATIC_BUILD $(PRJ_INCLUDES) -Fo$@ $?
+ $(cc32) $(stubscflags) -Fo$@ $?
$(TMP_DIR)\tclsh.exe.manifest: $(WINDIR)\tclsh.exe.manifest.in
@nmakehlp -s << $** >$@
@@ -884,7 +861,7 @@ depend:
@echo Build tclsh first!
!else
$(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
- -passthru:"-DBUILD_tcl $(PRJ_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \
+ -passthru:"-DBUILD_tcl $(TCL_INCLUDES) $(PRJ_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \
$(COMPATDIR),$$(COMPATDIR) $(TOMMATHDIR),$$(TOMMATHDIR) $(WINDIR),$$(WINDIR) @<<
$(TCLOBJS)
<<
@@ -913,12 +890,12 @@ $(TCLOBJS)
#---------------------------------------------------------------------
{$(TOMMATHDIR)}.c{$(TMP_DIR)}.obj::
- $(cc32) $(TCL_CFLAGS) -Fo$(TMP_DIR)\ @<<
+ $(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
$<
<<
{$(COMPATDIR)\zlib}.c{$(TMP_DIR)}.obj::
- $(cc32) $(TCL_CFLAGS) -Fo$(TMP_DIR)\ @<<
+ $(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
$<
<<
diff --git a/win/rules.vc b/win/rules.vc
index f94c894..fe5a8e7 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -139,6 +139,9 @@ TOOLSDIR = $(ROOT)\tools
# TBD - This is a potentially dangerous conflict, rename WINDIR to
# something else
WINDIR = $(ROOT)\win
+!ifndef RCDIR
+RCDIR = $(WINDIR)\rc
+!endif
# The target directory where the built packages and binaries will be installed.
# INSTALLDIR is the (optional) path specified by the user.
@@ -202,6 +205,11 @@ TCLINSTALL = 1
TCLDIR = $(_INSTALLDIR)
_TCLDIR = $(_INSTALLDIR)
_TCL_H = $(_INSTALLDIR)\include\tcl.h
+!elseif exist("..\..\tcl\generic\tcl.h")
+TCLINSTALL = 0
+TCLDIR = ..\..\tcl
+_TCLDIR = $(TCLDIR)
+_TCL_H = $(_TCLDIR)\generic\tcl.h
!endif
!endif # TCLDIR
@@ -531,7 +539,9 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg
# 0 -> Use the non-thread allocator.
# UNCHECKED - 1 -> when doing a debug build with symbols, use the release
# C runtime, 0 -> use the debug C runtime.
-#
+# USE_STUBS - 1 -> compile to use stubs interfaces, 0 -> direct linking
+# CONFIG_CHECK - 1 -> check current build configuration against Tcl
+# configuration (ignored for Tcl itself)
# Further, LINKERFLAGS are modified based on above.
# Default values for all the above
@@ -546,6 +556,12 @@ LOIMPACT = 0
TCL_USE_STATIC_PACKAGES = 0
USE_THREAD_ALLOC = 1
UNCHECKED = 0
+CONFIG_CHECK = 1
+!if "$(PROJECT)" == "tcl" || "$(PROJECT)" == "tk"
+USE_STUBS = 0
+!else
+USE_STUBS = 1
+!endif
# If OPTS is not empty AND does not contain "none" which turns off all OPTS
# set the above macros based on OPTS content
@@ -556,8 +572,11 @@ UNCHECKED = 0
!if [nmakehlp -f $(OPTS) "static"]
!message *** Doing static
STATIC_BUILD = 1
-!else
-STATIC_BUILD = 0
+!endif
+
+!if [nmakehlp -f $(OPTS) "nostubs"]
+!message *** Not using stubs
+USE_STUBS = 0
!endif
!if [nmakehlp -f $(OPTS) "nomsvcrt"]
@@ -644,6 +663,12 @@ UNCHECKED = 1
UNCHECKED = 0
!endif
+!if [nmakehlp -f $(OPTS) "noconfigcheck"]
+CONFIG_CHECK = 1
+!else
+CONFIG_CHECK = 0
+!endif
+
!endif # "$(OPTS)" != "" && ... parsing of OPTS
# Set linker flags based on above
@@ -855,8 +880,15 @@ STUBPREFIX = $(PROJECT)stub
# Set up paths to various Tcl executables and libraries needed by extensions
!if "$(PROJECT)" == "tcl"
-TCLSHNAME = $(PROJECT)sh$(TCL_VERSION)$(SUFX).exe
+TCLSHNAME = $(PROJECT)sh$(TCL_VERSION)$(SUFX).exe
TCLSH = $(OUT_DIR)\$(TCLSHNAME)
+TCLIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
+TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
+TCLLIB = $(OUT_DIR)\$(TCLLIBNAME)
+
+TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
+TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
+TCL_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)"
!else # $(PROJECT) is not "tcl"
@@ -902,8 +934,17 @@ TCLSH_NATIVE = $(TCLSH)
!endif
!endif
-# Do the same for Tk extensions that require the Tk libraries
-!if defined(PROJECT_REQUIRES_TK)
+# Do the same for Tk and Tk extensions that require the Tk libraries
+!if "$(PROJECT)" == "tk"
+
+WISH = "$(OUT_DIR)\$(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe"
+TKSTUBLIBNAME = $(STUBPREFIX)$(TK_VERSION).lib
+TKSTUBLIB = "$(OUT_DIR)\$(TKSTUBLIBNAME)"
+TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(TK_VERSION)$(SUFX).lib"
+TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT)
+TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)"
+
+!elseif defined(PROJECT_REQUIRES_TK)
!if $(TKINSTALL) # Building against installed Tk
@@ -993,6 +1034,17 @@ OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED
!endif
+!if $(USE_STUBS)
+# Note we do not define USE_TCL_STUBS even when building tk since some
+# test targets in tk do not use stubs
+!if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk"
+OPTDEFINES = $(OPTDEFINES) -DUSE_TCL_STUBS -DUSE_TCLOO_STUBS
+!ifdef PROJECT_REQUIRES_TK
+OPTDEFINES = $(OPTDEFINES) -DUSE_TK_STUBS
+!endif
+!endif
+!endif # USE_STUBS
+
!if !$(DEBUG)
OPTDEFINES = $(OPTDEFINES) -DNDEBUG
!if $(OPTIMIZING)
@@ -1012,7 +1064,7 @@ OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64
# UNICODE - Use the wide char Windows API.
# _ATL_XP_TARGETING - Newer SDK's need this to build for XP
# BUILD_xxx - defined to export the xxx_Init call from the DLL
-COMPILERFLAGS = /DUNICODE /D_UNICODE /D_ATL_XP_TARGETING /DBUILD_$(PROJECT)
+COMPILERFLAGS = /DUNICODE /D_UNICODE /D_ATL_XP_TARGETING
# crt picks the C run time based on selected OPTS
!if $(MSVCRT)
@@ -1061,7 +1113,27 @@ cwarn = $(cwarn) -wd4311 -wd4312
cwarn = $(cwarn) -WX
!endif
-cflags = -nologo -c $(COMPILERFLAGS) $(cdebug) $(cwarn) -Fp$(TMP_DIR)^\ $(OPTDEFINES)
+# These flags are defined roughly in the order of the pre-reform rules.vc/makefile.vc to help
+# visually compare that the pre- and post-reform build logs
+
+# cflags contains generic flags to be used for building practically all object files
+cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ $(cdebug)
+
+# appcflags contains $(cflags) and flags for building the application object files
+# (e.g. tclsh, or wish)
+# pkgcflags contains $(cflags) plus flags used for building shared object files
+# The two differ in the BUILD_$(PROJECT) macro which should be defined only for
+# the shared library *implementation* and not for its caller interface
+appcflags = $(cflags) $(crt) $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES) $(TCL_DEFINES) $(PRJ_DEFINES) $(OPTDEFINES)
+pkgcflags = $(appcflags) /DBUILD_$(PROJECT)
+
+# stubscflags contains $(cflags) plus flags used for building a stubs library for the
+# package.
+# Note: -DSTATIC_BUILD is defined in $(OPTDEFINES) only if the OPTS configuration indicates
+# a static library. However the stubs library is ALWAYS static hence included here
+# irrespective of the OPTS setting.
+stubscflags = $(cflags) $(PRJ_DEFINES) $(OPTDEFINES) -Zl -DSTATIC_BUILD $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES)
+
# Link flags
@@ -1154,20 +1226,21 @@ hose:
@echo Hosing $(OUT_DIR)\* ...
@if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR)
-# Implicit rule definitions
+# Implicit rule definitions - only for building library objects. For stubs and main
+# application, the master makefile should define explicit rules.
{$(WINDIR)}.c{$(TMP_DIR)}.obj::
- $(cc32) $(cflags) $(crt) $(PRJ_INCLUDES) $(PRJ_DEFINES) -Fo$(TMP_DIR)\ @<<
+ $(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
$<
<<
{$(GENERICDIR)}.c{$(TMP_DIR)}.obj::
- $(cc32) $(cflags) $(crt) $(PRJ_INCLUDES) $(PRJ_DEFINES) -Fo$(TMP_DIR)\ @<<
+ $(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
$<
<<
{$(COMPATDIR)}.c{$(TMP_DIR)}.obj::
- $(cc32) $(cflags) $(crt) $(PRJ_INCLUDES) $(PRJ_DEFINES) -Fo$(TMP_DIR)\ @<<
+ $(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
$<
<<
@@ -1196,7 +1269,7 @@ TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake"
!endif
!endif # TCLINSTALL
-!if ! $(DISABLE_CONFIG_CHECKS)
+!if $(CONFIG_CHECK)
!ifdef TCLNMAKECONFIG
!include $(TCLMAKECONFIG)