0000: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d #---------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 2d -------------- -
0040: 2a 2d 20 6d 61 6b 65 66 69 6c 65 20 2d 2a 2d 0d *- makefile -*-.
0050: 0a 23 20 72 75 6c 65 73 2e 76 63 20 2d 2d 0d 0a .# rules.vc --..
0060: 23 0d 0a 23 20 50 61 72 74 20 6f 66 20 74 68 65 #..# Part of the
0070: 20 6e 6d 61 6b 65 20 62 61 73 65 64 20 62 75 69 nmake based bui
0080: 6c 64 20 73 79 73 74 65 6d 20 66 6f 72 20 54 63 ld system for Tc
0090: 6c 20 61 6e 64 20 69 74 73 20 65 78 74 65 6e 73 l and its extens
00a0: 69 6f 6e 73 2e 0d 0a 23 20 54 68 69 73 20 66 69 ions...# This fi
00b0: 6c 65 20 64 6f 65 73 20 61 6c 6c 20 74 68 65 20 le does all the
00c0: 68 61 72 64 20 77 6f 72 6b 20 69 6e 20 74 65 72 hard work in ter
00d0: 6d 73 20 6f 66 20 70 61 72 73 69 6e 67 20 62 75 ms of parsing bu
00e0: 69 6c 64 20 6f 70 74 69 6f 6e 73 2c 0d 0a 23 20 ild options,..#
00f0: 63 6f 6d 70 69 6c 65 72 20 73 77 69 74 63 68 65 compiler switche
0100: 73 2c 20 64 65 66 69 6e 69 6e 67 20 63 6f 6d 6d s, defining comm
0110: 6f 6e 20 74 61 72 67 65 74 73 20 61 6e 64 20 6d on targets and m
0120: 61 63 72 6f 73 2e 20 54 68 65 20 54 63 6c 20 6d acros. The Tcl m
0130: 61 6b 65 66 69 6c 65 0d 0a 23 20 64 69 72 65 63 akefile..# direc
0140: 74 6c 79 20 69 6e 63 6c 75 64 65 73 20 74 68 69 tly includes thi
0150: 73 2e 20 45 78 74 65 6e 73 69 6f 6e 73 20 69 6e s. Extensions in
0160: 63 6c 75 64 65 20 69 74 20 76 69 61 20 22 72 75 clude it via "ru
0170: 6c 65 73 2d 65 78 74 2e 76 63 22 2e 0d 0a 23 0d les-ext.vc"...#.
0180: 0a 23 20 53 65 65 20 54 49 50 20 34 37 37 20 28 .# See TIP 477 (
0190: 68 74 74 70 73 3a 2f 2f 63 6f 72 65 2e 74 63 6c https://core.tcl
01a0: 2e 74 6b 2f 74 69 70 73 2f 64 6f 63 2f 74 72 75 .tk/tips/doc/tru
01b0: 6e 6b 2f 74 69 70 2f 34 37 37 2e 6d 64 29 20 66 nk/tip/477.md) f
01c0: 6f 72 0d 0a 23 20 64 65 74 61 69 6c 65 64 20 64 or..# detailed d
01d0: 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 0d 0a 23 ocumentation...#
01e0: 0d 0a 23 20 53 65 65 20 74 68 65 20 66 69 6c 65 ..# See the file
01f0: 20 22 6c 69 63 65 6e 73 65 2e 74 65 72 6d 73 22 "license.terms"
0200: 20 66 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e for information
0210: 20 6f 6e 20 75 73 61 67 65 20 61 6e 64 20 72 65 on usage and re
0220: 64 69 73 74 72 69 62 75 74 69 6f 6e 0d 0a 23 20 distribution..#
0230: 6f 66 20 74 68 69 73 20 66 69 6c 65 2c 20 61 6e of this file, an
0240: 64 20 66 6f 72 20 61 20 44 49 53 43 4c 41 49 4d d for a DISCLAIM
0250: 45 52 20 4f 46 20 41 4c 4c 20 57 41 52 52 41 4e ER OF ALL WARRAN
0260: 54 49 45 53 2e 0d 0a 23 0d 0a 23 20 43 6f 70 79 TIES...#..# Copy
0270: 72 69 67 68 74 20 28 63 29 20 32 30 30 31 2d 32 right (c) 2001-2
0280: 30 30 33 20 44 61 76 69 64 20 47 72 61 76 65 72 003 David Graver
0290: 65 61 75 78 2e 0d 0a 23 20 43 6f 70 79 72 69 67 eaux...# Copyrig
02a0: 68 74 20 28 63 29 20 32 30 30 33 2d 32 30 30 38 ht (c) 2003-2008
02b0: 20 50 61 74 72 69 63 6b 20 54 68 6f 79 74 73 0d Patrick Thoyts.
02c0: 0a 23 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 .# Copyright (c)
02d0: 20 32 30 31 37 20 20 20 20 20 20 41 73 68 6f 6b 2017 Ashok
02e0: 20 50 2e 20 4e 61 64 6b 61 72 6e 69 0d 0a 23 2d P. Nadkarni..#-
02f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0300: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0310: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0320: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0330: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 0d -------------...
0340: 0a 21 69 66 6e 64 65 66 20 5f 52 55 4c 45 53 5f .!ifndef _RULES_
0350: 56 43 0d 0a 5f 52 55 4c 45 53 5f 56 43 20 3d 20 VC.._RULES_VC =
0360: 31 0d 0a 0d 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 1....# The follo
0370: 77 69 6e 67 20 6d 61 63 72 6f 73 20 64 65 66 69 wing macros defi
0380: 6e 65 20 74 68 65 20 76 65 72 73 69 6f 6e 20 6f ne the version o
0390: 66 20 74 68 65 20 72 75 6c 65 73 2e 76 63 20 6e f the rules.vc n
03a0: 6d 61 6b 65 20 62 75 69 6c 64 20 73 79 73 74 65 make build syste
03b0: 6d 0d 0a 23 20 46 6f 72 20 6d 6f 64 69 66 69 63 m..# For modific
03c0: 61 74 69 6f 6e 73 20 74 68 61 74 20 61 72 65 20 ations that are
03d0: 6e 6f 74 20 62 61 63 6b 77 61 72 64 2d 63 6f 6d not backward-com
03e0: 70 61 74 69 62 6c 65 2c 20 79 6f 75 20 2a 6d 75 patible, you *mu
03f0: 73 74 2a 20 63 68 61 6e 67 65 0d 0a 23 20 74 68 st* change..# th
0400: 65 20 6d 61 6a 6f 72 20 76 65 72 73 69 6f 6e 2e e major version.
0410: 0d 0a 52 55 4c 45 53 5f 56 45 52 53 49 4f 4e 5f ..RULES_VERSION_
0420: 4d 41 4a 4f 52 20 3d 20 31 0d 0a 52 55 4c 45 53 MAJOR = 1..RULES
0430: 5f 56 45 52 53 49 4f 4e 5f 4d 49 4e 4f 52 20 3d _VERSION_MINOR =
0440: 20 31 0d 0a 0d 0a 23 20 54 68 65 20 50 52 4f 4a 1....# The PROJ
0450: 45 43 54 20 6d 61 63 72 6f 20 6d 75 73 74 20 62 ECT macro must b
0460: 65 20 64 65 66 69 6e 65 64 20 62 79 20 70 61 72 e defined by par
0470: 65 6e 74 20 6d 61 6b 65 66 69 6c 65 2e 0d 0a 21 ent makefile...!
0480: 69 66 20 22 24 28 50 52 4f 4a 45 43 54 29 22 20 if "$(PROJECT)"
0490: 3d 3d 20 22 22 0d 0a 21 65 72 72 6f 72 20 2a 2a == ""..!error **
04a0: 2a 20 45 72 72 6f 72 3a 20 4d 61 63 72 6f 20 50 * Error: Macro P
04b0: 52 4f 4a 45 43 54 20 6e 6f 74 20 64 65 66 69 6e ROJECT not defin
04c0: 65 64 21 20 50 6c 65 61 73 65 20 64 65 66 69 6e ed! Please defin
04d0: 65 20 69 74 20 62 65 66 6f 72 65 20 69 6e 63 6c e it before incl
04e0: 75 64 69 6e 67 20 72 75 6c 65 73 2e 76 63 0d 0a uding rules.vc..
04f0: 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 22 24 !endif....!if "$
0500: 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c (PRJ_PACKAGE_TCL
0510: 4e 41 4d 45 29 22 20 3d 3d 20 22 22 0d 0a 50 52 NAME)" == ""..PR
0520: 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d J_PACKAGE_TCLNAM
0530: 45 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 0d 0a E = $(PROJECT)..
0540: 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 41 6c 73 6f !endif....# Also
0550: 20 73 70 65 63 69 61 6c 20 63 61 73 65 20 54 63 special case Tc
0560: 6c 20 61 6e 64 20 54 6b 20 74 6f 20 73 61 76 65 l and Tk to save
0570: 20 73 6f 6d 65 20 74 79 70 69 6e 67 20 6c 61 74 some typing lat
0580: 65 72 0d 0a 44 4f 49 4e 47 5f 54 43 4c 20 3d 20 er..DOING_TCL =
0590: 30 0d 0a 44 4f 49 4e 47 5f 54 4b 20 20 3d 20 30 0..DOING_TK = 0
05a0: 0d 0a 21 69 66 20 22 24 28 50 52 4f 4a 45 43 54 ..!if "$(PROJECT
05b0: 29 22 20 3d 3d 20 22 74 63 6c 22 0d 0a 44 4f 49 )" == "tcl"..DOI
05c0: 4e 47 5f 54 43 4c 20 3d 20 31 0d 0a 21 65 6c 73 NG_TCL = 1..!els
05d0: 65 69 66 20 22 24 28 50 52 4f 4a 45 43 54 29 22 eif "$(PROJECT)"
05e0: 20 3d 3d 20 22 74 6b 22 0d 0a 44 4f 49 4e 47 5f == "tk"..DOING_
05f0: 54 4b 20 3d 20 31 0d 0a 21 65 6e 64 69 66 0d 0a TK = 1..!endif..
0600: 0d 0a 21 69 66 6e 64 65 66 20 4e 45 45 44 5f 54 ..!ifndef NEED_T
0610: 4b 0d 0a 23 20 42 61 63 6b 77 61 72 64 73 20 63 K..# Backwards c
0620: 6f 6d 70 61 74 69 62 69 6c 69 74 79 0d 0a 21 69 ompatibility..!i
0630: 66 64 65 66 20 50 52 4f 4a 45 43 54 5f 52 45 51 fdef PROJECT_REQ
0640: 55 49 52 45 53 5f 54 4b 0d 0a 4e 45 45 44 5f 54 UIRES_TK..NEED_T
0650: 4b 20 3d 20 24 28 50 52 4f 4a 45 43 54 5f 52 45 K = $(PROJECT_RE
0660: 51 55 49 52 45 53 5f 54 4b 29 0d 0a 21 65 6c 73 QUIRES_TK)..!els
0670: 65 0d 0a 4e 45 45 44 5f 54 4b 20 3d 20 30 0d 0a e..NEED_TK = 0..
0680: 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a !endif..!endif..
0690: 0d 0a 21 69 66 6e 64 65 66 20 4e 45 45 44 5f 54 ..!ifndef NEED_T
06a0: 43 4c 5f 53 4f 55 52 43 45 0d 0a 4e 45 45 44 5f CL_SOURCE..NEED_
06b0: 54 43 4c 5f 53 4f 55 52 43 45 20 3d 20 30 0d 0a TCL_SOURCE = 0..
06c0: 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 64 65 66 !endif....!ifdef
06d0: 20 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 0d NEED_TK_SOURCE.
06e0: 0a 21 69 66 20 24 28 4e 45 45 44 5f 54 4b 5f 53 .!if $(NEED_TK_S
06f0: 4f 55 52 43 45 29 0d 0a 4e 45 45 44 5f 54 4b 20 OURCE)..NEED_TK
0700: 3d 20 31 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6c = 1..!endif..!el
0710: 73 65 0d 0a 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 se..NEED_TK_SOUR
0720: 43 45 20 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a CE = 0..!endif..
0730: 0d 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ..##############
0740: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0750: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0760: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0770: 23 23 0d 0a 23 20 4e 6d 61 6b 65 20 69 73 20 61 ##..# Nmake is a
0780: 20 70 72 65 74 74 79 20 77 65 61 6b 20 65 6e 76 pretty weak env
0790: 69 72 6f 6e 6d 65 6e 74 20 69 6e 20 73 79 6e 74 ironment in synt
07a0: 61 78 20 61 6e 64 20 63 61 70 61 62 69 6c 69 74 ax and capabilit
07b0: 69 65 73 0d 0a 23 20 73 6f 20 74 68 69 73 20 66 ies..# so this f
07c0: 69 6c 65 20 69 73 20 6e 65 63 65 73 73 61 72 69 ile is necessari
07d0: 6c 79 20 76 65 72 62 6f 73 65 2e 20 49 74 27 73 ly verbose. It's
07e0: 20 62 72 6f 6b 65 6e 20 64 6f 77 6e 20 69 6e 74 broken down int
07f0: 6f 0d 0a 23 20 74 68 65 20 66 6f 6c 6c 6f 77 69 o..# the followi
0800: 6e 67 20 70 61 72 74 73 2e 0d 0a 23 0d 0a 23 20 ng parts...#..#
0810: 30 2e 20 53 61 6e 69 74 79 20 63 68 65 63 6b 20 0. Sanity check
0820: 74 68 61 74 20 63 6f 6d 70 69 6c 65 72 20 65 6e that compiler en
0830: 76 69 72 6f 6e 6d 65 6e 74 20 69 73 20 73 65 74 vironment is set
0840: 20 75 70 20 61 6e 64 20 69 6e 69 74 69 61 6c 69 up and initiali
0850: 7a 65 0d 0a 23 20 20 20 20 61 6e 79 20 62 75 69 ze..# any bui
0860: 6c 74 2d 69 6e 20 73 65 74 74 69 6e 67 73 20 66 lt-in settings f
0870: 72 6f 6d 20 74 68 65 20 70 61 72 65 6e 74 20 6d rom the parent m
0880: 61 6b 65 66 69 6c 65 0d 0a 23 20 31 2e 20 46 69 akefile..# 1. Fi
0890: 72 73 74 20 64 65 66 69 6e 65 20 74 68 65 20 65 rst define the e
08a0: 78 74 65 72 6e 61 6c 20 74 6f 6f 6c 73 20 75 73 xternal tools us
08b0: 65 64 20 66 6f 72 20 63 6f 6d 70 69 6c 69 6e 67 ed for compiling
08c0: 2c 20 63 6f 70 79 69 6e 67 20 65 74 63 2e 0d 0a , copying etc...
08d0: 23 20 20 20 20 61 73 20 74 68 69 73 20 69 73 20 # as this is
08e0: 69 6e 64 65 70 65 6e 64 65 6e 74 20 6f 66 20 65 independent of e
08f0: 76 65 72 79 74 68 69 6e 67 20 65 6c 73 65 2e 0d verything else..
0900: 0a 23 20 32 2e 20 46 69 67 75 72 65 20 6f 75 74 .# 2. Figure out
0910: 20 6f 75 72 20 62 75 69 6c 64 20 73 74 72 75 63 our build struc
0920: 74 75 72 65 20 69 6e 20 74 65 72 6d 73 20 6f 66 ture in terms of
0930: 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 2c 20 the directory,
0940: 77 68 65 74 68 65 72 0d 0a 23 20 20 20 20 77 65 whether..# we
0950: 20 61 72 65 20 62 75 69 6c 64 69 6e 67 20 54 63 are building Tc
0960: 6c 20 6f 72 20 61 6e 20 65 78 74 65 6e 73 69 6f l or an extensio
0970: 6e 2c 20 65 74 63 2e 0d 0a 23 20 33 2e 20 44 65 n, etc...# 3. De
0980: 74 65 72 6d 69 6e 65 20 74 68 65 20 63 6f 6d 70 termine the comp
0990: 69 6c 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72 20 iler and linker
09a0: 76 65 72 73 69 6f 6e 73 0d 0a 23 20 34 2e 20 42 versions..# 4. B
09b0: 75 69 6c 64 20 74 68 65 20 6e 6d 61 6b 65 68 6c uild the nmakehl
09c0: 70 20 68 65 6c 70 65 72 20 61 70 70 6c 69 63 61 p helper applica
09d0: 74 69 6f 6e 0d 0a 23 20 35 2e 20 44 65 74 65 72 tion..# 5. Deter
09e0: 6d 69 6e 65 20 74 68 65 20 73 75 70 70 6f 72 74 mine the support
09f0: 65 64 20 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69 ed compiler opti
0a00: 6f 6e 73 20 61 6e 64 20 66 65 61 74 75 72 65 73 ons and features
0a10: 0d 0a 23 20 36 2e 20 50 61 72 73 65 20 74 68 65 ..# 6. Parse the
0a20: 20 4f 50 54 53 20 6d 61 63 72 6f 20 76 61 6c 75 OPTS macro valu
0a30: 65 20 66 6f 72 20 75 73 65 72 2d 73 70 65 63 69 e for user-speci
0a40: 66 69 65 64 20 62 75 69 6c 64 20 63 6f 6e 66 69 fied build confi
0a50: 67 75 72 61 74 69 6f 6e 0d 0a 23 20 37 2e 20 50 guration..# 7. P
0a60: 61 72 73 65 20 74 68 65 20 53 54 41 54 53 20 6d arse the STATS m
0a70: 61 63 72 6f 20 76 61 6c 75 65 20 66 6f 72 20 73 acro value for s
0a80: 74 61 74 69 73 74 69 63 73 20 69 6e 73 74 72 75 tatistics instru
0a90: 6d 65 6e 74 61 74 69 6f 6e 0d 0a 23 20 38 2e 20 mentation..# 8.
0aa0: 50 61 72 73 65 20 74 68 65 20 43 48 45 43 4b 53 Parse the CHECKS
0ab0: 20 6d 61 63 72 6f 20 66 6f 72 20 61 64 64 69 74 macro for addit
0ac0: 69 6f 6e 61 6c 20 63 6f 6d 70 69 6c 61 74 69 6f ional compilatio
0ad0: 6e 20 63 68 65 63 6b 73 0d 0a 23 20 39 2e 20 45 n checks..# 9. E
0ae0: 78 74 72 61 63 74 20 54 63 6c 2c 20 61 6e 64 20 xtract Tcl, and
0af0: 70 6f 73 73 69 62 6c 79 20 54 6b 2c 20 76 65 72 possibly Tk, ver
0b00: 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20 66 72 6f sion numbers fro
0b10: 6d 20 74 68 65 20 68 65 61 64 65 72 73 0d 0a 23 m the headers..#
0b20: 20 31 30 2e 20 42 61 73 65 64 20 6f 6e 20 74 68 10. Based on th
0b30: 69 73 20 73 65 6c 65 63 74 65 64 20 63 6f 6e 66 is selected conf
0b40: 69 67 75 72 61 74 69 6f 6e 2c 20 63 6f 6e 73 74 iguration, const
0b50: 72 75 63 74 20 74 68 65 20 6f 75 74 70 75 74 0d ruct the output.
0b60: 0a 23 20 20 20 20 20 64 69 72 65 63 74 6f 72 79 .# directory
0b70: 20 61 6e 64 20 66 69 6c 65 20 70 61 74 68 73 0d and file paths.
0b80: 0a 23 20 31 31 2e 20 43 6f 6e 73 74 72 75 63 74 .# 11. Construct
0b90: 20 74 68 65 20 70 61 74 68 73 20 77 68 65 72 65 the paths where
0ba0: 20 74 68 65 20 70 61 63 6b 61 67 65 20 69 73 20 the package is
0bb0: 74 6f 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0d to be installed.
0bc0: 0a 23 20 31 32 2e 20 53 65 74 20 75 70 20 74 68 .# 12. Set up th
0bd0: 65 20 61 63 74 75 61 6c 20 6f 70 74 69 6f 6e 73 e actual options
0be0: 20 70 61 73 73 65 64 20 74 6f 20 63 6f 6d 70 69 passed to compi
0bf0: 6c 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72 20 62 ler and linker b
0c00: 61 73 65 64 0d 0a 23 20 20 20 20 20 6f 6e 20 74 ased..# on t
0c10: 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 67 he information g
0c20: 61 74 68 65 72 65 64 20 61 62 6f 76 65 2e 0d 0a athered above...
0c30: 23 20 31 33 2e 20 44 65 66 69 6e 65 20 73 6f 6d # 13. Define som
0c40: 65 20 73 74 61 6e 64 61 72 64 20 62 75 69 6c 64 e standard build
0c50: 20 74 61 72 67 65 74 73 20 61 6e 64 20 69 6d 70 targets and imp
0c60: 6c 69 63 69 74 20 72 75 6c 65 73 2e 20 54 68 65 licit rules. The
0c70: 73 65 20 6d 61 79 0d 0a 23 20 20 20 20 20 62 65 se may..# be
0c80: 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 64 69 73 61 optionally disa
0c90: 62 6c 65 64 20 62 79 20 74 68 65 20 70 61 72 65 bled by the pare
0ca0: 6e 74 20 6d 61 6b 65 66 69 6c 65 2e 0d 0a 23 20 nt makefile...#
0cb0: 31 34 2e 20 28 46 6f 72 20 65 78 74 65 6e 73 69 14. (For extensi
0cc0: 6f 6e 73 20 6f 6e 6c 79 2e 29 20 43 6f 6d 70 61 ons only.) Compa
0cd0: 72 65 20 74 68 65 20 63 6f 6e 66 69 67 75 72 61 re the configura
0ce0: 74 69 6f 6e 20 6f 66 20 74 68 65 20 74 61 72 67 tion of the targ
0cf0: 65 74 0d 0a 23 20 20 20 20 20 54 63 6c 20 61 6e et..# Tcl an
0d00: 64 20 74 68 65 20 65 78 74 65 6e 73 69 6f 6e 73 d the extensions
0d10: 20 61 6e 64 20 77 61 72 6e 20 61 67 61 69 6e 73 and warn agains
0d20: 74 20 64 69 73 63 72 65 70 61 6e 63 69 65 73 2e t discrepancies.
0d30: 0d 0a 23 0d 0a 23 20 4f 6e 65 20 66 69 6e 61 6c ..#..# One final
0d40: 20 6e 6f 74 65 20 61 62 6f 75 74 20 74 68 65 20 note about the
0d50: 6d 61 63 72 6f 20 6e 61 6d 65 73 20 75 73 65 64 macro names used
0d60: 2e 20 54 68 65 79 20 61 72 65 20 61 73 20 74 68 . They are as th
0d70: 65 79 20 61 72 65 0d 0a 23 20 66 6f 72 20 68 69 ey are..# for hi
0d80: 73 74 6f 72 69 63 61 6c 20 72 65 61 73 6f 6e 73 storical reasons
0d90: 2e 20 57 65 20 77 6f 75 6c 64 20 6c 69 6b 65 20 . We would like
0da0: 6c 65 67 61 63 79 20 65 78 74 65 6e 73 69 6f 6e legacy extension
0db0: 73 20 74 6f 0d 0a 23 20 63 6f 6e 74 69 6e 75 65 s to..# continue
0dc0: 20 74 6f 20 77 6f 72 6b 20 77 69 74 68 20 74 68 to work with th
0dd0: 69 73 20 6d 61 6b 65 20 69 6e 63 6c 75 64 65 20 is make include
0de0: 66 69 6c 65 20 73 6f 20 62 65 20 77 61 72 79 20 file so be wary
0df0: 6f 66 0d 0a 23 20 63 68 61 6e 67 69 6e 67 20 74 of..# changing t
0e00: 68 65 6d 20 66 6f 72 20 63 6f 6e 73 69 73 74 65 hem for consiste
0e10: 6e 63 79 20 6f 72 20 63 6c 61 72 69 74 79 2e 0d ncy or clarity..
0e20: 0a 0d 0a 23 20 30 2e 20 53 61 6e 69 74 79 20 63 ...# 0. Sanity c
0e30: 68 65 63 6b 20 63 6f 6d 70 69 6c 65 72 20 65 6e heck compiler en
0e40: 76 69 72 6f 6e 6d 65 6e 74 0d 0a 0d 0a 23 20 43 vironment....# C
0e50: 68 65 63 6b 20 74 6f 20 73 65 65 20 77 65 20 61 heck to see we a
0e60: 72 65 20 63 6f 6e 66 69 67 75 72 65 64 20 74 6f re configured to
0e70: 20 62 75 69 6c 64 20 77 69 74 68 20 4d 53 56 43 build with MSVC
0e80: 20 28 4d 53 44 45 56 44 49 52 2c 20 4d 53 56 43 (MSDEVDIR, MSVC
0e90: 44 49 52 20 6f 72 0d 0a 23 20 56 43 49 4e 53 54 DIR or..# VCINST
0ea0: 41 4c 4c 44 49 52 29 20 6f 72 20 77 69 74 68 20 ALLDIR) or with
0eb0: 74 68 65 20 4d 53 20 50 6c 61 74 66 6f 72 6d 20 the MS Platform
0ec0: 53 44 4b 20 28 4d 53 53 44 4b 20 6f 72 20 57 69 SDK (MSSDK or Wi
0ed0: 6e 64 6f 77 73 53 44 4b 44 69 72 29 0d 0a 0d 0a ndowsSDKDir)....
0ee0: 21 69 66 20 21 64 65 66 69 6e 65 64 28 4d 53 44 !if !defined(MSD
0ef0: 45 56 44 49 52 29 20 26 26 20 21 64 65 66 69 6e EVDIR) && !defin
0f00: 65 64 28 4d 53 56 43 44 49 52 29 20 26 26 20 21 ed(MSVCDIR) && !
0f10: 64 65 66 69 6e 65 64 28 56 43 49 4e 53 54 41 4c defined(VCINSTAL
0f20: 4c 44 49 52 29 20 26 26 20 21 64 65 66 69 6e 65 LDIR) && !define
0f30: 64 28 4d 53 53 44 4b 29 20 26 26 20 21 64 65 66 d(MSSDK) && !def
0f40: 69 6e 65 64 28 57 49 4e 44 4f 57 53 53 44 4b 44 ined(WINDOWSSDKD
0f50: 49 52 29 0d 0a 4d 53 47 20 3d 20 5e 0d 0a 56 69 IR)..MSG = ^..Vi
0f60: 73 75 61 6c 20 43 2b 2b 20 63 6f 6d 70 69 6c 65 sual C++ compile
0f70: 72 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 6e 6f r environment no
0f80: 74 20 69 6e 69 74 69 61 6c 69 7a 65 64 2e 0d 0a t initialized...
0f90: 21 65 72 72 6f 72 20 24 28 4d 53 47 29 0d 0a 21 !error $(MSG)..!
0fa0: 65 6e 64 69 66 0d 0a 0d 0a 23 20 57 65 20 6e 65 endif....# We ne
0fb0: 65 64 20 74 6f 20 72 75 6e 20 66 72 6f 6d 20 74 ed to run from t
0fc0: 68 65 20 64 69 72 65 63 74 6f 72 79 20 74 68 65 he directory the
0fd0: 20 70 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 parent makefile
0fe0: 20 69 73 20 6c 6f 63 61 74 65 64 20 69 6e 2e 0d is located in..
0ff0: 0a 23 20 6e 6d 61 6b 65 20 64 6f 65 73 20 6e 6f .# nmake does no
1000: 74 20 74 65 6c 6c 20 75 73 20 77 68 61 74 20 6d t tell us what m
1010: 61 6b 65 66 69 6c 65 20 77 61 73 20 75 73 65 64 akefile was used
1020: 20 74 6f 20 69 6e 76 6f 6b 65 20 69 74 20 73 6f to invoke it so
1030: 20 70 61 72 65 6e 74 0d 0a 23 20 6d 61 6b 65 66 parent..# makef
1040: 69 6c 65 20 68 61 73 20 74 6f 20 73 65 74 20 74 ile has to set t
1050: 68 65 20 4d 41 4b 45 46 49 4c 45 56 43 20 6d 61 he MAKEFILEVC ma
1060: 63 72 6f 20 6f 72 20 77 65 20 6a 75 73 74 20 6d cro or we just m
1070: 61 6b 65 20 61 20 67 75 65 73 73 20 61 6e 64 0d ake a guess and.
1080: 0a 23 20 77 61 72 6e 20 69 66 20 77 65 20 74 68 .# warn if we th
1090: 69 6e 6b 20 74 68 61 74 20 69 73 20 6e 6f 74 20 ink that is not
10a0: 74 68 65 20 63 61 73 65 2e 0d 0a 21 69 66 20 22 the case...!if "
10b0: 24 28 4d 41 4b 45 46 49 4c 45 56 43 29 22 20 3d $(MAKEFILEVC)" =
10c0: 3d 20 22 22 0d 0a 0d 0a 21 69 66 20 65 78 69 73 = ""....!if exis
10d0: 74 28 22 24 28 50 52 4f 4a 45 43 54 29 2e 76 63 t("$(PROJECT).vc
10e0: 22 29 0d 0a 4d 41 4b 45 46 49 4c 45 56 43 20 3d ")..MAKEFILEVC =
10f0: 20 24 28 50 52 4f 4a 45 43 54 29 2e 76 63 0d 0a $(PROJECT).vc..
1100: 21 65 6c 73 65 69 66 20 65 78 69 73 74 28 22 6d !elseif exist("m
1110: 61 6b 65 66 69 6c 65 2e 76 63 22 29 0d 0a 4d 41 akefile.vc")..MA
1120: 4b 45 46 49 4c 45 56 43 20 3d 20 6d 61 6b 65 66 KEFILEVC = makef
1130: 69 6c 65 2e 76 63 0d 0a 21 65 6e 64 69 66 0d 0a ile.vc..!endif..
1140: 21 65 6e 64 69 66 20 23 20 22 24 28 4d 41 4b 45 !endif # "$(MAKE
1150: 46 49 4c 45 56 43 29 22 20 3d 3d 20 22 22 0d 0a FILEVC)" == ""..
1160: 0d 0a 21 69 66 20 21 65 78 69 73 74 28 22 24 28 ..!if !exist("$(
1170: 4d 41 4b 45 46 49 4c 45 56 43 29 22 29 0d 0a 4d MAKEFILEVC)")..M
1180: 53 47 20 3d 20 5e 0d 0a 59 6f 75 20 6d 75 73 74 SG = ^..You must
1190: 20 72 75 6e 20 6e 6d 61 6b 65 20 66 72 6f 6d 20 run nmake from
11a0: 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 63 6f the directory co
11b0: 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 70 72 6f ntaining the pro
11c0: 6a 65 63 74 20 6d 61 6b 65 66 69 6c 65 2e 5e 0d ject makefile.^.
11d0: 0a 49 66 20 79 6f 75 20 61 72 65 20 64 6f 69 6e .If you are doin
11e0: 67 20 74 68 61 74 20 61 6e 64 20 67 65 74 74 69 g that and getti
11f0: 6e 67 20 74 68 69 73 20 6d 65 73 73 61 67 65 2c ng this message,
1200: 20 73 65 74 20 74 68 65 20 4d 41 4b 45 46 49 4c set the MAKEFIL
1210: 45 56 43 5e 0d 0a 6d 61 63 72 6f 20 74 6f 20 74 EVC^..macro to t
1220: 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 70 he name of the p
1230: 72 6f 6a 65 63 74 20 6d 61 6b 65 66 69 6c 65 2e roject makefile.
1240: 0d 0a 21 6d 65 73 73 61 67 65 20 57 41 52 4e 49 ..!message WARNI
1250: 4e 47 3a 20 24 28 4d 53 47 29 0d 0a 21 65 6e 64 NG: $(MSG)..!end
1260: 69 66 0d 0a 0d 0a 0d 0a 23 23 23 23 23 23 23 23 if......########
1270: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1280: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1290: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
12a0: 23 23 23 23 23 23 23 23 0d 0a 23 20 31 2e 20 44 ########..# 1. D
12b0: 65 66 69 6e 65 20 65 78 74 65 72 6e 61 6c 20 70 efine external p
12c0: 72 6f 67 72 61 6d 73 20 62 65 69 6e 67 20 75 73 rograms being us
12d0: 65 64 0d 0a 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d ed....#---------
12e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
1300: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
1310: 2d 0d 0a 23 20 53 65 74 20 74 68 65 20 70 72 6f -..# Set the pro
1320: 70 65 72 20 63 6f 70 79 20 6d 65 74 68 6f 64 20 per copy method
1330: 74 6f 20 61 76 6f 69 64 20 6f 76 65 72 77 72 69 to avoid overwri
1340: 74 65 20 71 75 65 73 74 69 6f 6e 73 0d 0a 23 20 te questions..#
1350: 74 6f 20 74 68 65 20 75 73 65 72 20 77 68 65 6e to the user when
1360: 20 63 6f 70 79 69 6e 67 20 66 69 6c 65 73 20 61 copying files a
1370: 6e 64 20 73 65 6c 65 63 74 69 6e 67 20 74 68 65 nd selecting the
1380: 20 72 69 67 68 74 0d 0a 23 20 22 64 65 6c 65 74 right..# "delet
1390: 65 20 61 6c 6c 22 20 6d 65 74 68 6f 64 2e 0d 0a e all" method...
13a0: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d #---------------
13b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 0d 0a 52 -----------....R
13e0: 4d 44 49 52 09 3d 20 72 6d 64 69 72 20 2f 53 20 MDIR.= rmdir /S
13f0: 2f 51 0d 0a 43 50 59 09 3d 20 78 63 6f 70 79 20 /Q..CPY.= xcopy
1400: 2f 69 20 2f 79 20 3e 4e 55 4c 0d 0a 43 50 59 44 /i /y >NUL..CPYD
1410: 49 52 20 20 3d 20 78 63 6f 70 79 20 2f 65 20 2f IR = xcopy /e /
1420: 69 20 2f 79 20 3e 4e 55 4c 0d 0a 43 4f 50 59 09 i /y >NUL..COPY.
1430: 3d 20 63 6f 70 79 20 2f 79 20 3e 4e 55 4c 0d 0a = copy /y >NUL..
1440: 4d 4b 44 49 52 20 20 20 3d 20 6d 6b 64 69 72 0d MKDIR = mkdir.
1450: 0a 0d 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 ...#############
1460: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1470: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1480: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1490: 23 23 23 23 23 23 23 23 23 0d 0a 23 20 32 2e 20 #########..# 2.
14a0: 46 69 67 75 72 65 20 6f 75 74 20 6f 75 72 20 62 Figure out our b
14b0: 75 69 6c 64 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 uild environment
14c0: 20 69 6e 20 74 65 72 6d 73 20 6f 66 20 77 68 61 in terms of wha
14d0: 74 20 77 65 27 72 65 20 62 75 69 6c 64 69 6e 67 t we're building
14e0: 2e 0d 0a 23 0d 0a 23 20 28 61 29 20 54 63 6c 20 ...#..# (a) Tcl
14f0: 69 74 73 65 6c 66 0d 0a 23 20 28 62 29 20 54 6b itself..# (b) Tk
1500: 0d 0a 23 20 28 63 29 20 61 20 54 63 6c 20 65 78 ..# (c) a Tcl ex
1510: 74 65 6e 73 69 6f 6e 20 75 73 69 6e 67 20 6c 69 tension using li
1520: 62 72 61 72 69 65 73 2f 69 6e 63 6c 75 64 65 73 braries/includes
1530: 20 66 72 6f 6d 20 61 6e 20 2a 69 6e 73 74 61 6c from an *instal
1540: 6c 65 64 2a 20 54 63 6c 0d 0a 23 20 28 64 29 20 led* Tcl..# (d)
1550: 61 20 54 63 6c 20 65 78 74 65 6e 73 69 6f 6e 20 a Tcl extension
1560: 75 73 69 6e 67 20 6c 69 62 72 61 72 69 65 73 2f using libraries/
1570: 69 6e 63 6c 75 64 65 73 20 66 72 6f 6d 20 54 63 includes from Tc
1580: 6c 20 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f l source directo
1590: 72 79 0d 0a 23 0d 0a 23 20 54 68 69 73 20 6c 61 ry..#..# This la
15a0: 73 74 20 69 73 20 6e 65 65 64 65 64 20 62 65 63 st is needed bec
15b0: 61 75 73 65 20 73 6f 6d 65 20 65 78 74 65 6e 73 ause some extens
15c0: 69 6f 6e 73 20 73 74 69 6c 6c 20 6e 65 65 64 0d ions still need.
15d0: 0a 23 20 73 6f 6d 65 20 54 63 6c 20 69 6e 74 65 .# some Tcl inte
15e0: 72 66 61 63 65 73 20 74 68 61 74 20 61 72 65 20 rfaces that are
15f0: 6e 6f 74 20 70 75 62 6c 69 63 6c 79 20 65 78 70 not publicly exp
1600: 6f 73 65 64 2e 0d 0a 23 0d 0a 23 20 54 68 65 20 osed...#..# The
1610: 66 72 61 67 6d 65 6e 74 20 77 69 6c 6c 20 73 65 fragment will se
1620: 74 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 t the following
1630: 6d 61 63 72 6f 73 3a 0d 0a 23 20 52 4f 4f 54 20 macros:..# ROOT
1640: 2d 20 72 6f 6f 74 20 6f 66 20 74 68 69 73 20 6d - root of this m
1650: 6f 64 75 6c 65 20 73 6f 75 72 63 65 73 0d 0a 23 odule sources..#
1660: 20 43 4f 4d 50 41 54 44 49 52 20 2d 20 73 6f 75 COMPATDIR - sou
1670: 72 63 65 20 64 69 72 65 63 74 6f 72 79 20 74 68 rce directory th
1680: 61 74 20 68 6f 6c 64 73 20 63 6f 6d 70 61 74 69 at holds compati
1690: 62 69 6c 69 74 79 20 73 6f 75 72 63 65 73 0d 0a bility sources..
16a0: 23 20 44 4f 43 44 49 52 20 2d 20 73 6f 75 72 63 # DOCDIR - sourc
16b0: 65 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 e directory cont
16c0: 61 69 6e 69 6e 67 20 64 6f 63 75 6d 65 6e 74 61 aining documenta
16d0: 74 69 6f 6e 20 66 69 6c 65 73 0d 0a 23 20 47 45 tion files..# GE
16e0: 4e 45 52 49 43 44 49 52 20 2d 20 70 6c 61 74 66 NERICDIR - platf
16f0: 6f 72 6d 2d 69 6e 64 65 70 65 6e 64 65 6e 74 20 orm-independent
1700: 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 source directory
1710: 0d 0a 23 20 57 49 4e 44 49 52 20 2d 20 57 69 6e ..# WINDIR - Win
1720: 64 6f 77 73 2d 73 70 65 63 69 66 69 63 20 73 6f dows-specific so
1730: 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 0d 0a urce directory..
1740: 23 20 54 45 53 54 44 49 52 20 2d 20 64 69 72 65 # TESTDIR - dire
1750: 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 ctory containing
1760: 20 74 65 73 74 20 66 69 6c 65 73 0d 0a 23 20 54 test files..# T
1770: 4f 4f 4c 53 44 49 52 20 2d 20 64 69 72 65 63 74 OOLSDIR - direct
1780: 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 62 ory containing b
1790: 75 69 6c 64 20 74 6f 6f 6c 73 0d 0a 23 20 5f 54 uild tools..# _T
17a0: 43 4c 44 49 52 20 2d 20 72 6f 6f 74 20 6f 66 20 CLDIR - root of
17b0: 74 68 65 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61 the Tcl installa
17c0: 74 69 6f 6e 20 4f 52 20 74 68 65 20 54 63 6c 20 tion OR the Tcl
17d0: 73 6f 75 72 63 65 73 2e 20 4e 6f 74 20 73 65 74 sources. Not set
17e0: 0d 0a 23 20 20 20 20 77 68 65 6e 20 62 75 69 6c ..# when buil
17f0: 64 69 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 2e ding Tcl itself.
1800: 0d 0a 23 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 ..# _INSTALLDIR
1810: 2d 20 6e 61 74 69 76 65 20 66 6f 72 6d 20 6f 66 - native form of
1820: 20 74 68 65 20 69 6e 73 74 61 6c 6c 61 74 69 6f the installatio
1830: 6e 20 70 61 74 68 2e 20 46 6f 72 20 54 63 6c 0d n path. For Tcl.
1840: 0a 23 20 20 20 20 74 68 69 73 20 77 69 6c 6c 20 .# this will
1850: 62 65 20 74 68 65 20 72 6f 6f 74 20 6f 66 20 74 be the root of t
1860: 68 65 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61 74 he Tcl installat
1870: 69 6f 6e 2e 20 46 6f 72 20 65 78 74 65 6e 73 69 ion. For extensi
1880: 6f 6e 73 0d 0a 23 20 20 20 20 74 68 69 73 20 77 ons..# this w
1890: 69 6c 6c 20 62 65 20 74 68 65 20 6c 69 62 20 64 ill be the lib d
18a0: 69 72 65 63 74 6f 72 79 20 75 6e 64 65 72 20 74 irectory under t
18b0: 68 65 20 72 6f 6f 74 2e 0d 0a 23 20 54 43 4c 49 he root...# TCLI
18c0: 4e 53 54 41 4c 4c 20 20 2d 20 73 65 74 20 74 6f NSTALL - set to
18d0: 20 31 20 69 66 20 5f 54 43 4c 44 49 52 20 72 65 1 if _TCLDIR re
18e0: 66 65 72 73 20 74 6f 0d 0a 23 20 20 20 20 68 65 fers to..# he
18f0: 61 64 65 72 73 20 61 6e 64 20 6c 69 62 72 61 72 aders and librar
1900: 69 65 73 20 66 72 6f 6d 20 61 6e 20 69 6e 73 74 ies from an inst
1910: 61 6c 6c 65 64 20 54 63 6c 2c 20 61 6e 64 20 30 alled Tcl, and 0
1920: 20 69 66 20 62 75 69 6c 74 20 61 67 61 69 6e 73 if built agains
1930: 74 0d 0a 23 20 20 20 20 54 63 6c 20 73 6f 75 72 t..# Tcl sour
1940: 63 65 73 2e 20 4e 6f 74 20 73 65 74 20 77 68 65 ces. Not set whe
1950: 6e 20 62 75 69 6c 64 69 6e 67 20 54 63 6c 20 69 n building Tcl i
1960: 74 73 65 6c 66 2e 20 59 65 73 2c 20 6e 6f 74 20 tself. Yes, not
1970: 76 65 72 79 20 77 65 6c 6c 0d 0a 23 20 20 20 20 very well..#
1980: 6e 61 6d 65 64 2e 0d 0a 23 20 5f 54 43 4c 5f 48 named...# _TCL_H
1990: 20 2d 20 6e 61 74 69 76 65 20 70 61 74 68 20 74 - native path t
19a0: 6f 20 74 68 65 20 74 63 6c 2e 68 20 66 69 6c 65 o the tcl.h file
19b0: 0d 0a 23 0d 0a 23 20 49 66 20 54 6b 20 69 73 20 ..#..# If Tk is
19c0: 69 6e 76 6f 6c 76 65 64 2c 20 61 6c 73 6f 20 73 involved, also s
19d0: 65 74 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e ets the followin
19e0: 67 0d 0a 23 20 5f 54 4b 44 49 52 20 2d 20 6e 61 g..# _TKDIR - na
19f0: 74 69 76 65 20 66 6f 72 6d 20 54 6b 20 69 6e 73 tive form Tk ins
1a00: 74 61 6c 6c 61 74 69 6f 6e 20 4f 52 20 54 6b 20 tallation OR Tk
1a10: 73 6f 75 72 63 65 2e 20 4e 6f 74 20 73 65 74 20 source. Not set
1a20: 69 66 20 62 75 69 6c 64 69 6e 67 0d 0a 23 20 20 if building..#
1a30: 20 20 54 6b 20 69 74 73 65 6c 66 2e 0d 0a 23 20 Tk itself...#
1a40: 54 4b 49 4e 53 54 41 4c 4c 20 2d 20 73 65 74 20 TKINSTALL - set
1a50: 31 20 69 66 20 5f 54 4b 44 49 52 20 72 65 66 65 1 if _TKDIR refe
1a60: 72 73 20 74 6f 20 69 6e 73 74 61 6c 6c 65 64 20 rs to installed
1a70: 54 6b 20 61 6e 64 20 30 20 69 66 20 54 6b 20 73 Tk and 0 if Tk s
1a80: 6f 75 72 63 65 73 0d 0a 23 20 5f 54 4b 5f 48 20 ources..# _TK_H
1a90: 2d 20 6e 61 74 69 76 65 20 70 61 74 68 20 74 6f - native path to
1aa0: 20 74 68 65 20 74 6b 2e 68 20 66 69 6c 65 0d 0a the tk.h file..
1ab0: 0d 0a 23 20 52 6f 6f 74 20 64 69 72 65 63 74 6f ..# Root directo
1ac0: 72 79 20 66 6f 72 20 73 6f 75 72 63 65 73 20 61 ry for sources a
1ad0: 6e 64 20 61 73 73 75 6d 65 64 20 73 75 62 64 69 nd assumed subdi
1ae0: 72 65 63 74 6f 72 69 65 73 0d 0a 52 4f 4f 54 20 rectories..ROOT
1af0: 3d 20 24 28 4d 41 4b 45 44 49 52 29 5c 2e 2e 0d = $(MAKEDIR)\...
1b00: 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 .# The following
1b10: 20 70 61 74 68 73 20 43 41 4e 4e 4f 54 20 68 61 paths CANNOT ha
1b20: 76 65 20 73 70 61 63 65 73 20 69 6e 20 74 68 65 ve spaces in the
1b30: 6d 20 61 73 20 74 68 65 79 20 61 70 70 65 61 72 m as they appear
1b40: 20 6f 6e 20 74 68 65 0d 0a 23 20 6c 65 66 74 20 on the..# left
1b50: 73 69 64 65 20 6f 66 20 69 6d 70 6c 69 63 69 74 side of implicit
1b60: 20 72 75 6c 65 73 2e 0d 0a 21 69 66 6e 64 65 66 rules...!ifndef
1b70: 20 43 4f 4d 50 41 54 44 49 52 0d 0a 43 4f 4d 50 COMPATDIR..COMP
1b80: 41 54 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c ATDIR.= $(ROOT)\
1b90: 63 6f 6d 70 61 74 0d 0a 21 65 6e 64 69 66 0d 0a compat..!endif..
1ba0: 21 69 66 6e 64 65 66 20 44 4f 43 44 49 52 0d 0a !ifndef DOCDIR..
1bb0: 44 4f 43 44 49 52 09 09 3d 20 24 28 52 4f 4f 54 DOCDIR..= $(ROOT
1bc0: 29 5c 64 6f 63 0d 0a 21 65 6e 64 69 66 0d 0a 21 )\doc..!endif..!
1bd0: 69 66 6e 64 65 66 20 47 45 4e 45 52 49 43 44 49 ifndef GENERICDI
1be0: 52 0d 0a 47 45 4e 45 52 49 43 44 49 52 09 3d 20 R..GENERICDIR.=
1bf0: 24 28 52 4f 4f 54 29 5c 67 65 6e 65 72 69 63 0d $(ROOT)\generic.
1c00: 0a 21 65 6e 64 69 66 0d 0a 21 69 66 6e 64 65 66 .!endif..!ifndef
1c10: 20 54 4f 4f 4c 53 44 49 52 0d 0a 54 4f 4f 4c 53 TOOLSDIR..TOOLS
1c20: 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c 74 6f DIR.= $(ROOT)\to
1c30: 6f 6c 73 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 ols..!endif..!if
1c40: 6e 64 65 66 20 54 45 53 54 44 49 52 0d 0a 54 45 ndef TESTDIR..TE
1c50: 53 54 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c STDIR.= $(ROOT)\
1c60: 74 65 73 74 73 0d 0a 21 65 6e 64 69 66 0d 0a 21 tests..!endif..!
1c70: 69 66 6e 64 65 66 20 4c 49 42 44 49 52 0d 0a 21 ifndef LIBDIR..!
1c80: 69 66 20 65 78 69 73 74 28 22 24 28 52 4f 4f 54 if exist("$(ROOT
1c90: 29 5c 6c 69 62 72 61 72 79 22 29 0d 0a 4c 49 42 )\library")..LIB
1ca0: 44 49 52 20 20 20 20 20 20 20 20 20 20 3d 20 24 DIR = $
1cb0: 28 52 4f 4f 54 29 5c 6c 69 62 72 61 72 79 0d 0a (ROOT)\library..
1cc0: 21 65 6c 73 65 0d 0a 4c 49 42 44 49 52 20 20 20 !else..LIBDIR
1cd0: 20 20 20 20 20 20 20 3d 20 24 28 52 4f 4f 54 29 = $(ROOT)
1ce0: 5c 6c 69 62 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 \lib..!endif..!e
1cf0: 6e 64 69 66 0d 0a 21 69 66 6e 64 65 66 20 44 45 ndif..!ifndef DE
1d00: 4d 4f 44 49 52 0d 0a 21 69 66 20 65 78 69 73 74 MODIR..!if exist
1d10: 28 22 24 28 4c 49 42 44 49 52 29 5c 64 65 6d 6f ("$(LIBDIR)\demo
1d20: 73 22 29 0d 0a 44 45 4d 4f 44 49 52 09 09 3d 20 s")..DEMODIR..=
1d30: 24 28 4c 49 42 44 49 52 29 5c 64 65 6d 6f 73 0d $(LIBDIR)\demos.
1d40: 0a 21 65 6c 73 65 0d 0a 44 45 4d 4f 44 49 52 09 .!else..DEMODIR.
1d50: 09 3d 20 24 28 52 4f 4f 54 29 5c 64 65 6d 6f 73 .= $(ROOT)\demos
1d60: 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 ..!endif..!endif
1d70: 20 23 20 69 66 6e 64 65 66 20 44 45 4d 4f 44 49 # ifndef DEMODI
1d80: 52 0d 0a 23 20 44 6f 20 4e 4f 54 20 65 6e 63 6c R..# Do NOT encl
1d90: 6f 73 65 20 57 49 4e 44 49 52 20 69 6e 20 61 20 ose WINDIR in a
1da0: 21 69 66 6e 64 65 66 20 62 65 63 61 75 73 65 20 !ifndef because
1db0: 57 69 6e 64 6f 77 73 20 61 6c 77 61 79 73 20 64 Windows always d
1dc0: 65 66 69 6e 65 73 0d 0a 23 20 57 49 4e 44 49 52 efines..# WINDIR
1dd0: 20 65 6e 76 20 76 61 72 20 74 6f 20 70 6f 69 6e env var to poin
1de0: 74 20 74 6f 20 63 3a 5c 77 69 6e 64 6f 77 73 21 t to c:\windows!
1df0: 0d 0a 23 20 54 42 44 20 2d 20 54 68 69 73 20 69 ..# TBD - This i
1e00: 73 20 61 20 70 6f 74 65 6e 74 69 61 6c 6c 79 20 s a potentially
1e10: 64 61 6e 67 65 72 6f 75 73 20 63 6f 6e 66 6c 69 dangerous confli
1e20: 63 74 2c 20 72 65 6e 61 6d 65 20 57 49 4e 44 49 ct, rename WINDI
1e30: 52 20 74 6f 0d 0a 23 20 73 6f 6d 65 74 68 69 6e R to..# somethin
1e40: 67 20 65 6c 73 65 0d 0a 57 49 4e 44 49 52 09 09 g else..WINDIR..
1e50: 3d 20 24 28 52 4f 4f 54 29 5c 77 69 6e 0d 0a 0d = $(ROOT)\win...
1e60: 0a 21 69 66 6e 64 65 66 20 52 43 44 49 52 0d 0a .!ifndef RCDIR..
1e70: 21 69 66 20 65 78 69 73 74 28 22 24 28 57 49 4e !if exist("$(WIN
1e80: 44 49 52 29 5c 72 63 22 29 0d 0a 52 43 44 49 52 DIR)\rc")..RCDIR
1e90: 20 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 57 = $(W
1ea0: 49 4e 44 49 52 29 5c 72 63 0d 0a 21 65 6c 73 65 INDIR)\rc..!else
1eb0: 0d 0a 52 43 44 49 52 20 20 20 20 20 20 20 20 20 ..RCDIR
1ec0: 20 20 3d 20 24 28 57 49 4e 44 49 52 29 0d 0a 21 = $(WINDIR)..!
1ed0: 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 52 endif..!endif..R
1ee0: 43 44 49 52 20 3d 20 24 28 52 43 44 49 52 3a 2f CDIR = $(RCDIR:/
1ef0: 3d 5c 29 0d 0a 0d 0a 23 20 54 68 65 20 74 61 72 =\)....# The tar
1f00: 67 65 74 20 64 69 72 65 63 74 6f 72 79 20 77 68 get directory wh
1f10: 65 72 65 20 74 68 65 20 62 75 69 6c 74 20 70 61 ere the built pa
1f20: 63 6b 61 67 65 73 20 61 6e 64 20 62 69 6e 61 72 ckages and binar
1f30: 69 65 73 20 77 69 6c 6c 20 62 65 20 69 6e 73 74 ies will be inst
1f40: 61 6c 6c 65 64 2e 0d 0a 23 20 49 4e 53 54 41 4c alled...# INSTAL
1f50: 4c 44 49 52 20 69 73 20 74 68 65 20 28 6f 70 74 LDIR is the (opt
1f60: 69 6f 6e 61 6c 29 20 70 61 74 68 20 73 70 65 63 ional) path spec
1f70: 69 66 69 65 64 20 62 79 20 74 68 65 20 75 73 65 ified by the use
1f80: 72 2e 0d 0a 23 20 5f 49 4e 53 54 41 4c 4c 44 49 r...# _INSTALLDI
1f90: 52 20 69 73 20 49 4e 53 54 41 4c 4c 44 49 52 20 R is INSTALLDIR
1fa0: 75 73 69 6e 67 20 74 68 65 20 62 61 63 6b 73 6c using the backsl
1fb0: 61 73 68 20 73 65 70 61 72 61 74 6f 72 20 73 79 ash separator sy
1fc0: 6e 74 61 78 0d 0a 21 69 66 64 65 66 20 49 4e 53 ntax..!ifdef INS
1fd0: 54 41 4c 4c 44 49 52 0d 0a 23 23 23 20 46 69 78 TALLDIR..### Fix
1fe0: 20 74 68 65 20 70 61 74 68 20 73 65 70 61 72 61 the path separa
1ff0: 74 6f 72 73 2e 0d 0a 5f 49 4e 53 54 41 4c 4c 44 tors..._INSTALLD
2000: 49 52 09 3d 20 24 28 49 4e 53 54 41 4c 4c 44 49 IR.= $(INSTALLDI
2010: 52 3a 2f 3d 5c 29 0d 0a 21 65 6c 73 65 0d 0a 23 R:/=\)..!else..#
2020: 23 23 20 41 73 73 75 6d 65 20 74 68 65 20 6e 6f ## Assume the no
2030: 72 6d 61 6c 20 64 65 66 61 75 6c 74 2e 0d 0a 5f rmal default..._
2040: 49 4e 53 54 41 4c 4c 44 49 52 09 3d 20 24 28 48 INSTALLDIR.= $(H
2050: 4f 4d 45 44 52 49 56 45 29 5c 54 63 6c 0d 0a 21 OMEDRIVE)\Tcl..!
2060: 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 24 28 44 endif....!if $(D
2070: 4f 49 4e 47 5f 54 43 4c 29 0d 0a 0d 0a 23 20 42 OING_TCL)....# B
2080: 45 47 49 4e 20 43 61 73 65 20 32 28 61 29 20 2d EGIN Case 2(a) -
2090: 20 42 75 69 6c 64 69 6e 67 20 54 63 6c 20 69 74 Building Tcl it
20a0: 73 65 6c 66 0d 0a 0d 0a 23 20 4f 6e 6c 79 20 6e self....# Only n
20b0: 65 65 64 20 74 6f 20 64 65 66 69 6e 65 20 5f 54 eed to define _T
20c0: 43 4c 5f 48 0d 0a 5f 54 43 4c 5f 48 20 3d 20 2e CL_H.._TCL_H = .
20d0: 2e 5c 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 0d .\generic\tcl.h.
20e0: 0a 0d 0a 23 20 45 4e 44 20 43 61 73 65 20 32 28 ...# END Case 2(
20f0: 61 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 54 63 a) - Building Tc
2100: 6c 20 69 74 73 65 6c 66 0d 0a 0d 0a 21 65 6c 73 l itself....!els
2110: 65 69 66 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0d eif $(DOING_TK).
2120: 0a 0d 0a 23 20 42 45 47 49 4e 20 43 61 73 65 20 ...# BEGIN Case
2130: 32 28 62 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 2(b) - Building
2140: 54 6b 0d 0a 0d 0a 54 43 4c 49 4e 53 54 41 4c 4c Tk....TCLINSTALL
2150: 20 3d 20 30 20 23 20 54 6b 20 61 6c 77 61 79 73 = 0 # Tk always
2160: 20 62 75 69 6c 64 73 20 61 67 61 69 6e 73 74 20 builds against
2170: 54 63 6c 20 73 6f 75 72 63 65 2c 20 6e 6f 74 20 Tcl source, not
2180: 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c an installed Tcl
2190: 0d 0a 21 69 66 20 22 24 28 54 43 4c 44 49 52 29 ..!if "$(TCLDIR)
21a0: 22 20 3d 3d 20 22 22 0d 0a 21 69 66 20 5b 65 63 " == ""..!if [ec
21b0: 68 6f 20 54 43 4c 44 49 52 20 3d 20 5c 3e 20 6e ho TCLDIR = \> n
21c0: 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20 5c 0d 0a makehlp.out] \..
21d0: 20 20 20 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70 20 || [nmakehlp
21e0: 2d 4c 20 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 -L generic\tcl.h
21f0: 20 3e 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 >> nmakehlp.out
2200: 5d 0d 0a 21 65 72 72 6f 72 20 2a 2a 2a 20 43 6f ]..!error *** Co
2210: 75 6c 64 20 6e 6f 74 20 6c 6f 63 61 74 65 20 54 uld not locate T
2220: 63 6c 20 73 6f 75 72 63 65 20 64 69 72 65 63 74 cl source direct
2230: 6f 72 79 2e 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 ory...!endif..!i
2240: 6e 63 6c 75 64 65 20 6e 6d 61 6b 65 68 6c 70 2e nclude nmakehlp.
2250: 6f 75 74 0d 0a 21 65 6e 64 69 66 20 23 20 54 43 out..!endif # TC
2260: 4c 44 49 52 20 3d 3d 20 22 22 0d 0a 0d 0a 5f 54 LDIR == ""...._T
2270: 43 4c 44 49 52 09 3d 20 24 28 54 43 4c 44 49 52 CLDIR.= $(TCLDIR
2280: 3a 2f 3d 5c 29 0d 0a 5f 54 43 4c 5f 48 20 20 3d :/=\).._TCL_H =
2290: 20 24 28 5f 54 43 4c 44 49 52 29 5c 67 65 6e 65 $(_TCLDIR)\gene
22a0: 72 69 63 5c 74 63 6c 2e 68 0d 0a 21 69 66 20 21 ric\tcl.h..!if !
22b0: 65 78 69 73 74 28 22 24 28 5f 54 43 4c 5f 48 29 exist("$(_TCL_H)
22c0: 22 29 0d 0a 21 65 72 72 6f 72 20 43 6f 75 6c 64 ")..!error Could
22d0: 20 6e 6f 74 20 6c 6f 63 61 74 65 20 74 63 6c 2e not locate tcl.
22e0: 68 2e 20 50 6c 65 61 73 65 20 73 65 74 20 74 68 h. Please set th
22f0: 65 20 54 43 4c 44 49 52 20 6d 61 63 72 6f 20 74 e TCLDIR macro t
2300: 6f 20 70 6f 69 6e 74 20 74 6f 20 74 68 65 20 54 o point to the T
2310: 63 6c 20 2a 73 6f 75 72 63 65 2a 20 64 69 72 65 cl *source* dire
2320: 63 74 6f 72 79 2e 0d 0a 21 65 6e 64 69 66 0d 0a ctory...!endif..
2330: 0d 0a 5f 54 4b 5f 48 20 3d 20 2e 2e 5c 67 65 6e .._TK_H = ..\gen
2340: 65 72 69 63 5c 74 6b 2e 68 0d 0a 0d 0a 23 20 45 eric\tk.h....# E
2350: 4e 44 20 43 61 73 65 20 32 28 62 29 20 2d 20 42 ND Case 2(b) - B
2360: 75 69 6c 64 69 6e 67 20 54 6b 0d 0a 0d 0a 21 65 uilding Tk....!e
2370: 6c 73 65 0d 0a 0d 0a 23 20 42 45 47 49 4e 20 43 lse....# BEGIN C
2380: 61 73 65 20 32 28 63 29 20 6f 72 20 28 64 29 20 ase 2(c) or (d)
2390: 2d 20 42 75 69 6c 64 69 6e 67 20 61 6e 20 65 78 - Building an ex
23a0: 74 65 6e 73 69 6f 6e 20 6f 74 68 65 72 20 74 68 tension other th
23b0: 61 6e 20 54 6b 0d 0a 0d 0a 23 20 49 66 20 63 6f an Tk....# If co
23c0: 6d 6d 61 6e 64 20 6c 69 6e 65 20 68 61 73 20 73 mmand line has s
23d0: 70 65 63 69 66 69 65 64 20 54 63 6c 20 6c 6f 63 pecified Tcl loc
23e0: 61 74 69 6f 6e 20 74 68 72 6f 75 67 68 20 54 43 ation through TC
23f0: 4c 44 49 52 2c 20 75 73 65 20 69 74 0d 0a 23 20 LDIR, use it..#
2400: 65 6c 73 65 20 64 65 66 61 75 6c 74 20 74 6f 20 else default to
2410: 74 68 65 20 49 4e 53 54 41 4c 4c 44 49 52 20 73 the INSTALLDIR s
2420: 65 74 74 69 6e 67 0d 0a 21 69 66 20 22 24 28 54 etting..!if "$(T
2430: 43 4c 44 49 52 29 22 20 21 3d 20 22 22 0d 0a 0d CLDIR)" != ""...
2440: 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 54 43 4c ._TCLDIR.= $(TCL
2450: 44 49 52 3a 2f 3d 5c 29 0d 0a 21 69 66 20 65 78 DIR:/=\)..!if ex
2460: 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29 5c ist("$(_TCLDIR)\
2470: 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 22 29 20 include\tcl.h")
2480: 23 20 43 61 73 65 20 32 28 63 29 20 77 69 74 68 # Case 2(c) with
2490: 20 54 43 4c 44 49 52 20 64 65 66 69 6e 65 64 0d TCLDIR defined.
24a0: 0a 54 43 4c 49 4e 53 54 41 4c 4c 09 3d 20 31 0d .TCLINSTALL.= 1.
24b0: 0a 5f 54 43 4c 5f 48 20 20 20 20 20 20 20 20 20 ._TCL_H
24c0: 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e = $(_TCLDIR)\in
24d0: 63 6c 75 64 65 5c 74 63 6c 2e 68 0d 0a 21 65 6c clude\tcl.h..!el
24e0: 73 65 69 66 20 65 78 69 73 74 28 22 24 28 5f 54 seif exist("$(_T
24f0: 43 4c 44 49 52 29 5c 67 65 6e 65 72 69 63 5c 74 CLDIR)\generic\t
2500: 63 6c 2e 68 22 29 20 23 20 43 61 73 65 20 32 28 cl.h") # Case 2(
2510: 64 29 20 77 69 74 68 20 54 43 4c 44 49 52 20 64 d) with TCLDIR d
2520: 65 66 69 6e 65 64 0d 0a 54 43 4c 49 4e 53 54 41 efined..TCLINSTA
2530: 4c 4c 09 3d 20 30 0d 0a 5f 54 43 4c 5f 48 20 20 LL.= 0.._TCL_H
2540: 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54 43 4c = $(_TCL
2550: 44 49 52 29 5c 67 65 6e 65 72 69 63 5c 74 63 6c DIR)\generic\tcl
2560: 2e 68 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 65 .h..!endif....!e
2570: 6c 73 65 20 20 23 20 20 23 20 43 61 73 65 20 32 lse # # Case 2
2580: 28 63 29 20 66 6f 72 20 65 78 74 65 6e 73 69 6f (c) for extensio
2590: 6e 73 20 77 69 74 68 20 54 43 4c 44 49 52 20 75 ns with TCLDIR u
25a0: 6e 64 65 66 69 6e 65 64 0d 0a 0d 0a 23 20 4e 65 ndefined....# Ne
25b0: 65 64 20 74 6f 20 6c 6f 63 61 74 65 20 54 63 6c ed to locate Tcl
25c0: 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 77 68 depending on wh
25d0: 65 74 68 65 72 20 69 74 20 6e 65 65 64 73 20 54 ether it needs T
25e0: 63 6c 20 73 6f 75 72 63 65 20 6f 72 20 6e 6f 74 cl source or not
25f0: 2e 0d 0a 23 20 49 66 20 77 65 20 64 6f 6e 27 74 ...# If we don't
2600: 2c 20 63 68 65 63 6b 20 74 68 65 20 49 4e 53 54 , check the INST
2610: 41 4c 4c 44 49 52 20 66 6f 72 20 61 6e 20 69 6e ALLDIR for an in
2620: 73 74 61 6c 6c 65 64 20 54 63 6c 20 66 69 72 73 stalled Tcl firs
2630: 74 0d 0a 0d 0a 21 69 66 20 65 78 69 73 74 28 22 t....!if exist("
2640: 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 $(_INSTALLDIR)\i
2650: 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 22 29 20 26 nclude\tcl.h") &
2660: 26 20 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f & !$(NEED_TCL_SO
2670: 55 52 43 45 29 0d 0a 0d 0a 54 43 4c 49 4e 53 54 URCE)....TCLINST
2680: 41 4c 4c 09 3d 20 31 0d 0a 54 43 4c 44 49 52 20 ALL.= 1..TCLDIR
2690: 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 49 4e = $(_IN
26a0: 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0d 0a 23 20 STALLDIR)\....#
26b0: 4e 4f 54 45 3a 20 77 65 20 77 69 6c 6c 20 62 65 NOTE: we will be
26c0: 20 72 65 73 65 74 74 69 6e 67 20 5f 49 4e 53 54 resetting _INST
26d0: 41 4c 4c 44 49 52 20 74 6f 20 5f 49 4e 53 54 41 ALLDIR to _INSTA
26e0: 4c 4c 44 49 52 2f 6c 69 62 20 66 6f 72 20 65 78 LLDIR/lib for ex
26f0: 74 65 6e 73 69 6f 6e 73 0d 0a 23 20 6c 61 74 65 tensions..# late
2700: 72 20 73 6f 20 74 68 65 20 5c 2e 2e 20 61 63 63 r so the \.. acc
2710: 6f 75 6e 74 73 20 66 6f 72 20 74 68 65 20 2f 6c ounts for the /l
2720: 69 62 0d 0a 5f 54 43 4c 44 49 52 09 09 3d 20 24 ib.._TCLDIR..= $
2730: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e (_INSTALLDIR)\..
2740: 0d 0a 5f 54 43 4c 5f 48 20 20 20 20 20 20 20 20 .._TCL_H
2750: 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 = $(_TCLDIR)\i
2760: 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 0d 0a 0d 0a nclude\tcl.h....
2770: 21 65 6c 73 65 20 23 20 65 78 69 73 74 28 2e 2e !else # exist(..
2780: 2e 29 20 26 26 20 21 20 24 28 4e 45 45 44 5f 54 .) && ! $(NEED_T
2790: 43 4c 5f 53 4f 55 52 43 45 29 0d 0a 0d 0a 21 69 CL_SOURCE)....!i
27a0: 66 20 5b 65 63 68 6f 20 5f 54 43 4c 44 49 52 20 f [echo _TCLDIR
27b0: 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 = \> nmakehlp.ou
27c0: 74 5d 20 5c 0d 0a 20 20 20 7c 7c 20 5b 6e 6d 61 t] \.. || [nma
27d0: 6b 65 68 6c 70 20 2d 4c 20 67 65 6e 65 72 69 63 kehlp -L generic
27e0: 5c 74 63 6c 2e 68 20 3e 3e 20 6e 6d 61 6b 65 68 \tcl.h >> nmakeh
27f0: 6c 70 2e 6f 75 74 5d 0d 0a 21 65 72 72 6f 72 20 lp.out]..!error
2800: 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 6c 6f *** Could not lo
2810: 63 61 74 65 20 54 63 6c 20 73 6f 75 72 63 65 20 cate Tcl source
2820: 64 69 72 65 63 74 6f 72 79 2e 0d 0a 21 65 6e 64 directory...!end
2830: 69 66 0d 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 if..!include nma
2840: 6b 65 68 6c 70 2e 6f 75 74 0d 0a 54 43 4c 49 4e kehlp.out..TCLIN
2850: 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 30 0d 0a STALL = 0..
2860: 54 43 4c 44 49 52 20 20 20 20 20 20 20 20 20 3d TCLDIR =
2870: 20 24 28 5f 54 43 4c 44 49 52 29 0d 0a 5f 54 43 $(_TCLDIR).._TC
2880: 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24 L_H = $
2890: 28 5f 54 43 4c 44 49 52 29 5c 67 65 6e 65 72 69 (_TCLDIR)\generi
28a0: 63 5c 74 63 6c 2e 68 0d 0a 0d 0a 21 65 6e 64 69 c\tcl.h....!endi
28b0: 66 20 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 26 f # exist(...) &
28c0: 26 20 21 20 24 28 4e 45 45 44 5f 54 43 4c 5f 53 & ! $(NEED_TCL_S
28d0: 4f 55 52 43 45 29 0d 0a 0d 0a 21 65 6e 64 69 66 OURCE)....!endif
28e0: 20 23 20 54 43 4c 44 49 52 0d 0a 0d 0a 21 69 66 # TCLDIR....!if
28f0: 6e 64 65 66 20 5f 54 43 4c 5f 48 0d 0a 4d 53 47 ndef _TCL_H..MSG
2900: 20 3d 5e 0d 0a 46 61 69 6c 65 64 20 74 6f 20 66 =^..Failed to f
2910: 69 6e 64 20 74 63 6c 2e 68 2e 20 54 68 65 20 54 ind tcl.h. The T
2920: 43 4c 44 49 52 20 6d 61 63 72 6f 20 69 73 20 73 CLDIR macro is s
2930: 65 74 20 69 6e 63 6f 72 72 65 63 74 6c 79 20 6f et incorrectly o
2940: 72 20 69 73 20 6e 6f 74 20 73 65 74 20 61 6e 64 r is not set and
2950: 20 64 65 66 61 75 6c 74 20 70 61 74 68 20 64 6f default path do
2960: 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 74 es not contain t
2970: 63 6c 2e 68 2e 0d 0a 21 65 72 72 6f 72 20 24 28 cl.h...!error $(
2980: 4d 53 47 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a MSG)..!endif....
2990: 23 20 4e 6f 77 20 64 6f 20 74 68 65 20 73 61 6d # Now do the sam
29a0: 65 20 74 6f 20 6c 6f 63 61 74 65 20 54 6b 20 68 e to locate Tk h
29b0: 65 61 64 65 72 73 20 61 6e 64 20 6c 69 62 73 20 eaders and libs
29c0: 69 66 20 70 72 6f 6a 65 63 74 20 72 65 71 75 69 if project requi
29d0: 72 65 73 20 54 6b 0d 0a 21 69 66 20 24 28 4e 45 res Tk..!if $(NE
29e0: 45 44 5f 54 4b 29 0d 0a 0d 0a 21 69 66 20 22 24 ED_TK)....!if "$
29f0: 28 54 4b 44 49 52 29 22 20 21 3d 20 22 22 0d 0a (TKDIR)" != ""..
2a00: 0d 0a 5f 54 4b 44 49 52 20 3d 20 24 28 54 4b 44 .._TKDIR = $(TKD
2a10: 49 52 3a 2f 3d 5c 29 0d 0a 21 69 66 20 65 78 69 IR:/=\)..!if exi
2a20: 73 74 28 22 24 28 5f 54 4b 44 49 52 29 5c 69 6e st("$(_TKDIR)\in
2a30: 63 6c 75 64 65 5c 74 6b 2e 68 22 29 0d 0a 54 4b clude\tk.h")..TK
2a40: 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 31 INSTALL = 1
2a50: 0d 0a 5f 54 4b 5f 48 20 20 20 20 20 20 20 20 20 .._TK_H
2a60: 20 3d 20 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 = $(_TKDIR)\inc
2a70: 6c 75 64 65 5c 74 6b 2e 68 0d 0a 21 65 6c 73 65 lude\tk.h..!else
2a80: 69 66 20 65 78 69 73 74 28 22 24 28 5f 54 4b 44 if exist("$(_TKD
2a90: 49 52 29 5c 67 65 6e 65 72 69 63 5c 74 6b 2e 68 IR)\generic\tk.h
2aa0: 22 29 0d 0a 54 4b 49 4e 53 54 41 4c 4c 20 20 20 ")..TKINSTALL
2ab0: 20 20 20 3d 20 30 0d 0a 5f 54 4b 5f 48 20 20 20 = 0.._TK_H
2ac0: 20 20 20 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 = $(_TKDI
2ad0: 52 29 5c 67 65 6e 65 72 69 63 5c 74 6b 2e 68 0d R)\generic\tk.h.
2ae0: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 65 6c 73 65 .!endif....!else
2af0: 20 23 20 54 4b 44 49 52 20 6e 6f 74 20 64 65 66 # TKDIR not def
2b00: 69 6e 65 64 0d 0a 0d 0a 23 20 4e 65 65 64 20 74 ined....# Need t
2b10: 6f 20 6c 6f 63 61 74 65 20 54 63 6c 20 64 65 70 o locate Tcl dep
2b20: 65 6e 64 69 6e 67 20 6f 6e 20 77 68 65 74 68 65 ending on whethe
2b30: 72 20 69 74 20 6e 65 65 64 73 20 54 63 6c 20 73 r it needs Tcl s
2b40: 6f 75 72 63 65 20 6f 72 20 6e 6f 74 2e 0d 0a 23 ource or not...#
2b50: 20 49 66 20 77 65 20 64 6f 6e 27 74 2c 20 63 68 If we don't, ch
2b60: 65 63 6b 20 74 68 65 20 49 4e 53 54 41 4c 4c 44 eck the INSTALLD
2b70: 49 52 20 66 6f 72 20 61 6e 20 69 6e 73 74 61 6c IR for an instal
2b80: 6c 65 64 20 54 63 6c 20 66 69 72 73 74 0d 0a 0d led Tcl first...
2b90: 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f 49 .!if exist("$(_I
2ba0: 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75 NSTALLDIR)\inclu
2bb0: 64 65 5c 74 6b 2e 68 22 29 20 26 26 20 21 24 28 de\tk.h") && !$(
2bc0: 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0d NEED_TK_SOURCE).
2bd0: 0a 0d 0a 54 4b 49 4e 53 54 41 4c 4c 20 20 20 20 ...TKINSTALL
2be0: 20 20 3d 20 31 0d 0a 23 20 4e 4f 54 45 3a 20 77 = 1..# NOTE: w
2bf0: 65 20 77 69 6c 6c 20 62 65 20 72 65 73 65 74 74 e will be resett
2c00: 69 6e 67 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 ing _INSTALLDIR
2c10: 74 6f 20 5f 49 4e 53 54 41 4c 4c 44 49 52 2f 6c to _INSTALLDIR/l
2c20: 69 62 20 66 6f 72 20 65 78 74 65 6e 73 69 6f 6e ib for extension
2c30: 73 0d 0a 23 20 6c 61 74 65 72 20 73 6f 20 74 68 s..# later so th
2c40: 65 20 5c 2e 2e 20 61 63 63 6f 75 6e 74 73 20 66 e \.. accounts f
2c50: 6f 72 20 74 68 65 20 2f 6c 69 62 0d 0a 5f 54 4b or the /lib.._TK
2c60: 44 49 52 20 20 20 20 20 20 20 20 20 3d 20 24 28 DIR = $(
2c70: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0d _INSTALLDIR)\...
2c80: 0a 5f 54 4b 5f 48 20 20 20 20 20 20 20 20 20 20 ._TK_H
2c90: 3d 20 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c = $(_TKDIR)\incl
2ca0: 75 64 65 5c 74 6b 2e 68 0d 0a 54 4b 44 49 52 20 ude\tk.h..TKDIR
2cb0: 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54 4b = $(_TK
2cc0: 44 49 52 29 0d 0a 0d 0a 21 65 6c 73 65 20 23 20 DIR)....!else #
2cd0: 65 78 69 73 74 28 22 24 28 5f 49 4e 53 54 41 4c exist("$(_INSTAL
2ce0: 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 6b LDIR)\include\tk
2cf0: 2e 68 22 29 20 26 26 20 21 24 28 4e 45 45 44 5f .h") && !$(NEED_
2d00: 54 4b 5f 53 4f 55 52 43 45 29 0d 0a 0d 0a 21 69 TK_SOURCE)....!i
2d10: 66 20 5b 65 63 68 6f 20 5f 54 4b 44 49 52 20 3d f [echo _TKDIR =
2d20: 20 5c 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 \> nmakehlp.out
2d30: 5d 20 5c 0d 0a 20 20 20 7c 7c 20 5b 6e 6d 61 6b ] \.. || [nmak
2d40: 65 68 6c 70 20 2d 4c 20 67 65 6e 65 72 69 63 5c ehlp -L generic\
2d50: 74 6b 2e 68 20 3e 3e 20 6e 6d 61 6b 65 68 6c 70 tk.h >> nmakehlp
2d60: 2e 6f 75 74 5d 0d 0a 21 65 72 72 6f 72 20 2a 2a .out]..!error **
2d70: 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 6c 6f 63 61 * Could not loca
2d80: 74 65 20 54 6b 20 73 6f 75 72 63 65 20 64 69 72 te Tk source dir
2d90: 65 63 74 6f 72 79 2e 0d 0a 21 65 6e 64 69 66 0d ectory...!endif.
2da0: 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 6b 65 68 .!include nmakeh
2db0: 6c 70 2e 6f 75 74 0d 0a 54 4b 49 4e 53 54 41 4c lp.out..TKINSTAL
2dc0: 4c 20 20 20 20 20 20 3d 20 30 0d 0a 54 4b 44 49 L = 0..TKDI
2dd0: 52 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f R = $(_
2de0: 54 4b 44 49 52 29 0d 0a 5f 54 4b 5f 48 20 20 20 TKDIR).._TK_H
2df0: 20 20 20 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 = $(_TKDI
2e00: 52 29 5c 67 65 6e 65 72 69 63 5c 74 6b 2e 68 0d R)\generic\tk.h.
2e10: 0a 0d 0a 21 65 6e 64 69 66 20 23 20 65 78 69 73 ...!endif # exis
2e20: 74 28 22 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 t("$(_INSTALLDIR
2e30: 29 5c 69 6e 63 6c 75 64 65 5c 74 6b 2e 68 22 29 )\include\tk.h")
2e40: 20 26 26 20 21 24 28 4e 45 45 44 5f 54 4b 5f 53 && !$(NEED_TK_S
2e50: 4f 55 52 43 45 29 0d 0a 0d 0a 21 65 6e 64 69 66 OURCE)....!endif
2e60: 20 23 20 54 4b 44 49 52 0d 0a 0d 0a 21 69 66 6e # TKDIR....!ifn
2e70: 64 65 66 20 5f 54 4b 5f 48 0d 0a 4d 53 47 20 3d def _TK_H..MSG =
2e80: 5e 0d 0a 46 61 69 6c 65 64 20 74 6f 20 66 69 6e ^..Failed to fin
2e90: 64 20 74 6b 2e 68 2e 20 54 68 65 20 54 4b 44 49 d tk.h. The TKDI
2ea0: 52 20 6d 61 63 72 6f 20 69 73 20 73 65 74 20 69 R macro is set i
2eb0: 6e 63 6f 72 72 65 63 74 6c 79 20 6f 72 20 69 73 ncorrectly or is
2ec0: 20 6e 6f 74 20 73 65 74 20 61 6e 64 20 64 65 66 not set and def
2ed0: 61 75 6c 74 20 70 61 74 68 20 64 6f 65 73 20 6e ault path does n
2ee0: 6f 74 20 63 6f 6e 74 61 69 6e 20 74 6b 2e 68 2e ot contain tk.h.
2ef0: 0d 0a 21 65 72 72 6f 72 20 24 28 4d 53 47 29 0d ..!error $(MSG).
2f00: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 65 6e 64 69 .!endif....!endi
2f10: 66 20 23 20 4e 45 45 44 5f 54 4b 0d 0a 0d 0a 21 f # NEED_TK....!
2f20: 69 66 20 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f if $(NEED_TCL_SO
2f30: 55 52 43 45 29 20 26 26 20 24 28 54 43 4c 49 4e URCE) && $(TCLIN
2f40: 53 54 41 4c 4c 29 0d 0a 4d 53 47 20 3d 20 5e 0d STALL)..MSG = ^.
2f50: 0a 2a 2a 2a 20 57 61 72 6e 69 6e 67 3a 20 54 68 .*** Warning: Th
2f60: 69 73 20 65 78 74 65 6e 73 69 6f 6e 20 72 65 71 is extension req
2f70: 75 69 72 65 73 20 74 68 65 20 73 6f 75 72 63 65 uires the source
2f80: 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 distribution of
2f90: 20 54 63 6c 2e 5e 0d 0a 2a 2a 2a 20 50 6c 65 61 Tcl.^..*** Plea
2fa0: 73 65 20 73 65 74 20 74 68 65 20 54 43 4c 44 49 se set the TCLDI
2fb0: 52 20 6d 61 63 72 6f 20 74 6f 20 70 6f 69 6e 74 R macro to point
2fc0: 20 74 6f 20 74 68 65 20 54 63 6c 20 73 6f 75 72 to the Tcl sour
2fd0: 63 65 73 2e 0d 0a 21 65 72 72 6f 72 20 24 28 4d ces...!error $(M
2fe0: 53 47 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 SG)..!endif....!
2ff0: 69 66 20 24 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 if $(NEED_TK_SOU
3000: 52 43 45 29 0d 0a 21 69 66 20 24 28 54 4b 49 4e RCE)..!if $(TKIN
3010: 53 54 41 4c 4c 29 0d 0a 4d 53 47 20 3d 20 5e 0d STALL)..MSG = ^.
3020: 0a 2a 2a 2a 20 57 61 72 6e 69 6e 67 3a 20 54 68 .*** Warning: Th
3030: 69 73 20 65 78 74 65 6e 73 69 6f 6e 20 72 65 71 is extension req
3040: 75 69 72 65 73 20 74 68 65 20 73 6f 75 72 63 65 uires the source
3050: 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 distribution of
3060: 20 54 6b 2e 5e 0d 0a 2a 2a 2a 20 50 6c 65 61 73 Tk.^..*** Pleas
3070: 65 20 73 65 74 20 74 68 65 20 54 4b 44 49 52 20 e set the TKDIR
3080: 6d 61 63 72 6f 20 74 6f 20 70 6f 69 6e 74 20 74 macro to point t
3090: 6f 20 74 68 65 20 54 6b 20 73 6f 75 72 63 65 73 o the Tk sources
30a0: 2e 0d 0a 21 65 72 72 6f 72 20 24 28 4d 53 47 29 ...!error $(MSG)
30b0: 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 ..!endif..!endif
30c0: 0d 0a 0d 0a 0d 0a 23 20 49 66 20 49 4e 53 54 41 ......# If INSTA
30d0: 4c 4c 44 49 52 20 73 65 74 20 74 6f 20 54 63 6c LLDIR set to Tcl
30e0: 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 72 6f installation ro
30f0: 6f 74 20 64 69 72 20 74 68 65 6e 20 72 65 73 65 ot dir then rese
3100: 74 20 74 6f 20 74 68 65 0d 0a 23 20 6c 69 62 20 t to the..# lib
3110: 64 69 72 20 66 6f 72 20 69 6e 73 74 61 6c 6c 69 dir for installi
3120: 6e 67 20 65 78 74 65 6e 73 69 6f 6e 73 20 0d 0a ng extensions ..
3130: 21 69 66 20 65 78 69 73 74 28 22 24 28 5f 49 4e !if exist("$(_IN
3140: 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75 64 STALLDIR)\includ
3150: 65 5c 74 63 6c 2e 68 22 29 0d 0a 5f 49 4e 53 54 e\tcl.h").._INST
3160: 41 4c 4c 44 49 52 3d 24 28 5f 49 4e 53 54 41 4c ALLDIR=$(_INSTAL
3170: 4c 44 49 52 29 5c 6c 69 62 0d 0a 21 65 6e 64 69 LDIR)\lib..!endi
3180: 66 0d 0a 0d 0a 23 20 45 4e 44 20 43 61 73 65 20 f....# END Case
3190: 32 28 63 29 20 6f 72 20 28 64 29 20 2d 20 42 75 2(c) or (d) - Bu
31a0: 69 6c 64 69 6e 67 20 61 6e 20 65 78 74 65 6e 73 ilding an extens
31b0: 69 6f 6e 0d 0a 21 65 6e 64 69 66 20 23 20 69 66 ion..!endif # if
31c0: 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a 0d $(DOING_TCL)...
31d0: 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 .###############
31e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
31f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3200: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3210: 23 0d 0a 23 20 33 2e 20 44 65 74 65 72 6d 69 6e #..# 3. Determin
3220: 65 20 63 6f 6d 70 69 6c 65 72 20 76 65 72 73 69 e compiler versi
3230: 6f 6e 20 61 6e 64 20 61 72 63 68 69 74 65 63 74 on and architect
3240: 75 72 65 0d 0a 23 20 49 6e 20 74 68 69 73 20 73 ure..# In this s
3250: 65 63 74 69 6f 6e 2c 20 77 65 20 66 69 67 75 72 ection, we figur
3260: 65 20 6f 75 74 20 74 68 65 20 63 6f 6d 70 69 6c e out the compil
3270: 65 72 20 76 65 72 73 69 6f 6e 20 61 6e 64 20 74 er version and t
3280: 68 65 0d 0a 23 20 61 72 63 68 69 74 65 63 74 75 he..# architectu
3290: 72 65 20 66 6f 72 20 77 68 69 63 68 20 77 65 20 re for which we
32a0: 61 72 65 20 62 75 69 6c 64 69 6e 67 2e 20 54 68 are building. Th
32b0: 69 73 20 73 65 74 73 20 74 68 65 0d 0a 23 20 66 is sets the..# f
32c0: 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 3a ollowing macros:
32d0: 0d 0a 23 20 56 43 56 45 52 53 49 4f 4e 20 2d 20 ..# VCVERSION -
32e0: 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 63 6f 6d the internal com
32f0: 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 61 73 piler version as
3300: 20 31 32 30 30 2c 20 31 34 30 30 2c 20 31 39 31 1200, 1400, 191
3310: 30 20 65 74 63 2e 0d 0a 23 20 20 20 20 20 54 68 0 etc...# Th
3320: 69 73 20 69 73 20 61 6c 73 6f 20 70 72 69 6e 74 is is also print
3330: 65 64 20 62 79 20 74 68 65 20 63 6f 6d 70 69 6c ed by the compil
3340: 65 72 20 69 6e 20 64 6f 74 74 65 64 20 66 6f 72 er in dotted for
3350: 6d 20 31 39 2e 31 30 20 65 74 63 2e 0d 0a 23 20 m 19.10 etc...#
3360: 56 43 56 45 52 20 2d 20 74 68 65 20 22 6d 61 72 VCVER - the "mar
3370: 6b 65 74 69 6e 67 20 76 65 72 73 69 6f 6e 22 2c keting version",
3380: 20 66 6f 72 20 65 78 61 6d 70 6c 65 20 56 69 73 for example Vis
3390: 75 61 6c 20 43 2b 2b 20 36 20 66 6f 72 20 69 6e ual C++ 6 for in
33a0: 74 65 72 6e 61 6c 0d 0a 23 20 20 20 20 20 63 6f ternal..# co
33b0: 6d 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 31 mpiler version 1
33c0: 32 30 30 2e 20 54 68 69 73 20 69 73 20 6b 65 70 200. This is kep
33d0: 74 20 6f 6e 6c 79 20 66 6f 72 20 6c 65 67 61 63 t only for legac
33e0: 79 20 72 65 61 73 6f 6e 73 20 61 73 20 69 74 0d y reasons as it.
33f0: 0a 23 20 20 20 20 20 64 6f 65 73 20 6e 6f 74 20 .# does not
3400: 6d 61 6b 65 20 73 65 6e 73 65 20 66 6f 72 20 72 make sense for r
3410: 65 63 65 6e 74 20 4d 69 63 72 6f 73 6f 66 74 20 ecent Microsoft
3420: 63 6f 6d 70 69 6c 65 72 73 2e 20 4f 6e 6c 79 20 compilers. Only
3430: 75 73 65 64 20 66 6f 72 0d 0a 23 20 20 20 20 20 used for..#
3440: 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f 72 79 output directory
3450: 20 6e 61 6d 65 73 2e 0d 0a 23 20 41 52 43 48 20 names...# ARCH
3460: 2d 20 73 65 74 20 74 6f 20 49 58 38 36 20 6f 72 - set to IX86 or
3470: 20 41 4d 44 36 34 20 64 65 70 65 6e 64 69 6e 67 AMD64 depending
3480: 20 6f 6e 20 33 32 2d 20 6f 72 20 36 34 2d 62 69 on 32- or 64-bi
3490: 74 20 74 61 72 67 65 74 0d 0a 23 20 4e 41 54 49 t target..# NATI
34a0: 56 45 5f 41 52 43 48 20 2d 20 73 65 74 20 74 6f VE_ARCH - set to
34b0: 20 49 58 38 36 20 6f 72 20 41 4d 44 36 34 20 66 IX86 or AMD64 f
34c0: 6f 72 20 74 68 65 20 68 6f 73 74 20 6d 61 63 68 or the host mach
34d0: 69 6e 65 0d 0a 23 20 4d 41 43 48 49 4e 45 20 2d ine..# MACHINE -
34e0: 20 73 61 6d 65 20 61 73 20 24 28 41 52 43 48 29 same as $(ARCH)
34f0: 20 2d 20 6c 65 67 61 63 79 0d 0a 23 20 5f 56 43 - legacy..# _VC
3500: 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 44 5f _MANIFEST_EMBED_
3510: 7b 44 4c 4c 2c 45 58 45 7d 20 2d 20 63 6f 6d 6d {DLL,EXE} - comm
3520: 61 6e 64 73 20 66 6f 72 20 65 6d 62 65 64 64 69 ands for embeddi
3530: 6e 67 20 61 20 6d 61 6e 69 66 65 73 74 20 69 66 ng a manifest if
3540: 20 6e 65 65 64 65 64 0d 0a 23 20 43 46 47 5f 45 needed..# CFG_E
3550: 4e 43 4f 44 49 4e 47 20 2d 20 73 65 74 20 74 6f NCODING - set to
3560: 20 61 6e 20 63 68 61 72 61 63 74 65 72 20 65 6e an character en
3570: 63 6f 64 69 6e 67 2e 0d 0a 23 20 20 20 54 42 44 coding...# TBD
3580: 20 2d 20 74 68 69 73 20 69 73 20 70 61 73 73 65 - this is passe
3590: 64 20 74 6f 20 63 6f 6d 70 69 6c 65 72 20 61 73 d to compiler as
35a0: 20 54 43 4c 5f 43 46 47 56 41 4c 5f 45 4e 43 4f TCL_CFGVAL_ENCO
35b0: 44 49 4e 47 20 62 75 74 20 63 61 6e 27 74 0d 0a DING but can't..
35c0: 23 20 20 20 73 65 65 20 77 68 65 72 65 20 69 74 # see where it
35d0: 20 69 73 20 75 73 65 64 0d 0a 0d 0a 63 63 33 32 is used....cc32
35e0: 09 09 3d 20 24 28 43 43 29 20 20 20 23 20 62 75 ..= $(CC) # bu
35f0: 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c 74 2e 0d ilt-in default..
3600: 0a 6c 69 6e 6b 33 32 09 09 3d 20 6c 69 6e 6b 0d .link32..= link.
3610: 0a 6c 69 62 33 32 09 09 3d 20 6c 69 62 0d 0a 72 .lib32..= lib..r
3620: 63 33 32 09 09 3d 20 24 28 52 43 29 20 20 20 23 c32..= $(RC) #
3630: 20 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c built-in defaul
3640: 74 2e 0d 0a 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d t.....#---------
3650: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3660: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3670: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3680: 2d 2d 2d 2d 2d 2d 2d 0d 0a 23 20 46 69 67 75 72 -------..# Figur
3690: 65 20 6f 75 74 20 74 68 65 20 63 6f 6d 70 69 6c e out the compil
36a0: 65 72 20 61 72 63 68 69 74 65 63 74 75 72 65 20 er architecture
36b0: 61 6e 64 20 76 65 72 73 69 6f 6e 20 62 79 20 77 and version by w
36c0: 72 69 74 69 6e 67 0d 0a 23 20 74 68 65 20 43 20 riting..# the C
36d0: 6d 61 63 72 6f 73 20 74 6f 20 61 20 66 69 6c 65 macros to a file
36e0: 2c 20 70 72 65 70 72 6f 63 65 73 73 69 6e 67 20 , preprocessing
36f0: 74 68 65 6d 20 77 69 74 68 20 74 68 65 20 43 0d them with the C.
3700: 0a 23 20 70 72 65 70 72 6f 63 65 73 73 6f 72 20 .# preprocessor
3710: 61 6e 64 20 72 65 61 64 69 6e 67 20 62 61 63 6b and reading back
3720: 20 74 68 65 20 63 72 65 61 74 65 64 20 66 69 6c the created fil
3730: 65 0d 0a 0d 0a 5f 48 41 53 48 3d 5e 23 0d 0a 5f e...._HASH=^#.._
3740: 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 VC_MANIFEST_EMBE
3750: 44 5f 45 58 45 3d 0d 0a 5f 56 43 5f 4d 41 4e 49 D_EXE=.._VC_MANI
3760: 46 45 53 54 5f 45 4d 42 45 44 5f 44 4c 4c 3d 0d FEST_EMBED_DLL=.
3770: 0a 56 43 56 45 52 3d 30 0d 0a 21 69 66 20 21 5b .VCVER=0..!if ![
3780: 65 63 68 6f 20 56 43 56 45 52 53 49 4f 4e 3d 5f echo VCVERSION=_
3790: 4d 53 43 5f 56 45 52 20 3e 20 76 65 72 63 6c 2e MSC_VER > vercl.
37a0: 78 5d 20 5c 0d 0a 20 20 20 20 26 26 20 21 5b 65 x] \.. && ![e
37b0: 63 68 6f 20 24 28 5f 48 41 53 48 29 69 66 20 64 cho $(_HASH)if d
37c0: 65 66 69 6e 65 64 28 5f 4d 5f 49 58 38 36 29 20 efined(_M_IX86)
37d0: 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 5c 0d 0a 20 >> vercl.x] \..
37e0: 20 20 20 26 26 20 21 5b 65 63 68 6f 20 41 52 43 && ![echo ARC
37f0: 48 3d 49 58 38 36 20 3e 3e 20 76 65 72 63 6c 2e H=IX86 >> vercl.
3800: 78 5d 20 5c 0d 0a 20 20 20 20 26 26 20 21 5b 65 x] \.. && ![e
3810: 63 68 6f 20 24 28 5f 48 41 53 48 29 65 6c 69 66 cho $(_HASH)elif
3820: 20 64 65 66 69 6e 65 64 28 5f 4d 5f 41 4d 44 36 defined(_M_AMD6
3830: 34 29 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 5c 4) >> vercl.x] \
3840: 0d 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20 .. && ![echo
3850: 41 52 43 48 3d 41 4d 44 36 34 20 3e 3e 20 76 65 ARCH=AMD64 >> ve
3860: 72 63 6c 2e 78 5d 20 5c 0d 0a 20 20 20 20 26 26 rcl.x] \.. &&
3870: 20 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29 ![echo $(_HASH)
3880: 65 6e 64 69 66 20 3e 3e 20 76 65 72 63 6c 2e 78 endif >> vercl.x
3890: 5d 20 5c 0d 0a 20 20 20 20 26 26 20 21 5b 24 28 ] \.. && ![$(
38a0: 63 63 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20 2d 54 cc32) -nologo -T
38b0: 43 20 2d 50 20 76 65 72 63 6c 2e 78 20 32 3e 4e C -P vercl.x 2>N
38c0: 55 4c 5d 0d 0a 21 69 6e 63 6c 75 64 65 20 76 65 UL]..!include ve
38d0: 72 63 6c 2e 69 0d 0a 21 69 66 20 24 28 56 43 56 rcl.i..!if $(VCV
38e0: 45 52 53 49 4f 4e 29 20 3c 20 31 39 30 30 0d 0a ERSION) < 1900..
38f0: 21 69 66 20 21 5b 65 63 68 6f 20 56 43 56 45 52 !if ![echo VCVER
3900: 3d 20 5e 5c 3e 20 76 65 72 63 6c 2e 76 63 5d 20 = ^\> vercl.vc]
3910: 5c 0d 0a 20 20 20 20 26 26 20 21 5b 73 65 74 20 \.. && ![set
3920: 2f 61 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 /a $(VCVERSION)
3930: 2f 20 31 30 30 20 2d 20 36 20 3e 3e 20 76 65 72 / 100 - 6 >> ver
3940: 63 6c 2e 76 63 5d 0d 0a 21 69 6e 63 6c 75 64 65 cl.vc]..!include
3950: 20 76 65 72 63 6c 2e 76 63 0d 0a 21 65 6e 64 69 vercl.vc..!endi
3960: 66 0d 0a 21 65 6c 73 65 0d 0a 23 20 54 68 65 20 f..!else..# The
3970: 73 69 6d 70 6c 65 20 63 61 6c 63 75 6c 61 74 69 simple calculati
3980: 6f 6e 20 61 62 6f 76 65 20 64 6f 65 73 20 6e 6f on above does no
3990: 74 20 61 70 70 6c 79 20 74 6f 20 6e 65 77 20 56 t apply to new V
39a0: 69 73 75 61 6c 20 53 74 75 64 69 6f 20 72 65 6c isual Studio rel
39b0: 65 61 73 65 73 0d 0a 23 20 4b 65 65 70 20 74 68 eases..# Keep th
39c0: 65 20 63 6f 6d 70 69 6c 65 72 20 76 65 72 73 69 e compiler versi
39d0: 6f 6e 20 69 6e 20 69 74 73 20 6e 61 74 69 76 65 on in its native
39e0: 20 66 6f 72 6d 2e 0d 0a 56 43 56 45 52 20 3d 20 form...VCVER =
39f0: 24 28 56 43 56 45 52 53 49 4f 4e 29 0d 0a 21 65 $(VCVERSION)..!e
3a00: 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a ndif..!endif....
3a10: 21 69 66 20 21 5b 64 65 6c 20 32 3e 4e 55 4c 20 !if ![del 2>NUL
3a20: 2f 71 2f 66 20 76 65 72 63 6c 2e 78 20 76 65 72 /q/f vercl.x ver
3a30: 63 6c 2e 69 20 76 65 72 63 6c 2e 76 63 5d 0d 0a cl.i vercl.vc]..
3a40: 21 65 6e 64 69 66 0d 0a 0d 0a 23 2d 2d 2d 2d 2d !endif....#-----
3a50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3a60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3a70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3a80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 23 20 54 -----------..# T
3a90: 68 65 20 4d 41 43 48 49 4e 45 20 6d 61 63 72 6f he MACHINE macro
3aa0: 20 69 73 20 75 73 65 64 20 62 79 20 6c 65 67 61 is used by lega
3ab0: 63 79 20 6d 61 6b 65 66 69 6c 65 73 20 73 6f 20 cy makefiles so
3ac0: 73 65 74 20 69 74 20 61 73 20 77 65 6c 6c 0d 0a set it as well..
3ad0: 21 69 66 64 65 66 20 4d 41 43 48 49 4e 45 0d 0a !ifdef MACHINE..
3ae0: 21 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 !if "$(MACHINE)"
3af0: 20 3d 3d 20 22 78 38 36 22 0d 0a 21 75 6e 64 65 == "x86"..!unde
3b00: 66 20 4d 41 43 48 49 4e 45 0d 0a 4d 41 43 48 49 f MACHINE..MACHI
3b10: 4e 45 20 3d 20 49 58 38 36 0d 0a 21 65 6c 73 65 NE = IX86..!else
3b20: 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 if "$(MACHINE)"
3b30: 3d 3d 20 22 78 36 34 22 0d 0a 21 75 6e 64 65 66 == "x64"..!undef
3b40: 20 4d 41 43 48 49 4e 45 0d 0a 4d 41 43 48 49 4e MACHINE..MACHIN
3b50: 45 20 3d 20 41 4d 44 36 34 0d 0a 21 65 6e 64 69 E = AMD64..!endi
3b60: 66 0d 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e f..!if "$(MACHIN
3b70: 45 29 22 20 21 3d 20 22 24 28 41 52 43 48 29 22 E)" != "$(ARCH)"
3b80: 0d 0a 21 65 72 72 6f 72 20 53 70 65 63 69 66 69 ..!error Specifi
3b90: 65 64 20 4d 41 43 48 49 4e 45 20 6d 61 63 72 6f ed MACHINE macro
3ba0: 20 24 28 4d 41 43 48 49 4e 45 29 20 64 6f 65 73 $(MACHINE) does
3bb0: 20 6e 6f 74 20 6d 61 74 63 68 20 64 65 74 65 63 not match detec
3bc0: 74 65 64 20 74 61 72 67 65 74 20 61 72 63 68 69 ted target archi
3bd0: 74 65 63 74 75 72 65 20 24 28 41 52 43 48 29 2e tecture $(ARCH).
3be0: 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6c 73 65 0d ..!endif..!else.
3bf0: 0a 4d 41 43 48 49 4e 45 3d 24 28 41 52 43 48 29 .MACHINE=$(ARCH)
3c00: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 2d 2d 2d ..!endif....#---
3c10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3c20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3c30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3c40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 23 20 46 69 67 ---------..# Fig
3c50: 75 72 65 20 6f 75 74 20 74 68 65 20 2a 68 6f 73 ure out the *hos
3c60: 74 2a 20 61 72 63 68 69 74 65 63 74 75 72 65 20 t* architecture
3c70: 62 79 20 72 65 61 64 69 6e 67 20 74 68 65 20 72 by reading the r
3c80: 65 67 69 73 74 72 79 0d 0a 0d 0a 21 69 66 20 21 egistry....!if !
3c90: 5b 72 65 67 20 71 75 65 72 79 20 48 4b 4c 4d 5c [reg query HKLM\
3ca0: 48 61 72 64 77 61 72 65 5c 44 65 73 63 72 69 70 Hardware\Descrip
3cb0: 74 69 6f 6e 5c 53 79 73 74 65 6d 5c 43 65 6e 74 tion\System\Cent
3cc0: 72 61 6c 50 72 6f 63 65 73 73 6f 72 5c 30 20 2f ralProcessor\0 /
3cd0: 76 20 49 64 65 6e 74 69 66 69 65 72 20 7c 20 66 v Identifier | f
3ce0: 69 6e 64 73 74 72 20 2f 69 20 78 38 36 5d 0d 0a indstr /i x86]..
3cf0: 4e 41 54 49 56 45 5f 41 52 43 48 3d 49 58 38 36 NATIVE_ARCH=IX86
3d00: 0d 0a 21 65 6c 73 65 0d 0a 4e 41 54 49 56 45 5f ..!else..NATIVE_
3d10: 41 52 43 48 3d 41 4d 44 36 34 0d 0a 21 65 6e 64 ARCH=AMD64..!end
3d20: 69 66 0d 0a 0d 0a 23 20 53 69 6e 63 65 20 4d 53 if....# Since MS
3d30: 56 43 38 20 77 65 20 6d 75 73 74 20 64 65 61 6c VC8 we must deal
3d40: 20 77 69 74 68 20 6d 61 6e 69 66 65 73 74 20 72 with manifest r
3d50: 65 73 6f 75 72 63 65 73 2e 0d 0a 21 69 66 20 24 esources...!if $
3d60: 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 3d 20 31 (VCVERSION) >= 1
3d70: 34 30 30 0d 0a 5f 56 43 5f 4d 41 4e 49 46 45 53 400.._VC_MANIFES
3d80: 54 5f 45 4d 42 45 44 5f 45 58 45 3d 69 66 20 65 T_EMBED_EXE=if e
3d90: 78 69 73 74 20 24 40 2e 6d 61 6e 69 66 65 73 74 xist $@.manifest
3da0: 20 6d 74 20 2d 6e 6f 6c 6f 67 6f 20 2d 6d 61 6e mt -nologo -man
3db0: 69 66 65 73 74 20 24 40 2e 6d 61 6e 69 66 65 73 ifest $@.manifes
3dc0: 74 20 2d 6f 75 74 70 75 74 72 65 73 6f 75 72 63 t -outputresourc
3dd0: 65 3a 24 40 3b 31 0d 0a 5f 56 43 5f 4d 41 4e 49 e:$@;1.._VC_MANI
3de0: 46 45 53 54 5f 45 4d 42 45 44 5f 44 4c 4c 3d 69 FEST_EMBED_DLL=i
3df0: 66 20 65 78 69 73 74 20 24 40 2e 6d 61 6e 69 66 f exist $@.manif
3e00: 65 73 74 20 6d 74 20 2d 6e 6f 6c 6f 67 6f 20 2d est mt -nologo -
3e10: 6d 61 6e 69 66 65 73 74 20 24 40 2e 6d 61 6e 69 manifest $@.mani
3e20: 66 65 73 74 20 2d 6f 75 74 70 75 74 72 65 73 6f fest -outputreso
3e30: 75 72 63 65 3a 24 40 3b 32 0d 0a 21 65 6e 64 69 urce:$@;2..!endi
3e40: 66 0d 0a 0d 0a 21 69 66 6e 64 65 66 20 43 46 47 f....!ifndef CFG
3e50: 5f 45 4e 43 4f 44 49 4e 47 0d 0a 43 46 47 5f 45 _ENCODING..CFG_E
3e60: 4e 43 4f 44 49 4e 47 09 3d 20 5c 22 63 70 31 32 NCODING.= \"cp12
3e70: 35 32 5c 22 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 52\"..!endif....
3e80: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3e90: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3ea0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3eb0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3ec0: 0d 0a 23 20 34 2e 20 42 75 69 6c 64 20 74 68 65 ..# 4. Build the
3ed0: 20 6e 6d 61 6b 65 68 6c 70 20 70 72 6f 67 72 61 nmakehlp progra
3ee0: 6d 0d 0a 23 20 54 68 69 73 20 69 73 20 61 20 68 m..# This is a h
3ef0: 65 6c 70 65 72 20 61 70 70 20 77 65 20 6e 65 65 elper app we nee
3f00: 64 20 74 6f 20 6f 76 65 72 63 6f 6d 65 20 6e 6d d to overcome nm
3f10: 61 6b 65 27 73 20 6c 69 6d 69 74 69 6e 67 0d 0a ake's limiting..
3f20: 23 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e 20 57 # environment. W
3f30: 65 20 77 69 6c 6c 20 63 61 6c 6c 20 6f 75 74 20 e will call out
3f40: 74 6f 20 69 74 20 74 6f 20 67 65 74 20 76 61 72 to it to get var
3f50: 69 6f 75 73 20 62 69 74 73 20 6f 66 0d 0a 23 20 ious bits of..#
3f60: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 information abou
3f70: 74 20 73 75 70 70 6f 72 74 65 64 20 63 6f 6d 70 t supported comp
3f80: 69 6c 65 72 20 6f 70 74 69 6f 6e 73 20 65 74 63 iler options etc
3f90: 2e 0d 0a 23 0d 0a 23 20 54 63 6c 20 69 74 73 65 ...#..# Tcl itse
3fa0: 6c 66 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 75 lf will always u
3fb0: 73 65 20 74 68 65 20 6e 6d 61 6b 65 68 6c 70 2e se the nmakehlp.
3fc0: 63 20 70 72 6f 67 72 61 6d 20 77 68 69 63 68 20 c program which
3fd0: 69 73 0d 0a 23 20 69 6e 20 69 74 73 20 6f 77 6e is..# in its own
3fe0: 20 73 6f 75 72 63 65 2e 20 54 68 69 73 20 69 73 source. This is
3ff0: 20 74 68 65 20 22 6d 61 73 74 65 72 22 20 63 6f the "master" co
4000: 70 79 20 61 6e 64 20 6b 65 70 74 20 75 70 64 61 py and kept upda
4010: 74 65 64 2e 0d 0a 23 0d 0a 23 20 45 78 74 65 6e ted...#..# Exten
4020: 73 69 6f 6e 73 20 62 75 69 6c 74 20 61 67 61 69 sions built agai
4030: 6e 73 74 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64 nst an installed
4040: 20 54 63 6c 20 77 69 6c 6c 20 75 73 65 20 74 68 Tcl will use th
4050: 65 20 69 6e 73 74 61 6c 6c 65 64 0d 0a 23 20 63 e installed..# c
4060: 6f 70 79 20 6f 66 20 54 63 6c 27 73 20 6e 6d 61 opy of Tcl's nma
4070: 6b 65 68 6c 70 2e 63 20 69 66 20 74 68 65 72 65 kehlp.c if there
4080: 20 69 73 20 6f 6e 65 20 61 6e 64 20 74 68 65 69 is one and thei
4090: 72 20 6f 77 6e 20 76 65 72 73 69 6f 6e 0d 0a 23 r own version..#
40a0: 20 6f 74 68 65 72 77 69 73 65 2e 20 49 6e 20 74 otherwise. In t
40b0: 68 65 20 6c 61 74 74 65 72 20 63 61 73 65 2c 20 he latter case,
40c0: 74 68 65 79 20 77 6f 75 6c 64 20 61 6c 73 6f 20 they would also
40d0: 62 65 20 75 73 69 6e 67 20 74 68 65 69 72 20 6f be using their o
40e0: 77 6e 0d 0a 23 20 72 75 6c 65 73 2e 76 63 2e 20 wn..# rules.vc.
40f0: 4e 6f 74 65 20 74 68 61 74 20 6f 6c 64 65 72 20 Note that older
4100: 76 65 72 73 69 6f 6e 73 20 6f 66 20 54 63 6c 20 versions of Tcl
4110: 64 6f 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 20 6e do not install n
4120: 6d 61 6b 65 68 6c 70 2e 63 0d 0a 23 20 6f 72 20 makehlp.c..# or
4130: 72 75 6c 65 73 2e 76 63 2e 0d 0a 23 0d 0a 23 20 rules.vc...#..#
4140: 45 78 74 65 6e 73 69 6f 6e 73 20 62 75 69 6c 74 Extensions built
4150: 20 61 67 61 69 6e 73 74 20 54 63 6c 20 73 6f 75 against Tcl sou
4160: 72 63 65 73 20 77 69 6c 6c 20 75 73 65 20 74 68 rces will use th
4170: 65 20 6f 6e 65 20 66 72 6f 6d 20 74 68 65 20 54 e one from the T
4180: 63 6c 20 73 6f 75 72 63 65 2e 0d 0a 23 0d 0a 23 cl source...#..#
4190: 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 61 When building a
41a0: 6e 20 65 78 74 65 6e 73 69 6f 6e 20 75 73 69 6e n extension usin
41b0: 67 20 61 20 73 75 66 66 69 63 69 65 6e 74 6c 79 g a sufficiently
41c0: 20 6e 65 77 20 76 65 72 73 69 6f 6e 20 6f 66 20 new version of
41d0: 54 63 6c 2c 0d 0a 23 20 72 75 6c 65 73 2d 65 78 Tcl,..# rules-ex
41e0: 74 2e 76 63 20 77 69 6c 6c 20 64 65 66 69 6e 65 t.vc will define
41f0: 20 4e 4d 41 4b 45 48 4c 50 43 20 61 70 70 72 6f NMAKEHLPC appro
4200: 70 72 69 61 74 65 6c 79 20 74 6f 20 70 6f 69 6e priately to poin
4210: 74 20 74 6f 20 74 68 65 0d 0a 23 20 63 6f 70 79 t to the..# copy
4220: 20 6f 66 20 6e 6d 61 6b 65 68 6c 70 2e 63 20 74 of nmakehlp.c t
4230: 6f 20 62 65 20 75 73 65 64 2e 0d 0a 0d 0a 21 69 o be used.....!i
4240: 66 6e 64 65 66 20 4e 4d 41 4b 45 48 4c 50 43 0d fndef NMAKEHLPC.
4250: 0a 23 20 44 65 66 61 75 6c 74 20 74 6f 20 74 68 .# Default to th
4260: 65 20 6f 6e 65 20 69 6e 20 74 68 65 20 63 75 72 e one in the cur
4270: 72 65 6e 74 20 64 69 72 65 63 74 6f 72 79 20 28 rent directory (
4280: 74 68 65 20 65 78 74 65 6e 73 69 6f 6e 27 73 20 the extension's
4290: 6f 77 6e 20 6e 6d 61 6b 65 68 6c 70 2e 63 29 0d own nmakehlp.c).
42a0: 0a 4e 4d 41 4b 45 48 4c 50 43 20 3d 20 6e 6d 61 .NMAKEHLPC = nma
42b0: 6b 65 68 6c 70 2e 63 0d 0a 0d 0a 21 69 66 20 21 kehlp.c....!if !
42c0: 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a 21 69 $(DOING_TCL)..!i
42d0: 66 20 24 28 54 43 4c 49 4e 53 54 41 4c 4c 29 0d f $(TCLINSTALL).
42e0: 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f 54 .!if exist("$(_T
42f0: 43 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d 61 6b 65 CLDIR)\lib\nmake
4300: 5c 6e 6d 61 6b 65 68 6c 70 2e 63 22 29 0d 0a 4e \nmakehlp.c")..N
4310: 4d 41 4b 45 48 4c 50 43 20 3d 20 24 28 5f 54 43 MAKEHLPC = $(_TC
4320: 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c LDIR)\lib\nmake\
4330: 6e 6d 61 6b 65 68 6c 70 2e 63 0d 0a 21 65 6e 64 nmakehlp.c..!end
4340: 69 66 0d 0a 21 65 6c 73 65 20 23 20 21 20 24 28 if..!else # ! $(
4350: 54 43 4c 49 4e 53 54 41 4c 4c 29 0d 0a 21 69 66 TCLINSTALL)..!if
4360: 20 65 78 69 73 74 28 22 24 28 5f 54 43 4c 44 49 exist("$(_TCLDI
4370: 52 29 5c 77 69 6e 5c 6e 6d 61 6b 65 68 6c 70 2e R)\win\nmakehlp.
4380: 63 22 29 0d 0a 4e 4d 41 4b 45 48 4c 50 43 20 3d c")..NMAKEHLPC =
4390: 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c $(_TCLDIR)\win\
43a0: 6e 6d 61 6b 65 68 6c 70 2e 63 0d 0a 21 65 6e 64 nmakehlp.c..!end
43b0: 69 66 0d 0a 21 65 6e 64 69 66 20 23 20 24 28 54 if..!endif # $(T
43c0: 43 4c 49 4e 53 54 41 4c 4c 29 0d 0a 21 65 6e 64 CLINSTALL)..!end
43d0: 69 66 20 23 20 21 24 28 44 4f 49 4e 47 5f 54 43 if # !$(DOING_TC
43e0: 4c 29 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 20 4e L)....!endif # N
43f0: 4d 41 4b 45 48 4c 50 43 0d 0a 0d 0a 23 20 57 65 MAKEHLPC....# We
4400: 20 61 6c 77 61 79 73 20 62 75 69 6c 64 20 6e 6d always build nm
4410: 61 6b 65 68 6c 70 20 65 76 65 6e 20 69 66 20 69 akehlp even if i
4420: 74 20 65 78 69 73 74 73 20 73 69 6e 63 65 20 77 t exists since w
4430: 65 20 64 6f 20 6e 6f 74 20 6b 6e 6f 77 0d 0a 23 e do not know..#
4440: 20 77 68 61 74 20 73 6f 75 72 63 65 20 69 74 20 what source it
4450: 77 61 73 20 62 75 69 6c 74 20 66 72 6f 6d 2e 0d was built from..
4460: 0a 21 69 66 20 5b 24 28 63 63 33 32 29 20 2d 6e .!if [$(cc32) -n
4470: 6f 6c 6f 67 6f 20 22 24 28 4e 4d 41 4b 45 48 4c ologo "$(NMAKEHL
4480: 50 43 29 22 20 2d 6c 69 6e 6b 20 2d 73 75 62 73 PC)" -link -subs
4490: 79 73 74 65 6d 3a 63 6f 6e 73 6f 6c 65 20 3e 20 ystem:console >
44a0: 6e 75 6c 5d 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a nul]..!endif....
44b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
44c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
44d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
44e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
44f0: 0d 0a 23 20 35 2e 20 54 65 73 74 20 66 6f 72 20 ..# 5. Test for
4500: 63 6f 6d 70 69 6c 65 72 20 66 65 61 74 75 72 65 compiler feature
4510: 73 0d 0a 23 20 56 69 73 75 61 6c 20 43 2b 2b 20 s..# Visual C++
4520: 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e 73 compiler options
4530: 20 68 61 76 65 20 63 68 61 6e 67 65 64 20 6f 76 have changed ov
4540: 65 72 20 74 68 65 20 79 65 61 72 73 2e 20 43 68 er the years. Ch
4550: 65 63 6b 0d 0a 23 20 77 68 69 63 68 20 6f 70 74 eck..# which opt
4560: 69 6f 6e 73 20 61 72 65 20 73 75 70 70 6f 72 74 ions are support
4570: 65 64 20 62 79 20 74 68 65 20 63 6f 6d 70 69 6c ed by the compil
4580: 65 72 20 69 6e 20 75 73 65 2e 0d 0a 23 0d 0a 23 er in use...#..#
4590: 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d The following m
45a0: 61 63 72 6f 73 20 61 72 65 20 73 65 74 3a 0d 0a acros are set:..
45b0: 23 20 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 20 # OPTIMIZATIONS
45c0: 2d 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 66 - the compiler f
45d0: 6c 61 67 73 20 74 6f 20 62 65 20 75 73 65 64 20 lags to be used
45e0: 66 6f 72 20 6f 70 74 69 6d 69 7a 65 64 20 62 75 for optimized bu
45f0: 69 6c 64 73 0d 0a 23 20 44 45 42 55 47 46 4c 41 ilds..# DEBUGFLA
4600: 47 53 20 2d 20 74 68 65 20 63 6f 6d 70 69 6c 65 GS - the compile
4610: 72 20 66 6c 61 67 73 20 74 6f 20 62 65 20 75 73 r flags to be us
4620: 65 64 20 66 6f 72 20 64 65 62 75 67 20 62 75 69 ed for debug bui
4630: 6c 64 73 0d 0a 23 20 4c 49 4e 4b 45 52 46 4c 41 lds..# LINKERFLA
4640: 47 53 20 2d 20 46 6c 61 67 73 20 70 61 73 73 65 GS - Flags passe
4650: 64 20 74 6f 20 74 68 65 20 6c 69 6e 6b 65 72 20 d to the linker
4660: 0d 0a 23 0d 0a 23 20 4e 6f 74 65 20 74 68 61 74 ..#..# Note that
4670: 20 74 68 65 73 65 20 61 72 65 20 74 68 65 20 63 these are the c
4680: 6f 6d 70 69 6c 65 72 20 73 65 74 74 69 6e 67 73 ompiler settings
4690: 20 2a 61 76 61 69 6c 61 62 6c 65 2a 2c 20 6e 6f *available*, no
46a0: 74 20 74 68 6f 73 65 0d 0a 23 20 74 68 61 74 20 t those..# that
46b0: 77 69 6c 6c 20 62 65 20 2a 75 73 65 64 2a 2e 20 will be *used*.
46c0: 54 68 65 20 6c 61 74 74 65 72 20 64 65 70 65 6e The latter depen
46d0: 64 73 20 6f 6e 20 74 68 65 20 4f 50 54 53 20 6d ds on the OPTS m
46e0: 61 63 72 6f 20 73 65 74 74 69 6e 67 73 0d 0a 23 acro settings..#
46f0: 20 77 68 69 63 68 20 77 65 20 68 61 76 65 20 6e which we have n
4700: 6f 74 20 79 65 74 20 70 61 72 73 65 64 2e 0d 0a ot yet parsed...
4710: 23 0d 0a 23 20 41 6c 73 6f 20 6e 6f 74 65 20 74 #..# Also note t
4720: 68 61 74 20 73 6f 6d 65 20 6f 66 20 74 68 65 20 hat some of the
4730: 66 6c 61 67 73 20 69 6e 20 4f 50 54 49 4d 49 5a flags in OPTIMIZ
4740: 41 54 49 4f 4e 53 20 61 72 65 20 6e 6f 74 20 72 ATIONS are not r
4750: 65 61 6c 6c 79 0d 0a 23 20 72 65 6c 61 74 65 64 eally..# related
4760: 20 74 6f 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e to optimization
4770: 2e 20 54 68 65 79 20 61 72 65 20 70 6c 61 63 65 . They are place
4780: 64 20 74 68 65 72 65 20 6f 6e 6c 79 20 66 6f 72 d there only for
4790: 20 6c 65 67 61 63 79 20 72 65 61 73 6f 6e 73 0d legacy reasons.
47a0: 0a 23 20 61 73 20 73 6f 6d 65 20 65 78 74 65 6e .# as some exten
47b0: 73 69 6f 6e 73 20 65 78 70 65 63 74 20 74 68 65 sions expect the
47c0: 6d 20 74 6f 20 62 65 20 69 6e 63 6c 75 64 65 64 m to be included
47d0: 20 69 6e 20 74 68 61 74 20 6d 61 63 72 6f 2e 0d in that macro..
47e0: 0a 0d 0a 23 20 2d 4f 70 20 69 6d 70 72 6f 76 65 ...# -Op improve
47f0: 73 20 66 6c 6f 61 74 20 63 6f 6e 73 69 73 74 65 s float consiste
4800: 6e 63 79 2e 20 4e 6f 74 65 20 6f 6e 6c 79 20 6e ncy. Note only n
4810: 65 65 64 65 64 20 66 6f 72 20 6f 6c 64 65 72 20 eeded for older
4820: 63 6f 6d 70 69 6c 65 72 73 0d 0a 23 20 4e 65 77 compilers..# New
4830: 65 72 20 63 6f 6d 70 69 6c 65 72 73 20 64 6f 20 er compilers do
4840: 6e 6f 74 20 6e 65 65 64 20 6f 72 20 73 75 70 70 not need or supp
4850: 6f 72 74 20 74 68 69 73 20 6f 70 74 69 6f 6e 2e ort this option.
4860: 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 ..!if [nmakehlp
4870: 2d 63 20 2d 4f 70 5d 0d 0a 46 50 4f 50 54 53 20 -c -Op]..FPOPTS
4880: 20 3d 20 2d 4f 70 0d 0a 21 65 6e 64 69 66 0d 0a = -Op..!endif..
4890: 0d 0a 23 20 53 74 72 69 63 74 20 66 6c 6f 61 74 ..# Strict float
48a0: 69 6e 67 20 70 6f 69 6e 74 20 73 65 6d 61 6e 74 ing point semant
48b0: 69 63 73 20 2d 20 70 72 65 73 65 6e 74 20 69 6e ics - present in
48c0: 20 6e 65 77 65 72 20 63 6f 6d 70 69 6c 65 72 73 newer compilers
48d0: 20 69 6e 20 6c 69 65 75 20 6f 66 20 2d 4f 70 0d in lieu of -Op.
48e0: 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d .!if [nmakehlp -
48f0: 63 20 2d 66 70 3a 73 74 72 69 63 74 5d 0d 0a 46 c -fp:strict]..F
4900: 50 4f 50 54 53 20 20 3d 20 24 28 46 50 4f 50 54 POPTS = $(FPOPT
4910: 53 29 20 2d 66 70 3a 73 74 72 69 63 74 0d 0a 21 S) -fp:strict..!
4920: 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 22 24 28 endif....!if "$(
4930: 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 49 58 MACHINE)" == "IX
4940: 38 36 22 0d 0a 23 23 23 20 74 65 73 74 20 66 6f 86"..### test fo
4950: 72 20 70 65 6e 74 69 75 6d 20 65 72 72 61 74 61 r pentium errata
4960: 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 ..!if [nmakehlp
4970: 2d 63 20 2d 51 49 30 66 5d 0d 0a 21 6d 65 73 73 -c -QI0f]..!mess
4980: 61 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 age *** Compiler
4990: 20 68 61 73 20 27 50 65 6e 74 69 75 6d 20 30 78 has 'Pentium 0x
49a0: 30 66 20 66 69 78 27 0d 0a 46 50 4f 50 54 53 20 0f fix'..FPOPTS
49b0: 20 3d 20 24 28 46 50 4f 50 54 53 29 20 2d 51 49 = $(FPOPTS) -QI
49c0: 30 66 0d 0a 21 65 6c 73 65 0d 0a 21 6d 65 73 73 0f..!else..!mess
49d0: 61 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 age *** Compiler
49e0: 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 27 does not have '
49f0: 50 65 6e 74 69 75 6d 20 30 78 30 66 20 66 69 78 Pentium 0x0f fix
4a00: 27 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 '..!endif..!endi
4a10: 66 0d 0a 0d 0a 23 23 23 20 74 65 73 74 20 66 6f f....### test fo
4a20: 72 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 73 0d r optimizations.
4a30: 0a 23 20 2f 4f 32 20 6f 70 74 69 6d 69 7a 61 74 .# /O2 optimizat
4a40: 69 6f 6e 20 69 6e 63 6c 75 64 65 73 20 2f 4f 67 ion includes /Og
4a50: 20 2f 4f 69 20 2f 4f 74 20 2f 4f 79 20 2f 4f 62 /Oi /Ot /Oy /Ob
4a60: 32 20 2f 47 73 20 2f 47 46 20 2f 47 79 20 61 73 2 /Gs /GF /Gy as
4a70: 20 70 65 72 0d 0a 23 20 64 6f 63 75 6d 65 6e 74 per..# document
4a80: 61 74 69 6f 6e 2e 20 4e 6f 74 65 20 77 65 20 64 ation. Note we d
4a90: 6f 20 4e 4f 54 20 77 61 6e 74 20 2f 47 73 20 61 o NOT want /Gs a
4aa0: 73 20 74 68 61 74 20 69 6e 73 65 72 74 73 20 61 s that inserts a
4ab0: 20 5f 63 68 6b 73 74 6b 0d 0a 23 20 73 74 61 63 _chkstk..# stac
4ac0: 6b 20 70 72 6f 62 65 20 61 74 20 2a 65 76 65 72 k probe at *ever
4ad0: 79 2a 20 66 75 6e 63 74 69 6f 6e 20 65 6e 74 72 y* function entr
4ae0: 79 2c 20 6e 6f 74 20 6a 75 73 74 20 74 68 6f 73 y, not just thos
4af0: 65 20 77 69 74 68 20 6d 6f 72 65 20 74 68 61 6e e with more than
4b00: 0d 0a 23 20 61 20 70 61 67 65 20 6f 66 20 73 74 ..# a page of st
4b10: 61 63 6b 20 61 6c 6c 6f 63 61 74 69 6f 6e 20 72 ack allocation r
4b20: 65 73 75 6c 74 69 6e 67 20 69 6e 20 61 20 70 65 esulting in a pe
4b30: 72 66 6f 72 6d 61 6e 63 65 20 68 69 74 2e 20 20 rformance hit.
4b40: 48 6f 77 65 76 65 72 2c 0d 0a 23 20 2f 4f 32 20 However,..# /O2
4b50: 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 69 73 documentation is
4b60: 20 6d 69 73 6c 65 61 64 69 6e 67 20 61 73 20 69 misleading as i
4b70: 74 73 20 73 74 61 63 6b 20 70 72 6f 62 65 73 20 ts stack probes
4b80: 61 72 65 20 73 69 6d 70 6c 79 20 74 68 65 0d 0a are simply the..
4b90: 23 20 64 65 66 61 75 6c 74 20 70 61 67 65 20 73 # default page s
4ba0: 69 7a 65 20 6c 6f 63 61 6c 73 20 61 6c 6c 6f 63 ize locals alloc
4bb0: 61 74 69 6f 6e 20 70 72 6f 62 65 73 20 61 6e 64 ation probes and
4bc0: 20 6e 6f 74 20 77 68 61 74 20 69 73 20 69 6d 70 not what is imp
4bd0: 6c 69 65 64 0d 0a 23 20 62 79 20 61 6e 20 65 78 lied..# by an ex
4be0: 70 6c 69 63 69 74 20 2f 47 73 20 6f 70 74 69 6f plicit /Gs optio
4bf0: 6e 2e 0d 0a 0d 0a 4f 50 54 49 4d 49 5a 41 54 49 n.....OPTIMIZATI
4c00: 4f 4e 53 20 3d 20 24 28 46 50 4f 50 54 53 29 0d ONS = $(FPOPTS).
4c10: 0a 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 ...!if [nmakehlp
4c20: 20 2d 63 20 2d 4f 32 5d 0d 0a 4f 50 54 49 4d 49 -c -O2]..OPTIMI
4c30: 5a 49 4e 47 20 3d 20 31 0d 0a 4f 50 54 49 4d 49 ZING = 1..OPTIMI
4c40: 5a 41 54 49 4f 4e 53 20 20 20 3d 20 24 28 4f 50 ZATIONS = $(OP
4c50: 54 49 4d 49 5a 41 54 49 4f 4e 53 29 20 2d 4f 32 TIMIZATIONS) -O2
4c60: 0d 0a 21 65 6c 73 65 0d 0a 23 20 4c 65 67 61 63 ..!else..# Legac
4c70: 79 2c 20 72 65 61 6c 6c 79 2e 20 41 6c 6c 20 6d y, really. All m
4c80: 6f 64 65 72 6e 20 63 6f 6d 70 69 6c 65 72 73 20 odern compilers
4c90: 73 75 70 70 6f 72 74 20 74 68 69 73 0d 0a 21 6d support this..!m
4ca0: 65 73 73 61 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 essage *** Compi
4cb0: 6c 65 72 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 ler does not hav
4cc0: 65 20 27 4f 70 74 69 6d 69 7a 61 74 69 6f 6e 73 e 'Optimizations
4cd0: 27 0d 0a 4f 50 54 49 4d 49 5a 49 4e 47 20 3d 20 '..OPTIMIZING =
4ce0: 30 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 43 0..!endif....# C
4cf0: 68 65 63 6b 73 20 66 6f 72 20 62 75 66 66 65 72 hecks for buffer
4d00: 20 6f 76 65 72 66 6c 6f 77 73 20 69 6e 20 6c 6f overflows in lo
4d10: 63 61 6c 20 61 72 72 61 79 73 0d 0a 21 69 66 20 cal arrays..!if
4d20: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63 20 2d 47 53 [nmakehlp -c -GS
4d30: 5d 0d 0a 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 ]..OPTIMIZATIONS
4d40: 20 20 3d 20 24 28 4f 50 54 49 4d 49 5a 41 54 49 = $(OPTIMIZATI
4d50: 4f 4e 53 29 20 2d 47 53 0d 0a 21 65 6e 64 69 66 ONS) -GS..!endif
4d60: 0d 0a 0d 0a 23 20 4c 69 6e 6b 20 74 69 6d 65 20 ....# Link time
4d70: 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 2e 20 4e 6f optimization. No
4d80: 74 65 20 74 68 61 74 20 74 68 69 73 20 6f 70 74 te that this opt
4d90: 69 6f 6e 20 28 70 6f 74 65 6e 74 69 61 6c 6c 79 ion (potentially
4da0: 29 20 6d 61 6b 65 73 0d 0a 23 20 67 65 6e 65 72 ) makes..# gener
4db0: 61 74 65 64 20 6c 69 62 72 61 72 69 65 73 20 6f ated libraries o
4dc0: 6e 6c 79 20 75 73 61 62 6c 65 20 62 79 20 74 68 nly usable by th
4dd0: 65 20 73 70 65 63 69 66 69 63 20 56 43 2b 2b 20 e specific VC++
4de0: 76 65 72 73 69 6f 6e 20 74 68 61 74 0d 0a 23 20 version that..#
4df0: 63 72 65 61 74 65 64 20 69 74 2e 20 52 65 71 75 created it. Requ
4e00: 69 72 65 73 20 2f 4c 54 43 47 20 6c 69 6e 6b 65 ires /LTCG linke
4e10: 72 20 6f 70 74 69 6f 6e 0d 0a 21 69 66 20 5b 6e r option..!if [n
4e20: 6d 61 6b 65 68 6c 70 20 2d 63 20 2d 47 4c 5d 0d makehlp -c -GL].
4e30: 0a 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 20 20 .OPTIMIZATIONS
4e40: 3d 20 24 28 4f 50 54 49 4d 49 5a 41 54 49 4f 4e = $(OPTIMIZATION
4e50: 53 29 20 2d 47 4c 0d 0a 43 43 5f 47 4c 5f 4f 50 S) -GL..CC_GL_OP
4e60: 54 5f 45 4e 41 42 4c 45 44 20 3d 20 31 0d 0a 21 T_ENABLED = 1..!
4e70: 65 6c 73 65 0d 0a 23 20 49 6e 20 6e 65 77 65 72 else..# In newer
4e80: 20 63 6f 6d 70 69 6c 65 72 73 20 2d 47 4c 20 61 compilers -GL a
4e90: 6e 64 20 2d 59 58 20 61 72 65 20 69 6e 63 6f 6d nd -YX are incom
4ea0: 70 61 74 69 62 6c 65 2e 0d 0a 21 69 66 20 5b 6e patible...!if [n
4eb0: 6d 61 6b 65 68 6c 70 20 2d 63 20 2d 59 58 5d 0d makehlp -c -YX].
4ec0: 0a 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 20 20 .OPTIMIZATIONS
4ed0: 3d 20 24 28 4f 50 54 49 4d 49 5a 41 54 49 4f 4e = $(OPTIMIZATION
4ee0: 53 29 20 2d 59 58 0d 0a 21 65 6e 64 69 66 0d 0a S) -YX..!endif..
4ef0: 21 65 6e 64 69 66 20 23 20 5b 6e 6d 61 6b 65 68 !endif # [nmakeh
4f00: 6c 70 20 2d 63 20 2d 47 4c 5d 0d 0a 0d 0a 44 45 lp -c -GL]....DE
4f10: 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d 20 24 BUGFLAGS = $
4f20: 28 46 50 4f 50 54 53 29 0d 0a 0d 0a 23 20 52 75 (FPOPTS)....# Ru
4f30: 6e 20 74 69 6d 65 20 65 72 72 6f 72 20 63 68 65 n time error che
4f40: 63 6b 73 2e 20 4e 6f 74 20 61 76 61 69 6c 61 62 cks. Not availab
4f50: 6c 65 20 6f 72 20 76 61 6c 69 64 20 69 6e 20 61 le or valid in a
4f60: 20 72 65 6c 65 61 73 65 2c 20 6e 6f 6e 2d 64 65 release, non-de
4f70: 62 75 67 20 62 75 69 6c 64 0d 0a 23 20 52 54 43 bug build..# RTC
4f80: 20 69 73 20 66 6f 72 20 6d 6f 64 65 72 6e 20 63 is for modern c
4f90: 6f 6d 70 69 6c 65 72 73 2c 20 2d 47 5a 20 69 73 ompilers, -GZ is
4fa0: 20 6c 65 67 61 63 79 0d 0a 21 69 66 20 5b 6e 6d legacy..!if [nm
4fb0: 61 6b 65 68 6c 70 20 2d 63 20 2d 52 54 43 31 5d akehlp -c -RTC1]
4fc0: 0d 0a 44 45 42 55 47 46 4c 41 47 53 20 20 20 20 ..DEBUGFLAGS
4fd0: 20 3d 20 24 28 44 45 42 55 47 46 4c 41 47 53 29 = $(DEBUGFLAGS)
4fe0: 20 2d 52 54 43 31 0d 0a 21 65 6c 73 65 69 66 20 -RTC1..!elseif
4ff0: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63 20 2d 47 5a [nmakehlp -c -GZ
5000: 5d 0d 0a 44 45 42 55 47 46 4c 41 47 53 20 20 20 ]..DEBUGFLAGS
5010: 20 20 3d 20 24 28 44 45 42 55 47 46 4c 41 47 53 = $(DEBUGFLAGS
5020: 29 20 2d 47 5a 0d 0a 21 65 6e 64 69 66 0d 0a 0d ) -GZ..!endif...
5030: 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d .#--------------
5040: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5050: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5060: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5070: 2d 2d 0d 0a 23 20 4c 69 6e 6b 65 72 20 66 6c 61 --..# Linker fla
5080: 67 73 0d 0a 0d 0a 23 20 4c 49 4e 4b 45 52 5f 54 gs....# LINKER_T
5090: 45 53 54 46 4c 41 47 53 20 61 72 65 20 66 6f 72 ESTFLAGS are for
50a0: 20 69 6e 74 65 72 6e 61 6c 20 75 73 65 20 77 68 internal use wh
50b0: 65 6e 20 77 65 20 63 61 6c 6c 20 6e 6d 61 6b 65 en we call nmake
50c0: 68 6c 70 20 74 6f 20 74 65 73 74 0d 0a 23 20 69 hlp to test..# i
50d0: 66 20 74 68 65 20 6c 69 6e 6b 65 72 20 73 75 70 f the linker sup
50e0: 70 6f 72 74 73 20 61 20 73 70 65 63 69 66 69 63 ports a specific
50f0: 20 6f 70 74 69 6f 6e 2e 20 57 69 74 68 6f 75 74 option. Without
5100: 20 74 68 65 73 65 20 66 6c 61 67 73 20 6c 69 6e these flags lin
5110: 6b 20 77 69 6c 6c 0d 0a 23 20 72 65 74 75 72 6e k will..# return
5120: 20 22 4c 4e 4b 31 35 36 31 3a 20 65 6e 74 72 79 "LNK1561: entry
5130: 20 70 6f 69 6e 74 20 6d 75 73 74 20 62 65 20 64 point must be d
5140: 65 66 69 6e 65 64 22 20 65 72 72 6f 72 20 63 6f efined" error co
5150: 6d 70 69 6c 69 6e 67 20 66 72 6f 6d 20 56 53 2d mpiling from VS-
5160: 49 44 45 3a 0d 0a 23 20 54 68 65 79 20 61 72 65 IDE:..# They are
5170: 20 6e 6f 74 20 70 61 73 73 65 64 20 74 68 72 6f not passed thro
5180: 75 67 68 20 74 6f 20 74 68 65 20 61 63 74 75 61 ugh to the actua
5190: 6c 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 2f 20 l application /
51a0: 65 78 74 65 6e 73 69 6f 6e 0d 0a 23 20 6c 69 6e extension..# lin
51b0: 6b 20 72 75 6c 65 73 2e 0d 0a 21 69 66 6e 64 65 k rules...!ifnde
51c0: 66 20 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41 f LINKER_TESTFLA
51d0: 47 53 0d 0a 4c 49 4e 4b 45 52 5f 54 45 53 54 46 GS..LINKER_TESTF
51e0: 4c 41 47 53 20 3d 20 2f 44 4c 4c 20 2f 4e 4f 45 LAGS = /DLL /NOE
51f0: 4e 54 52 59 20 2f 4f 55 54 3a 6e 6d 61 6b 65 68 NTRY /OUT:nmakeh
5200: 6c 70 2e 6f 75 74 0d 0a 21 65 6e 64 69 66 0d 0a lp.out..!endif..
5210: 0d 0a 4c 49 4e 4b 45 52 46 4c 41 47 53 20 20 20 ..LINKERFLAGS
5220: 20 20 3d 0d 0a 0d 0a 23 20 49 66 20 63 6f 6d 70 =....# If comp
5230: 69 6c 65 72 20 68 61 73 20 65 6e 61 62 6c 65 64 iler has enabled
5240: 20 6c 69 6e 6b 20 74 69 6d 65 20 6f 70 74 69 6d link time optim
5250: 69 7a 61 74 69 6f 6e 2c 20 6c 69 6e 6b 65 72 20 ization, linker
5260: 6d 75 73 74 20 74 6f 6f 20 77 69 74 68 20 2d 6c must too with -l
5270: 74 63 67 0d 0a 21 69 66 64 65 66 20 43 43 5f 47 tcg..!ifdef CC_G
5280: 4c 5f 4f 50 54 5f 45 4e 41 42 4c 45 44 0d 0a 21 L_OPT_ENABLED..!
5290: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 6c 20 if [nmakehlp -l
52a0: 2d 6c 74 63 67 20 24 28 4c 49 4e 4b 45 52 5f 54 -ltcg $(LINKER_T
52b0: 45 53 54 46 4c 41 47 53 29 5d 0d 0a 4c 49 4e 4b ESTFLAGS)]..LINK
52c0: 45 52 46 4c 41 47 53 20 20 20 20 20 3d 20 24 28 ERFLAGS = $(
52d0: 4c 49 4e 4b 45 52 46 4c 41 47 53 29 20 2d 6c 74 LINKERFLAGS) -lt
52e0: 63 67 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 cg..!endif..!end
52f0: 69 66 0d 0a 0d 0a 23 23 23 23 23 23 23 23 23 23 if....##########
5300: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
5310: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
5320: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
5330: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0d 0a ##############..
5340: 23 20 36 2e 20 50 61 72 73 65 20 74 68 65 20 4f # 6. Parse the O
5350: 50 54 53 20 6d 61 63 72 6f 20 74 6f 20 77 6f 72 PTS macro to wor
5360: 6b 20 6f 75 74 20 74 68 65 20 72 65 71 75 65 73 k out the reques
5370: 74 65 64 20 62 75 69 6c 64 20 63 6f 6e 66 69 67 ted build config
5380: 75 72 61 74 69 6f 6e 2e 0d 0a 23 20 42 61 73 65 uration...# Base
5390: 64 20 6f 6e 20 74 68 69 73 2c 20 77 65 20 77 69 d on this, we wi
53a0: 6c 6c 20 63 6f 6e 73 74 72 75 63 74 20 74 68 65 ll construct the
53b0: 20 61 63 74 75 61 6c 20 73 77 69 74 63 68 65 73 actual switches
53c0: 20 74 6f 20 62 65 20 70 61 73 73 65 64 20 74 6f to be passed to
53d0: 20 74 68 65 0d 0a 23 20 63 6f 6d 70 69 6c 65 72 the..# compiler
53e0: 20 61 6e 64 20 6c 69 6e 6b 65 72 20 75 73 69 6e and linker usin
53f0: 67 20 74 68 65 20 6d 61 63 72 6f 73 20 64 65 66 g the macros def
5400: 69 6e 65 64 20 69 6e 20 74 68 65 20 70 72 65 76 ined in the prev
5410: 69 6f 75 73 20 73 65 63 74 69 6f 6e 2e 0d 0a 23 ious section...#
5420: 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d The following m
5430: 61 63 72 6f 73 20 61 72 65 20 64 65 66 69 6e 65 acros are define
5440: 64 20 62 79 20 74 68 69 73 20 73 65 63 74 69 6f d by this sectio
5450: 6e 20 62 61 73 65 64 20 6f 6e 20 4f 50 54 53 0d n based on OPTS.
5460: 0a 23 20 53 54 41 54 49 43 5f 42 55 49 4c 44 20 .# STATIC_BUILD
5470: 2d 20 30 20 2d 3e 20 54 63 6c 20 69 73 20 74 6f - 0 -> Tcl is to
5480: 20 62 65 20 62 75 69 6c 74 20 61 73 20 61 20 73 be built as a s
5490: 68 61 72 65 64 20 6c 69 62 72 61 72 79 0d 0a 23 hared library..#
54a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
54b0: 31 20 2d 3e 20 62 75 69 6c 64 20 61 73 20 61 20 1 -> build as a
54c0: 73 74 61 74 69 63 20 6c 69 62 72 61 72 79 20 61 static library a
54d0: 6e 64 20 73 68 65 6c 6c 0d 0a 23 20 54 43 4c 5f nd shell..# TCL_
54e0: 54 48 52 45 41 44 53 20 2d 20 6c 65 67 61 63 79 THREADS - legacy
54f0: 20 62 75 74 20 61 6c 77 61 79 73 20 31 20 6f 6e but always 1 on
5500: 20 57 69 6e 64 6f 77 73 20 73 69 6e 63 65 20 77 Windows since w
5510: 69 6e 73 6f 63 6b 20 72 65 71 75 69 72 65 73 20 insock requires
5520: 69 74 2e 0d 0a 23 20 44 45 42 55 47 20 2d 20 31 it...# DEBUG - 1
5530: 20 2d 3e 20 64 65 62 75 67 20 62 75 69 6c 64 2c -> debug build,
5540: 20 30 20 2d 3e 20 72 65 6c 65 61 73 65 20 62 75 0 -> release bu
5550: 69 6c 64 73 0d 0a 23 20 53 59 4d 42 4f 4c 53 20 ilds..# SYMBOLS
5560: 2d 20 31 20 2d 3e 20 67 65 6e 65 72 61 74 65 20 - 1 -> generate
5570: 50 44 42 27 73 2c 20 30 20 2d 3e 20 6e 6f 20 50 PDB's, 0 -> no P
5580: 44 42 27 73 0d 0a 23 20 50 52 4f 46 49 4c 45 20 DB's..# PROFILE
5590: 2d 20 31 20 2d 3e 20 67 65 6e 65 72 61 74 65 20 - 1 -> generate
55a0: 70 72 6f 66 69 6c 69 6e 67 20 69 6e 66 6f 2c 20 profiling info,
55b0: 30 20 2d 3e 20 6e 6f 20 70 72 6f 66 69 6c 69 6e 0 -> no profilin
55c0: 67 0d 0a 23 20 50 47 4f 20 20 20 20 20 2d 20 31 g..# PGO - 1
55d0: 20 2d 3e 20 70 72 6f 66 69 6c 65 20 62 61 73 65 -> profile base
55e0: 64 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 2c 20 d optimization,
55f0: 30 20 2d 3e 20 6e 6f 0d 0a 23 20 4d 53 56 43 52 0 -> no..# MSVCR
5600: 54 20 20 2d 20 31 20 2d 3e 20 6c 69 6e 6b 20 74 T - 1 -> link t
5610: 6f 20 64 79 6e 61 6d 69 63 20 43 20 72 75 6e 74 o dynamic C runt
5620: 69 6d 65 20 65 76 65 6e 20 77 68 65 6e 20 62 75 ime even when bu
5630: 69 6c 64 69 6e 67 20 73 74 61 74 69 63 20 54 63 ilding static Tc
5640: 6c 20 62 75 69 6c 64 0d 0a 23 20 20 20 20 20 20 l build..#
5650: 20 20 20 20 20 30 20 2d 3e 20 6c 69 6e 6b 20 74 0 -> link t
5660: 6f 20 73 74 61 74 69 63 20 43 20 72 75 6e 74 69 o static C runti
5670: 6d 65 20 66 6f 72 20 73 74 61 74 69 63 20 54 63 me for static Tc
5680: 6c 20 62 75 69 6c 64 2e 0d 0a 23 20 20 20 20 20 l build...#
5690: 20 20 20 20 20 20 44 6f 65 73 20 6e 6f 74 20 69 Does not i
56a0: 6d 70 61 63 74 20 73 68 61 72 65 64 20 54 63 6c mpact shared Tcl
56b0: 20 62 75 69 6c 64 73 20 28 53 54 41 54 49 43 5f builds (STATIC_
56c0: 42 55 49 4c 44 20 3d 3d 20 30 29 0d 0a 23 20 54 BUILD == 0)..# T
56d0: 43 4c 5f 55 53 45 5f 53 54 41 54 49 43 5f 50 41 CL_USE_STATIC_PA
56e0: 43 4b 41 47 45 53 20 2d 20 31 20 2d 3e 20 73 74 CKAGES - 1 -> st
56f0: 61 74 69 63 61 6c 6c 79 20 6c 69 6e 6b 20 74 68 atically link th
5700: 65 20 72 65 67 69 73 74 72 79 20 61 6e 64 20 64 e registry and d
5710: 64 65 20 65 78 74 65 6e 73 69 6f 6e 73 0d 0a 23 de extensions..#
5720: 20 20 20 20 20 20 20 20 20 20 20 69 6e 20 74 68 in th
5730: 65 20 54 63 6c 20 73 68 65 6c 6c 2e 20 30 20 2d e Tcl shell. 0 -
5740: 3e 20 6b 65 65 70 20 74 68 65 6d 20 61 73 20 73 > keep them as s
5750: 68 61 72 65 64 20 6c 69 62 72 61 72 69 65 73 0d hared libraries.
5760: 0a 23 20 20 20 20 20 20 20 20 20 20 20 44 6f 65 .# Doe
5770: 73 20 6e 6f 74 20 69 6d 70 61 63 74 20 73 68 61 s not impact sha
5780: 72 65 64 20 54 63 6c 20 62 75 69 6c 64 73 2e 0d red Tcl builds..
5790: 0a 23 20 55 53 45 5f 54 48 52 45 41 44 5f 41 4c .# USE_THREAD_AL
57a0: 4c 4f 43 20 2d 20 31 20 2d 3e 20 55 73 65 20 61 LOC - 1 -> Use a
57b0: 20 73 68 61 72 65 64 20 67 6c 6f 62 61 6c 20 66 shared global f
57c0: 72 65 65 20 70 6f 6f 6c 20 66 6f 72 20 61 6c 6c ree pool for all
57d0: 6f 63 61 74 69 6f 6e 2e 0d 0a 23 20 20 20 20 20 ocation...#
57e0: 20 20 20 20 20 20 30 20 2d 3e 20 55 73 65 20 74 0 -> Use t
57f0: 68 65 20 6e 6f 6e 2d 74 68 72 65 61 64 20 61 6c he non-thread al
5800: 6c 6f 63 61 74 6f 72 2e 0d 0a 23 20 55 4e 43 48 locator...# UNCH
5810: 45 43 4b 45 44 20 2d 20 31 20 2d 3e 20 77 68 65 ECKED - 1 -> whe
5820: 6e 20 64 6f 69 6e 67 20 61 20 64 65 62 75 67 20 n doing a debug
5830: 62 75 69 6c 64 20 77 69 74 68 20 73 79 6d 62 6f build with symbo
5840: 6c 73 2c 20 75 73 65 20 74 68 65 20 72 65 6c 65 ls, use the rele
5850: 61 73 65 0d 0a 23 20 20 20 20 20 20 20 20 20 20 ase..#
5860: 20 43 20 72 75 6e 74 69 6d 65 2c 20 30 20 2d 3e C runtime, 0 ->
5870: 20 75 73 65 20 74 68 65 20 64 65 62 75 67 20 43 use the debug C
5880: 20 72 75 6e 74 69 6d 65 2e 0d 0a 23 20 55 53 45 runtime...# USE
5890: 5f 53 54 55 42 53 20 2d 20 31 20 2d 3e 20 63 6f _STUBS - 1 -> co
58a0: 6d 70 69 6c 65 20 74 6f 20 75 73 65 20 73 74 75 mpile to use stu
58b0: 62 73 20 69 6e 74 65 72 66 61 63 65 73 2c 20 30 bs interfaces, 0
58c0: 20 2d 3e 20 64 69 72 65 63 74 20 6c 69 6e 6b 69 -> direct linki
58d0: 6e 67 0d 0a 23 20 43 4f 4e 46 49 47 5f 43 48 45 ng..# CONFIG_CHE
58e0: 43 4b 20 2d 20 31 20 2d 3e 20 63 68 65 63 6b 20 CK - 1 -> check
58f0: 63 75 72 72 65 6e 74 20 62 75 69 6c 64 20 63 6f current build co
5900: 6e 66 69 67 75 72 61 74 69 6f 6e 20 61 67 61 69 nfiguration agai
5910: 6e 73 74 20 54 63 6c 0d 0a 23 20 20 20 20 20 20 nst Tcl..#
5920: 20 20 20 20 20 63 6f 6e 66 69 67 75 72 61 74 69 configurati
5930: 6f 6e 20 28 69 67 6e 6f 72 65 64 20 66 6f 72 20 on (ignored for
5940: 54 63 6c 20 69 74 73 65 6c 66 29 0d 0a 23 20 46 Tcl itself)..# F
5950: 75 72 74 68 65 72 2c 20 4c 49 4e 4b 45 52 46 4c urther, LINKERFL
5960: 41 47 53 20 61 72 65 20 6d 6f 64 69 66 69 65 64 AGS are modified
5970: 20 62 61 73 65 64 20 6f 6e 20 61 62 6f 76 65 2e based on above.
5980: 0d 0a 0d 0a 23 20 44 65 66 61 75 6c 74 20 76 61 ....# Default va
5990: 6c 75 65 73 20 66 6f 72 20 61 6c 6c 20 74 68 65 lues for all the
59a0: 20 61 62 6f 76 65 0d 0a 53 54 41 54 49 43 5f 42 above..STATIC_B
59b0: 55 49 4c 44 09 3d 20 30 0d 0a 54 43 4c 5f 54 48 UILD.= 0..TCL_TH
59c0: 52 45 41 44 53 09 3d 20 31 0d 0a 44 45 42 55 47 READS.= 1..DEBUG
59d0: 09 09 3d 20 30 0d 0a 53 59 4d 42 4f 4c 53 09 09 ..= 0..SYMBOLS..
59e0: 3d 20 30 0d 0a 50 52 4f 46 49 4c 45 09 09 3d 20 = 0..PROFILE..=
59f0: 30 0d 0a 50 47 4f 09 09 3d 20 30 0d 0a 4d 53 56 0..PGO..= 0..MSV
5a00: 43 52 54 09 09 3d 20 31 0d 0a 54 43 4c 5f 55 53 CRT..= 1..TCL_US
5a10: 45 5f 53 54 41 54 49 43 5f 50 41 43 4b 41 47 45 E_STATIC_PACKAGE
5a20: 53 09 3d 20 30 0d 0a 55 53 45 5f 54 48 52 45 41 S.= 0..USE_THREA
5a30: 44 5f 41 4c 4c 4f 43 20 3d 20 31 0d 0a 55 4e 43 D_ALLOC = 1..UNC
5a40: 48 45 43 4b 45 44 09 3d 20 30 0d 0a 43 4f 4e 46 HECKED.= 0..CONF
5a50: 49 47 5f 43 48 45 43 4b 20 20 20 20 3d 20 31 0d IG_CHECK = 1.
5a60: 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c .!if $(DOING_TCL
5a70: 29 0d 0a 55 53 45 5f 53 54 55 42 53 20 20 20 20 )..USE_STUBS
5a80: 20 20 20 3d 20 30 0d 0a 21 65 6c 73 65 0d 0a 55 = 0..!else..U
5a90: 53 45 5f 53 54 55 42 53 20 20 20 20 20 20 20 3d SE_STUBS =
5aa0: 20 31 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 1..!endif....#
5ab0: 49 66 20 4f 50 54 53 20 69 73 20 6e 6f 74 20 65 If OPTS is not e
5ac0: 6d 70 74 79 20 41 4e 44 20 64 6f 65 73 20 6e 6f mpty AND does no
5ad0: 74 20 63 6f 6e 74 61 69 6e 20 22 6e 6f 6e 65 22 t contain "none"
5ae0: 20 77 68 69 63 68 20 74 75 72 6e 73 20 6f 66 66 which turns off
5af0: 20 61 6c 6c 20 4f 50 54 53 0d 0a 23 20 73 65 74 all OPTS..# set
5b00: 20 74 68 65 20 61 62 6f 76 65 20 6d 61 63 72 6f the above macro
5b10: 73 20 62 61 73 65 64 20 6f 6e 20 4f 50 54 53 20 s based on OPTS
5b20: 63 6f 6e 74 65 6e 74 0d 0a 21 69 66 20 22 24 28 content..!if "$(
5b30: 4f 50 54 53 29 22 20 21 3d 20 22 22 20 26 26 20 OPTS)" != "" &&
5b40: 21 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 22 24 ![nmakehlp -f "$
5b50: 28 4f 50 54 53 29 22 20 22 6e 6f 6e 65 22 5d 0d (OPTS)" "none"].
5b60: 0a 0d 0a 23 20 4f 50 54 53 20 61 72 65 20 73 70 ...# OPTS are sp
5b70: 65 63 69 66 69 65 64 2c 20 70 61 72 73 65 20 74 ecified, parse t
5b80: 68 65 6d 0d 0a 0d 0a 21 69 66 20 5b 6e 6d 61 6b hem....!if [nmak
5b90: 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 ehlp -f $(OPTS)
5ba0: 22 73 74 61 74 69 63 22 5d 0d 0a 21 6d 65 73 73 "static"]..!mess
5bb0: 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 73 74 age *** Doing st
5bc0: 61 74 69 63 0d 0a 53 54 41 54 49 43 5f 42 55 49 atic..STATIC_BUI
5bd0: 4c 44 09 3d 20 31 0d 0a 21 65 6e 64 69 66 0d 0a LD.= 1..!endif..
5be0: 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 ..!if [nmakehlp
5bf0: 2d 66 20 24 28 4f 50 54 53 29 20 22 6e 6f 73 74 -f $(OPTS) "nost
5c00: 75 62 73 22 5d 0d 0a 21 6d 65 73 73 61 67 65 20 ubs"]..!message
5c10: 2a 2a 2a 20 4e 6f 74 20 75 73 69 6e 67 20 73 74 *** Not using st
5c20: 75 62 73 0d 0a 55 53 45 5f 53 54 55 42 53 09 3d ubs..USE_STUBS.=
5c30: 20 30 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 0..!endif....!i
5c40: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 f [nmakehlp -f $
5c50: 28 4f 50 54 53 29 20 22 6e 6f 6d 73 76 63 72 74 (OPTS) "nomsvcrt
5c60: 22 5d 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a "]..!message ***
5c70: 20 44 6f 69 6e 67 20 6e 6f 6d 73 76 63 72 74 0d Doing nomsvcrt.
5c80: 0a 4d 53 56 43 52 54 09 09 3d 20 30 0d 0a 21 65 .MSVCRT..= 0..!e
5c90: 6c 73 65 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 lse..!if [nmakeh
5ca0: 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 6d lp -f $(OPTS) "m
5cb0: 73 76 63 72 74 22 5d 0d 0a 21 6d 65 73 73 61 67 svcrt"]..!messag
5cc0: 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 6d 73 76 63 e *** Doing msvc
5cd0: 72 74 0d 0a 4d 53 56 43 52 54 09 09 3d 20 31 0d rt..MSVCRT..= 1.
5ce0: 0a 21 65 6c 73 65 0d 0a 21 69 66 20 21 24 28 53 .!else..!if !$(S
5cf0: 54 41 54 49 43 5f 42 55 49 4c 44 29 0d 0a 4d 53 TATIC_BUILD)..MS
5d00: 56 43 52 54 09 09 3d 20 31 0d 0a 21 65 6c 73 65 VCRT..= 1..!else
5d10: 0d 0a 4d 53 56 43 52 54 09 09 3d 20 30 0d 0a 21 ..MSVCRT..= 0..!
5d20: 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 21 endif..!endif..!
5d30: 65 6e 64 69 66 20 23 20 5b 6e 6d 61 6b 65 68 6c endif # [nmakehl
5d40: 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 6e 6f p -f $(OPTS) "no
5d50: 6d 73 76 63 72 74 22 5d 0d 0a 0d 0a 21 69 66 20 msvcrt"]....!if
5d60: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f [nmakehlp -f $(O
5d70: 50 54 53 29 20 22 73 74 61 74 69 63 70 6b 67 22 PTS) "staticpkg"
5d80: 5d 20 26 26 20 24 28 53 54 41 54 49 43 5f 42 55 ] && $(STATIC_BU
5d90: 49 4c 44 29 0d 0a 21 6d 65 73 73 61 67 65 20 2a ILD)..!message *
5da0: 2a 2a 20 44 6f 69 6e 67 20 73 74 61 74 69 63 70 ** Doing staticp
5db0: 6b 67 0d 0a 54 43 4c 5f 55 53 45 5f 53 54 41 54 kg..TCL_USE_STAT
5dc0: 49 43 5f 50 41 43 4b 41 47 45 53 09 3d 20 31 0d IC_PACKAGES.= 1.
5dd0: 0a 21 65 6c 73 65 0d 0a 54 43 4c 5f 55 53 45 5f .!else..TCL_USE_
5de0: 53 54 41 54 49 43 5f 50 41 43 4b 41 47 45 53 09 STATIC_PACKAGES.
5df0: 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 = 0..!endif....!
5e00: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 if [nmakehlp -f
5e10: 24 28 4f 50 54 53 29 20 22 6e 6f 74 68 72 65 61 $(OPTS) "nothrea
5e20: 64 73 22 5d 0d 0a 21 6d 65 73 73 61 67 65 20 2a ds"]..!message *
5e30: 2a 2a 20 43 6f 6d 70 69 6c 65 20 65 78 70 6c 69 ** Compile expli
5e40: 63 69 74 6c 79 20 66 6f 72 20 6e 6f 6e 2d 74 68 citly for non-th
5e50: 72 65 61 64 65 64 20 54 63 6c 0d 0a 54 43 4c 5f readed Tcl..TCL_
5e60: 54 48 52 45 41 44 53 09 3d 20 30 0d 0a 55 53 45 THREADS.= 0..USE
5e70: 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 3d 20 30 _THREAD_ALLOC= 0
5e80: 0d 0a 21 65 6c 73 65 0d 0a 54 43 4c 5f 54 48 52 ..!else..TCL_THR
5e90: 45 41 44 53 09 3d 20 31 0d 0a 55 53 45 5f 54 48 EADS.= 1..USE_TH
5ea0: 52 45 41 44 5f 41 4c 4c 4f 43 3d 20 31 0d 0a 21 READ_ALLOC= 1..!
5eb0: 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 5b 6e 6d endif....!if [nm
5ec0: 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 akehlp -f $(OPTS
5ed0: 29 20 22 73 79 6d 62 6f 6c 73 22 5d 0d 0a 21 6d ) "symbols"]..!m
5ee0: 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 essage *** Doing
5ef0: 20 73 79 6d 62 6f 6c 73 0d 0a 44 45 42 55 47 09 symbols..DEBUG.
5f00: 09 3d 20 31 0d 0a 21 65 6c 73 65 0d 0a 44 45 42 .= 1..!else..DEB
5f10: 55 47 09 09 3d 20 30 0d 0a 21 65 6e 64 69 66 0d UG..= 0..!endif.
5f20: 0a 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 ...!if [nmakehlp
5f30: 20 2d 66 20 24 28 4f 50 54 53 29 20 22 70 64 62 -f $(OPTS) "pdb
5f40: 73 22 5d 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a s"]..!message **
5f50: 2a 20 44 6f 69 6e 67 20 70 64 62 73 0d 0a 53 59 * Doing pdbs..SY
5f60: 4d 42 4f 4c 53 09 09 3d 20 31 0d 0a 21 65 6c 73 MBOLS..= 1..!els
5f70: 65 0d 0a 53 59 4d 42 4f 4c 53 09 09 3d 20 30 0d e..SYMBOLS..= 0.
5f80: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 5b .!endif....!if [
5f90: 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 nmakehlp -f $(OP
5fa0: 54 53 29 20 22 70 72 6f 66 69 6c 65 22 5d 0d 0a TS) "profile"]..
5fb0: 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 !message *** Doi
5fc0: 6e 67 20 70 72 6f 66 69 6c 65 0d 0a 50 52 4f 46 ng profile..PROF
5fd0: 49 4c 45 09 09 3d 20 31 0d 0a 21 65 6c 73 65 0d ILE..= 1..!else.
5fe0: 0a 50 52 4f 46 49 4c 45 09 09 3d 20 30 0d 0a 21 .PROFILE..= 0..!
5ff0: 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 5b 6e 6d endif....!if [nm
6000: 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 akehlp -f $(OPTS
6010: 29 20 22 70 67 69 22 5d 0d 0a 21 6d 65 73 73 61 ) "pgi"]..!messa
6020: 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 70 72 6f ge *** Doing pro
6030: 66 69 6c 65 20 67 75 69 64 65 64 20 6f 70 74 69 file guided opti
6040: 6d 69 7a 61 74 69 6f 6e 20 69 6e 73 74 72 75 6d mization instrum
6050: 65 6e 74 61 74 69 6f 6e 0d 0a 50 47 4f 09 09 3d entation..PGO..=
6060: 20 31 0d 0a 21 65 6c 73 65 69 66 20 5b 6e 6d 61 1..!elseif [nma
6070: 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 kehlp -f $(OPTS)
6080: 20 22 70 67 6f 22 5d 0d 0a 21 6d 65 73 73 61 67 "pgo"]..!messag
6090: 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 70 72 6f 66 e *** Doing prof
60a0: 69 6c 65 20 67 75 69 64 65 64 20 6f 70 74 69 6d ile guided optim
60b0: 69 7a 61 74 69 6f 6e 0d 0a 50 47 4f 09 09 3d 20 ization..PGO..=
60c0: 32 0d 0a 21 65 6c 73 65 0d 0a 50 47 4f 09 09 3d 2..!else..PGO..=
60d0: 20 30 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 0..!endif....!i
60e0: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 f [nmakehlp -f $
60f0: 28 4f 50 54 53 29 20 22 6c 6f 69 6d 70 61 63 74 (OPTS) "loimpact
6100: 22 5d 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a "]..!message ***
6110: 20 57 61 72 6e 69 6e 67 3a 20 69 67 6e 6f 72 69 Warning: ignori
6120: 6e 67 20 6f 70 74 69 6f 6e 20 22 6c 6f 69 6d 70 ng option "loimp
6130: 61 63 74 22 20 2d 20 64 65 70 72 65 63 61 74 65 act" - deprecate
6140: 64 20 6f 6e 20 6d 6f 64 65 72 6e 20 57 69 6e 64 d on modern Wind
6150: 6f 77 73 2e 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a ows...!endif....
6160: 23 20 54 42 44 20 2d 20 73 68 6f 75 6c 64 20 67 # TBD - should g
6170: 65 74 20 72 69 64 20 6f 66 20 74 68 69 73 20 6f et rid of this o
6180: 70 74 69 6f 6e 0d 0a 21 69 66 20 5b 6e 6d 61 6b ption..!if [nmak
6190: 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 ehlp -f $(OPTS)
61a0: 22 74 68 72 64 61 6c 6c 6f 63 22 5d 0d 0a 21 6d "thrdalloc"]..!m
61b0: 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 essage *** Doing
61c0: 20 74 68 72 64 61 6c 6c 6f 63 0d 0a 55 53 45 5f thrdalloc..USE_
61d0: 54 48 52 45 41 44 5f 41 4c 4c 4f 43 20 3d 20 31 THREAD_ALLOC = 1
61e0: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 ..!endif....!if
61f0: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f [nmakehlp -f $(O
6200: 50 54 53 29 20 22 74 63 6c 61 6c 6c 6f 63 22 5d PTS) "tclalloc"]
6210: 0d 0a 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c ..USE_THREAD_ALL
6220: 4f 43 20 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a OC = 0..!endif..
6230: 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 ..!if [nmakehlp
6240: 2d 66 20 24 28 4f 50 54 53 29 20 22 75 6e 63 68 -f $(OPTS) "unch
6250: 65 63 6b 65 64 22 5d 0d 0a 21 6d 65 73 73 61 67 ecked"]..!messag
6260: 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 75 6e 63 68 e *** Doing unch
6270: 65 63 6b 65 64 0d 0a 55 4e 43 48 45 43 4b 45 44 ecked..UNCHECKED
6280: 20 3d 20 31 0d 0a 21 65 6c 73 65 0d 0a 55 4e 43 = 1..!else..UNC
6290: 48 45 43 4b 45 44 20 3d 20 30 0d 0a 21 65 6e 64 HECKED = 0..!end
62a0: 69 66 0d 0a 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 if....!if [nmake
62b0: 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 hlp -f $(OPTS) "
62c0: 6e 6f 63 6f 6e 66 69 67 63 68 65 63 6b 22 5d 0d noconfigcheck"].
62d0: 0a 43 4f 4e 46 49 47 5f 43 48 45 43 4b 20 3d 20 .CONFIG_CHECK =
62e0: 31 0d 0a 21 65 6c 73 65 0d 0a 43 4f 4e 46 49 47 1..!else..CONFIG
62f0: 5f 43 48 45 43 4b 20 3d 20 30 0d 0a 21 65 6e 64 _CHECK = 0..!end
6300: 69 66 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 20 22 if....!endif # "
6310: 24 28 4f 50 54 53 29 22 20 21 3d 20 22 22 20 20 $(OPTS)" != ""
6320: 26 26 20 2e 2e 2e 20 70 61 72 73 69 6e 67 20 6f && ... parsing o
6330: 66 20 4f 50 54 53 0d 0a 0d 0a 23 20 53 65 74 20 f OPTS....# Set
6340: 6c 69 6e 6b 65 72 20 66 6c 61 67 73 20 62 61 73 linker flags bas
6350: 65 64 20 6f 6e 20 61 62 6f 76 65 0d 0a 0d 0a 21 ed on above....!
6360: 69 66 20 24 28 50 47 4f 29 20 3e 20 31 0d 0a 21 if $(PGO) > 1..!
6370: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 6c 20 if [nmakehlp -l
6380: 2d 6c 74 63 67 3a 70 67 6f 70 74 69 6d 69 7a 65 -ltcg:pgoptimize
6390: 20 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c $(LINKER_TESTFL
63a0: 41 47 53 29 5d 0d 0a 4c 49 4e 4b 45 52 46 4c 41 AGS)]..LINKERFLA
63b0: 47 53 09 3d 20 24 28 4c 49 4e 4b 45 52 46 4c 41 GS.= $(LINKERFLA
63c0: 47 53 3a 2d 6c 74 63 67 3d 29 20 2d 6c 74 63 67 GS:-ltcg=) -ltcg
63d0: 3a 70 67 6f 70 74 69 6d 69 7a 65 0d 0a 21 65 6c :pgoptimize..!el
63e0: 73 65 0d 0a 4d 53 47 3d 5e 0d 0a 54 68 69 73 20 se..MSG=^..This
63f0: 63 6f 6d 70 69 6c 65 72 20 64 6f 65 73 20 6e 6f compiler does no
6400: 74 20 73 75 70 70 6f 72 74 20 70 72 6f 66 69 6c t support profil
6410: 65 20 67 75 69 64 65 64 20 6f 70 74 69 6d 69 7a e guided optimiz
6420: 61 74 69 6f 6e 2e 0d 0a 21 65 72 72 6f 72 20 24 ation...!error $
6430: 28 4d 53 47 29 0d 0a 21 65 6e 64 69 66 0d 0a 21 (MSG)..!endif..!
6440: 65 6c 73 65 69 66 20 24 28 50 47 4f 29 20 3e 20 elseif $(PGO) >
6450: 30 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 0..!if [nmakehlp
6460: 20 2d 6c 20 2d 6c 74 63 67 3a 70 67 69 6e 73 74 -l -ltcg:pginst
6470: 72 75 6d 65 6e 74 20 24 28 4c 49 4e 4b 45 52 5f rument $(LINKER_
6480: 54 45 53 54 46 4c 41 47 53 29 5d 0d 0a 4c 49 4e TESTFLAGS)]..LIN
6490: 4b 45 52 46 4c 41 47 53 09 3d 20 24 28 4c 49 4e KERFLAGS.= $(LIN
64a0: 4b 45 52 46 4c 41 47 53 3a 2d 6c 74 63 67 3d 29 KERFLAGS:-ltcg=)
64b0: 20 2d 6c 74 63 67 3a 70 67 69 6e 73 74 72 75 6d -ltcg:pginstrum
64c0: 65 6e 74 0d 0a 21 65 6c 73 65 0d 0a 4d 53 47 3d ent..!else..MSG=
64d0: 5e 0d 0a 54 68 69 73 20 63 6f 6d 70 69 6c 65 72 ^..This compiler
64e0: 20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 does not suppor
64f0: 74 20 70 72 6f 66 69 6c 65 20 67 75 69 64 65 64 t profile guided
6500: 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 2e 0d 0a optimization...
6510: 21 65 72 72 6f 72 20 24 28 4d 53 47 29 0d 0a 21 !error $(MSG)..!
6520: 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d endif..!endif...
6530: 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 .###############
6540: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6550: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6560: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6570: 23 0d 0a 23 20 37 2e 20 50 61 72 73 65 20 74 68 #..# 7. Parse th
6580: 65 20 53 54 41 54 53 20 6d 61 63 72 6f 20 74 6f e STATS macro to
6590: 20 63 6f 6e 66 69 67 75 72 65 20 63 6f 64 65 20 configure code
65a0: 69 6e 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0d instrumentation.
65b0: 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 .# The following
65c0: 20 6d 61 63 72 6f 73 20 61 72 65 20 73 65 74 20 macros are set
65d0: 62 79 20 74 68 69 73 20 73 65 63 74 69 6f 6e 3a by this section:
65e0: 0d 0a 23 20 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 ..# TCL_MEM_DEBU
65f0: 47 20 2d 20 31 20 2d 3e 20 65 6e 61 62 6c 65 73 G - 1 -> enables
6600: 20 6d 65 6d 6f 72 79 20 61 6c 6c 6f 63 61 74 69 memory allocati
6610: 6f 6e 20 69 6e 73 74 72 75 6d 65 6e 74 61 74 69 on instrumentati
6620: 6f 6e 0d 0a 23 20 20 20 20 20 20 20 20 20 20 20 on..#
6630: 20 20 20 20 20 20 30 20 2d 3e 20 64 69 73 61 62 0 -> disab
6640: 6c 65 73 0d 0a 23 20 54 43 4c 5f 43 4f 4d 50 49 les..# TCL_COMPI
6650: 4c 45 5f 44 45 42 55 47 20 2d 20 31 20 2d 3e 20 LE_DEBUG - 1 ->
6660: 65 6e 61 62 6c 65 73 20 62 79 74 65 20 63 6f 6d enables byte com
6670: 70 69 6c 65 72 20 6c 6f 67 67 69 6e 67 0d 0a 23 piler logging..#
6680: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
6690: 20 20 20 20 20 30 20 2d 3e 20 64 69 73 61 62 6c 0 -> disabl
66a0: 65 73 0d 0a 0d 0a 23 20 44 65 66 61 75 6c 74 20 es....# Default
66b0: 62 6f 74 68 20 61 72 65 20 6f 66 66 0d 0a 54 43 both are off..TC
66c0: 4c 5f 4d 45 4d 5f 44 45 42 55 47 09 20 20 20 20 L_MEM_DEBUG.
66d0: 3d 20 30 0d 0a 54 43 4c 5f 43 4f 4d 50 49 4c 45 = 0..TCL_COMPILE
66e0: 5f 44 45 42 55 47 20 20 20 3d 20 30 0d 0a 0d 0a _DEBUG = 0....
66f0: 21 69 66 20 22 24 28 53 54 41 54 53 29 22 20 21 !if "$(STATS)" !
6700: 3d 20 22 22 20 26 26 20 21 5b 6e 6d 61 6b 65 68 = "" && ![nmakeh
6710: 6c 70 20 2d 66 20 22 24 28 53 54 41 54 53 29 22 lp -f "$(STATS)"
6720: 20 22 6e 6f 6e 65 22 5d 0d 0a 0d 0a 21 69 66 20 "none"]....!if
6730: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 53 [nmakehlp -f $(S
6740: 54 41 54 53 29 20 22 6d 65 6d 64 62 67 22 5d 0d TATS) "memdbg"].
6750: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f .!message *** Do
6760: 69 6e 67 20 6d 65 6d 64 62 67 0d 0a 54 43 4c 5f ing memdbg..TCL_
6770: 4d 45 4d 5f 44 45 42 55 47 09 20 20 20 20 3d 20 MEM_DEBUG. =
6780: 31 0d 0a 21 65 6c 73 65 0d 0a 54 43 4c 5f 4d 45 1..!else..TCL_ME
6790: 4d 5f 44 45 42 55 47 09 20 20 20 20 3d 20 30 0d M_DEBUG. = 0.
67a0: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 5b .!endif....!if [
67b0: 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 53 54 nmakehlp -f $(ST
67c0: 41 54 53 29 20 22 63 6f 6d 70 64 62 67 22 5d 0d ATS) "compdbg"].
67d0: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f .!message *** Do
67e0: 69 6e 67 20 63 6f 6d 70 64 62 67 0d 0a 54 43 4c ing compdbg..TCL
67f0: 5f 43 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 20 _COMPILE_DEBUG
6800: 20 3d 20 31 0d 0a 21 65 6c 73 65 0d 0a 54 43 4c = 1..!else..TCL
6810: 5f 43 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 20 _COMPILE_DEBUG
6820: 20 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a = 0..!endif....
6830: 21 65 6e 64 69 66 0d 0a 0d 0a 23 23 23 23 23 23 !endif....######
6840: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6850: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6860: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6870: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0d 0a ##############..
6880: 23 20 38 2e 20 50 61 72 73 65 20 74 68 65 20 43 # 8. Parse the C
6890: 48 45 43 4b 53 20 6d 61 63 72 6f 20 74 6f 20 63 HECKS macro to c
68a0: 6f 6e 66 69 67 75 72 65 20 61 64 64 69 74 69 6f onfigure additio
68b0: 6e 61 6c 20 63 6f 6d 70 69 6c 65 72 20 63 68 65 nal compiler che
68c0: 63 6b 73 0d 0a 23 20 54 68 65 20 66 6f 6c 6c 6f cks..# The follo
68d0: 77 69 6e 67 20 6d 61 63 72 6f 73 20 61 72 65 20 wing macros are
68e0: 73 65 74 20 62 79 20 74 68 69 73 20 73 65 63 74 set by this sect
68f0: 69 6f 6e 3a 0d 0a 23 20 57 41 52 4e 49 4e 47 53 ion:..# WARNINGS
6900: 20 2d 20 63 6f 6d 70 69 6c 65 72 20 73 77 69 74 - compiler swit
6910: 63 68 65 73 20 74 68 61 74 20 63 6f 6e 74 72 6f ches that contro
6920: 6c 20 74 68 65 20 77 61 72 6e 69 6e 67 73 20 6c l the warnings l
6930: 65 76 65 6c 0d 0a 23 20 54 43 4c 5f 4e 4f 5f 44 evel..# TCL_NO_D
6940: 45 50 52 45 43 41 54 45 44 20 2d 20 31 20 2d 3e EPRECATED - 1 ->
6950: 20 64 69 73 61 62 6c 65 20 73 75 70 70 6f 72 74 disable support
6960: 20 66 6f 72 20 64 65 70 72 65 63 61 74 65 64 20 for deprecated
6970: 66 75 6e 63 74 69 6f 6e 73 0d 0a 23 20 20 20 20 functions..#
6980: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
6990: 20 30 20 2d 3e 20 65 6e 61 62 6c 65 20 64 65 70 0 -> enable dep
69a0: 72 65 63 61 74 65 64 20 66 75 6e 63 74 69 6f 6e recated function
69b0: 73 0d 0a 0d 0a 23 20 44 65 66 61 75 6c 74 73 20 s....# Defaults
69c0: 2d 20 50 65 72 6d 69 74 20 64 65 70 72 65 63 61 - Permit depreca
69d0: 74 65 64 20 66 75 6e 63 74 69 6f 6e 73 20 61 6e ted functions an
69e0: 64 20 77 61 72 6e 69 6e 67 20 6c 65 76 65 6c 20 d warning level
69f0: 33 0d 0a 54 43 4c 5f 4e 4f 5f 44 45 50 52 45 43 3..TCL_NO_DEPREC
6a00: 41 54 45 44 09 20 20 20 20 3d 20 30 0d 0a 57 41 ATED. = 0..WA
6a10: 52 4e 49 4e 47 53 09 09 20 20 20 20 3d 20 2d 57 RNINGS.. = -W
6a20: 33 0d 0a 0d 0a 21 69 66 20 22 24 28 43 48 45 43 3....!if "$(CHEC
6a30: 4b 53 29 22 20 21 3d 20 22 22 20 26 26 20 21 5b KS)" != "" && ![
6a40: 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 22 24 28 43 nmakehlp -f "$(C
6a50: 48 45 43 4b 53 29 22 20 22 6e 6f 6e 65 22 5d 0d HECKS)" "none"].
6a60: 0a 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 ...!if [nmakehlp
6a70: 20 2d 66 20 24 28 43 48 45 43 4b 53 29 20 22 6e -f $(CHECKS) "n
6a80: 6f 64 65 70 22 5d 0d 0a 21 6d 65 73 73 61 67 65 odep"]..!message
6a90: 20 2a 2a 2a 20 44 6f 69 6e 67 20 6e 6f 64 65 70 *** Doing nodep
6aa0: 20 63 68 65 63 6b 0d 0a 54 43 4c 5f 4e 4f 5f 44 check..TCL_NO_D
6ab0: 45 50 52 45 43 41 54 45 44 09 20 20 20 20 3d 20 EPRECATED. =
6ac0: 31 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 1..!endif....!if
6ad0: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 [nmakehlp -f $(
6ae0: 43 48 45 43 4b 53 29 20 22 66 75 6c 6c 77 61 72 CHECKS) "fullwar
6af0: 6e 22 5d 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a n"]..!message **
6b00: 2a 20 44 6f 69 6e 67 20 66 75 6c 6c 20 77 61 72 * Doing full war
6b10: 6e 69 6e 67 73 20 63 68 65 63 6b 0d 0a 57 41 52 nings check..WAR
6b20: 4e 49 4e 47 53 09 09 20 20 20 20 3d 20 2d 57 34 NINGS.. = -W4
6b30: 0d 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 ..!if [nmakehlp
6b40: 2d 6c 20 2d 77 61 72 6e 3a 33 20 24 28 4c 49 4e -l -warn:3 $(LIN
6b50: 4b 45 52 5f 54 45 53 54 46 4c 41 47 53 29 5d 0d KER_TESTFLAGS)].
6b60: 0a 4c 49 4e 4b 45 52 46 4c 41 47 53 09 09 20 20 .LINKERFLAGS..
6b70: 20 20 3d 20 24 28 4c 49 4e 4b 45 52 46 4c 41 47 = $(LINKERFLAG
6b80: 53 29 20 2d 77 61 72 6e 3a 33 0d 0a 21 65 6e 64 S) -warn:3..!end
6b90: 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 if..!endif....!i
6ba0: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 f [nmakehlp -f $
6bb0: 28 43 48 45 43 4b 53 29 20 22 36 34 62 69 74 22 (CHECKS) "64bit"
6bc0: 5d 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d ] && [nmakehlp -
6bd0: 63 20 2d 57 70 36 34 5d 0d 0a 21 6d 65 73 73 61 c -Wp64]..!messa
6be0: 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 36 34 62 ge *** Doing 64b
6bf0: 69 74 20 70 6f 72 74 61 62 69 6c 69 74 79 20 77 it portability w
6c00: 61 72 6e 69 6e 67 73 0d 0a 57 41 52 4e 49 4e 47 arnings..WARNING
6c10: 53 09 09 20 20 20 20 3d 20 24 28 57 41 52 4e 49 S.. = $(WARNI
6c20: 4e 47 53 29 20 2d 57 70 36 34 0d 0a 21 65 6e 64 NGS) -Wp64..!end
6c30: 69 66 0d 0a 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a if....!endif....
6c40: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6c50: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6c60: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6c70: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6c80: 0d 0a 23 20 39 2e 20 45 78 74 72 61 63 74 20 76 ..# 9. Extract v
6c90: 61 72 69 6f 75 73 20 76 65 72 73 69 6f 6e 20 6e arious version n
6ca0: 75 6d 62 65 72 73 0d 0a 23 20 46 6f 72 20 54 63 umbers..# For Tc
6cb0: 6c 20 61 6e 64 20 54 6b 2c 20 76 65 72 73 69 6f l and Tk, versio
6cc0: 6e 20 6e 75 6d 62 65 72 73 20 61 72 65 20 65 78 n numbers are ex
6cd0: 74 72 61 63 74 65 64 20 66 72 6f 6d 20 74 63 6c tracted from tcl
6ce0: 2e 68 20 61 6e 64 20 74 6b 2e 68 0d 0a 23 20 72 .h and tk.h..# r
6cf0: 65 73 70 65 63 74 69 76 65 6c 79 2e 20 46 6f 72 espectively. For
6d00: 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 76 65 72 extensions, ver
6d10: 73 69 6f 6e 73 20 61 72 65 20 65 78 74 72 61 63 sions are extrac
6d20: 74 65 64 20 66 72 6f 6d 20 74 68 65 0d 0a 23 20 ted from the..#
6d30: 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20 6f 72 20 configure.in or
6d40: 63 6f 6e 66 69 67 75 72 65 2e 61 63 20 66 72 6f configure.ac fro
6d50: 6d 20 74 68 65 20 54 45 41 20 63 6f 6e 66 69 67 m the TEA config
6d60: 75 72 61 74 69 6f 6e 20 69 66 20 69 74 0d 0a 23 uration if it..#
6d70: 20 65 78 69 73 74 73 2c 20 61 6e 64 20 75 6e 73 exists, and uns
6d80: 65 74 20 6f 74 68 65 72 77 69 73 65 2e 0d 0a 23 et otherwise...#
6d90: 20 53 65 74 73 20 74 68 65 20 66 6f 6c 6c 6f 77 Sets the follow
6da0: 69 6e 67 20 6d 61 63 72 6f 73 3a 0d 0a 23 20 54 ing macros:..# T
6db0: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e CL_MAJOR_VERSION
6dc0: 0d 0a 23 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 ..# TCL_MINOR_VE
6dd0: 52 53 49 4f 4e 0d 0a 23 20 54 43 4c 5f 50 41 54 RSION..# TCL_PAT
6de0: 43 48 5f 4c 45 56 45 4c 0d 0a 23 20 54 43 4c 5f CH_LEVEL..# TCL_
6df0: 56 45 52 53 49 4f 4e 0d 0a 23 20 54 4b 5f 4d 41 VERSION..# TK_MA
6e00: 4a 4f 52 5f 56 45 52 53 49 4f 4e 0d 0a 23 20 54 JOR_VERSION..# T
6e10: 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 0d K_MINOR_VERSION.
6e20: 0a 23 20 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45 .# TK_PATCH_LEVE
6e30: 4c 0d 0a 23 20 54 4b 5f 56 45 52 53 49 4f 4e 0d L..# TK_VERSION.
6e40: 0a 23 20 44 4f 54 56 45 52 53 49 4f 4e 20 2d 20 .# DOTVERSION -
6e50: 73 65 74 20 61 73 20 28 66 6f 72 20 65 78 61 6d set as (for exam
6e60: 70 6c 65 29 20 32 2e 35 0d 0a 23 20 56 45 52 53 ple) 2.5..# VERS
6e70: 49 4f 4e 20 2d 20 73 65 74 20 61 73 20 28 66 6f ION - set as (fo
6e80: 72 20 65 78 61 6d 70 6c 65 20 32 35 29 0d 0a 23 r example 25)..#
6e90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6ea0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6eb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6ec0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a --------------..
6ed0: 0d 0a 21 69 66 20 5b 65 63 68 6f 20 52 45 4d 20 ..!if [echo REM
6ee0: 3d 20 54 68 69 73 20 66 69 6c 65 20 69 73 20 67 = This file is g
6ef0: 65 6e 65 72 61 74 65 64 20 66 72 6f 6d 20 72 75 enerated from ru
6f00: 6c 65 73 2e 76 63 20 3e 20 76 65 72 73 69 6f 6e les.vc > version
6f10: 73 2e 76 63 5d 0d 0a 21 65 6e 64 69 66 0d 0a 21 s.vc]..!endif..!
6f20: 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 4d 41 4a if [echo TCL_MAJ
6f30: 4f 52 5f 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e OR_VERSION = \>>
6f40: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d versions.vc] \.
6f50: 0a 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 . && [nmakehlp
6f60: 20 2d 56 20 22 24 28 5f 54 43 4c 5f 48 29 22 20 -V "$(_TCL_H)"
6f70: 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f TCL_MAJOR_VERSIO
6f80: 4e 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 N >> versions.vc
6f90: 5d 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 5b ]..!endif..!if [
6fa0: 65 63 68 6f 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 echo TCL_MINOR_V
6fb0: 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76 65 72 ERSION = \>> ver
6fc0: 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d 0a 20 20 20 sions.vc] \..
6fd0: 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56 20 && [nmakehlp -V
6fe0: 22 24 28 5f 54 43 4c 5f 48 29 22 20 54 43 4c 5f "$(_TCL_H)" TCL_
6ff0: 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 20 3e 3e MINOR_VERSION >>
7000: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21 versions.vc]..!
7010: 65 6e 64 69 66 0d 0a 21 69 66 20 5b 65 63 68 6f endif..!if [echo
7020: 20 54 43 4c 5f 50 41 54 43 48 5f 4c 45 56 45 4c TCL_PATCH_LEVEL
7030: 20 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e = \>> versions.
7040: 76 63 5d 20 5c 0d 0a 20 20 20 26 26 20 5b 6e 6d vc] \.. && [nm
7050: 61 6b 65 68 6c 70 20 2d 56 20 22 24 28 5f 54 43 akehlp -V "$(_TC
7060: 4c 5f 48 29 22 20 54 43 4c 5f 50 41 54 43 48 5f L_H)" TCL_PATCH_
7070: 4c 45 56 45 4c 20 3e 3e 20 76 65 72 73 69 6f 6e LEVEL >> version
7080: 73 2e 76 63 5d 0d 0a 21 65 6e 64 69 66 0d 0a 0d s.vc]..!endif...
7090: 0a 21 69 66 20 64 65 66 69 6e 65 64 28 5f 54 4b .!if defined(_TK
70a0: 5f 48 29 0d 0a 21 69 66 20 5b 65 63 68 6f 20 54 _H)..!if [echo T
70b0: 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 20 K_MAJOR_VERSION
70c0: 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 = \>> versions.v
70d0: 63 5d 20 5c 0d 0a 20 20 20 26 26 20 5b 6e 6d 61 c] \.. && [nma
70e0: 6b 65 68 6c 70 20 2d 56 20 24 28 5f 54 4b 5f 48 kehlp -V $(_TK_H
70f0: 29 20 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 ) TK_MAJOR_VERSI
7100: 4f 4e 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 ON >> versions.v
7110: 63 5d 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 c]..!endif..!if
7120: 5b 65 63 68 6f 20 54 4b 5f 4d 49 4e 4f 52 5f 56 [echo TK_MINOR_V
7130: 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76 65 72 ERSION = \>> ver
7140: 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d 0a 20 20 20 sions.vc] \..
7150: 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56 20 && [nmakehlp -V
7160: 24 28 5f 54 4b 5f 48 29 20 54 4b 5f 4d 49 4e 4f $(_TK_H) TK_MINO
7170: 52 5f 56 45 52 53 49 4f 4e 20 3e 3e 20 76 65 72 R_VERSION >> ver
7180: 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21 65 6e 64 69 sions.vc]..!endi
7190: 66 0d 0a 21 69 66 20 5b 65 63 68 6f 20 54 4b 5f f..!if [echo TK_
71a0: 50 41 54 43 48 5f 4c 45 56 45 4c 20 3d 20 5c 3e PATCH_LEVEL = \>
71b0: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c > versions.vc] \
71c0: 0d 0a 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c .. && [nmakehl
71d0: 70 20 2d 56 20 24 28 5f 54 4b 5f 48 29 20 54 4b p -V $(_TK_H) TK
71e0: 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20 3e 3e 20 _PATCH_LEVEL >>
71f0: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21 65 versions.vc]..!e
7200: 6e 64 69 66 0d 0a 21 65 6e 64 69 66 20 23 20 5f ndif..!endif # _
7210: 54 4b 5f 48 0d 0a 0d 0a 21 69 6e 63 6c 75 64 65 TK_H....!include
7220: 20 76 65 72 73 69 6f 6e 73 2e 76 63 0d 0a 0d 0a versions.vc....
7230: 54 43 4c 5f 56 45 52 53 49 4f 4e 09 3d 20 24 28 TCL_VERSION.= $(
7240: 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f TCL_MAJOR_VERSIO
7250: 4e 29 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 N)$(TCL_MINOR_VE
7260: 52 53 49 4f 4e 29 0d 0a 54 43 4c 5f 44 4f 54 56 RSION)..TCL_DOTV
7270: 45 52 53 49 4f 4e 09 3d 20 24 28 54 43 4c 5f 4d ERSION.= $(TCL_M
7280: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28 AJOR_VERSION).$(
7290: 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f TCL_MINOR_VERSIO
72a0: 4e 29 0d 0a 21 69 66 20 64 65 66 69 6e 65 64 28 N)..!if defined(
72b0: 5f 54 4b 5f 48 29 0d 0a 54 4b 5f 56 45 52 53 49 _TK_H)..TK_VERSI
72c0: 4f 4e 09 3d 20 24 28 54 4b 5f 4d 41 4a 4f 52 5f ON.= $(TK_MAJOR_
72d0: 56 45 52 53 49 4f 4e 29 24 28 54 4b 5f 4d 49 4e VERSION)$(TK_MIN
72e0: 4f 52 5f 56 45 52 53 49 4f 4e 29 0d 0a 54 4b 5f OR_VERSION)..TK_
72f0: 44 4f 54 56 45 52 53 49 4f 4e 09 3d 20 24 28 54 DOTVERSION.= $(T
7300: 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 K_MAJOR_VERSION)
7310: 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 .$(TK_MINOR_VERS
7320: 49 4f 4e 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a ION)..!endif....
7330: 23 20 53 65 74 20 44 4f 54 56 45 52 53 49 4f 4e # Set DOTVERSION
7340: 20 61 6e 64 20 56 45 52 53 49 4f 4e 0d 0a 21 69 and VERSION..!i
7350: 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a f $(DOING_TCL)..
7360: 0d 0a 44 4f 54 56 45 52 53 49 4f 4e 20 3d 20 24 ..DOTVERSION = $
7370: 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 (TCL_MAJOR_VERSI
7380: 4f 4e 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f ON).$(TCL_MINOR_
7390: 56 45 52 53 49 4f 4e 29 0d 0a 56 45 52 53 49 4f VERSION)..VERSIO
73a0: 4e 20 3d 20 24 28 54 43 4c 5f 56 45 52 53 49 4f N = $(TCL_VERSIO
73b0: 4e 29 0d 0a 0d 0a 21 65 6c 73 65 69 66 20 24 28 N)....!elseif $(
73c0: 44 4f 49 4e 47 5f 54 4b 29 0d 0a 0d 0a 44 4f 54 DOING_TK)....DOT
73d0: 56 45 52 53 49 4f 4e 20 3d 20 24 28 54 4b 5f 44 VERSION = $(TK_D
73e0: 4f 54 56 45 52 53 49 4f 4e 29 0d 0a 56 45 52 53 OTVERSION)..VERS
73f0: 49 4f 4e 20 3d 20 24 28 54 4b 5f 56 45 52 53 49 ION = $(TK_VERSI
7400: 4f 4e 29 0d 0a 0d 0a 21 65 6c 73 65 20 23 20 44 ON)....!else # D
7410: 6f 69 6e 67 20 61 20 6e 6f 6e 2d 54 6b 20 65 78 oing a non-Tk ex
7420: 74 65 6e 73 69 6f 6e 0d 0a 0d 0a 23 20 49 66 20 tension....# If
7430: 70 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 parent makefile
7440: 68 61 73 20 6e 6f 74 20 64 65 66 69 6e 65 64 20 has not defined
7450: 44 4f 54 56 45 52 53 49 4f 4e 2c 20 74 72 79 20 DOTVERSION, try
7460: 74 6f 20 67 65 74 20 69 74 20 66 72 6f 6d 20 54 to get it from T
7470: 45 41 0d 0a 23 20 66 69 72 73 74 20 66 72 6f 6d EA..# first from
7480: 20 61 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20 a configure.in
7490: 66 69 6c 65 2c 20 61 6e 64 20 74 68 65 6e 20 66 file, and then f
74a0: 72 6f 6d 20 63 6f 6e 66 69 67 75 72 65 2e 61 63 rom configure.ac
74b0: 0d 0a 21 69 66 6e 64 65 66 20 44 4f 54 56 45 52 ..!ifndef DOTVER
74c0: 53 49 4f 4e 0d 0a 21 69 66 20 5b 65 63 68 6f 20 SION..!if [echo
74d0: 44 4f 54 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 20 DOTVERSION = \>
74e0: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d 0a versions.vc] \..
74f0: 20 20 20 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70 20 || [nmakehlp
7500: 2d 56 20 24 28 52 4f 4f 54 29 5c 63 6f 6e 66 69 -V $(ROOT)\confi
7510: 67 75 72 65 2e 69 6e 20 5e 5b 24 28 50 52 4f 4a gure.in ^[$(PROJ
7520: 45 43 54 29 5e 5d 20 3e 3e 20 76 65 72 73 69 6f ECT)^] >> versio
7530: 6e 73 2e 76 63 5d 0d 0a 21 69 66 20 5b 65 63 68 ns.vc]..!if [ech
7540: 6f 20 44 4f 54 56 45 52 53 49 4f 4e 20 3d 20 5c o DOTVERSION = \
7550: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c > versions.vc] \
7560: 0d 0a 20 20 20 7c 7c 20 5b 6e 6d 61 6b 65 68 6c .. || [nmakehl
7570: 70 20 2d 56 20 24 28 52 4f 4f 54 29 5c 63 6f 6e p -V $(ROOT)\con
7580: 66 69 67 75 72 65 2e 61 63 20 5e 5b 24 28 50 52 figure.ac ^[$(PR
7590: 4f 4a 45 43 54 29 5e 5d 20 3e 3e 20 76 65 72 73 OJECT)^] >> vers
75a0: 69 6f 6e 73 2e 76 63 5d 0d 0a 21 65 72 72 6f 72 ions.vc]..!error
75b0: 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 *** Could not f
75c0: 69 67 75 72 65 20 6f 75 74 20 65 78 74 65 6e 73 igure out extens
75d0: 69 6f 6e 20 76 65 72 73 69 6f 6e 2e 20 50 6c 65 ion version. Ple
75e0: 61 73 65 20 64 65 66 69 6e 65 20 44 4f 54 56 45 ase define DOTVE
75f0: 52 53 49 4f 4e 20 69 6e 20 70 61 72 65 6e 74 20 RSION in parent
7600: 6d 61 6b 65 66 69 6c 65 20 62 65 66 6f 72 65 20 makefile before
7610: 69 6e 63 6c 75 64 69 6e 67 20 72 75 6c 65 73 2e including rules.
7620: 76 63 2e 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e vc...!endif..!en
7630: 64 69 66 0d 0a 21 69 6e 63 6c 75 64 65 20 76 65 dif..!include ve
7640: 72 73 69 6f 6e 73 2e 76 63 0d 0a 21 65 6e 64 69 rsions.vc..!endi
7650: 66 20 23 20 44 4f 54 56 45 52 53 49 4f 4e 0d 0a f # DOTVERSION..
7660: 56 45 52 53 49 4f 4e 20 20 20 20 20 20 20 20 20 VERSION
7670: 3d 20 24 28 44 4f 54 56 45 52 53 49 4f 4e 3a 2e = $(DOTVERSION:.
7680: 3d 29 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 20 24 =)....!endif # $
7690: 28 44 4f 49 4e 47 5f 54 43 4c 29 20 2e 2e 2e 20 (DOING_TCL) ...
76a0: 65 74 63 2e 0d 0a 0d 0a 23 23 23 23 23 23 23 23 etc.....########
76b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
76c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
76d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
76e0: 23 23 23 23 23 23 23 23 0d 0a 23 20 31 30 2e 20 ########..# 10.
76f0: 43 6f 6e 73 74 72 75 63 74 20 6f 75 74 70 75 74 Construct output
7700: 20 64 69 72 65 63 74 6f 72 79 20 61 6e 64 20 66 directory and f
7710: 69 6c 65 20 70 61 74 68 73 0d 0a 23 20 46 69 67 ile paths..# Fig
7720: 75 72 65 2d 6f 75 74 20 68 6f 77 20 74 6f 20 6e ure-out how to n
7730: 61 6d 65 20 6f 75 72 20 69 6e 74 65 72 6d 65 64 ame our intermed
7740: 69 61 74 65 20 61 6e 64 20 6f 75 74 70 75 74 20 iate and output
7750: 64 69 72 65 63 74 6f 72 69 65 73 2e 0d 0a 23 20 directories...#
7760: 49 6e 20 6f 72 64 65 72 20 74 6f 20 61 76 6f 69 In order to avoi
7770: 64 20 69 6e 61 64 76 65 72 74 65 6e 74 20 6d 69 d inadvertent mi
7780: 78 69 6e 67 20 6f 66 20 6f 62 6a 65 63 74 20 66 xing of object f
7790: 69 6c 65 73 20 62 75 69 6c 74 20 75 73 69 6e 67 iles built using
77a0: 0d 0a 23 20 64 69 66 66 65 72 65 6e 74 20 63 6f ..# different co
77b0: 6d 70 69 6c 65 72 73 2c 20 62 75 69 6c 64 20 63 mpilers, build c
77c0: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 73 20 65 74 onfigurations et
77d0: 63 2e 2c 0d 0a 23 0d 0a 23 20 4e 61 6d 69 6e 67 c.,..#..# Naming
77e0: 20 63 6f 6e 76 65 6e 74 69 6f 6e 20 28 73 75 66 convention (suf
77f0: 66 69 78 65 73 29 3a 0d 0a 23 20 20 20 74 20 3d fixes):..# t =
7800: 20 66 75 6c 6c 20 74 68 72 65 61 64 20 73 75 70 full thread sup
7810: 70 6f 72 74 2e 0d 0a 23 20 20 20 73 20 3d 20 73 port...# s = s
7820: 74 61 74 69 63 20 6c 69 62 72 61 72 79 20 28 61 tatic library (a
7830: 73 20 6f 70 70 6f 73 65 64 20 74 6f 20 61 6e 20 s opposed to an
7840: 69 6d 70 6f 72 74 20 6c 69 62 72 61 72 79 29 0d import library).
7850: 0a 23 20 20 20 67 20 3d 20 6c 69 6e 6b 65 64 20 .# g = linked
7860: 74 6f 20 74 68 65 20 64 65 62 75 67 20 65 6e 61 to the debug ena
7870: 62 6c 65 64 20 43 20 72 75 6e 2d 74 69 6d 65 2e bled C run-time.
7880: 0d 0a 23 20 20 20 78 20 3d 20 73 70 65 63 69 61 ..# x = specia
7890: 6c 20 73 74 61 74 69 63 20 62 75 69 6c 64 20 77 l static build w
78a0: 68 65 6e 20 69 74 20 6c 69 6e 6b 73 20 74 6f 20 hen it links to
78b0: 74 68 65 20 64 79 6e 61 6d 69 63 20 43 20 72 75 the dynamic C ru
78c0: 6e 2d 74 69 6d 65 2e 0d 0a 23 0d 0a 23 20 54 68 n-time...#..# Th
78d0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 e following macr
78e0: 6f 73 20 61 72 65 20 73 65 74 20 69 6e 20 74 68 os are set in th
78f0: 69 73 20 73 65 63 74 69 6f 6e 3a 0d 0a 23 20 53 is section:..# S
7900: 55 46 58 20 2d 20 74 68 65 20 73 75 66 66 69 78 UFX - the suffix
7910: 20 74 6f 20 75 73 65 20 66 6f 72 20 62 69 6e 61 to use for bina
7920: 72 69 65 73 20 62 61 73 65 64 20 6f 6e 20 61 62 ries based on ab
7930: 6f 76 65 20 6e 61 6d 69 6e 67 20 63 6f 6e 76 65 ove naming conve
7940: 6e 74 69 6f 6e 0d 0a 23 20 42 55 49 4c 44 44 49 ntion..# BUILDDI
7950: 52 54 4f 50 20 2d 20 74 68 65 20 74 6f 70 6c 65 RTOP - the tople
7960: 76 65 6c 20 64 65 66 61 75 6c 74 20 6f 75 74 70 vel default outp
7970: 75 74 20 64 69 72 65 63 74 6f 72 79 0d 0a 23 20 ut directory..#
7980: 20 20 20 20 20 69 73 20 6f 66 20 74 68 65 20 66 is of the f
7990: 6f 72 6d 20 7b 52 65 6c 65 61 73 65 2c 44 65 62 orm {Release,Deb
79a0: 75 67 7d 5b 5f 41 4d 44 36 34 5d 5b 5f 43 4f 4d ug}[_AMD64][_COM
79b0: 50 49 4c 45 52 56 45 52 53 49 4f 4e 5d 0d 0a 23 PILERVERSION]..#
79c0: 20 54 4d 50 5f 44 49 52 20 2d 20 64 69 72 65 63 TMP_DIR - direc
79d0: 74 6f 72 79 20 77 68 65 72 65 20 6f 62 6a 65 63 tory where objec
79e0: 74 20 66 69 6c 65 73 20 61 72 65 20 63 72 65 61 t files are crea
79f0: 74 65 64 0d 0a 23 20 4f 55 54 5f 44 49 52 20 2d ted..# OUT_DIR -
7a00: 20 64 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 directory where
7a10: 20 6f 75 74 70 75 74 20 65 78 65 63 75 74 61 62 output executab
7a20: 6c 65 73 20 61 72 65 20 63 72 65 61 74 65 64 0d les are created.
7a30: 0a 23 20 42 6f 74 68 20 54 4d 50 5f 44 49 52 20 .# Both TMP_DIR
7a40: 61 6e 64 20 4f 55 54 5f 44 49 52 20 61 72 65 20 and OUT_DIR are
7a50: 64 65 66 61 75 6c 74 65 64 20 6f 6e 6c 79 20 69 defaulted only i
7a60: 66 20 6e 6f 74 20 64 65 66 69 6e 65 64 20 62 79 f not defined by
7a70: 20 74 68 65 0d 0a 23 20 70 61 72 65 6e 74 20 6d the..# parent m
7a80: 61 6b 65 66 69 6c 65 20 28 6f 72 20 63 6f 6d 6d akefile (or comm
7a90: 61 6e 64 20 6c 69 6e 65 29 2e 20 54 68 65 20 64 and line). The d
7aa0: 65 66 61 75 6c 74 20 76 61 6c 75 65 73 20 61 72 efault values ar
7ab0: 65 0d 0a 23 20 62 61 73 65 64 20 6f 6e 20 42 55 e..# based on BU
7ac0: 49 4c 44 44 49 52 54 4f 50 2e 0d 0a 23 20 53 54 ILDDIRTOP...# ST
7ad0: 55 42 50 52 45 46 49 58 20 2d 20 6e 61 6d 65 20 UBPREFIX - name
7ae0: 6f 66 20 74 68 65 20 73 74 75 62 73 20 6c 69 62 of the stubs lib
7af0: 72 61 72 79 20 66 6f 72 20 74 68 69 73 20 70 72 rary for this pr
7b00: 6f 6a 65 63 74 0d 0a 23 20 50 52 4a 49 4d 50 4c oject..# PRJIMPL
7b10: 49 42 20 2d 20 6f 75 74 70 75 74 20 70 61 74 68 IB - output path
7b20: 20 6f 66 20 74 68 65 20 67 65 6e 65 72 61 74 65 of the generate
7b30: 64 20 70 72 6f 6a 65 63 74 20 69 6d 70 6f 72 74 d project import
7b40: 20 6c 69 62 72 61 72 79 0d 0a 23 20 50 52 4a 4c library..# PRJL
7b50: 49 42 4e 41 4d 45 20 2d 20 6e 61 6d 65 20 6f 66 IBNAME - name of
7b60: 20 67 65 6e 65 72 61 74 65 64 20 70 72 6f 6a 65 generated proje
7b70: 63 74 20 6c 69 62 72 61 72 79 0d 0a 23 20 50 52 ct library..# PR
7b80: 4a 4c 49 42 20 20 20 20 20 2d 20 6f 75 74 70 75 JLIB - outpu
7b90: 74 20 70 61 74 68 20 6f 66 20 67 65 6e 65 72 61 t path of genera
7ba0: 74 65 64 20 70 72 6f 6a 65 63 74 20 6c 69 62 72 ted project libr
7bb0: 61 72 79 0d 0a 23 20 50 52 4a 53 54 55 42 4c 49 ary..# PRJSTUBLI
7bc0: 42 4e 41 4d 45 20 2d 20 6e 61 6d 65 20 6f 66 20 BNAME - name of
7bd0: 74 68 65 20 67 65 6e 65 72 61 74 65 64 20 70 72 the generated pr
7be0: 6f 6a 65 63 74 20 73 74 75 62 73 20 6c 69 62 72 oject stubs libr
7bf0: 61 72 79 0d 0a 23 20 50 52 4a 53 54 55 42 4c 49 ary..# PRJSTUBLI
7c00: 42 20 2d 20 6f 75 74 70 75 74 20 70 61 74 68 20 B - output path
7c10: 6f 66 20 74 68 65 20 67 65 6e 65 72 61 74 65 64 of the generated
7c20: 20 70 72 6f 6a 65 63 74 20 73 74 75 62 73 20 6c project stubs l
7c30: 69 62 72 61 72 79 0d 0a 23 20 52 45 53 46 49 4c ibrary..# RESFIL
7c40: 45 20 2d 20 6f 75 74 70 75 74 20 72 65 73 6f 75 E - output resou
7c50: 72 63 65 20 66 69 6c 65 20 28 6f 6e 6c 79 20 69 rce file (only i
7c60: 66 20 6e 6f 74 20 73 74 61 74 69 63 20 62 75 69 f not static bui
7c70: 6c 64 29 0d 0a 0d 0a 53 55 46 58 09 20 20 20 20 ld)....SUFX.
7c80: 3d 20 74 73 67 78 0d 0a 0d 0a 21 69 66 20 24 28 = tsgx....!if $(
7c90: 44 45 42 55 47 29 0d 0a 42 55 49 4c 44 44 49 52 DEBUG)..BUILDDIR
7ca0: 54 4f 50 20 3d 20 44 65 62 75 67 0d 0a 21 65 6c TOP = Debug..!el
7cb0: 73 65 0d 0a 42 55 49 4c 44 44 49 52 54 4f 50 20 se..BUILDDIRTOP
7cc0: 3d 20 52 65 6c 65 61 73 65 0d 0a 21 65 6e 64 69 = Release..!endi
7cd0: 66 0d 0a 0d 0a 21 69 66 20 22 24 28 4d 41 43 48 f....!if "$(MACH
7ce0: 49 4e 45 29 22 20 21 3d 20 22 49 58 38 36 22 0d INE)" != "IX86".
7cf0: 0a 42 55 49 4c 44 44 49 52 54 4f 50 20 3d 24 28 .BUILDDIRTOP =$(
7d00: 42 55 49 4c 44 44 49 52 54 4f 50 29 5f 24 28 4d BUILDDIRTOP)_$(M
7d10: 41 43 48 49 4e 45 29 0d 0a 21 65 6e 64 69 66 0d ACHINE)..!endif.
7d20: 0a 21 69 66 20 24 28 56 43 56 45 52 29 20 3e 20 .!if $(VCVER) >
7d30: 36 0d 0a 42 55 49 4c 44 44 49 52 54 4f 50 20 3d 6..BUILDDIRTOP =
7d40: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5f 56 $(BUILDDIRTOP)_V
7d50: 43 24 28 56 43 56 45 52 29 0d 0a 21 65 6e 64 69 C$(VCVER)..!endi
7d60: 66 0d 0a 0d 0a 21 69 66 20 21 24 28 44 45 42 55 f....!if !$(DEBU
7d70: 47 29 20 7c 7c 20 24 28 44 45 42 55 47 29 20 26 G) || $(DEBUG) &
7d80: 26 20 24 28 55 4e 43 48 45 43 4b 45 44 29 0d 0a & $(UNCHECKED)..
7d90: 53 55 46 58 09 20 20 20 20 3d 20 24 28 53 55 46 SUFX. = $(SUF
7da0: 58 3a 67 3d 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d X:g=)..!endif...
7db0: 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d 20 2e .TMP_DIRFULL = .
7dc0: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c \$(BUILDDIRTOP)\
7dd0: 24 28 50 52 4f 4a 45 43 54 29 5f 54 68 72 65 61 $(PROJECT)_Threa
7de0: 64 65 64 44 79 6e 61 6d 69 63 53 74 61 74 69 63 dedDynamicStatic
7df0: 58 0d 0a 0d 0a 21 69 66 20 21 24 28 53 54 41 54 X....!if !$(STAT
7e00: 49 43 5f 42 55 49 4c 44 29 0d 0a 54 4d 50 5f 44 IC_BUILD)..TMP_D
7e10: 49 52 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f 44 IRFULL = $(TMP_D
7e20: 49 52 46 55 4c 4c 3a 53 74 61 74 69 63 3d 29 0d IRFULL:Static=).
7e30: 0a 53 55 46 58 09 20 20 20 20 3d 20 24 28 53 55 .SUFX. = $(SU
7e40: 46 58 3a 73 3d 29 0d 0a 45 58 54 09 20 20 20 20 FX:s=)..EXT.
7e50: 3d 20 64 6c 6c 0d 0a 54 4d 50 5f 44 49 52 46 55 = dll..TMP_DIRFU
7e60: 4c 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 LL = $(TMP_DIRFU
7e70: 4c 4c 3a 58 3d 29 0d 0a 53 55 46 58 09 20 20 20 LL:X=)..SUFX.
7e80: 20 3d 20 24 28 53 55 46 58 3a 78 3d 29 0d 0a 21 = $(SUFX:x=)..!
7e90: 65 6c 73 65 0d 0a 54 4d 50 5f 44 49 52 46 55 4c else..TMP_DIRFUL
7ea0: 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 4c L = $(TMP_DIRFUL
7eb0: 4c 3a 44 79 6e 61 6d 69 63 3d 29 0d 0a 45 58 54 L:Dynamic=)..EXT
7ec0: 09 20 20 20 20 3d 20 6c 69 62 0d 0a 21 69 66 20 . = lib..!if
7ed0: 21 24 28 4d 53 56 43 52 54 29 0d 0a 54 4d 50 5f !$(MSVCRT)..TMP_
7ee0: 44 49 52 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f DIRFULL = $(TMP_
7ef0: 44 49 52 46 55 4c 4c 3a 58 3d 29 0d 0a 53 55 46 DIRFULL:X=)..SUF
7f00: 58 09 20 20 20 20 3d 20 24 28 53 55 46 58 3a 78 X. = $(SUFX:x
7f10: 3d 29 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 =)..!endif..!end
7f20: 69 66 0d 0a 0d 0a 21 69 66 20 21 24 28 54 43 4c if....!if !$(TCL
7f30: 5f 54 48 52 45 41 44 53 29 0d 0a 54 4d 50 5f 44 _THREADS)..TMP_D
7f40: 49 52 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f 44 IRFULL = $(TMP_D
7f50: 49 52 46 55 4c 4c 3a 54 68 72 65 61 64 65 64 3d IRFULL:Threaded=
7f60: 29 0d 0a 53 55 46 58 09 20 20 20 20 3d 20 24 28 )..SUFX. = $(
7f70: 53 55 46 58 3a 74 3d 29 0d 0a 21 65 6e 64 69 66 SUFX:t=)..!endif
7f80: 0d 0a 0d 0a 21 69 66 6e 64 65 66 20 54 4d 50 5f ....!ifndef TMP_
7f90: 44 49 52 0d 0a 54 4d 50 5f 44 49 52 09 20 20 20 DIR..TMP_DIR.
7fa0: 20 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c = $(TMP_DIRFULL
7fb0: 29 0d 0a 21 69 66 6e 64 65 66 20 4f 55 54 5f 44 )..!ifndef OUT_D
7fc0: 49 52 0d 0a 4f 55 54 5f 44 49 52 09 20 20 20 20 IR..OUT_DIR.
7fd0: 3d 20 2e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f = .\$(BUILDDIRTO
7fe0: 50 29 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6c 73 P)..!endif..!els
7ff0: 65 0d 0a 21 69 66 6e 64 65 66 20 4f 55 54 5f 44 e..!ifndef OUT_D
8000: 49 52 0d 0a 4f 55 54 5f 44 49 52 09 20 20 20 20 IR..OUT_DIR.
8010: 3d 20 24 28 54 4d 50 5f 44 49 52 29 0d 0a 21 65 = $(TMP_DIR)..!e
8020: 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a ndif..!endif....
8030: 23 20 52 65 6c 61 74 69 76 65 20 70 61 74 68 73 # Relative paths
8040: 20 2d 3e 20 61 62 73 6f 6c 75 74 65 0d 0a 21 69 -> absolute..!i
8050: 66 20 5b 65 63 68 6f 20 4f 55 54 5f 44 49 52 20 f [echo OUT_DIR
8060: 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 = \> nmakehlp.ou
8070: 74 5d 20 5c 0d 0a 20 20 20 7c 7c 20 5b 6e 6d 61 t] \.. || [nma
8080: 6b 65 68 6c 70 20 2d 51 20 22 24 28 4f 55 54 5f kehlp -Q "$(OUT_
8090: 44 49 52 29 22 20 3e 3e 20 6e 6d 61 6b 65 68 6c DIR)" >> nmakehl
80a0: 70 2e 6f 75 74 5d 0d 0a 21 65 72 72 6f 72 20 2a p.out]..!error *
80b0: 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 75 6c ** Could not ful
80c0: 6c 79 20 71 75 61 6c 69 66 79 20 70 61 74 68 20 ly qualify path
80d0: 4f 55 54 5f 44 49 52 3d 24 28 4f 55 54 5f 44 49 OUT_DIR=$(OUT_DI
80e0: 52 29 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 R)..!endif..!if
80f0: 5b 65 63 68 6f 20 54 4d 50 5f 44 49 52 20 3d 20 [echo TMP_DIR =
8100: 5c 3e 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 \>> nmakehlp.out
8110: 5d 20 5c 0d 0a 20 20 20 7c 7c 20 5b 6e 6d 61 6b ] \.. || [nmak
8120: 65 68 6c 70 20 2d 51 20 22 24 28 54 4d 50 5f 44 ehlp -Q "$(TMP_D
8130: 49 52 29 22 20 3e 3e 20 6e 6d 61 6b 65 68 6c 70 IR)" >> nmakehlp
8140: 2e 6f 75 74 5d 0d 0a 21 65 72 72 6f 72 20 2a 2a .out]..!error **
8150: 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 75 6c 6c * Could not full
8160: 79 20 71 75 61 6c 69 66 79 20 70 61 74 68 20 54 y qualify path T
8170: 4d 50 5f 44 49 52 3d 24 28 54 4d 50 5f 44 49 52 MP_DIR=$(TMP_DIR
8180: 29 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 6e 63 6c )..!endif..!incl
8190: 75 64 65 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 ude nmakehlp.out
81a0: 0d 0a 0d 0a 23 20 54 68 65 20 6e 61 6d 65 20 6f ....# The name o
81b0: 66 20 74 68 65 20 73 74 75 62 73 20 6c 69 62 72 f the stubs libr
81c0: 61 72 79 20 66 6f 72 20 74 68 65 20 70 72 6f 6a ary for the proj
81d0: 65 63 74 20 62 65 69 6e 67 20 62 75 69 6c 74 0d ect being built.
81e0: 0a 53 54 55 42 50 52 45 46 49 58 20 20 20 20 20 .STUBPREFIX
81f0: 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 73 74 75 = $(PROJECT)stu
8200: 62 0d 0a 0d 0a 23 20 53 65 74 20 75 70 20 70 61 b....# Set up pa
8210: 74 68 73 20 74 6f 20 76 61 72 69 6f 75 73 20 54 ths to various T
8220: 63 6c 20 65 78 65 63 75 74 61 62 6c 65 73 20 61 cl executables a
8230: 6e 64 20 6c 69 62 72 61 72 69 65 73 20 6e 65 65 nd libraries nee
8240: 64 65 64 20 62 79 20 65 78 74 65 6e 73 69 6f 6e ded by extension
8250: 73 0d 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 s..!if $(DOING_T
8260: 43 4c 29 0d 0a 0d 0a 54 43 4c 53 48 4e 41 4d 45 CL)....TCLSHNAME
8270: 20 20 20 20 20 20 20 3d 20 24 28 50 52 4f 4a 45 = $(PROJE
8280: 43 54 29 73 68 24 28 54 43 4c 5f 56 45 52 53 49 CT)sh$(TCL_VERSI
8290: 4f 4e 29 24 28 53 55 46 58 29 2e 65 78 65 0d 0a ON)$(SUFX).exe..
82a0: 54 43 4c 53 48 09 09 3d 20 24 28 4f 55 54 5f 44 TCLSH..= $(OUT_D
82b0: 49 52 29 5c 24 28 54 43 4c 53 48 4e 41 4d 45 29 IR)\$(TCLSHNAME)
82c0: 0d 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20 24 28 ..TCLIMPLIB.= $(
82d0: 4f 55 54 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 OUT_DIR)\$(PROJE
82e0: 43 54 29 24 28 56 45 52 53 49 4f 4e 29 24 28 53 CT)$(VERSION)$(S
82f0: 55 46 58 29 2e 6c 69 62 0d 0a 54 43 4c 4c 49 42 UFX).lib..TCLLIB
8300: 4e 41 4d 45 09 3d 20 24 28 50 52 4f 4a 45 43 54 NAME.= $(PROJECT
8310: 29 24 28 56 45 52 53 49 4f 4e 29 24 28 53 55 46 )$(VERSION)$(SUF
8320: 58 29 2e 24 28 45 58 54 29 0d 0a 54 43 4c 4c 49 X).$(EXT)..TCLLI
8330: 42 09 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c B..= $(OUT_DIR)\
8340: 24 28 54 43 4c 4c 49 42 4e 41 4d 45 29 0d 0a 0d $(TCLLIBNAME)...
8350: 0a 54 43 4c 53 54 55 42 4c 49 42 4e 41 4d 45 09 .TCLSTUBLIBNAME.
8360: 3d 20 24 28 53 54 55 42 50 52 45 46 49 58 29 24 = $(STUBPREFIX)$
8370: 28 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0d 0a 54 (VERSION).lib..T
8380: 43 4c 53 54 55 42 4c 49 42 09 3d 20 24 28 4f 55 CLSTUBLIB.= $(OU
8390: 54 5f 44 49 52 29 5c 24 28 54 43 4c 53 54 55 42 T_DIR)\$(TCLSTUB
83a0: 4c 49 42 4e 41 4d 45 29 0d 0a 54 43 4c 5f 49 4e LIBNAME)..TCL_IN
83b0: 43 4c 55 44 45 53 20 20 20 20 3d 20 2d 49 22 24 CLUDES = -I"$
83c0: 28 57 49 4e 44 49 52 29 22 20 2d 49 22 24 28 47 (WINDIR)" -I"$(G
83d0: 45 4e 45 52 49 43 44 49 52 29 22 0d 0a 0d 0a 21 ENERICDIR)"....!
83e0: 65 6c 73 65 20 23 20 21 20 24 28 44 4f 49 4e 47 else # ! $(DOING
83f0: 5f 54 43 4c 29 0d 0a 0d 0a 21 69 66 20 24 28 54 _TCL)....!if $(T
8400: 43 4c 49 4e 53 54 41 4c 4c 29 20 23 20 42 75 69 CLINSTALL) # Bui
8410: 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 61 6e lding against an
8420: 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c 0d 0a installed Tcl..
8430: 0d 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e ..# When buildin
8440: 67 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 77 65 g extensions, we
8450: 20 6e 65 65 64 20 74 6f 20 6c 6f 63 61 74 65 20 need to locate
8460: 74 63 6c 73 68 2e 20 44 65 70 65 6e 64 69 6e 67 tclsh. Depending
8470: 20 6f 6e 20 76 65 72 73 69 6f 6e 0d 0a 23 20 6f on version..# o
8480: 66 20 54 63 6c 20 77 65 20 61 72 65 20 62 75 69 f Tcl we are bui
8490: 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 2c 20 74 lding against, t
84a0: 68 69 73 20 6d 61 79 20 6f 72 20 6d 61 79 20 6e his may or may n
84b0: 6f 74 20 68 61 76 65 20 61 20 22 74 22 20 73 75 ot have a "t" su
84c0: 66 66 69 78 2e 0d 0a 23 20 54 72 79 20 76 61 72 ffix...# Try var
84d0: 69 6f 75 73 20 70 6f 73 73 69 62 69 6c 69 74 69 ious possibiliti
84e0: 65 73 20 69 6e 20 74 75 72 6e 2e 0d 0a 54 43 4c es in turn...TCL
84f0: 53 48 09 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 SH..= $(_TCLDIR)
8500: 5c 62 69 6e 5c 74 63 6c 73 68 24 28 54 43 4c 5f \bin\tclsh$(TCL_
8510: 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e VERSION)$(SUFX).
8520: 65 78 65 0d 0a 21 69 66 20 21 65 78 69 73 74 28 exe..!if !exist(
8530: 22 24 28 54 43 4c 53 48 29 22 29 20 26 26 20 24 "$(TCLSH)") && $
8540: 28 54 43 4c 5f 54 48 52 45 41 44 53 29 0d 0a 54 (TCL_THREADS)..T
8550: 43 4c 53 48 20 20 20 20 20 20 20 20 20 20 20 3d CLSH =
8560: 20 24 28 5f 54 43 4c 44 49 52 29 5c 62 69 6e 5c $(_TCLDIR)\bin\
8570: 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 52 53 49 tclsh$(TCL_VERSI
8580: 4f 4e 29 74 24 28 53 55 46 58 29 2e 65 78 65 0d ON)t$(SUFX).exe.
8590: 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 21 65 78 .!endif..!if !ex
85a0: 69 73 74 28 22 24 28 54 43 4c 53 48 29 22 29 0d ist("$(TCLSH)").
85b0: 0a 54 43 4c 53 48 20 20 20 20 20 20 20 20 20 20 .TCLSH
85c0: 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 62 69 = $(_TCLDIR)\bi
85d0: 6e 5c 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 52 n\tclsh$(TCL_VER
85e0: 53 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e SION)$(SUFX:t=).
85f0: 65 78 65 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 54 exe..!endif....T
8600: 43 4c 53 54 55 42 4c 49 42 09 3d 20 24 28 5f 54 CLSTUBLIB.= $(_T
8610: 43 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c 73 74 CLDIR)\lib\tclst
8620: 75 62 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 ub$(TCL_VERSION)
8630: 2e 6c 69 62 0d 0a 54 43 4c 49 4d 50 4c 49 42 09 .lib..TCLIMPLIB.
8640: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 = $(_TCLDIR)\lib
8650: 5c 74 63 6c 24 28 54 43 4c 5f 56 45 52 53 49 4f \tcl$(TCL_VERSIO
8660: 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 0d 0a 23 N)$(SUFX).lib..#
8670: 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 65 When building e
8680: 78 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 79 20 62 xtensions, may b
8690: 65 20 6c 69 6e 6b 69 6e 67 20 61 67 61 69 6e 73 e linking agains
86a0: 74 20 54 63 6c 20 74 68 61 74 20 64 6f 65 73 20 t Tcl that does
86b0: 6e 6f 74 20 61 64 64 0d 0a 23 20 22 74 22 20 73 not add..# "t" s
86c0: 75 66 66 69 78 20 28 65 2e 67 2e 20 38 2e 35 20 uffix (e.g. 8.5
86d0: 6f 72 20 38 2e 37 29 2e 20 49 66 20 6c 69 62 20 or 8.7). If lib
86e0: 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65 63 6b 20 not found check
86f0: 66 6f 72 20 74 68 61 74 20 70 6f 73 73 69 62 69 for that possibi
8700: 6c 69 74 79 2e 0d 0a 21 69 66 20 21 65 78 69 73 lity...!if !exis
8710: 74 28 22 24 28 54 43 4c 49 4d 50 4c 49 42 29 22 t("$(TCLIMPLIB)"
8720: 29 0d 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20 24 )..TCLIMPLIB.= $
8730: 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74 63 (_TCLDIR)\lib\tc
8740: 6c 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 l$(TCL_VERSION)$
8750: 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0d 0a 21 (SUFX:t=).lib..!
8760: 65 6e 64 69 66 0d 0a 54 43 4c 5f 4c 49 42 52 41 endif..TCL_LIBRA
8770: 52 59 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c RY.= $(_TCLDIR)\
8780: 6c 69 62 0d 0a 54 43 4c 52 45 47 4c 49 42 09 3d lib..TCLREGLIB.=
8790: 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c $(_TCLDIR)\lib\
87a0: 74 63 6c 72 65 67 31 33 24 28 53 55 46 58 3a 74 tclreg13$(SUFX:t
87b0: 3d 29 2e 6c 69 62 0d 0a 54 43 4c 44 44 45 4c 49 =).lib..TCLDDELI
87c0: 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c B.= $(_TCLDIR)\l
87d0: 69 62 5c 74 63 6c 64 64 65 31 34 24 28 53 55 46 ib\tcldde14$(SUF
87e0: 58 3a 74 3d 29 2e 6c 69 62 0d 0a 54 43 4c 54 4f X:t=).lib..TCLTO
87f0: 4f 4c 53 44 49 52 09 3d 20 5c 6d 75 73 74 5c 68 OLSDIR.= \must\h
8800: 61 76 65 5c 74 63 6c 5c 73 6f 75 72 63 65 73 5c ave\tcl\sources\
8810: 74 6f 5c 62 75 69 6c 64 5c 74 68 69 73 5c 74 61 to\build\this\ta
8820: 72 67 65 74 0d 0a 54 43 4c 5f 49 4e 43 4c 55 44 rget..TCL_INCLUD
8830: 45 53 20 20 20 20 3d 20 2d 49 22 24 28 5f 54 43 ES = -I"$(_TC
8840: 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 22 0d 0a LDIR)\include"..
8850: 0d 0a 21 65 6c 73 65 20 23 20 42 75 69 6c 64 69 ..!else # Buildi
8860: 6e 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 73 ng against Tcl s
8870: 6f 75 72 63 65 73 0d 0a 0d 0a 54 43 4c 53 48 09 ources....TCLSH.
8880: 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 .= $(_TCLDIR)\wi
8890: 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 n\$(BUILDDIRTOP)
88a0: 5c 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 52 53 \tclsh$(TCL_VERS
88b0: 49 4f 4e 29 24 28 53 55 46 58 29 2e 65 78 65 0d ION)$(SUFX).exe.
88c0: 0a 21 69 66 20 21 65 78 69 73 74 28 24 28 54 43 .!if !exist($(TC
88d0: 4c 53 48 29 29 20 26 26 20 24 28 54 43 4c 5f 54 LSH)) && $(TCL_T
88e0: 48 52 45 41 44 53 29 0d 0a 54 43 4c 53 48 09 09 HREADS)..TCLSH..
88f0: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e = $(_TCLDIR)\win
8900: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c \$(BUILDDIRTOP)\
8910: 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 52 53 49 tclsh$(TCL_VERSI
8920: 4f 4e 29 74 24 28 53 55 46 58 29 2e 65 78 65 0d ON)t$(SUFX).exe.
8930: 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 21 65 78 .!endif..!if !ex
8940: 69 73 74 28 24 28 54 43 4c 53 48 29 29 0d 0a 54 ist($(TCLSH))..T
8950: 43 4c 53 48 09 09 3d 20 24 28 5f 54 43 4c 44 49 CLSH..= $(_TCLDI
8960: 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 R)\win\$(BUILDDI
8970: 52 54 4f 50 29 5c 74 63 6c 73 68 24 28 54 43 4c RTOP)\tclsh$(TCL
8980: 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 3a _VERSION)$(SUFX:
8990: 74 3d 29 2e 65 78 65 0d 0a 21 65 6e 64 69 66 0d t=).exe..!endif.
89a0: 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d 20 24 28 .TCLSTUBLIB.= $(
89b0: 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 _TCLDIR)\win\$(B
89c0: 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 73 UILDDIRTOP)\tcls
89d0: 74 75 62 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e tub$(TCL_VERSION
89e0: 29 2e 6c 69 62 0d 0a 54 43 4c 49 4d 50 4c 49 42 ).lib..TCLIMPLIB
89f0: 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 .= $(_TCLDIR)\wi
8a00: 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 n\$(BUILDDIRTOP)
8a10: 5c 74 63 6c 24 28 54 43 4c 5f 56 45 52 53 49 4f \tcl$(TCL_VERSIO
8a20: 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 0d 0a 23 N)$(SUFX).lib..#
8a30: 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 65 When building e
8a40: 78 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 79 20 62 xtensions, may b
8a50: 65 20 6c 69 6e 6b 69 6e 67 20 61 67 61 69 6e 73 e linking agains
8a60: 74 20 54 63 6c 20 74 68 61 74 20 64 6f 65 73 20 t Tcl that does
8a70: 6e 6f 74 20 61 64 64 0d 0a 23 20 22 74 22 20 73 not add..# "t" s
8a80: 75 66 66 69 78 20 28 65 2e 67 2e 20 38 2e 35 20 uffix (e.g. 8.5
8a90: 6f 72 20 38 2e 37 29 2e 20 49 66 20 6c 69 62 20 or 8.7). If lib
8aa0: 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65 63 6b 20 not found check
8ab0: 66 6f 72 20 74 68 61 74 20 70 6f 73 73 69 62 69 for that possibi
8ac0: 6c 69 74 79 2e 0d 0a 21 69 66 20 21 65 78 69 73 lity...!if !exis
8ad0: 74 28 22 24 28 54 43 4c 49 4d 50 4c 49 42 29 22 t("$(TCLIMPLIB)"
8ae0: 29 0d 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20 24 )..TCLIMPLIB.= $
8af0: 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 (_TCLDIR)\win\$(
8b00: 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c BUILDDIRTOP)\tcl
8b10: 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 $(TCL_VERSION)$(
8b20: 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0d 0a 21 65 SUFX:t=).lib..!e
8b30: 6e 64 69 66 0d 0a 54 43 4c 5f 4c 49 42 52 41 52 ndif..TCL_LIBRAR
8b40: 59 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c Y.= $(_TCLDIR)\l
8b50: 69 62 72 61 72 79 0d 0a 54 43 4c 52 45 47 4c 49 ibrary..TCLREGLI
8b60: 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 B.= $(_TCLDIR)\w
8b70: 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 in\$(BUILDDIRTOP
8b80: 29 5c 74 63 6c 72 65 67 31 33 24 28 53 55 46 58 )\tclreg13$(SUFX
8b90: 3a 74 3d 29 2e 6c 69 62 0d 0a 54 43 4c 44 44 45 :t=).lib..TCLDDE
8ba0: 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 LIB.= $(_TCLDIR)
8bb0: 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 \win\$(BUILDDIRT
8bc0: 4f 50 29 5c 74 63 6c 64 64 65 31 34 24 28 53 55 OP)\tcldde14$(SU
8bd0: 46 58 3a 74 3d 29 2e 6c 69 62 0d 0a 54 43 4c 54 FX:t=).lib..TCLT
8be0: 4f 4f 4c 53 44 49 52 09 3d 20 24 28 5f 54 43 4c OOLSDIR.= $(_TCL
8bf0: 44 49 52 29 5c 74 6f 6f 6c 73 0d 0a 54 43 4c 5f DIR)\tools..TCL_
8c00: 49 4e 43 4c 55 44 45 53 09 3d 20 2d 49 22 24 28 INCLUDES.= -I"$(
8c10: 5f 54 43 4c 44 49 52 29 5c 67 65 6e 65 72 69 63 _TCLDIR)\generic
8c20: 22 20 2d 49 22 24 28 5f 54 43 4c 44 49 52 29 5c " -I"$(_TCLDIR)\
8c30: 77 69 6e 22 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 win"....!endif #
8c40: 20 54 43 4c 49 4e 53 54 41 4c 4c 0d 0a 0d 0a 74 TCLINSTALL....t
8c50: 63 6c 6c 69 62 73 20 3d 20 22 24 28 54 43 4c 53 cllibs = "$(TCLS
8c60: 54 55 42 4c 49 42 29 22 20 22 24 28 54 43 4c 49 TUBLIB)" "$(TCLI
8c70: 4d 50 4c 49 42 29 22 0d 0a 0d 0a 21 65 6e 64 69 MPLIB)"....!endi
8c80: 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 f # $(DOING_TCL)
8c90: 0d 0a 0d 0a 23 20 57 65 20 6e 65 65 64 20 61 20 ....# We need a
8ca0: 74 63 6c 73 68 20 74 68 61 74 20 77 69 6c 6c 20 tclsh that will
8cb0: 72 75 6e 20 6f 6e 20 74 68 65 20 68 6f 73 74 20 run on the host
8cc0: 6d 61 63 68 69 6e 65 20 61 73 20 70 61 72 74 20 machine as part
8cd0: 6f 66 20 74 68 65 20 62 75 69 6c 64 2e 0d 0a 23 of the build...#
8ce0: 20 49 58 38 36 20 72 75 6e 73 20 6f 6e 20 61 6c IX86 runs on al
8cf0: 6c 20 61 72 63 68 69 74 65 63 74 75 72 65 73 2e l architectures.
8d00: 0d 0a 21 69 66 6e 64 65 66 20 54 43 4c 53 48 5f ..!ifndef TCLSH_
8d10: 4e 41 54 49 56 45 0d 0a 21 69 66 20 22 24 28 4d NATIVE..!if "$(M
8d20: 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 49 58 38 ACHINE)" == "IX8
8d30: 36 22 20 7c 7c 20 22 24 28 4d 41 43 48 49 4e 45 6" || "$(MACHINE
8d40: 29 22 20 3d 3d 20 22 24 28 4e 41 54 49 56 45 5f )" == "$(NATIVE_
8d50: 41 52 43 48 29 22 0d 0a 54 43 4c 53 48 5f 4e 41 ARCH)"..TCLSH_NA
8d60: 54 49 56 45 09 3d 20 24 28 54 43 4c 53 48 29 0d TIVE.= $(TCLSH).
8d70: 0a 21 65 6c 73 65 0d 0a 21 65 72 72 6f 72 20 59 .!else..!error Y
8d80: 6f 75 20 6d 75 73 74 20 65 78 70 6c 69 63 69 74 ou must explicit
8d90: 6c 79 20 73 65 74 20 54 43 4c 53 48 5f 4e 41 54 ly set TCLSH_NAT
8da0: 49 56 45 20 66 6f 72 20 63 72 6f 73 73 2d 63 6f IVE for cross-co
8db0: 6d 70 69 6c 61 74 69 6f 6e 0d 0a 21 65 6e 64 69 mpilation..!endi
8dc0: 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 44 f..!endif....# D
8dd0: 6f 20 74 68 65 20 73 61 6d 65 20 66 6f 72 20 54 o the same for T
8de0: 6b 20 61 6e 64 20 54 6b 20 65 78 74 65 6e 73 69 k and Tk extensi
8df0: 6f 6e 73 20 74 68 61 74 20 72 65 71 75 69 72 65 ons that require
8e00: 20 74 68 65 20 54 6b 20 6c 69 62 72 61 72 69 65 the Tk librarie
8e10: 73 0d 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 s..!if $(DOING_T
8e20: 4b 29 20 7c 7c 20 24 28 4e 45 45 44 5f 54 4b 29 K) || $(NEED_TK)
8e30: 0d 0a 57 49 53 48 4e 41 4d 45 50 52 45 46 49 58 ..WISHNAMEPREFIX
8e40: 20 3d 20 77 69 73 68 0d 0a 57 49 53 48 4e 41 4d = wish..WISHNAM
8e50: 45 20 3d 20 24 28 57 49 53 48 4e 41 4d 45 50 52 E = $(WISHNAMEPR
8e60: 45 46 49 58 29 24 28 54 4b 5f 56 45 52 53 49 4f EFIX)$(TK_VERSIO
8e70: 4e 29 24 28 53 55 46 58 29 2e 65 78 65 0d 0a 54 N)$(SUFX).exe..T
8e80: 4b 4c 49 42 4e 41 4d 45 09 3d 20 24 28 50 52 4f KLIBNAME.= $(PRO
8e90: 4a 45 43 54 29 24 28 54 4b 5f 56 45 52 53 49 4f JECT)$(TK_VERSIO
8ea0: 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58 54 29 N)$(SUFX).$(EXT)
8eb0: 0d 0a 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45 09 ..TKSTUBLIBNAME.
8ec0: 3d 20 74 6b 73 74 75 62 24 28 54 4b 5f 56 45 52 = tkstub$(TK_VER
8ed0: 53 49 4f 4e 29 2e 6c 69 62 0d 0a 54 4b 49 4d 50 SION).lib..TKIMP
8ee0: 4c 49 42 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b LIBNAME.= tk$(TK
8ef0: 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 _VERSION)$(SUFX)
8f00: 2e 6c 69 62 0d 0a 0d 0a 21 69 66 20 24 28 44 4f .lib....!if $(DO
8f10: 49 4e 47 5f 54 4b 29 0d 0a 57 49 53 48 20 09 09 ING_TK)..WISH ..
8f20: 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 57 = $(OUT_DIR)\$(W
8f30: 49 53 48 4e 41 4d 45 29 0d 0a 54 4b 53 54 55 42 ISHNAME)..TKSTUB
8f40: 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 LIB.= $(OUT_DIR)
8f50: 5c 24 28 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45 \$(TKSTUBLIBNAME
8f60: 29 0d 0a 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 )..TKIMPLIB.= $(
8f70: 4f 55 54 5f 44 49 52 29 5c 24 28 54 4b 49 4d 50 OUT_DIR)\$(TKIMP
8f80: 4c 49 42 4e 41 4d 45 29 0d 0a 54 4b 4c 49 42 09 LIBNAME)..TKLIB.
8f90: 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 .= $(OUT_DIR)\$(
8fa0: 54 4b 4c 49 42 4e 41 4d 45 29 0d 0a 54 4b 5f 49 TKLIBNAME)..TK_I
8fb0: 4e 43 4c 55 44 45 53 20 20 20 20 3d 20 2d 49 22 NCLUDES = -I"
8fc0: 24 28 57 49 4e 44 49 52 29 22 20 2d 49 22 24 28 $(WINDIR)" -I"$(
8fd0: 47 45 4e 45 52 49 43 44 49 52 29 22 0d 0a 0d 0a GENERICDIR)"....
8fe0: 21 65 6c 73 65 20 23 20 65 66 66 65 63 74 69 76 !else # effectiv
8ff0: 65 6c 79 20 4e 45 45 44 5f 54 4b 0d 0a 0d 0a 21 ely NEED_TK....!
9000: 69 66 20 24 28 54 4b 49 4e 53 54 41 4c 4c 29 20 if $(TKINSTALL)
9010: 23 20 42 75 69 6c 64 69 6e 67 20 61 67 61 69 6e # Building again
9020: 73 74 20 69 6e 73 74 61 6c 6c 65 64 20 54 6b 0d st installed Tk.
9030: 0a 57 49 53 48 09 09 3d 20 24 28 5f 54 4b 44 49 .WISH..= $(_TKDI
9040: 52 29 5c 62 69 6e 5c 24 28 57 49 53 48 4e 41 4d R)\bin\$(WISHNAM
9050: 45 29 0d 0a 54 4b 53 54 55 42 4c 49 42 09 3d 20 E)..TKSTUBLIB.=
9060: 24 28 5f 54 4b 44 49 52 29 5c 6c 69 62 5c 24 28 $(_TKDIR)\lib\$(
9070: 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45 29 0d 0a TKSTUBLIBNAME)..
9080: 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 4b TKIMPLIB.= $(_TK
9090: 44 49 52 29 5c 6c 69 62 5c 24 28 54 4b 49 4d 50 DIR)\lib\$(TKIMP
90a0: 4c 49 42 4e 41 4d 45 29 0d 0a 23 20 57 68 65 6e LIBNAME)..# When
90b0: 20 62 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73 building extens
90c0: 69 6f 6e 73 2c 20 6d 61 79 20 62 65 20 6c 69 6e ions, may be lin
90d0: 6b 69 6e 67 20 61 67 61 69 6e 73 74 20 54 6b 20 king against Tk
90e0: 74 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 61 64 that does not ad
90f0: 64 0d 0a 23 20 22 74 22 20 73 75 66 66 69 78 20 d..# "t" suffix
9100: 28 65 2e 67 2e 20 38 2e 35 20 6f 72 20 38 2e 37 (e.g. 8.5 or 8.7
9110: 29 2e 20 49 66 20 6c 69 62 20 6e 6f 74 20 66 6f ). If lib not fo
9120: 75 6e 64 20 63 68 65 63 6b 20 66 6f 72 20 74 68 und check for th
9130: 61 74 20 70 6f 73 73 69 62 69 6c 69 74 79 2e 0d at possibility..
9140: 0a 21 69 66 20 21 65 78 69 73 74 28 22 24 28 54 .!if !exist("$(T
9150: 4b 49 4d 50 4c 49 42 29 22 29 0d 0a 54 4b 49 4d KIMPLIB)")..TKIM
9160: 50 4c 49 42 4e 41 4d 45 09 3d 20 74 6b 24 28 54 PLIBNAME.= tk$(T
9170: 4b 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 K_VERSION)$(SUFX
9180: 3a 74 3d 29 2e 6c 69 62 0d 0a 54 4b 49 4d 50 4c :t=).lib..TKIMPL
9190: 49 42 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c 6c IB.= $(_TKDIR)\l
91a0: 69 62 5c 24 28 54 4b 49 4d 50 4c 49 42 4e 41 4d ib\$(TKIMPLIBNAM
91b0: 45 29 0d 0a 21 65 6e 64 69 66 0d 0a 54 4b 5f 49 E)..!endif..TK_I
91c0: 4e 43 4c 55 44 45 53 20 20 20 20 20 3d 20 2d 49 NCLUDES = -I
91d0: 22 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75 "$(_TKDIR)\inclu
91e0: 64 65 22 0d 0a 21 65 6c 73 65 20 23 20 42 75 69 de"..!else # Bui
91f0: 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54 6b lding against Tk
9200: 20 73 6f 75 72 63 65 73 0d 0a 57 49 53 48 09 09 sources..WISH..
9210: 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77 69 6e 5c = $(_TKDIR)\win\
9220: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 24 $(BUILDDIRTOP)\$
9230: 28 57 49 53 48 4e 41 4d 45 29 0d 0a 54 4b 53 54 (WISHNAME)..TKST
9240: 55 42 4c 49 42 09 3d 20 24 28 5f 54 4b 44 49 52 UBLIB.= $(_TKDIR
9250: 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 )\win\$(BUILDDIR
9260: 54 4f 50 29 5c 24 28 54 4b 53 54 55 42 4c 49 42 TOP)\$(TKSTUBLIB
9270: 4e 41 4d 45 29 0d 0a 54 4b 49 4d 50 4c 49 42 09 NAME)..TKIMPLIB.
9280: 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77 69 6e 5c = $(_TKDIR)\win\
9290: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 24 $(BUILDDIRTOP)\$
92a0: 28 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0d 0a (TKIMPLIBNAME)..
92b0: 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 # When building
92c0: 65 78 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 79 20 extensions, may
92d0: 62 65 20 6c 69 6e 6b 69 6e 67 20 61 67 61 69 6e be linking again
92e0: 73 74 20 54 6b 20 74 68 61 74 20 64 6f 65 73 20 st Tk that does
92f0: 6e 6f 74 20 61 64 64 0d 0a 23 20 22 74 22 20 73 not add..# "t" s
9300: 75 66 66 69 78 20 28 65 2e 67 2e 20 38 2e 35 20 uffix (e.g. 8.5
9310: 6f 72 20 38 2e 37 29 2e 20 49 66 20 6c 69 62 20 or 8.7). If lib
9320: 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65 63 6b 20 not found check
9330: 66 6f 72 20 74 68 61 74 20 70 6f 73 73 69 62 69 for that possibi
9340: 6c 69 74 79 2e 0d 0a 21 69 66 20 21 65 78 69 73 lity...!if !exis
9350: 74 28 22 24 28 54 4b 49 4d 50 4c 49 42 29 22 29 t("$(TKIMPLIB)")
9360: 0d 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 09 3d ..TKIMPLIBNAME.=
9370: 20 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f 4e 29 tk$(TK_VERSION)
9380: 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0d 0a $(SUFX:t=).lib..
9390: 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 4b TKIMPLIB.= $(_TK
93a0: 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 DIR)\win\$(BUILD
93b0: 44 49 52 54 4f 50 29 5c 24 28 54 4b 49 4d 50 4c DIRTOP)\$(TKIMPL
93c0: 49 42 4e 41 4d 45 29 0d 0a 21 65 6e 64 69 66 0d IBNAME)..!endif.
93d0: 0a 54 4b 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 .TK_INCLUDES
93e0: 20 3d 20 2d 49 22 24 28 5f 54 4b 44 49 52 29 5c = -I"$(_TKDIR)\
93f0: 67 65 6e 65 72 69 63 22 20 2d 49 22 24 28 5f 54 generic" -I"$(_T
9400: 4b 44 49 52 29 5c 77 69 6e 22 20 2d 49 22 24 28 KDIR)\win" -I"$(
9410: 5f 54 4b 44 49 52 29 5c 78 6c 69 62 22 0d 0a 21 _TKDIR)\xlib"..!
9420: 65 6e 64 69 66 20 23 20 54 4b 49 4e 53 54 41 4c endif # TKINSTAL
9430: 4c 0d 0a 74 6b 6c 69 62 73 20 3d 20 22 24 28 54 L..tklibs = "$(T
9440: 4b 53 54 55 42 4c 49 42 29 22 20 22 24 28 54 4b KSTUBLIB)" "$(TK
9450: 49 4d 50 4c 49 42 29 22 0d 0a 0d 0a 21 65 6e 64 IMPLIB)"....!end
9460: 69 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 4b 29 if # $(DOING_TK)
9470: 0d 0a 21 65 6e 64 69 66 20 23 20 24 28 44 4f 49 ..!endif # $(DOI
9480: 4e 47 5f 54 4b 29 20 7c 7c 20 24 28 4e 45 45 44 NG_TK) || $(NEED
9490: 5f 54 4b 29 0d 0a 0d 0a 23 20 56 61 72 69 6f 75 _TK)....# Variou
94a0: 73 20 6f 75 74 70 75 74 20 70 61 74 68 73 0d 0a s output paths..
94b0: 50 52 4a 49 4d 50 4c 49 42 09 3d 20 24 28 4f 55 PRJIMPLIB.= $(OU
94c0: 54 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 T_DIR)\$(PROJECT
94d0: 29 24 28 56 45 52 53 49 4f 4e 29 24 28 53 55 46 )$(VERSION)$(SUF
94e0: 58 29 2e 6c 69 62 0d 0a 50 52 4a 4c 49 42 4e 41 X).lib..PRJLIBNA
94f0: 4d 45 09 3d 20 24 28 50 52 4f 4a 45 43 54 29 24 ME.= $(PROJECT)$
9500: 28 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 (VERSION)$(SUFX)
9510: 2e 24 28 45 58 54 29 0d 0a 50 52 4a 4c 49 42 09 .$(EXT)..PRJLIB.
9520: 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 .= $(OUT_DIR)\$(
9530: 50 52 4a 4c 49 42 4e 41 4d 45 29 0d 0a 0d 0a 50 PRJLIBNAME)....P
9540: 52 4a 53 54 55 42 4c 49 42 4e 41 4d 45 09 3d 20 RJSTUBLIBNAME.=
9550: 24 28 53 54 55 42 50 52 45 46 49 58 29 24 28 56 $(STUBPREFIX)$(V
9560: 45 52 53 49 4f 4e 29 2e 6c 69 62 0d 0a 50 52 4a ERSION).lib..PRJ
9570: 53 54 55 42 4c 49 42 09 3d 20 24 28 4f 55 54 5f STUBLIB.= $(OUT_
9580: 44 49 52 29 5c 24 28 50 52 4a 53 54 55 42 4c 49 DIR)\$(PRJSTUBLI
9590: 42 4e 41 4d 45 29 0d 0a 0d 0a 23 20 49 66 20 65 BNAME)....# If e
95a0: 78 74 65 6e 73 69 6f 6e 20 70 61 72 65 6e 74 20 xtension parent
95b0: 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 6e 6f 74 makefile has not
95c0: 20 64 65 66 69 6e 65 64 20 61 20 72 65 73 6f 75 defined a resou
95d0: 72 63 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 66 rce definition f
95e0: 69 6c 65 2c 0d 0a 23 20 77 65 20 77 69 6c 6c 20 ile,..# we will
95f0: 67 65 6e 65 72 61 74 65 20 6f 6e 65 20 66 72 6f generate one fro
9600: 6d 20 73 74 61 6e 64 61 72 64 20 74 65 6d 70 6c m standard templ
9610: 61 74 65 2e 0d 0a 21 69 66 20 21 24 28 44 4f 49 ate...!if !$(DOI
9620: 4e 47 5f 54 43 4c 29 20 26 26 20 21 24 28 44 4f NG_TCL) && !$(DO
9630: 49 4e 47 5f 54 4b 29 20 26 26 20 21 24 28 53 54 ING_TK) && !$(ST
9640: 41 54 49 43 5f 42 55 49 4c 44 29 0d 0a 21 69 66 ATIC_BUILD)..!if
9650: 64 65 66 20 52 43 46 49 4c 45 0d 0a 52 45 53 46 def RCFILE..RESF
9660: 49 4c 45 20 3d 20 24 28 54 4d 50 5f 44 49 52 29 ILE = $(TMP_DIR)
9670: 5c 24 28 52 43 46 49 4c 45 3a 2e 72 63 3d 2e 72 \$(RCFILE:.rc=.r
9680: 65 73 29 0d 0a 21 65 6c 73 65 0d 0a 52 45 53 46 es)..!else..RESF
9690: 49 4c 45 20 3d 20 24 28 54 4d 50 5f 44 49 52 29 ILE = $(TMP_DIR)
96a0: 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 65 73 0d \$(PROJECT).res.
96b0: 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d .!endif..!endif.
96c0: 0a 0d 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 ...#############
96d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
96e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
96f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
9700: 23 23 23 23 23 23 0d 0a 23 20 31 31 2e 20 43 6f ######..# 11. Co
9710: 6e 73 74 72 75 63 74 20 74 68 65 20 70 61 74 68 nstruct the path
9720: 73 20 66 6f 72 20 74 68 65 20 69 6e 73 74 61 6c s for the instal
9730: 6c 61 74 69 6f 6e 20 64 69 72 65 63 74 6f 72 69 lation directori
9740: 65 73 0d 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77 es..# The follow
9750: 69 6e 67 20 6d 61 63 72 6f 73 20 67 65 74 20 64 ing macros get d
9760: 65 66 69 6e 65 64 20 69 6e 20 74 68 69 73 20 73 efined in this s
9770: 65 63 74 69 6f 6e 3a 0d 0a 23 20 4c 49 42 5f 49 ection:..# LIB_I
9780: 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 NSTALL_DIR - whe
9790: 72 65 20 6c 69 62 72 61 72 69 65 73 20 73 68 6f re libraries sho
97a0: 75 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 uld be installed
97b0: 0d 0a 23 20 42 49 4e 5f 49 4e 53 54 41 4c 4c 5f ..# BIN_INSTALL_
97c0: 44 49 52 20 2d 20 77 68 65 72 65 20 74 68 65 20 DIR - where the
97d0: 65 78 65 63 75 74 61 62 6c 65 73 20 73 68 6f 75 executables shou
97e0: 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0d ld be installed.
97f0: 0a 23 20 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 .# DOC_INSTALL_D
9800: 49 52 20 2d 20 77 68 65 72 65 20 64 6f 63 75 6d IR - where docum
9810: 65 6e 74 61 74 69 6f 6e 20 73 68 6f 75 6c 64 20 entation should
9820: 62 65 20 69 6e 73 74 61 6c 6c 65 64 0d 0a 23 20 be installed..#
9830: 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 SCRIPT_INSTALL_D
9840: 49 52 20 2d 20 77 68 65 72 65 20 73 63 72 69 70 IR - where scrip
9850: 74 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 73 ts should be ins
9860: 74 61 6c 6c 65 64 0d 0a 23 20 49 4e 43 4c 55 44 talled..# INCLUD
9870: 45 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20 E_INSTALL_DIR -
9880: 77 68 65 72 65 20 43 20 69 6e 63 6c 75 64 65 20 where C include
9890: 66 69 6c 65 73 20 73 68 6f 75 6c 64 20 62 65 20 files should be
98a0: 69 6e 73 74 61 6c 6c 65 64 0d 0a 23 20 44 45 4d installed..# DEM
98b0: 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20 O_INSTALL_DIR -
98c0: 77 68 65 72 65 20 64 65 6d 6f 73 20 73 68 6f 75 where demos shou
98d0: 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0d ld be installed.
98e0: 0a 23 20 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 .# PRJ_INSTALL_D
98f0: 49 52 20 2d 20 77 68 65 72 65 20 70 61 63 6b 61 IR - where packa
9900: 67 65 20 77 69 6c 6c 20 62 65 20 69 6e 73 74 61 ge will be insta
9910: 6c 6c 65 64 20 28 6e 6f 74 20 73 65 74 20 66 6f lled (not set fo
9920: 72 20 54 63 6c 20 61 6e 64 20 54 6b 29 0d 0a 0d r Tcl and Tk)...
9930: 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c .!if $(DOING_TCL
9940: 29 20 7c 7c 20 24 28 44 4f 49 4e 47 5f 54 4b 29 ) || $(DOING_TK)
9950: 0d 0a 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 ..LIB_INSTALL_DI
9960: 52 09 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 R..= $(_INSTALLD
9970: 49 52 29 5c 6c 69 62 0d 0a 42 49 4e 5f 49 4e 53 IR)\lib..BIN_INS
9980: 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 5f 49 TALL_DIR..= $(_I
9990: 4e 53 54 41 4c 4c 44 49 52 29 5c 62 69 6e 0d 0a NSTALLDIR)\bin..
99a0: 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 DOC_INSTALL_DIR.
99b0: 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 .= $(_INSTALLDIR
99c0: 29 5c 64 6f 63 0d 0a 21 69 66 20 24 28 44 4f 49 )\doc..!if $(DOI
99d0: 4e 47 5f 54 43 4c 29 0d 0a 53 43 52 49 50 54 5f NG_TCL)..SCRIPT_
99e0: 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 INSTALL_DIR.= $(
99f0: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 _INSTALLDIR)\lib
9a00: 5c 24 28 50 52 4f 4a 45 43 54 29 24 28 54 43 4c \$(PROJECT)$(TCL
9a10: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e _MAJOR_VERSION).
9a20: 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 $(TCL_MINOR_VERS
9a30: 49 4f 4e 29 0d 0a 21 65 6c 73 65 20 23 20 44 4f ION)..!else # DO
9a40: 49 4e 47 5f 54 4b 0d 0a 53 43 52 49 50 54 5f 49 ING_TK..SCRIPT_I
9a50: 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 5f NSTALL_DIR.= $(_
9a60: 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 5c INSTALLDIR)\lib\
9a70: 24 28 50 52 4f 4a 45 43 54 29 24 28 54 4b 5f 4d $(PROJECT)$(TK_M
9a80: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28 AJOR_VERSION).$(
9a90: 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e TK_MINOR_VERSION
9aa0: 29 0d 0a 21 65 6e 64 69 66 0d 0a 44 45 4d 4f 5f )..!endif..DEMO_
9ab0: 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 INSTALL_DIR.= $(
9ac0: 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 SCRIPT_INSTALL_D
9ad0: 49 52 29 5c 64 65 6d 6f 73 0d 0a 49 4e 43 4c 55 IR)\demos..INCLU
9ae0: 44 45 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d DE_INSTALL_DIR.=
9af0: 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c $(_INSTALLDIR)\
9b00: 69 6e 63 6c 75 64 65 0d 0a 0d 0a 21 65 6c 73 65 include....!else
9b10: 20 23 20 65 78 74 65 6e 73 69 6f 6e 20 6f 74 68 # extension oth
9b20: 65 72 20 74 68 61 6e 20 54 6b 0d 0a 0d 0a 50 52 er than Tk....PR
9b30: 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 20 20 J_INSTALL_DIR
9b40: 20 20 20 20 20 20 3d 20 24 28 5f 49 4e 53 54 41 = $(_INSTA
9b50: 4c 4c 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 LLDIR)\$(PROJECT
9b60: 29 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 0d 0a )$(DOTVERSION)..
9b70: 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 LIB_INSTALL_DIR.
9b80: 09 3d 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c .= $(PRJ_INSTALL
9b90: 5f 44 49 52 29 0d 0a 42 49 4e 5f 49 4e 53 54 41 _DIR)..BIN_INSTA
9ba0: 4c 4c 5f 44 49 52 09 09 3d 20 24 28 50 52 4a 5f LL_DIR..= $(PRJ_
9bb0: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0d 0a 44 4f INSTALL_DIR)..DO
9bc0: 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d C_INSTALL_DIR..=
9bd0: 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 $(PRJ_INSTALL_D
9be0: 49 52 29 0d 0a 53 43 52 49 50 54 5f 49 4e 53 54 IR)..SCRIPT_INST
9bf0: 41 4c 4c 5f 44 49 52 09 3d 20 24 28 50 52 4a 5f ALL_DIR.= $(PRJ_
9c00: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0d 0a 44 45 INSTALL_DIR)..DE
9c10: 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d MO_INSTALL_DIR.=
9c20: 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 $(PRJ_INSTALL_D
9c30: 49 52 29 5c 64 65 6d 6f 73 0d 0a 49 4e 43 4c 55 IR)\demos..INCLU
9c40: 44 45 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d DE_INSTALL_DIR.=
9c50: 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e 63 6c $(_TCLDIR)\incl
9c60: 75 64 65 0d 0a 0d 0a 21 65 6e 64 69 66 0d 0a 0d ude....!endif...
9c70: 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 .###############
9c80: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
9c90: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
9ca0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
9cb0: 23 23 23 23 0d 0a 23 20 31 32 2e 20 53 65 74 20 ####..# 12. Set
9cc0: 75 70 20 61 63 74 75 61 6c 20 6f 70 74 69 6f 6e up actual option
9cd0: 73 20 74 6f 20 62 65 20 70 61 73 73 65 64 20 74 s to be passed t
9ce0: 6f 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61 o the compiler a
9cf0: 6e 64 20 6c 69 6e 6b 65 72 0d 0a 23 20 4e 6f 77 nd linker..# Now
9d00: 20 77 65 20 68 61 76 65 20 61 6c 6c 20 74 68 65 we have all the
9d10: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 77 65 20 information we
9d20: 6e 65 65 64 2c 20 73 65 74 20 75 70 20 74 68 65 need, set up the
9d30: 20 61 63 74 75 61 6c 20 66 6c 61 67 73 20 61 6e actual flags an
9d40: 64 0d 0a 23 20 6f 70 74 69 6f 6e 73 20 74 68 61 d..# options tha
9d50: 74 20 77 65 20 77 69 6c 6c 20 70 61 73 73 20 74 t we will pass t
9d60: 6f 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61 o the compiler a
9d70: 6e 64 20 6c 69 6e 6b 65 72 2e 20 54 68 65 20 6d nd linker. The m
9d80: 61 69 6e 0d 0a 23 20 6d 61 6b 65 66 69 6c 65 20 ain..# makefile
9d90: 73 68 6f 75 6c 64 20 75 73 65 20 74 68 65 73 65 should use these
9da0: 20 69 6e 20 63 6f 6d 62 69 6e 61 74 69 6f 6e 20 in combination
9db0: 77 69 74 68 20 77 68 61 74 65 76 65 72 20 6f 74 with whatever ot
9dc0: 68 65 72 20 66 6c 61 67 73 0d 0a 23 20 61 6e 64 her flags..# and
9dd0: 20 73 77 69 74 63 68 65 73 20 61 72 65 20 73 70 switches are sp
9de0: 65 63 69 66 69 63 20 74 6f 20 69 74 2e 0d 0a 23 ecific to it...#
9df0: 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d The following m
9e00: 61 63 72 6f 73 20 61 72 65 20 64 65 66 69 6e 65 acros are define
9e10: 64 2c 20 6e 61 6d 65 73 20 61 72 65 20 66 6f 72 d, names are for
9e20: 20 68 69 73 74 6f 72 69 63 61 6c 20 63 6f 6d 70 historical comp
9e30: 61 74 69 62 69 6c 69 74 79 3a 0d 0a 23 20 4f 50 atibility:..# OP
9e40: 54 44 45 46 49 4e 45 53 20 2d 20 2f 44 78 78 78 TDEFINES - /Dxxx
9e50: 20 43 20 6d 61 63 72 6f 20 66 6c 61 67 73 20 62 C macro flags b
9e60: 61 73 65 64 20 6f 6e 20 75 73 65 72 2d 73 70 65 ased on user-spe
9e70: 63 69 66 69 65 64 20 4f 50 54 53 0d 0a 23 20 43 cified OPTS..# C
9e80: 4f 4d 50 49 4c 45 52 46 4c 41 47 53 20 2d 20 2f OMPILERFLAGS - /
9e90: 44 78 78 78 20 43 20 6d 61 63 72 6f 20 66 6c 61 Dxxx C macro fla
9ea0: 67 73 20 69 6e 64 65 70 65 6e 64 65 6e 74 20 6f gs independent o
9eb0: 66 20 61 6e 79 20 63 6f 6e 66 69 67 75 72 61 74 f any configurat
9ec0: 69 6f 6e 20 6f 70 74 74 69 6f 6e 73 0d 0a 23 20 ion opttions..#
9ed0: 63 72 74 20 2d 20 43 6f 6d 70 69 6c 65 72 20 73 crt - Compiler s
9ee0: 77 69 74 63 68 20 74 68 61 74 20 73 65 6c 65 63 witch that selec
9ef0: 74 73 20 74 68 65 20 61 70 70 72 6f 70 72 69 61 ts the appropria
9f00: 74 65 20 43 20 72 75 6e 74 69 6d 65 0d 0a 23 20 te C runtime..#
9f10: 63 64 65 62 75 67 20 2d 20 43 6f 6d 70 69 6c 65 cdebug - Compile
9f20: 72 20 73 77 69 74 63 68 65 73 20 72 65 6c 61 74 r switches relat
9f30: 65 64 20 74 6f 20 64 65 62 75 67 20 41 4e 44 20 ed to debug AND
9f40: 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 73 0d 0a 23 optimizations..#
9f50: 20 63 77 61 72 6e 20 2d 20 43 6f 6d 70 69 6c 65 cwarn - Compile
9f60: 72 20 73 77 69 74 63 68 65 73 20 74 68 61 74 20 r switches that
9f70: 73 65 74 20 77 61 72 6e 69 6e 67 20 6c 65 76 65 set warning leve
9f80: 6c 73 0d 0a 23 20 63 66 6c 61 67 73 20 2d 20 63 ls..# cflags - c
9f90: 6f 6d 70 6c 65 74 65 20 63 6f 6d 70 69 6c 65 72 omplete compiler
9fa0: 20 73 77 69 74 63 68 65 73 20 28 73 75 62 73 75 switches (subsu
9fb0: 6d 65 73 20 63 64 65 62 75 67 20 61 6e 64 20 63 mes cdebug and c
9fc0: 77 61 72 6e 29 0d 0a 23 20 6c 64 65 62 75 67 20 warn)..# ldebug
9fd0: 2d 20 4c 69 6e 6b 65 72 20 73 77 69 74 63 68 65 - Linker switche
9fe0: 73 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 20 64 65 s controlling de
9ff0: 62 75 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 bug information
a000: 61 6e 64 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e and optimization
a010: 0d 0a 23 20 6c 66 6c 61 67 73 20 2d 20 63 6f 6d ..# lflags - com
a020: 70 6c 65 74 65 20 6c 69 6e 6b 65 72 20 73 77 69 plete linker swi
a030: 74 63 68 65 73 20 28 73 75 62 73 75 6d 65 73 20 tches (subsumes
a040: 6c 64 65 62 75 67 29 20 65 78 63 65 70 74 20 73 ldebug) except s
a050: 75 62 73 79 73 74 65 6d 20 74 79 70 65 0d 0a 23 ubsystem type..#
a060: 20 64 6c 6c 6c 66 6c 61 67 73 20 2d 20 63 6f 6d dlllflags - com
a070: 70 6c 65 74 65 20 6c 69 6e 6b 65 72 20 73 77 69 plete linker swi
a080: 74 63 68 65 73 20 74 6f 20 62 75 69 6c 64 20 44 tches to build D
a090: 4c 4c 73 20 28 73 75 62 73 75 6d 65 73 20 6c 66 LLs (subsumes lf
a0a0: 6c 61 67 73 29 0d 0a 23 20 63 6f 6e 6c 66 6c 61 lags)..# conlfla
a0b0: 67 73 20 2d 20 63 6f 6d 70 6c 65 74 65 20 6c 69 gs - complete li
a0c0: 6e 6b 65 72 20 73 77 69 74 63 68 65 73 20 66 6f nker switches fo
a0d0: 72 20 63 6f 6e 73 6f 6c 65 20 70 72 6f 67 72 61 r console progra
a0e0: 6d 20 28 73 75 62 73 75 6d 65 73 20 6c 66 6c 61 m (subsumes lfla
a0f0: 67 73 29 0d 0a 23 20 67 75 69 6c 66 6c 61 67 73 gs)..# guilflags
a100: 20 2d 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e 6b - complete link
a110: 65 72 20 73 77 69 74 63 68 65 73 20 66 6f 72 20 er switches for
a120: 47 55 49 20 70 72 6f 67 72 61 6d 20 28 73 75 62 GUI program (sub
a130: 73 75 6d 65 73 20 6c 66 6c 61 67 73 29 0d 0a 23 sumes lflags)..#
a140: 20 62 61 73 65 6c 69 62 73 20 2d 20 6d 69 6e 69 baselibs - mini
a150: 6d 75 6d 20 57 69 6e 64 6f 77 73 20 6c 69 62 72 mum Windows libr
a160: 61 72 69 65 73 20 72 65 71 75 69 72 65 64 2e 20 aries required.
a170: 50 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 Parent makefile
a180: 63 61 6e 0d 0a 23 20 20 20 20 64 65 66 69 6e 65 can..# define
a190: 20 50 52 4a 5f 4c 49 42 53 20 62 65 66 6f 72 65 PRJ_LIBS before
a1a0: 20 69 6e 63 6c 75 64 69 6e 67 20 72 75 6c 65 73 including rules
a1b0: 2e 72 63 20 69 66 20 61 64 64 69 74 69 6f 6e 61 .rc if additiona
a1c0: 6c 20 6c 69 62 73 20 61 72 65 20 6e 65 65 64 65 l libs are neede
a1d0: 64 0d 0a 0d 0a 4f 50 54 44 45 46 49 4e 45 53 09 d....OPTDEFINES.
a1e0: 3d 20 2d 44 54 43 4c 5f 43 46 47 56 41 4c 5f 45 = -DTCL_CFGVAL_E
a1f0: 4e 43 4f 44 49 4e 47 3d 24 28 43 46 47 5f 45 4e NCODING=$(CFG_EN
a200: 43 4f 44 49 4e 47 29 20 2d 44 53 54 44 43 5f 48 CODING) -DSTDC_H
a210: 45 41 44 45 52 53 0d 0a 0d 0a 21 69 66 20 24 28 EADERS....!if $(
a220: 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 29 0d 0a TCL_MEM_DEBUG)..
a230: 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f OPTDEFINES.= $(O
a240: 50 54 44 45 46 49 4e 45 53 29 20 2d 44 54 43 4c PTDEFINES) -DTCL
a250: 5f 4d 45 4d 5f 44 45 42 55 47 0d 0a 21 65 6e 64 _MEM_DEBUG..!end
a260: 69 66 0d 0a 21 69 66 20 24 28 54 43 4c 5f 43 4f if..!if $(TCL_CO
a270: 4d 50 49 4c 45 5f 44 45 42 55 47 29 0d 0a 4f 50 MPILE_DEBUG)..OP
a280: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 TDEFINES.= $(OPT
a290: 44 45 46 49 4e 45 53 29 20 2d 44 54 43 4c 5f 43 DEFINES) -DTCL_C
a2a0: 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 2d 44 54 OMPILE_DEBUG -DT
a2b0: 43 4c 5f 43 4f 4d 50 49 4c 45 5f 53 54 41 54 53 CL_COMPILE_STATS
a2c0: 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 24 28 ..!endif..!if $(
a2d0: 54 43 4c 5f 54 48 52 45 41 44 53 29 0d 0a 4f 50 TCL_THREADS)..OP
a2e0: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 TDEFINES.= $(OPT
a2f0: 44 45 46 49 4e 45 53 29 20 2d 44 54 43 4c 5f 54 DEFINES) -DTCL_T
a300: 48 52 45 41 44 53 3d 31 0d 0a 21 69 66 20 24 28 HREADS=1..!if $(
a310: 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 USE_THREAD_ALLOC
a320: 29 0d 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 )..OPTDEFINES.=
a330: 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2d 44 $(OPTDEFINES) -D
a340: 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 USE_THREAD_ALLOC
a350: 3d 31 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 =1..!endif..!end
a360: 69 66 0d 0a 21 69 66 20 24 28 53 54 41 54 49 43 if..!if $(STATIC
a370: 5f 42 55 49 4c 44 29 0d 0a 4f 50 54 44 45 46 49 _BUILD)..OPTDEFI
a380: 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e NES.= $(OPTDEFIN
a390: 45 53 29 20 2d 44 53 54 41 54 49 43 5f 42 55 49 ES) -DSTATIC_BUI
a3a0: 4c 44 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 LD..!endif..!if
a3b0: 24 28 54 43 4c 5f 4e 4f 5f 44 45 50 52 45 43 41 $(TCL_NO_DEPRECA
a3c0: 54 45 44 29 0d 0a 4f 50 54 44 45 46 49 4e 45 53 TED)..OPTDEFINES
a3d0: 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 .= $(OPTDEFINES)
a3e0: 20 2d 44 54 43 4c 5f 4e 4f 5f 44 45 50 52 45 43 -DTCL_NO_DEPREC
a3f0: 41 54 45 44 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a ATED..!endif....
a400: 21 69 66 20 24 28 55 53 45 5f 53 54 55 42 53 29 !if $(USE_STUBS)
a410: 0d 0a 23 20 4e 6f 74 65 20 77 65 20 64 6f 20 6e ..# Note we do n
a420: 6f 74 20 64 65 66 69 6e 65 20 55 53 45 5f 54 43 ot define USE_TC
a430: 4c 5f 53 54 55 42 53 20 65 76 65 6e 20 77 68 65 L_STUBS even whe
a440: 6e 20 62 75 69 6c 64 69 6e 67 20 54 6b 20 73 69 n building Tk si
a450: 6e 63 65 20 73 6f 6d 65 0d 0a 23 20 74 65 73 74 nce some..# test
a460: 20 74 61 72 67 65 74 73 20 69 6e 20 54 6b 20 64 targets in Tk d
a470: 6f 20 6e 6f 74 20 75 73 65 20 73 74 75 62 73 0d o not use stubs.
a480: 0a 21 69 66 20 21 20 24 28 44 4f 49 4e 47 5f 54 .!if ! $(DOING_T
a490: 43 4c 29 0d 0a 55 53 45 5f 53 54 55 42 53 5f 44 CL)..USE_STUBS_D
a4a0: 45 46 53 20 20 3d 20 2d 44 55 53 45 5f 54 43 4c EFS = -DUSE_TCL
a4b0: 5f 53 54 55 42 53 20 2d 44 55 53 45 5f 54 43 4c _STUBS -DUSE_TCL
a4c0: 4f 4f 5f 53 54 55 42 53 0d 0a 21 69 66 20 24 28 OO_STUBS..!if $(
a4d0: 4e 45 45 44 5f 54 4b 29 0d 0a 55 53 45 5f 53 54 NEED_TK)..USE_ST
a4e0: 55 42 53 5f 44 45 46 53 20 20 3d 20 24 28 55 53 UBS_DEFS = $(US
a4f0: 45 5f 53 54 55 42 53 5f 44 45 46 53 29 20 2d 44 E_STUBS_DEFS) -D
a500: 55 53 45 5f 54 4b 5f 53 54 55 42 53 0d 0a 21 65 USE_TK_STUBS..!e
a510: 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 ndif..!endif..!e
a520: 6e 64 69 66 20 23 20 55 53 45 5f 53 54 55 42 53 ndif # USE_STUBS
a530: 0d 0a 0d 0a 21 69 66 20 21 24 28 44 45 42 55 47 ....!if !$(DEBUG
a540: 29 0d 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 )..OPTDEFINES.=
a550: 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2d 44 $(OPTDEFINES) -D
a560: 4e 44 45 42 55 47 0d 0a 21 69 66 20 24 28 4f 50 NDEBUG..!if $(OP
a570: 54 49 4d 49 5a 49 4e 47 29 0d 0a 4f 50 54 44 45 TIMIZING)..OPTDE
a580: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 FINES.= $(OPTDEF
a590: 49 4e 45 53 29 20 2d 44 54 43 4c 5f 43 46 47 5f INES) -DTCL_CFG_
a5a0: 4f 50 54 49 4d 49 5a 45 44 0d 0a 21 65 6e 64 69 OPTIMIZED..!endi
a5b0: 66 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 24 f..!endif..!if $
a5c0: 28 50 52 4f 46 49 4c 45 29 0d 0a 4f 50 54 44 45 (PROFILE)..OPTDE
a5d0: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 FINES.= $(OPTDEF
a5e0: 49 4e 45 53 29 20 2d 44 54 43 4c 5f 43 46 47 5f INES) -DTCL_CFG_
a5f0: 50 52 4f 46 49 4c 45 44 0d 0a 21 65 6e 64 69 66 PROFILED..!endif
a600: 0d 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e 45 ..!if "$(MACHINE
a610: 29 22 20 3d 3d 20 22 41 4d 44 36 34 22 0d 0a 4f )" == "AMD64"..O
a620: 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 PTDEFINES.= $(OP
a630: 54 44 45 46 49 4e 45 53 29 20 2d 44 54 43 4c 5f TDEFINES) -DTCL_
a640: 43 46 47 5f 44 4f 36 34 42 49 54 0d 0a 21 65 6e CFG_DO64BIT..!en
a650: 64 69 66 0d 0a 21 69 66 20 24 28 56 43 56 45 52 dif..!if $(VCVER
a660: 53 49 4f 4e 29 20 3c 20 31 33 30 30 0d 0a 4f 50 SION) < 1300..OP
a670: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 TDEFINES.= $(OPT
a680: 44 45 46 49 4e 45 53 29 20 2d 44 4e 4f 5f 53 54 DEFINES) -DNO_ST
a690: 52 54 4f 49 36 34 0d 0a 21 65 6e 64 69 66 0d 0a RTOI64..!endif..
a6a0: 0d 0a 23 20 5f 41 54 4c 5f 58 50 5f 54 41 52 47 ..# _ATL_XP_TARG
a6b0: 45 54 49 4e 47 20 2d 20 4e 65 77 65 72 20 53 44 ETING - Newer SD
a6c0: 4b 27 73 20 6e 65 65 64 20 74 68 69 73 20 74 6f K's need this to
a6d0: 20 62 75 69 6c 64 20 66 6f 72 20 58 50 0d 0a 43 build for XP..C
a6e0: 4f 4d 50 49 4c 45 52 46 4c 41 47 53 20 20 3d 20 OMPILERFLAGS =
a6f0: 2f 44 5f 41 54 4c 5f 58 50 5f 54 41 52 47 45 54 /D_ATL_XP_TARGET
a700: 49 4e 47 0d 0a 0d 0a 23 20 46 6f 6c 6c 6f 77 69 ING....# Followi
a710: 6e 67 20 69 73 20 70 72 69 6d 61 72 69 6c 79 20 ng is primarily
a720: 66 6f 72 20 74 68 65 20 62 65 6e 65 66 69 74 20 for the benefit
a730: 6f 66 20 65 78 74 65 6e 73 69 6f 6e 73 2e 20 54 of extensions. T
a740: 63 6c 20 38 2e 35 20 62 75 69 6c 64 73 0d 0a 23 cl 8.5 builds..#
a750: 20 54 63 6c 20 77 69 74 68 6f 75 74 20 2f 44 55 Tcl without /DU
a760: 4e 49 43 4f 44 45 2c 20 77 68 69 6c 65 20 38 2e NICODE, while 8.
a770: 36 20 62 75 69 6c 64 73 20 77 69 74 68 20 69 74 6 builds with it
a780: 20 64 65 66 69 6e 65 64 2e 20 57 68 65 6e 20 62 defined. When b
a790: 75 69 6c 64 69 6e 67 0d 0a 23 20 61 6e 20 65 78 uilding..# an ex
a7a0: 74 65 6e 73 69 6f 6e 2c 20 69 74 20 69 73 20 61 tension, it is a
a7b0: 64 76 69 73 61 62 6c 65 20 28 62 75 74 20 6e 6f dvisable (but no
a7c0: 74 20 6d 61 6e 64 61 74 65 64 29 20 74 6f 20 75 t mandated) to u
a7d0: 73 65 20 74 68 65 20 73 61 6d 65 20 57 69 6e 64 se the same Wind
a7e0: 6f 77 73 0d 0a 23 20 41 50 49 20 61 73 20 74 68 ows..# API as th
a7f0: 65 20 54 63 6c 20 62 75 69 6c 64 2e 20 54 68 69 e Tcl build. Thi
a800: 73 20 69 73 20 61 63 63 6f 72 64 69 6e 67 6c 79 s is accordingly
a810: 20 64 65 66 61 75 6c 74 65 64 20 62 65 6c 6f 77 defaulted below
a820: 2e 20 41 20 70 61 72 74 69 63 75 6c 61 72 0d 0a . A particular..
a830: 23 20 65 78 74 65 6e 73 69 6f 6e 20 63 61 6e 20 # extension can
a840: 6f 76 65 72 72 69 64 65 20 74 68 69 73 20 62 79 override this by
a850: 20 70 72 65 2d 64 65 66 69 6e 69 6e 67 20 55 53 pre-defining US
a860: 45 5f 57 49 44 45 43 48 41 52 5f 41 50 49 2e 0d E_WIDECHAR_API..
a870: 0a 21 69 66 6e 64 65 66 20 55 53 45 5f 57 49 44 .!ifndef USE_WID
a880: 45 43 48 41 52 5f 41 50 49 0d 0a 21 69 66 20 24 ECHAR_API..!if $
a890: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3e 20 (TCL_VERSION) >
a8a0: 38 35 0d 0a 55 53 45 5f 57 49 44 45 43 48 41 52 85..USE_WIDECHAR
a8b0: 5f 41 50 49 20 3d 20 31 0d 0a 21 65 6c 73 65 0d _API = 1..!else.
a8c0: 0a 55 53 45 5f 57 49 44 45 43 48 41 52 5f 41 50 .USE_WIDECHAR_AP
a8d0: 49 20 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a 21 I = 0..!endif..!
a8e0: 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 24 28 55 endif....!if $(U
a8f0: 53 45 5f 57 49 44 45 43 48 41 52 5f 41 50 49 29 SE_WIDECHAR_API)
a900: 0d 0a 43 4f 4d 50 49 4c 45 52 46 4c 41 47 53 20 ..COMPILERFLAGS
a910: 3d 20 24 28 43 4f 4d 50 49 4c 45 52 46 4c 41 47 = $(COMPILERFLAG
a920: 53 29 20 2f 44 55 4e 49 43 4f 44 45 20 2f 44 5f S) /DUNICODE /D_
a930: 55 4e 49 43 4f 44 45 20 0d 0a 21 65 6e 64 69 66 UNICODE ..!endif
a940: 0d 0a 0d 0a 23 20 4c 69 6b 65 20 74 68 65 20 54 ....# Like the T
a950: 45 41 20 73 79 73 74 65 6d 20 6f 6e 6c 79 20 73 EA system only s
a960: 65 74 20 74 68 69 73 20 6e 6f 6e 20 65 6d 70 74 et this non empt
a970: 79 20 66 6f 72 20 6e 6f 6e 2d 54 6b 20 65 78 74 y for non-Tk ext
a980: 65 6e 73 69 6f 6e 73 0d 0a 23 20 4e 6f 74 65 3a ensions..# Note:
a990: 20 73 6f 6d 65 20 65 78 74 65 6e 73 69 6f 6e 73 some extensions
a9a0: 20 75 73 65 20 50 41 43 4b 41 47 45 5f 4e 41 4d use PACKAGE_NAM
a9b0: 45 20 61 6e 64 20 6f 74 68 65 72 73 20 75 73 65 E and others use
a9c0: 20 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 PACKAGE_TCLNAME
a9d0: 0d 0a 23 20 73 6f 20 77 65 20 70 61 73 73 20 62 ..# so we pass b
a9e0: 6f 74 68 0d 0a 21 69 66 20 21 24 28 44 4f 49 4e oth..!if !$(DOIN
a9f0: 47 5f 54 43 4c 29 20 26 26 20 21 24 28 44 4f 49 G_TCL) && !$(DOI
aa00: 4e 47 5f 54 4b 29 0d 0a 50 4b 47 4e 41 4d 45 46 NG_TK)..PKGNAMEF
aa10: 4c 41 47 53 20 3d 20 2d 44 50 41 43 4b 41 47 45 LAGS = -DPACKAGE
aa20: 5f 4e 41 4d 45 3d 22 5c 22 24 28 50 52 4a 5f 50 _NAME="\"$(PRJ_P
aa30: 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 5c ACKAGE_TCLNAME)\
aa40: 22 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 "" \..
aa50: 20 20 20 20 20 2d 44 50 41 43 4b 41 47 45 5f 54 -DPACKAGE_T
aa60: 43 4c 4e 41 4d 45 3d 22 5c 22 24 28 50 52 4a 5f CLNAME="\"$(PRJ_
aa70: 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 PACKAGE_TCLNAME)
aa80: 5c 22 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 \"" \..
aa90: 20 20 20 20 20 20 2d 44 50 41 43 4b 41 47 45 5f -DPACKAGE_
aaa0: 56 45 52 53 49 4f 4e 3d 22 5c 22 24 28 44 4f 54 VERSION="\"$(DOT
aab0: 56 45 52 53 49 4f 4e 29 5c 22 22 20 5c 0d 0a 20 VERSION)\"" \..
aac0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 44 -D
aad0: 4d 4f 44 55 4c 45 5f 53 43 4f 50 45 3d 65 78 74 MODULE_SCOPE=ext
aae0: 65 72 6e 20 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a ern ..!endif....
aaf0: 23 20 63 72 74 20 70 69 63 6b 73 20 74 68 65 20 # crt picks the
ab00: 43 20 72 75 6e 20 74 69 6d 65 20 62 61 73 65 64 C run time based
ab10: 20 6f 6e 20 73 65 6c 65 63 74 65 64 20 4f 50 54 on selected OPT
ab20: 53 0d 0a 21 69 66 20 24 28 4d 53 56 43 52 54 29 S..!if $(MSVCRT)
ab30: 0d 0a 21 69 66 20 24 28 44 45 42 55 47 29 20 26 ..!if $(DEBUG) &
ab40: 26 20 21 24 28 55 4e 43 48 45 43 4b 45 44 29 0d & !$(UNCHECKED).
ab50: 0a 63 72 74 20 3d 20 2d 4d 44 64 0d 0a 21 65 6c .crt = -MDd..!el
ab60: 73 65 0d 0a 63 72 74 20 3d 20 2d 4d 44 0d 0a 21 se..crt = -MD..!
ab70: 65 6e 64 69 66 0d 0a 21 65 6c 73 65 0d 0a 21 69 endif..!else..!i
ab80: 66 20 24 28 44 45 42 55 47 29 20 26 26 20 21 24 f $(DEBUG) && !$
ab90: 28 55 4e 43 48 45 43 4b 45 44 29 0d 0a 63 72 74 (UNCHECKED)..crt
aba0: 20 3d 20 2d 4d 54 64 0d 0a 21 65 6c 73 65 0d 0a = -MTd..!else..
abb0: 63 72 74 20 3d 20 2d 4d 54 0d 0a 21 65 6e 64 69 crt = -MT..!endi
abc0: 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 63 f..!endif....# c
abd0: 64 65 62 75 67 20 69 6e 63 6c 75 64 65 73 20 63 debug includes c
abe0: 6f 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e 73 20 ompiler options
abf0: 66 6f 72 20 64 65 62 75 67 67 69 6e 67 20 61 73 for debugging as
ac00: 20 77 65 6c 6c 20 61 73 20 6f 70 74 69 6d 69 7a well as optimiz
ac10: 61 74 69 6f 6e 2e 0d 0a 21 69 66 20 24 28 44 45 ation...!if $(DE
ac20: 42 55 47 29 0d 0a 0d 0a 23 20 49 6e 20 64 65 62 BUG)....# In deb
ac30: 75 67 67 69 6e 67 20 6d 6f 64 65 2c 20 6f 70 74 ugging mode, opt
ac40: 69 6d 69 7a 61 74 69 6f 6e 73 20 6e 65 65 64 20 imizations need
ac50: 74 6f 20 62 65 20 64 69 73 61 62 6c 65 64 0d 0a to be disabled..
ac60: 63 64 65 62 75 67 20 3d 20 2d 5a 69 20 2d 4f 64 cdebug = -Zi -Od
ac70: 20 24 28 44 45 42 55 47 46 4c 41 47 53 29 0d 0a $(DEBUGFLAGS)..
ac80: 0d 0a 21 65 6c 73 65 0d 0a 0d 0a 63 64 65 62 75 ..!else....cdebu
ac90: 67 20 3d 20 24 28 4f 50 54 49 4d 49 5a 41 54 49 g = $(OPTIMIZATI
aca0: 4f 4e 53 29 0d 0a 21 69 66 20 24 28 53 59 4d 42 ONS)..!if $(SYMB
acb0: 4f 4c 53 29 0d 0a 63 64 65 62 75 67 20 3d 20 24 OLS)..cdebug = $
acc0: 28 63 64 65 62 75 67 29 20 2d 5a 69 0d 0a 21 65 (cdebug) -Zi..!e
acd0: 6e 64 69 66 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 ndif....!endif #
ace0: 20 24 28 44 45 42 55 47 29 0d 0a 0d 0a 23 20 63 $(DEBUG)....# c
acf0: 77 61 72 6e 20 69 6e 63 6c 75 64 65 73 20 64 65 warn includes de
ad00: 66 61 75 6c 74 20 77 61 72 6e 69 6e 67 20 6c 65 fault warning le
ad10: 76 65 6c 73 2e 0d 0a 63 77 61 72 6e 20 3d 20 24 vels...cwarn = $
ad20: 28 57 41 52 4e 49 4e 47 53 29 0d 0a 0d 0a 21 69 (WARNINGS)....!i
ad30: 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d f "$(MACHINE)" =
ad40: 3d 20 22 41 4d 44 36 34 22 0d 0a 23 20 44 69 73 = "AMD64"..# Dis
ad50: 61 62 6c 65 20 70 6f 69 6e 74 65 72 3c 2d 3e 69 able pointer<->i
ad60: 6e 74 20 77 61 72 6e 69 6e 67 73 20 72 65 6c 61 nt warnings rela
ad70: 74 65 64 20 74 6f 20 63 61 73 74 20 62 65 74 77 ted to cast betw
ad80: 65 65 6e 20 64 69 66 66 65 72 65 6e 74 20 73 69 een different si
ad90: 7a 65 73 0d 0a 23 20 54 68 65 72 65 20 61 72 65 zes..# There are
ada0: 20 61 20 67 61 64 7a 69 6c 6c 69 6f 6e 20 6f 66 a gadzillion of
adb0: 20 74 68 65 73 65 20 64 75 65 20 74 6f 20 75 73 these due to us
adc0: 65 20 6f 66 20 43 6c 69 65 6e 74 44 61 74 61 20 e of ClientData
add0: 61 6e 64 0d 0a 23 20 63 6c 75 74 74 65 72 20 75 and..# clutter u
ade0: 70 20 63 6f 6d 70 69 6c 65 72 0d 0a 23 20 6f 75 p compiler..# ou
adf0: 74 70 75 74 20 69 6e 63 72 65 61 73 69 6e 67 20 tput increasing
ae00: 63 68 61 6e 63 65 20 6f 66 20 61 20 72 65 61 6c chance of a real
ae10: 20 77 61 72 6e 69 6e 67 20 67 65 74 74 69 6e 67 warning getting
ae20: 20 6c 6f 73 74 2e 20 53 6f 20 64 69 73 61 62 6c lost. So disabl
ae30: 65 20 74 68 65 6d 2e 0d 0a 23 20 45 76 65 6e 74 e them...# Event
ae40: 75 61 6c 6c 79 20 73 6f 6d 65 20 64 61 79 2c 20 ually some day,
ae50: 54 63 6c 20 77 69 6c 6c 20 62 65 20 36 34 2d 62 Tcl will be 64-b
ae60: 69 74 20 63 6c 65 61 6e 2e 0d 0a 63 77 61 72 6e it clean...cwarn
ae70: 20 3d 20 24 28 63 77 61 72 6e 29 20 2d 77 64 34 = $(cwarn) -wd4
ae80: 33 31 31 20 2d 77 64 34 33 31 32 0d 0a 21 65 6e 311 -wd4312..!en
ae90: 64 69 66 0d 0a 0d 0a 23 23 23 20 43 6f 6d 6d 6f dif....### Commo
aea0: 6e 20 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69 6f n compiler optio
aeb0: 6e 73 20 74 68 61 74 20 61 72 65 20 61 72 63 68 ns that are arch
aec0: 69 74 65 63 74 75 72 65 20 73 70 65 63 69 66 69 itecture specifi
aed0: 63 0d 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e c..!if "$(MACHIN
aee0: 45 29 22 20 3d 3d 20 22 41 52 4d 22 0d 0a 63 61 E)" == "ARM"..ca
aef0: 72 63 68 20 3d 20 2d 44 5f 41 52 4d 5f 57 49 4e rch = -D_ARM_WIN
af00: 41 50 49 5f 50 41 52 54 49 54 49 4f 4e 5f 44 45 API_PARTITION_DE
af10: 53 4b 54 4f 50 5f 53 44 4b 5f 41 56 41 49 4c 41 SKTOP_SDK_AVAILA
af20: 42 4c 45 0d 0a 21 65 6c 73 65 0d 0a 63 61 72 63 BLE..!else..carc
af30: 68 20 3d 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 h =..!endif....!
af40: 69 66 20 24 28 44 45 42 55 47 29 0d 0a 23 20 54 if $(DEBUG)..# T
af50: 75 72 6e 20 77 61 72 6e 69 6e 67 73 20 69 6e 74 urn warnings int
af60: 6f 20 65 72 72 6f 72 73 0d 0a 63 77 61 72 6e 20 o errors..cwarn
af70: 3d 20 24 28 63 77 61 72 6e 29 20 2d 57 58 0d 0a = $(cwarn) -WX..
af80: 21 65 6e 64 69 66 0d 0a 0d 0a 49 4e 43 4c 55 44 !endif....INCLUD
af90: 45 53 20 3d 20 24 28 54 43 4c 5f 49 4e 43 4c 55 ES = $(TCL_INCLU
afa0: 44 45 53 29 20 24 28 54 4b 5f 49 4e 43 4c 55 44 DES) $(TK_INCLUD
afb0: 45 53 29 20 24 28 50 52 4a 5f 49 4e 43 4c 55 44 ES) $(PRJ_INCLUD
afc0: 45 53 29 0d 0a 21 69 66 20 21 24 28 44 4f 49 4e ES)..!if !$(DOIN
afd0: 47 5f 54 43 4c 29 20 26 26 20 21 24 28 44 4f 49 G_TCL) && !$(DOI
afe0: 4e 47 5f 54 4b 29 0d 0a 49 4e 43 4c 55 44 45 53 NG_TK)..INCLUDES
aff0: 20 3d 20 24 28 49 4e 43 4c 55 44 45 53 29 20 2d = $(INCLUDES) -
b000: 49 22 24 28 47 45 4e 45 52 49 43 44 49 52 29 22 I"$(GENERICDIR)"
b010: 20 2d 49 22 24 28 57 49 4e 44 49 52 29 22 20 2d -I"$(WINDIR)" -
b020: 49 22 24 28 43 4f 4d 50 41 54 44 49 52 29 22 0d I"$(COMPATDIR)".
b030: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 54 68 65 .!endif....# The
b040: 73 65 20 66 6c 61 67 73 20 61 72 65 20 64 65 66 se flags are def
b050: 69 6e 65 64 20 72 6f 75 67 68 6c 79 20 69 6e 20 ined roughly in
b060: 74 68 65 20 6f 72 64 65 72 20 6f 66 20 74 68 65 the order of the
b070: 20 70 72 65 2d 72 65 66 6f 72 6d 0d 0a 23 20 72 pre-reform..# r
b080: 75 6c 65 73 2e 76 63 2f 6d 61 6b 65 66 69 6c 65 ules.vc/makefile
b090: 2e 76 63 20 74 6f 20 68 65 6c 70 20 76 69 73 75 .vc to help visu
b0a0: 61 6c 6c 79 20 63 6f 6d 70 61 72 65 20 74 68 61 ally compare tha
b0b0: 74 20 74 68 65 20 70 72 65 2d 20 61 6e 64 0d 0a t the pre- and..
b0c0: 23 20 70 6f 73 74 2d 72 65 66 6f 72 6d 20 62 75 # post-reform bu
b0d0: 69 6c 64 20 6c 6f 67 73 0d 0a 0d 0a 23 20 63 66 ild logs....# cf
b0e0: 6c 61 67 73 20 63 6f 6e 74 61 69 6e 73 20 67 65 lags contains ge
b0f0: 6e 65 72 69 63 20 66 6c 61 67 73 20 75 73 65 64 neric flags used
b100: 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 70 72 for building pr
b110: 61 63 74 69 63 61 6c 6c 79 20 61 6c 6c 20 6f 62 actically all ob
b120: 6a 65 63 74 20 66 69 6c 65 73 0d 0a 63 66 6c 61 ject files..cfla
b130: 67 73 20 3d 20 2d 6e 6f 6c 6f 67 6f 20 2d 63 20 gs = -nologo -c
b140: 24 28 43 4f 4d 50 49 4c 45 52 46 4c 41 47 53 29 $(COMPILERFLAGS)
b150: 20 24 28 63 61 72 63 68 29 20 24 28 63 77 61 72 $(carch) $(cwar
b160: 6e 29 20 2d 46 70 24 28 54 4d 50 5f 44 49 52 29 n) -Fp$(TMP_DIR)
b170: 5e 5c 20 24 28 63 64 65 62 75 67 29 0d 0a 0d 0a ^\ $(cdebug)....
b180: 23 20 61 70 70 63 66 6c 61 67 73 20 63 6f 6e 74 # appcflags cont
b190: 61 69 6e 73 20 24 28 63 66 6c 61 67 73 29 20 61 ains $(cflags) a
b1a0: 6e 64 20 66 6c 61 67 73 20 66 6f 72 20 62 75 69 nd flags for bui
b1b0: 6c 64 69 6e 67 20 74 68 65 20 61 70 70 6c 69 63 lding the applic
b1c0: 61 74 69 6f 6e 0d 0a 23 20 6f 62 6a 65 63 74 20 ation..# object
b1d0: 66 69 6c 65 73 20 28 65 2e 67 2e 20 74 63 6c 73 files (e.g. tcls
b1e0: 68 2c 20 6f 72 20 77 69 73 68 29 20 70 6b 67 63 h, or wish) pkgc
b1f0: 66 6c 61 67 73 20 63 6f 6e 74 61 69 6e 73 20 24 flags contains $
b200: 28 63 66 6c 61 67 73 29 20 70 6c 75 73 0d 0a 23 (cflags) plus..#
b210: 20 66 6c 61 67 73 20 75 73 65 64 20 66 6f 72 20 flags used for
b220: 62 75 69 6c 64 69 6e 67 20 73 68 61 72 65 64 20 building shared
b230: 6f 62 6a 65 63 74 20 66 69 6c 65 73 20 54 68 65 object files The
b240: 20 74 77 6f 20 64 69 66 66 65 72 20 69 6e 20 74 two differ in t
b250: 68 65 0d 0a 23 20 42 55 49 4c 44 5f 24 28 50 52 he..# BUILD_$(PR
b260: 4f 4a 45 43 54 29 20 6d 61 63 72 6f 20 77 68 69 OJECT) macro whi
b270: 63 68 20 73 68 6f 75 6c 64 20 62 65 20 64 65 66 ch should be def
b280: 69 6e 65 64 20 6f 6e 6c 79 20 66 6f 72 20 74 68 ined only for th
b290: 65 20 73 68 61 72 65 64 0d 0a 23 20 6c 69 62 72 e shared..# libr
b2a0: 61 72 79 20 2a 69 6d 70 6c 65 6d 65 6e 74 61 74 ary *implementat
b2b0: 69 6f 6e 2a 20 61 6e 64 20 6e 6f 74 20 66 6f 72 ion* and not for
b2c0: 20 69 74 73 20 63 61 6c 6c 65 72 20 69 6e 74 65 its caller inte
b2d0: 72 66 61 63 65 0d 0a 0d 0a 61 70 70 63 66 6c 61 rface....appcfla
b2e0: 67 73 20 3d 20 24 28 63 66 6c 61 67 73 29 20 24 gs = $(cflags) $
b2f0: 28 63 72 74 29 20 24 28 49 4e 43 4c 55 44 45 53 (crt) $(INCLUDES
b300: 29 20 24 28 54 43 4c 5f 44 45 46 49 4e 45 53 29 ) $(TCL_DEFINES)
b310: 20 24 28 50 52 4a 5f 44 45 46 49 4e 45 53 29 20 $(PRJ_DEFINES)
b320: 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 24 28 $(OPTDEFINES) $(
b330: 55 53 45 5f 53 54 55 42 53 5f 44 45 46 53 29 0d USE_STUBS_DEFS).
b340: 0a 61 70 70 63 66 6c 61 67 73 5f 6e 6f 73 74 75 .appcflags_nostu
b350: 62 73 20 3d 20 24 28 63 66 6c 61 67 73 29 20 24 bs = $(cflags) $
b360: 28 63 72 74 29 20 24 28 49 4e 43 4c 55 44 45 53 (crt) $(INCLUDES
b370: 29 20 24 28 54 43 4c 5f 44 45 46 49 4e 45 53 29 ) $(TCL_DEFINES)
b380: 20 24 28 50 52 4a 5f 44 45 46 49 4e 45 53 29 20 $(PRJ_DEFINES)
b390: 24 28 4f 50 54 44 45 46 49 4e 45 53 29 0d 0a 70 $(OPTDEFINES)..p
b3a0: 6b 67 63 66 6c 61 67 73 20 3d 20 24 28 61 70 70 kgcflags = $(app
b3b0: 63 66 6c 61 67 73 29 20 24 28 50 4b 47 4e 41 4d cflags) $(PKGNAM
b3c0: 45 46 4c 41 47 53 29 20 2d 44 42 55 49 4c 44 5f EFLAGS) -DBUILD_
b3d0: 24 28 50 52 4f 4a 45 43 54 29 0d 0a 70 6b 67 63 $(PROJECT)..pkgc
b3e0: 66 6c 61 67 73 5f 6e 6f 73 74 75 62 73 20 3d 20 flags_nostubs =
b3f0: 24 28 61 70 70 63 66 6c 61 67 73 5f 6e 6f 73 74 $(appcflags_nost
b400: 75 62 73 29 20 24 28 50 4b 47 4e 41 4d 45 46 4c ubs) $(PKGNAMEFL
b410: 41 47 53 29 20 2d 44 42 55 49 4c 44 5f 24 28 50 AGS) -DBUILD_$(P
b420: 52 4f 4a 45 43 54 29 0d 0a 0d 0a 23 20 73 74 75 ROJECT)....# stu
b430: 62 73 63 66 6c 61 67 73 20 63 6f 6e 74 61 69 6e bscflags contain
b440: 73 20 24 28 63 66 6c 61 67 73 29 20 70 6c 75 73 s $(cflags) plus
b450: 20 66 6c 61 67 73 20 75 73 65 64 20 66 6f 72 20 flags used for
b460: 62 75 69 6c 64 69 6e 67 20 61 20 73 74 75 62 73 building a stubs
b470: 0d 0a 23 20 6c 69 62 72 61 72 79 20 66 6f 72 20 ..# library for
b480: 74 68 65 20 70 61 63 6b 61 67 65 2e 20 20 4e 6f the package. No
b490: 74 65 3a 20 2d 44 53 54 41 54 49 43 5f 42 55 49 te: -DSTATIC_BUI
b4a0: 4c 44 20 69 73 20 64 65 66 69 6e 65 64 20 69 6e LD is defined in
b4b0: 0d 0a 23 20 24 28 4f 50 54 44 45 46 49 4e 45 53 ..# $(OPTDEFINES
b4c0: 29 20 6f 6e 6c 79 20 69 66 20 74 68 65 20 4f 50 ) only if the OP
b4d0: 54 53 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e TS configuration
b4e0: 20 69 6e 64 69 63 61 74 65 73 20 61 20 73 74 61 indicates a sta
b4f0: 74 69 63 0d 0a 23 20 6c 69 62 72 61 72 79 2e 20 tic..# library.
b500: 48 6f 77 65 76 65 72 20 74 68 65 20 73 74 75 62 However the stub
b510: 73 20 6c 69 62 72 61 72 79 20 69 73 20 41 4c 57 s library is ALW
b520: 41 59 53 20 73 74 61 74 69 63 20 68 65 6e 63 65 AYS static hence
b530: 20 69 6e 63 6c 75 64 65 64 0d 0a 23 20 68 65 72 included..# her
b540: 65 20 69 72 72 65 73 70 65 63 74 69 76 65 20 6f e irrespective o
b550: 66 20 74 68 65 20 4f 50 54 53 20 73 65 74 74 69 f the OPTS setti
b560: 6e 67 2e 0d 0a 23 0d 0a 23 20 54 42 44 20 2d 20 ng...#..# TBD -
b570: 74 63 6c 76 66 73 20 68 61 73 20 61 20 63 6f 6d tclvfs has a com
b580: 6d 65 6e 74 20 74 68 61 74 20 73 74 75 62 73 20 ment that stubs
b590: 6c 69 62 73 20 73 68 6f 75 6c 64 20 6e 6f 74 20 libs should not
b5a0: 62 65 20 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 be compiled with
b5b0: 20 2d 47 4c 0d 0a 23 20 77 69 74 68 6f 75 74 20 -GL..# without
b5c0: 73 74 61 74 69 6e 67 20 77 68 79 2e 20 54 63 6c stating why. Tcl
b5d0: 20 69 74 73 65 6c 66 20 63 6f 6d 70 69 6c 65 64 itself compiled
b5e0: 20 73 74 75 62 73 20 6c 69 62 73 20 77 69 74 68 stubs libs with
b5f0: 20 74 68 69 73 20 66 6c 61 67 2e 0d 0a 23 20 73 this flag...# s
b600: 6f 20 77 65 20 64 6f 20 6e 6f 74 20 72 65 6d 6f o we do not remo
b610: 76 65 20 69 74 20 66 72 6f 6d 20 63 66 6c 61 67 ve it from cflag
b620: 73 2e 20 2d 47 4c 20 6d 61 79 20 70 72 65 76 65 s. -GL may preve
b630: 6e 74 20 65 78 74 65 6e 73 69 6f 6e 73 0d 0a 23 nt extensions..#
b640: 20 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 6f compiled with o
b650: 6e 65 20 56 43 20 76 65 72 73 69 6f 6e 20 74 6f ne VC version to
b660: 20 66 61 69 6c 20 74 6f 20 6c 69 6e 6b 20 61 67 fail to link ag
b670: 61 69 6e 73 74 20 73 74 75 62 73 20 6c 69 62 72 ainst stubs libr
b680: 61 72 79 0d 0a 23 20 63 6f 6d 70 69 6c 65 64 20 ary..# compiled
b690: 77 69 74 68 20 61 6e 6f 74 68 65 72 20 56 43 20 with another VC
b6a0: 76 65 72 73 69 6f 6e 2e 20 43 68 65 63 6b 20 66 version. Check f
b6b0: 6f 72 20 74 68 69 73 20 61 6e 64 20 66 69 78 20 or this and fix
b6c0: 61 63 63 6f 72 64 69 6e 67 6c 79 2e 0d 0a 73 74 accordingly...st
b6d0: 75 62 73 63 66 6c 61 67 73 20 3d 20 24 28 63 66 ubscflags = $(cf
b6e0: 6c 61 67 73 29 20 24 28 50 4b 47 4e 41 4d 45 46 lags) $(PKGNAMEF
b6f0: 4c 41 47 53 29 20 24 28 50 52 4a 5f 44 45 46 49 LAGS) $(PRJ_DEFI
b700: 4e 45 53 29 20 24 28 4f 50 54 44 45 46 49 4e 45 NES) $(OPTDEFINE
b710: 53 29 20 2d 5a 6c 20 2d 44 53 54 41 54 49 43 5f S) -Zl -DSTATIC_
b720: 42 55 49 4c 44 20 24 28 49 4e 43 4c 55 44 45 53 BUILD $(INCLUDES
b730: 29 0d 0a 0d 0a 23 20 4c 69 6e 6b 20 66 6c 61 67 )....# Link flag
b740: 73 20 0d 0a 0d 0a 21 69 66 20 24 28 44 45 42 55 s ....!if $(DEBU
b750: 47 29 0d 0a 6c 64 65 62 75 67 09 3d 20 2d 64 65 G)..ldebug.= -de
b760: 62 75 67 20 2d 64 65 62 75 67 74 79 70 65 3a 63 bug -debugtype:c
b770: 76 0d 0a 21 65 6c 73 65 0d 0a 6c 64 65 62 75 67 v..!else..ldebug
b780: 09 3d 20 2d 72 65 6c 65 61 73 65 20 2d 6f 70 74 .= -release -opt
b790: 3a 72 65 66 20 2d 6f 70 74 3a 69 63 66 2c 33 0d :ref -opt:icf,3.
b7a0: 0a 21 69 66 20 24 28 53 59 4d 42 4f 4c 53 29 0d .!if $(SYMBOLS).
b7b0: 0a 6c 64 65 62 75 67 09 3d 20 24 28 6c 64 65 62 .ldebug.= $(ldeb
b7c0: 75 67 29 20 2d 64 65 62 75 67 20 2d 64 65 62 75 ug) -debug -debu
b7d0: 67 74 79 70 65 3a 63 76 0d 0a 21 65 6e 64 69 66 gtype:cv..!endif
b7e0: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 4e 6f ..!endif....# No
b7f0: 74 65 3a 20 50 72 6f 66 69 6c 69 6e 67 20 69 73 te: Profiling is
b800: 20 63 75 72 72 65 6e 74 6c 79 20 6f 6e 6c 79 20 currently only
b810: 70 6f 73 73 69 62 6c 65 20 77 69 74 68 20 74 68 possible with th
b820: 65 20 56 69 73 75 61 6c 20 53 74 75 64 69 6f 20 e Visual Studio
b830: 45 6e 74 65 72 70 72 69 73 65 0d 0a 21 69 66 20 Enterprise..!if
b840: 24 28 50 52 4f 46 49 4c 45 29 0d 0a 6c 64 65 62 $(PROFILE)..ldeb
b850: 75 67 3d 20 24 28 6c 64 65 62 75 67 29 20 2d 70 ug= $(ldebug) -p
b860: 72 6f 66 69 6c 65 0d 0a 21 65 6e 64 69 66 0d 0a rofile..!endif..
b870: 0d 0a 23 23 23 20 44 65 63 6c 61 72 61 74 69 6f ..### Declaratio
b880: 6e 73 20 63 6f 6d 6d 6f 6e 20 74 6f 20 61 6c 6c ns common to all
b890: 20 6c 69 6e 6b 65 72 20 76 65 72 73 69 6f 6e 73 linker versions
b8a0: 20 0d 0a 6c 66 6c 61 67 73 09 3d 20 2d 6e 6f 6c ..lflags.= -nol
b8b0: 6f 67 6f 20 2d 6d 61 63 68 69 6e 65 3a 24 28 4d ogo -machine:$(M
b8c0: 41 43 48 49 4e 45 29 20 24 28 4c 49 4e 4b 45 52 ACHINE) $(LINKER
b8d0: 46 4c 41 47 53 29 20 24 28 6c 64 65 62 75 67 29 FLAGS) $(ldebug)
b8e0: 0d 0a 0d 0a 21 69 66 20 24 28 4d 53 56 43 52 54 ....!if $(MSVCRT
b8f0: 29 20 26 26 20 21 28 24 28 44 45 42 55 47 29 20 ) && !($(DEBUG)
b900: 26 26 20 21 24 28 55 4e 43 48 45 43 4b 45 44 29 && !$(UNCHECKED)
b910: 29 20 26 26 20 24 28 56 43 56 45 52 53 49 4f 4e ) && $(VCVERSION
b920: 29 20 3e 3d 20 31 39 30 30 0d 0a 6c 66 6c 61 67 ) >= 1900..lflag
b930: 73 09 3d 20 24 28 6c 66 6c 61 67 73 29 20 2d 6e s.= $(lflags) -n
b940: 6f 64 65 66 61 75 6c 74 6c 69 62 3a 6c 69 62 75 odefaultlib:libu
b950: 63 72 74 2e 6c 69 62 0d 0a 21 65 6e 64 69 66 0d crt.lib..!endif.
b960: 0a 0d 0a 23 20 4f 6c 64 20 6c 69 6e 6b 65 72 73 ...# Old linkers
b970: 20 28 56 69 73 75 61 6c 20 43 2b 2b 20 36 20 69 (Visual C++ 6 i
b980: 6e 20 70 61 72 74 69 63 75 6c 61 72 29 20 77 69 n particular) wi
b990: 6c 6c 20 6c 69 6e 6b 20 66 6f 72 20 66 61 73 74 ll link for fast
b9a0: 20 6c 6f 61 64 69 6e 67 0d 0a 23 20 6f 6e 20 57 loading..# on W
b9b0: 69 6e 39 38 2e 20 53 69 6e 63 65 20 77 65 20 64 in98. Since we d
b9c0: 6f 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 57 69 o not support Wi
b9d0: 6e 39 38 20 61 6e 79 20 6d 6f 72 65 2c 20 77 65 n98 any more, we
b9e0: 20 73 70 65 63 69 66 79 20 6e 6f 77 69 6e 39 38 specify nowin98
b9f0: 0d 0a 23 20 61 73 20 72 65 63 6f 6d 6d 65 6e 64 ..# as recommend
ba00: 65 64 20 66 6f 72 20 4e 54 20 61 6e 64 20 6c 61 ed for NT and la
ba10: 74 65 72 2e 20 48 6f 77 65 76 65 72 2c 20 74 68 ter. However, th
ba20: 69 73 20 69 73 20 6f 6e 6c 79 20 72 65 71 75 69 is is only requi
ba30: 72 65 64 20 62 79 0d 0a 23 20 49 58 38 36 20 6f red by..# IX86 o
ba40: 6e 20 6f 6c 64 65 72 20 63 6f 6d 70 69 6c 65 72 n older compiler
ba50: 73 20 61 6e 64 20 6f 6e 6c 79 20 6e 65 65 64 65 s and only neede
ba60: 64 20 69 66 20 77 65 20 61 72 65 20 6e 6f 74 20 d if we are not
ba70: 64 6f 69 6e 67 20 61 20 73 74 61 74 69 63 20 62 doing a static b
ba80: 75 69 6c 64 2e 0d 0a 0d 0a 21 69 66 20 22 24 28 uild.....!if "$(
ba90: 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 49 58 MACHINE)" == "IX
baa0: 38 36 22 20 26 26 20 21 24 28 53 54 41 54 49 43 86" && !$(STATIC
bab0: 5f 42 55 49 4c 44 29 0d 0a 21 69 66 20 5b 6e 6d _BUILD)..!if [nm
bac0: 61 6b 65 68 6c 70 20 2d 6c 20 2d 6f 70 74 3a 6e akehlp -l -opt:n
bad0: 6f 77 69 6e 39 38 20 24 28 4c 49 4e 4b 45 52 5f owin98 $(LINKER_
bae0: 54 45 53 54 46 4c 41 47 53 29 5d 0d 0a 23 20 41 TESTFLAGS)]..# A
baf0: 6c 69 67 6e 20 73 65 63 74 69 6f 6e 73 20 66 6f lign sections fo
bb00: 72 20 50 45 20 73 69 7a 65 20 73 61 76 69 6e 67 r PE size saving
bb10: 73 2e 0d 0a 6c 66 6c 61 67 73 09 3d 20 24 28 6c s...lflags.= $(l
bb20: 66 6c 61 67 73 29 20 2d 6f 70 74 3a 6e 6f 77 69 flags) -opt:nowi
bb30: 6e 39 38 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e n98..!endif..!en
bb40: 64 69 66 0d 0a 0d 0a 64 6c 6c 6c 66 6c 61 67 73 dif....dlllflags
bb50: 20 3d 20 24 28 6c 66 6c 61 67 73 29 20 2d 64 6c = $(lflags) -dl
bb60: 6c 0d 0a 63 6f 6e 6c 66 6c 61 67 73 20 3d 20 24 l..conlflags = $
bb70: 28 6c 66 6c 61 67 73 29 20 2d 73 75 62 73 79 73 (lflags) -subsys
bb80: 74 65 6d 3a 63 6f 6e 73 6f 6c 65 0d 0a 67 75 69 tem:console..gui
bb90: 6c 66 6c 61 67 73 20 3d 20 24 28 6c 66 6c 61 67 lflags = $(lflag
bba0: 73 29 20 2d 73 75 62 73 79 73 74 65 6d 3a 77 69 s) -subsystem:wi
bbb0: 6e 64 6f 77 73 0d 0a 0d 0a 23 20 4c 69 62 72 61 ndows....# Libra
bbc0: 72 69 65 73 20 74 68 61 74 20 61 72 65 20 72 65 ries that are re
bbd0: 71 75 69 72 65 64 20 66 6f 72 20 65 76 65 72 79 quired for every
bbe0: 20 69 6d 61 67 65 2e 0d 0a 23 20 45 78 74 65 6e image...# Exten
bbf0: 73 69 6f 6e 73 20 73 68 6f 75 6c 64 20 64 65 66 sions should def
bc00: 69 6e 65 20 61 6e 79 20 61 64 64 69 74 69 6f 6e ine any addition
bc10: 61 6c 20 6c 69 62 72 61 72 69 65 73 20 77 69 74 al libraries wit
bc20: 68 20 24 28 50 52 4a 5f 4c 49 42 53 29 0d 0a 77 h $(PRJ_LIBS)..w
bc30: 69 6e 6c 69 62 73 20 20 20 3d 20 6b 65 72 6e 65 inlibs = kerne
bc40: 6c 33 32 2e 6c 69 62 20 61 64 76 61 70 69 33 32 l32.lib advapi32
bc50: 2e 6c 69 62 0d 0a 0d 0a 21 69 66 20 24 28 4e 45 .lib....!if $(NE
bc60: 45 44 5f 54 4b 29 0d 0a 77 69 6e 6c 69 62 73 20 ED_TK)..winlibs
bc70: 3d 20 24 28 77 69 6e 6c 69 62 73 29 20 67 64 69 = $(winlibs) gdi
bc80: 33 32 2e 6c 69 62 20 75 73 65 72 33 32 2e 6c 69 32.lib user32.li
bc90: 62 20 75 78 74 68 65 6d 65 2e 6c 69 62 0d 0a 21 b uxtheme.lib..!
bca0: 65 6e 64 69 66 0d 0a 0d 0a 23 20 41 76 6f 69 64 endif....# Avoid
bcb0: 20 27 75 6e 72 65 73 6f 6c 76 65 64 20 65 78 74 'unresolved ext
bcc0: 65 72 6e 61 6c 20 73 79 6d 62 6f 6c 20 5f 5f 73 ernal symbol __s
bcd0: 65 63 75 72 69 74 79 5f 63 6f 6f 6b 69 65 27 20 ecurity_cookie'
bce0: 65 72 72 6f 72 73 2e 0d 0a 23 20 63 2e 66 2e 20 errors...# c.f.
bcf0: 68 74 74 70 3a 2f 2f 73 75 70 70 6f 72 74 2e 6d http://support.m
bd00: 69 63 72 6f 73 6f 66 74 2e 63 6f 6d 2f 3f 69 64 icrosoft.com/?id
bd10: 3d 38 39 34 35 37 33 0d 0a 21 69 66 20 22 24 28 =894573..!if "$(
bd20: 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 4d MACHINE)" == "AM
bd30: 44 36 34 22 0d 0a 21 69 66 20 24 28 56 43 56 45 D64"..!if $(VCVE
bd40: 52 53 49 4f 4e 29 20 3e 20 31 33 39 39 20 26 26 RSION) > 1399 &&
bd50: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3c 20 $(VCVERSION) <
bd60: 31 35 30 30 0d 0a 77 69 6e 6c 69 62 73 20 20 20 1500..winlibs
bd70: 3d 20 24 28 77 69 6e 6c 69 62 73 29 20 62 75 66 = $(winlibs) buf
bd80: 66 65 72 6f 76 65 72 66 6c 6f 77 55 2e 6c 69 62 feroverflowU.lib
bd90: 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 ..!endif..!endif
bda0: 0d 0a 0d 0a 62 61 73 65 6c 69 62 73 20 3d 20 24 ....baselibs = $
bdb0: 28 77 69 6e 6c 69 62 73 29 20 24 28 50 52 4a 5f (winlibs) $(PRJ_
bdc0: 4c 49 42 53 29 0d 0a 0d 0a 21 69 66 20 24 28 4d LIBS)....!if $(M
bdd0: 53 56 43 52 54 29 20 26 26 20 21 28 24 28 44 45 SVCRT) && !($(DE
bde0: 42 55 47 29 20 26 26 20 21 24 28 55 4e 43 48 45 BUG) && !$(UNCHE
bdf0: 43 4b 45 44 29 29 20 26 26 20 24 28 56 43 56 45 CKED)) && $(VCVE
be00: 52 53 49 4f 4e 29 20 3e 3d 20 31 39 30 30 0d 0a RSION) >= 1900..
be10: 62 61 73 65 6c 69 62 73 20 20 20 3d 20 24 28 62 baselibs = $(b
be20: 61 73 65 6c 69 62 73 29 20 75 63 72 74 2e 6c 69 aselibs) ucrt.li
be30: 62 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 23 23 b..!endif....###
be40: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
be50: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
be60: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
be70: 23 23 23 23 23 23 23 23 23 23 23 23 23 0d 0a 23 #############..#
be80: 20 31 33 2e 20 44 65 66 69 6e 65 20 73 74 61 6e 13. Define stan
be90: 64 61 72 64 20 63 6f 6d 6d 61 6e 64 73 2c 20 63 dard commands, c
bea0: 6f 6d 6d 6f 6e 20 6d 61 6b 65 20 74 61 72 67 65 ommon make targe
beb0: 74 73 20 61 6e 64 20 69 6d 70 6c 69 63 69 74 20 ts and implicit
bec0: 72 75 6c 65 73 0d 0a 0d 0a 43 43 50 4b 47 43 4d rules....CCPKGCM
bed0: 44 20 3d 20 24 28 63 63 33 32 29 20 24 28 70 6b D = $(cc32) $(pk
bee0: 67 63 66 6c 61 67 73 29 20 2d 46 6f 24 28 54 4d gcflags) -Fo$(TM
bef0: 50 5f 44 49 52 29 5e 5c 0d 0a 43 43 41 50 50 43 P_DIR)^\..CCAPPC
bf00: 4d 44 20 3d 20 24 28 63 63 33 32 29 20 24 28 61 MD = $(cc32) $(a
bf10: 70 70 63 66 6c 61 67 73 29 20 2d 46 6f 24 28 54 ppcflags) -Fo$(T
bf20: 4d 50 5f 44 49 52 29 5e 5c 0d 0a 43 43 53 54 55 MP_DIR)^\..CCSTU
bf30: 42 53 43 4d 44 20 3d 20 24 28 63 63 33 32 29 20 BSCMD = $(cc32)
bf40: 24 28 73 74 75 62 73 63 66 6c 61 67 73 29 20 2d $(stubscflags) -
bf50: 46 6f 24 28 54 4d 50 5f 44 49 52 29 5e 5c 0d 0a Fo$(TMP_DIR)^\..
bf60: 0d 0a 4c 49 42 43 4d 44 20 3d 20 24 28 6c 69 62 ..LIBCMD = $(lib
bf70: 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20 24 28 4c 49 32) -nologo $(LI
bf80: 4e 4b 45 52 46 4c 41 47 53 29 20 2d 6f 75 74 3a NKERFLAGS) -out:
bf90: 24 40 0d 0a 44 4c 4c 43 4d 44 20 3d 20 24 28 6c $@..DLLCMD = $(l
bfa0: 69 6e 6b 33 32 29 20 24 28 64 6c 6c 6c 66 6c 61 ink32) $(dlllfla
bfb0: 67 73 29 20 2d 6f 75 74 3a 24 40 20 24 28 62 61 gs) -out:$@ $(ba
bfc0: 73 65 6c 69 62 73 29 20 24 28 74 63 6c 6c 69 62 selibs) $(tcllib
bfd0: 73 29 20 24 28 74 6b 6c 69 62 73 29 0d 0a 0d 0a s) $(tklibs)....
bfe0: 43 4f 4e 45 58 45 43 4d 44 20 3d 20 24 28 6c 69 CONEXECMD = $(li
bff0: 6e 6b 33 32 29 20 24 28 63 6f 6e 6c 66 6c 61 67 nk32) $(conlflag
c000: 73 29 20 2d 6f 75 74 3a 24 40 20 24 28 62 61 73 s) -out:$@ $(bas
c010: 65 6c 69 62 73 29 20 24 28 74 63 6c 6c 69 62 73 elibs) $(tcllibs
c020: 29 20 24 28 74 6b 6c 69 62 73 29 0d 0a 47 55 49 ) $(tklibs)..GUI
c030: 45 58 45 43 4d 44 20 3d 20 24 28 6c 69 6e 6b 33 EXECMD = $(link3
c040: 32 29 20 24 28 67 75 69 6c 66 6c 61 67 73 29 20 2) $(guilflags)
c050: 2d 6f 75 74 3a 24 40 20 24 28 62 61 73 65 6c 69 -out:$@ $(baseli
c060: 62 73 29 20 24 28 74 63 6c 6c 69 62 73 29 20 24 bs) $(tcllibs) $
c070: 28 74 6b 6c 69 62 73 29 0d 0a 52 45 53 43 4d 44 (tklibs)..RESCMD
c080: 20 20 3d 20 24 28 72 63 33 32 29 20 2d 66 6f 20 = $(rc32) -fo
c090: 24 40 20 2d 72 20 2d 69 20 22 24 28 47 45 4e 45 $@ -r -i "$(GENE
c0a0: 52 49 43 44 49 52 29 22 20 2d 69 20 22 24 28 54 RICDIR)" -i "$(T
c0b0: 4d 50 5f 44 49 52 29 22 20 5c 0d 0a 09 20 20 20 MP_DIR)" \...
c0c0: 20 24 28 54 43 4c 5f 49 4e 43 4c 55 44 45 53 29 $(TCL_INCLUDES)
c0d0: 20 5c 0d 0a 09 20 20 20 20 2d 44 44 45 42 55 47 \... -DDEBUG
c0e0: 3d 24 28 44 45 42 55 47 29 20 2d 64 20 55 4e 43 =$(DEBUG) -d UNC
c0f0: 48 45 43 4b 45 44 3d 24 28 55 4e 43 48 45 43 4b HECKED=$(UNCHECK
c100: 45 44 29 20 5c 0d 0a 09 20 20 20 20 2d 44 43 4f ED) \... -DCO
c110: 4d 4d 41 56 45 52 53 49 4f 4e 3d 24 28 44 4f 54 MMAVERSION=$(DOT
c120: 56 45 52 53 49 4f 4e 3a 2e 3d 2c 29 2c 30 20 5c VERSION:.=,),0 \
c130: 0d 0a 09 20 20 20 20 2d 44 44 4f 54 56 45 52 53 ... -DDOTVERS
c140: 49 4f 4e 3d 5c 22 24 28 44 4f 54 56 45 52 53 49 ION=\"$(DOTVERSI
c150: 4f 4e 29 5c 22 20 5c 0d 0a 09 20 20 20 20 2d 44 ON)\" \... -D
c160: 56 45 52 53 49 4f 4e 3d 5c 22 24 28 56 45 52 53 VERSION=\"$(VERS
c170: 49 4f 4e 29 5c 22 20 5c 0d 0a 09 20 20 20 20 2d ION)\" \... -
c180: 44 53 55 46 58 3d 5c 22 24 28 53 55 46 58 29 5c DSUFX=\"$(SUFX)\
c190: 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 " \..
c1a0: 20 2d 44 50 52 4f 4a 45 43 54 3d 5c 22 24 28 50 -DPROJECT=\"$(P
c1b0: 52 4f 4a 45 43 54 29 5c 22 20 5c 0d 0a 20 20 20 ROJECT)\" \..
c1c0: 20 20 20 20 20 20 20 20 20 2d 44 50 52 4a 4c 49 -DPRJLI
c1d0: 42 4e 41 4d 45 3d 5c 22 24 28 50 52 4a 4c 49 42 BNAME=\"$(PRJLIB
c1e0: 4e 41 4d 45 29 5c 22 20 0d 0a 0d 0a 21 69 66 6e NAME)\" ....!ifn
c1f0: 64 65 66 20 44 45 46 41 55 4c 54 5f 42 55 49 4c def DEFAULT_BUIL
c200: 44 5f 54 41 52 47 45 54 0d 0a 44 45 46 41 55 4c D_TARGET..DEFAUL
c210: 54 5f 42 55 49 4c 44 5f 54 41 52 47 45 54 20 3d T_BUILD_TARGET =
c220: 20 24 28 50 52 4f 4a 45 43 54 29 0d 0a 21 65 6e $(PROJECT)..!en
c230: 64 69 66 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 74 dif....default-t
c240: 61 72 67 65 74 3a 20 24 28 44 45 46 41 55 4c 54 arget: $(DEFAULT
c250: 5f 42 55 49 4c 44 5f 54 41 52 47 45 54 29 0d 0a _BUILD_TARGET)..
c260: 0d 0a 64 65 66 61 75 6c 74 2d 70 6b 67 69 6e 64 ..default-pkgind
c270: 65 78 3a 0d 0a 09 40 65 63 68 6f 20 70 61 63 6b ex:...@echo pack
c280: 61 67 65 20 69 66 6e 65 65 64 65 64 20 24 28 50 age ifneeded $(P
c290: 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 RJ_PACKAGE_TCLNA
c2a0: 4d 45 29 20 24 28 44 4f 54 56 45 52 53 49 4f 4e ME) $(DOTVERSION
c2b0: 29 20 5c 0d 0a 09 20 20 20 20 5b 6c 69 73 74 20 ) \... [list
c2c0: 6c 6f 61 64 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 load [file join
c2d0: 24 24 64 69 72 20 24 28 50 52 4a 4c 49 42 4e 41 $$dir $(PRJLIBNA
c2e0: 4d 45 29 5d 5d 20 3e 20 24 28 4f 55 54 5f 44 49 ME)]] > $(OUT_DI
c2f0: 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0d R)\pkgIndex.tcl.
c300: 0a 0d 0a 64 65 66 61 75 6c 74 2d 70 6b 67 69 6e ...default-pkgin
c310: 64 65 78 2d 74 65 61 3a 0d 0a 09 40 69 66 20 65 dex-tea:...@if e
c320: 78 69 73 74 20 24 28 52 4f 4f 54 29 5c 70 6b 67 xist $(ROOT)\pkg
c330: 49 6e 64 65 78 2e 74 63 6c 2e 69 6e 20 6e 6d 61 Index.tcl.in nma
c340: 6b 65 68 6c 70 20 2d 73 20 3c 3c 20 24 28 52 4f kehlp -s << $(RO
c350: 4f 54 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c OT)\pkgIndex.tcl
c360: 2e 69 6e 20 3e 20 24 28 4f 55 54 5f 44 49 52 29 .in > $(OUT_DIR)
c370: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0d 0a 40 \pkgIndex.tcl..@
c380: 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e 40 PACKAGE_VERSION@
c390: 20 20 20 20 24 28 44 4f 54 56 45 52 53 49 4f 4e $(DOTVERSION
c3a0: 29 0d 0a 40 50 41 43 4b 41 47 45 5f 4e 41 4d 45 )..@PACKAGE_NAME
c3b0: 40 20 20 20 20 20 20 20 24 28 50 52 4a 5f 50 41 @ $(PRJ_PA
c3c0: 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 0d 0a CKAGE_TCLNAME)..
c3d0: 40 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 @PACKAGE_TCLNAME
c3e0: 40 20 20 20 20 24 28 50 52 4a 5f 50 41 43 4b 41 @ $(PRJ_PACKA
c3f0: 47 45 5f 54 43 4c 4e 41 4d 45 29 0d 0a 40 50 4b GE_TCLNAME)..@PK
c400: 47 5f 4c 49 42 5f 46 49 4c 45 40 20 20 20 20 20 G_LIB_FILE@
c410: 20 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 29 0d $(PRJLIBNAME).
c420: 0a 3c 3c 0d 0a 0d 0a 0d 0a 64 65 66 61 75 6c 74 .<<......default
c430: 2d 69 6e 73 74 61 6c 6c 3a 20 64 65 66 61 75 6c -install: defaul
c440: 74 2d 69 6e 73 74 61 6c 6c 2d 62 69 6e 61 72 69 t-install-binari
c450: 65 73 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 es default-insta
c460: 6c 6c 2d 6c 69 62 72 61 72 69 65 73 0d 0a 0d 0a ll-libraries....
c470: 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d default-install-
c480: 62 69 6e 61 72 69 65 73 3a 20 24 28 50 52 4a 4c binaries: $(PRJL
c490: 49 42 29 0d 0a 09 40 65 63 68 6f 20 49 6e 73 74 IB)...@echo Inst
c4a0: 61 6c 6c 69 6e 67 20 62 69 6e 61 72 69 65 73 20 alling binaries
c4b0: 74 6f 20 27 24 28 53 43 52 49 50 54 5f 49 4e 53 to '$(SCRIPT_INS
c4c0: 54 41 4c 4c 5f 44 49 52 29 27 0d 0a 09 40 69 66 TALL_DIR)'...@if
c4d0: 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28 53 43 not exist "$(SC
c4e0: 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 RIPT_INSTALL_DIR
c4f0: 29 22 20 6d 6b 64 69 72 20 22 24 28 53 43 52 49 )" mkdir "$(SCRI
c500: 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 PT_INSTALL_DIR)"
c510: 0d 0a 09 40 24 28 43 50 59 29 20 24 28 50 52 4a ...@$(CPY) $(PRJ
c520: 4c 49 42 29 20 22 24 28 53 43 52 49 50 54 5f 49 LIB) "$(SCRIPT_I
c530: 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 3e 4e 55 NSTALL_DIR)" >NU
c540: 4c 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 69 6e 73 L....default-ins
c550: 74 61 6c 6c 2d 6c 69 62 72 61 72 69 65 73 3a 20 tall-libraries:
c560: 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e $(OUT_DIR)\pkgIn
c570: 64 65 78 2e 74 63 6c 0d 0a 09 40 65 63 68 6f 20 dex.tcl...@echo
c580: 49 6e 73 74 61 6c 6c 69 6e 67 20 6c 69 62 72 61 Installing libra
c590: 72 69 65 73 20 74 6f 20 27 24 28 53 43 52 49 50 ries to '$(SCRIP
c5a0: 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0d T_INSTALL_DIR)'.
c5b0: 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 4c 49 ..@if exist $(LI
c5c0: 42 44 49 52 29 20 24 28 43 50 59 29 20 24 28 4c BDIR) $(CPY) $(L
c5d0: 49 42 44 49 52 29 5c 2a 2e 74 63 6c 20 22 24 28 IBDIR)\*.tcl "$(
c5e0: 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 SCRIPT_INSTALL_D
c5f0: 49 52 29 22 0d 0a 09 40 65 63 68 6f 20 49 6e 73 IR)"...@echo Ins
c600: 74 61 6c 6c 69 6e 67 20 70 61 63 6b 61 67 65 20 talling package
c610: 69 6e 64 65 78 20 69 6e 20 27 24 28 53 43 52 49 index in '$(SCRI
c620: 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 PT_INSTALL_DIR)'
c630: 0d 0a 09 40 24 28 43 50 59 29 20 24 28 4f 55 54 ...@$(CPY) $(OUT
c640: 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 _DIR)\pkgIndex.t
c650: 63 6c 20 24 28 53 43 52 49 50 54 5f 49 4e 53 54 cl $(SCRIPT_INST
c660: 41 4c 4c 5f 44 49 52 29 0d 0a 0d 0a 64 65 66 61 ALL_DIR)....defa
c670: 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 73 74 75 62 ult-install-stub
c680: 73 3a 0d 0a 09 40 65 63 68 6f 20 49 6e 73 74 61 s:...@echo Insta
c690: 6c 6c 69 6e 67 20 73 74 75 62 73 20 6c 69 62 72 lling stubs libr
c6a0: 61 72 79 20 74 6f 20 27 24 28 53 43 52 49 50 54 ary to '$(SCRIPT
c6b0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0d 0a _INSTALL_DIR)'..
c6c0: 09 40 69 66 20 6e 6f 74 20 65 78 69 73 74 20 22 .@if not exist "
c6d0: 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c $(SCRIPT_INSTALL
c6e0: 5f 44 49 52 29 22 20 6d 6b 64 69 72 20 22 24 28 _DIR)" mkdir "$(
c6f0: 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 SCRIPT_INSTALL_D
c700: 49 52 29 22 0d 0a 09 40 24 28 43 50 59 29 20 24 IR)"...@$(CPY) $
c710: 28 50 52 4a 53 54 55 42 4c 49 42 29 20 22 24 28 (PRJSTUBLIB) "$(
c720: 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 SCRIPT_INSTALL_D
c730: 49 52 29 22 20 3e 4e 55 4c 0d 0a 0d 0a 64 65 66 IR)" >NUL....def
c740: 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 64 6f 63 ault-install-doc
c750: 73 2d 68 74 6d 6c 3a 0d 0a 09 40 65 63 68 6f 20 s-html:...@echo
c760: 49 6e 73 74 61 6c 6c 69 6e 67 20 64 6f 63 75 6d Installing docum
c770: 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65 73 20 74 entation files t
c780: 6f 20 27 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c o '$(DOC_INSTALL
c790: 5f 44 49 52 29 27 0d 0a 09 40 69 66 20 6e 6f 74 _DIR)'...@if not
c7a0: 20 65 78 69 73 74 20 22 24 28 44 4f 43 5f 49 4e exist "$(DOC_IN
c7b0: 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 STALL_DIR)" mkdi
c7c0: 72 20 22 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c r "$(DOC_INSTALL
c7d0: 5f 44 49 52 29 22 0d 0a 09 40 69 66 20 65 78 69 _DIR)"...@if exi
c7e0: 73 74 20 24 28 44 4f 43 44 49 52 29 20 66 6f 72 st $(DOCDIR) for
c7f0: 20 25 66 20 69 6e 20 28 22 24 28 44 4f 43 44 49 %f in ("$(DOCDI
c800: 52 29 5c 2a 2e 68 74 6d 6c 22 20 22 24 28 44 4f R)\*.html" "$(DO
c810: 43 44 49 52 29 5c 2a 2e 63 73 73 22 20 22 24 28 CDIR)\*.css" "$(
c820: 44 4f 43 44 49 52 29 5c 2a 2e 70 6e 67 22 29 20 DOCDIR)\*.png")
c830: 64 6f 20 40 24 28 43 4f 50 59 29 20 25 66 20 22 do @$(COPY) %f "
c840: 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 $(DOC_INSTALL_DI
c850: 52 29 22 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 69 R)"....default-i
c860: 6e 73 74 61 6c 6c 2d 64 6f 63 73 2d 6e 3a 0d 0a nstall-docs-n:..
c870: 09 40 65 63 68 6f 20 49 6e 73 74 61 6c 6c 69 6e .@echo Installin
c880: 67 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 g documentation
c890: 66 69 6c 65 73 20 74 6f 20 27 24 28 44 4f 43 5f files to '$(DOC_
c8a0: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0d 0a 09 INSTALL_DIR)'...
c8b0: 40 69 66 20 6e 6f 74 20 65 78 69 73 74 20 22 24 @if not exist "$
c8c0: 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 (DOC_INSTALL_DIR
c8d0: 29 22 20 6d 6b 64 69 72 20 22 24 28 44 4f 43 5f )" mkdir "$(DOC_
c8e0: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0d 0a 09 INSTALL_DIR)"...
c8f0: 40 69 66 20 65 78 69 73 74 20 24 28 44 4f 43 44 @if exist $(DOCD
c900: 49 52 29 20 66 6f 72 20 25 66 20 69 6e 20 28 22 IR) for %f in ("
c910: 24 28 44 4f 43 44 49 52 29 5c 2a 2e 6e 22 29 20 $(DOCDIR)\*.n")
c920: 64 6f 20 40 24 28 43 4f 50 59 29 20 25 66 20 22 do @$(COPY) %f "
c930: 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 $(DOC_INSTALL_DI
c940: 52 29 22 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 69 R)"....default-i
c950: 6e 73 74 61 6c 6c 2d 64 65 6d 6f 73 3a 0d 0a 09 nstall-demos:...
c960: 40 65 63 68 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 @echo Installing
c970: 20 64 65 6d 6f 73 20 74 6f 20 27 24 28 44 45 4d demos to '$(DEM
c980: 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0d O_INSTALL_DIR)'.
c990: 0a 09 40 69 66 20 6e 6f 74 20 65 78 69 73 74 20 ..@if not exist
c9a0: 22 24 28 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f "$(DEMO_INSTALL_
c9b0: 44 49 52 29 22 20 6d 6b 64 69 72 20 22 24 28 44 DIR)" mkdir "$(D
c9c0: 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 EMO_INSTALL_DIR)
c9d0: 22 0d 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 "...@if exist $(
c9e0: 44 45 4d 4f 44 49 52 29 20 24 28 43 50 59 44 49 DEMODIR) $(CPYDI
c9f0: 52 29 20 22 24 28 44 45 4d 4f 44 49 52 29 22 20 R) "$(DEMODIR)"
ca00: 22 24 28 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f "$(DEMO_INSTALL_
ca10: 44 49 52 29 22 0d 0a 0d 0a 64 65 66 61 75 6c 74 DIR)"....default
ca20: 2d 63 6c 65 61 6e 3a 0d 0a 09 40 65 63 68 6f 20 -clean:...@echo
ca30: 43 6c 65 61 6e 69 6e 67 20 24 28 54 4d 50 5f 44 Cleaning $(TMP_D
ca40: 49 52 29 5c 2a 20 2e 2e 2e 0d 0a 09 40 69 66 20 IR)\* ......@if
ca50: 65 78 69 73 74 20 24 28 54 4d 50 5f 44 49 52 29 exist $(TMP_DIR)
ca60: 5c 6e 75 6c 20 24 28 52 4d 44 49 52 29 20 24 28 \nul $(RMDIR) $(
ca70: 54 4d 50 5f 44 49 52 29 0d 0a 09 40 65 63 68 6f TMP_DIR)...@echo
ca80: 20 43 6c 65 61 6e 69 6e 67 20 24 28 57 49 4e 44 Cleaning $(WIND
ca90: 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f 62 6a IR)\nmakehlp.obj
caa0: 2c 20 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 20 2e , nmakehlp.exe .
cab0: 2e 2e 0d 0a 09 40 69 66 20 65 78 69 73 74 20 24 .....@if exist $
cac0: 28 57 49 4e 44 49 52 29 5c 6e 6d 61 6b 65 68 6c (WINDIR)\nmakehl
cad0: 70 2e 6f 62 6a 20 64 65 6c 20 24 28 57 49 4e 44 p.obj del $(WIND
cae0: 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f 62 6a IR)\nmakehlp.obj
caf0: 0d 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 57 ...@if exist $(W
cb00: 49 4e 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e INDIR)\nmakehlp.
cb10: 65 78 65 20 64 65 6c 20 24 28 57 49 4e 44 49 52 exe del $(WINDIR
cb20: 29 5c 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 0d 0a )\nmakehlp.exe..
cb30: 09 40 69 66 20 65 78 69 73 74 20 24 28 57 49 4e .@if exist $(WIN
cb40: 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f 75 DIR)\nmakehlp.ou
cb50: 74 20 64 65 6c 20 24 28 57 49 4e 44 49 52 29 5c t del $(WINDIR)\
cb60: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0d 0a 09 40 nmakehlp.out...@
cb70: 65 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24 28 echo Cleaning $(
cb80: 57 49 4e 44 49 52 29 5c 6e 6d 68 6c 70 2d 6f 75 WINDIR)\nmhlp-ou
cb90: 74 2e 74 78 74 20 2e 2e 2e 0d 0a 09 40 69 66 20 t.txt ......@if
cba0: 65 78 69 73 74 20 24 28 57 49 4e 44 49 52 29 5c exist $(WINDIR)\
cbb0: 6e 6d 68 6c 70 2d 6f 75 74 2e 74 78 74 20 64 65 nmhlp-out.txt de
cbc0: 6c 20 24 28 57 49 4e 44 49 52 29 5c 6e 6d 68 6c l $(WINDIR)\nmhl
cbd0: 70 2d 6f 75 74 2e 74 78 74 0d 0a 09 40 65 63 68 p-out.txt...@ech
cbe0: 6f 20 43 6c 65 61 6e 69 6e 67 20 24 28 57 49 4e o Cleaning $(WIN
cbf0: 44 49 52 29 5c 5f 6a 75 6e 6b 2e 70 63 68 20 2e DIR)\_junk.pch .
cc00: 2e 2e 0d 0a 09 40 69 66 20 65 78 69 73 74 20 24 .....@if exist $
cc10: 28 57 49 4e 44 49 52 29 5c 5f 6a 75 6e 6b 2e 70 (WINDIR)\_junk.p
cc20: 63 68 20 64 65 6c 20 24 28 57 49 4e 44 49 52 29 ch del $(WINDIR)
cc30: 5c 5f 6a 75 6e 6b 2e 70 63 68 0d 0a 09 40 65 63 \_junk.pch...@ec
cc40: 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24 28 57 49 ho Cleaning $(WI
cc50: 4e 44 49 52 29 5c 76 65 72 63 6c 2e 78 2c 20 76 NDIR)\vercl.x, v
cc60: 65 72 63 6c 2e 69 20 2e 2e 2e 0d 0a 09 40 69 66 ercl.i ......@if
cc70: 20 65 78 69 73 74 20 24 28 57 49 4e 44 49 52 29 exist $(WINDIR)
cc80: 5c 76 65 72 63 6c 2e 78 20 64 65 6c 20 24 28 57 \vercl.x del $(W
cc90: 49 4e 44 49 52 29 5c 76 65 72 63 6c 2e 78 0d 0a INDIR)\vercl.x..
cca0: 09 40 69 66 20 65 78 69 73 74 20 24 28 57 49 4e .@if exist $(WIN
ccb0: 44 49 52 29 5c 76 65 72 63 6c 2e 69 20 64 65 6c DIR)\vercl.i del
ccc0: 20 24 28 57 49 4e 44 49 52 29 5c 76 65 72 63 6c $(WINDIR)\vercl
ccd0: 2e 69 0d 0a 09 40 65 63 68 6f 20 43 6c 65 61 6e .i...@echo Clean
cce0: 69 6e 67 20 24 28 57 49 4e 44 49 52 29 5c 76 65 ing $(WINDIR)\ve
ccf0: 72 73 69 6f 6e 73 2e 76 63 2c 20 76 65 72 73 69 rsions.vc, versi
cd00: 6f 6e 2e 76 63 20 2e 2e 2e 0d 0a 09 40 69 66 20 on.vc ......@if
cd10: 65 78 69 73 74 20 24 28 57 49 4e 44 49 52 29 5c exist $(WINDIR)\
cd20: 76 65 72 73 69 6f 6e 73 2e 76 63 20 64 65 6c 20 versions.vc del
cd30: 24 28 57 49 4e 44 49 52 29 5c 76 65 72 73 69 6f $(WINDIR)\versio
cd40: 6e 73 2e 76 63 0d 0a 09 40 69 66 20 65 78 69 73 ns.vc...@if exis
cd50: 74 20 24 28 57 49 4e 44 49 52 29 5c 76 65 72 73 t $(WINDIR)\vers
cd60: 69 6f 6e 2e 76 63 20 64 65 6c 20 24 28 57 49 4e ion.vc del $(WIN
cd70: 44 49 52 29 5c 76 65 72 73 69 6f 6e 2e 76 63 0d DIR)\version.vc.
cd80: 0a 0d 0a 64 65 66 61 75 6c 74 2d 68 6f 73 65 3a ...default-hose:
cd90: 20 64 65 66 61 75 6c 74 2d 63 6c 65 61 6e 0d 0a default-clean..
cda0: 09 40 65 63 68 6f 20 48 6f 73 69 6e 67 20 24 28 .@echo Hosing $(
cdb0: 4f 55 54 5f 44 49 52 29 5c 2a 20 2e 2e 2e 0d 0a OUT_DIR)\* .....
cdc0: 09 40 69 66 20 65 78 69 73 74 20 24 28 4f 55 54 .@if exist $(OUT
cdd0: 5f 44 49 52 29 5c 6e 75 6c 20 24 28 52 4d 44 49 _DIR)\nul $(RMDI
cde0: 52 29 20 24 28 4f 55 54 5f 44 49 52 29 0d 0a 0d R) $(OUT_DIR)...
cdf0: 0a 23 20 4f 6e 6c 79 20 66 6f 72 20 62 61 63 6b .# Only for back
ce00: 77 61 72 64 20 63 6f 6d 70 61 74 69 62 69 6c 69 ward compatibili
ce10: 74 79 0d 0a 64 65 66 61 75 6c 74 2d 64 69 73 74 ty..default-dist
ce20: 63 6c 65 61 6e 3a 20 64 65 66 61 75 6c 74 2d 68 clean: default-h
ce30: 6f 73 65 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 73 ose....default-s
ce40: 65 74 75 70 3a 0d 0a 09 40 69 66 20 6e 6f 74 20 etup:...@if not
ce50: 65 78 69 73 74 20 24 28 4f 55 54 5f 44 49 52 29 exist $(OUT_DIR)
ce60: 5c 6e 75 6c 20 6d 6b 64 69 72 20 24 28 4f 55 54 \nul mkdir $(OUT
ce70: 5f 44 49 52 29 0d 0a 09 40 69 66 20 6e 6f 74 20 _DIR)...@if not
ce80: 65 78 69 73 74 20 24 28 54 4d 50 5f 44 49 52 29 exist $(TMP_DIR)
ce90: 5c 6e 75 6c 20 6d 6b 64 69 72 20 24 28 54 4d 50 \nul mkdir $(TMP
cea0: 5f 44 49 52 29 0d 0a 0d 0a 21 69 66 20 22 24 28 _DIR)....!if "$(
ceb0: 54 45 53 54 50 41 54 29 22 20 21 3d 20 22 22 0d TESTPAT)" != "".
cec0: 0a 54 45 53 54 46 4c 41 47 53 20 3d 20 24 28 54 .TESTFLAGS = $(T
ced0: 45 53 54 46 4c 41 47 53 29 20 2d 66 69 6c 65 20 ESTFLAGS) -file
cee0: 24 28 54 45 53 54 50 41 54 29 0d 0a 21 65 6e 64 $(TESTPAT)..!end
cef0: 69 66 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 74 65 if....default-te
cf00: 73 74 3a 20 64 65 66 61 75 6c 74 2d 73 65 74 75 st: default-setu
cf10: 70 20 24 28 50 52 4f 4a 45 43 54 29 0d 0a 09 40 p $(PROJECT)...@
cf20: 73 65 74 20 54 43 4c 4c 49 42 50 41 54 48 3d 24 set TCLLIBPATH=$
cf30: 28 4f 55 54 5f 44 49 52 3a 5c 3d 2f 29 0d 0a 09 (OUT_DIR:\=/)...
cf40: 40 69 66 20 65 78 69 73 74 20 24 28 4c 49 42 44 @if exist $(LIBD
cf50: 49 52 29 20 66 6f 72 20 25 66 20 69 6e 20 28 22 IR) for %f in ("
cf60: 24 28 4c 49 42 44 49 52 29 5c 2a 2e 74 63 6c 22 $(LIBDIR)\*.tcl"
cf70: 29 20 64 6f 20 40 24 28 43 4f 50 59 29 20 25 66 ) do @$(COPY) %f
cf80: 20 22 24 28 4f 55 54 5f 44 49 52 29 22 0d 0a 09 "$(OUT_DIR)"...
cf90: 63 64 20 22 24 28 54 45 53 54 44 49 52 29 22 20 cd "$(TESTDIR)"
cfa0: 26 26 20 24 28 44 45 42 55 47 47 45 52 29 20 24 && $(DEBUGGER) $
cfb0: 28 54 43 4c 53 48 29 20 61 6c 6c 2e 74 63 6c 20 (TCLSH) all.tcl
cfc0: 24 28 54 45 53 54 46 4c 41 47 53 29 0d 0a 0d 0a $(TESTFLAGS)....
cfd0: 64 65 66 61 75 6c 74 2d 73 68 65 6c 6c 3a 20 64 default-shell: d
cfe0: 65 66 61 75 6c 74 2d 73 65 74 75 70 20 24 28 50 efault-setup $(P
cff0: 52 4f 4a 45 43 54 29 0d 0a 09 40 73 65 74 20 54 ROJECT)...@set T
d000: 43 4c 4c 49 42 50 41 54 48 3d 24 28 4f 55 54 5f CLLIBPATH=$(OUT_
d010: 44 49 52 3a 5c 3d 2f 29 0d 0a 09 40 69 66 20 65 DIR:\=/)...@if e
d020: 78 69 73 74 20 24 28 4c 49 42 44 49 52 29 20 66 xist $(LIBDIR) f
d030: 6f 72 20 25 66 20 69 6e 20 28 22 24 28 4c 49 42 or %f in ("$(LIB
d040: 44 49 52 29 5c 2a 2e 74 63 6c 22 29 20 64 6f 20 DIR)\*.tcl") do
d050: 40 24 28 43 4f 50 59 29 20 25 66 20 22 24 28 4f @$(COPY) %f "$(O
d060: 55 54 5f 44 49 52 29 22 0d 0a 09 24 28 44 45 42 UT_DIR)"...$(DEB
d070: 55 47 47 45 52 29 20 24 28 54 43 4c 53 48 29 0d UGGER) $(TCLSH).
d080: 0a 0d 0a 23 20 47 65 6e 65 72 61 74 69 6f 6e 20 ...# Generation
d090: 6f 66 20 57 69 6e 64 6f 77 73 20 76 65 72 73 69 of Windows versi
d0a0: 6f 6e 20 72 65 73 6f 75 72 63 65 20 0d 0a 21 69 on resource ..!i
d0b0: 66 64 65 66 20 52 43 46 49 4c 45 0d 0a 0d 0a 23 fdef RCFILE....#
d0c0: 20 4e 6f 74 65 3a 20 64 6f 6e 27 74 20 75 73 65 Note: don't use
d0d0: 20 24 2a 2a 20 69 6e 20 62 65 6c 6f 77 20 72 75 $** in below ru
d0e0: 6c 65 20 62 65 63 61 75 73 65 20 74 68 65 72 65 le because there
d0f0: 20 6d 61 79 20 62 65 20 6f 74 68 65 72 20 64 65 may be other de
d100: 70 65 6e 64 65 6e 63 69 65 73 0d 0a 23 20 61 6e pendencies..# an
d110: 64 20 6f 6e 6c 79 20 74 68 65 20 22 6d 61 73 74 d only the "mast
d120: 65 72 22 20 72 63 20 6d 75 73 74 20 62 65 20 70 er" rc must be p
d130: 61 73 73 65 64 20 74 6f 20 74 68 65 20 72 65 73 assed to the res
d140: 6f 75 72 63 65 20 63 6f 6d 70 69 6c 65 72 0d 0a ource compiler..
d150: 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 50 52 4f $(TMP_DIR)\$(PRO
d160: 4a 45 43 54 29 2e 72 65 73 3a 20 24 28 52 43 44 JECT).res: $(RCD
d170: 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 IR)\$(PROJECT).r
d180: 63 0d 0a 09 24 28 52 45 53 43 4d 44 29 20 24 28 c...$(RESCMD) $(
d190: 52 43 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 RCDIR)\$(PROJECT
d1a0: 29 2e 72 63 0d 0a 0d 0a 21 65 6c 73 65 0d 0a 0d ).rc....!else...
d1b0: 0a 23 20 49 66 20 70 61 72 65 6e 74 20 6d 61 6b .# If parent mak
d1c0: 65 66 69 6c 65 20 68 61 73 20 6e 6f 74 20 64 65 efile has not de
d1d0: 66 69 6e 65 64 20 61 20 72 65 73 6f 75 72 63 65 fined a resource
d1e0: 20 64 65 66 69 6e 69 74 69 6f 6e 20 66 69 6c 65 definition file
d1f0: 2c 0d 0a 23 20 77 65 20 77 69 6c 6c 20 67 65 6e ,..# we will gen
d200: 65 72 61 74 65 20 6f 6e 65 20 66 72 6f 6d 20 73 erate one from s
d210: 74 61 6e 64 61 72 64 20 74 65 6d 70 6c 61 74 65 tandard template
d220: 2e 0d 0a 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 ...$(TMP_DIR)\$(
d230: 50 52 4f 4a 45 43 54 29 2e 72 65 73 3a 20 24 28 PROJECT).res: $(
d240: 54 4d 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 TMP_DIR)\$(PROJE
d250: 43 54 29 2e 72 63 0d 0a 0d 0a 24 28 54 4d 50 5f CT).rc....$(TMP_
d260: 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e DIR)\$(PROJECT).
d270: 72 63 3a 0d 0a 09 40 24 28 43 4f 50 59 29 20 3c rc:...@$(COPY) <
d280: 3c 20 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 50 < $(TMP_DIR)\$(P
d290: 52 4f 4a 45 43 54 29 2e 72 63 0d 0a 23 69 6e 63 ROJECT).rc..#inc
d2a0: 6c 75 64 65 20 3c 77 69 6e 76 65 72 2e 68 3e 0d lude <winver.h>.
d2b0: 0a 0d 0a 56 53 5f 56 45 52 53 49 4f 4e 5f 49 4e ...VS_VERSION_IN
d2c0: 46 4f 20 56 45 52 53 49 4f 4e 49 4e 46 4f 0d 0a FO VERSIONINFO..
d2d0: 20 46 49 4c 45 56 45 52 53 49 4f 4e 09 43 4f 4d FILEVERSION.COM
d2e0: 4d 41 56 45 52 53 49 4f 4e 0d 0a 20 50 52 4f 44 MAVERSION.. PROD
d2f0: 55 43 54 56 45 52 53 49 4f 4e 09 43 4f 4d 4d 41 UCTVERSION.COMMA
d300: 56 45 52 53 49 4f 4e 0d 0a 20 46 49 4c 45 46 4c VERSION.. FILEFL
d310: 41 47 53 4d 41 53 4b 09 30 78 33 66 4c 0d 0a 23 AGSMASK.0x3fL..#
d320: 69 66 64 65 66 20 44 45 42 55 47 0d 0a 20 46 49 ifdef DEBUG.. FI
d330: 4c 45 46 4c 41 47 53 09 56 53 5f 46 46 5f 44 45 LEFLAGS.VS_FF_DE
d340: 42 55 47 0d 0a 23 65 6c 73 65 0d 0a 20 46 49 4c BUG..#else.. FIL
d350: 45 46 4c 41 47 53 09 30 78 30 4c 0d 0a 23 65 6e EFLAGS.0x0L..#en
d360: 64 69 66 0d 0a 20 46 49 4c 45 4f 53 09 09 56 4f dif.. FILEOS..VO
d370: 53 5f 4e 54 5f 57 49 4e 44 4f 57 53 33 32 0d 0a S_NT_WINDOWS32..
d380: 20 46 49 4c 45 54 59 50 45 09 56 46 54 5f 44 4c FILETYPE.VFT_DL
d390: 4c 0d 0a 20 46 49 4c 45 53 55 42 54 59 50 45 09 L.. FILESUBTYPE.
d3a0: 30 78 30 4c 0d 0a 42 45 47 49 4e 0d 0a 20 20 20 0x0L..BEGIN..
d3b0: 20 42 4c 4f 43 4b 20 22 53 74 72 69 6e 67 46 69 BLOCK "StringFi
d3c0: 6c 65 49 6e 66 6f 22 0d 0a 20 20 20 20 42 45 47 leInfo".. BEG
d3d0: 49 4e 0d 0a 20 20 20 20 20 20 20 20 42 4c 4f 43 IN.. BLOC
d3e0: 4b 20 22 30 34 30 39 30 34 62 30 22 0d 0a 20 20 K "040904b0"..
d3f0: 20 20 20 20 20 20 42 45 47 49 4e 0d 0a 20 20 20 BEGIN..
d400: 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 20 22 VALUE "
d410: 46 69 6c 65 44 65 73 63 72 69 70 74 69 6f 6e 22 FileDescription"
d420: 2c 20 20 22 54 63 6c 20 65 78 74 65 6e 73 69 6f , "Tcl extensio
d430: 6e 20 22 20 50 52 4f 4a 45 43 54 0d 0a 20 20 20 n " PROJECT..
d440: 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 20 22 VALUE "
d450: 4f 72 69 67 69 6e 61 6c 46 69 6c 65 6e 61 6d 65 OriginalFilename
d460: 22 2c 20 50 52 4a 4c 49 42 4e 41 4d 45 0d 0a 20 ", PRJLIBNAME..
d470: 20 20 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 VALUE
d480: 20 22 46 69 6c 65 56 65 72 73 69 6f 6e 22 2c 20 "FileVersion",
d490: 20 20 20 20 20 44 4f 54 56 45 52 53 49 4f 4e 0d DOTVERSION.
d4a0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 41 4c . VAL
d4b0: 55 45 20 22 50 72 6f 64 75 63 74 4e 61 6d 65 22 UE "ProductName"
d4c0: 2c 20 20 20 20 20 20 22 50 61 63 6b 61 67 65 20 , "Package
d4d0: 22 20 50 52 4f 4a 45 43 54 20 22 20 66 6f 72 20 " PROJECT " for
d4e0: 54 63 6c 22 0d 0a 20 20 20 20 20 20 20 20 20 20 Tcl"..
d4f0: 20 20 56 41 4c 55 45 20 22 50 72 6f 64 75 63 74 VALUE "Product
d500: 56 65 72 73 69 6f 6e 22 2c 20 20 20 44 4f 54 56 Version", DOTV
d510: 45 52 53 49 4f 4e 20 0d 0a 20 20 20 20 20 20 20 ERSION ..
d520: 20 45 4e 44 0d 0a 20 20 20 20 45 4e 44 0d 0a 20 END.. END..
d530: 20 20 20 42 4c 4f 43 4b 20 22 56 61 72 46 69 6c BLOCK "VarFil
d540: 65 49 6e 66 6f 22 0d 0a 20 20 20 20 42 45 47 49 eInfo".. BEGI
d550: 4e 0d 0a 20 20 20 20 20 20 20 20 56 41 4c 55 45 N.. VALUE
d560: 20 22 54 72 61 6e 73 6c 61 74 69 6f 6e 22 2c 20 "Translation",
d570: 30 78 34 30 39 2c 20 31 32 30 30 0d 0a 20 20 20 0x409, 1200..
d580: 20 45 4e 44 0d 0a 45 4e 44 0d 0a 0d 0a 3c 3c 0d END..END....<<.
d590: 0a 0d 0a 21 65 6e 64 69 66 20 23 20 69 66 64 65 ...!endif # ifde
d5a0: 66 20 52 43 46 49 4c 45 0d 0a 0d 0a 21 69 66 6e f RCFILE....!ifn
d5b0: 64 65 66 20 44 49 53 41 42 4c 45 5f 49 4d 50 4c def DISABLE_IMPL
d5c0: 49 43 49 54 5f 52 55 4c 45 53 0d 0a 44 49 53 41 ICIT_RULES..DISA
d5d0: 42 4c 45 5f 49 4d 50 4c 49 43 49 54 5f 52 55 4c BLE_IMPLICIT_RUL
d5e0: 45 53 20 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a ES = 0..!endif..
d5f0: 0d 0a 21 69 66 20 21 24 28 44 49 53 41 42 4c 45 ..!if !$(DISABLE
d600: 5f 49 4d 50 4c 49 43 49 54 5f 52 55 4c 45 53 29 _IMPLICIT_RULES)
d610: 0d 0a 23 20 49 6d 70 6c 69 63 69 74 20 72 75 6c ..# Implicit rul
d620: 65 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 2d 20 e definitions -
d630: 6f 6e 6c 79 20 66 6f 72 20 62 75 69 6c 64 69 6e only for buildin
d640: 67 20 6c 69 62 72 61 72 79 20 6f 62 6a 65 63 74 g library object
d650: 73 2e 20 46 6f 72 20 73 74 75 62 73 20 61 6e 64 s. For stubs and
d660: 0d 0a 23 20 6d 61 69 6e 20 61 70 70 6c 69 63 61 ..# main applica
d670: 74 69 6f 6e 2c 20 74 68 65 20 6d 61 73 74 65 72 tion, the master
d680: 20 6d 61 6b 65 66 69 6c 65 20 73 68 6f 75 6c 64 makefile should
d690: 20 64 65 66 69 6e 65 20 65 78 70 6c 69 63 69 74 define explicit
d6a0: 20 72 75 6c 65 73 2e 0d 0a 0d 0a 7b 24 28 52 4f rules.....{$(RO
d6b0: 4f 54 29 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52 OT)}.c{$(TMP_DIR
d6c0: 29 7d 2e 6f 62 6a 3a 3a 0d 0a 09 24 28 43 43 50 )}.obj::...$(CCP
d6d0: 4b 47 43 4d 44 29 20 40 3c 3c 0d 0a 24 3c 0d 0a KGCMD) @<<..$<..
d6e0: 3c 3c 0d 0a 0d 0a 7b 24 28 57 49 4e 44 49 52 29 <<....{$(WINDIR)
d6f0: 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e }.c{$(TMP_DIR)}.
d700: 6f 62 6a 3a 3a 0d 0a 09 24 28 43 43 50 4b 47 43 obj::...$(CCPKGC
d710: 4d 44 29 20 40 3c 3c 0d 0a 24 3c 0d 0a 3c 3c 0d MD) @<<..$<..<<.
d720: 0a 0d 0a 7b 24 28 47 45 4e 45 52 49 43 44 49 52 ...{$(GENERICDIR
d730: 29 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d )}.c{$(TMP_DIR)}
d740: 2e 6f 62 6a 3a 3a 0d 0a 09 24 28 43 43 50 4b 47 .obj::...$(CCPKG
d750: 43 4d 44 29 20 40 3c 3c 0d 0a 24 3c 0d 0a 3c 3c CMD) @<<..$<..<<
d760: 0d 0a 0d 0a 7b 24 28 43 4f 4d 50 41 54 44 49 52 ....{$(COMPATDIR
d770: 29 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d )}.c{$(TMP_DIR)}
d780: 2e 6f 62 6a 3a 3a 0d 0a 09 24 28 43 43 50 4b 47 .obj::...$(CCPKG
d790: 43 4d 44 29 20 40 3c 3c 0d 0a 24 3c 0d 0a 3c 3c CMD) @<<..$<..<<
d7a0: 0d 0a 0d 0a 7b 24 28 52 43 44 49 52 29 7d 2e 72 ....{$(RCDIR)}.r
d7b0: 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 72 65 c{$(TMP_DIR)}.re
d7c0: 73 3a 0d 0a 09 24 28 52 45 53 43 4d 44 29 20 24 s:...$(RESCMD) $
d7d0: 3c 0d 0a 0d 0a 7b 24 28 57 49 4e 44 49 52 29 7d <....{$(WINDIR)}
d7e0: 2e 72 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e .rc{$(TMP_DIR)}.
d7f0: 72 65 73 3a 0d 0a 09 24 28 52 45 53 43 4d 44 29 res:...$(RESCMD)
d800: 20 24 3c 0d 0a 0d 0a 7b 24 28 54 4d 50 5f 44 49 $<....{$(TMP_DI
d810: 52 29 7d 2e 72 63 7b 24 28 54 4d 50 5f 44 49 52 R)}.rc{$(TMP_DIR
d820: 29 7d 2e 72 65 73 3a 0d 0a 09 24 28 52 45 53 43 )}.res:...$(RESC
d830: 4d 44 29 20 24 3c 0d 0a 0d 0a 2e 53 55 46 46 49 MD) $<.....SUFFI
d840: 58 45 53 3a 0d 0a 2e 53 55 46 46 49 58 45 53 3a XES:...SUFFIXES:
d850: 2e 63 20 2e 72 63 0d 0a 0d 0a 21 65 6e 64 69 66 .c .rc....!endif
d860: 0d 0a 0d 0a 23 23 23 23 23 23 23 23 23 23 23 23 ....############
d870: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
d880: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
d890: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
d8a0: 23 23 23 23 0d 0a 23 20 31 34 2e 20 53 61 6e 69 ####..# 14. Sani
d8b0: 74 79 20 63 68 65 63 6b 20 73 65 6c 65 63 74 65 ty check selecte
d8c0: 64 20 6f 70 74 69 6f 6e 73 20 61 67 61 69 6e 73 d options agains
d8d0: 74 20 54 63 6c 20 62 75 69 6c 64 20 6f 70 74 69 t Tcl build opti
d8e0: 6f 6e 73 0d 0a 23 20 57 68 65 6e 20 62 75 69 6c ons..# When buil
d8f0: 64 69 6e 67 20 61 6e 20 65 78 74 65 6e 73 69 6f ding an extensio
d900: 6e 2c 20 63 65 72 74 61 69 6e 20 63 6f 6e 66 69 n, certain confi
d910: 67 75 72 61 74 69 6f 6e 20 6f 70 74 69 6f 6e 73 guration options
d920: 20 73 68 6f 75 6c 64 0d 0a 23 20 6d 61 74 63 68 should..# match
d930: 20 74 68 65 20 6f 6e 65 73 20 75 73 65 64 20 77 the ones used w
d940: 68 65 6e 20 54 63 6c 20 77 61 73 20 62 75 69 6c hen Tcl was buil
d950: 74 2e 20 48 65 72 65 20 77 65 20 63 68 65 63 6b t. Here we check
d960: 20 61 6e 64 0d 0a 23 20 77 61 72 6e 20 6f 6e 20 and..# warn on
d970: 61 20 6d 69 73 6d 61 74 63 68 2e 0d 0a 21 69 66 a mismatch...!if
d980: 20 21 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d ! $(DOING_TCL).
d990: 0a 0d 0a 21 69 66 20 24 28 54 43 4c 49 4e 53 54 ...!if $(TCLINST
d9a0: 41 4c 4c 29 20 23 20 42 75 69 6c 64 69 6e 67 20 ALL) # Building
d9b0: 61 67 61 69 6e 73 74 20 61 6e 20 69 6e 73 74 61 against an insta
d9c0: 6c 6c 65 64 20 54 63 6c 0d 0a 21 69 66 20 65 78 lled Tcl..!if ex
d9d0: 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29 5c ist("$(_TCLDIR)\
d9e0: 6c 69 62 5c 6e 6d 61 6b 65 5c 74 63 6c 2e 6e 6d lib\nmake\tcl.nm
d9f0: 61 6b 65 22 29 0d 0a 54 43 4c 4e 4d 41 4b 45 43 ake")..TCLNMAKEC
da00: 4f 4e 46 49 47 20 3d 20 22 24 28 5f 54 43 4c 44 ONFIG = "$(_TCLD
da10: 49 52 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 74 63 IR)\lib\nmake\tc
da20: 6c 2e 6e 6d 61 6b 65 22 0d 0a 21 65 6e 64 69 66 l.nmake"..!endif
da30: 0d 0a 21 65 6c 73 65 20 23 20 21 20 24 28 54 43 ..!else # ! $(TC
da40: 4c 49 4e 53 54 41 4c 4c 29 20 2d 20 62 75 69 6c LINSTALL) - buil
da50: 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54 63 6c ding against Tcl
da60: 20 73 6f 75 72 63 65 0d 0a 21 69 66 20 65 78 69 source..!if exi
da70: 73 74 28 22 24 28 4f 55 54 5f 44 49 52 29 5c 74 st("$(OUT_DIR)\t
da80: 63 6c 2e 6e 6d 61 6b 65 22 29 0d 0a 54 43 4c 4e cl.nmake")..TCLN
da90: 4d 41 4b 45 43 4f 4e 46 49 47 20 3d 20 22 24 28 MAKECONFIG = "$(
daa0: 4f 55 54 5f 44 49 52 29 5c 74 63 6c 2e 6e 6d 61 OUT_DIR)\tcl.nma
dab0: 6b 65 22 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e ke"..!endif..!en
dac0: 64 69 66 20 23 20 54 43 4c 49 4e 53 54 41 4c 4c dif # TCLINSTALL
dad0: 0d 0a 0d 0a 21 69 66 20 24 28 43 4f 4e 46 49 47 ....!if $(CONFIG
dae0: 5f 43 48 45 43 4b 29 0d 0a 21 69 66 64 65 66 20 _CHECK)..!ifdef
daf0: 54 43 4c 4e 4d 41 4b 45 43 4f 4e 46 49 47 0d 0a TCLNMAKECONFIG..
db00: 21 69 6e 63 6c 75 64 65 20 24 28 54 43 4c 4e 4d !include $(TCLNM
db10: 41 4b 45 43 4f 4e 46 49 47 29 0d 0a 0d 0a 21 69 AKECONFIG)....!i
db20: 66 20 64 65 66 69 6e 65 64 28 43 4f 52 45 5f 4d f defined(CORE_M
db30: 41 43 48 49 4e 45 29 20 26 26 20 22 24 28 43 4f ACHINE) && "$(CO
db40: 52 45 5f 4d 41 43 48 49 4e 45 29 22 20 21 3d 20 RE_MACHINE)" !=
db50: 22 24 28 4d 41 43 48 49 4e 45 29 22 0d 0a 21 65 "$(MACHINE)"..!e
db60: 72 72 6f 72 20 45 52 52 4f 52 3a 20 42 75 69 6c rror ERROR: Buil
db70: 64 20 74 61 72 67 65 74 20 28 24 28 4d 41 43 48 d target ($(MACH
db80: 49 4e 45 29 29 20 64 6f 65 73 20 6e 6f 74 20 6d INE)) does not m
db90: 61 74 63 68 20 74 68 65 20 54 63 6c 20 6c 69 62 atch the Tcl lib
dba0: 72 61 72 79 20 61 72 63 68 69 74 65 63 74 75 72 rary architectur
dbb0: 65 20 28 24 28 43 4f 52 45 5f 4d 41 43 48 49 4e e ($(CORE_MACHIN
dbc0: 45 29 29 2e 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 E))...!endif..!i
dbd0: 66 20 64 65 66 69 6e 65 64 28 43 4f 52 45 5f 55 f defined(CORE_U
dbe0: 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 SE_THREAD_ALLOC)
dbf0: 20 26 26 20 24 28 43 4f 52 45 5f 55 53 45 5f 54 && $(CORE_USE_T
dc00: 48 52 45 41 44 5f 41 4c 4c 4f 43 29 20 21 3d 20 HREAD_ALLOC) !=
dc10: 24 28 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c $(USE_THREAD_ALL
dc20: 4f 43 29 0d 0a 21 6d 65 73 73 61 67 65 20 57 41 OC)..!message WA
dc30: 52 4e 49 4e 47 3a 20 56 61 6c 75 65 20 6f 66 20 RNING: Value of
dc40: 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 USE_THREAD_ALLOC
dc50: 20 28 24 28 55 53 45 5f 54 48 52 45 41 44 5f 41 ($(USE_THREAD_A
dc60: 4c 4c 4f 43 29 29 20 64 6f 65 73 20 6e 6f 74 20 LLOC)) does not
dc70: 6d 61 74 63 68 20 69 74 73 20 54 63 6c 20 63 6f match its Tcl co
dc80: 72 65 20 76 61 6c 75 65 20 28 24 28 43 4f 52 45 re value ($(CORE
dc90: 5f 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f _USE_THREAD_ALLO
dca0: 43 29 29 2e 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 C))...!endif..!i
dcb0: 66 20 64 65 66 69 6e 65 64 28 43 4f 52 45 5f 44 f defined(CORE_D
dcc0: 45 42 55 47 29 20 26 26 20 24 28 43 4f 52 45 5f EBUG) && $(CORE_
dcd0: 44 45 42 55 47 29 20 21 3d 20 24 28 44 45 42 55 DEBUG) != $(DEBU
dce0: 47 29 0d 0a 21 6d 65 73 73 61 67 65 20 57 41 52 G)..!message WAR
dcf0: 4e 49 4e 47 3a 20 56 61 6c 75 65 20 6f 66 20 44 NING: Value of D
dd00: 45 42 55 47 20 28 24 28 44 45 42 55 47 29 29 20 EBUG ($(DEBUG))
dd10: 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 69 does not match i
dd20: 74 73 20 54 63 6c 20 6c 69 62 72 61 72 79 20 63 ts Tcl library c
dd30: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 28 24 28 onfiguration ($(
dd40: 44 45 42 55 47 29 29 2e 0d 0a 21 65 6e 64 69 66 DEBUG))...!endif
dd50: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 65 6e 64 ..!endif....!end
dd60: 69 66 20 23 20 54 43 4c 4e 4d 41 4b 45 43 4f 4e if # TCLNMAKECON
dd70: 46 49 47 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 20 FIG....!endif #
dd80: 21 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a ! $(DOING_TCL)..
dd90: 0d 0a 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ....#-----------
dda0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
ddb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
ddc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d ---------------.
ddd0: 0a 23 20 44 69 73 70 6c 61 79 20 73 74 61 74 73 .# Display stats
dde0: 20 62 65 69 6e 67 20 75 73 65 64 2e 0d 0a 23 2d being used...#-
ddf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
de00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
de10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
de20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 0d 0a 21 69 66 ---------....!if
de30: 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a !$(DOING_TCL)..
de40: 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 42 75 69 !message *** Bui
de50: 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54 63 lding against Tc
de60: 6c 20 61 74 20 27 24 28 5f 54 43 4c 44 49 52 29 l at '$(_TCLDIR)
de70: 27 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 21 '..!endif..!if !
de80: 24 28 44 4f 49 4e 47 5f 54 4b 29 20 26 26 20 24 $(DOING_TK) && $
de90: 28 4e 45 45 44 5f 54 4b 29 0d 0a 21 6d 65 73 73 (NEED_TK)..!mess
dea0: 61 67 65 20 2a 2a 2a 20 42 75 69 6c 64 69 6e 67 age *** Building
deb0: 20 61 67 61 69 6e 73 74 20 54 6b 20 61 74 20 27 against Tk at '
dec0: 24 28 5f 54 4b 44 49 52 29 27 0d 0a 21 65 6e 64 $(_TKDIR)'..!end
ded0: 69 66 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a if..!message ***
dee0: 20 49 6e 74 65 72 6d 65 64 69 61 74 65 20 64 69 Intermediate di
def0: 72 65 63 74 6f 72 79 20 77 69 6c 6c 20 62 65 20 rectory will be
df00: 27 24 28 54 4d 50 5f 44 49 52 29 27 0d 0a 21 6d '$(TMP_DIR)'..!m
df10: 65 73 73 61 67 65 20 2a 2a 2a 20 4f 75 74 70 75 essage *** Outpu
df20: 74 20 64 69 72 65 63 74 6f 72 79 20 77 69 6c 6c t directory will
df30: 20 62 65 20 27 24 28 4f 55 54 5f 44 49 52 29 27 be '$(OUT_DIR)'
df40: 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 49 ..!message *** I
df50: 6e 73 74 61 6c 6c 61 74 69 6f 6e 2c 20 69 66 20 nstallation, if
df60: 73 65 6c 65 63 74 65 64 2c 20 77 69 6c 6c 20 62 selected, will b
df70: 65 20 69 6e 20 27 24 28 5f 49 4e 53 54 41 4c 4c e in '$(_INSTALL
df80: 44 49 52 29 27 0d 0a 21 6d 65 73 73 61 67 65 20 DIR)'..!message
df90: 2a 2a 2a 20 53 75 66 66 69 78 20 66 6f 72 20 62 *** Suffix for b
dfa0: 69 6e 61 72 69 65 73 20 77 69 6c 6c 20 62 65 20 inaries will be
dfb0: 27 24 28 53 55 46 58 29 27 0d 0a 21 6d 65 73 73 '$(SUFX)'..!mess
dfc0: 61 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 age *** Compiler
dfd0: 20 76 65 72 73 69 6f 6e 20 24 28 56 43 56 45 52 version $(VCVER
dfe0: 29 2e 20 54 61 72 67 65 74 20 24 28 4d 41 43 48 ). Target $(MACH
dff0: 49 4e 45 29 2c 20 68 6f 73 74 20 24 28 4e 41 54 INE), host $(NAT
e000: 49 56 45 5f 41 52 43 48 29 2e 0d 0a 0d 0a 21 65 IVE_ARCH).....!e
e010: 6e 64 69 66 20 23 20 69 66 64 65 66 20 5f 52 55 ndif # ifdef _RU
e020: 4c 45 53 5f 56 43 0d 0a LES_VC..