diff options
Diffstat (limited to 'win/rules-ext.vc')
-rw-r--r-- | win/rules-ext.vc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/win/rules-ext.vc b/win/rules-ext.vc index 3aba80d..58c70fa 100644 --- a/win/rules-ext.vc +++ b/win/rules-ext.vc @@ -28,6 +28,12 @@ macro to the name of the project makefile. !error The rules-ext.vc file is not intended for Tcl itself.
!endif
+# We extract version numbers using the nmakehlp program. For now use
+# the local copy of nmakehlp. Once we locate Tcl, we will use that
+# one if it is newer.
+!if [$(CC) -nologo "nmakehlp.c" -link -subsystem:console > nul]
+!endif
+
# First locate the Tcl directory that we are working with.
!ifdef TCLDIR
@@ -36,13 +42,20 @@ _RULESDIR = $(TCLDIR:/=\) !else
# If an installation path is specified, that is also the Tcl directory.
-# Also, tk never builds against an installed Tcl, it needs Tcl sources
+# Also Tk never builds against an installed Tcl, it needs Tcl sources
!if defined(INSTALLDIR) && "$(PROJECT)" != "tk"
_RULESDIR=$(INSTALLDIR:/=\)
!else
+# Locate Tcl sources
+!if [echo _RULESDIR = \> nmakehlp.out] \
+ || [nmakehlp -L generic\tcl.h >> nmakehlp.out]
_RULESDIR = ..\..\tcl
+!else
+!include nmakehlp.out
!endif
+!endif # defined(INSTALLDIR)....
+
!endif # ifndef TCLDIR
# Now look for the targets.vc file under the Tcl root. Note we check this
@@ -63,10 +76,6 @@ _RULESDIR = . !if exist("rules.vc") # The extension has its own copy
-# We extract version numbers using the nmakehlp program.
-!if [$(CC) -nologo "$(_RULESDIR)\nmakehlp.c" -link -subsystem:console > nul]
-!endif
-
!if [echo TCL_RULES_MAJOR = \> versions.vc] \
&& [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MAJOR >> versions.vc]
!endif
|