summaryrefslogtreecommitdiffstats
path: root/win/rules.vc
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2017-11-15 13:18:00 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2017-11-15 13:18:00 (GMT)
commitc4d4363abd0a6d7f54d613ba0aa5c319c0d8bd36 (patch)
tree0b41916dd23ff73884608dc9af6f953775218ee8 /win/rules.vc
parent0197a30845c7644fe45ca1a4ec1fc0b9c9ee0c20 (diff)
downloadtcl-c4d4363abd0a6d7f54d613ba0aa5c319c0d8bd36.zip
tcl-c4d4363abd0a6d7f54d613ba0aa5c319c0d8bd36.tar.gz
tcl-c4d4363abd0a6d7f54d613ba0aa5c319c0d8bd36.tar.bz2
Loosen restriction on where rules-ext.vc file is located.
Diffstat (limited to 'win/rules.vc')
-rw-r--r--win/rules.vc35
1 files changed, 27 insertions, 8 deletions
diff --git a/win/rules.vc b/win/rules.vc
index 8db07bd..586272d 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -52,7 +52,11 @@ NEED_TK = 0
NEED_TCL_SOURCE = 0
!endif
-!ifndef NEED_TK_SOURCE
+!ifdef NEED_TK_SOURCE
+!if $(NEED_TK_SOURCE)
+NEED_TK = 1
+!endif
+!else
NEED_TK_SOURCE = 0
!endif
@@ -91,13 +95,6 @@ NEED_TK_SOURCE = 0
# 0. Sanity check compiler environment
-!if !exist("rules-ext.vc")
-MSG = ^
-You must run nmake from the directory containing the makefile and rules-ext.vc.^
-Please `cd` to its location first.
-!error $(MSG)
-!endif
-
# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or
# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir)
@@ -107,6 +104,28 @@ Visual C++ compiler environment not initialized.
!error $(MSG)
!endif
+# We need to run from the directory the parent makefile is located in.
+# nmake does not tell us what makefile was used to invoke it so parent
+# makefile has to set the MAKEFILEVC macro or we just make a guess and
+# warn if we think that is not the case.
+!if "$(MAKEFILEVC)" == ""
+
+!if exist("$(PROJECT).vc")
+MAKEFILEVC = $(PROJECT).vc
+!elseif exist("makefile.vc")
+MAKEFILEVC = makefile.vc
+!endif
+!endif # "$(MAKEFILEVC)" == ""
+
+!if !exist("$(MAKEFILEVC)")
+MSG = ^
+You must run nmake from the directory containing the project makefile.^
+If you are doing that and getting this message, set the MAKEFILEVC^
+macro to the name of the project makefile.
+!message WARNING: $(MSG)
+!endif
+
+
################################################################
# 1. Define external programs being used