From c4d4363abd0a6d7f54d613ba0aa5c319c0d8bd36 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Wed, 15 Nov 2017 13:18:00 +0000 Subject: Loosen restriction on where rules-ext.vc file is located. --- win/rules-ext.vc | 22 ++++++++++++++++++---- win/rules.vc | 35 +++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/win/rules-ext.vc b/win/rules-ext.vc index 7de6055..ec84464 100644 --- a/win/rules-ext.vc +++ b/win/rules-ext.vc @@ -3,11 +3,25 @@ !ifndef _RULES_EXT_VC -!if !exist("rules-ext.vc") +# 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 this makefile only from the directory it is in.^ -Please `cd` to its location first. -!error $(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 !if "$(PROJECT)" == "tcl" 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 -- cgit v0.12