File
win/rules-ext.vc
— part of check-in
[423a7e3717]
at
2026-05-28 02:45:21
on branch main
— Corrected Windows makefile issue where the TCLSH variable set in rules-ext.vc it is overridden with a hard-coded value.
Also includes updates to support ARM64 cross compilation.
Many thanks to Phillip Brooks for these changes.
(user:
bohagan,
size: 4265)
[annotate]
[blame][check-ins using]
0000: 23 20 54 68 69 73 20 66 69 6c 65 20 73 68 6f 75 # This file shou
0010: 6c 64 20 6f 6e 6c 79 20 62 65 20 69 6e 63 6c 75 ld only be inclu
0020: 64 65 64 20 69 6e 20 6d 61 6b 65 66 69 6c 65 73 ded in makefiles
0030: 20 66 6f 72 20 54 63 6c 20 65 78 74 65 6e 73 69 for Tcl extensi
0040: 6f 6e 73 2c 0a 23 20 4e 4f 54 20 69 6e 20 74 68 ons,.# NOT in th
0050: 65 20 6d 61 6b 65 66 69 6c 65 20 66 6f 72 20 54 e makefile for T
0060: 63 6c 20 69 74 73 65 6c 66 2e 0a 0a 21 69 66 6e cl itself...!ifn
0070: 64 65 66 20 5f 52 55 4c 45 53 5f 45 58 54 5f 56 def _RULES_EXT_V
0080: 43 0a 0a 23 20 57 65 20 6e 65 65 64 20 74 6f 20 C..# We need to
0090: 72 75 6e 20 66 72 6f 6d 20 74 68 65 20 64 69 72 run from the dir
00a0: 65 63 74 6f 72 79 20 74 68 65 20 70 61 72 65 6e ectory the paren
00b0: 74 20 6d 61 6b 65 66 69 6c 65 20 69 73 20 6c 6f t makefile is lo
00c0: 63 61 74 65 64 20 69 6e 2e 0a 23 20 6e 6d 61 6b cated in..# nmak
00d0: 65 20 64 6f 65 73 20 6e 6f 74 20 74 65 6c 6c 20 e does not tell
00e0: 75 73 20 77 68 61 74 20 6d 61 6b 65 66 69 6c 65 us what makefile
00f0: 20 77 61 73 20 75 73 65 64 20 74 6f 20 69 6e 76 was used to inv
0100: 6f 6b 65 20 69 74 20 73 6f 20 70 61 72 65 6e 74 oke it so parent
0110: 0a 23 20 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 .# makefile has
0120: 74 6f 20 73 65 74 20 74 68 65 20 4d 41 4b 45 46 to set the MAKEF
0130: 49 4c 45 56 43 20 6d 61 63 72 6f 20 6f 72 20 77 ILEVC macro or w
0140: 65 20 6a 75 73 74 20 6d 61 6b 65 20 61 20 67 75 e just make a gu
0150: 65 73 73 20 61 6e 64 0a 23 20 77 61 72 6e 20 69 ess and.# warn i
0160: 66 20 77 65 20 74 68 69 6e 6b 20 74 68 61 74 20 f we think that
0170: 69 73 20 6e 6f 74 20 74 68 65 20 63 61 73 65 2e is not the case.
0180: 0a 21 69 66 20 22 24 28 4d 41 4b 45 46 49 4c 45 .!if "$(MAKEFILE
0190: 56 43 29 22 20 3d 3d 20 22 22 0a 0a 21 69 66 20 VC)" == ""..!if
01a0: 65 78 69 73 74 28 22 24 28 50 52 4f 4a 45 43 54 exist("$(PROJECT
01b0: 29 2e 76 63 22 29 0a 4d 41 4b 45 46 49 4c 45 56 ).vc").MAKEFILEV
01c0: 43 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 2e 76 C = $(PROJECT).v
01d0: 63 0a 21 65 6c 73 65 69 66 20 65 78 69 73 74 28 c.!elseif exist(
01e0: 22 6d 61 6b 65 66 69 6c 65 2e 76 63 22 29 0a 4d "makefile.vc").M
01f0: 41 4b 45 46 49 4c 45 56 43 20 3d 20 6d 61 6b 65 AKEFILEVC = make
0200: 66 69 6c 65 2e 76 63 0a 21 65 6e 64 69 66 0a 21 file.vc.!endif.!
0210: 65 6e 64 69 66 20 23 20 22 24 28 4d 41 4b 45 46 endif # "$(MAKEF
0220: 49 4c 45 56 43 29 22 20 3d 3d 20 22 22 0a 0a 21 ILEVC)" == ""..!
0230: 69 66 20 21 65 78 69 73 74 28 22 24 28 4d 41 4b if !exist("$(MAK
0240: 45 46 49 4c 45 56 43 29 22 29 0a 4d 53 47 20 3d EFILEVC)").MSG =
0250: 20 5e 0a 59 6f 75 20 6d 75 73 74 20 72 75 6e 20 ^.You must run
0260: 6e 6d 61 6b 65 20 66 72 6f 6d 20 74 68 65 20 64 nmake from the d
0270: 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e irectory contain
0280: 69 6e 67 20 74 68 65 20 70 72 6f 6a 65 63 74 20 ing the project
0290: 6d 61 6b 65 66 69 6c 65 2e 5e 0a 49 66 20 79 6f makefile.^.If yo
02a0: 75 20 61 72 65 20 64 6f 69 6e 67 20 74 68 61 74 u are doing that
02b0: 20 61 6e 64 20 67 65 74 74 69 6e 67 20 74 68 69 and getting thi
02c0: 73 20 6d 65 73 73 61 67 65 2c 20 73 65 74 20 74 s message, set t
02d0: 68 65 20 4d 41 4b 45 46 49 4c 45 56 43 5e 0a 6d he MAKEFILEVC^.m
02e0: 61 63 72 6f 20 74 6f 20 74 68 65 20 6e 61 6d 65 acro to the name
02f0: 20 6f 66 20 74 68 65 20 70 72 6f 6a 65 63 74 20 of the project
0300: 6d 61 6b 65 66 69 6c 65 2e 0a 21 6d 65 73 73 61 makefile..!messa
0310: 67 65 20 57 41 52 4e 49 4e 47 3a 20 24 28 4d 53 ge WARNING: $(MS
0320: 47 29 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 22 G).!endif..!if "
0330: 24 28 50 52 4f 4a 45 43 54 29 22 20 3d 3d 20 22 $(PROJECT)" == "
0340: 74 63 6c 22 0a 21 65 72 72 6f 72 20 54 68 65 20 tcl".!error The
0350: 72 75 6c 65 73 2d 65 78 74 2e 76 63 20 66 69 6c rules-ext.vc fil
0360: 65 20 69 73 20 6e 6f 74 20 69 6e 74 65 6e 64 65 e is not intende
0370: 64 20 66 6f 72 20 54 63 6c 20 69 74 73 65 6c 66 d for Tcl itself
0380: 2e 0a 21 65 6e 64 69 66 0a 0a 23 20 57 65 20 65 ..!endif..# We e
0390: 78 74 72 61 63 74 20 76 65 72 73 69 6f 6e 20 6e xtract version n
03a0: 75 6d 62 65 72 73 20 75 73 69 6e 67 20 74 68 65 umbers using the
03b0: 20 6e 6d 61 6b 65 68 6c 70 20 70 72 6f 67 72 61 nmakehlp progra
03c0: 6d 2e 20 46 6f 72 20 6e 6f 77 20 75 73 65 0a 23 m. For now use.#
03d0: 20 74 68 65 20 6c 6f 63 61 6c 20 63 6f 70 79 20 the local copy
03e0: 6f 66 20 6e 6d 61 6b 65 68 6c 70 2e 20 4f 6e 63 of nmakehlp. Onc
03f0: 65 20 77 65 20 6c 6f 63 61 74 65 20 54 63 6c 2c e we locate Tcl,
0400: 20 77 65 20 77 69 6c 6c 20 75 73 65 20 74 68 61 we will use tha
0410: 74 0a 23 20 6f 6e 65 20 69 66 20 69 74 20 69 73 t.# one if it is
0420: 20 6e 65 77 65 72 2e 0a 21 69 66 20 5b 24 28 43 newer..!if [$(C
0430: 43 29 20 2d 6e 6f 6c 6f 67 6f 20 2d 44 4e 44 45 C) -nologo -DNDE
0440: 42 55 47 20 22 6e 6d 61 6b 65 68 6c 70 2e 63 22 BUG "nmakehlp.c"
0450: 20 2d 6c 69 6e 6b 20 2d 73 75 62 73 79 73 74 65 -link -subsyste
0460: 6d 3a 63 6f 6e 73 6f 6c 65 20 3e 20 6e 75 6c 5d m:console > nul]
0470: 0a 21 65 6e 64 69 66 0a 0a 23 20 57 65 20 6e 65 .!endif..# We ne
0480: 65 64 20 61 20 6e 6d 61 6b 65 68 6c 70 20 74 68 ed a nmakehlp th
0490: 61 74 20 77 69 6c 6c 20 72 75 6e 20 6f 6e 20 74 at will run on t
04a0: 68 65 20 68 6f 73 74 20 6d 61 63 68 69 6e 65 20 he host machine
04b0: 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 62 as part of the b
04c0: 75 69 6c 64 2e 0a 23 20 69 66 20 54 43 4c 53 48 uild..# if TCLSH
04d0: 5f 4e 41 54 49 56 45 20 69 73 20 73 65 74 20 66 _NATIVE is set f
04e0: 6f 72 20 63 72 6f 73 73 20 63 6f 6d 70 69 6c 61 or cross compila
04f0: 74 69 6f 6e 2c 20 77 65 27 6c 6c 20 74 72 79 20 tion, we'll try
0500: 74 6f 20 66 69 6e 64 20 61 6e 20 61 73 73 6f 63 to find an assoc
0510: 69 61 74 65 64 20 0a 23 20 6e 6d 61 6b 65 68 6c iated .# nmakehl
0520: 70 2e 65 78 65 20 74 68 61 74 20 72 75 6e 73 20 p.exe that runs
0530: 6f 6e 20 74 68 65 20 62 75 69 6c 64 20 61 72 63 on the build arc
0540: 68 69 74 65 63 74 75 72 65 2e 0a 21 69 66 64 65 hitecture..!ifde
0550: 66 20 54 43 4c 53 48 5f 4e 41 54 49 56 45 0a 21 f TCLSH_NATIVE.!
0560: 69 66 6e 64 65 66 20 4e 4d 41 4b 45 48 4c 50 5f ifndef NMAKEHLP_
0570: 4e 41 54 49 56 45 0a 21 69 66 20 5b 24 28 54 43 NATIVE.!if [$(TC
0580: 4c 53 48 5f 4e 41 54 49 56 45 29 20 24 28 54 43 LSH_NATIVE) $(TC
0590: 4c 44 49 52 29 5c 77 69 6e 5c 66 69 6e 64 5f 6e LDIR)\win\find_n
05a0: 6d 61 6b 65 68 6c 70 2e 74 63 6c 20 24 28 54 43 makehlp.tcl $(TC
05b0: 4c 53 48 5f 4e 41 54 49 56 45 29 20 3e 20 66 69 LSH_NATIVE) > fi
05c0: 6e 64 5f 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d nd_nmakehlp.out]
05d0: 0a 21 65 72 72 6f 72 20 54 43 4c 53 48 5f 4e 41 .!error TCLSH_NA
05e0: 54 49 56 45 20 69 73 20 73 65 74 2c 20 62 75 74 TIVE is set, but
05f0: 20 75 6e 61 62 6c 65 20 74 6f 20 66 69 6e 64 20 unable to find
0600: 61 73 73 6f 63 69 61 74 65 64 20 6e 6d 61 6b 65 associated nmake
0610: 68 6c 70 2e 65 78 65 20 6e 65 61 72 62 79 2e 0a hlp.exe nearby..
0620: 21 65 6c 73 65 0a 21 69 6e 63 6c 75 64 65 20 66 !else.!include f
0630: 69 6e 64 5f 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 ind_nmakehlp.out
0640: 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 21 .!endif.!endif.!
0650: 65 6e 64 69 66 0a 0a 21 69 66 6e 64 65 66 20 4e endif..!ifndef N
0660: 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 0a 4e MAKEHLP_NATIVE.N
0670: 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 3d 6e MAKEHLP_NATIVE=n
0680: 6d 61 6b 65 68 6c 70 0a 21 65 6e 64 69 66 0a 0a makehlp.!endif..
0690: 23 20 46 69 72 73 74 20 6c 6f 63 61 74 65 20 74 # First locate t
06a0: 68 65 20 54 63 6c 20 64 69 72 65 63 74 6f 72 79 he Tcl directory
06b0: 20 74 68 61 74 20 77 65 20 61 72 65 20 77 6f 72 that we are wor
06c0: 6b 69 6e 67 20 77 69 74 68 2e 0a 21 69 66 20 22 king with..!if "
06d0: 24 28 54 43 4c 44 49 52 29 22 20 21 3d 20 22 22 $(TCLDIR)" != ""
06e0: 0a 0a 5f 52 55 4c 45 53 44 49 52 20 3d 20 24 28 .._RULESDIR = $(
06f0: 54 43 4c 44 49 52 3a 2f 3d 5c 29 0a 0a 21 65 6c TCLDIR:/=\)..!el
0700: 73 65 0a 0a 23 20 49 66 20 61 6e 20 69 6e 73 74 se..# If an inst
0710: 61 6c 6c 61 74 69 6f 6e 20 70 61 74 68 20 69 73 allation path is
0720: 20 73 70 65 63 69 66 69 65 64 2c 20 74 68 61 74 specified, that
0730: 20 69 73 20 61 6c 73 6f 20 74 68 65 20 54 63 6c is also the Tcl
0740: 20 64 69 72 65 63 74 6f 72 79 2e 0a 23 20 41 6c directory..# Al
0750: 73 6f 20 54 6b 20 6e 65 76 65 72 20 62 75 69 6c so Tk never buil
0760: 64 73 20 61 67 61 69 6e 73 74 20 61 6e 20 69 6e ds against an in
0770: 73 74 61 6c 6c 65 64 20 54 63 6c 2c 20 69 74 20 stalled Tcl, it
0780: 6e 65 65 64 73 20 54 63 6c 20 73 6f 75 72 63 65 needs Tcl source
0790: 73 0a 21 69 66 20 64 65 66 69 6e 65 64 28 49 4e s.!if defined(IN
07a0: 53 54 41 4c 4c 44 49 52 29 20 26 26 20 22 24 28 STALLDIR) && "$(
07b0: 50 52 4f 4a 45 43 54 29 22 20 21 3d 20 22 74 6b PROJECT)" != "tk
07c0: 22 0a 5f 52 55 4c 45 53 44 49 52 3d 24 28 49 4e "._RULESDIR=$(IN
07d0: 53 54 41 4c 4c 44 49 52 3a 2f 3d 5c 29 0a 21 65 STALLDIR:/=\).!e
07e0: 6c 73 65 0a 23 20 4c 6f 63 61 74 65 20 54 63 6c lse.# Locate Tcl
07f0: 20 73 6f 75 72 63 65 73 0a 21 69 66 20 5b 65 63 sources.!if [ec
0800: 68 6f 20 5f 52 55 4c 45 53 44 49 52 20 3d 20 5c ho _RULESDIR = \
0810: 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20 > nmakehlp.out]
0820: 5c 0a 20 20 20 7c 7c 20 5b 24 28 4e 4d 41 4b 45 \. || [$(NMAKE
0830: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 4c 20 67 HLP_NATIVE) -L g
0840: 65 6e 65 72 69 63 5c 74 63 6c 2e 68 20 3e 3e 20 eneric\tcl.h >>
0850: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 5f 52 nmakehlp.out]._R
0860: 55 4c 45 53 44 49 52 20 3d 20 2e 2e 5c 2e 2e 5c ULESDIR = ..\..\
0870: 74 63 6c 0a 21 65 6c 73 65 0a 21 69 6e 63 6c 75 tcl.!else.!inclu
0880: 64 65 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0a de nmakehlp.out.
0890: 21 65 6e 64 69 66 0a 0a 21 65 6e 64 69 66 20 23 !endif..!endif #
08a0: 20 64 65 66 69 6e 65 64 28 49 4e 53 54 41 4c 4c defined(INSTALL
08b0: 44 49 52 29 2e 2e 2e 2e 0a 0a 21 65 6e 64 69 66 DIR)......!endif
08c0: 20 23 20 69 66 6e 64 65 66 20 54 43 4c 44 49 52 # ifndef TCLDIR
08d0: 0a 0a 23 20 4e 6f 77 20 6c 6f 6f 6b 20 66 6f 72 ..# Now look for
08e0: 20 74 68 65 20 74 61 72 67 65 74 73 2e 76 63 20 the targets.vc
08f0: 66 69 6c 65 20 75 6e 64 65 72 20 74 68 65 20 54 file under the T
0900: 63 6c 20 72 6f 6f 74 2e 20 4e 6f 74 65 20 77 65 cl root. Note we
0910: 20 63 68 65 63 6b 20 74 68 69 73 0a 23 20 66 69 check this.# fi
0920: 6c 65 20 61 6e 64 20 6e 6f 74 20 72 75 6c 65 73 le and not rules
0930: 2e 76 63 20 62 65 63 61 75 73 65 20 74 68 65 20 .vc because the
0940: 6c 61 74 74 65 72 20 61 6c 73 6f 20 65 78 69 73 latter also exis
0950: 74 73 20 6f 6e 20 6f 6c 64 65 72 20 73 79 73 74 ts on older syst
0960: 65 6d 73 2e 0a 21 69 66 20 65 78 69 73 74 28 22 ems..!if exist("
0970: 24 28 5f 52 55 4c 45 53 44 49 52 29 5c 6c 69 62 $(_RULESDIR)\lib
0980: 5c 6e 6d 61 6b 65 5c 74 61 72 67 65 74 73 2e 76 \nmake\targets.v
0990: 63 22 29 20 23 20 42 75 69 6c 64 69 6e 67 20 61 c") # Building a
09a0: 67 61 69 6e 73 74 20 69 6e 73 74 61 6c 6c 65 64 gainst installed
09b0: 20 54 63 6c 0a 5f 52 55 4c 45 53 44 49 52 20 3d Tcl._RULESDIR =
09c0: 20 24 28 5f 52 55 4c 45 53 44 49 52 29 5c 6c 69 $(_RULESDIR)\li
09d0: 62 5c 6e 6d 61 6b 65 0a 21 65 6c 73 65 69 66 20 b\nmake.!elseif
09e0: 65 78 69 73 74 28 22 24 28 5f 52 55 4c 45 53 44 exist("$(_RULESD
09f0: 49 52 29 5c 77 69 6e 5c 74 61 72 67 65 74 73 2e IR)\win\targets.
0a00: 76 63 22 29 20 20 20 23 20 42 75 69 6c 64 69 6e vc") # Buildin
0a10: 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 73 6f g against Tcl so
0a20: 75 72 63 65 73 0a 5f 52 55 4c 45 53 44 49 52 20 urces._RULESDIR
0a30: 3d 20 24 28 5f 52 55 4c 45 53 44 49 52 29 5c 77 = $(_RULESDIR)\w
0a40: 69 6e 0a 21 65 6c 73 65 0a 23 20 49 66 20 77 65 in.!else.# If we
0a50: 20 68 61 76 65 20 6e 6f 74 20 6c 6f 63 61 74 65 have not locate
0a60: 64 20 54 63 6c 27 73 20 74 61 72 67 65 74 73 20 d Tcl's targets
0a70: 66 69 6c 65 2c 20 6d 6f 73 74 20 6c 69 6b 65 6c file, most likel
0a80: 79 20 77 65 20 61 72 65 20 63 6f 6d 70 69 6c 69 y we are compili
0a90: 6e 67 0a 23 20 61 67 61 69 6e 73 74 20 61 6e 20 ng.# against an
0aa0: 6f 6c 64 65 72 20 76 65 72 73 69 6f 6e 20 6f 66 older version of
0ab0: 20 54 63 6c 20 61 6e 64 20 73 6f 20 6d 75 73 74 Tcl and so must
0ac0: 20 75 73 65 20 6f 75 72 20 6f 77 6e 20 73 75 70 use our own sup
0ad0: 70 6f 72 74 20 66 69 6c 65 73 2e 0a 5f 52 55 4c port files.._RUL
0ae0: 45 53 44 49 52 20 3d 20 2e 0a 21 65 6e 64 69 66 ESDIR = ..!endif
0af0: 0a 0a 21 69 66 20 22 24 28 5f 52 55 4c 45 53 44 ..!if "$(_RULESD
0b00: 49 52 29 22 20 21 3d 20 22 2e 22 0a 23 20 50 6f IR)" != ".".# Po
0b10: 74 65 6e 74 69 61 6c 6c 79 20 75 73 69 6e 67 20 tentially using
0b20: 54 63 6c 27 73 20 73 75 70 70 6f 72 74 20 66 69 Tcl's support fi
0b30: 6c 65 73 2e 20 49 66 20 74 68 69 73 20 65 78 74 les. If this ext
0b40: 65 6e 73 69 6f 6e 20 68 61 73 20 69 74 73 20 6f ension has its o
0b50: 77 6e 0a 23 20 6e 6d 61 6b 65 20 73 75 70 70 6f wn.# nmake suppo
0b60: 72 74 20 66 69 6c 65 73 2c 20 6e 65 65 64 20 74 rt files, need t
0b70: 6f 20 63 6f 6d 70 61 72 65 20 74 68 65 20 76 65 o compare the ve
0b80: 72 73 69 6f 6e 73 20 61 6e 64 20 70 69 63 6b 20 rsions and pick
0b90: 6e 65 77 65 72 2e 0a 0a 21 69 66 20 65 78 69 73 newer...!if exis
0ba0: 74 28 22 72 75 6c 65 73 2e 76 63 22 29 20 23 20 t("rules.vc") #
0bb0: 54 68 65 20 65 78 74 65 6e 73 69 6f 6e 20 68 61 The extension ha
0bc0: 73 20 69 74 73 20 6f 77 6e 20 63 6f 70 79 0a 0a s its own copy..
0bd0: 21 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 52 55 !if [echo TCL_RU
0be0: 4c 45 53 5f 4d 41 4a 4f 52 20 3d 20 5c 3e 20 76 LES_MAJOR = \> v
0bf0: 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 ersions.vc] \.
0c00: 20 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f && [$(NMAKEHLP_
0c10: 4e 41 54 49 56 45 29 20 2d 56 20 22 24 28 5f 52 NATIVE) -V "$(_R
0c20: 55 4c 45 53 44 49 52 29 5c 72 75 6c 65 73 2e 76 ULESDIR)\rules.v
0c30: 63 22 20 52 55 4c 45 53 5f 56 45 52 53 49 4f 4e c" RULES_VERSION
0c40: 5f 4d 41 4a 4f 52 20 3e 3e 20 76 65 72 73 69 6f _MAJOR >> versio
0c50: 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21 69 ns.vc].!endif.!i
0c60: 66 20 5b 65 63 68 6f 20 54 43 4c 5f 52 55 4c 45 f [echo TCL_RULE
0c70: 53 5f 4d 49 4e 4f 52 20 3d 20 5c 3e 3e 20 76 65 S_MINOR = \>> ve
0c80: 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 rsions.vc] \.
0c90: 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e && [$(NMAKEHLP_N
0ca0: 41 54 49 56 45 29 20 2d 56 20 22 24 28 5f 52 55 ATIVE) -V "$(_RU
0cb0: 4c 45 53 44 49 52 29 5c 72 75 6c 65 73 2e 76 63 LESDIR)\rules.vc
0cc0: 22 20 52 55 4c 45 53 5f 56 45 52 53 49 4f 4e 5f " RULES_VERSION_
0cd0: 4d 49 4e 4f 52 20 3e 3e 20 76 65 72 73 69 6f 6e MINOR >> version
0ce0: 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 0a 21 69 s.vc].!endif..!i
0cf0: 66 20 5b 65 63 68 6f 20 4f 55 52 5f 52 55 4c 45 f [echo OUR_RULE
0d00: 53 5f 4d 41 4a 4f 52 20 3d 20 5c 3e 3e 20 76 65 S_MAJOR = \>> ve
0d10: 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 rsions.vc] \.
0d20: 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e && [$(NMAKEHLP_N
0d30: 41 54 49 56 45 29 20 2d 56 20 22 72 75 6c 65 73 ATIVE) -V "rules
0d40: 2e 76 63 22 20 52 55 4c 45 53 5f 56 45 52 53 49 .vc" RULES_VERSI
0d50: 4f 4e 5f 4d 41 4a 4f 52 20 3e 3e 20 76 65 72 73 ON_MAJOR >> vers
0d60: 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a ions.vc].!endif.
0d70: 21 69 66 20 5b 65 63 68 6f 20 4f 55 52 5f 52 55 !if [echo OUR_RU
0d80: 4c 45 53 5f 4d 49 4e 4f 52 20 3d 20 5c 3e 3e 20 LES_MINOR = \>>
0d90: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 versions.vc] \.
0da0: 20 20 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 && [$(NMAKEHLP
0db0: 5f 4e 41 54 49 56 45 29 20 2d 56 20 22 72 75 6c _NATIVE) -V "rul
0dc0: 65 73 2e 76 63 22 20 52 55 4c 45 53 5f 56 45 52 es.vc" RULES_VER
0dd0: 53 49 4f 4e 5f 4d 49 4e 4f 52 20 3e 3e 20 76 65 SION_MINOR >> ve
0de0: 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 rsions.vc].!endi
0df0: 66 0a 21 69 6e 63 6c 75 64 65 20 76 65 72 73 69 f.!include versi
0e00: 6f 6e 73 2e 76 63 0a 23 20 57 65 20 68 61 76 65 ons.vc.# We have
0e10: 20 61 20 6e 65 77 65 72 20 76 65 72 73 69 6f 6e a newer version
0e20: 20 6f 66 20 74 68 65 20 73 75 70 70 6f 72 74 20 of the support
0e30: 66 69 6c 65 73 2c 20 75 73 65 20 74 68 65 6d 0a files, use them.
0e40: 21 69 66 20 28 24 28 54 43 4c 5f 52 55 4c 45 53 !if ($(TCL_RULES
0e50: 5f 4d 41 4a 4f 52 29 20 21 3d 20 24 28 4f 55 52 _MAJOR) != $(OUR
0e60: 5f 52 55 4c 45 53 5f 4d 41 4a 4f 52 29 29 20 7c _RULES_MAJOR)) |
0e70: 7c 20 28 24 28 54 43 4c 5f 52 55 4c 45 53 5f 4d | ($(TCL_RULES_M
0e80: 49 4e 4f 52 29 20 3c 20 24 28 4f 55 52 5f 52 55 INOR) < $(OUR_RU
0e90: 4c 45 53 5f 4d 49 4e 4f 52 29 29 0a 5f 52 55 4c LES_MINOR))._RUL
0ea0: 45 53 44 49 52 20 3d 20 2e 0a 21 65 6e 64 69 66 ESDIR = ..!endif
0eb0: 0a 0a 21 65 6e 64 69 66 20 23 20 69 66 20 65 78 ..!endif # if ex
0ec0: 69 73 74 28 22 72 75 6c 65 73 2e 76 63 22 29 0a ist("rules.vc").
0ed0: 0a 21 65 6e 64 69 66 20 23 20 69 66 20 24 28 5f .!endif # if $(_
0ee0: 52 55 4c 45 53 44 49 52 29 20 21 3d 20 22 2e 22 RULESDIR) != "."
0ef0: 0a 0a 23 20 4c 65 74 20 72 75 6c 65 73 2e 76 63 ..# Let rules.vc
0f00: 20 6b 6e 6f 77 20 77 68 61 74 20 63 6f 70 79 20 know what copy
0f10: 6f 66 20 6e 6d 61 6b 65 68 6c 70 2e 63 20 74 6f of nmakehlp.c to
0f20: 20 75 73 65 2e 0a 4e 4d 41 4b 45 48 4c 50 43 20 use..NMAKEHLPC
0f30: 3d 20 24 28 5f 52 55 4c 45 53 44 49 52 29 5c 6e = $(_RULESDIR)\n
0f40: 6d 61 6b 65 68 6c 70 2e 63 0a 0a 23 20 47 65 74 makehlp.c..# Get
0f50: 20 72 69 64 20 6f 66 20 6f 75 72 20 69 6e 74 65 rid of our inte
0f60: 72 6e 61 6c 20 64 65 66 69 6e 65 73 20 62 65 66 rnal defines bef
0f70: 6f 72 65 20 63 61 6c 6c 69 6e 67 20 72 75 6c 65 ore calling rule
0f80: 73 2e 76 63 0a 21 75 6e 64 65 66 20 54 43 4c 5f s.vc.!undef TCL_
0f90: 52 55 4c 45 53 5f 4d 41 4a 4f 52 0a 21 75 6e 64 RULES_MAJOR.!und
0fa0: 65 66 20 54 43 4c 5f 52 55 4c 45 53 5f 4d 49 4e ef TCL_RULES_MIN
0fb0: 4f 52 0a 21 75 6e 64 65 66 20 4f 55 52 5f 52 55 OR.!undef OUR_RU
0fc0: 4c 45 53 5f 4d 41 4a 4f 52 0a 21 75 6e 64 65 66 LES_MAJOR.!undef
0fd0: 20 4f 55 52 5f 52 55 4c 45 53 5f 4d 49 4e 4f 52 OUR_RULES_MINOR
0fe0: 0a 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f ..!if exist("$(_
0ff0: 52 55 4c 45 53 44 49 52 29 5c 72 75 6c 65 73 2e RULESDIR)\rules.
1000: 76 63 22 29 0a 21 6d 65 73 73 61 67 65 20 2a 2a vc").!message **
1010: 2a 20 55 73 69 6e 67 20 24 28 5f 52 55 4c 45 53 * Using $(_RULES
1020: 44 49 52 29 5c 72 75 6c 65 73 2e 76 63 0a 21 69 DIR)\rules.vc.!i
1030: 6e 63 6c 75 64 65 20 22 24 28 5f 52 55 4c 45 53 nclude "$(_RULES
1040: 44 49 52 29 5c 72 75 6c 65 73 2e 76 63 22 0a 21 DIR)\rules.vc".!
1050: 65 6c 73 65 0a 21 65 72 72 6f 72 20 2a 2a 2a 20 else.!error ***
1060: 43 6f 75 6c 64 20 6e 6f 74 20 6c 6f 63 61 74 65 Could not locate
1070: 20 72 75 6c 65 73 2e 76 63 20 69 6e 20 24 28 5f rules.vc in $(_
1080: 52 55 4c 45 53 44 49 52 29 0a 21 65 6e 64 69 66 RULESDIR).!endif
1090: 0a 0a 21 65 6e 64 69 66 20 23 20 5f 52 55 4c 45 ..!endif # _RULE
10a0: 53 5f 45 58 54 5f 56 43 0a S_EXT_VC.