Hex Artifact Content

Artifact d6ab426c84f0c35fc6ecff9ccff1a87e14593b36b9a8e209bb953e173720b946:


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 0a  *- makefile -*-.
0050: 23 20 72 75 6c 65 73 2e 76 63 20 2d 2d 0a 23 0a  # rules.vc --.#.
0060: 23 20 50 61 72 74 20 6f 66 20 74 68 65 20 6e 6d  # Part of the nm
0070: 61 6b 65 20 62 61 73 65 64 20 62 75 69 6c 64 20  ake based build 
0080: 73 79 73 74 65 6d 20 66 6f 72 20 54 63 6c 20 61  system for Tcl a
0090: 6e 64 20 69 74 73 20 65 78 74 65 6e 73 69 6f 6e  nd its extension
00a0: 73 2e 0a 23 20 54 68 69 73 20 66 69 6c 65 20 64  s..# This file d
00b0: 6f 65 73 20 61 6c 6c 20 74 68 65 20 68 61 72 64  oes all the hard
00c0: 20 77 6f 72 6b 20 69 6e 20 74 65 72 6d 73 20 6f   work in terms o
00d0: 66 20 70 61 72 73 69 6e 67 20 62 75 69 6c 64 20  f parsing build 
00e0: 6f 70 74 69 6f 6e 73 2c 0a 23 20 63 6f 6d 70 69  options,.# compi
00f0: 6c 65 72 20 73 77 69 74 63 68 65 73 2c 20 64 65  ler switches, de
0100: 66 69 6e 69 6e 67 20 63 6f 6d 6d 6f 6e 20 74 61  fining common ta
0110: 72 67 65 74 73 20 61 6e 64 20 6d 61 63 72 6f 73  rgets and macros
0120: 2e 20 54 68 65 20 54 63 6c 20 6d 61 6b 65 66 69  . The Tcl makefi
0130: 6c 65 0a 23 20 64 69 72 65 63 74 6c 79 20 69 6e  le.# directly in
0140: 63 6c 75 64 65 73 20 74 68 69 73 2e 20 45 78 74  cludes this. Ext
0150: 65 6e 73 69 6f 6e 73 20 69 6e 63 6c 75 64 65 20  ensions include 
0160: 69 74 20 76 69 61 20 22 72 75 6c 65 73 2d 65 78  it via "rules-ex
0170: 74 2e 76 63 22 2e 0a 23 0a 23 20 53 65 65 20 54  t.vc"..#.# See T
0180: 49 50 20 34 37 37 20 28 68 74 74 70 73 3a 2f 2f  IP 477 (https://
0190: 63 6f 72 65 2e 74 63 6c 2d 6c 61 6e 67 2e 6f 72  core.tcl-lang.or
01a0: 67 2f 74 69 70 73 2f 64 6f 63 2f 6d 61 69 6e 2f  g/tips/doc/main/
01b0: 74 69 70 2f 34 37 37 2e 6d 64 29 20 66 6f 72 0a  tip/477.md) for.
01c0: 23 20 64 65 74 61 69 6c 65 64 20 64 6f 63 75 6d  # detailed docum
01d0: 65 6e 74 61 74 69 6f 6e 2e 0a 23 0a 23 20 53 65  entation..#.# Se
01e0: 65 20 74 68 65 20 66 69 6c 65 20 22 6c 69 63 65  e the file "lice
01f0: 6e 73 65 2e 74 65 72 6d 73 22 20 66 6f 72 20 69  nse.terms" for i
0200: 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 75 73  nformation on us
0210: 61 67 65 20 61 6e 64 20 72 65 64 69 73 74 72 69  age and redistri
0220: 62 75 74 69 6f 6e 0a 23 20 6f 66 20 74 68 69 73  bution.# of this
0230: 20 66 69 6c 65 2c 20 61 6e 64 20 66 6f 72 20 61   file, and for a
0240: 20 44 49 53 43 4c 41 49 4d 45 52 20 4f 46 20 41   DISCLAIMER OF A
0250: 4c 4c 20 57 41 52 52 41 4e 54 49 45 53 2e 0a 23  LL WARRANTIES..#
0260: 0a 23 20 43 6f 70 79 72 69 67 68 74 20 28 63 29  .# Copyright (c)
0270: 20 32 30 30 31 2d 32 30 30 33 20 44 61 76 69 64   2001-2003 David
0280: 20 47 72 61 76 65 72 65 61 75 78 2e 0a 23 20 43   Gravereaux..# C
0290: 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 30  opyright (c) 200
02a0: 33 2d 32 30 30 38 20 50 61 74 72 69 63 6b 20 54  3-2008 Patrick T
02b0: 68 6f 79 74 73 0a 23 20 43 6f 70 79 72 69 67 68  hoyts.# Copyrigh
02c0: 74 20 28 63 29 20 32 30 31 37 20 20 20 20 20 20  t (c) 2017      
02d0: 41 73 68 6f 6b 20 50 2e 20 4e 61 64 6b 61 72 6e  Ashok P. Nadkarn
02e0: 69 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  i.#-------------
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 0a 0a 21 69 66 6e 64 65 66 20 5f 52 55 4c 45  -..!ifndef _RULE
0340: 53 5f 56 43 0a 5f 52 55 4c 45 53 5f 56 43 20 3d  S_VC._RULES_VC =
0350: 20 31 0a 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77   1..# The follow
0360: 69 6e 67 20 6d 61 63 72 6f 73 20 64 65 66 69 6e  ing macros defin
0370: 65 20 74 68 65 20 76 65 72 73 69 6f 6e 20 6f 66  e the version of
0380: 20 74 68 65 20 72 75 6c 65 73 2e 76 63 20 6e 6d   the rules.vc nm
0390: 61 6b 65 20 62 75 69 6c 64 20 73 79 73 74 65 6d  ake build system
03a0: 0a 23 20 46 6f 72 20 6d 6f 64 69 66 69 63 61 74  .# For modificat
03b0: 69 6f 6e 73 20 74 68 61 74 20 61 72 65 20 6e 6f  ions that are no
03c0: 74 20 62 61 63 6b 77 61 72 64 2d 63 6f 6d 70 61  t backward-compa
03d0: 74 69 62 6c 65 2c 20 79 6f 75 20 2a 6d 75 73 74  tible, you *must
03e0: 2a 20 63 68 61 6e 67 65 0a 23 20 74 68 65 20 6d  * change.# the m
03f0: 61 6a 6f 72 20 76 65 72 73 69 6f 6e 2e 0a 52 55  ajor version..RU
0400: 4c 45 53 5f 56 45 52 53 49 4f 4e 5f 4d 41 4a 4f  LES_VERSION_MAJO
0410: 52 20 3d 20 31 0a 52 55 4c 45 53 5f 56 45 52 53  R = 1.RULES_VERS
0420: 49 4f 4e 5f 4d 49 4e 4f 52 20 3d 20 31 31 0a 0a  ION_MINOR = 11..
0430: 23 20 54 68 65 20 50 52 4f 4a 45 43 54 20 6d 61  # The PROJECT ma
0440: 63 72 6f 20 6d 75 73 74 20 62 65 20 64 65 66 69  cro must be defi
0450: 6e 65 64 20 62 79 20 70 61 72 65 6e 74 20 6d 61  ned by parent ma
0460: 6b 65 66 69 6c 65 2e 0a 21 69 66 20 22 24 28 50  kefile..!if "$(P
0470: 52 4f 4a 45 43 54 29 22 20 3d 3d 20 22 22 0a 21  ROJECT)" == "".!
0480: 65 72 72 6f 72 20 2a 2a 2a 20 45 72 72 6f 72 3a  error *** Error:
0490: 20 4d 61 63 72 6f 20 50 52 4f 4a 45 43 54 20 6e   Macro PROJECT n
04a0: 6f 74 20 64 65 66 69 6e 65 64 21 20 50 6c 65 61  ot defined! Plea
04b0: 73 65 20 64 65 66 69 6e 65 20 69 74 20 62 65 66  se define it bef
04c0: 6f 72 65 20 69 6e 63 6c 75 64 69 6e 67 20 72 75  ore including ru
04d0: 6c 65 73 2e 76 63 0a 21 65 6e 64 69 66 0a 0a 21  les.vc.!endif..!
04e0: 69 66 20 22 24 28 50 52 4a 5f 50 41 43 4b 41 47  if "$(PRJ_PACKAG
04f0: 45 5f 54 43 4c 4e 41 4d 45 29 22 20 3d 3d 20 22  E_TCLNAME)" == "
0500: 22 0a 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43  ".PRJ_PACKAGE_TC
0510: 4c 4e 41 4d 45 20 3d 20 24 28 50 52 4f 4a 45 43  LNAME = $(PROJEC
0520: 54 29 0a 21 65 6e 64 69 66 0a 0a 23 20 41 6c 73  T).!endif..# Als
0530: 6f 20 73 70 65 63 69 61 6c 20 63 61 73 65 20 54  o special case T
0540: 63 6c 20 61 6e 64 20 54 6b 20 74 6f 20 73 61 76  cl and Tk to sav
0550: 65 20 73 6f 6d 65 20 74 79 70 69 6e 67 20 6c 61  e some typing la
0560: 74 65 72 0a 44 4f 49 4e 47 5f 54 43 4c 20 3d 20  ter.DOING_TCL = 
0570: 30 0a 44 4f 49 4e 47 5f 54 4b 20 20 3d 20 30 0a  0.DOING_TK  = 0.
0580: 21 69 66 20 22 24 28 50 52 4f 4a 45 43 54 29 22  !if "$(PROJECT)"
0590: 20 3d 3d 20 22 74 63 6c 22 0a 44 4f 49 4e 47 5f   == "tcl".DOING_
05a0: 54 43 4c 20 3d 20 31 0a 21 65 6c 73 65 69 66 20  TCL = 1.!elseif 
05b0: 22 24 28 50 52 4f 4a 45 43 54 29 22 20 3d 3d 20  "$(PROJECT)" == 
05c0: 22 74 6b 22 0a 44 4f 49 4e 47 5f 54 4b 20 3d 20  "tk".DOING_TK = 
05d0: 31 0a 21 65 6e 64 69 66 0a 0a 21 69 66 6e 64 65  1.!endif..!ifnde
05e0: 66 20 4e 45 45 44 5f 54 4b 0a 23 20 42 61 63 6b  f NEED_TK.# Back
05f0: 77 61 72 64 73 20 63 6f 6d 70 61 74 69 62 69 6c  wards compatibil
0600: 69 74 79 0a 21 69 66 64 65 66 20 50 52 4f 4a 45  ity.!ifdef PROJE
0610: 43 54 5f 52 45 51 55 49 52 45 53 5f 54 4b 0a 4e  CT_REQUIRES_TK.N
0620: 45 45 44 5f 54 4b 20 3d 20 24 28 50 52 4f 4a 45  EED_TK = $(PROJE
0630: 43 54 5f 52 45 51 55 49 52 45 53 5f 54 4b 29 0a  CT_REQUIRES_TK).
0640: 21 65 6c 73 65 0a 4e 45 45 44 5f 54 4b 20 3d 20  !else.NEED_TK = 
0650: 30 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  0.!endif.!endif.
0660: 0a 21 69 66 6e 64 65 66 20 4e 45 45 44 5f 54 43  .!ifndef NEED_TC
0670: 4c 5f 53 4f 55 52 43 45 0a 4e 45 45 44 5f 54 43  L_SOURCE.NEED_TC
0680: 4c 5f 53 4f 55 52 43 45 20 3d 20 30 0a 21 65 6e  L_SOURCE = 0.!en
0690: 64 69 66 0a 0a 21 69 66 64 65 66 20 4e 45 45 44  dif..!ifdef NEED
06a0: 5f 54 4b 5f 53 4f 55 52 43 45 0a 21 69 66 20 24  _TK_SOURCE.!if $
06b0: 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29  (NEED_TK_SOURCE)
06c0: 0a 4e 45 45 44 5f 54 4b 20 3d 20 31 0a 21 65 6e  .NEED_TK = 1.!en
06d0: 64 69 66 0a 21 65 6c 73 65 0a 4e 45 45 44 5f 54  dif.!else.NEED_T
06e0: 4b 5f 53 4f 55 52 43 45 20 3d 20 30 0a 21 65 6e  K_SOURCE = 0.!en
06f0: 64 69 66 0a 0a 23 23 23 23 23 23 23 23 23 23 23  dif..###########
0700: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
0710: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
0720: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
0730: 23 23 23 23 23 0a 23 20 4e 6d 61 6b 65 20 69 73  #####.# Nmake is
0740: 20 61 20 70 72 65 74 74 79 20 77 65 61 6b 20 65   a pretty weak e
0750: 6e 76 69 72 6f 6e 6d 65 6e 74 20 69 6e 20 73 79  nvironment in sy
0760: 6e 74 61 78 20 61 6e 64 20 63 61 70 61 62 69 6c  ntax and capabil
0770: 69 74 69 65 73 0a 23 20 73 6f 20 74 68 69 73 20  ities.# so this 
0780: 66 69 6c 65 20 69 73 20 6e 65 63 65 73 73 61 72  file is necessar
0790: 69 6c 79 20 76 65 72 62 6f 73 65 2e 20 49 74 27  ily verbose. It'
07a0: 73 20 62 72 6f 6b 65 6e 20 64 6f 77 6e 20 69 6e  s broken down in
07b0: 74 6f 0a 23 20 74 68 65 20 66 6f 6c 6c 6f 77 69  to.# the followi
07c0: 6e 67 20 70 61 72 74 73 2e 0a 23 0a 23 20 30 2e  ng parts..#.# 0.
07d0: 20 53 61 6e 69 74 79 20 63 68 65 63 6b 20 74 68   Sanity check th
07e0: 61 74 20 63 6f 6d 70 69 6c 65 72 20 65 6e 76 69  at compiler envi
07f0: 72 6f 6e 6d 65 6e 74 20 69 73 20 73 65 74 20 75  ronment is set u
0800: 70 20 61 6e 64 20 69 6e 69 74 69 61 6c 69 7a 65  p and initialize
0810: 0a 23 20 20 20 20 61 6e 79 20 62 75 69 6c 74 2d  .#    any built-
0820: 69 6e 20 73 65 74 74 69 6e 67 73 20 66 72 6f 6d  in settings from
0830: 20 74 68 65 20 70 61 72 65 6e 74 20 6d 61 6b 65   the parent make
0840: 66 69 6c 65 0a 23 20 31 2e 20 46 69 72 73 74 20  file.# 1. First 
0850: 64 65 66 69 6e 65 20 74 68 65 20 65 78 74 65 72  define the exter
0860: 6e 61 6c 20 74 6f 6f 6c 73 20 75 73 65 64 20 66  nal tools used f
0870: 6f 72 20 63 6f 6d 70 69 6c 69 6e 67 2c 20 63 6f  or compiling, co
0880: 70 79 69 6e 67 20 65 74 63 2e 0a 23 20 20 20 20  pying etc..#    
0890: 61 73 20 74 68 69 73 20 69 73 20 69 6e 64 65 70  as this is indep
08a0: 65 6e 64 65 6e 74 20 6f 66 20 65 76 65 72 79 74  endent of everyt
08b0: 68 69 6e 67 20 65 6c 73 65 2e 0a 23 20 32 2e 20  hing else..# 2. 
08c0: 46 69 67 75 72 65 20 6f 75 74 20 6f 75 72 20 62  Figure out our b
08d0: 75 69 6c 64 20 73 74 72 75 63 74 75 72 65 20 69  uild structure i
08e0: 6e 20 74 65 72 6d 73 20 6f 66 20 74 68 65 20 64  n terms of the d
08f0: 69 72 65 63 74 6f 72 79 2c 20 77 68 65 74 68 65  irectory, whethe
0900: 72 0a 23 20 20 20 20 77 65 20 61 72 65 20 62 75  r.#    we are bu
0910: 69 6c 64 69 6e 67 20 54 63 6c 20 6f 72 20 61 6e  ilding Tcl or an
0920: 20 65 78 74 65 6e 73 69 6f 6e 2c 20 65 74 63 2e   extension, etc.
0930: 0a 23 20 33 2e 20 44 65 74 65 72 6d 69 6e 65 20  .# 3. Determine 
0940: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64  the compiler and
0950: 20 6c 69 6e 6b 65 72 20 76 65 72 73 69 6f 6e 73   linker versions
0960: 0a 23 20 34 2e 20 42 75 69 6c 64 20 74 68 65 20  .# 4. Build the 
0970: 6e 6d 61 6b 65 68 6c 70 20 68 65 6c 70 65 72 20  nmakehlp helper 
0980: 61 70 70 6c 69 63 61 74 69 6f 6e 0a 23 20 35 2e  application.# 5.
0990: 20 44 65 74 65 72 6d 69 6e 65 20 74 68 65 20 73   Determine the s
09a0: 75 70 70 6f 72 74 65 64 20 63 6f 6d 70 69 6c 65  upported compile
09b0: 72 20 6f 70 74 69 6f 6e 73 20 61 6e 64 20 66 65  r options and fe
09c0: 61 74 75 72 65 73 0a 23 20 36 2e 20 50 61 72 73  atures.# 6. Pars
09d0: 65 20 74 68 65 20 4f 50 54 53 20 6d 61 63 72 6f  e the OPTS macro
09e0: 20 76 61 6c 75 65 20 66 6f 72 20 75 73 65 72 2d   value for user-
09f0: 73 70 65 63 69 66 69 65 64 20 62 75 69 6c 64 20  specified build 
0a00: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0a 23 20  configuration.# 
0a10: 37 2e 20 50 61 72 73 65 20 74 68 65 20 53 54 41  7. Parse the STA
0a20: 54 53 20 6d 61 63 72 6f 20 76 61 6c 75 65 20 66  TS macro value f
0a30: 6f 72 20 73 74 61 74 69 73 74 69 63 73 20 69 6e  or statistics in
0a40: 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0a 23 20  strumentation.# 
0a50: 38 2e 20 50 61 72 73 65 20 74 68 65 20 43 48 45  8. Parse the CHE
0a60: 43 4b 53 20 6d 61 63 72 6f 20 66 6f 72 20 61 64  CKS macro for ad
0a70: 64 69 74 69 6f 6e 61 6c 20 63 6f 6d 70 69 6c 61  ditional compila
0a80: 74 69 6f 6e 20 63 68 65 63 6b 73 0a 23 20 39 2e  tion checks.# 9.
0a90: 20 45 78 74 72 61 63 74 20 54 63 6c 2c 20 61 6e   Extract Tcl, an
0aa0: 64 20 70 6f 73 73 69 62 6c 79 20 54 6b 2c 20 76  d possibly Tk, v
0ab0: 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20 66  ersion numbers f
0ac0: 72 6f 6d 20 74 68 65 20 68 65 61 64 65 72 73 0a  rom the headers.
0ad0: 23 20 31 30 2e 20 42 61 73 65 64 20 6f 6e 20 74  # 10. Based on t
0ae0: 68 69 73 20 73 65 6c 65 63 74 65 64 20 63 6f 6e  his selected con
0af0: 66 69 67 75 72 61 74 69 6f 6e 2c 20 63 6f 6e 73  figuration, cons
0b00: 74 72 75 63 74 20 74 68 65 20 6f 75 74 70 75 74  truct the output
0b10: 0a 23 20 20 20 20 20 64 69 72 65 63 74 6f 72 79  .#     directory
0b20: 20 61 6e 64 20 66 69 6c 65 20 70 61 74 68 73 0a   and file paths.
0b30: 23 20 31 31 2e 20 43 6f 6e 73 74 72 75 63 74 20  # 11. Construct 
0b40: 74 68 65 20 70 61 74 68 73 20 77 68 65 72 65 20  the paths where 
0b50: 74 68 65 20 70 61 63 6b 61 67 65 20 69 73 20 74  the package is t
0b60: 6f 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23  o be installed.#
0b70: 20 31 32 2e 20 53 65 74 20 75 70 20 74 68 65 20   12. Set up the 
0b80: 61 63 74 75 61 6c 20 6f 70 74 69 6f 6e 73 20 70  actual options p
0b90: 61 73 73 65 64 20 74 6f 20 63 6f 6d 70 69 6c 65  assed to compile
0ba0: 72 20 61 6e 64 20 6c 69 6e 6b 65 72 20 62 61 73  r and linker bas
0bb0: 65 64 0a 23 20 20 20 20 20 6f 6e 20 74 68 65 20  ed.#     on the 
0bc0: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 67 61 74 68  information gath
0bd0: 65 72 65 64 20 61 62 6f 76 65 2e 0a 23 20 31 33  ered above..# 13
0be0: 2e 20 44 65 66 69 6e 65 20 73 6f 6d 65 20 73 74  . Define some st
0bf0: 61 6e 64 61 72 64 20 62 75 69 6c 64 20 74 61 72  andard build tar
0c00: 67 65 74 73 20 61 6e 64 20 69 6d 70 6c 69 63 69  gets and implici
0c10: 74 20 72 75 6c 65 73 2e 20 54 68 65 73 65 20 6d  t rules. These m
0c20: 61 79 0a 23 20 20 20 20 20 62 65 20 6f 70 74 69  ay.#     be opti
0c30: 6f 6e 61 6c 6c 79 20 64 69 73 61 62 6c 65 64 20  onally disabled 
0c40: 62 79 20 74 68 65 20 70 61 72 65 6e 74 20 6d 61  by the parent ma
0c50: 6b 65 66 69 6c 65 2e 0a 23 20 31 34 2e 20 28 46  kefile..# 14. (F
0c60: 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 20 6f 6e  or extensions on
0c70: 6c 79 2e 29 20 43 6f 6d 70 61 72 65 20 74 68 65  ly.) Compare the
0c80: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 6f   configuration o
0c90: 66 20 74 68 65 20 74 61 72 67 65 74 0a 23 20 20  f the target.#  
0ca0: 20 20 20 54 63 6c 20 61 6e 64 20 74 68 65 20 65     Tcl and the e
0cb0: 78 74 65 6e 73 69 6f 6e 73 20 61 6e 64 20 77 61  xtensions and wa
0cc0: 72 6e 20 61 67 61 69 6e 73 74 20 64 69 73 63 72  rn against discr
0cd0: 65 70 61 6e 63 69 65 73 2e 0a 23 0a 23 20 4f 6e  epancies..#.# On
0ce0: 65 20 66 69 6e 61 6c 20 6e 6f 74 65 20 61 62 6f  e final note abo
0cf0: 75 74 20 74 68 65 20 6d 61 63 72 6f 20 6e 61 6d  ut the macro nam
0d00: 65 73 20 75 73 65 64 2e 20 54 68 65 79 20 61 72  es used. They ar
0d10: 65 20 61 73 20 74 68 65 79 20 61 72 65 0a 23 20  e as they are.# 
0d20: 66 6f 72 20 68 69 73 74 6f 72 69 63 61 6c 20 72  for historical r
0d30: 65 61 73 6f 6e 73 2e 20 57 65 20 77 6f 75 6c 64  easons. We would
0d40: 20 6c 69 6b 65 20 6c 65 67 61 63 79 20 65 78 74   like legacy ext
0d50: 65 6e 73 69 6f 6e 73 20 74 6f 0a 23 20 63 6f 6e  ensions to.# con
0d60: 74 69 6e 75 65 20 74 6f 20 77 6f 72 6b 20 77 69  tinue to work wi
0d70: 74 68 20 74 68 69 73 20 6d 61 6b 65 20 69 6e 63  th this make inc
0d80: 6c 75 64 65 20 66 69 6c 65 20 73 6f 20 62 65 20  lude file so be 
0d90: 77 61 72 79 20 6f 66 0a 23 20 63 68 61 6e 67 69  wary of.# changi
0da0: 6e 67 20 74 68 65 6d 20 66 6f 72 20 63 6f 6e 73  ng them for cons
0db0: 69 73 74 65 6e 63 79 20 6f 72 20 63 6c 61 72 69  istency or clari
0dc0: 74 79 2e 0a 0a 23 20 30 2e 20 53 61 6e 69 74 79  ty...# 0. Sanity
0dd0: 20 63 68 65 63 6b 20 63 6f 6d 70 69 6c 65 72 20   check compiler 
0de0: 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a 0a 23 20 43  environment..# C
0df0: 68 65 63 6b 20 74 6f 20 73 65 65 20 77 65 20 61  heck to see we a
0e00: 72 65 20 63 6f 6e 66 69 67 75 72 65 64 20 74 6f  re configured to
0e10: 20 62 75 69 6c 64 20 77 69 74 68 20 4d 53 56 43   build with MSVC
0e20: 20 28 4d 53 44 45 56 44 49 52 2c 20 4d 53 56 43   (MSDEVDIR, MSVC
0e30: 44 49 52 20 6f 72 0a 23 20 56 43 49 4e 53 54 41  DIR or.# VCINSTA
0e40: 4c 4c 44 49 52 29 20 6f 72 20 77 69 74 68 20 74  LLDIR) or with t
0e50: 68 65 20 4d 53 20 50 6c 61 74 66 6f 72 6d 20 53  he MS Platform S
0e60: 44 4b 20 28 4d 53 53 44 4b 20 6f 72 20 57 69 6e  DK (MSSDK or Win
0e70: 64 6f 77 73 53 44 4b 44 69 72 29 0a 0a 21 69 66  dowsSDKDir)..!if
0e80: 20 21 64 65 66 69 6e 65 64 28 4d 53 44 45 56 44   !defined(MSDEVD
0e90: 49 52 29 20 26 26 20 21 64 65 66 69 6e 65 64 28  IR) && !defined(
0ea0: 4d 53 56 43 44 49 52 29 20 26 26 20 21 64 65 66  MSVCDIR) && !def
0eb0: 69 6e 65 64 28 56 43 49 4e 53 54 41 4c 4c 44 49  ined(VCINSTALLDI
0ec0: 52 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 4d  R) && !defined(M
0ed0: 53 53 44 4b 29 20 26 26 20 21 64 65 66 69 6e 65  SSDK) && !define
0ee0: 64 28 57 49 4e 44 4f 57 53 53 44 4b 44 49 52 29  d(WINDOWSSDKDIR)
0ef0: 0a 4d 53 47 20 3d 20 5e 0a 56 69 73 75 61 6c 20  .MSG = ^.Visual 
0f00: 43 2b 2b 20 63 6f 6d 70 69 6c 65 72 20 65 6e 76  C++ compiler env
0f10: 69 72 6f 6e 6d 65 6e 74 20 6e 6f 74 20 69 6e 69  ironment not ini
0f20: 74 69 61 6c 69 7a 65 64 2e 0a 21 65 72 72 6f 72  tialized..!error
0f30: 20 24 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a 0a   $(MSG).!endif..
0f40: 23 20 57 65 20 6e 65 65 64 20 74 6f 20 72 75 6e  # We need to run
0f50: 20 66 72 6f 6d 20 74 68 65 20 64 69 72 65 63 74   from the direct
0f60: 6f 72 79 20 74 68 65 20 70 61 72 65 6e 74 20 6d  ory the parent m
0f70: 61 6b 65 66 69 6c 65 20 69 73 20 6c 6f 63 61 74  akefile is locat
0f80: 65 64 20 69 6e 2e 0a 23 20 6e 6d 61 6b 65 20 64  ed in..# nmake d
0f90: 6f 65 73 20 6e 6f 74 20 74 65 6c 6c 20 75 73 20  oes not tell us 
0fa0: 77 68 61 74 20 6d 61 6b 65 66 69 6c 65 20 77 61  what makefile wa
0fb0: 73 20 75 73 65 64 20 74 6f 20 69 6e 76 6f 6b 65  s used to invoke
0fc0: 20 69 74 20 73 6f 20 70 61 72 65 6e 74 0a 23 20   it so parent.# 
0fd0: 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 74 6f 20  makefile has to 
0fe0: 73 65 74 20 74 68 65 20 4d 41 4b 45 46 49 4c 45  set the MAKEFILE
0ff0: 56 43 20 6d 61 63 72 6f 20 6f 72 20 77 65 20 6a  VC macro or we j
1000: 75 73 74 20 6d 61 6b 65 20 61 20 67 75 65 73 73  ust make a guess
1010: 20 61 6e 64 0a 23 20 77 61 72 6e 20 69 66 20 77   and.# warn if w
1020: 65 20 74 68 69 6e 6b 20 74 68 61 74 20 69 73 20  e think that is 
1030: 6e 6f 74 20 74 68 65 20 63 61 73 65 2e 0a 21 69  not the case..!i
1040: 66 20 22 24 28 4d 41 4b 45 46 49 4c 45 56 43 29  f "$(MAKEFILEVC)
1050: 22 20 3d 3d 20 22 22 0a 0a 21 69 66 20 65 78 69  " == ""..!if exi
1060: 73 74 28 22 24 28 50 52 4f 4a 45 43 54 29 2e 76  st("$(PROJECT).v
1070: 63 22 29 0a 4d 41 4b 45 46 49 4c 45 56 43 20 3d  c").MAKEFILEVC =
1080: 20 24 28 50 52 4f 4a 45 43 54 29 2e 76 63 0a 21   $(PROJECT).vc.!
1090: 65 6c 73 65 69 66 20 65 78 69 73 74 28 22 6d 61  elseif exist("ma
10a0: 6b 65 66 69 6c 65 2e 76 63 22 29 0a 4d 41 4b 45  kefile.vc").MAKE
10b0: 46 49 4c 45 56 43 20 3d 20 6d 61 6b 65 66 69 6c  FILEVC = makefil
10c0: 65 2e 76 63 0a 21 65 6e 64 69 66 0a 21 65 6e 64  e.vc.!endif.!end
10d0: 69 66 20 23 20 22 24 28 4d 41 4b 45 46 49 4c 45  if # "$(MAKEFILE
10e0: 56 43 29 22 20 3d 3d 20 22 22 0a 0a 21 69 66 20  VC)" == ""..!if 
10f0: 21 65 78 69 73 74 28 22 24 28 4d 41 4b 45 46 49  !exist("$(MAKEFI
1100: 4c 45 56 43 29 22 29 0a 4d 53 47 20 3d 20 5e 0a  LEVC)").MSG = ^.
1110: 59 6f 75 20 6d 75 73 74 20 72 75 6e 20 6e 6d 61  You must run nma
1120: 6b 65 20 66 72 6f 6d 20 74 68 65 20 64 69 72 65  ke from the dire
1130: 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67  ctory containing
1140: 20 74 68 65 20 70 72 6f 6a 65 63 74 20 6d 61 6b   the project mak
1150: 65 66 69 6c 65 2e 5e 0a 49 66 20 79 6f 75 20 61  efile.^.If you a
1160: 72 65 20 64 6f 69 6e 67 20 74 68 61 74 20 61 6e  re doing that an
1170: 64 20 67 65 74 74 69 6e 67 20 74 68 69 73 20 6d  d getting this m
1180: 65 73 73 61 67 65 2c 20 73 65 74 20 74 68 65 20  essage, set the 
1190: 4d 41 4b 45 46 49 4c 45 56 43 5e 0a 6d 61 63 72  MAKEFILEVC^.macr
11a0: 6f 20 74 6f 20 74 68 65 20 6e 61 6d 65 20 6f 66  o to the name of
11b0: 20 74 68 65 20 70 72 6f 6a 65 63 74 20 6d 61 6b   the project mak
11c0: 65 66 69 6c 65 2e 0a 21 6d 65 73 73 61 67 65 20  efile..!message 
11d0: 57 41 52 4e 49 4e 47 3a 20 24 28 4d 53 47 29 0a  WARNING: $(MSG).
11e0: 21 65 6e 64 69 66 0a 0a 0a 23 23 23 23 23 23 23  !endif...#######
11f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1200: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1210: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1220: 23 23 23 23 23 23 23 23 23 0a 23 20 31 2e 20 44  #########.# 1. D
1230: 65 66 69 6e 65 20 65 78 74 65 72 6e 61 6c 20 70  efine external p
1240: 72 6f 67 72 61 6d 73 20 62 65 69 6e 67 20 75 73  rograms being us
1250: 65 64 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ed..#-----------
1260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1280: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
1290: 23 20 53 65 74 20 74 68 65 20 70 72 6f 70 65 72  # Set the proper
12a0: 20 63 6f 70 79 20 6d 65 74 68 6f 64 20 74 6f 20   copy method to 
12b0: 61 76 6f 69 64 20 6f 76 65 72 77 72 69 74 65 20  avoid overwrite 
12c0: 71 75 65 73 74 69 6f 6e 73 0a 23 20 74 6f 20 74  questions.# to t
12d0: 68 65 20 75 73 65 72 20 77 68 65 6e 20 63 6f 70  he user when cop
12e0: 79 69 6e 67 20 66 69 6c 65 73 20 61 6e 64 20 73  ying files and s
12f0: 65 6c 65 63 74 69 6e 67 20 74 68 65 20 72 69 67  electing the rig
1300: 68 74 0a 23 20 22 64 65 6c 65 74 65 20 61 6c 6c  ht.# "delete all
1310: 22 20 6d 65 74 68 6f 64 2e 0a 23 2d 2d 2d 2d 2d  " method..#-----
1320: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1330: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1340: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1350: 2d 2d 2d 2d 2d 0a 0a 52 4d 44 49 52 09 3d 20 72  -----..RMDIR.= r
1360: 6d 64 69 72 20 2f 53 20 2f 51 0a 43 50 59 09 3d  mdir /S /Q.CPY.=
1370: 20 78 63 6f 70 79 20 2f 69 20 2f 79 20 3e 4e 55   xcopy /i /y >NU
1380: 4c 0a 43 50 59 44 49 52 20 20 3d 20 78 63 6f 70  L.CPYDIR  = xcop
1390: 79 20 2f 65 20 2f 69 20 2f 79 20 3e 4e 55 4c 0a  y /e /i /y >NUL.
13a0: 43 4f 50 59 09 3d 20 63 6f 70 79 20 2f 79 20 3e  COPY.= copy /y >
13b0: 4e 55 4c 0a 4d 4b 44 49 52 20 20 20 3d 20 6d 6b  NUL.MKDIR   = mk
13c0: 64 69 72 0a 0a 23 23 23 23 23 23 23 23 23 23 23  dir..###########
13d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
13e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
13f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1400: 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 32 2e  ###########.# 2.
1410: 20 46 69 67 75 72 65 20 6f 75 74 20 6f 75 72 20   Figure out our 
1420: 62 75 69 6c 64 20 65 6e 76 69 72 6f 6e 6d 65 6e  build environmen
1430: 74 20 69 6e 20 74 65 72 6d 73 20 6f 66 20 77 68  t in terms of wh
1440: 61 74 20 77 65 27 72 65 20 62 75 69 6c 64 69 6e  at we're buildin
1450: 67 2e 0a 23 0a 23 20 28 61 29 20 54 63 6c 20 69  g..#.# (a) Tcl i
1460: 74 73 65 6c 66 0a 23 20 28 62 29 20 54 6b 0a 23  tself.# (b) Tk.#
1470: 20 28 63 29 20 61 20 54 63 6c 20 65 78 74 65 6e   (c) a Tcl exten
1480: 73 69 6f 6e 20 75 73 69 6e 67 20 6c 69 62 72 61  sion using libra
1490: 72 69 65 73 2f 69 6e 63 6c 75 64 65 73 20 66 72  ries/includes fr
14a0: 6f 6d 20 61 6e 20 2a 69 6e 73 74 61 6c 6c 65 64  om an *installed
14b0: 2a 20 54 63 6c 0a 23 20 28 64 29 20 61 20 54 63  * Tcl.# (d) a Tc
14c0: 6c 20 65 78 74 65 6e 73 69 6f 6e 20 75 73 69 6e  l extension usin
14d0: 67 20 6c 69 62 72 61 72 69 65 73 2f 69 6e 63 6c  g libraries/incl
14e0: 75 64 65 73 20 66 72 6f 6d 20 54 63 6c 20 73 6f  udes from Tcl so
14f0: 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 0a 23  urce directory.#
1500: 0a 23 20 54 68 69 73 20 6c 61 73 74 20 69 73 20  .# This last is 
1510: 6e 65 65 64 65 64 20 62 65 63 61 75 73 65 20 73  needed because s
1520: 6f 6d 65 20 65 78 74 65 6e 73 69 6f 6e 73 20 73  ome extensions s
1530: 74 69 6c 6c 20 6e 65 65 64 0a 23 20 73 6f 6d 65  till need.# some
1540: 20 54 63 6c 20 69 6e 74 65 72 66 61 63 65 73 20   Tcl interfaces 
1550: 74 68 61 74 20 61 72 65 20 6e 6f 74 20 70 75 62  that are not pub
1560: 6c 69 63 6c 79 20 65 78 70 6f 73 65 64 2e 0a 23  licly exposed..#
1570: 0a 23 20 54 68 65 20 66 72 61 67 6d 65 6e 74 20  .# The fragment 
1580: 77 69 6c 6c 20 73 65 74 20 74 68 65 20 66 6f 6c  will set the fol
1590: 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 3a 0a 23  lowing macros:.#
15a0: 20 52 4f 4f 54 20 2d 20 72 6f 6f 74 20 6f 66 20   ROOT - root of 
15b0: 74 68 69 73 20 6d 6f 64 75 6c 65 20 73 6f 75 72  this module sour
15c0: 63 65 73 0a 23 20 43 4f 4d 50 41 54 44 49 52 20  ces.# COMPATDIR 
15d0: 2d 20 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f  - source directo
15e0: 72 79 20 74 68 61 74 20 68 6f 6c 64 73 20 63 6f  ry that holds co
15f0: 6d 70 61 74 69 62 69 6c 69 74 79 20 73 6f 75 72  mpatibility sour
1600: 63 65 73 0a 23 20 44 4f 43 44 49 52 20 2d 20 73  ces.# DOCDIR - s
1610: 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 20  ource directory 
1620: 63 6f 6e 74 61 69 6e 69 6e 67 20 64 6f 63 75 6d  containing docum
1630: 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65 73 0a 23  entation files.#
1640: 20 47 45 4e 45 52 49 43 44 49 52 20 2d 20 70 6c   GENERICDIR - pl
1650: 61 74 66 6f 72 6d 2d 69 6e 64 65 70 65 6e 64 65  atform-independe
1660: 6e 74 20 73 6f 75 72 63 65 20 64 69 72 65 63 74  nt source direct
1670: 6f 72 79 0a 23 20 57 49 4e 5f 44 49 52 20 2d 20  ory.# WIN_DIR - 
1680: 57 69 6e 64 6f 77 73 2d 73 70 65 63 69 66 69 63  Windows-specific
1690: 20 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72   source director
16a0: 79 0a 23 20 54 45 53 54 44 49 52 20 2d 20 64 69  y.# TESTDIR - di
16b0: 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69  rectory containi
16c0: 6e 67 20 74 65 73 74 20 66 69 6c 65 73 0a 23 20  ng test files.# 
16d0: 54 4f 4f 4c 53 44 49 52 20 2d 20 64 69 72 65 63  TOOLSDIR - direc
16e0: 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20  tory containing 
16f0: 62 75 69 6c 64 20 74 6f 6f 6c 73 0a 23 20 5f 54  build tools.# _T
1700: 43 4c 44 49 52 20 2d 20 72 6f 6f 74 20 6f 66 20  CLDIR - root of 
1710: 74 68 65 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61  the Tcl installa
1720: 74 69 6f 6e 20 4f 52 20 74 68 65 20 54 63 6c 20  tion OR the Tcl 
1730: 73 6f 75 72 63 65 73 2e 20 4e 6f 74 20 73 65 74  sources. Not set
1740: 0a 23 20 20 20 20 77 68 65 6e 20 62 75 69 6c 64  .#    when build
1750: 69 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 2e 0a  ing Tcl itself..
1760: 23 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 2d 20  # _INSTALLDIR - 
1770: 6e 61 74 69 76 65 20 66 6f 72 6d 20 6f 66 20 74  native form of t
1780: 68 65 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20  he installation 
1790: 70 61 74 68 2e 20 46 6f 72 20 54 63 6c 0a 23 20  path. For Tcl.# 
17a0: 20 20 20 74 68 69 73 20 77 69 6c 6c 20 62 65 20     this will be 
17b0: 74 68 65 20 72 6f 6f 74 20 6f 66 20 74 68 65 20  the root of the 
17c0: 54 63 6c 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e  Tcl installation
17d0: 2e 20 46 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73  . For extensions
17e0: 0a 23 20 20 20 20 74 68 69 73 20 77 69 6c 6c 20  .#    this will 
17f0: 62 65 20 74 68 65 20 6c 69 62 20 64 69 72 65 63  be the lib direc
1800: 74 6f 72 79 20 75 6e 64 65 72 20 74 68 65 20 72  tory under the r
1810: 6f 6f 74 2e 0a 23 20 54 43 4c 49 4e 53 54 41 4c  oot..# TCLINSTAL
1820: 4c 20 20 2d 20 73 65 74 20 74 6f 20 31 20 69 66  L  - set to 1 if
1830: 20 5f 54 43 4c 44 49 52 20 72 65 66 65 72 73 20   _TCLDIR refers 
1840: 74 6f 0a 23 20 20 20 20 68 65 61 64 65 72 73 20  to.#    headers 
1850: 61 6e 64 20 6c 69 62 72 61 72 69 65 73 20 66 72  and libraries fr
1860: 6f 6d 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20  om an installed 
1870: 54 63 6c 2c 20 61 6e 64 20 30 20 69 66 20 62 75  Tcl, and 0 if bu
1880: 69 6c 74 20 61 67 61 69 6e 73 74 0a 23 20 20 20  ilt against.#   
1890: 20 54 63 6c 20 73 6f 75 72 63 65 73 2e 20 4e 6f   Tcl sources. No
18a0: 74 20 73 65 74 20 77 68 65 6e 20 62 75 69 6c 64  t set when build
18b0: 69 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 2e 20  ing Tcl itself. 
18c0: 59 65 73 2c 20 6e 6f 74 20 76 65 72 79 20 77 65  Yes, not very we
18d0: 6c 6c 0a 23 20 20 20 20 6e 61 6d 65 64 2e 0a 23  ll.#    named..#
18e0: 20 5f 54 43 4c 5f 48 20 2d 20 6e 61 74 69 76 65   _TCL_H - native
18f0: 20 70 61 74 68 20 74 6f 20 74 68 65 20 74 63 6c   path to the tcl
1900: 2e 68 20 66 69 6c 65 0a 23 0a 23 20 49 66 20 54  .h file.#.# If T
1910: 6b 20 69 73 20 69 6e 76 6f 6c 76 65 64 2c 20 61  k is involved, a
1920: 6c 73 6f 20 73 65 74 73 20 74 68 65 20 66 6f 6c  lso sets the fol
1930: 6c 6f 77 69 6e 67 0a 23 20 5f 54 4b 44 49 52 20  lowing.# _TKDIR 
1940: 2d 20 6e 61 74 69 76 65 20 66 6f 72 6d 20 54 6b  - native form Tk
1950: 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 4f 52   installation OR
1960: 20 54 6b 20 73 6f 75 72 63 65 2e 20 4e 6f 74 20   Tk source. Not 
1970: 73 65 74 20 69 66 20 62 75 69 6c 64 69 6e 67 0a  set if building.
1980: 23 20 20 20 20 54 6b 20 69 74 73 65 6c 66 2e 0a  #    Tk itself..
1990: 23 20 54 4b 49 4e 53 54 41 4c 4c 20 2d 20 73 65  # TKINSTALL - se
19a0: 74 20 31 20 69 66 20 5f 54 4b 44 49 52 20 72 65  t 1 if _TKDIR re
19b0: 66 65 72 73 20 74 6f 20 69 6e 73 74 61 6c 6c 65  fers to installe
19c0: 64 20 54 6b 20 61 6e 64 20 30 20 69 66 20 54 6b  d Tk and 0 if Tk
19d0: 20 73 6f 75 72 63 65 73 0a 23 20 5f 54 4b 5f 48   sources.# _TK_H
19e0: 20 2d 20 6e 61 74 69 76 65 20 70 61 74 68 20 74   - native path t
19f0: 6f 20 74 68 65 20 74 6b 2e 68 20 66 69 6c 65 0a  o the tk.h file.
1a00: 0a 23 20 52 6f 6f 74 20 64 69 72 65 63 74 6f 72  .# Root director
1a10: 79 20 66 6f 72 20 73 6f 75 72 63 65 73 20 61 6e  y for sources an
1a20: 64 20 61 73 73 75 6d 65 64 20 73 75 62 64 69 72  d assumed subdir
1a30: 65 63 74 6f 72 69 65 73 0a 52 4f 4f 54 20 3d 20  ectories.ROOT = 
1a40: 24 28 4d 41 4b 45 44 49 52 29 5c 2e 2e 0a 23 20  $(MAKEDIR)\...# 
1a50: 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 70 61  The following pa
1a60: 74 68 73 20 43 41 4e 4e 4f 54 20 68 61 76 65 20  ths CANNOT have 
1a70: 73 70 61 63 65 73 20 69 6e 20 74 68 65 6d 20 61  spaces in them a
1a80: 73 20 74 68 65 79 20 61 70 70 65 61 72 20 6f 6e  s they appear on
1a90: 20 74 68 65 0a 23 20 6c 65 66 74 20 73 69 64 65   the.# left side
1aa0: 20 6f 66 20 69 6d 70 6c 69 63 69 74 20 72 75 6c   of implicit rul
1ab0: 65 73 2e 0a 21 69 66 6e 64 65 66 20 43 4f 4d 50  es..!ifndef COMP
1ac0: 41 54 44 49 52 0a 43 4f 4d 50 41 54 44 49 52 09  ATDIR.COMPATDIR.
1ad0: 3d 20 24 28 52 4f 4f 54 29 5c 63 6f 6d 70 61 74  = $(ROOT)\compat
1ae0: 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64 65 66 20  .!endif.!ifndef 
1af0: 44 4f 43 44 49 52 0a 44 4f 43 44 49 52 09 09 3d  DOCDIR.DOCDIR..=
1b00: 20 24 28 52 4f 4f 54 29 5c 64 6f 63 0a 21 65 6e   $(ROOT)\doc.!en
1b10: 64 69 66 0a 21 69 66 6e 64 65 66 20 47 45 4e 45  dif.!ifndef GENE
1b20: 52 49 43 44 49 52 0a 47 45 4e 45 52 49 43 44 49  RICDIR.GENERICDI
1b30: 52 09 3d 20 24 28 52 4f 4f 54 29 5c 67 65 6e 65  R.= $(ROOT)\gene
1b40: 72 69 63 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64  ric.!endif.!ifnd
1b50: 65 66 20 54 4f 4f 4c 53 44 49 52 0a 54 4f 4f 4c  ef TOOLSDIR.TOOL
1b60: 53 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c 74  SDIR.= $(ROOT)\t
1b70: 6f 6f 6c 73 0a 21 65 6e 64 69 66 0a 21 69 66 6e  ools.!endif.!ifn
1b80: 64 65 66 20 54 45 53 54 44 49 52 0a 54 45 53 54  def TESTDIR.TEST
1b90: 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c 74 65  DIR.= $(ROOT)\te
1ba0: 73 74 73 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64  sts.!endif.!ifnd
1bb0: 65 66 20 4c 49 42 44 49 52 0a 21 69 66 20 65 78  ef LIBDIR.!if ex
1bc0: 69 73 74 28 22 24 28 52 4f 4f 54 29 5c 6c 69 62  ist("$(ROOT)\lib
1bd0: 72 61 72 79 22 29 0a 4c 49 42 44 49 52 20 20 20  rary").LIBDIR   
1be0: 20 20 20 20 20 20 20 3d 20 24 28 52 4f 4f 54 29         = $(ROOT)
1bf0: 5c 6c 69 62 72 61 72 79 0a 21 65 6c 73 65 0a 4c  \library.!else.L
1c00: 49 42 44 49 52 20 20 20 20 20 20 20 20 20 20 3d  IBDIR          =
1c10: 20 24 28 52 4f 4f 54 29 5c 6c 69 62 0a 21 65 6e   $(ROOT)\lib.!en
1c20: 64 69 66 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64  dif.!endif.!ifnd
1c30: 65 66 20 44 45 4d 4f 44 49 52 0a 21 69 66 20 65  ef DEMODIR.!if e
1c40: 78 69 73 74 28 22 24 28 4c 49 42 44 49 52 29 5c  xist("$(LIBDIR)\
1c50: 64 65 6d 6f 73 22 29 0a 44 45 4d 4f 44 49 52 09  demos").DEMODIR.
1c60: 09 3d 20 24 28 4c 49 42 44 49 52 29 5c 64 65 6d  .= $(LIBDIR)\dem
1c70: 6f 73 0a 21 65 6c 73 65 0a 44 45 4d 4f 44 49 52  os.!else.DEMODIR
1c80: 09 09 3d 20 24 28 52 4f 4f 54 29 5c 64 65 6d 6f  ..= $(ROOT)\demo
1c90: 73 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 20  s.!endif.!endif 
1ca0: 23 20 69 66 6e 64 65 66 20 44 45 4d 4f 44 49 52  # ifndef DEMODIR
1cb0: 0a 23 20 44 6f 20 4e 4f 54 20 75 73 65 20 57 49  .# Do NOT use WI
1cc0: 4e 44 49 52 20 62 65 63 61 75 73 65 20 69 74 20  NDIR because it 
1cd0: 69 73 20 57 69 6e 64 6f 77 73 20 69 6e 74 65 72  is Windows inter
1ce0: 6e 61 6c 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a  nal environment.
1cf0: 23 20 76 61 72 69 61 62 6c 65 20 74 6f 20 70 6f  # variable to po
1d00: 69 6e 74 20 74 6f 20 63 3a 5c 77 69 6e 64 6f 77  int to c:\window
1d10: 73 21 0a 57 49 4e 5f 44 49 52 09 09 3d 20 24 28  s!.WIN_DIR..= $(
1d20: 52 4f 4f 54 29 5c 77 69 6e 0a 0a 21 69 66 6e 64  ROOT)\win..!ifnd
1d30: 65 66 20 52 43 44 49 52 0a 21 69 66 20 65 78 69  ef RCDIR.!if exi
1d40: 73 74 28 22 24 28 57 49 4e 5f 44 49 52 29 5c 72  st("$(WIN_DIR)\r
1d50: 63 22 29 0a 52 43 44 49 52 20 20 20 20 20 20 20  c").RCDIR       
1d60: 20 20 20 20 3d 20 24 28 57 49 4e 5f 44 49 52 29      = $(WIN_DIR)
1d70: 5c 72 63 0a 21 65 6c 73 65 0a 52 43 44 49 52 20  \rc.!else.RCDIR 
1d80: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 57 49            = $(WI
1d90: 4e 5f 44 49 52 29 0a 21 65 6e 64 69 66 0a 21 65  N_DIR).!endif.!e
1da0: 6e 64 69 66 0a 52 43 44 49 52 20 3d 20 24 28 52  ndif.RCDIR = $(R
1db0: 43 44 49 52 3a 2f 3d 5c 29 0a 0a 23 20 54 68 65  CDIR:/=\)..# The
1dc0: 20 74 61 72 67 65 74 20 64 69 72 65 63 74 6f 72   target director
1dd0: 79 20 77 68 65 72 65 20 74 68 65 20 62 75 69 6c  y where the buil
1de0: 74 20 70 61 63 6b 61 67 65 73 20 61 6e 64 20 62  t packages and b
1df0: 69 6e 61 72 69 65 73 20 77 69 6c 6c 20 62 65 20  inaries will be 
1e00: 69 6e 73 74 61 6c 6c 65 64 2e 0a 23 20 49 4e 53  installed..# INS
1e10: 54 41 4c 4c 44 49 52 20 69 73 20 74 68 65 20 28  TALLDIR is the (
1e20: 6f 70 74 69 6f 6e 61 6c 29 20 70 61 74 68 20 73  optional) path s
1e30: 70 65 63 69 66 69 65 64 20 62 79 20 74 68 65 20  pecified by the 
1e40: 75 73 65 72 2e 0a 23 20 5f 49 4e 53 54 41 4c 4c  user..# _INSTALL
1e50: 44 49 52 20 69 73 20 49 4e 53 54 41 4c 4c 44 49  DIR is INSTALLDI
1e60: 52 20 75 73 69 6e 67 20 74 68 65 20 62 61 63 6b  R using the back
1e70: 73 6c 61 73 68 20 73 65 70 61 72 61 74 6f 72 20  slash separator 
1e80: 73 79 6e 74 61 78 0a 21 69 66 64 65 66 20 49 4e  syntax.!ifdef IN
1e90: 53 54 41 4c 4c 44 49 52 0a 23 23 23 20 46 69 78  STALLDIR.### Fix
1ea0: 20 74 68 65 20 70 61 74 68 20 73 65 70 61 72 61   the path separa
1eb0: 74 6f 72 73 2e 0a 5f 49 4e 53 54 41 4c 4c 44 49  tors.._INSTALLDI
1ec0: 52 09 3d 20 24 28 49 4e 53 54 41 4c 4c 44 49 52  R.= $(INSTALLDIR
1ed0: 3a 2f 3d 5c 29 0a 21 65 6c 73 65 0a 23 23 23 20  :/=\).!else.### 
1ee0: 41 73 73 75 6d 65 20 74 68 65 20 6e 6f 72 6d 61  Assume the norma
1ef0: 6c 20 64 65 66 61 75 6c 74 2e 0a 5f 49 4e 53 54  l default.._INST
1f00: 41 4c 4c 44 49 52 09 3d 20 24 28 48 4f 4d 45 44  ALLDIR.= $(HOMED
1f10: 52 49 56 45 29 5c 54 63 6c 0a 21 65 6e 64 69 66  RIVE)\Tcl.!endif
1f20: 0a 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43  ..!if $(DOING_TC
1f30: 4c 29 0a 0a 23 20 42 45 47 49 4e 20 43 61 73 65  L)..# BEGIN Case
1f40: 20 32 28 61 29 20 2d 20 42 75 69 6c 64 69 6e 67   2(a) - Building
1f50: 20 54 63 6c 20 69 74 73 65 6c 66 0a 0a 23 20 4f   Tcl itself..# O
1f60: 6e 6c 79 20 6e 65 65 64 20 74 6f 20 64 65 66 69  nly need to defi
1f70: 6e 65 20 5f 54 43 4c 5f 48 0a 5f 54 43 4c 5f 48  ne _TCL_H._TCL_H
1f80: 20 3d 20 2e 2e 5c 67 65 6e 65 72 69 63 5c 74 63   = ..\generic\tc
1f90: 6c 2e 68 0a 0a 23 20 45 4e 44 20 43 61 73 65 20  l.h..# END Case 
1fa0: 32 28 61 29 20 2d 20 42 75 69 6c 64 69 6e 67 20  2(a) - Building 
1fb0: 54 63 6c 20 69 74 73 65 6c 66 0a 0a 21 65 6c 73  Tcl itself..!els
1fc0: 65 69 66 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0a  eif $(DOING_TK).
1fd0: 0a 23 20 42 45 47 49 4e 20 43 61 73 65 20 32 28  .# BEGIN Case 2(
1fe0: 62 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 54 6b  b) - Building Tk
1ff0: 0a 0a 54 43 4c 49 4e 53 54 41 4c 4c 20 3d 20 30  ..TCLINSTALL = 0
2000: 20 23 20 54 6b 20 61 6c 77 61 79 73 20 62 75 69   # Tk always bui
2010: 6c 64 73 20 61 67 61 69 6e 73 74 20 54 63 6c 20  lds against Tcl 
2020: 73 6f 75 72 63 65 2c 20 6e 6f 74 20 61 6e 20 69  source, not an i
2030: 6e 73 74 61 6c 6c 65 64 20 54 63 6c 0a 21 69 66  nstalled Tcl.!if
2040: 20 22 24 28 54 43 4c 44 49 52 29 22 20 3d 3d 20   "$(TCLDIR)" == 
2050: 22 22 0a 21 69 66 20 5b 65 63 68 6f 20 54 43 4c  "".!if [echo TCL
2060: 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c  DIR = \> nmakehl
2070: 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b  p.out] \.   || [
2080: 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20 67 65 6e 65  nmakehlp -L gene
2090: 72 69 63 5c 74 63 6c 2e 68 20 3e 3e 20 6e 6d 61  ric\tcl.h >> nma
20a0: 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72 6f  kehlp.out].!erro
20b0: 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20  r *** Could not 
20c0: 6c 6f 63 61 74 65 20 54 63 6c 20 73 6f 75 72 63  locate Tcl sourc
20d0: 65 20 64 69 72 65 63 74 6f 72 79 2e 0a 21 65 6e  e directory..!en
20e0: 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61  dif.!include nma
20f0: 6b 65 68 6c 70 2e 6f 75 74 0a 21 65 6e 64 69 66  kehlp.out.!endif
2100: 20 23 20 54 43 4c 44 49 52 20 3d 3d 20 22 22 0a   # TCLDIR == "".
2110: 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 54 43 4c  ._TCLDIR.= $(TCL
2120: 44 49 52 3a 2f 3d 5c 29 0a 5f 54 43 4c 5f 48 20  DIR:/=\)._TCL_H 
2130: 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 67 65   = $(_TCLDIR)\ge
2140: 6e 65 72 69 63 5c 74 63 6c 2e 68 0a 21 69 66 20  neric\tcl.h.!if 
2150: 21 65 78 69 73 74 28 22 24 28 5f 54 43 4c 5f 48  !exist("$(_TCL_H
2160: 29 22 29 0a 21 65 72 72 6f 72 20 43 6f 75 6c 64  )").!error Could
2170: 20 6e 6f 74 20 6c 6f 63 61 74 65 20 74 63 6c 2e   not locate tcl.
2180: 68 2e 20 50 6c 65 61 73 65 20 73 65 74 20 74 68  h. Please set th
2190: 65 20 54 43 4c 44 49 52 20 6d 61 63 72 6f 20 74  e TCLDIR macro t
21a0: 6f 20 70 6f 69 6e 74 20 74 6f 20 74 68 65 20 54  o point to the T
21b0: 63 6c 20 2a 73 6f 75 72 63 65 2a 20 64 69 72 65  cl *source* dire
21c0: 63 74 6f 72 79 2e 0a 21 65 6e 64 69 66 0a 0a 5f  ctory..!endif.._
21d0: 54 4b 5f 48 20 3d 20 2e 2e 5c 67 65 6e 65 72 69  TK_H = ..\generi
21e0: 63 5c 74 6b 2e 68 0a 0a 23 20 45 4e 44 20 43 61  c\tk.h..# END Ca
21f0: 73 65 20 32 28 62 29 20 2d 20 42 75 69 6c 64 69  se 2(b) - Buildi
2200: 6e 67 20 54 6b 0a 0a 21 65 6c 73 65 0a 0a 23 20  ng Tk..!else..# 
2210: 42 45 47 49 4e 20 43 61 73 65 20 32 28 63 29 20  BEGIN Case 2(c) 
2220: 6f 72 20 28 64 29 20 2d 20 42 75 69 6c 64 69 6e  or (d) - Buildin
2230: 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20 6f  g an extension o
2240: 74 68 65 72 20 74 68 61 6e 20 54 6b 0a 0a 23 20  ther than Tk..# 
2250: 49 66 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20  If command line 
2260: 68 61 73 20 73 70 65 63 69 66 69 65 64 20 54 63  has specified Tc
2270: 6c 20 6c 6f 63 61 74 69 6f 6e 20 74 68 72 6f 75  l location throu
2280: 67 68 20 54 43 4c 44 49 52 2c 20 75 73 65 20 69  gh TCLDIR, use i
2290: 74 0a 23 20 65 6c 73 65 20 64 65 66 61 75 6c 74  t.# else default
22a0: 20 74 6f 20 74 68 65 20 49 4e 53 54 41 4c 4c 44   to the INSTALLD
22b0: 49 52 20 73 65 74 74 69 6e 67 0a 21 69 66 20 22  IR setting.!if "
22c0: 24 28 54 43 4c 44 49 52 29 22 20 21 3d 20 22 22  $(TCLDIR)" != ""
22d0: 0a 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 54 43  .._TCLDIR.= $(TC
22e0: 4c 44 49 52 3a 2f 3d 5c 29 0a 21 69 66 20 65 78  LDIR:/=\).!if ex
22f0: 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29 5c  ist("$(_TCLDIR)\
2300: 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 22 29 20  include\tcl.h") 
2310: 23 20 43 61 73 65 20 32 28 63 29 20 77 69 74 68  # Case 2(c) with
2320: 20 54 43 4c 44 49 52 20 64 65 66 69 6e 65 64 0a   TCLDIR defined.
2330: 54 43 4c 49 4e 53 54 41 4c 4c 09 3d 20 31 0a 5f  TCLINSTALL.= 1._
2340: 54 43 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d  TCL_H          =
2350: 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e 63 6c   $(_TCLDIR)\incl
2360: 75 64 65 5c 74 63 6c 2e 68 0a 21 65 6c 73 65 69  ude\tcl.h.!elsei
2370: 66 20 65 78 69 73 74 28 22 24 28 5f 54 43 4c 44  f exist("$(_TCLD
2380: 49 52 29 5c 67 65 6e 65 72 69 63 5c 74 63 6c 2e  IR)\generic\tcl.
2390: 68 22 29 20 23 20 43 61 73 65 20 32 28 64 29 20  h") # Case 2(d) 
23a0: 77 69 74 68 20 54 43 4c 44 49 52 20 64 65 66 69  with TCLDIR defi
23b0: 6e 65 64 0a 54 43 4c 49 4e 53 54 41 4c 4c 09 3d  ned.TCLINSTALL.=
23c0: 20 30 0a 5f 54 43 4c 5f 48 20 20 20 20 20 20 20   0._TCL_H       
23d0: 20 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c     = $(_TCLDIR)\
23e0: 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 0a 21 65  generic\tcl.h.!e
23f0: 6e 64 69 66 0a 0a 21 65 6c 73 65 20 20 23 20 20  ndif..!else  #  
2400: 23 20 43 61 73 65 20 32 28 63 29 20 66 6f 72 20  # Case 2(c) for 
2410: 65 78 74 65 6e 73 69 6f 6e 73 20 77 69 74 68 20  extensions with 
2420: 54 43 4c 44 49 52 20 75 6e 64 65 66 69 6e 65 64  TCLDIR undefined
2430: 0a 0a 23 20 4e 65 65 64 20 74 6f 20 6c 6f 63 61  ..# Need to loca
2440: 74 65 20 54 63 6c 20 64 65 70 65 6e 64 69 6e 67  te Tcl depending
2450: 20 6f 6e 20 77 68 65 74 68 65 72 20 69 74 20 6e   on whether it n
2460: 65 65 64 73 20 54 63 6c 20 73 6f 75 72 63 65 20  eeds Tcl source 
2470: 6f 72 20 6e 6f 74 2e 0a 23 20 49 66 20 77 65 20  or not..# If we 
2480: 64 6f 6e 27 74 2c 20 63 68 65 63 6b 20 74 68 65  don't, check the
2490: 20 49 4e 53 54 41 4c 4c 44 49 52 20 66 6f 72 20   INSTALLDIR for 
24a0: 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c  an installed Tcl
24b0: 20 66 69 72 73 74 0a 0a 21 69 66 20 65 78 69 73   first..!if exis
24c0: 74 28 22 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52  t("$(_INSTALLDIR
24d0: 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 22  )\include\tcl.h"
24e0: 29 20 26 26 20 21 24 28 4e 45 45 44 5f 54 43 4c  ) && !$(NEED_TCL
24f0: 5f 53 4f 55 52 43 45 29 0a 0a 54 43 4c 49 4e 53  _SOURCE)..TCLINS
2500: 54 41 4c 4c 09 3d 20 31 0a 54 43 4c 44 49 52 20  TALL.= 1.TCLDIR 
2510: 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 49 4e           = $(_IN
2520: 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0a 23 20 4e  STALLDIR)\...# N
2530: 4f 54 45 3a 20 77 65 20 77 69 6c 6c 20 62 65 20  OTE: we will be 
2540: 72 65 73 65 74 74 69 6e 67 20 5f 49 4e 53 54 41  resetting _INSTA
2550: 4c 4c 44 49 52 20 74 6f 20 5f 49 4e 53 54 41 4c  LLDIR to _INSTAL
2560: 4c 44 49 52 2f 6c 69 62 20 66 6f 72 20 65 78 74  LDIR/lib for ext
2570: 65 6e 73 69 6f 6e 73 0a 23 20 6c 61 74 65 72 20  ensions.# later 
2580: 73 6f 20 74 68 65 20 5c 2e 2e 20 61 63 63 6f 75  so the \.. accou
2590: 6e 74 73 20 66 6f 72 20 74 68 65 20 2f 6c 69 62  nts for the /lib
25a0: 0a 5f 54 43 4c 44 49 52 09 09 3d 20 24 28 5f 49  ._TCLDIR..= $(_I
25b0: 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0a 5f 54  NSTALLDIR)\..._T
25c0: 43 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20  CL_H          = 
25d0: 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e 63 6c 75  $(_TCLDIR)\inclu
25e0: 64 65 5c 74 63 6c 2e 68 0a 0a 21 65 6c 73 65 20  de\tcl.h..!else 
25f0: 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 26 26 20  # exist(...) && 
2600: 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f 55 52  !$(NEED_TCL_SOUR
2610: 43 45 29 0a 0a 21 69 66 20 5b 65 63 68 6f 20 5f  CE)..!if [echo _
2620: 54 43 4c 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b  TCLDIR = \> nmak
2630: 65 68 6c 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c  ehlp.out] \.   |
2640: 7c 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20 67  | [nmakehlp -L g
2650: 65 6e 65 72 69 63 5c 74 63 6c 2e 68 20 3e 3e 20  eneric\tcl.h >> 
2660: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65  nmakehlp.out].!e
2670: 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e  rror *** Could n
2680: 6f 74 20 6c 6f 63 61 74 65 20 54 63 6c 20 73 6f  ot locate Tcl so
2690: 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 2e 0a  urce directory..
26a0: 21 65 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65 20  !endif.!include 
26b0: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0a 54 43 4c  nmakehlp.out.TCL
26c0: 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 30  INSTALL      = 0
26d0: 0a 54 43 4c 44 49 52 20 20 20 20 20 20 20 20 20  .TCLDIR         
26e0: 3d 20 24 28 5f 54 43 4c 44 49 52 29 0a 5f 54 43  = $(_TCLDIR)._TC
26f0: 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24  L_H          = $
2700: 28 5f 54 43 4c 44 49 52 29 5c 67 65 6e 65 72 69  (_TCLDIR)\generi
2710: 63 5c 74 63 6c 2e 68 0a 0a 21 65 6e 64 69 66 20  c\tcl.h..!endif 
2720: 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 26 26 20  # exist(...) && 
2730: 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f 55 52  !$(NEED_TCL_SOUR
2740: 43 45 29 0a 0a 21 65 6e 64 69 66 20 23 20 54 43  CE)..!endif # TC
2750: 4c 44 49 52 0a 0a 21 69 66 6e 64 65 66 20 5f 54  LDIR..!ifndef _T
2760: 43 4c 5f 48 0a 4d 53 47 20 3d 5e 0a 46 61 69 6c  CL_H.MSG =^.Fail
2770: 65 64 20 74 6f 20 66 69 6e 64 20 74 63 6c 2e 68  ed to find tcl.h
2780: 2e 20 54 68 65 20 54 43 4c 44 49 52 20 6d 61 63  . The TCLDIR mac
2790: 72 6f 20 69 73 20 73 65 74 20 69 6e 63 6f 72 72  ro is set incorr
27a0: 65 63 74 6c 79 20 6f 72 20 69 73 20 6e 6f 74 20  ectly or is not 
27b0: 73 65 74 20 61 6e 64 20 64 65 66 61 75 6c 74 20  set and default 
27c0: 70 61 74 68 20 64 6f 65 73 20 6e 6f 74 20 63 6f  path does not co
27d0: 6e 74 61 69 6e 20 74 63 6c 2e 68 2e 0a 21 65 72  ntain tcl.h..!er
27e0: 72 6f 72 20 24 28 4d 53 47 29 0a 21 65 6e 64 69  ror $(MSG).!endi
27f0: 66 0a 0a 23 20 4e 6f 77 20 64 6f 20 74 68 65 20  f..# Now do the 
2800: 73 61 6d 65 20 74 6f 20 6c 6f 63 61 74 65 20 54  same to locate T
2810: 6b 20 68 65 61 64 65 72 73 20 61 6e 64 20 6c 69  k headers and li
2820: 62 73 20 69 66 20 70 72 6f 6a 65 63 74 20 72 65  bs if project re
2830: 71 75 69 72 65 73 20 54 6b 0a 21 69 66 20 24 28  quires Tk.!if $(
2840: 4e 45 45 44 5f 54 4b 29 0a 0a 21 69 66 20 22 24  NEED_TK)..!if "$
2850: 28 54 4b 44 49 52 29 22 20 21 3d 20 22 22 0a 0a  (TKDIR)" != ""..
2860: 5f 54 4b 44 49 52 20 3d 20 24 28 54 4b 44 49 52  _TKDIR = $(TKDIR
2870: 3a 2f 3d 5c 29 0a 21 69 66 20 65 78 69 73 74 28  :/=\).!if exist(
2880: 22 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75  "$(_TKDIR)\inclu
2890: 64 65 5c 74 6b 2e 68 22 29 0a 54 4b 49 4e 53 54  de\tk.h").TKINST
28a0: 41 4c 4c 20 20 20 20 20 20 3d 20 31 0a 5f 54 4b  ALL      = 1._TK
28b0: 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24 28  _H          = $(
28c0: 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c  _TKDIR)\include\
28d0: 74 6b 2e 68 0a 21 65 6c 73 65 69 66 20 65 78 69  tk.h.!elseif exi
28e0: 73 74 28 22 24 28 5f 54 4b 44 49 52 29 5c 67 65  st("$(_TKDIR)\ge
28f0: 6e 65 72 69 63 5c 74 6b 2e 68 22 29 0a 54 4b 49  neric\tk.h").TKI
2900: 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 30 0a  NSTALL      = 0.
2910: 5f 54 4b 5f 48 20 20 20 20 20 20 20 20 20 20 3d  _TK_H          =
2920: 20 24 28 5f 54 4b 44 49 52 29 5c 67 65 6e 65 72   $(_TKDIR)\gener
2930: 69 63 5c 74 6b 2e 68 0a 21 65 6e 64 69 66 0a 0a  ic\tk.h.!endif..
2940: 21 65 6c 73 65 20 23 20 54 4b 44 49 52 20 6e 6f  !else # TKDIR no
2950: 74 20 64 65 66 69 6e 65 64 0a 0a 23 20 4e 65 65  t defined..# Nee
2960: 64 20 74 6f 20 6c 6f 63 61 74 65 20 54 63 6c 20  d to locate Tcl 
2970: 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 77 68 65  depending on whe
2980: 74 68 65 72 20 69 74 20 6e 65 65 64 73 20 54 63  ther it needs Tc
2990: 6c 20 73 6f 75 72 63 65 20 6f 72 20 6e 6f 74 2e  l source or not.
29a0: 0a 23 20 49 66 20 77 65 20 64 6f 6e 27 74 2c 20  .# If we don't, 
29b0: 63 68 65 63 6b 20 74 68 65 20 49 4e 53 54 41 4c  check the INSTAL
29c0: 4c 44 49 52 20 66 6f 72 20 61 6e 20 69 6e 73 74  LDIR for an inst
29d0: 61 6c 6c 65 64 20 54 63 6c 20 66 69 72 73 74 0a  alled Tcl first.
29e0: 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f 49  .!if exist("$(_I
29f0: 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75  NSTALLDIR)\inclu
2a00: 64 65 5c 74 6b 2e 68 22 29 20 26 26 20 21 24 28  de\tk.h") && !$(
2a10: 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0a  NEED_TK_SOURCE).
2a20: 0a 54 4b 49 4e 53 54 41 4c 4c 20 20 20 20 20 20  .TKINSTALL      
2a30: 3d 20 31 0a 23 20 4e 4f 54 45 3a 20 77 65 20 77  = 1.# NOTE: we w
2a40: 69 6c 6c 20 62 65 20 72 65 73 65 74 74 69 6e 67  ill be resetting
2a50: 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 74 6f 20   _INSTALLDIR to 
2a60: 5f 49 4e 53 54 41 4c 4c 44 49 52 2f 6c 69 62 20  _INSTALLDIR/lib 
2a70: 66 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 0a 23  for extensions.#
2a80: 20 6c 61 74 65 72 20 73 6f 20 74 68 65 20 5c 2e   later so the \.
2a90: 2e 20 61 63 63 6f 75 6e 74 73 20 66 6f 72 20 74  . accounts for t
2aa0: 68 65 20 2f 6c 69 62 0a 5f 54 4b 44 49 52 20 20  he /lib._TKDIR  
2ab0: 20 20 20 20 20 20 20 3d 20 24 28 5f 49 4e 53 54         = $(_INST
2ac0: 41 4c 4c 44 49 52 29 5c 2e 2e 0a 5f 54 4b 5f 48  ALLDIR)\..._TK_H
2ad0: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54            = $(_T
2ae0: 4b 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 6b  KDIR)\include\tk
2af0: 2e 68 0a 54 4b 44 49 52 20 20 20 20 20 20 20 20  .h.TKDIR        
2b00: 20 20 3d 20 24 28 5f 54 4b 44 49 52 29 0a 0a 21    = $(_TKDIR)..!
2b10: 65 6c 73 65 20 23 20 65 78 69 73 74 28 22 24 28  else # exist("$(
2b20: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63  _INSTALLDIR)\inc
2b30: 6c 75 64 65 5c 74 6b 2e 68 22 29 20 26 26 20 21  lude\tk.h") && !
2b40: 24 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45  $(NEED_TK_SOURCE
2b50: 29 0a 0a 21 69 66 20 5b 65 63 68 6f 20 5f 54 4b  )..!if [echo _TK
2b60: 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c  DIR = \> nmakehl
2b70: 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b  p.out] \.   || [
2b80: 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20 67 65 6e 65  nmakehlp -L gene
2b90: 72 69 63 5c 74 6b 2e 68 20 3e 3e 20 6e 6d 61 6b  ric\tk.h >> nmak
2ba0: 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72 6f 72  ehlp.out].!error
2bb0: 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 6c   *** Could not l
2bc0: 6f 63 61 74 65 20 54 6b 20 73 6f 75 72 63 65 20  ocate Tk source 
2bd0: 64 69 72 65 63 74 6f 72 79 2e 0a 21 65 6e 64 69  directory..!endi
2be0: 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 6b 65  f.!include nmake
2bf0: 68 6c 70 2e 6f 75 74 0a 54 4b 49 4e 53 54 41 4c  hlp.out.TKINSTAL
2c00: 4c 20 20 20 20 20 20 3d 20 30 0a 54 4b 44 49 52  L      = 0.TKDIR
2c10: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54            = $(_T
2c20: 4b 44 49 52 29 0a 5f 54 4b 5f 48 20 20 20 20 20  KDIR)._TK_H     
2c30: 20 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 52 29       = $(_TKDIR)
2c40: 5c 67 65 6e 65 72 69 63 5c 74 6b 2e 68 0a 0a 21  \generic\tk.h..!
2c50: 65 6e 64 69 66 20 23 20 65 78 69 73 74 28 22 24  endif # exist("$
2c60: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e  (_INSTALLDIR)\in
2c70: 63 6c 75 64 65 5c 74 6b 2e 68 22 29 20 26 26 20  clude\tk.h") && 
2c80: 21 24 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43  !$(NEED_TK_SOURC
2c90: 45 29 0a 0a 21 65 6e 64 69 66 20 23 20 54 4b 44  E)..!endif # TKD
2ca0: 49 52 0a 0a 21 69 66 6e 64 65 66 20 5f 54 4b 5f  IR..!ifndef _TK_
2cb0: 48 0a 4d 53 47 20 3d 5e 0a 46 61 69 6c 65 64 20  H.MSG =^.Failed 
2cc0: 74 6f 20 66 69 6e 64 20 74 6b 2e 68 2e 20 54 68  to find tk.h. Th
2cd0: 65 20 54 4b 44 49 52 20 6d 61 63 72 6f 20 69 73  e TKDIR macro is
2ce0: 20 73 65 74 20 69 6e 63 6f 72 72 65 63 74 6c 79   set incorrectly
2cf0: 20 6f 72 20 69 73 20 6e 6f 74 20 73 65 74 20 61   or is not set a
2d00: 6e 64 20 64 65 66 61 75 6c 74 20 70 61 74 68 20  nd default path 
2d10: 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e  does not contain
2d20: 20 74 6b 2e 68 2e 0a 21 65 72 72 6f 72 20 24 28   tk.h..!error $(
2d30: 4d 53 47 29 0a 21 65 6e 64 69 66 0a 0a 21 65 6e  MSG).!endif..!en
2d40: 64 69 66 20 23 20 4e 45 45 44 5f 54 4b 0a 0a 21  dif # NEED_TK..!
2d50: 69 66 20 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f  if $(NEED_TCL_SO
2d60: 55 52 43 45 29 20 26 26 20 24 28 54 43 4c 49 4e  URCE) && $(TCLIN
2d70: 53 54 41 4c 4c 29 0a 4d 53 47 20 3d 20 5e 0a 2a  STALL).MSG = ^.*
2d80: 2a 2a 20 57 61 72 6e 69 6e 67 3a 20 54 68 69 73  ** Warning: This
2d90: 20 65 78 74 65 6e 73 69 6f 6e 20 72 65 71 75 69   extension requi
2da0: 72 65 73 20 74 68 65 20 73 6f 75 72 63 65 20 64  res the source d
2db0: 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 20 54  istribution of T
2dc0: 63 6c 2e 5e 0a 2a 2a 2a 20 50 6c 65 61 73 65 20  cl.^.*** Please 
2dd0: 73 65 74 20 74 68 65 20 54 43 4c 44 49 52 20 6d  set the TCLDIR m
2de0: 61 63 72 6f 20 74 6f 20 70 6f 69 6e 74 20 74 6f  acro to point to
2df0: 20 74 68 65 20 54 63 6c 20 73 6f 75 72 63 65 73   the Tcl sources
2e00: 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53 47 29 0a  ..!error $(MSG).
2e10: 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 4e 45  !endif..!if $(NE
2e20: 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0a 21 69  ED_TK_SOURCE).!i
2e30: 66 20 24 28 54 4b 49 4e 53 54 41 4c 4c 29 0a 4d  f $(TKINSTALL).M
2e40: 53 47 20 3d 20 5e 0a 2a 2a 2a 20 57 61 72 6e 69  SG = ^.*** Warni
2e50: 6e 67 3a 20 54 68 69 73 20 65 78 74 65 6e 73 69  ng: This extensi
2e60: 6f 6e 20 72 65 71 75 69 72 65 73 20 74 68 65 20  on requires the 
2e70: 73 6f 75 72 63 65 20 64 69 73 74 72 69 62 75 74  source distribut
2e80: 69 6f 6e 20 6f 66 20 54 6b 2e 5e 0a 2a 2a 2a 20  ion of Tk.^.*** 
2e90: 50 6c 65 61 73 65 20 73 65 74 20 74 68 65 20 54  Please set the T
2ea0: 4b 44 49 52 20 6d 61 63 72 6f 20 74 6f 20 70 6f  KDIR macro to po
2eb0: 69 6e 74 20 74 6f 20 74 68 65 20 54 6b 20 73 6f  int to the Tk so
2ec0: 75 72 63 65 73 2e 0a 21 65 72 72 6f 72 20 24 28  urces..!error $(
2ed0: 4d 53 47 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64  MSG).!endif.!end
2ee0: 69 66 0a 0a 0a 23 20 49 66 20 49 4e 53 54 41 4c  if...# If INSTAL
2ef0: 4c 44 49 52 20 73 65 74 20 74 6f 20 54 63 6c 20  LDIR set to Tcl 
2f00: 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 72 6f 6f  installation roo
2f10: 74 20 64 69 72 20 74 68 65 6e 20 72 65 73 65 74  t dir then reset
2f20: 20 74 6f 20 74 68 65 0a 23 20 6c 69 62 20 64 69   to the.# lib di
2f30: 72 20 66 6f 72 20 69 6e 73 74 61 6c 6c 69 6e 67  r for installing
2f40: 20 65 78 74 65 6e 73 69 6f 6e 73 0a 21 69 66 20   extensions.!if 
2f50: 65 78 69 73 74 28 22 24 28 5f 49 4e 53 54 41 4c  exist("$(_INSTAL
2f60: 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63  LDIR)\include\tc
2f70: 6c 2e 68 22 29 0a 5f 49 4e 53 54 41 4c 4c 44 49  l.h")._INSTALLDI
2f80: 52 3d 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29  R=$(_INSTALLDIR)
2f90: 5c 6c 69 62 0a 21 65 6e 64 69 66 0a 0a 23 20 45  \lib.!endif..# E
2fa0: 4e 44 20 43 61 73 65 20 32 28 63 29 20 6f 72 20  ND Case 2(c) or 
2fb0: 28 64 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 61  (d) - Building a
2fc0: 6e 20 65 78 74 65 6e 73 69 6f 6e 0a 21 65 6e 64  n extension.!end
2fd0: 69 66 20 23 20 69 66 20 24 28 44 4f 49 4e 47 5f  if # if $(DOING_
2fe0: 54 43 4c 29 0a 0a 23 23 23 23 23 23 23 23 23 23  TCL)..##########
2ff0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3000: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3010: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3020: 23 23 23 23 23 23 0a 23 20 33 2e 20 44 65 74 65  ######.# 3. Dete
3030: 72 6d 69 6e 65 20 63 6f 6d 70 69 6c 65 72 20 76  rmine compiler v
3040: 65 72 73 69 6f 6e 20 61 6e 64 20 61 72 63 68 69  ersion and archi
3050: 74 65 63 74 75 72 65 0a 23 20 49 6e 20 74 68 69  tecture.# In thi
3060: 73 20 73 65 63 74 69 6f 6e 2c 20 77 65 20 66 69  s section, we fi
3070: 67 75 72 65 20 6f 75 74 20 74 68 65 20 63 6f 6d  gure out the com
3080: 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 61 6e  piler version an
3090: 64 20 74 68 65 0a 23 20 61 72 63 68 69 74 65 63  d the.# architec
30a0: 74 75 72 65 20 66 6f 72 20 77 68 69 63 68 20 77  ture for which w
30b0: 65 20 61 72 65 20 62 75 69 6c 64 69 6e 67 2e 20  e are building. 
30c0: 54 68 69 73 20 73 65 74 73 20 74 68 65 0a 23 20  This sets the.# 
30d0: 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73  following macros
30e0: 3a 0a 23 20 56 43 56 45 52 53 49 4f 4e 20 2d 20  :.# VCVERSION - 
30f0: 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 63 6f 6d  the internal com
3100: 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 61 73  piler version as
3110: 20 31 32 30 30 2c 20 31 34 30 30 2c 20 31 39 31   1200, 1400, 191
3120: 30 20 65 74 63 2e 0a 23 20 20 20 20 20 54 68 69  0 etc..#     Thi
3130: 73 20 69 73 20 61 6c 73 6f 20 70 72 69 6e 74 65  s is also printe
3140: 64 20 62 79 20 74 68 65 20 63 6f 6d 70 69 6c 65  d by the compile
3150: 72 20 69 6e 20 64 6f 74 74 65 64 20 66 6f 72 6d  r in dotted form
3160: 20 31 39 2e 31 30 20 65 74 63 2e 0a 23 20 56 43   19.10 etc..# VC
3170: 56 45 52 20 2d 20 74 68 65 20 22 6d 61 72 6b 65  VER - the "marke
3180: 74 69 6e 67 20 76 65 72 73 69 6f 6e 22 2c 20 66  ting version", f
3190: 6f 72 20 65 78 61 6d 70 6c 65 20 56 69 73 75 61  or example Visua
31a0: 6c 20 43 2b 2b 20 36 20 66 6f 72 20 69 6e 74 65  l C++ 6 for inte
31b0: 72 6e 61 6c 0a 23 20 20 20 20 20 63 6f 6d 70 69  rnal.#     compi
31c0: 6c 65 72 20 76 65 72 73 69 6f 6e 20 31 32 30 30  ler version 1200
31d0: 2e 20 54 68 69 73 20 69 73 20 6b 65 70 74 20 6f  . This is kept o
31e0: 6e 6c 79 20 66 6f 72 20 6c 65 67 61 63 79 20 72  nly for legacy r
31f0: 65 61 73 6f 6e 73 20 61 73 20 69 74 0a 23 20 20  easons as it.#  
3200: 20 20 20 64 6f 65 73 20 6e 6f 74 20 6d 61 6b 65     does not make
3210: 20 73 65 6e 73 65 20 66 6f 72 20 72 65 63 65 6e   sense for recen
3220: 74 20 4d 69 63 72 6f 73 6f 66 74 20 63 6f 6d 70  t Microsoft comp
3230: 69 6c 65 72 73 2e 20 4f 6e 6c 79 20 75 73 65 64  ilers. Only used
3240: 20 66 6f 72 0a 23 20 20 20 20 20 6f 75 74 70 75   for.#     outpu
3250: 74 20 64 69 72 65 63 74 6f 72 79 20 6e 61 6d 65  t directory name
3260: 73 2e 0a 23 20 41 52 43 48 20 2d 20 73 65 74 20  s..# ARCH - set 
3270: 74 6f 20 49 58 38 36 2c 20 41 52 4d 36 34 20 6f  to IX86, ARM64 o
3280: 72 20 41 4d 44 36 34 20 64 65 70 65 6e 64 69 6e  r AMD64 dependin
3290: 67 20 6f 6e 20 33 32 2d 20 6f 72 20 36 34 2d 62  g on 32- or 64-b
32a0: 69 74 20 74 61 72 67 65 74 0a 23 20 4e 41 54 49  it target.# NATI
32b0: 56 45 5f 41 52 43 48 20 2d 20 73 65 74 20 74 6f  VE_ARCH - set to
32c0: 20 49 58 38 36 2c 20 41 52 4d 36 34 20 6f 72 20   IX86, ARM64 or 
32d0: 41 4d 44 36 34 20 66 6f 72 20 74 68 65 20 68 6f  AMD64 for the ho
32e0: 73 74 20 6d 61 63 68 69 6e 65 0a 23 20 4d 41 43  st machine.# MAC
32f0: 48 49 4e 45 20 2d 20 73 61 6d 65 20 61 73 20 24  HINE - same as $
3300: 28 41 52 43 48 29 20 2d 20 6c 65 67 61 63 79 0a  (ARCH) - legacy.
3310: 23 20 5f 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45  # _VC_MANIFEST_E
3320: 4d 42 45 44 5f 7b 44 4c 4c 2c 45 58 45 7d 20 2d  MBED_{DLL,EXE} -
3330: 20 63 6f 6d 6d 61 6e 64 73 20 66 6f 72 20 65 6d   commands for em
3340: 62 65 64 64 69 6e 67 20 61 20 6d 61 6e 69 66 65  bedding a manife
3350: 73 74 20 69 66 20 6e 65 65 64 65 64 0a 0a 63 63  st if needed..cc
3360: 33 32 09 09 3d 20 24 28 43 43 29 20 20 20 23 20  32..= $(CC)   # 
3370: 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c 74  built-in default
3380: 2e 0a 6c 69 6e 6b 33 32 09 09 3d 20 6c 69 6e 6b  ..link32..= link
3390: 0a 6c 69 62 33 32 09 09 3d 20 6c 69 62 0a 72 63  .lib32..= lib.rc
33a0: 33 32 09 09 3d 20 24 28 52 43 29 20 20 20 23 20  32..= $(RC)   # 
33b0: 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c 74  built-in default
33c0: 2e 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ...#------------
33d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
33e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
33f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3400: 2d 2d 2d 2d 0a 23 20 46 69 67 75 72 65 20 6f 75  ----.# Figure ou
3410: 74 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61  t the compiler a
3420: 72 63 68 69 74 65 63 74 75 72 65 20 61 6e 64 20  rchitecture and 
3430: 76 65 72 73 69 6f 6e 20 62 79 20 77 72 69 74 69  version by writi
3440: 6e 67 0a 23 20 74 68 65 20 43 20 6d 61 63 72 6f  ng.# the C macro
3450: 73 20 74 6f 20 61 20 66 69 6c 65 2c 20 70 72 65  s to a file, pre
3460: 70 72 6f 63 65 73 73 69 6e 67 20 74 68 65 6d 20  processing them 
3470: 77 69 74 68 20 74 68 65 20 43 0a 23 20 70 72 65  with the C.# pre
3480: 70 72 6f 63 65 73 73 6f 72 20 61 6e 64 20 72 65  processor and re
3490: 61 64 69 6e 67 20 62 61 63 6b 20 74 68 65 20 63  ading back the c
34a0: 72 65 61 74 65 64 20 66 69 6c 65 0a 0a 5f 48 41  reated file.._HA
34b0: 53 48 3d 5e 23 0a 5f 56 43 5f 4d 41 4e 49 46 45  SH=^#._VC_MANIFE
34c0: 53 54 5f 45 4d 42 45 44 5f 45 58 45 3d 0a 5f 56  ST_EMBED_EXE=._V
34d0: 43 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 44  C_MANIFEST_EMBED
34e0: 5f 44 4c 4c 3d 0a 56 43 56 45 52 3d 30 0a 21 69  _DLL=.VCVER=0.!i
34f0: 66 20 21 5b 65 63 68 6f 20 56 43 56 45 52 53 49  f ![echo VCVERSI
3500: 4f 4e 3d 5f 4d 53 43 5f 56 45 52 20 3e 20 76 65  ON=_MSC_VER > ve
3510: 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20  rcl.x] \.    && 
3520: 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29 69  ![echo $(_HASH)i
3530: 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 49 58 38  f defined(_M_IX8
3540: 36 29 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 5c  6) >> vercl.x] \
3550: 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20 41  .    && ![echo A
3560: 52 43 48 3d 49 58 38 36 20 3e 3e 20 76 65 72 63  RCH=IX86 >> verc
3570: 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b  l.x] \.    && ![
3580: 65 63 68 6f 20 24 28 5f 48 41 53 48 29 65 6c 69  echo $(_HASH)eli
3590: 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 41 4d 44  f defined(_M_AMD
35a0: 36 34 29 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20  64) >> vercl.x] 
35b0: 5c 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20  \.    && ![echo 
35c0: 41 52 43 48 3d 41 4d 44 36 34 20 3e 3e 20 76 65  ARCH=AMD64 >> ve
35d0: 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20  rcl.x] \.    && 
35e0: 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29 65  ![echo $(_HASH)e
35f0: 6c 69 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 41  lif defined(_M_A
3600: 52 4d 36 34 29 20 3e 3e 20 76 65 72 63 6c 2e 78  RM64) >> vercl.x
3610: 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b 65 63 68  ] \.    && ![ech
3620: 6f 20 41 52 43 48 3d 41 52 4d 36 34 20 3e 3e 20  o ARCH=ARM64 >> 
3630: 76 65 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26  vercl.x] \.    &
3640: 26 20 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48  & ![echo $(_HASH
3650: 29 65 6e 64 69 66 20 3e 3e 20 76 65 72 63 6c 2e  )endif >> vercl.
3660: 78 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b 24 28  x] \.    && ![$(
3670: 63 63 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20 2d 54  cc32) -nologo -T
3680: 43 20 2d 50 20 76 65 72 63 6c 2e 78 20 32 3e 4e  C -P vercl.x 2>N
3690: 55 4c 5d 0a 21 69 6e 63 6c 75 64 65 20 76 65 72  UL].!include ver
36a0: 63 6c 2e 69 0a 21 69 66 20 24 28 56 43 56 45 52  cl.i.!if $(VCVER
36b0: 53 49 4f 4e 29 20 3c 20 31 39 30 30 0a 21 69 66  SION) < 1900.!if
36c0: 20 21 5b 65 63 68 6f 20 56 43 56 45 52 3d 20 5e   ![echo VCVER= ^
36d0: 5c 3e 20 76 65 72 63 6c 2e 76 63 5d 20 5c 0a 20  \> vercl.vc] \. 
36e0: 20 20 20 26 26 20 21 5b 73 65 74 20 2f 61 20 24     && ![set /a $
36f0: 28 56 43 56 45 52 53 49 4f 4e 29 20 2f 20 31 30  (VCVERSION) / 10
3700: 30 20 2d 20 36 20 3e 3e 20 76 65 72 63 6c 2e 76  0 - 6 >> vercl.v
3710: 63 5d 0a 21 69 6e 63 6c 75 64 65 20 76 65 72 63  c].!include verc
3720: 6c 2e 76 63 0a 21 65 6e 64 69 66 0a 21 65 6c 73  l.vc.!endif.!els
3730: 65 0a 23 20 54 68 65 20 73 69 6d 70 6c 65 20 63  e.# The simple c
3740: 61 6c 63 75 6c 61 74 69 6f 6e 20 61 62 6f 76 65  alculation above
3750: 20 64 6f 65 73 20 6e 6f 74 20 61 70 70 6c 79 20   does not apply 
3760: 74 6f 20 6e 65 77 20 56 69 73 75 61 6c 20 53 74  to new Visual St
3770: 75 64 69 6f 20 72 65 6c 65 61 73 65 73 0a 23 20  udio releases.# 
3780: 4b 65 65 70 20 74 68 65 20 63 6f 6d 70 69 6c 65  Keep the compile
3790: 72 20 76 65 72 73 69 6f 6e 20 69 6e 20 69 74 73  r version in its
37a0: 20 6e 61 74 69 76 65 20 66 6f 72 6d 2e 0a 56 43   native form..VC
37b0: 56 45 52 20 3d 20 24 28 56 43 56 45 52 53 49 4f  VER = $(VCVERSIO
37c0: 4e 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  N).!endif.!endif
37d0: 0a 0a 21 69 66 20 21 5b 64 65 6c 20 32 3e 4e 55  ..!if ![del 2>NU
37e0: 4c 20 2f 71 2f 66 20 76 65 72 63 6c 2e 78 20 76  L /q/f vercl.x v
37f0: 65 72 63 6c 2e 69 20 76 65 72 63 6c 2e 76 63 5d  ercl.i vercl.vc]
3800: 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d 2d  .!endif..#------
3810: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3820: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3830: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3840: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 68 65  ----------.# The
3850: 20 4d 41 43 48 49 4e 45 20 6d 61 63 72 6f 20 69   MACHINE macro i
3860: 73 20 75 73 65 64 20 62 79 20 6c 65 67 61 63 79  s used by legacy
3870: 20 6d 61 6b 65 66 69 6c 65 73 20 73 6f 20 73 65   makefiles so se
3880: 74 20 69 74 20 61 73 20 77 65 6c 6c 0a 21 69 66  t it as well.!if
3890: 64 65 66 20 4d 41 43 48 49 4e 45 0a 21 69 66 20  def MACHINE.!if 
38a0: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
38b0: 22 78 38 36 22 0a 21 75 6e 64 65 66 20 4d 41 43  "x86".!undef MAC
38c0: 48 49 4e 45 0a 4d 41 43 48 49 4e 45 20 3d 20 49  HINE.MACHINE = I
38d0: 58 38 36 0a 21 65 6c 73 65 69 66 20 22 24 28 4d  X86.!elseif "$(M
38e0: 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 61 72 6d  ACHINE)" == "arm
38f0: 36 34 22 0a 21 75 6e 64 65 66 20 4d 41 43 48 49  64".!undef MACHI
3900: 4e 45 0a 4d 41 43 48 49 4e 45 20 3d 20 41 52 4d  NE.MACHINE = ARM
3910: 36 34 0a 21 65 6c 73 65 69 66 20 22 24 28 4d 41  64.!elseif "$(MA
3920: 43 48 49 4e 45 29 22 20 3d 3d 20 22 78 36 34 22  CHINE)" == "x64"
3930: 0a 21 75 6e 64 65 66 20 4d 41 43 48 49 4e 45 0a  .!undef MACHINE.
3940: 4d 41 43 48 49 4e 45 20 3d 20 41 4d 44 36 34 0a  MACHINE = AMD64.
3950: 21 65 6e 64 69 66 0a 21 69 66 20 22 24 28 4d 41  !endif.!if "$(MA
3960: 43 48 49 4e 45 29 22 20 21 3d 20 22 24 28 41 52  CHINE)" != "$(AR
3970: 43 48 29 22 0a 21 65 72 72 6f 72 20 53 70 65 63  CH)".!error Spec
3980: 69 66 69 65 64 20 4d 41 43 48 49 4e 45 20 6d 61  ified MACHINE ma
3990: 63 72 6f 20 24 28 4d 41 43 48 49 4e 45 29 20 64  cro $(MACHINE) d
39a0: 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 64 65  oes not match de
39b0: 74 65 63 74 65 64 20 74 61 72 67 65 74 20 61 72  tected target ar
39c0: 63 68 69 74 65 63 74 75 72 65 20 24 28 41 52 43  chitecture $(ARC
39d0: 48 29 2e 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65  H)..!endif.!else
39e0: 0a 4d 41 43 48 49 4e 45 3d 24 28 41 52 43 48 29  .MACHINE=$(ARCH)
39f0: 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d 2d  .!endif..#------
3a00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3a10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3a20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3a30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 68 65 20  ---------.# The 
3a40: 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46  PLATFORM_IDENTIF
3a50: 59 20 6d 61 63 72 6f 20 6d 61 74 63 68 65 73 20  Y macro matches 
3a60: 74 68 65 20 76 61 6c 75 65 73 20 72 65 74 75 72  the values retur
3a70: 6e 65 64 20 62 79 0a 23 20 74 68 65 20 54 63 6c  ned by.# the Tcl
3a80: 20 70 6c 61 74 66 6f 72 6d 3a 3a 69 64 65 6e 74   platform::ident
3a90: 69 66 79 20 63 6f 6d 6d 61 6e 64 0a 21 69 66 20  ify command.!if 
3aa0: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
3ab0: 22 41 4d 44 36 34 22 0a 50 4c 41 54 46 4f 52 4d  "AMD64".PLATFORM
3ac0: 5f 49 44 45 4e 54 49 46 59 20 3d 20 77 69 6e 33  _IDENTIFY = win3
3ad0: 32 2d 78 38 36 5f 36 34 0a 21 65 6c 73 65 69 66  2-x86_64.!elseif
3ae0: 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d   "$(MACHINE)" ==
3af0: 20 22 41 52 4d 36 34 22 0a 50 4c 41 54 46 4f 52   "ARM64".PLATFOR
3b00: 4d 5f 49 44 45 4e 54 49 46 59 20 3d 20 77 69 6e  M_IDENTIFY = win
3b10: 33 32 2d 61 72 6d 0a 21 65 6c 73 65 0a 50 4c 41  32-arm.!else.PLA
3b20: 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 20 3d  TFORM_IDENTIFY =
3b30: 20 77 69 6e 33 32 2d 69 78 38 36 0a 21 65 6e 64   win32-ix86.!end
3b40: 69 66 0a 0a 23 20 54 68 65 20 4d 55 4c 54 49 50  if..# The MULTIP
3b50: 4c 41 54 46 4f 52 4d 20 6d 61 63 72 6f 20 63 6f  LATFORM macro co
3b60: 6e 74 72 6f 6c 73 20 77 68 65 74 68 65 72 20 62  ntrols whether b
3b70: 69 6e 61 72 79 20 65 78 74 65 6e 73 69 6f 6e 73  inary extensions
3b80: 20 61 72 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23   are installed.#
3b90: 20 69 6e 20 70 6c 61 74 66 6f 72 6d 2d 73 70 65   in platform-spe
3ba0: 63 69 66 69 63 20 64 69 72 65 63 74 6f 72 69 65  cific directorie
3bb0: 73 2e 20 49 6e 74 65 6e 64 65 64 20 74 6f 20 62  s. Intended to b
3bc0: 65 20 73 65 74 2f 75 73 65 64 20 62 79 20 65 78  e set/used by ex
3bd0: 74 65 6e 73 69 6f 6e 73 2e 0a 21 69 66 6e 64 65  tensions..!ifnde
3be0: 66 20 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d 5f  f MULTIPLATFORM_
3bf0: 49 4e 53 54 41 4c 4c 0a 4d 55 4c 54 49 50 4c 41  INSTALL.MULTIPLA
3c00: 54 46 4f 52 4d 5f 49 4e 53 54 41 4c 4c 20 3d 20  TFORM_INSTALL = 
3c10: 30 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d  0.!endif..#-----
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 2d 2d 2d 2d 2d 2d 2d  ----------------
3c50: 2d 2d 2d 2d 2d 2d 2d 0a 23 20 46 69 67 75 72 65  -------.# Figure
3c60: 20 6f 75 74 20 74 68 65 20 2a 68 6f 73 74 2a 20   out the *host* 
3c70: 61 72 63 68 69 74 65 63 74 75 72 65 20 62 79 20  architecture by 
3c80: 72 65 61 64 69 6e 67 20 74 68 65 20 72 65 67 69  reading the regi
3c90: 73 74 72 79 0a 0a 21 69 66 20 21 5b 72 65 67 20  stry..!if ![reg 
3ca0: 71 75 65 72 79 20 48 4b 4c 4d 5c 48 61 72 64 77  query HKLM\Hardw
3cb0: 61 72 65 5c 44 65 73 63 72 69 70 74 69 6f 6e 5c  are\Description\
3cc0: 53 79 73 74 65 6d 5c 43 65 6e 74 72 61 6c 50 72  System\CentralPr
3cd0: 6f 63 65 73 73 6f 72 5c 30 20 2f 76 20 49 64 65  ocessor\0 /v Ide
3ce0: 6e 74 69 66 69 65 72 20 7c 20 66 69 6e 64 73 74  ntifier | findst
3cf0: 72 20 2f 69 20 78 38 36 5d 0a 4e 41 54 49 56 45  r /i x86].NATIVE
3d00: 5f 41 52 43 48 3d 49 58 38 36 0a 21 65 6c 73 65  _ARCH=IX86.!else
3d10: 69 66 20 21 5b 72 65 67 20 71 75 65 72 79 20 48  if ![reg query H
3d20: 4b 4c 4d 5c 48 61 72 64 77 61 72 65 5c 44 65 73  KLM\Hardware\Des
3d30: 63 72 69 70 74 69 6f 6e 5c 53 79 73 74 65 6d 5c  cription\System\
3d40: 43 65 6e 74 72 61 6c 50 72 6f 63 65 73 73 6f 72  CentralProcessor
3d50: 5c 30 20 2f 76 20 49 64 65 6e 74 69 66 69 65 72  \0 /v Identifier
3d60: 20 7c 20 66 69 6e 64 73 74 72 20 2f 69 20 41 52   | findstr /i AR
3d70: 4d 20 7c 20 66 69 6e 64 73 74 72 20 2f 69 20 36  M | findstr /i 6
3d80: 34 2d 62 69 74 5d 0a 4e 41 54 49 56 45 5f 41 52  4-bit].NATIVE_AR
3d90: 43 48 3d 41 52 4d 36 34 0a 21 65 6c 73 65 0a 4e  CH=ARM64.!else.N
3da0: 41 54 49 56 45 5f 41 52 43 48 3d 41 4d 44 36 34  ATIVE_ARCH=AMD64
3db0: 0a 21 65 6e 64 69 66 0a 0a 23 20 53 69 6e 63 65  .!endif..# Since
3dc0: 20 4d 53 56 43 38 20 77 65 20 6d 75 73 74 20 64   MSVC8 we must d
3dd0: 65 61 6c 20 77 69 74 68 20 6d 61 6e 69 66 65 73  eal with manifes
3de0: 74 20 72 65 73 6f 75 72 63 65 73 2e 0a 21 69 66  t resources..!if
3df0: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 3d   $(VCVERSION) >=
3e00: 20 31 34 30 30 0a 5f 56 43 5f 4d 41 4e 49 46 45   1400._VC_MANIFE
3e10: 53 54 5f 45 4d 42 45 44 5f 45 58 45 3d 69 66 20  ST_EMBED_EXE=if 
3e20: 65 78 69 73 74 20 24 40 2e 6d 61 6e 69 66 65 73  exist $@.manifes
3e30: 74 20 6d 74 20 2d 6e 6f 6c 6f 67 6f 20 2d 6d 61  t mt -nologo -ma
3e40: 6e 69 66 65 73 74 20 24 40 2e 6d 61 6e 69 66 65  nifest $@.manife
3e50: 73 74 20 2d 6f 75 74 70 75 74 72 65 73 6f 75 72  st -outputresour
3e60: 63 65 3a 24 40 3b 31 0a 5f 56 43 5f 4d 41 4e 49  ce:$@;1._VC_MANI
3e70: 46 45 53 54 5f 45 4d 42 45 44 5f 44 4c 4c 3d 69  FEST_EMBED_DLL=i
3e80: 66 20 65 78 69 73 74 20 24 40 2e 6d 61 6e 69 66  f exist $@.manif
3e90: 65 73 74 20 6d 74 20 2d 6e 6f 6c 6f 67 6f 20 2d  est mt -nologo -
3ea0: 6d 61 6e 69 66 65 73 74 20 24 40 2e 6d 61 6e 69  manifest $@.mani
3eb0: 66 65 73 74 20 2d 6f 75 74 70 75 74 72 65 73 6f  fest -outputreso
3ec0: 75 72 63 65 3a 24 40 3b 32 0a 21 65 6e 64 69 66  urce:$@;2.!endif
3ed0: 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ..##############
3ee0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3ef0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3f00: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3f10: 23 23 0a 23 20 34 2e 20 42 75 69 6c 64 20 74 68  ##.# 4. Build th
3f20: 65 20 6e 6d 61 6b 65 68 6c 70 20 70 72 6f 67 72  e nmakehlp progr
3f30: 61 6d 0a 23 20 54 68 69 73 20 69 73 20 61 20 68  am.# This is a h
3f40: 65 6c 70 65 72 20 61 70 70 20 77 65 20 6e 65 65  elper app we nee
3f50: 64 20 74 6f 20 6f 76 65 72 63 6f 6d 65 20 6e 6d  d to overcome nm
3f60: 61 6b 65 27 73 20 6c 69 6d 69 74 69 6e 67 0a 23  ake's limiting.#
3f70: 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e 20 57 65   environment. We
3f80: 20 77 69 6c 6c 20 63 61 6c 6c 20 6f 75 74 20 74   will call out t
3f90: 6f 20 69 74 20 74 6f 20 67 65 74 20 76 61 72 69  o it to get vari
3fa0: 6f 75 73 20 62 69 74 73 20 6f 66 0a 23 20 69 6e  ous bits of.# in
3fb0: 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20  formation about 
3fc0: 73 75 70 70 6f 72 74 65 64 20 63 6f 6d 70 69 6c  supported compil
3fd0: 65 72 20 6f 70 74 69 6f 6e 73 20 65 74 63 2e 0a  er options etc..
3fe0: 23 0a 23 20 54 63 6c 20 69 74 73 65 6c 66 20 77  #.# Tcl itself w
3ff0: 69 6c 6c 20 61 6c 77 61 79 73 20 75 73 65 20 74  ill always use t
4000: 68 65 20 6e 6d 61 6b 65 68 6c 70 2e 63 20 70 72  he nmakehlp.c pr
4010: 6f 67 72 61 6d 20 77 68 69 63 68 20 69 73 0a 23  ogram which is.#
4020: 20 69 6e 20 69 74 73 20 6f 77 6e 20 73 6f 75 72   in its own sour
4030: 63 65 2e 20 49 74 20 77 69 6c 6c 20 62 65 20 6b  ce. It will be k
4040: 65 70 74 20 75 70 64 61 74 65 64 20 74 68 65 72  ept updated ther
4050: 65 2e 0a 23 0a 23 20 45 78 74 65 6e 73 69 6f 6e  e..#.# Extension
4060: 73 20 62 75 69 6c 74 20 61 67 61 69 6e 73 74 20  s built against 
4070: 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c  an installed Tcl
4080: 20 77 69 6c 6c 20 75 73 65 20 74 68 65 20 69 6e   will use the in
4090: 73 74 61 6c 6c 65 64 0a 23 20 63 6f 70 79 20 6f  stalled.# copy o
40a0: 66 20 54 63 6c 27 73 20 6e 6d 61 6b 65 68 6c 70  f Tcl's nmakehlp
40b0: 2e 63 20 69 66 20 74 68 65 72 65 20 69 73 20 6f  .c if there is o
40c0: 6e 65 20 61 6e 64 20 74 68 65 69 72 20 6f 77 6e  ne and their own
40d0: 20 76 65 72 73 69 6f 6e 0a 23 20 6f 74 68 65 72   version.# other
40e0: 77 69 73 65 2e 20 49 6e 20 74 68 65 20 6c 61 74  wise. In the lat
40f0: 74 65 72 20 63 61 73 65 2c 20 74 68 65 79 20 77  ter case, they w
4100: 6f 75 6c 64 20 61 6c 73 6f 20 62 65 20 75 73 69  ould also be usi
4110: 6e 67 20 74 68 65 69 72 20 6f 77 6e 0a 23 20 72  ng their own.# r
4120: 75 6c 65 73 2e 76 63 2e 20 4e 6f 74 65 20 74 68  ules.vc. Note th
4130: 61 74 20 6f 6c 64 65 72 20 76 65 72 73 69 6f 6e  at older version
4140: 73 20 6f 66 20 54 63 6c 20 64 6f 20 6e 6f 74 20  s of Tcl do not 
4150: 69 6e 73 74 61 6c 6c 20 6e 6d 61 6b 65 68 6c 70  install nmakehlp
4160: 2e 63 0a 23 20 6f 72 20 72 75 6c 65 73 2e 76 63  .c.# or rules.vc
4170: 2e 0a 23 0a 23 20 45 78 74 65 6e 73 69 6f 6e 73  ..#.# Extensions
4180: 20 62 75 69 6c 74 20 61 67 61 69 6e 73 74 20 54   built against T
4190: 63 6c 20 73 6f 75 72 63 65 73 20 77 69 6c 6c 20  cl sources will 
41a0: 75 73 65 20 74 68 65 20 6f 6e 65 20 66 72 6f 6d  use the one from
41b0: 20 74 68 65 20 54 63 6c 20 73 6f 75 72 63 65 2e   the Tcl source.
41c0: 0a 23 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69  .#.# When buildi
41d0: 6e 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20  ng an extension 
41e0: 75 73 69 6e 67 20 61 20 73 75 66 66 69 63 69 65  using a sufficie
41f0: 6e 74 6c 79 20 6e 65 77 20 76 65 72 73 69 6f 6e  ntly new version
4200: 20 6f 66 20 54 63 6c 2c 0a 23 20 72 75 6c 65 73   of Tcl,.# rules
4210: 2d 65 78 74 2e 76 63 20 77 69 6c 6c 20 64 65 66  -ext.vc will def
4220: 69 6e 65 20 4e 4d 41 4b 45 48 4c 50 43 20 61 70  ine NMAKEHLPC ap
4230: 70 72 6f 70 72 69 61 74 65 6c 79 20 74 6f 20 70  propriately to p
4240: 6f 69 6e 74 20 74 6f 20 74 68 65 0a 23 20 63 6f  oint to the.# co
4250: 70 79 20 6f 66 20 6e 6d 61 6b 65 68 6c 70 2e 63  py of nmakehlp.c
4260: 20 74 6f 20 62 65 20 75 73 65 64 2e 0a 0a 21 69   to be used...!i
4270: 66 6e 64 65 66 20 4e 4d 41 4b 45 48 4c 50 43 0a  fndef NMAKEHLPC.
4280: 23 20 44 65 66 61 75 6c 74 20 74 6f 20 74 68 65  # Default to the
4290: 20 6f 6e 65 20 69 6e 20 74 68 65 20 63 75 72 72   one in the curr
42a0: 65 6e 74 20 64 69 72 65 63 74 6f 72 79 20 28 74  ent directory (t
42b0: 68 65 20 65 78 74 65 6e 73 69 6f 6e 27 73 20 6f  he extension's o
42c0: 77 6e 20 6e 6d 61 6b 65 68 6c 70 2e 63 29 0a 4e  wn nmakehlp.c).N
42d0: 4d 41 4b 45 48 4c 50 43 20 3d 20 6e 6d 61 6b 65  MAKEHLPC = nmake
42e0: 68 6c 70 2e 63 0a 0a 21 69 66 20 21 24 28 44 4f  hlp.c..!if !$(DO
42f0: 49 4e 47 5f 54 43 4c 29 0a 21 69 66 20 24 28 54  ING_TCL).!if $(T
4300: 43 4c 49 4e 53 54 41 4c 4c 29 0a 21 69 66 20 65  CLINSTALL).!if e
4310: 78 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29  xist("$(_TCLDIR)
4320: 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 6e 6d 61 6b 65  \lib\nmake\nmake
4330: 68 6c 70 2e 63 22 29 0a 4e 4d 41 4b 45 48 4c 50  hlp.c").NMAKEHLP
4340: 43 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c  C = $(_TCLDIR)\l
4350: 69 62 5c 6e 6d 61 6b 65 5c 6e 6d 61 6b 65 68 6c  ib\nmake\nmakehl
4360: 70 2e 63 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65  p.c.!endif.!else
4370: 20 23 20 21 24 28 54 43 4c 49 4e 53 54 41 4c 4c   # !$(TCLINSTALL
4380: 29 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f  ).!if exist("$(_
4390: 54 43 4c 44 49 52 29 5c 77 69 6e 5c 6e 6d 61 6b  TCLDIR)\win\nmak
43a0: 65 68 6c 70 2e 63 22 29 0a 4e 4d 41 4b 45 48 4c  ehlp.c").NMAKEHL
43b0: 50 43 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  PC = $(_TCLDIR)\
43c0: 77 69 6e 5c 6e 6d 61 6b 65 68 6c 70 2e 63 0a 21  win\nmakehlp.c.!
43d0: 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20 24  endif.!endif # $
43e0: 28 54 43 4c 49 4e 53 54 41 4c 4c 29 0a 21 65 6e  (TCLINSTALL).!en
43f0: 64 69 66 20 23 20 21 24 28 44 4f 49 4e 47 5f 54  dif # !$(DOING_T
4400: 43 4c 29 0a 0a 21 65 6e 64 69 66 20 23 20 4e 4d  CL)..!endif # NM
4410: 41 4b 45 48 4c 50 43 0a 0a 23 20 57 65 20 61 6c  AKEHLPC..# We al
4420: 77 61 79 73 20 62 75 69 6c 64 20 6e 6d 61 6b 65  ways build nmake
4430: 68 6c 70 20 65 76 65 6e 20 69 66 20 69 74 20 65  hlp even if it e
4440: 78 69 73 74 73 20 73 69 6e 63 65 20 77 65 20 64  xists since we d
4450: 6f 20 6e 6f 74 20 6b 6e 6f 77 0a 23 20 77 68 61  o not know.# wha
4460: 74 20 73 6f 75 72 63 65 20 69 74 20 77 61 73 20  t source it was 
4470: 62 75 69 6c 74 20 66 72 6f 6d 2e 0a 21 69 66 20  built from..!if 
4480: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
4490: 22 49 58 38 36 22 20 7c 7c 20 22 24 28 4d 41 43  "IX86" || "$(MAC
44a0: 48 49 4e 45 29 22 20 3d 3d 20 22 24 28 4e 41 54  HINE)" == "$(NAT
44b0: 49 56 45 5f 41 52 43 48 29 22 0a 21 69 66 20 5b  IVE_ARCH)".!if [
44c0: 24 28 63 63 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20  $(cc32) -nologo 
44d0: 22 24 28 4e 4d 41 4b 45 48 4c 50 43 29 22 20 2d  "$(NMAKEHLPC)" -
44e0: 6c 69 6e 6b 20 2d 73 75 62 73 79 73 74 65 6d 3a  link -subsystem:
44f0: 63 6f 6e 73 6f 6c 65 20 3e 20 6e 75 6c 5d 0a 21  console > nul].!
4500: 65 6e 64 69 66 0a 21 65 6c 73 65 0a 21 69 66 20  endif.!else.!if 
4510: 5b 63 6f 70 79 20 24 28 4e 4d 41 4b 45 48 4c 50  [copy $(NMAKEHLP
4520: 43 3a 6e 6d 61 6b 65 68 6c 70 2e 63 3d 78 38 36  C:nmakehlp.c=x86
4530: 5f 36 34 2d 77 36 34 2d 6d 69 6e 67 77 33 32 2d  _64-w64-mingw32-
4540: 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 29 20 6e 6d  nmakehlp.exe) nm
4550: 61 6b 65 68 6c 70 2e 65 78 65 20 3e 4e 55 4c 5d  akehlp.exe >NUL]
4560: 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a  .!endif.!endif..
4570: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4580: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4590: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
45a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
45b0: 0a 23 20 35 2e 20 54 65 73 74 20 66 6f 72 20 63  .# 5. Test for c
45c0: 6f 6d 70 69 6c 65 72 20 66 65 61 74 75 72 65 73  ompiler features
45d0: 0a 23 20 56 69 73 75 61 6c 20 43 2b 2b 20 63 6f  .# Visual C++ co
45e0: 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e 73 20 68  mpiler options h
45f0: 61 76 65 20 63 68 61 6e 67 65 64 20 6f 76 65 72  ave changed over
4600: 20 74 68 65 20 79 65 61 72 73 2e 20 43 68 65 63   the years. Chec
4610: 6b 0a 23 20 77 68 69 63 68 20 6f 70 74 69 6f 6e  k.# which option
4620: 73 20 61 72 65 20 73 75 70 70 6f 72 74 65 64 20  s are supported 
4630: 62 79 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20  by the compiler 
4640: 69 6e 20 75 73 65 2e 0a 23 0a 23 20 54 68 65 20  in use..#.# The 
4650: 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73  following macros
4660: 20 61 72 65 20 73 65 74 3a 0a 23 20 4f 50 54 49   are set:.# OPTI
4670: 4d 49 5a 41 54 49 4f 4e 53 20 2d 20 74 68 65 20  MIZATIONS - the 
4680: 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73 20 74  compiler flags t
4690: 6f 20 62 65 20 75 73 65 64 20 66 6f 72 20 6f 70  o be used for op
46a0: 74 69 6d 69 7a 65 64 20 62 75 69 6c 64 73 0a 23  timized builds.#
46b0: 20 44 45 42 55 47 46 4c 41 47 53 20 2d 20 74 68   DEBUGFLAGS - th
46c0: 65 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73  e compiler flags
46d0: 20 74 6f 20 62 65 20 75 73 65 64 20 66 6f 72 20   to be used for 
46e0: 64 65 62 75 67 20 62 75 69 6c 64 73 0a 23 20 4c  debug builds.# L
46f0: 49 4e 4b 45 52 46 4c 41 47 53 20 2d 20 46 6c 61  INKERFLAGS - Fla
4700: 67 73 20 70 61 73 73 65 64 20 74 6f 20 74 68 65  gs passed to the
4710: 20 6c 69 6e 6b 65 72 0a 23 0a 23 20 4e 6f 74 65   linker.#.# Note
4720: 20 74 68 61 74 20 74 68 65 73 65 20 61 72 65 20   that these are 
4730: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 73 65 74  the compiler set
4740: 74 69 6e 67 73 20 2a 61 76 61 69 6c 61 62 6c 65  tings *available
4750: 2a 2c 20 6e 6f 74 20 74 68 6f 73 65 0a 23 20 74  *, not those.# t
4760: 68 61 74 20 77 69 6c 6c 20 62 65 20 2a 75 73 65  hat will be *use
4770: 64 2a 2e 20 54 68 65 20 6c 61 74 74 65 72 20 64  d*. The latter d
4780: 65 70 65 6e 64 73 20 6f 6e 20 74 68 65 20 4f 50  epends on the OP
4790: 54 53 20 6d 61 63 72 6f 20 73 65 74 74 69 6e 67  TS macro setting
47a0: 73 0a 23 20 77 68 69 63 68 20 77 65 20 68 61 76  s.# which we hav
47b0: 65 20 6e 6f 74 20 79 65 74 20 70 61 72 73 65 64  e not yet parsed
47c0: 2e 0a 23 0a 23 20 41 6c 73 6f 20 6e 6f 74 65 20  ..#.# Also note 
47d0: 74 68 61 74 20 73 6f 6d 65 20 6f 66 20 74 68 65  that some of the
47e0: 20 66 6c 61 67 73 20 69 6e 20 4f 50 54 49 4d 49   flags in OPTIMI
47f0: 5a 41 54 49 4f 4e 53 20 61 72 65 20 6e 6f 74 20  ZATIONS are not 
4800: 72 65 61 6c 6c 79 0a 23 20 72 65 6c 61 74 65 64  really.# related
4810: 20 74 6f 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e   to optimization
4820: 2e 20 54 68 65 79 20 61 72 65 20 70 6c 61 63 65  . They are place
4830: 64 20 74 68 65 72 65 20 6f 6e 6c 79 20 66 6f 72  d there only for
4840: 20 6c 65 67 61 63 79 20 72 65 61 73 6f 6e 73 0a   legacy reasons.
4850: 23 20 61 73 20 73 6f 6d 65 20 65 78 74 65 6e 73  # as some extens
4860: 69 6f 6e 73 20 65 78 70 65 63 74 20 74 68 65 6d  ions expect them
4870: 20 74 6f 20 62 65 20 69 6e 63 6c 75 64 65 64 20   to be included 
4880: 69 6e 20 74 68 61 74 20 6d 61 63 72 6f 2e 0a 0a  in that macro...
4890: 23 20 2d 4f 70 20 69 6d 70 72 6f 76 65 73 20 66  # -Op improves f
48a0: 6c 6f 61 74 20 63 6f 6e 73 69 73 74 65 6e 63 79  loat consistency
48b0: 2e 20 4e 6f 74 65 20 6f 6e 6c 79 20 6e 65 65 64  . Note only need
48c0: 65 64 20 66 6f 72 20 6f 6c 64 65 72 20 63 6f 6d  ed for older com
48d0: 70 69 6c 65 72 73 0a 23 20 4e 65 77 65 72 20 63  pilers.# Newer c
48e0: 6f 6d 70 69 6c 65 72 73 20 64 6f 20 6e 6f 74 20  ompilers do not 
48f0: 6e 65 65 64 20 6f 72 20 73 75 70 70 6f 72 74 20  need or support 
4900: 74 68 69 73 20 6f 70 74 69 6f 6e 2e 0a 21 69 66  this option..!if
4910: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63 20 2d 4f   [nmakehlp -c -O
4920: 70 5d 0a 46 50 4f 50 54 53 20 20 3d 20 2d 4f 70  p].FPOPTS  = -Op
4930: 0a 21 65 6e 64 69 66 0a 0a 23 20 53 74 72 69 63  .!endif..# Stric
4940: 74 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74  t floating point
4950: 20 73 65 6d 61 6e 74 69 63 73 20 2d 20 70 72 65   semantics - pre
4960: 73 65 6e 74 20 69 6e 20 6e 65 77 65 72 20 63 6f  sent in newer co
4970: 6d 70 69 6c 65 72 73 20 69 6e 20 6c 69 65 75 20  mpilers in lieu 
4980: 6f 66 20 2d 4f 70 0a 21 69 66 20 5b 6e 6d 61 6b  of -Op.!if [nmak
4990: 65 68 6c 70 20 2d 63 20 2d 66 70 3a 73 74 72 69  ehlp -c -fp:stri
49a0: 63 74 5d 0a 46 50 4f 50 54 53 20 20 3d 20 24 28  ct].FPOPTS  = $(
49b0: 46 50 4f 50 54 53 29 20 2d 66 70 3a 73 74 72 69  FPOPTS) -fp:stri
49c0: 63 74 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 22  ct.!endif..!if "
49d0: 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22  $(MACHINE)" == "
49e0: 49 58 38 36 22 0a 23 23 23 20 74 65 73 74 20 66  IX86".### test f
49f0: 6f 72 20 70 65 6e 74 69 75 6d 20 65 72 72 61 74  or pentium errat
4a00: 61 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  a.!if [nmakehlp 
4a10: 2d 63 20 2d 51 49 30 66 5d 0a 21 6d 65 73 73 61  -c -QI0f].!messa
4a20: 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 20  ge *** Compiler 
4a30: 68 61 73 20 27 50 65 6e 74 69 75 6d 20 30 78 30  has 'Pentium 0x0
4a40: 66 20 66 69 78 27 0a 46 50 4f 50 54 53 20 20 3d  f fix'.FPOPTS  =
4a50: 20 24 28 46 50 4f 50 54 53 29 20 2d 51 49 30 66   $(FPOPTS) -QI0f
4a60: 0a 21 65 6c 73 65 0a 21 6d 65 73 73 61 67 65 20  .!else.!message 
4a70: 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 20 64 6f 65  *** Compiler doe
4a80: 73 20 6e 6f 74 20 68 61 76 65 20 27 50 65 6e 74  s not have 'Pent
4a90: 69 75 6d 20 30 78 30 66 20 66 69 78 27 0a 21 65  ium 0x0f fix'.!e
4aa0: 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a 23 23 23  ndif.!endif..###
4ab0: 20 74 65 73 74 20 66 6f 72 20 6f 70 74 69 6d 69   test for optimi
4ac0: 7a 61 74 69 6f 6e 73 0a 23 20 2f 4f 32 20 6f 70  zations.# /O2 op
4ad0: 74 69 6d 69 7a 61 74 69 6f 6e 20 69 6e 63 6c 75  timization inclu
4ae0: 64 65 73 20 2f 4f 67 20 2f 4f 69 20 2f 4f 74 20  des /Og /Oi /Ot 
4af0: 2f 4f 79 20 2f 4f 62 32 20 2f 47 73 20 2f 47 46  /Oy /Ob2 /Gs /GF
4b00: 20 2f 47 79 20 61 73 20 70 65 72 0a 23 20 64 6f   /Gy as per.# do
4b10: 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 20 4e 6f 74  cumentation. Not
4b20: 65 20 77 65 20 64 6f 20 4e 4f 54 20 77 61 6e 74  e we do NOT want
4b30: 20 2f 47 73 20 61 73 20 74 68 61 74 20 69 6e 73   /Gs as that ins
4b40: 65 72 74 73 20 61 20 5f 63 68 6b 73 74 6b 0a 23  erts a _chkstk.#
4b50: 20 73 74 61 63 6b 20 70 72 6f 62 65 20 61 74 20   stack probe at 
4b60: 2a 65 76 65 72 79 2a 20 66 75 6e 63 74 69 6f 6e  *every* function
4b70: 20 65 6e 74 72 79 2c 20 6e 6f 74 20 6a 75 73 74   entry, not just
4b80: 20 74 68 6f 73 65 20 77 69 74 68 20 6d 6f 72 65   those with more
4b90: 20 74 68 61 6e 0a 23 20 61 20 70 61 67 65 20 6f   than.# a page o
4ba0: 66 20 73 74 61 63 6b 20 61 6c 6c 6f 63 61 74 69  f stack allocati
4bb0: 6f 6e 20 72 65 73 75 6c 74 69 6e 67 20 69 6e 20  on resulting in 
4bc0: 61 20 70 65 72 66 6f 72 6d 61 6e 63 65 20 68 69  a performance hi
4bd0: 74 2e 20 20 48 6f 77 65 76 65 72 2c 0a 23 20 2f  t.  However,.# /
4be0: 4f 32 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e  O2 documentation
4bf0: 20 69 73 20 6d 69 73 6c 65 61 64 69 6e 67 20 61   is misleading a
4c00: 73 20 69 74 73 20 73 74 61 63 6b 20 70 72 6f 62  s its stack prob
4c10: 65 73 20 61 72 65 20 73 69 6d 70 6c 79 20 74 68  es are simply th
4c20: 65 0a 23 20 64 65 66 61 75 6c 74 20 70 61 67 65  e.# default page
4c30: 20 73 69 7a 65 20 6c 6f 63 61 6c 73 20 61 6c 6c   size locals all
4c40: 6f 63 61 74 69 6f 6e 20 70 72 6f 62 65 73 20 61  ocation probes a
4c50: 6e 64 20 6e 6f 74 20 77 68 61 74 20 69 73 20 69  nd not what is i
4c60: 6d 70 6c 69 65 64 0a 23 20 62 79 20 61 6e 20 65  mplied.# by an e
4c70: 78 70 6c 69 63 69 74 20 2f 47 73 20 6f 70 74 69  xplicit /Gs opti
4c80: 6f 6e 2e 0a 0a 4f 50 54 49 4d 49 5a 41 54 49 4f  on...OPTIMIZATIO
4c90: 4e 53 20 3d 20 24 28 46 50 4f 50 54 53 29 0a 0a  NS = $(FPOPTS)..
4ca0: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63  !if [nmakehlp -c
4cb0: 20 2d 4f 32 5d 0a 4f 50 54 49 4d 49 5a 49 4e 47   -O2].OPTIMIZING
4cc0: 20 3d 20 31 0a 4f 50 54 49 4d 49 5a 41 54 49 4f   = 1.OPTIMIZATIO
4cd0: 4e 53 20 20 20 3d 20 24 28 4f 50 54 49 4d 49 5a  NS   = $(OPTIMIZ
4ce0: 41 54 49 4f 4e 53 29 20 2d 4f 32 0a 21 65 6c 73  ATIONS) -O2.!els
4cf0: 65 0a 23 20 4c 65 67 61 63 79 2c 20 72 65 61 6c  e.# Legacy, real
4d00: 6c 79 2e 20 41 6c 6c 20 6d 6f 64 65 72 6e 20 63  ly. All modern c
4d10: 6f 6d 70 69 6c 65 72 73 20 73 75 70 70 6f 72 74  ompilers support
4d20: 20 74 68 69 73 0a 21 6d 65 73 73 61 67 65 20 2a   this.!message *
4d30: 2a 2a 20 43 6f 6d 70 69 6c 65 72 20 64 6f 65 73  ** Compiler does
4d40: 20 6e 6f 74 20 68 61 76 65 20 27 4f 70 74 69 6d   not have 'Optim
4d50: 69 7a 61 74 69 6f 6e 73 27 0a 4f 50 54 49 4d 49  izations'.OPTIMI
4d60: 5a 49 4e 47 20 3d 20 30 0a 21 65 6e 64 69 66 0a  ZING = 0.!endif.
4d70: 0a 23 20 43 68 65 63 6b 73 20 66 6f 72 20 62 75  .# Checks for bu
4d80: 66 66 65 72 20 6f 76 65 72 66 6c 6f 77 73 20 69  ffer overflows i
4d90: 6e 20 6c 6f 63 61 6c 20 61 72 72 61 79 73 0a 21  n local arrays.!
4da0: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63 20  if [nmakehlp -c 
4db0: 2d 47 53 5d 0a 4f 50 54 49 4d 49 5a 41 54 49 4f  -GS].OPTIMIZATIO
4dc0: 4e 53 20 20 3d 20 24 28 4f 50 54 49 4d 49 5a 41  NS  = $(OPTIMIZA
4dd0: 54 49 4f 4e 53 29 20 2d 47 53 0a 21 65 6e 64 69  TIONS) -GS.!endi
4de0: 66 0a 0a 23 20 4c 69 6e 6b 20 74 69 6d 65 20 6f  f..# Link time o
4df0: 70 74 69 6d 69 7a 61 74 69 6f 6e 2e 20 4e 6f 74  ptimization. Not
4e00: 65 20 74 68 61 74 20 74 68 69 73 20 6f 70 74 69  e that this opti
4e10: 6f 6e 20 28 70 6f 74 65 6e 74 69 61 6c 6c 79 29  on (potentially)
4e20: 20 6d 61 6b 65 73 0a 23 20 67 65 6e 65 72 61 74   makes.# generat
4e30: 65 64 20 6c 69 62 72 61 72 69 65 73 20 6f 6e 6c  ed libraries onl
4e40: 79 20 75 73 61 62 6c 65 20 62 79 20 74 68 65 20  y usable by the 
4e50: 73 70 65 63 69 66 69 63 20 56 43 2b 2b 20 76 65  specific VC++ ve
4e60: 72 73 69 6f 6e 20 74 68 61 74 0a 23 20 63 72 65  rsion that.# cre
4e70: 61 74 65 64 20 69 74 2e 20 52 65 71 75 69 72 65  ated it. Require
4e80: 73 20 2f 4c 54 43 47 20 6c 69 6e 6b 65 72 20 6f  s /LTCG linker o
4e90: 70 74 69 6f 6e 0a 21 69 66 20 5b 6e 6d 61 6b 65  ption.!if [nmake
4ea0: 68 6c 70 20 2d 63 20 2d 47 4c 5d 0a 4f 50 54 49  hlp -c -GL].OPTI
4eb0: 4d 49 5a 41 54 49 4f 4e 53 20 20 3d 20 24 28 4f  MIZATIONS  = $(O
4ec0: 50 54 49 4d 49 5a 41 54 49 4f 4e 53 29 20 2d 47  PTIMIZATIONS) -G
4ed0: 4c 0a 43 43 5f 47 4c 5f 4f 50 54 5f 45 4e 41 42  L.CC_GL_OPT_ENAB
4ee0: 4c 45 44 20 3d 20 31 0a 21 65 6c 73 65 0a 23 20  LED = 1.!else.# 
4ef0: 49 6e 20 6e 65 77 65 72 20 63 6f 6d 70 69 6c 65  In newer compile
4f00: 72 73 20 2d 47 4c 20 61 6e 64 20 2d 59 58 20 61  rs -GL and -YX a
4f10: 72 65 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 2e  re incompatible.
4f20: 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  .!if [nmakehlp -
4f30: 63 20 2d 59 58 5d 0a 4f 50 54 49 4d 49 5a 41 54  c -YX].OPTIMIZAT
4f40: 49 4f 4e 53 20 20 3d 20 24 28 4f 50 54 49 4d 49  IONS  = $(OPTIMI
4f50: 5a 41 54 49 4f 4e 53 29 20 2d 59 58 0a 21 65 6e  ZATIONS) -YX.!en
4f60: 64 69 66 0a 21 65 6e 64 69 66 20 23 20 5b 6e 6d  dif.!endif # [nm
4f70: 61 6b 65 68 6c 70 20 2d 63 20 2d 47 4c 5d 0a 0a  akehlp -c -GL]..
4f80: 44 45 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d  DEBUGFLAGS     =
4f90: 20 24 28 46 50 4f 50 54 53 29 0a 0a 23 20 52 75   $(FPOPTS)..# Ru
4fa0: 6e 20 74 69 6d 65 20 65 72 72 6f 72 20 63 68 65  n time error che
4fb0: 63 6b 73 2e 20 4e 6f 74 20 61 76 61 69 6c 61 62  cks. Not availab
4fc0: 6c 65 20 6f 72 20 76 61 6c 69 64 20 69 6e 20 61  le or valid in a
4fd0: 20 72 65 6c 65 61 73 65 2c 20 6e 6f 6e 2d 64 65   release, non-de
4fe0: 62 75 67 20 62 75 69 6c 64 0a 23 20 52 54 43 20  bug build.# RTC 
4ff0: 69 73 20 66 6f 72 20 6d 6f 64 65 72 6e 20 63 6f  is for modern co
5000: 6d 70 69 6c 65 72 73 2c 20 2d 47 5a 20 69 73 20  mpilers, -GZ is 
5010: 6c 65 67 61 63 79 0a 21 69 66 20 5b 6e 6d 61 6b  legacy.!if [nmak
5020: 65 68 6c 70 20 2d 63 20 2d 52 54 43 31 5d 0a 44  ehlp -c -RTC1].D
5030: 45 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d 20  EBUGFLAGS     = 
5040: 24 28 44 45 42 55 47 46 4c 41 47 53 29 20 2d 52  $(DEBUGFLAGS) -R
5050: 54 43 31 0a 21 65 6c 73 65 69 66 20 5b 6e 6d 61  TC1.!elseif [nma
5060: 6b 65 68 6c 70 20 2d 63 20 2d 47 5a 5d 0a 44 45  kehlp -c -GZ].DE
5070: 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d 20 24  BUGFLAGS     = $
5080: 28 44 45 42 55 47 46 4c 41 47 53 29 20 2d 47 5a  (DEBUGFLAGS) -GZ
5090: 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d 2d  .!endif..#------
50a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
50b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
50c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
50d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 4c 69 6e  ----------.# Lin
50e0: 6b 65 72 20 66 6c 61 67 73 0a 0a 23 20 4c 49 4e  ker flags..# LIN
50f0: 4b 45 52 5f 54 45 53 54 46 4c 41 47 53 20 61 72  KER_TESTFLAGS ar
5100: 65 20 66 6f 72 20 69 6e 74 65 72 6e 61 6c 20 75  e for internal u
5110: 73 65 20 77 68 65 6e 20 77 65 20 63 61 6c 6c 20  se when we call 
5120: 6e 6d 61 6b 65 68 6c 70 20 74 6f 20 74 65 73 74  nmakehlp to test
5130: 0a 23 20 69 66 20 74 68 65 20 6c 69 6e 6b 65 72  .# if the linker
5140: 20 73 75 70 70 6f 72 74 73 20 61 20 73 70 65 63   supports a spec
5150: 69 66 69 63 20 6f 70 74 69 6f 6e 2e 20 57 69 74  ific option. Wit
5160: 68 6f 75 74 20 74 68 65 73 65 20 66 6c 61 67 73  hout these flags
5170: 20 6c 69 6e 6b 20 77 69 6c 6c 0a 23 20 72 65 74   link will.# ret
5180: 75 72 6e 20 22 4c 4e 4b 31 35 36 31 3a 20 65 6e  urn "LNK1561: en
5190: 74 72 79 20 70 6f 69 6e 74 20 6d 75 73 74 20 62  try point must b
51a0: 65 20 64 65 66 69 6e 65 64 22 20 65 72 72 6f 72  e defined" error
51b0: 20 63 6f 6d 70 69 6c 69 6e 67 20 66 72 6f 6d 20   compiling from 
51c0: 56 53 2d 49 44 45 3a 0a 23 20 54 68 65 79 20 61  VS-IDE:.# They a
51d0: 72 65 20 6e 6f 74 20 70 61 73 73 65 64 20 74 68  re not passed th
51e0: 72 6f 75 67 68 20 74 6f 20 74 68 65 20 61 63 74  rough to the act
51f0: 75 61 6c 20 61 70 70 6c 69 63 61 74 69 6f 6e 20  ual application 
5200: 2f 20 65 78 74 65 6e 73 69 6f 6e 0a 23 20 6c 69  / extension.# li
5210: 6e 6b 20 72 75 6c 65 73 2e 0a 21 69 66 6e 64 65  nk rules..!ifnde
5220: 66 20 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41  f LINKER_TESTFLA
5230: 47 53 0a 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c  GS.LINKER_TESTFL
5240: 41 47 53 20 3d 20 2f 44 4c 4c 20 2f 4e 4f 45 4e  AGS = /DLL /NOEN
5250: 54 52 59 20 2f 4f 55 54 3a 6e 6d 61 6b 65 68 6c  TRY /OUT:nmakehl
5260: 70 2e 6f 75 74 0a 21 65 6e 64 69 66 0a 0a 4c 49  p.out.!endif..LI
5270: 4e 4b 45 52 46 4c 41 47 53 20 20 20 20 20 3d 0a  NKERFLAGS     =.
5280: 0a 23 20 49 66 20 63 6f 6d 70 69 6c 65 72 20 68  .# If compiler h
5290: 61 73 20 65 6e 61 62 6c 65 64 20 6c 69 6e 6b 20  as enabled link 
52a0: 74 69 6d 65 20 6f 70 74 69 6d 69 7a 61 74 69 6f  time optimizatio
52b0: 6e 2c 20 6c 69 6e 6b 65 72 20 6d 75 73 74 20 74  n, linker must t
52c0: 6f 6f 20 77 69 74 68 20 2d 6c 74 63 67 0a 21 69  oo with -ltcg.!i
52d0: 66 64 65 66 20 43 43 5f 47 4c 5f 4f 50 54 5f 45  fdef CC_GL_OPT_E
52e0: 4e 41 42 4c 45 44 0a 21 69 66 20 5b 6e 6d 61 6b  NABLED.!if [nmak
52f0: 65 68 6c 70 20 2d 6c 20 2d 6c 74 63 67 20 24 28  ehlp -l -ltcg $(
5300: 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41 47 53  LINKER_TESTFLAGS
5310: 29 5d 0a 4c 49 4e 4b 45 52 46 4c 41 47 53 20 20  )].LINKERFLAGS  
5320: 20 20 20 3d 20 24 28 4c 49 4e 4b 45 52 46 4c 41     = $(LINKERFLA
5330: 47 53 29 20 2d 6c 74 63 67 0a 21 65 6e 64 69 66  GS) -ltcg.!endif
5340: 0a 21 65 6e 64 69 66 0a 0a 0a 23 23 23 23 23 23  .!endif...######
5350: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5360: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5370: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5380: 23 23 23 23 23 23 23 23 23 23 0a 23 20 36 2e 20  ##########.# 6. 
5390: 45 78 74 72 61 63 74 20 76 61 72 69 6f 75 73 20  Extract various 
53a0: 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20  version numbers 
53b0: 66 72 6f 6d 20 68 65 61 64 65 72 73 0a 23 20 46  from headers.# F
53c0: 6f 72 20 54 63 6c 20 61 6e 64 20 54 6b 2c 20 76  or Tcl and Tk, v
53d0: 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20 61  ersion numbers a
53e0: 72 65 20 65 78 74 72 61 63 74 65 64 20 66 72 6f  re extracted fro
53f0: 6d 20 74 63 6c 2e 68 20 61 6e 64 20 74 6b 2e 68  m tcl.h and tk.h
5400: 0a 23 20 72 65 73 70 65 63 74 69 76 65 6c 79 2e  .# respectively.
5410: 20 46 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 2c   For extensions,
5420: 20 76 65 72 73 69 6f 6e 73 20 61 72 65 20 65 78   versions are ex
5430: 74 72 61 63 74 65 64 20 66 72 6f 6d 20 74 68 65  tracted from the
5440: 0a 23 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20  .# configure.in 
5450: 6f 72 20 63 6f 6e 66 69 67 75 72 65 2e 61 63 20  or configure.ac 
5460: 66 72 6f 6d 20 74 68 65 20 54 45 41 20 63 6f 6e  from the TEA con
5470: 66 69 67 75 72 61 74 69 6f 6e 20 69 66 20 69 74  figuration if it
5480: 0a 23 20 65 78 69 73 74 73 2c 20 61 6e 64 20 75  .# exists, and u
5490: 6e 73 65 74 20 6f 74 68 65 72 77 69 73 65 2e 0a  nset otherwise..
54a0: 23 20 53 65 74 73 20 74 68 65 20 66 6f 6c 6c 6f  # Sets the follo
54b0: 77 69 6e 67 20 6d 61 63 72 6f 73 3a 0a 23 20 54  wing macros:.# T
54c0: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e  CL_MAJOR_VERSION
54d0: 0a 23 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52  .# TCL_MINOR_VER
54e0: 53 49 4f 4e 0a 23 20 54 43 4c 5f 52 45 4c 45 41  SION.# TCL_RELEA
54f0: 53 45 5f 53 45 52 49 41 4c 0a 23 20 54 43 4c 5f  SE_SERIAL.# TCL_
5500: 50 41 54 43 48 5f 4c 45 56 45 4c 0a 23 20 54 43  PATCH_LEVEL.# TC
5510: 4c 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 0a 23  L_PATCH_LETTER.#
5520: 20 54 43 4c 5f 56 45 52 53 49 4f 4e 0a 23 20 54   TCL_VERSION.# T
5530: 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 0a  K_MAJOR_VERSION.
5540: 23 20 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49  # TK_MINOR_VERSI
5550: 4f 4e 0a 23 20 54 4b 5f 52 45 4c 45 41 53 45 5f  ON.# TK_RELEASE_
5560: 53 45 52 49 41 4c 0a 23 20 54 4b 5f 50 41 54 43  SERIAL.# TK_PATC
5570: 48 5f 4c 45 56 45 4c 0a 23 20 54 4b 5f 50 41 54  H_LEVEL.# TK_PAT
5580: 43 48 5f 4c 45 54 54 45 52 0a 23 20 54 4b 5f 56  CH_LETTER.# TK_V
5590: 45 52 53 49 4f 4e 0a 23 20 44 4f 54 56 45 52 53  ERSION.# DOTVERS
55a0: 49 4f 4e 20 2d 20 73 65 74 20 61 73 20 28 66 6f  ION - set as (fo
55b0: 72 20 65 78 61 6d 70 6c 65 29 20 32 2e 35 0a 23  r example) 2.5.#
55c0: 20 56 45 52 53 49 4f 4e 20 2d 20 73 65 74 20 61   VERSION - set a
55d0: 73 20 28 66 6f 72 20 65 78 61 6d 70 6c 65 20 32  s (for example 2
55e0: 35 29 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  5).#------------
55f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5610: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5620: 2d 2d 0a 0a 21 69 66 20 5b 65 63 68 6f 20 52 45  --..!if [echo RE
5630: 4d 20 3d 20 54 68 69 73 20 66 69 6c 65 20 69 73  M = This file is
5640: 20 67 65 6e 65 72 61 74 65 64 20 66 72 6f 6d 20   generated from 
5650: 72 75 6c 65 73 2e 76 63 20 3e 20 76 65 72 73 69  rules.vc > versi
5660: 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21  ons.vc].!endif.!
5670: 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 4d 41 4a  if [echo TCL_MAJ
5680: 4f 52 5f 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e  OR_VERSION = \>>
5690: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a   versions.vc] \.
56a0: 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20     && [nmakehlp 
56b0: 2d 56 20 22 24 28 5f 54 43 4c 5f 48 29 22 20 22  -V "$(_TCL_H)" "
56c0: 64 65 66 69 6e 65 20 54 43 4c 5f 4d 41 4a 4f 52  define TCL_MAJOR
56d0: 5f 56 45 52 53 49 4f 4e 22 20 3e 3e 20 76 65 72  _VERSION" >> ver
56e0: 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66  sions.vc].!endif
56f0: 0a 21 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 4d  .!if [echo TCL_M
5700: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 20 3d 20 5c  INOR_VERSION = \
5710: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20  >> versions.vc] 
5720: 5c 0a 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c  \.   && [nmakehl
5730: 70 20 2d 56 20 22 24 28 5f 54 43 4c 5f 48 29 22  p -V "$(_TCL_H)"
5740: 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49   TCL_MINOR_VERSI
5750: 4f 4e 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  ON >> versions.v
5760: 63 5d 0a 21 65 6e 64 69 66 0a 21 69 66 20 5b 65  c].!endif.!if [e
5770: 63 68 6f 20 54 43 4c 5f 52 45 4c 45 41 53 45 5f  cho TCL_RELEASE_
5780: 53 45 52 49 41 4c 20 3d 20 5c 3e 3e 20 76 65 72  SERIAL = \>> ver
5790: 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 26  sions.vc] \.   &
57a0: 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56 20 22  & [nmakehlp -V "
57b0: 24 28 5f 54 43 4c 5f 48 29 22 20 54 43 4c 5f 52  $(_TCL_H)" TCL_R
57c0: 45 4c 45 41 53 45 5f 53 45 52 49 41 4c 20 3e 3e  ELEASE_SERIAL >>
57d0: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65   versions.vc].!e
57e0: 6e 64 69 66 0a 21 69 66 20 5b 65 63 68 6f 20 54  ndif.!if [echo T
57f0: 43 4c 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20 3d  CL_PATCH_LEVEL =
5800: 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63   \>> versions.vc
5810: 5d 20 5c 0a 20 20 20 26 26 20 5b 6e 6d 61 6b 65  ] \.   && [nmake
5820: 68 6c 70 20 2d 56 20 22 24 28 5f 54 43 4c 5f 48  hlp -V "$(_TCL_H
5830: 29 22 20 54 43 4c 5f 50 41 54 43 48 5f 4c 45 56  )" TCL_PATCH_LEV
5840: 45 4c 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  EL >> versions.v
5850: 63 5d 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 64  c].!endif..!if d
5860: 65 66 69 6e 65 64 28 5f 54 4b 5f 48 29 0a 21 69  efined(_TK_H).!i
5870: 66 20 5b 65 63 68 6f 20 54 4b 5f 4d 41 4a 4f 52  f [echo TK_MAJOR
5880: 5f 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76  _VERSION = \>> v
5890: 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20  ersions.vc] \.  
58a0: 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56   && [nmakehlp -V
58b0: 20 24 28 5f 54 4b 5f 48 29 20 22 64 65 66 69 6e   $(_TK_H) "defin
58c0: 65 20 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  e TK_MAJOR_VERSI
58d0: 4f 4e 22 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e  ON" >> versions.
58e0: 76 63 5d 0a 21 65 6e 64 69 66 0a 21 69 66 20 5b  vc].!endif.!if [
58f0: 65 63 68 6f 20 54 4b 5f 4d 49 4e 4f 52 5f 56 45  echo TK_MINOR_VE
5900: 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76 65 72 73  RSION = \>> vers
5910: 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 26 26  ions.vc] \.   &&
5920: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56 20 24 28   [nmakehlp -V $(
5930: 5f 54 4b 5f 48 29 20 54 4b 5f 4d 49 4e 4f 52 5f  _TK_H) TK_MINOR_
5940: 56 45 52 53 49 4f 4e 20 3e 3e 20 76 65 72 73 69  VERSION >> versi
5950: 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21  ons.vc].!endif.!
5960: 69 66 20 5b 65 63 68 6f 20 54 4b 5f 52 45 4c 45  if [echo TK_RELE
5970: 41 53 45 5f 53 45 52 49 41 4c 20 3d 20 5c 3e 3e  ASE_SERIAL = \>>
5980: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a   versions.vc] \.
5990: 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20     && [nmakehlp 
59a0: 2d 56 20 22 24 28 5f 54 4b 5f 48 29 22 20 54 4b  -V "$(_TK_H)" TK
59b0: 5f 52 45 4c 45 41 53 45 5f 53 45 52 49 41 4c 20  _RELEASE_SERIAL 
59c0: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a  >> versions.vc].
59d0: 21 65 6e 64 69 66 0a 21 69 66 20 5b 65 63 68 6f  !endif.!if [echo
59e0: 20 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20   TK_PATCH_LEVEL 
59f0: 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  = \>> versions.v
5a00: 63 5d 20 5c 0a 20 20 20 26 26 20 5b 6e 6d 61 6b  c] \.   && [nmak
5a10: 65 68 6c 70 20 2d 56 20 24 28 5f 54 4b 5f 48 29  ehlp -V $(_TK_H)
5a20: 20 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20   TK_PATCH_LEVEL 
5a30: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a  >> versions.vc].
5a40: 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20  !endif.!endif # 
5a50: 5f 54 4b 5f 48 0a 0a 21 69 6e 63 6c 75 64 65 20  _TK_H..!include 
5a60: 76 65 72 73 69 6f 6e 73 2e 76 63 0a 0a 54 43 4c  versions.vc..TCL
5a70: 5f 56 45 52 53 49 4f 4e 09 3d 20 24 28 54 43 4c  _VERSION.= $(TCL
5a80: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 24  _MAJOR_VERSION)$
5a90: 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49  (TCL_MINOR_VERSI
5aa0: 4f 4e 29 0a 54 43 4c 5f 44 4f 54 56 45 52 53 49  ON).TCL_DOTVERSI
5ab0: 4f 4e 09 3d 20 24 28 54 43 4c 5f 4d 41 4a 4f 52  ON.= $(TCL_MAJOR
5ac0: 5f 56 45 52 53 49 4f 4e 29 2e 24 28 54 43 4c 5f  _VERSION).$(TCL_
5ad0: 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 21  MINOR_VERSION).!
5ae0: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20  if [nmakehlp -f 
5af0: 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45 56 45  $(TCL_PATCH_LEVE
5b00: 4c 29 20 22 61 22 5d 0a 54 43 4c 5f 50 41 54 43  L) "a"].TCL_PATC
5b10: 48 5f 4c 45 54 54 45 52 20 3d 20 61 0a 21 65 6c  H_LETTER = a.!el
5b20: 73 65 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  seif [nmakehlp -
5b30: 66 20 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45  f $(TCL_PATCH_LE
5b40: 56 45 4c 29 20 22 62 22 5d 0a 54 43 4c 5f 50 41  VEL) "b"].TCL_PA
5b50: 54 43 48 5f 4c 45 54 54 45 52 20 3d 20 62 0a 21  TCH_LETTER = b.!
5b60: 65 6c 73 65 0a 54 43 4c 5f 50 41 54 43 48 5f 4c  else.TCL_PATCH_L
5b70: 45 54 54 45 52 20 3d 20 2e 0a 21 65 6e 64 69 66  ETTER = ..!endif
5b80: 0a 0a 21 69 66 20 64 65 66 69 6e 65 64 28 5f 54  ..!if defined(_T
5b90: 4b 5f 48 29 0a 0a 54 4b 5f 56 45 52 53 49 4f 4e  K_H)..TK_VERSION
5ba0: 09 3d 20 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45  .= $(TK_MAJOR_VE
5bb0: 52 53 49 4f 4e 29 24 28 54 4b 5f 4d 49 4e 4f 52  RSION)$(TK_MINOR
5bc0: 5f 56 45 52 53 49 4f 4e 29 0a 54 4b 5f 44 4f 54  _VERSION).TK_DOT
5bd0: 56 45 52 53 49 4f 4e 09 3d 20 24 28 54 4b 5f 4d  VERSION.= $(TK_M
5be0: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28  AJOR_VERSION).$(
5bf0: 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e  TK_MINOR_VERSION
5c00: 29 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  ).!if [nmakehlp 
5c10: 2d 66 20 24 28 54 4b 5f 50 41 54 43 48 5f 4c 45  -f $(TK_PATCH_LE
5c20: 56 45 4c 29 20 22 61 22 5d 0a 54 4b 5f 50 41 54  VEL) "a"].TK_PAT
5c30: 43 48 5f 4c 45 54 54 45 52 20 3d 20 61 0a 21 65  CH_LETTER = a.!e
5c40: 6c 73 65 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  lseif [nmakehlp 
5c50: 2d 66 20 24 28 54 4b 5f 50 41 54 43 48 5f 4c 45  -f $(TK_PATCH_LE
5c60: 56 45 4c 29 20 22 62 22 5d 0a 54 4b 5f 50 41 54  VEL) "b"].TK_PAT
5c70: 43 48 5f 4c 45 54 54 45 52 20 3d 20 62 0a 21 65  CH_LETTER = b.!e
5c80: 6c 73 65 0a 54 4b 5f 50 41 54 43 48 5f 4c 45 54  lse.TK_PATCH_LET
5c90: 54 45 52 20 3d 20 2e 0a 21 65 6e 64 69 66 0a 0a  TER = ..!endif..
5ca0: 21 65 6e 64 69 66 0a 0a 23 20 53 65 74 20 44 4f  !endif..# Set DO
5cb0: 54 56 45 52 53 49 4f 4e 20 61 6e 64 20 56 45 52  TVERSION and VER
5cc0: 53 49 4f 4e 0a 21 69 66 20 24 28 44 4f 49 4e 47  SION.!if $(DOING
5cd0: 5f 54 43 4c 29 0a 0a 44 4f 54 56 45 52 53 49 4f  _TCL)..DOTVERSIO
5ce0: 4e 20 3d 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f  N = $(TCL_MAJOR_
5cf0: 56 45 52 53 49 4f 4e 29 2e 24 28 54 43 4c 5f 4d  VERSION).$(TCL_M
5d00: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 56 45  INOR_VERSION).VE
5d10: 52 53 49 4f 4e 20 3d 20 24 28 54 43 4c 5f 56 45  RSION = $(TCL_VE
5d20: 52 53 49 4f 4e 29 0a 0a 21 65 6c 73 65 69 66 20  RSION)..!elseif 
5d30: 24 28 44 4f 49 4e 47 5f 54 4b 29 0a 0a 44 4f 54  $(DOING_TK)..DOT
5d40: 56 45 52 53 49 4f 4e 20 3d 20 24 28 54 4b 5f 44  VERSION = $(TK_D
5d50: 4f 54 56 45 52 53 49 4f 4e 29 0a 56 45 52 53 49  OTVERSION).VERSI
5d60: 4f 4e 20 3d 20 24 28 54 4b 5f 56 45 52 53 49 4f  ON = $(TK_VERSIO
5d70: 4e 29 0a 0a 21 65 6c 73 65 20 23 20 44 6f 69 6e  N)..!else # Doin
5d80: 67 20 61 20 6e 6f 6e 2d 54 6b 20 65 78 74 65 6e  g a non-Tk exten
5d90: 73 69 6f 6e 0a 0a 23 20 49 66 20 70 61 72 65 6e  sion..# If paren
5da0: 74 20 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 6e  t makefile has n
5db0: 6f 74 20 64 65 66 69 6e 65 64 20 44 4f 54 56 45  ot defined DOTVE
5dc0: 52 53 49 4f 4e 2c 20 74 72 79 20 74 6f 20 67 65  RSION, try to ge
5dd0: 74 20 69 74 20 66 72 6f 6d 20 54 45 41 0a 23 20  t it from TEA.# 
5de0: 66 69 72 73 74 20 66 72 6f 6d 20 61 20 63 6f 6e  first from a con
5df0: 66 69 67 75 72 65 2e 69 6e 20 66 69 6c 65 2c 20  figure.in file, 
5e00: 61 6e 64 20 74 68 65 6e 20 66 72 6f 6d 20 63 6f  and then from co
5e10: 6e 66 69 67 75 72 65 2e 61 63 0a 21 69 66 6e 64  nfigure.ac.!ifnd
5e20: 65 66 20 44 4f 54 56 45 52 53 49 4f 4e 0a 21 69  ef DOTVERSION.!i
5e30: 66 20 5b 65 63 68 6f 20 44 4f 54 56 45 52 53 49  f [echo DOTVERSI
5e40: 4f 4e 20 3d 20 5c 3e 20 76 65 72 73 69 6f 6e 73  ON = \> versions
5e50: 2e 76 63 5d 20 5c 0a 20 20 20 7c 7c 20 5b 6e 6d  .vc] \.   || [nm
5e60: 61 6b 65 68 6c 70 20 2d 56 20 24 28 52 4f 4f 54  akehlp -V $(ROOT
5e70: 29 5c 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20 41  )\configure.in A
5e80: 43 5f 49 4e 49 54 20 3e 3e 20 76 65 72 73 69 6f  C_INIT >> versio
5e90: 6e 73 2e 76 63 5d 0a 21 69 66 20 5b 65 63 68 6f  ns.vc].!if [echo
5ea0: 20 44 4f 54 56 45 52 53 49 4f 4e 20 3d 20 5c 3e   DOTVERSION = \>
5eb0: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a   versions.vc] \.
5ec0: 20 20 20 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70 20     || [nmakehlp 
5ed0: 2d 56 20 24 28 52 4f 4f 54 29 5c 63 6f 6e 66 69  -V $(ROOT)\confi
5ee0: 67 75 72 65 2e 61 63 20 41 43 5f 49 4e 49 54 20  gure.ac AC_INIT 
5ef0: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a  >> versions.vc].
5f00: 21 65 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64  !error *** Could
5f10: 20 6e 6f 74 20 66 69 67 75 72 65 20 6f 75 74 20   not figure out 
5f20: 65 78 74 65 6e 73 69 6f 6e 20 76 65 72 73 69 6f  extension versio
5f30: 6e 2e 20 50 6c 65 61 73 65 20 64 65 66 69 6e 65  n. Please define
5f40: 20 44 4f 54 56 45 52 53 49 4f 4e 20 69 6e 20 70   DOTVERSION in p
5f50: 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 62  arent makefile b
5f60: 65 66 6f 72 65 20 69 6e 63 6c 75 64 69 6e 67 20  efore including 
5f70: 72 75 6c 65 73 2e 76 63 2e 0a 21 65 6e 64 69 66  rules.vc..!endif
5f80: 0a 21 65 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65  .!endif.!include
5f90: 20 76 65 72 73 69 6f 6e 73 2e 76 63 0a 21 65 6e   versions.vc.!en
5fa0: 64 69 66 20 23 20 44 4f 54 56 45 52 53 49 4f 4e  dif # DOTVERSION
5fb0: 0a 56 45 52 53 49 4f 4e 20 20 20 20 20 20 20 20  .VERSION        
5fc0: 20 3d 20 24 28 44 4f 54 56 45 52 53 49 4f 4e 3a   = $(DOTVERSION:
5fd0: 2e 3d 29 0a 0a 21 65 6e 64 69 66 20 23 20 24 28  .=)..!endif # $(
5fe0: 44 4f 49 4e 47 5f 54 43 4c 29 20 2e 2e 2e 20 65  DOING_TCL) ... e
5ff0: 74 63 2e 0a 0a 23 20 57 69 6e 64 6f 77 73 20 52  tc...# Windows R
6000: 43 20 66 69 6c 65 73 20 68 61 76 65 20 33 20 76  C files have 3 v
6010: 65 72 73 69 6f 6e 20 63 6f 6d 70 6f 6e 65 6e 74  ersion component
6020: 73 2e 20 45 6e 73 75 72 65 20 74 68 69 73 20 69  s. Ensure this i
6030: 72 72 65 73 70 65 63 74 69 76 65 0a 23 20 6f 66  rrespective.# of
6040: 20 68 6f 77 20 6d 61 6e 79 20 63 6f 6d 70 6f 6e   how many compon
6050: 65 6e 74 73 20 74 68 65 20 70 61 63 6b 61 67 65  ents the package
6060: 20 68 61 73 20 73 70 65 63 69 66 69 65 64 2e 20   has specified. 
6070: 42 61 73 69 63 61 6c 6c 79 2c 20 65 6e 73 75 72  Basically, ensur
6080: 65 0a 23 20 6d 69 6e 69 6d 75 6d 20 34 20 63 6f  e.# minimum 4 co
6090: 6d 70 6f 6e 65 6e 74 73 20 62 79 20 61 70 70 65  mponents by appe
60a0: 6e 64 69 6e 67 20 34 20 30 27 73 20 61 6e 64 20  nding 4 0's and 
60b0: 74 68 65 6e 20 70 69 63 6b 20 6f 75 74 20 74 68  then pick out th
60c0: 65 20 66 69 72 73 74 20 34 2e 0a 23 20 41 6c 73  e first 4..# Als
60d0: 6f 20 74 61 6b 65 20 63 61 72 65 20 6f 66 20 74  o take care of t
60e0: 68 65 20 66 61 63 74 20 74 68 61 74 20 44 4f 54  he fact that DOT
60f0: 56 45 52 53 49 4f 4e 20 6d 61 79 20 68 61 76 65  VERSION may have
6100: 20 22 61 22 20 6f 72 20 22 62 22 20 69 6e 73 74   "a" or "b" inst
6110: 65 61 64 0a 23 20 6f 66 20 22 2e 22 20 73 65 70  ead.# of "." sep
6120: 61 72 61 74 69 6e 67 20 74 68 65 20 76 65 72 73  arating the vers
6130: 69 6f 6e 20 63 6f 6d 70 6f 6e 65 6e 74 73 2e 0a  ion components..
6140: 44 4f 54 53 45 50 41 52 41 54 45 44 3d 24 28 44  DOTSEPARATED=$(D
6150: 4f 54 56 45 52 53 49 4f 4e 3a 61 3d 2e 29 0a 44  OTVERSION:a=.).D
6160: 4f 54 53 45 50 41 52 41 54 45 44 3d 24 28 44 4f  OTSEPARATED=$(DO
6170: 54 53 45 50 41 52 41 54 45 44 3a 62 3d 2e 29 0a  TSEPARATED:b=.).
6180: 21 69 66 20 5b 65 63 68 6f 20 52 43 43 4f 4d 4d  !if [echo RCCOMM
6190: 41 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 20 76 65  AVERSION = \> ve
61a0: 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 7c  rsions.vc] \.  |
61b0: 7c 20 5b 66 6f 72 20 2f 66 20 22 74 6f 6b 65 6e  | [for /f "token
61c0: 73 3d 31 2c 32 2c 33 2c 34 2c 35 2a 20 64 65 6c  s=1,2,3,4,5* del
61d0: 69 6d 73 3d 2e 22 20 25 61 20 69 6e 20 28 22 24  ims=." %a in ("$
61e0: 28 44 4f 54 53 45 50 41 52 41 54 45 44 29 2e 30  (DOTSEPARATED).0
61f0: 2e 30 2e 30 2e 30 22 29 20 64 6f 20 65 63 68 6f  .0.0.0") do echo
6200: 20 25 61 2c 25 62 2c 25 63 2c 25 64 20 3e 3e 20   %a,%b,%c,%d >> 
6210: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 72  versions.vc].!er
6220: 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f  ror *** Could no
6230: 74 20 67 65 6e 65 72 61 74 65 20 52 43 43 4f 4d  t generate RCCOM
6240: 4d 41 56 45 52 53 49 4f 4e 20 2a 2a 2a 0a 21 65  MAVERSION ***.!e
6250: 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 76 65  ndif.!include ve
6260: 72 73 69 6f 6e 73 2e 76 63 0a 0a 23 23 23 23 23  rsions.vc..#####
6270: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
6280: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
6290: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
62a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
62b0: 23 23 23 0a 23 20 37 2e 20 50 61 72 73 65 20 74  ###.# 7. Parse t
62c0: 68 65 20 4f 50 54 53 20 6d 61 63 72 6f 20 74 6f  he OPTS macro to
62d0: 20 77 6f 72 6b 20 6f 75 74 20 74 68 65 20 72 65   work out the re
62e0: 71 75 65 73 74 65 64 20 62 75 69 6c 64 20 63 6f  quested build co
62f0: 6e 66 69 67 75 72 61 74 69 6f 6e 2e 0a 23 20 42  nfiguration..# B
6300: 61 73 65 64 20 6f 6e 20 74 68 69 73 2c 20 77 65  ased on this, we
6310: 20 77 69 6c 6c 20 63 6f 6e 73 74 72 75 63 74 20   will construct 
6320: 74 68 65 20 61 63 74 75 61 6c 20 73 77 69 74 63  the actual switc
6330: 68 65 73 20 74 6f 20 62 65 20 70 61 73 73 65 64  hes to be passed
6340: 20 74 6f 20 74 68 65 0a 23 20 63 6f 6d 70 69 6c   to the.# compil
6350: 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72 20 75 73  er and linker us
6360: 69 6e 67 20 74 68 65 20 6d 61 63 72 6f 73 20 64  ing the macros d
6370: 65 66 69 6e 65 64 20 69 6e 20 74 68 65 20 70 72  efined in the pr
6380: 65 76 69 6f 75 73 20 73 65 63 74 69 6f 6e 2e 0a  evious section..
6390: 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  # The following 
63a0: 6d 61 63 72 6f 73 20 61 72 65 20 64 65 66 69 6e  macros are defin
63b0: 65 64 20 62 79 20 74 68 69 73 20 73 65 63 74 69  ed by this secti
63c0: 6f 6e 20 62 61 73 65 64 20 6f 6e 20 4f 50 54 53  on based on OPTS
63d0: 0a 23 20 53 54 41 54 49 43 5f 42 55 49 4c 44 20  .# STATIC_BUILD 
63e0: 2d 20 30 20 2d 3e 20 54 63 6c 20 69 73 20 74 6f  - 0 -> Tcl is to
63f0: 20 62 65 20 62 75 69 6c 74 20 61 73 20 61 20 73   be built as a s
6400: 68 61 72 65 64 20 6c 69 62 72 61 72 79 0a 23 20  hared library.# 
6410: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 31                 1
6420: 20 2d 3e 20 62 75 69 6c 64 20 61 73 20 61 20 73   -> build as a s
6430: 74 61 74 69 63 20 6c 69 62 72 61 72 79 20 61 6e  tatic library an
6440: 64 20 73 68 65 6c 6c 0a 23 20 54 43 4c 5f 54 48  d shell.# TCL_TH
6450: 52 45 41 44 53 20 2d 20 6c 65 67 61 63 79 20 62  READS - legacy b
6460: 75 74 20 61 6c 77 61 79 73 20 31 20 6f 6e 20 57  ut always 1 on W
6470: 69 6e 64 6f 77 73 20 73 69 6e 63 65 20 77 69 6e  indows since win
6480: 73 6f 63 6b 20 72 65 71 75 69 72 65 73 20 69 74  sock requires it
6490: 2e 0a 23 20 44 45 42 55 47 20 2d 20 31 20 2d 3e  ..# DEBUG - 1 ->
64a0: 20 64 65 62 75 67 20 62 75 69 6c 64 2c 20 30 20   debug build, 0 
64b0: 2d 3e 20 72 65 6c 65 61 73 65 20 62 75 69 6c 64  -> release build
64c0: 73 0a 23 20 53 59 4d 42 4f 4c 53 20 2d 20 31 20  s.# SYMBOLS - 1 
64d0: 2d 3e 20 67 65 6e 65 72 61 74 65 20 50 44 42 27  -> generate PDB'
64e0: 73 2c 20 30 20 2d 3e 20 6e 6f 20 50 44 42 27 73  s, 0 -> no PDB's
64f0: 0a 23 20 50 52 4f 46 49 4c 45 20 2d 20 31 20 2d  .# PROFILE - 1 -
6500: 3e 20 67 65 6e 65 72 61 74 65 20 70 72 6f 66 69  > generate profi
6510: 6c 69 6e 67 20 69 6e 66 6f 2c 20 30 20 2d 3e 20  ling info, 0 -> 
6520: 6e 6f 20 70 72 6f 66 69 6c 69 6e 67 0a 23 20 50  no profiling.# P
6530: 47 4f 20 20 20 20 20 2d 20 31 20 2d 3e 20 70 72  GO     - 1 -> pr
6540: 6f 66 69 6c 65 20 62 61 73 65 64 20 6f 70 74 69  ofile based opti
6550: 6d 69 7a 61 74 69 6f 6e 2c 20 30 20 2d 3e 20 6e  mization, 0 -> n
6560: 6f 0a 23 20 4d 53 56 43 52 54 20 20 2d 20 31 20  o.# MSVCRT  - 1 
6570: 2d 3e 20 6c 69 6e 6b 20 74 6f 20 64 79 6e 61 6d  -> link to dynam
6580: 69 63 20 43 20 72 75 6e 74 69 6d 65 20 65 76 65  ic C runtime eve
6590: 6e 20 77 68 65 6e 20 62 75 69 6c 64 69 6e 67 20  n when building 
65a0: 73 74 61 74 69 63 20 54 63 6c 20 62 75 69 6c 64  static Tcl build
65b0: 0a 23 20 20 20 20 20 20 20 20 20 20 20 30 20 2d  .#           0 -
65c0: 3e 20 6c 69 6e 6b 20 74 6f 20 73 74 61 74 69 63  > link to static
65d0: 20 43 20 72 75 6e 74 69 6d 65 20 66 6f 72 20 73   C runtime for s
65e0: 74 61 74 69 63 20 54 63 6c 20 62 75 69 6c 64 2e  tatic Tcl build.
65f0: 0a 23 20 20 20 20 20 20 20 20 20 20 20 44 6f 65  .#           Doe
6600: 73 20 6e 6f 74 20 69 6d 70 61 63 74 20 73 68 61  s not impact sha
6610: 72 65 64 20 54 63 6c 20 62 75 69 6c 64 73 20 28  red Tcl builds (
6620: 53 54 41 54 49 43 5f 42 55 49 4c 44 20 3d 3d 20  STATIC_BUILD == 
6630: 30 29 0a 23 20 20 20 20 20 20 20 20 20 20 20 44  0).#           D
6640: 65 66 61 75 6c 74 3a 20 31 20 66 6f 72 20 54 63  efault: 1 for Tc
6650: 6c 20 38 2e 37 20 61 6e 64 20 75 70 2c 20 30 20  l 8.7 and up, 0 
6660: 6f 74 68 65 72 77 69 73 65 2e 0a 23 20 54 43 4c  otherwise..# TCL
6670: 5f 55 53 45 5f 53 54 41 54 49 43 5f 50 41 43 4b  _USE_STATIC_PACK
6680: 41 47 45 53 20 2d 20 31 20 2d 3e 20 73 74 61 74  AGES - 1 -> stat
6690: 69 63 61 6c 6c 79 20 6c 69 6e 6b 20 74 68 65 20  ically link the 
66a0: 72 65 67 69 73 74 72 79 20 61 6e 64 20 64 64 65  registry and dde
66b0: 20 65 78 74 65 6e 73 69 6f 6e 73 0a 23 20 20 20   extensions.#   
66c0: 20 20 20 20 20 20 20 20 69 6e 20 74 68 65 20 54          in the T
66d0: 63 6c 20 61 6e 64 20 57 69 73 68 20 73 68 65 6c  cl and Wish shel
66e0: 6c 2e 20 30 20 2d 3e 20 6b 65 65 70 20 74 68 65  l. 0 -> keep the
66f0: 6d 20 61 73 20 73 68 61 72 65 64 20 6c 69 62 72  m as shared libr
6700: 61 72 69 65 73 2e 20 44 6f 65 73 0a 23 20 20 20  aries. Does.#   
6710: 20 20 20 20 20 20 20 20 6e 6f 74 20 69 6d 70 61          not impa
6720: 63 74 20 73 68 61 72 65 64 20 54 63 6c 20 62 75  ct shared Tcl bu
6730: 69 6c 64 73 2e 20 49 6d 70 6c 69 65 64 20 62 79  ilds. Implied by
6740: 20 53 54 41 54 49 43 5f 42 55 49 4c 44 20 73 69   STATIC_BUILD si
6750: 6e 63 65 20 54 63 6c 20 38 2e 37 2e 0a 23 20 55  nce Tcl 8.7..# U
6760: 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 20  SE_THREAD_ALLOC 
6770: 2d 20 31 20 2d 3e 20 55 73 65 20 61 20 73 68 61  - 1 -> Use a sha
6780: 72 65 64 20 67 6c 6f 62 61 6c 20 66 72 65 65 20  red global free 
6790: 70 6f 6f 6c 20 66 6f 72 20 61 6c 6c 6f 63 61 74  pool for allocat
67a0: 69 6f 6e 2e 0a 23 20 20 20 20 20 20 20 20 20 20  ion..#          
67b0: 20 30 20 2d 3e 20 55 73 65 20 74 68 65 20 6e 6f   0 -> Use the no
67c0: 6e 2d 74 68 72 65 61 64 20 61 6c 6c 6f 63 61 74  n-thread allocat
67d0: 6f 72 2e 0a 23 20 55 4e 43 48 45 43 4b 45 44 20  or..# UNCHECKED 
67e0: 2d 20 31 20 2d 3e 20 77 68 65 6e 20 64 6f 69 6e  - 1 -> when doin
67f0: 67 20 61 20 64 65 62 75 67 20 62 75 69 6c 64 20  g a debug build 
6800: 77 69 74 68 20 73 79 6d 62 6f 6c 73 2c 20 75 73  with symbols, us
6810: 65 20 74 68 65 20 72 65 6c 65 61 73 65 0a 23 20  e the release.# 
6820: 20 20 20 20 20 20 20 20 20 20 43 20 72 75 6e 74            C runt
6830: 69 6d 65 2c 20 30 20 2d 3e 20 75 73 65 20 74 68  ime, 0 -> use th
6840: 65 20 64 65 62 75 67 20 43 20 72 75 6e 74 69 6d  e debug C runtim
6850: 65 2e 0a 23 20 55 53 45 5f 53 54 55 42 53 20 2d  e..# USE_STUBS -
6860: 20 31 20 2d 3e 20 63 6f 6d 70 69 6c 65 20 74 6f   1 -> compile to
6870: 20 75 73 65 20 73 74 75 62 73 20 69 6e 74 65 72   use stubs inter
6880: 66 61 63 65 73 2c 20 30 20 2d 3e 20 64 69 72 65  faces, 0 -> dire
6890: 63 74 20 6c 69 6e 6b 69 6e 67 0a 23 20 43 4f 4e  ct linking.# CON
68a0: 46 49 47 5f 43 48 45 43 4b 20 2d 20 31 20 2d 3e  FIG_CHECK - 1 ->
68b0: 20 63 68 65 63 6b 20 63 75 72 72 65 6e 74 20 62   check current b
68c0: 75 69 6c 64 20 63 6f 6e 66 69 67 75 72 61 74 69  uild configurati
68d0: 6f 6e 20 61 67 61 69 6e 73 74 20 54 63 6c 0a 23  on against Tcl.#
68e0: 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 66 69             confi
68f0: 67 75 72 61 74 69 6f 6e 20 28 69 67 6e 6f 72 65  guration (ignore
6900: 64 20 66 6f 72 20 54 63 6c 20 69 74 73 65 6c 66  d for Tcl itself
6910: 29 0a 23 20 5f 55 53 45 5f 36 34 42 49 54 5f 54  ).# _USE_64BIT_T
6920: 49 4d 45 5f 54 20 2d 20 66 6f 72 63 65 73 20 61  IME_T - forces a
6930: 20 62 75 69 6c 64 20 75 73 69 6e 67 20 36 34 2d   build using 64-
6940: 62 69 74 20 74 69 6d 65 5f 74 20 66 6f 72 20 33  bit time_t for 3
6950: 32 2d 62 69 74 20 62 75 69 6c 64 0a 23 20 20 20  2-bit build.#   
6960: 20 20 20 20 20 20 20 20 28 43 52 54 20 6c 69 62          (CRT lib
6970: 72 61 72 79 20 73 68 6f 75 6c 64 20 73 75 70 70  rary should supp
6980: 6f 72 74 20 74 68 69 73 2c 20 6e 6f 74 20 6e 65  ort this, not ne
6990: 65 64 65 64 20 66 6f 72 20 54 63 6c 20 39 2e 78  eded for Tcl 9.x
69a0: 29 0a 23 20 46 75 72 74 68 65 72 2c 20 4c 49 4e  ).# Further, LIN
69b0: 4b 45 52 46 4c 41 47 53 20 61 72 65 20 6d 6f 64  KERFLAGS are mod
69c0: 69 66 69 65 64 20 62 61 73 65 64 20 6f 6e 20 61  ified based on a
69d0: 62 6f 76 65 2e 0a 0a 23 20 44 65 66 61 75 6c 74  bove...# Default
69e0: 20 76 61 6c 75 65 73 20 66 6f 72 20 61 6c 6c 20   values for all 
69f0: 74 68 65 20 61 62 6f 76 65 0a 53 54 41 54 49 43  the above.STATIC
6a00: 5f 42 55 49 4c 44 09 3d 20 30 0a 54 43 4c 5f 54  _BUILD.= 0.TCL_T
6a10: 48 52 45 41 44 53 09 3d 20 31 0a 44 45 42 55 47  HREADS.= 1.DEBUG
6a20: 09 09 3d 20 30 0a 53 59 4d 42 4f 4c 53 09 09 3d  ..= 0.SYMBOLS..=
6a30: 20 30 0a 50 52 4f 46 49 4c 45 09 09 3d 20 30 0a   0.PROFILE..= 0.
6a40: 50 47 4f 09 09 3d 20 30 0a 4d 53 56 43 52 54 09  PGO..= 0.MSVCRT.
6a50: 09 3d 20 31 0a 54 43 4c 5f 55 53 45 5f 53 54 41  .= 1.TCL_USE_STA
6a60: 54 49 43 5f 50 41 43 4b 41 47 45 53 09 3d 20 30  TIC_PACKAGES.= 0
6a70: 0a 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f  .USE_THREAD_ALLO
6a80: 43 20 3d 20 31 0a 55 4e 43 48 45 43 4b 45 44 09  C = 1.UNCHECKED.
6a90: 3d 20 30 0a 43 4f 4e 46 49 47 5f 43 48 45 43 4b  = 0.CONFIG_CHECK
6aa0: 20 20 20 20 3d 20 31 0a 21 69 66 20 24 28 44 4f      = 1.!if $(DO
6ab0: 49 4e 47 5f 54 43 4c 29 0a 55 53 45 5f 53 54 55  ING_TCL).USE_STU
6ac0: 42 53 20 20 20 20 20 20 20 3d 20 30 0a 21 65 6c  BS       = 0.!el
6ad0: 73 65 0a 55 53 45 5f 53 54 55 42 53 20 20 20 20  se.USE_STUBS    
6ae0: 20 20 20 3d 20 31 0a 21 65 6e 64 69 66 0a 0a 23     = 1.!endif..#
6af0: 20 49 66 20 4f 50 54 53 20 69 73 20 6e 6f 74 20   If OPTS is not 
6b00: 65 6d 70 74 79 20 41 4e 44 20 64 6f 65 73 20 6e  empty AND does n
6b10: 6f 74 20 63 6f 6e 74 61 69 6e 20 22 6e 6f 6e 65  ot contain "none
6b20: 22 20 77 68 69 63 68 20 74 75 72 6e 73 20 6f 66  " which turns of
6b30: 66 20 61 6c 6c 20 4f 50 54 53 0a 23 20 73 65 74  f all OPTS.# set
6b40: 20 74 68 65 20 61 62 6f 76 65 20 6d 61 63 72 6f   the above macro
6b50: 73 20 62 61 73 65 64 20 6f 6e 20 4f 50 54 53 20  s based on OPTS 
6b60: 63 6f 6e 74 65 6e 74 0a 21 69 66 20 22 24 28 4f  content.!if "$(O
6b70: 50 54 53 29 22 20 21 3d 20 22 22 20 26 26 20 21  PTS)" != "" && !
6b80: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 22 24 28  [nmakehlp -f "$(
6b90: 4f 50 54 53 29 22 20 22 6e 6f 6e 65 22 5d 0a 0a  OPTS)" "none"]..
6ba0: 23 20 4f 50 54 53 20 61 72 65 20 73 70 65 63 69  # OPTS are speci
6bb0: 66 69 65 64 2c 20 70 61 72 73 65 20 74 68 65 6d  fied, parse them
6bc0: 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  ..!if [nmakehlp 
6bd0: 2d 66 20 24 28 4f 50 54 53 29 20 22 73 74 61 74  -f $(OPTS) "stat
6be0: 69 63 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a  ic"].!message **
6bf0: 2a 20 44 6f 69 6e 67 20 73 74 61 74 69 63 0a 53  * Doing static.S
6c00: 54 41 54 49 43 5f 42 55 49 4c 44 09 3d 20 31 0a  TATIC_BUILD.= 1.
6c10: 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61  !endif..!if [nma
6c20: 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29  kehlp -f $(OPTS)
6c30: 20 22 6e 6f 73 74 75 62 73 22 5d 0a 21 6d 65 73   "nostubs"].!mes
6c40: 73 61 67 65 20 2a 2a 2a 20 4e 6f 74 20 75 73 69  sage *** Not usi
6c50: 6e 67 20 73 74 75 62 73 0a 55 53 45 5f 53 54 55  ng stubs.USE_STU
6c60: 42 53 09 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21  BS.= 0.!endif..!
6c70: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20  if [nmakehlp -f 
6c80: 24 28 4f 50 54 53 29 20 22 6e 6f 6d 73 76 63 72  $(OPTS) "nomsvcr
6c90: 74 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  t"].!message ***
6ca0: 20 44 6f 69 6e 67 20 6e 6f 6d 73 76 63 72 74 0a   Doing nomsvcrt.
6cb0: 4d 53 56 43 52 54 09 09 3d 20 30 0a 21 65 6c 73  MSVCRT..= 0.!els
6cc0: 65 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  e.!if [nmakehlp 
6cd0: 2d 66 20 24 28 4f 50 54 53 29 20 22 6d 73 76 63  -f $(OPTS) "msvc
6ce0: 72 74 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a  rt"].!message **
6cf0: 2a 20 44 6f 69 6e 67 20 6d 73 76 63 72 74 0a 21  * Doing msvcrt.!
6d00: 65 6c 73 65 0a 21 69 66 20 24 28 54 43 4c 5f 4d  else.!if $(TCL_M
6d10: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d  AJOR_VERSION) ==
6d20: 20 38 20 26 26 20 24 28 54 43 4c 5f 4d 49 4e 4f   8 && $(TCL_MINO
6d30: 52 5f 56 45 52 53 49 4f 4e 29 20 3c 20 37 20 26  R_VERSION) < 7 &
6d40: 26 20 24 28 53 54 41 54 49 43 5f 42 55 49 4c 44  & $(STATIC_BUILD
6d50: 29 0a 4d 53 56 43 52 54 09 09 3d 20 30 0a 21 65  ).MSVCRT..= 0.!e
6d60: 6e 64 69 66 0a 21 65 6e 64 69 66 0a 21 65 6e 64  ndif.!endif.!end
6d70: 69 66 20 23 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  if # [nmakehlp -
6d80: 66 20 24 28 4f 50 54 53 29 20 22 6e 6f 6d 73 76  f $(OPTS) "nomsv
6d90: 63 72 74 22 5d 0a 0a 21 69 66 20 5b 6e 6d 61 6b  crt"]..!if [nmak
6da0: 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20  ehlp -f $(OPTS) 
6db0: 22 73 74 61 74 69 63 70 6b 67 22 5d 20 26 26 20  "staticpkg"] && 
6dc0: 24 28 53 54 41 54 49 43 5f 42 55 49 4c 44 29 0a  $(STATIC_BUILD).
6dd0: 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69  !message *** Doi
6de0: 6e 67 20 73 74 61 74 69 63 70 6b 67 0a 54 43 4c  ng staticpkg.TCL
6df0: 5f 55 53 45 5f 53 54 41 54 49 43 5f 50 41 43 4b  _USE_STATIC_PACK
6e00: 41 47 45 53 09 3d 20 31 0a 21 65 6e 64 69 66 0a  AGES.= 1.!endif.
6e10: 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  .!if [nmakehlp -
6e20: 66 20 24 28 4f 50 54 53 29 20 22 6e 6f 74 68 72  f $(OPTS) "nothr
6e30: 65 61 64 73 22 5d 0a 21 6d 65 73 73 61 67 65 20  eads"].!message 
6e40: 2a 2a 2a 20 43 6f 6d 70 69 6c 65 20 65 78 70 6c  *** Compile expl
6e50: 69 63 69 74 6c 79 20 66 6f 72 20 6e 6f 6e 2d 74  icitly for non-t
6e60: 68 72 65 61 64 65 64 20 74 63 6c 0a 54 43 4c 5f  hreaded tcl.TCL_
6e70: 54 48 52 45 41 44 53 20 3d 20 30 0a 55 53 45 5f  THREADS = 0.USE_
6e80: 54 48 52 45 41 44 5f 41 4c 4c 4f 43 3d 20 30 0a  THREAD_ALLOC= 0.
6e90: 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61  !endif..!if [nma
6ea0: 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29  kehlp -f $(OPTS)
6eb0: 20 22 74 63 6c 38 22 5d 0a 21 6d 65 73 73 61 67   "tcl8"].!messag
6ec0: 65 20 2a 2a 2a 20 42 75 69 6c 64 20 66 6f 72 20  e *** Build for 
6ed0: 54 63 6c 38 0a 54 43 4c 5f 42 55 49 4c 44 5f 46  Tcl8.TCL_BUILD_F
6ee0: 4f 52 20 3d 20 38 0a 21 65 6e 64 69 66 0a 0a 21  OR = 8.!endif..!
6ef0: 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56  if $(TCL_MAJOR_V
6f00: 45 52 53 49 4f 4e 29 20 3d 3d 20 38 0a 21 69 66  ERSION) == 8.!if
6f10: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28   [nmakehlp -f $(
6f20: 4f 50 54 53 29 20 22 74 69 6d 65 36 34 62 69 74  OPTS) "time64bit
6f30: 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20  "].!message *** 
6f40: 46 6f 72 63 65 20 36 34 2d 62 69 74 20 74 69 6d  Force 64-bit tim
6f50: 65 5f 74 0a 5f 55 53 45 5f 36 34 42 49 54 5f 54  e_t._USE_64BIT_T
6f60: 49 4d 45 5f 54 20 3d 20 31 0a 21 65 6e 64 69 66  IME_T = 1.!endif
6f70: 0a 21 65 6e 64 69 66 0a 0a 23 20 59 65 73 2c 20  .!endif..# Yes, 
6f80: 69 74 27 73 20 77 65 69 72 64 20 74 68 61 74 20  it's weird that 
6f90: 74 68 65 20 22 73 79 6d 62 6f 6c 73 22 20 6f 70  the "symbols" op
6fa0: 74 69 6f 6e 20 63 6f 6e 74 72 6f 6c 73 20 44 45  tion controls DE
6fb0: 42 55 47 20 61 6e 64 0a 23 20 74 68 65 20 22 70  BUG and.# the "p
6fc0: 64 62 73 22 20 6f 70 74 69 6f 6e 20 63 6f 6e 74  dbs" option cont
6fd0: 72 6f 6c 73 20 53 59 4d 42 4f 4c 53 2e 20 54 68  rols SYMBOLS. Th
6fe0: 61 74 27 73 20 68 69 73 74 6f 72 69 63 61 6c 2e  at's historical.
6ff0: 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  .!if [nmakehlp -
7000: 66 20 24 28 4f 50 54 53 29 20 22 73 79 6d 62 6f  f $(OPTS) "symbo
7010: 6c 73 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a  ls"].!message **
7020: 2a 20 44 6f 69 6e 67 20 73 79 6d 62 6f 6c 73 0a  * Doing symbols.
7030: 44 45 42 55 47 09 09 3d 20 31 0a 21 65 6c 73 65  DEBUG..= 1.!else
7040: 0a 44 45 42 55 47 09 09 3d 20 30 0a 21 65 6e 64  .DEBUG..= 0.!end
7050: 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c  if..!if [nmakehl
7060: 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 70 64  p -f $(OPTS) "pd
7070: 62 73 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a  bs"].!message **
7080: 2a 20 44 6f 69 6e 67 20 70 64 62 73 0a 53 59 4d  * Doing pdbs.SYM
7090: 42 4f 4c 53 09 09 3d 20 31 0a 21 65 6c 73 65 0a  BOLS..= 1.!else.
70a0: 53 59 4d 42 4f 4c 53 09 09 3d 20 30 0a 21 65 6e  SYMBOLS..= 0.!en
70b0: 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68  dif..!if [nmakeh
70c0: 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 70  lp -f $(OPTS) "p
70d0: 72 6f 66 69 6c 65 22 5d 0a 21 6d 65 73 73 61 67  rofile"].!messag
70e0: 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 70 72 6f 66  e *** Doing prof
70f0: 69 6c 65 0a 50 52 4f 46 49 4c 45 09 09 3d 20 31  ile.PROFILE..= 1
7100: 0a 21 65 6c 73 65 0a 50 52 4f 46 49 4c 45 09 09  .!else.PROFILE..
7110: 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20  = 0.!endif..!if 
7120: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f  [nmakehlp -f $(O
7130: 50 54 53 29 20 22 70 67 69 22 5d 0a 21 6d 65 73  PTS) "pgi"].!mes
7140: 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 70  sage *** Doing p
7150: 72 6f 66 69 6c 65 20 67 75 69 64 65 64 20 6f 70  rofile guided op
7160: 74 69 6d 69 7a 61 74 69 6f 6e 20 69 6e 73 74 72  timization instr
7170: 75 6d 65 6e 74 61 74 69 6f 6e 0a 50 47 4f 09 09  umentation.PGO..
7180: 3d 20 31 0a 21 65 6c 73 65 69 66 20 5b 6e 6d 61  = 1.!elseif [nma
7190: 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29  kehlp -f $(OPTS)
71a0: 20 22 70 67 6f 22 5d 0a 21 6d 65 73 73 61 67 65   "pgo"].!message
71b0: 20 2a 2a 2a 20 44 6f 69 6e 67 20 70 72 6f 66 69   *** Doing profi
71c0: 6c 65 20 67 75 69 64 65 64 20 6f 70 74 69 6d 69  le guided optimi
71d0: 7a 61 74 69 6f 6e 0a 50 47 4f 09 09 3d 20 32 0a  zation.PGO..= 2.
71e0: 21 65 6c 73 65 0a 50 47 4f 09 09 3d 20 30 0a 21  !else.PGO..= 0.!
71f0: 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b  endif..!if [nmak
7200: 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20  ehlp -f $(OPTS) 
7210: 22 6c 6f 69 6d 70 61 63 74 22 5d 0a 21 6d 65 73  "loimpact"].!mes
7220: 73 61 67 65 20 2a 2a 2a 20 57 61 72 6e 69 6e 67  sage *** Warning
7230: 3a 20 69 67 6e 6f 72 69 6e 67 20 6f 70 74 69 6f  : ignoring optio
7240: 6e 20 22 6c 6f 69 6d 70 61 63 74 22 20 2d 20 64  n "loimpact" - d
7250: 65 70 72 65 63 61 74 65 64 20 6f 6e 20 6d 6f 64  eprecated on mod
7260: 65 72 6e 20 57 69 6e 64 6f 77 73 2e 0a 21 65 6e  ern Windows..!en
7270: 64 69 66 0a 0a 23 20 54 42 44 20 2d 20 73 68 6f  dif..# TBD - sho
7280: 75 6c 64 20 67 65 74 20 72 69 64 20 6f 66 20 74  uld get rid of t
7290: 68 69 73 20 6f 70 74 69 6f 6e 0a 21 69 66 20 5b  his option.!if [
72a0: 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50  nmakehlp -f $(OP
72b0: 54 53 29 20 22 74 68 72 64 61 6c 6c 6f 63 22 5d  TS) "thrdalloc"]
72c0: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f  .!message *** Do
72d0: 69 6e 67 20 74 68 72 64 61 6c 6c 6f 63 0a 55 53  ing thrdalloc.US
72e0: 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 20 3d  E_THREAD_ALLOC =
72f0: 20 31 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b   1.!endif..!if [
7300: 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50  nmakehlp -f $(OP
7310: 54 53 29 20 22 74 63 6c 61 6c 6c 6f 63 22 5d 0a  TS) "tclalloc"].
7320: 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43  USE_THREAD_ALLOC
7330: 20 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66   = 0.!endif..!if
7340: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28   [nmakehlp -f $(
7350: 4f 50 54 53 29 20 22 75 6e 63 68 65 63 6b 65 64  OPTS) "unchecked
7360: 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20  "].!message *** 
7370: 44 6f 69 6e 67 20 75 6e 63 68 65 63 6b 65 64 0a  Doing unchecked.
7380: 55 4e 43 48 45 43 4b 45 44 20 3d 20 31 0a 21 65  UNCHECKED = 1.!e
7390: 6c 73 65 0a 55 4e 43 48 45 43 4b 45 44 20 3d 20  lse.UNCHECKED = 
73a0: 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e  0.!endif..!if [n
73b0: 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54  makehlp -f $(OPT
73c0: 53 29 20 22 6e 6f 63 6f 6e 66 69 67 63 68 65 63  S) "noconfigchec
73d0: 6b 22 5d 0a 43 4f 4e 46 49 47 5f 43 48 45 43 4b  k"].CONFIG_CHECK
73e0: 20 3d 20 31 0a 21 65 6c 73 65 0a 43 4f 4e 46 49   = 1.!else.CONFI
73f0: 47 5f 43 48 45 43 4b 20 3d 20 30 0a 21 65 6e 64  G_CHECK = 0.!end
7400: 69 66 0a 0a 21 65 6e 64 69 66 20 23 20 22 24 28  if..!endif # "$(
7410: 4f 50 54 53 29 22 20 21 3d 20 22 22 20 20 26 26  OPTS)" != ""  &&
7420: 20 2e 2e 2e 20 70 61 72 73 69 6e 67 20 6f 66 20   ... parsing of 
7430: 4f 50 54 53 0a 0a 23 20 53 65 74 20 6c 69 6e 6b  OPTS..# Set link
7440: 65 72 20 66 6c 61 67 73 20 62 61 73 65 64 20 6f  er flags based o
7450: 6e 20 61 62 6f 76 65 0a 0a 21 69 66 20 24 28 50  n above..!if $(P
7460: 47 4f 29 20 3e 20 31 0a 21 69 66 20 5b 6e 6d 61  GO) > 1.!if [nma
7470: 6b 65 68 6c 70 20 2d 6c 20 2d 6c 74 63 67 3a 70  kehlp -l -ltcg:p
7480: 67 6f 70 74 69 6d 69 7a 65 20 24 28 4c 49 4e 4b  goptimize $(LINK
7490: 45 52 5f 54 45 53 54 46 4c 41 47 53 29 5d 0a 4c  ER_TESTFLAGS)].L
74a0: 49 4e 4b 45 52 46 4c 41 47 53 09 3d 20 24 28 4c  INKERFLAGS.= $(L
74b0: 49 4e 4b 45 52 46 4c 41 47 53 3a 2d 6c 74 63 67  INKERFLAGS:-ltcg
74c0: 3d 29 20 2d 6c 74 63 67 3a 70 67 6f 70 74 69 6d  =) -ltcg:pgoptim
74d0: 69 7a 65 0a 21 65 6c 73 65 0a 4d 53 47 3d 5e 0a  ize.!else.MSG=^.
74e0: 54 68 69 73 20 63 6f 6d 70 69 6c 65 72 20 64 6f  This compiler do
74f0: 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 70  es not support p
7500: 72 6f 66 69 6c 65 20 67 75 69 64 65 64 20 6f 70  rofile guided op
7510: 74 69 6d 69 7a 61 74 69 6f 6e 2e 0a 21 65 72 72  timization..!err
7520: 6f 72 20 24 28 4d 53 47 29 0a 21 65 6e 64 69 66  or $(MSG).!endif
7530: 0a 21 65 6c 73 65 69 66 20 24 28 50 47 4f 29 20  .!elseif $(PGO) 
7540: 3e 20 30 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c  > 0.!if [nmakehl
7550: 70 20 2d 6c 20 2d 6c 74 63 67 3a 70 67 69 6e 73  p -l -ltcg:pgins
7560: 74 72 75 6d 65 6e 74 20 24 28 4c 49 4e 4b 45 52  trument $(LINKER
7570: 5f 54 45 53 54 46 4c 41 47 53 29 5d 0a 4c 49 4e  _TESTFLAGS)].LIN
7580: 4b 45 52 46 4c 41 47 53 09 3d 20 24 28 4c 49 4e  KERFLAGS.= $(LIN
7590: 4b 45 52 46 4c 41 47 53 3a 2d 6c 74 63 67 3d 29  KERFLAGS:-ltcg=)
75a0: 20 2d 6c 74 63 67 3a 70 67 69 6e 73 74 72 75 6d   -ltcg:pginstrum
75b0: 65 6e 74 0a 21 65 6c 73 65 0a 4d 53 47 3d 5e 0a  ent.!else.MSG=^.
75c0: 54 68 69 73 20 63 6f 6d 70 69 6c 65 72 20 64 6f  This compiler do
75d0: 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 70  es not support p
75e0: 72 6f 66 69 6c 65 20 67 75 69 64 65 64 20 6f 70  rofile guided op
75f0: 74 69 6d 69 7a 61 74 69 6f 6e 2e 0a 21 65 72 72  timization..!err
7600: 6f 72 20 24 28 4d 53 47 29 0a 21 65 6e 64 69 66  or $(MSG).!endif
7610: 0a 21 65 6e 64 69 66 0a 0a 23 23 23 23 23 23 23  .!endif..#######
7620: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7630: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7640: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7650: 23 23 23 23 23 23 23 23 23 0a 23 20 38 2e 20 50  #########.# 8. P
7660: 61 72 73 65 20 74 68 65 20 53 54 41 54 53 20 6d  arse the STATS m
7670: 61 63 72 6f 20 74 6f 20 63 6f 6e 66 69 67 75 72  acro to configur
7680: 65 20 63 6f 64 65 20 69 6e 73 74 72 75 6d 65 6e  e code instrumen
7690: 74 61 74 69 6f 6e 0a 23 20 54 68 65 20 66 6f 6c  tation.# The fol
76a0: 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 20 61 72  lowing macros ar
76b0: 65 20 73 65 74 20 62 79 20 74 68 69 73 20 73 65  e set by this se
76c0: 63 74 69 6f 6e 3a 0a 23 20 54 43 4c 5f 4d 45 4d  ction:.# TCL_MEM
76d0: 5f 44 45 42 55 47 20 2d 20 31 20 2d 3e 20 65 6e  _DEBUG - 1 -> en
76e0: 61 62 6c 65 73 20 6d 65 6d 6f 72 79 20 61 6c 6c  ables memory all
76f0: 6f 63 61 74 69 6f 6e 20 69 6e 73 74 72 75 6d 65  ocation instrume
7700: 6e 74 61 74 69 6f 6e 0a 23 20 20 20 20 20 20 20  ntation.#       
7710: 20 20 20 20 20 20 20 20 20 20 30 20 2d 3e 20 64            0 -> d
7720: 69 73 61 62 6c 65 73 0a 23 20 54 43 4c 5f 43 4f  isables.# TCL_CO
7730: 4d 50 49 4c 45 5f 44 45 42 55 47 20 2d 20 31 20  MPILE_DEBUG - 1 
7740: 2d 3e 20 65 6e 61 62 6c 65 73 20 62 79 74 65 20  -> enables byte 
7750: 63 6f 6d 70 69 6c 65 72 20 6c 6f 67 67 69 6e 67  compiler logging
7760: 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .#              
7770: 20 20 20 20 20 20 20 30 20 2d 3e 20 64 69 73 61         0 -> disa
7780: 62 6c 65 73 0a 0a 23 20 44 65 66 61 75 6c 74 20  bles..# Default 
7790: 62 6f 74 68 20 61 72 65 20 6f 66 66 0a 54 43 4c  both are off.TCL
77a0: 5f 4d 45 4d 5f 44 45 42 55 47 09 20 20 20 20 3d  _MEM_DEBUG.    =
77b0: 20 30 0a 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 44   0.TCL_COMPILE_D
77c0: 45 42 55 47 20 20 20 3d 20 30 0a 0a 21 69 66 20  EBUG   = 0..!if 
77d0: 22 24 28 53 54 41 54 53 29 22 20 21 3d 20 22 22  "$(STATS)" != ""
77e0: 20 26 26 20 21 5b 6e 6d 61 6b 65 68 6c 70 20 2d   && ![nmakehlp -
77f0: 66 20 22 24 28 53 54 41 54 53 29 22 20 22 6e 6f  f "$(STATS)" "no
7800: 6e 65 22 5d 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65  ne"]..!if [nmake
7810: 68 6c 70 20 2d 66 20 24 28 53 54 41 54 53 29 20  hlp -f $(STATS) 
7820: 22 6d 65 6d 64 62 67 22 5d 0a 21 6d 65 73 73 61  "memdbg"].!messa
7830: 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 6d 65 6d  ge *** Doing mem
7840: 64 62 67 0a 54 43 4c 5f 4d 45 4d 5f 44 45 42 55  dbg.TCL_MEM_DEBU
7850: 47 09 20 20 20 20 3d 20 31 0a 21 65 6c 73 65 0a  G.    = 1.!else.
7860: 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 09 20 20  TCL_MEM_DEBUG.  
7870: 20 20 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69    = 0.!endif..!i
7880: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24  f [nmakehlp -f $
7890: 28 53 54 41 54 53 29 20 22 63 6f 6d 70 64 62 67  (STATS) "compdbg
78a0: 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20  "].!message *** 
78b0: 44 6f 69 6e 67 20 63 6f 6d 70 64 62 67 0a 54 43  Doing compdbg.TC
78c0: 4c 5f 43 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20  L_COMPILE_DEBUG 
78d0: 20 20 3d 20 31 0a 21 65 6c 73 65 0a 54 43 4c 5f    = 1.!else.TCL_
78e0: 43 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 20 20  COMPILE_DEBUG   
78f0: 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 65 6e 64  = 0.!endif..!end
7900: 69 66 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23  if..############
7910: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7920: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7930: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7940: 23 23 23 23 23 23 23 23 0a 23 20 39 2e 20 50 61  ########.# 9. Pa
7950: 72 73 65 20 74 68 65 20 43 48 45 43 4b 53 20 6d  rse the CHECKS m
7960: 61 63 72 6f 20 74 6f 20 63 6f 6e 66 69 67 75 72  acro to configur
7970: 65 20 61 64 64 69 74 69 6f 6e 61 6c 20 63 6f 6d  e additional com
7980: 70 69 6c 65 72 20 63 68 65 63 6b 73 0a 23 20 54  piler checks.# T
7990: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63  he following mac
79a0: 72 6f 73 20 61 72 65 20 73 65 74 20 62 79 20 74  ros are set by t
79b0: 68 69 73 20 73 65 63 74 69 6f 6e 3a 0a 23 20 57  his section:.# W
79c0: 41 52 4e 49 4e 47 53 20 2d 20 63 6f 6d 70 69 6c  ARNINGS - compil
79d0: 65 72 20 73 77 69 74 63 68 65 73 20 74 68 61 74  er switches that
79e0: 20 63 6f 6e 74 72 6f 6c 20 74 68 65 20 77 61 72   control the war
79f0: 6e 69 6e 67 73 20 6c 65 76 65 6c 0a 23 20 54 43  nings level.# TC
7a00: 4c 5f 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 20  L_NO_DEPRECATED 
7a10: 2d 20 31 20 2d 3e 20 64 69 73 61 62 6c 65 20 73  - 1 -> disable s
7a20: 75 70 70 6f 72 74 20 66 6f 72 20 64 65 70 72 65  upport for depre
7a30: 63 61 74 65 64 20 66 75 6e 63 74 69 6f 6e 73 0a  cated functions.
7a40: 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  #               
7a50: 20 20 20 20 20 20 30 20 2d 3e 20 65 6e 61 62 6c        0 -> enabl
7a60: 65 20 64 65 70 72 65 63 61 74 65 64 20 66 75 6e  e deprecated fun
7a70: 63 74 69 6f 6e 73 0a 0a 23 20 44 65 66 61 75 6c  ctions..# Defaul
7a80: 74 73 20 2d 20 50 65 72 6d 69 74 20 64 65 70 72  ts - Permit depr
7a90: 65 63 61 74 65 64 20 66 75 6e 63 74 69 6f 6e 73  ecated functions
7aa0: 20 61 6e 64 20 77 61 72 6e 69 6e 67 20 6c 65 76   and warning lev
7ab0: 65 6c 20 33 0a 54 43 4c 5f 4e 4f 5f 44 45 50 52  el 3.TCL_NO_DEPR
7ac0: 45 43 41 54 45 44 09 20 20 20 20 3d 20 30 0a 57  ECATED.    = 0.W
7ad0: 41 52 4e 49 4e 47 53 09 09 20 20 20 20 3d 20 2d  ARNINGS..    = -
7ae0: 57 33 0a 0a 21 69 66 20 22 24 28 43 48 45 43 4b  W3..!if "$(CHECK
7af0: 53 29 22 20 21 3d 20 22 22 20 26 26 20 21 5b 6e  S)" != "" && ![n
7b00: 6d 61 6b 65 68 6c 70 20 2d 66 20 22 24 28 43 48  makehlp -f "$(CH
7b10: 45 43 4b 53 29 22 20 22 6e 6f 6e 65 22 5d 0a 0a  ECKS)" "none"]..
7b20: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66  !if [nmakehlp -f
7b30: 20 24 28 43 48 45 43 4b 53 29 20 22 6e 6f 64 65   $(CHECKS) "node
7b40: 70 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  p"].!message ***
7b50: 20 44 6f 69 6e 67 20 6e 6f 64 65 70 20 63 68 65   Doing nodep che
7b60: 63 6b 0a 54 43 4c 5f 4e 4f 5f 44 45 50 52 45 43  ck.TCL_NO_DEPREC
7b70: 41 54 45 44 09 20 20 20 20 3d 20 31 0a 21 65 6e  ATED.    = 1.!en
7b80: 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68  dif..!if [nmakeh
7b90: 6c 70 20 2d 66 20 24 28 43 48 45 43 4b 53 29 20  lp -f $(CHECKS) 
7ba0: 22 66 75 6c 6c 77 61 72 6e 22 5d 0a 21 6d 65 73  "fullwarn"].!mes
7bb0: 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 66  sage *** Doing f
7bc0: 75 6c 6c 20 77 61 72 6e 69 6e 67 73 20 63 68 65  ull warnings che
7bd0: 63 6b 0a 57 41 52 4e 49 4e 47 53 09 09 20 20 20  ck.WARNINGS..   
7be0: 20 3d 20 2d 57 34 0a 21 69 66 20 5b 6e 6d 61 6b   = -W4.!if [nmak
7bf0: 65 68 6c 70 20 2d 6c 20 2d 77 61 72 6e 3a 33 20  ehlp -l -warn:3 
7c00: 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41  $(LINKER_TESTFLA
7c10: 47 53 29 5d 0a 4c 49 4e 4b 45 52 46 4c 41 47 53  GS)].LINKERFLAGS
7c20: 09 09 20 20 20 20 3d 20 24 28 4c 49 4e 4b 45 52  ..    = $(LINKER
7c30: 46 4c 41 47 53 29 20 2d 77 61 72 6e 3a 33 0a 21  FLAGS) -warn:3.!
7c40: 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a 21 69  endif.!endif..!i
7c50: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24  f [nmakehlp -f $
7c60: 28 43 48 45 43 4b 53 29 20 22 36 34 62 69 74 22  (CHECKS) "64bit"
7c70: 5d 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  ] && [nmakehlp -
7c80: 63 20 2d 57 70 36 34 5d 0a 21 6d 65 73 73 61 67  c -Wp64].!messag
7c90: 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 36 34 62 69  e *** Doing 64bi
7ca0: 74 20 70 6f 72 74 61 62 69 6c 69 74 79 20 77 61  t portability wa
7cb0: 72 6e 69 6e 67 73 0a 57 41 52 4e 49 4e 47 53 09  rnings.WARNINGS.
7cc0: 09 20 20 20 20 3d 20 24 28 57 41 52 4e 49 4e 47  .    = $(WARNING
7cd0: 53 29 20 2d 57 70 36 34 0a 21 65 6e 64 69 66 0a  S) -Wp64.!endif.
7ce0: 0a 21 65 6e 64 69 66 0a 0a 0a 23 23 23 23 23 23  .!endif...######
7cf0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7d00: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7d10: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7d20: 23 23 23 23 23 23 23 23 23 23 0a 23 20 31 30 2e  ##########.# 10.
7d30: 20 43 6f 6e 73 74 72 75 63 74 20 6f 75 74 70 75   Construct outpu
7d40: 74 20 64 69 72 65 63 74 6f 72 79 20 61 6e 64 20  t directory and 
7d50: 66 69 6c 65 20 70 61 74 68 73 0a 23 20 46 69 67  file paths.# Fig
7d60: 75 72 65 2d 6f 75 74 20 68 6f 77 20 74 6f 20 6e  ure-out how to n
7d70: 61 6d 65 20 6f 75 72 20 69 6e 74 65 72 6d 65 64  ame our intermed
7d80: 69 61 74 65 20 61 6e 64 20 6f 75 74 70 75 74 20  iate and output 
7d90: 64 69 72 65 63 74 6f 72 69 65 73 2e 0a 23 20 49  directories..# I
7da0: 6e 20 6f 72 64 65 72 20 74 6f 20 61 76 6f 69 64  n order to avoid
7db0: 20 69 6e 61 64 76 65 72 74 65 6e 74 20 6d 69 78   inadvertent mix
7dc0: 69 6e 67 20 6f 66 20 6f 62 6a 65 63 74 20 66 69  ing of object fi
7dd0: 6c 65 73 20 62 75 69 6c 74 20 75 73 69 6e 67 0a  les built using.
7de0: 23 20 64 69 66 66 65 72 65 6e 74 20 63 6f 6d 70  # different comp
7df0: 69 6c 65 72 73 2c 20 62 75 69 6c 64 20 63 6f 6e  ilers, build con
7e00: 66 69 67 75 72 61 74 69 6f 6e 73 20 65 74 63 2e  figurations etc.
7e10: 2c 0a 23 0a 23 20 4e 61 6d 69 6e 67 20 63 6f 6e  ,.#.# Naming con
7e20: 76 65 6e 74 69 6f 6e 20 28 73 75 66 66 69 78 65  vention (suffixe
7e30: 73 29 3a 0a 23 20 20 20 74 20 3d 20 66 75 6c 6c  s):.#   t = full
7e40: 20 74 68 72 65 61 64 20 73 75 70 70 6f 72 74 2e   thread support.
7e50: 20 28 4e 6f 74 20 75 73 65 64 20 66 6f 72 20 54   (Not used for T
7e60: 63 6c 20 3e 3d 20 38 2e 37 29 0a 23 20 20 20 73  cl >= 8.7).#   s
7e70: 20 3d 20 73 74 61 74 69 63 20 6c 69 62 72 61 72   = static librar
7e80: 79 20 28 61 73 20 6f 70 70 6f 73 65 64 20 74 6f  y (as opposed to
7e90: 20 61 6e 20 69 6d 70 6f 72 74 20 6c 69 62 72 61   an import libra
7ea0: 72 79 29 0a 23 20 20 20 67 20 3d 20 6c 69 6e 6b  ry).#   g = link
7eb0: 65 64 20 74 6f 20 74 68 65 20 64 65 62 75 67 20  ed to the debug 
7ec0: 65 6e 61 62 6c 65 64 20 43 20 72 75 6e 2d 74 69  enabled C run-ti
7ed0: 6d 65 2e 0a 23 20 20 20 78 20 3d 20 73 70 65 63  me..#   x = spec
7ee0: 69 61 6c 20 73 74 61 74 69 63 20 62 75 69 6c 64  ial static build
7ef0: 20 77 68 65 6e 20 69 74 20 6c 69 6e 6b 73 20 74   when it links t
7f00: 6f 20 74 68 65 20 64 79 6e 61 6d 69 63 20 43 20  o the dynamic C 
7f10: 72 75 6e 2d 74 69 6d 65 2e 0a 23 0a 23 20 54 68  run-time..#.# Th
7f20: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72  e following macr
7f30: 6f 73 20 61 72 65 20 73 65 74 20 69 6e 20 74 68  os are set in th
7f40: 69 73 20 73 65 63 74 69 6f 6e 3a 0a 23 20 53 55  is section:.# SU
7f50: 46 58 20 2d 20 74 68 65 20 73 75 66 66 69 78 20  FX - the suffix 
7f60: 74 6f 20 75 73 65 20 66 6f 72 20 62 69 6e 61 72  to use for binar
7f70: 69 65 73 20 62 61 73 65 64 20 6f 6e 20 61 62 6f  ies based on abo
7f80: 76 65 20 6e 61 6d 69 6e 67 20 63 6f 6e 76 65 6e  ve naming conven
7f90: 74 69 6f 6e 0a 23 20 42 55 49 4c 44 44 49 52 54  tion.# BUILDDIRT
7fa0: 4f 50 20 2d 20 74 68 65 20 74 6f 70 6c 65 76 65  OP - the topleve
7fb0: 6c 20 64 65 66 61 75 6c 74 20 6f 75 74 70 75 74  l default output
7fc0: 20 64 69 72 65 63 74 6f 72 79 0a 23 20 20 20 20   directory.#    
7fd0: 20 20 69 73 20 6f 66 20 74 68 65 20 66 6f 72 6d    is of the form
7fe0: 20 7b 52 65 6c 65 61 73 65 2c 44 65 62 75 67 7d   {Release,Debug}
7ff0: 5b 5f 41 4d 44 36 34 5d 5b 5f 43 4f 4d 50 49 4c  [_AMD64][_COMPIL
8000: 45 52 56 45 52 53 49 4f 4e 5d 0a 23 20 54 4d 50  ERVERSION].# TMP
8010: 5f 44 49 52 20 2d 20 64 69 72 65 63 74 6f 72 79  _DIR - directory
8020: 20 77 68 65 72 65 20 6f 62 6a 65 63 74 20 66 69   where object fi
8030: 6c 65 73 20 61 72 65 20 63 72 65 61 74 65 64 0a  les are created.
8040: 23 20 4f 55 54 5f 44 49 52 20 2d 20 64 69 72 65  # OUT_DIR - dire
8050: 63 74 6f 72 79 20 77 68 65 72 65 20 6f 75 74 70  ctory where outp
8060: 75 74 20 65 78 65 63 75 74 61 62 6c 65 73 20 61  ut executables a
8070: 72 65 20 63 72 65 61 74 65 64 0a 23 20 42 6f 74  re created.# Bot
8080: 68 20 54 4d 50 5f 44 49 52 20 61 6e 64 20 4f 55  h TMP_DIR and OU
8090: 54 5f 44 49 52 20 61 72 65 20 64 65 66 61 75 6c  T_DIR are defaul
80a0: 74 65 64 20 6f 6e 6c 79 20 69 66 20 6e 6f 74 20  ted only if not 
80b0: 64 65 66 69 6e 65 64 20 62 79 20 74 68 65 0a 23  defined by the.#
80c0: 20 70 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65   parent makefile
80d0: 20 28 6f 72 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e   (or command lin
80e0: 65 29 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20  e). The default 
80f0: 76 61 6c 75 65 73 20 61 72 65 0a 23 20 62 61 73  values are.# bas
8100: 65 64 20 6f 6e 20 42 55 49 4c 44 44 49 52 54 4f  ed on BUILDDIRTO
8110: 50 2e 0a 23 20 53 54 55 42 50 52 45 46 49 58 20  P..# STUBPREFIX 
8120: 2d 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 73 74  - name of the st
8130: 75 62 73 20 6c 69 62 72 61 72 79 20 66 6f 72 20  ubs library for 
8140: 74 68 69 73 20 70 72 6f 6a 65 63 74 0a 23 20 50  this project.# P
8150: 52 4a 49 4d 50 4c 49 42 20 2d 20 6f 75 74 70 75  RJIMPLIB - outpu
8160: 74 20 70 61 74 68 20 6f 66 20 74 68 65 20 67 65  t path of the ge
8170: 6e 65 72 61 74 65 64 20 70 72 6f 6a 65 63 74 20  nerated project 
8180: 69 6d 70 6f 72 74 20 6c 69 62 72 61 72 79 0a 23  import library.#
8190: 20 50 52 4a 4c 49 42 4e 41 4d 45 20 2d 20 6e 61   PRJLIBNAME - na
81a0: 6d 65 20 6f 66 20 67 65 6e 65 72 61 74 65 64 20  me of generated 
81b0: 70 72 6f 6a 65 63 74 20 6c 69 62 72 61 72 79 0a  project library.
81c0: 23 20 50 52 4a 4c 49 42 20 20 20 20 20 2d 20 6f  # PRJLIB     - o
81d0: 75 74 70 75 74 20 70 61 74 68 20 6f 66 20 67 65  utput path of ge
81e0: 6e 65 72 61 74 65 64 20 70 72 6f 6a 65 63 74 20  nerated project 
81f0: 6c 69 62 72 61 72 79 0a 23 20 50 52 4a 53 54 55  library.# PRJSTU
8200: 42 4c 49 42 4e 41 4d 45 20 2d 20 6e 61 6d 65 20  BLIBNAME - name 
8210: 6f 66 20 74 68 65 20 67 65 6e 65 72 61 74 65 64  of the generated
8220: 20 70 72 6f 6a 65 63 74 20 73 74 75 62 73 20 6c   project stubs l
8230: 69 62 72 61 72 79 0a 23 20 50 52 4a 53 54 55 42  ibrary.# PRJSTUB
8240: 4c 49 42 20 2d 20 6f 75 74 70 75 74 20 70 61 74  LIB - output pat
8250: 68 20 6f 66 20 74 68 65 20 67 65 6e 65 72 61 74  h of the generat
8260: 65 64 20 70 72 6f 6a 65 63 74 20 73 74 75 62 73  ed project stubs
8270: 20 6c 69 62 72 61 72 79 0a 23 20 52 45 53 46 49   library.# RESFI
8280: 4c 45 20 2d 20 6f 75 74 70 75 74 20 72 65 73 6f  LE - output reso
8290: 75 72 63 65 20 66 69 6c 65 20 28 6f 6e 6c 79 20  urce file (only 
82a0: 69 66 20 6e 6f 74 20 73 74 61 74 69 63 20 62 75  if not static bu
82b0: 69 6c 64 29 0a 0a 53 55 46 58 09 20 20 20 20 3d  ild)..SUFX.    =
82c0: 20 74 73 67 78 0a 0a 21 69 66 20 24 28 44 45 42   tsgx..!if $(DEB
82d0: 55 47 29 0a 42 55 49 4c 44 44 49 52 54 4f 50 20  UG).BUILDDIRTOP 
82e0: 3d 20 44 65 62 75 67 0a 21 65 6c 73 65 0a 42 55  = Debug.!else.BU
82f0: 49 4c 44 44 49 52 54 4f 50 20 3d 20 52 65 6c 65  ILDDIRTOP = Rele
8300: 61 73 65 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20  ase.!endif..!if 
8310: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 21 3d 20  "$(MACHINE)" != 
8320: 22 49 58 38 36 22 0a 42 55 49 4c 44 44 49 52 54  "IX86".BUILDDIRT
8330: 4f 50 20 3d 24 28 42 55 49 4c 44 44 49 52 54 4f  OP =$(BUILDDIRTO
8340: 50 29 5f 24 28 4d 41 43 48 49 4e 45 29 0a 21 65  P)_$(MACHINE).!e
8350: 6e 64 69 66 0a 21 69 66 20 24 28 56 43 56 45 52  ndif.!if $(VCVER
8360: 29 20 3e 20 36 0a 42 55 49 4c 44 44 49 52 54 4f  ) > 6.BUILDDIRTO
8370: 50 20 3d 24 28 42 55 49 4c 44 44 49 52 54 4f 50  P =$(BUILDDIRTOP
8380: 29 5f 56 43 24 28 56 43 56 45 52 29 0a 21 65 6e  )_VC$(VCVER).!en
8390: 64 69 66 0a 0a 21 69 66 20 21 24 28 44 45 42 55  dif..!if !$(DEBU
83a0: 47 29 20 7c 7c 20 24 28 54 43 4c 5f 56 45 52 53  G) || $(TCL_VERS
83b0: 49 4f 4e 29 20 3e 20 38 36 20 7c 7c 20 24 28 44  ION) > 86 || $(D
83c0: 45 42 55 47 29 20 26 26 20 24 28 55 4e 43 48 45  EBUG) && $(UNCHE
83d0: 43 4b 45 44 29 0a 53 55 46 58 09 20 20 20 20 3d  CKED).SUFX.    =
83e0: 20 24 28 53 55 46 58 3a 67 3d 29 0a 21 65 6e 64   $(SUFX:g=).!end
83f0: 69 66 0a 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20  if..TMP_DIRFULL 
8400: 3d 20 2e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f  = .\$(BUILDDIRTO
8410: 50 29 5c 24 28 50 52 4f 4a 45 43 54 29 5f 54 68  P)\$(PROJECT)_Th
8420: 72 65 61 64 65 64 44 79 6e 61 6d 69 63 53 74 61  readedDynamicSta
8430: 74 69 63 58 0a 0a 21 69 66 20 21 24 28 53 54 41  ticX..!if !$(STA
8440: 54 49 43 5f 42 55 49 4c 44 29 0a 54 4d 50 5f 44  TIC_BUILD).TMP_D
8450: 49 52 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f 44  IRFULL = $(TMP_D
8460: 49 52 46 55 4c 4c 3a 53 74 61 74 69 63 3d 29 0a  IRFULL:Static=).
8470: 53 55 46 58 09 20 20 20 20 3d 20 24 28 53 55 46  SUFX.    = $(SUF
8480: 58 3a 73 3d 29 0a 45 58 54 09 20 20 20 20 3d 20  X:s=).EXT.    = 
8490: 64 6c 6c 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20  dll.TMP_DIRFULL 
84a0: 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a  = $(TMP_DIRFULL:
84b0: 58 3d 29 0a 53 55 46 58 09 20 20 20 20 3d 20 24  X=).SUFX.    = $
84c0: 28 53 55 46 58 3a 78 3d 29 0a 21 65 6c 73 65 0a  (SUFX:x=).!else.
84d0: 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d 20 24 28  TMP_DIRFULL = $(
84e0: 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 44 79 6e 61  TMP_DIRFULL:Dyna
84f0: 6d 69 63 3d 29 0a 45 58 54 09 20 20 20 20 3d 20  mic=).EXT.    = 
8500: 6c 69 62 0a 21 69 66 20 21 24 28 4d 53 56 43 52  lib.!if !$(MSVCR
8510: 54 29 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d  T).TMP_DIRFULL =
8520: 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 58   $(TMP_DIRFULL:X
8530: 3d 29 0a 53 55 46 58 09 20 20 20 20 3d 20 24 28  =).SUFX.    = $(
8540: 53 55 46 58 3a 78 3d 29 0a 21 65 6e 64 69 66 0a  SUFX:x=).!endif.
8550: 21 65 6e 64 69 66 0a 0a 21 69 66 20 21 24 28 54  !endif..!if !$(T
8560: 43 4c 5f 54 48 52 45 41 44 53 29 20 7c 7c 20 24  CL_THREADS) || $
8570: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3e 20  (TCL_VERSION) > 
8580: 38 36 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d  86.TMP_DIRFULL =
8590: 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 54   $(TMP_DIRFULL:T
85a0: 68 72 65 61 64 65 64 3d 29 0a 53 55 46 58 09 20  hreaded=).SUFX. 
85b0: 20 20 20 3d 20 24 28 53 55 46 58 3a 74 3d 29 0a     = $(SUFX:t=).
85c0: 21 65 6e 64 69 66 0a 0a 21 69 66 6e 64 65 66 20  !endif..!ifndef 
85d0: 54 4d 50 5f 44 49 52 0a 54 4d 50 5f 44 49 52 09  TMP_DIR.TMP_DIR.
85e0: 20 20 20 20 3d 20 24 28 54 4d 50 5f 44 49 52 46      = $(TMP_DIRF
85f0: 55 4c 4c 29 0a 21 69 66 6e 64 65 66 20 4f 55 54  ULL).!ifndef OUT
8600: 5f 44 49 52 0a 4f 55 54 5f 44 49 52 09 20 20 20  _DIR.OUT_DIR.   
8610: 20 3d 20 2e 5c 24 28 42 55 49 4c 44 44 49 52 54   = .\$(BUILDDIRT
8620: 4f 50 29 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65  OP).!endif.!else
8630: 0a 21 69 66 6e 64 65 66 20 4f 55 54 5f 44 49 52  .!ifndef OUT_DIR
8640: 0a 4f 55 54 5f 44 49 52 09 20 20 20 20 3d 20 24  .OUT_DIR.    = $
8650: 28 54 4d 50 5f 44 49 52 29 0a 21 65 6e 64 69 66  (TMP_DIR).!endif
8660: 0a 21 65 6e 64 69 66 0a 0a 23 20 52 65 6c 61 74  .!endif..# Relat
8670: 69 76 65 20 70 61 74 68 73 20 2d 3e 20 61 62 73  ive paths -> abs
8680: 6f 6c 75 74 65 0a 21 69 66 20 5b 65 63 68 6f 20  olute.!if [echo 
8690: 4f 55 54 5f 44 49 52 20 3d 20 5c 3e 20 6e 6d 61  OUT_DIR = \> nma
86a0: 6b 65 68 6c 70 2e 6f 75 74 5d 20 5c 0a 20 20 20  kehlp.out] \.   
86b0: 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 51 20  || [nmakehlp -Q 
86c0: 22 24 28 4f 55 54 5f 44 49 52 29 22 20 3e 3e 20  "$(OUT_DIR)" >> 
86d0: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65  nmakehlp.out].!e
86e0: 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e  rror *** Could n
86f0: 6f 74 20 66 75 6c 6c 79 20 71 75 61 6c 69 66 79  ot fully qualify
8700: 20 70 61 74 68 20 4f 55 54 5f 44 49 52 3d 24 28   path OUT_DIR=$(
8710: 4f 55 54 5f 44 49 52 29 0a 21 65 6e 64 69 66 0a  OUT_DIR).!endif.
8720: 21 69 66 20 5b 65 63 68 6f 20 54 4d 50 5f 44 49  !if [echo TMP_DI
8730: 52 20 3d 20 5c 3e 3e 20 6e 6d 61 6b 65 68 6c 70  R = \>> nmakehlp
8740: 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b 6e  .out] \.   || [n
8750: 6d 61 6b 65 68 6c 70 20 2d 51 20 22 24 28 54 4d  makehlp -Q "$(TM
8760: 50 5f 44 49 52 29 22 20 3e 3e 20 6e 6d 61 6b 65  P_DIR)" >> nmake
8770: 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72 6f 72 20  hlp.out].!error 
8780: 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 75  *** Could not fu
8790: 6c 6c 79 20 71 75 61 6c 69 66 79 20 70 61 74 68  lly qualify path
87a0: 20 54 4d 50 5f 44 49 52 3d 24 28 54 4d 50 5f 44   TMP_DIR=$(TMP_D
87b0: 49 52 29 0a 21 65 6e 64 69 66 0a 21 69 6e 63 6c  IR).!endif.!incl
87c0: 75 64 65 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74  ude nmakehlp.out
87d0: 0a 0a 23 20 54 68 65 20 6e 61 6d 65 20 6f 66 20  ..# The name of 
87e0: 74 68 65 20 73 74 75 62 73 20 6c 69 62 72 61 72  the stubs librar
87f0: 79 20 66 6f 72 20 74 68 65 20 70 72 6f 6a 65 63  y for the projec
8800: 74 20 62 65 69 6e 67 20 62 75 69 6c 74 0a 53 54  t being built.ST
8810: 55 42 50 52 45 46 49 58 20 20 20 20 20 20 3d 20  UBPREFIX      = 
8820: 24 28 50 52 4f 4a 45 43 54 29 73 74 75 62 0a 0a  $(PROJECT)stub..
8830: 23 0a 23 20 53 65 74 20 75 70 20 70 61 74 68 73  #.# Set up paths
8840: 20 74 6f 20 76 61 72 69 6f 75 73 20 54 63 6c 20   to various Tcl 
8850: 65 78 65 63 75 74 61 62 6c 65 73 20 61 6e 64 20  executables and 
8860: 6c 69 62 72 61 72 69 65 73 20 6e 65 65 64 65 64  libraries needed
8870: 20 62 79 20 65 78 74 65 6e 73 69 6f 6e 73 0a 23   by extensions.#
8880: 0a 0a 23 20 54 49 50 20 34 33 30 2e 20 55 6e 75  ..# TIP 430. Unu
8890: 73 65 64 20 66 6f 72 20 38 2e 36 20 62 75 74 20  sed for 8.6 but 
88a0: 6e 6f 20 68 61 72 6d 20 64 65 66 69 6e 69 6e 67  no harm defining
88b0: 20 69 74 20 74 6f 20 61 6c 6c 6f 77 20 61 20 63   it to allow a c
88c0: 6f 6d 6d 6f 6e 20 72 75 6c 65 73 2e 76 63 0a 54  ommon rules.vc.T
88d0: 43 4c 53 43 52 49 50 54 5a 49 50 4e 41 4d 45 20  CLSCRIPTZIPNAME 
88e0: 3d 20 6c 69 62 74 63 6c 24 28 54 43 4c 5f 4d 41  = libtcl$(TCL_MA
88f0: 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28 54  JOR_VERSION).$(T
8900: 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e  CL_MINOR_VERSION
8910: 29 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45 54  )$(TCL_PATCH_LET
8920: 54 45 52 29 24 28 54 43 4c 5f 52 45 4c 45 41 53  TER)$(TCL_RELEAS
8930: 45 5f 53 45 52 49 41 4c 29 2e 7a 69 70 0a 54 4b  E_SERIAL).zip.TK
8940: 53 43 52 49 50 54 5a 49 50 4e 41 4d 45 20 3d 20  SCRIPTZIPNAME = 
8950: 6c 69 62 74 6b 24 28 54 4b 5f 4d 41 4a 4f 52 5f  libtk$(TK_MAJOR_
8960: 56 45 52 53 49 4f 4e 29 2e 24 28 54 4b 5f 4d 49  VERSION).$(TK_MI
8970: 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 24 28 54 4b  NOR_VERSION)$(TK
8980: 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 29 24 28  _PATCH_LETTER)$(
8990: 54 4b 5f 52 45 4c 45 41 53 45 5f 53 45 52 49 41  TK_RELEASE_SERIA
89a0: 4c 29 2e 7a 69 70 0a 0a 21 69 66 20 24 28 44 4f  L).zip..!if $(DO
89b0: 49 4e 47 5f 54 43 4c 29 0a 54 43 4c 53 48 4e 41  ING_TCL).TCLSHNA
89c0: 4d 45 20 20 20 20 20 20 20 3d 20 24 28 50 52 4f  ME       = $(PRO
89d0: 4a 45 43 54 29 73 68 24 28 56 45 52 53 49 4f 4e  JECT)sh$(VERSION
89e0: 29 24 28 53 55 46 58 29 2e 65 78 65 0a 54 43 4c  )$(SUFX).exe.TCL
89f0: 53 48 09 09 3d 20 24 28 4f 55 54 5f 44 49 52 29  SH..= $(OUT_DIR)
8a00: 5c 24 28 54 43 4c 53 48 4e 41 4d 45 29 0a 54 43  \$(TCLSHNAME).TC
8a10: 4c 49 4d 50 4c 49 42 09 3d 20 24 28 4f 55 54 5f  LIMPLIB.= $(OUT_
8a20: 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 24  DIR)\$(PROJECT)$
8a30: 28 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29  (VERSION)$(SUFX)
8a40: 2e 6c 69 62 0a 54 43 4c 4c 49 42 4e 41 4d 45 09  .lib.TCLLIBNAME.
8a50: 3d 20 24 28 50 52 4f 4a 45 43 54 29 24 28 56 45  = $(PROJECT)$(VE
8a60: 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 28  RSION)$(SUFX).$(
8a70: 45 58 54 29 0a 54 43 4c 4c 49 42 09 09 3d 20 24  EXT).TCLLIB..= $
8a80: 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 43 4c 4c  (OUT_DIR)\$(TCLL
8a90: 49 42 4e 41 4d 45 29 0a 54 43 4c 53 43 52 49 50  IBNAME).TCLSCRIP
8aa0: 54 5a 49 50 20 20 20 20 3d 20 24 28 4f 55 54 5f  TZIP    = $(OUT_
8ab0: 44 49 52 29 5c 24 28 54 43 4c 53 43 52 49 50 54  DIR)\$(TCLSCRIPT
8ac0: 5a 49 50 4e 41 4d 45 29 0a 0a 21 69 66 20 24 28  ZIPNAME)..!if $(
8ad0: 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f  TCL_MAJOR_VERSIO
8ae0: 4e 29 20 3d 3d 20 38 0a 54 43 4c 53 54 55 42 4c  N) == 8.TCLSTUBL
8af0: 49 42 4e 41 4d 45 09 3d 20 24 28 53 54 55 42 50  IBNAME.= $(STUBP
8b00: 52 45 46 49 58 29 24 28 56 45 52 53 49 4f 4e 29  REFIX)$(VERSION)
8b10: 2e 6c 69 62 0a 21 65 6c 73 65 0a 54 43 4c 53 54  .lib.!else.TCLST
8b20: 55 42 4c 49 42 4e 41 4d 45 09 3d 20 24 28 53 54  UBLIBNAME.= $(ST
8b30: 55 42 50 52 45 46 49 58 29 2e 6c 69 62 0a 21 65  UBPREFIX).lib.!e
8b40: 6e 64 69 66 0a 54 43 4c 53 54 55 42 4c 49 42 09  ndif.TCLSTUBLIB.
8b50: 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 54  = $(OUT_DIR)\$(T
8b60: 43 4c 53 54 55 42 4c 49 42 4e 41 4d 45 29 0a 54  CLSTUBLIBNAME).T
8b70: 43 4c 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 3d  CL_INCLUDES    =
8b80: 20 2d 49 22 24 28 57 49 4e 5f 44 49 52 29 22 20   -I"$(WIN_DIR)" 
8b90: 2d 49 22 24 28 47 45 4e 45 52 49 43 44 49 52 29  -I"$(GENERICDIR)
8ba0: 22 0a 0a 21 65 6c 73 65 20 23 20 21 24 28 44 4f  "..!else # !$(DO
8bb0: 49 4e 47 5f 54 43 4c 29 0a 0a 21 69 66 20 24 28  ING_TCL)..!if $(
8bc0: 54 43 4c 49 4e 53 54 41 4c 4c 29 20 23 20 42 75  TCLINSTALL) # Bu
8bd0: 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 61  ilding against a
8be0: 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c 0a  n installed Tcl.
8bf0: 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67  .# When building
8c00: 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 77 65 20   extensions, we 
8c10: 6e 65 65 64 20 74 6f 20 6c 6f 63 61 74 65 20 74  need to locate t
8c20: 63 6c 73 68 2e 20 44 65 70 65 6e 64 69 6e 67 20  clsh. Depending 
8c30: 6f 6e 20 76 65 72 73 69 6f 6e 0a 23 20 6f 66 20  on version.# of 
8c40: 54 63 6c 20 77 65 20 61 72 65 20 62 75 69 6c 64  Tcl we are build
8c50: 69 6e 67 20 61 67 61 69 6e 73 74 2c 20 74 68 69  ing against, thi
8c60: 73 20 6d 61 79 20 6f 72 20 6d 61 79 20 6e 6f 74  s may or may not
8c70: 20 68 61 76 65 20 61 20 22 74 22 20 73 75 66 66   have a "t" suff
8c80: 69 78 2e 0a 23 20 54 72 79 20 76 61 72 69 6f 75  ix..# Try variou
8c90: 73 20 70 6f 73 73 69 62 69 6c 69 74 69 65 73 20  s possibilities 
8ca0: 69 6e 20 74 75 72 6e 2e 0a 54 43 4c 53 48 09 09  in turn..TCLSH..
8cb0: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 62 69 6e  = $(_TCLDIR)\bin
8cc0: 5c 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 52 53  \tclsh$(TCL_VERS
8cd0: 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e 65  ION)$(SUFX:t=).e
8ce0: 78 65 0a 21 69 66 20 21 65 78 69 73 74 28 22 24  xe.!if !exist("$
8cf0: 28 54 43 4c 53 48 29 22 29 0a 54 43 4c 53 48 20  (TCLSH)").TCLSH 
8d00: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54            = $(_T
8d10: 43 4c 44 49 52 29 5c 62 69 6e 5c 74 63 6c 73 68  CLDIR)\bin\tclsh
8d20: 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 74 24  $(TCL_VERSION)t$
8d30: 28 53 55 46 58 3a 74 3d 29 2e 65 78 65 0a 21 65  (SUFX:t=).exe.!e
8d40: 6e 64 69 66 0a 0a 21 69 66 20 24 28 54 43 4c 5f  ndif..!if $(TCL_
8d50: 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d  MAJOR_VERSION) =
8d60: 3d 20 38 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d  = 8.TCLSTUBLIB.=
8d70: 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c   $(_TCLDIR)\lib\
8d80: 74 63 6c 73 74 75 62 24 28 54 43 4c 5f 56 45 52  tclstub$(TCL_VER
8d90: 53 49 4f 4e 29 2e 6c 69 62 0a 21 65 6c 73 65 0a  SION).lib.!else.
8da0: 54 43 4c 53 54 55 42 4c 49 42 09 3d 20 24 28 5f  TCLSTUBLIB.= $(_
8db0: 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c 73  TCLDIR)\lib\tcls
8dc0: 74 75 62 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 54  tub.lib.!endif.T
8dd0: 43 4c 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 43  CLIMPLIB.= $(_TC
8de0: 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c 24 28 54  LDIR)\lib\tcl$(T
8df0: 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46  CL_VERSION)$(SUF
8e00: 58 3a 74 3d 29 2e 6c 69 62 0a 23 20 57 68 65 6e  X:t=).lib.# When
8e10: 20 62 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73   building extens
8e20: 69 6f 6e 73 2c 20 6d 61 79 20 62 65 20 6c 69 6e  ions, may be lin
8e30: 6b 69 6e 67 20 61 67 61 69 6e 73 74 20 54 63 6c  king against Tcl
8e40: 20 74 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 61   that does not a
8e50: 64 64 0a 23 20 22 74 22 20 73 75 66 66 69 78 20  dd.# "t" suffix 
8e60: 28 65 2e 67 2e 20 38 2e 35 20 6f 72 20 38 2e 37  (e.g. 8.5 or 8.7
8e70: 29 2e 20 49 66 20 6c 69 62 20 6e 6f 74 20 66 6f  ). If lib not fo
8e80: 75 6e 64 20 63 68 65 63 6b 20 66 6f 72 20 74 68  und check for th
8e90: 61 74 20 70 6f 73 73 69 62 69 6c 69 74 79 2e 0a  at possibility..
8ea0: 21 69 66 20 21 65 78 69 73 74 28 22 24 28 54 43  !if !exist("$(TC
8eb0: 4c 49 4d 50 4c 49 42 29 22 29 0a 54 43 4c 49 4d  LIMPLIB)").TCLIM
8ec0: 50 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52  PLIB.= $(_TCLDIR
8ed0: 29 5c 6c 69 62 5c 74 63 6c 24 28 54 43 4c 5f 56  )\lib\tcl$(TCL_V
8ee0: 45 52 53 49 4f 4e 29 74 24 28 53 55 46 58 3a 74  ERSION)t$(SUFX:t
8ef0: 3d 29 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 54 43  =).lib.!endif.TC
8f00: 4c 5f 4c 49 42 52 41 52 59 09 3d 20 24 28 5f 54  L_LIBRARY.= $(_T
8f10: 43 4c 44 49 52 29 5c 6c 69 62 0a 54 43 4c 52 45  CLDIR)\lib.TCLRE
8f20: 47 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52  GLIB.= $(_TCLDIR
8f30: 29 5c 6c 69 62 5c 74 63 6c 72 65 67 31 33 24 28  )\lib\tclreg13$(
8f40: 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a 54 43 4c  SUFX:t=).lib.TCL
8f50: 44 44 45 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44  DDELIB.= $(_TCLD
8f60: 49 52 29 5c 6c 69 62 5c 74 63 6c 64 64 65 31 34  IR)\lib\tcldde14
8f70: 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a 54  $(SUFX:t=).lib.T
8f80: 43 4c 53 43 52 49 50 54 5a 49 50 09 3d 20 24 28  CLSCRIPTZIP.= $(
8f90: 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 24 28 54  _TCLDIR)\lib\$(T
8fa0: 43 4c 53 43 52 49 50 54 5a 49 50 4e 41 4d 45 29  CLSCRIPTZIPNAME)
8fb0: 0a 54 43 4c 54 4f 4f 4c 53 44 49 52 09 3d 20 5c  .TCLTOOLSDIR.= \
8fc0: 6d 75 73 74 5c 68 61 76 65 5c 74 63 6c 5c 73 6f  must\have\tcl\so
8fd0: 75 72 63 65 73 5c 74 6f 5c 62 75 69 6c 64 5c 74  urces\to\build\t
8fe0: 68 69 73 5c 74 61 72 67 65 74 0a 54 43 4c 5f 49  his\target.TCL_I
8ff0: 4e 43 4c 55 44 45 53 20 20 20 20 3d 20 2d 49 22  NCLUDES    = -I"
9000: 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e 63 6c 75  $(_TCLDIR)\inclu
9010: 64 65 22 0a 0a 21 65 6c 73 65 20 23 20 42 75 69  de"..!else # Bui
9020: 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54 63  lding against Tc
9030: 6c 20 73 6f 75 72 63 65 73 0a 0a 54 43 4c 53 48  l sources..TCLSH
9040: 09 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77  ..= $(_TCLDIR)\w
9050: 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50  in\$(BUILDDIRTOP
9060: 29 5c 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 52  )\tclsh$(TCL_VER
9070: 53 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e  SION)$(SUFX:t=).
9080: 65 78 65 0a 21 69 66 20 21 65 78 69 73 74 28 24  exe.!if !exist($
9090: 28 54 43 4c 53 48 29 29 0a 54 43 4c 53 48 09 09  (TCLSH)).TCLSH..
90a0: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e  = $(_TCLDIR)\win
90b0: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c  \$(BUILDDIRTOP)\
90c0: 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 52 53 49  tclsh$(TCL_VERSI
90d0: 4f 4e 29 74 24 28 53 55 46 58 3a 74 3d 29 2e 65  ON)t$(SUFX:t=).e
90e0: 78 65 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28  xe.!endif.!if $(
90f0: 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f  TCL_MAJOR_VERSIO
9100: 4e 29 20 3d 3d 20 38 0a 54 43 4c 53 54 55 42 4c  N) == 8.TCLSTUBL
9110: 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  IB.= $(_TCLDIR)\
9120: 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f  win\$(BUILDDIRTO
9130: 50 29 5c 74 63 6c 73 74 75 62 24 28 54 43 4c 5f  P)\tclstub$(TCL_
9140: 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0a 21 65 6c  VERSION).lib.!el
9150: 73 65 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d 20  se.TCLSTUBLIB.= 
9160: 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24  $(_TCLDIR)\win\$
9170: 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63  (BUILDDIRTOP)\tc
9180: 6c 73 74 75 62 2e 6c 69 62 0a 21 65 6e 64 69 66  lstub.lib.!endif
9190: 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20 24 28 5f  .TCLIMPLIB.= $(_
91a0: 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  TCLDIR)\win\$(BU
91b0: 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 24 28  ILDDIRTOP)\tcl$(
91c0: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 53 55  TCL_VERSION)$(SU
91d0: 46 58 3a 74 3d 29 2e 6c 69 62 0a 23 20 57 68 65  FX:t=).lib.# Whe
91e0: 6e 20 62 75 69 6c 64 69 6e 67 20 65 78 74 65 6e  n building exten
91f0: 73 69 6f 6e 73 2c 20 6d 61 79 20 62 65 20 6c 69  sions, may be li
9200: 6e 6b 69 6e 67 20 61 67 61 69 6e 73 74 20 54 63  nking against Tc
9210: 6c 20 74 68 61 74 20 64 6f 65 73 20 6e 6f 74 20  l that does not 
9220: 61 64 64 0a 23 20 22 74 22 20 73 75 66 66 69 78  add.# "t" suffix
9230: 20 28 65 2e 67 2e 20 38 2e 35 20 6f 72 20 38 2e   (e.g. 8.5 or 8.
9240: 37 29 2e 20 49 66 20 6c 69 62 20 6e 6f 74 20 66  7). If lib not f
9250: 6f 75 6e 64 20 63 68 65 63 6b 20 66 6f 72 20 74  ound check for t
9260: 68 61 74 20 70 6f 73 73 69 62 69 6c 69 74 79 2e  hat possibility.
9270: 0a 21 69 66 20 21 65 78 69 73 74 28 22 24 28 54  .!if !exist("$(T
9280: 43 4c 49 4d 50 4c 49 42 29 22 29 0a 54 43 4c 49  CLIMPLIB)").TCLI
9290: 4d 50 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49  MPLIB.= $(_TCLDI
92a0: 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49  R)\win\$(BUILDDI
92b0: 52 54 4f 50 29 5c 74 63 6c 24 28 54 43 4c 5f 56  RTOP)\tcl$(TCL_V
92c0: 45 52 53 49 4f 4e 29 74 24 28 53 55 46 58 3a 74  ERSION)t$(SUFX:t
92d0: 3d 29 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 54 43  =).lib.!endif.TC
92e0: 4c 5f 4c 49 42 52 41 52 59 09 3d 20 24 28 5f 54  L_LIBRARY.= $(_T
92f0: 43 4c 44 49 52 29 5c 6c 69 62 72 61 72 79 0a 54  CLDIR)\library.T
9300: 43 4c 52 45 47 4c 49 42 09 3d 20 24 28 5f 54 43  CLREGLIB.= $(_TC
9310: 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c  LDIR)\win\$(BUIL
9320: 44 44 49 52 54 4f 50 29 5c 74 63 6c 72 65 67 31  DDIRTOP)\tclreg1
9330: 33 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a  3$(SUFX:t=).lib.
9340: 54 43 4c 44 44 45 4c 49 42 09 3d 20 24 28 5f 54  TCLDDELIB.= $(_T
9350: 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49  CLDIR)\win\$(BUI
9360: 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 64 64 65  LDDIRTOP)\tcldde
9370: 31 34 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62  14$(SUFX:t=).lib
9380: 0a 54 43 4c 53 43 52 49 50 54 5a 49 50 09 3d 20  .TCLSCRIPTZIP.= 
9390: 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24  $(_TCLDIR)\win\$
93a0: 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 24 28  (BUILDDIRTOP)\$(
93b0: 54 43 4c 53 43 52 49 50 54 5a 49 50 4e 41 4d 45  TCLSCRIPTZIPNAME
93c0: 29 0a 54 43 4c 54 4f 4f 4c 53 44 49 52 09 3d 20  ).TCLTOOLSDIR.= 
93d0: 24 28 5f 54 43 4c 44 49 52 29 5c 74 6f 6f 6c 73  $(_TCLDIR)\tools
93e0: 0a 54 43 4c 5f 49 4e 43 4c 55 44 45 53 09 3d 20  .TCL_INCLUDES.= 
93f0: 2d 49 22 24 28 5f 54 43 4c 44 49 52 29 5c 67 65  -I"$(_TCLDIR)\ge
9400: 6e 65 72 69 63 22 20 2d 49 22 24 28 5f 54 43 4c  neric" -I"$(_TCL
9410: 44 49 52 29 5c 77 69 6e 22 0a 0a 21 65 6e 64 69  DIR)\win"..!endi
9420: 66 20 23 20 54 43 4c 49 4e 53 54 41 4c 4c 0a 0a  f # TCLINSTALL..
9430: 21 69 66 20 21 24 28 53 54 41 54 49 43 5f 42 55  !if !$(STATIC_BU
9440: 49 4c 44 29 20 26 26 20 22 24 28 54 43 4c 5f 42  ILD) && "$(TCL_B
9450: 55 49 4c 44 5f 46 4f 52 29 22 20 3d 3d 20 22 38  UILD_FOR)" == "8
9460: 22 0a 74 63 6c 6c 69 62 73 20 3d 20 22 24 28 54  ".tcllibs = "$(T
9470: 43 4c 53 54 55 42 4c 49 42 29 22 0a 21 65 6c 73  CLSTUBLIB)".!els
9480: 65 0a 74 63 6c 6c 69 62 73 20 3d 20 22 24 28 54  e.tcllibs = "$(T
9490: 43 4c 53 54 55 42 4c 49 42 29 22 20 22 24 28 54  CLSTUBLIB)" "$(T
94a0: 43 4c 49 4d 50 4c 49 42 29 22 0a 21 65 6e 64 69  CLIMPLIB)".!endi
94b0: 66 0a 0a 21 65 6e 64 69 66 20 23 20 24 28 44 4f  f..!endif # $(DO
94c0: 49 4e 47 5f 54 43 4c 29 0a 0a 23 20 57 65 20 6e  ING_TCL)..# We n
94d0: 65 65 64 20 61 20 74 63 6c 73 68 20 74 68 61 74  eed a tclsh that
94e0: 20 77 69 6c 6c 20 72 75 6e 20 6f 6e 20 74 68 65   will run on the
94f0: 20 68 6f 73 74 20 6d 61 63 68 69 6e 65 20 61 73   host machine as
9500: 20 70 61 72 74 20 6f 66 20 74 68 65 20 62 75 69   part of the bui
9510: 6c 64 2e 0a 23 20 49 58 38 36 20 72 75 6e 73 20  ld..# IX86 runs 
9520: 6f 6e 20 61 6c 6c 20 61 72 63 68 69 74 65 63 74  on all architect
9530: 75 72 65 73 2e 0a 21 69 66 6e 64 65 66 20 54 43  ures..!ifndef TC
9540: 4c 53 48 5f 4e 41 54 49 56 45 0a 21 69 66 20 22  LSH_NATIVE.!if "
9550: 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22  $(MACHINE)" == "
9560: 49 58 38 36 22 20 7c 7c 20 22 24 28 4d 41 43 48  IX86" || "$(MACH
9570: 49 4e 45 29 22 20 3d 3d 20 22 24 28 4e 41 54 49  INE)" == "$(NATI
9580: 56 45 5f 41 52 43 48 29 22 0a 54 43 4c 53 48 5f  VE_ARCH)".TCLSH_
9590: 4e 41 54 49 56 45 09 3d 20 24 28 54 43 4c 53 48  NATIVE.= $(TCLSH
95a0: 29 0a 21 65 6c 73 65 0a 21 65 72 72 6f 72 20 59  ).!else.!error Y
95b0: 6f 75 20 6d 75 73 74 20 65 78 70 6c 69 63 69 74  ou must explicit
95c0: 6c 79 20 73 65 74 20 54 43 4c 53 48 5f 4e 41 54  ly set TCLSH_NAT
95d0: 49 56 45 20 66 6f 72 20 63 72 6f 73 73 2d 63 6f  IVE for cross-co
95e0: 6d 70 69 6c 61 74 69 6f 6e 0a 21 65 6e 64 69 66  mpilation.!endif
95f0: 0a 21 65 6e 64 69 66 0a 0a 23 20 44 6f 20 74 68  .!endif..# Do th
9600: 65 20 73 61 6d 65 20 66 6f 72 20 54 6b 20 61 6e  e same for Tk an
9610: 64 20 54 6b 20 65 78 74 65 6e 73 69 6f 6e 73 20  d Tk extensions 
9620: 74 68 61 74 20 72 65 71 75 69 72 65 20 74 68 65  that require the
9630: 20 54 6b 20 6c 69 62 72 61 72 69 65 73 0a 21 69   Tk libraries.!i
9640: 66 20 24 28 44 4f 49 4e 47 5f 54 4b 29 20 7c 7c  f $(DOING_TK) ||
9650: 20 24 28 4e 45 45 44 5f 54 4b 29 0a 57 49 53 48   $(NEED_TK).WISH
9660: 4e 41 4d 45 50 52 45 46 49 58 20 3d 20 77 69 73  NAMEPREFIX = wis
9670: 68 0a 57 49 53 48 4e 41 4d 45 20 3d 20 24 28 57  h.WISHNAME = $(W
9680: 49 53 48 4e 41 4d 45 50 52 45 46 49 58 29 24 28  ISHNAMEPREFIX)$(
9690: 54 4b 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46  TK_VERSION)$(SUF
96a0: 58 29 2e 65 78 65 0a 54 4b 4c 49 42 4e 41 4d 45  X).exe.TKLIBNAME
96b0: 38 09 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53 49  8.= tk$(TK_VERSI
96c0: 4f 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58 54  ON)$(SUFX).$(EXT
96d0: 29 0a 54 4b 4c 49 42 4e 41 4d 45 39 09 3d 20 74  ).TKLIBNAME9.= t
96e0: 63 6c 39 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f  cl9tk$(TK_VERSIO
96f0: 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58 54 29  N)$(SUFX).$(EXT)
9700: 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52  .!if $(TCL_MAJOR
9710: 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 20 7c  _VERSION) == 8 |
9720: 7c 20 22 24 28 54 43 4c 5f 42 55 49 4c 44 5f 46  | "$(TCL_BUILD_F
9730: 4f 52 29 22 20 3d 3d 20 22 38 22 0a 54 4b 4c 49  OR)" == "8".TKLI
9740: 42 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56  BNAME.= tk$(TK_V
9750: 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 24  ERSION)$(SUFX).$
9760: 28 45 58 54 29 0a 54 4b 49 4d 50 4c 49 42 4e 41  (EXT).TKIMPLIBNA
9770: 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53  ME.= tk$(TK_VERS
9780: 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 0a  ION)$(SUFX).lib.
9790: 21 65 6c 73 65 0a 54 4b 4c 49 42 4e 41 4d 45 09  !else.TKLIBNAME.
97a0: 3d 20 74 63 6c 39 74 6b 24 28 54 4b 5f 56 45 52  = tcl9tk$(TK_VER
97b0: 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 28 45  SION)$(SUFX).$(E
97c0: 58 54 29 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d 45  XT).TKIMPLIBNAME
97d0: 09 3d 20 74 63 6c 39 74 6b 24 28 54 4b 5f 56 45  .= tcl9tk$(TK_VE
97e0: 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69  RSION)$(SUFX).li
97f0: 62 0a 21 65 6e 64 69 66 0a 54 4b 53 54 55 42 4c  b.!endif.TKSTUBL
9800: 49 42 4e 41 4d 45 09 3d 20 74 6b 73 74 75 62 24  IBNAME.= tkstub$
9810: 28 54 4b 5f 56 45 52 53 49 4f 4e 29 2e 6c 69 62  (TK_VERSION).lib
9820: 0a 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 4b  ..!if $(DOING_TK
9830: 29 0a 57 49 53 48 20 09 09 3d 20 24 28 4f 55 54  ).WISH ..= $(OUT
9840: 5f 44 49 52 29 5c 24 28 57 49 53 48 4e 41 4d 45  _DIR)\$(WISHNAME
9850: 29 0a 54 4b 53 54 55 42 4c 49 42 09 3d 20 24 28  ).TKSTUBLIB.= $(
9860: 4f 55 54 5f 44 49 52 29 5c 24 28 54 4b 53 54 55  OUT_DIR)\$(TKSTU
9870: 42 4c 49 42 4e 41 4d 45 29 0a 54 4b 49 4d 50 4c  BLIBNAME).TKIMPL
9880: 49 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c  IB.= $(OUT_DIR)\
9890: 24 28 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0a  $(TKIMPLIBNAME).
98a0: 54 4b 4c 49 42 09 09 3d 20 24 28 4f 55 54 5f 44  TKLIB..= $(OUT_D
98b0: 49 52 29 5c 24 28 54 4b 4c 49 42 4e 41 4d 45 29  IR)\$(TKLIBNAME)
98c0: 0a 54 4b 5f 49 4e 43 4c 55 44 45 53 20 20 20 20  .TK_INCLUDES    
98d0: 20 3d 20 2d 49 22 24 28 57 49 4e 5f 44 49 52 29   = -I"$(WIN_DIR)
98e0: 22 20 2d 49 22 24 28 47 45 4e 45 52 49 43 44 49  " -I"$(GENERICDI
98f0: 52 29 22 0a 54 4b 53 43 52 49 50 54 5a 49 50 20  R)".TKSCRIPTZIP 
9900: 20 20 20 20 3d 20 24 28 4f 55 54 5f 44 49 52 29      = $(OUT_DIR)
9910: 5c 24 28 54 4b 53 43 52 49 50 54 5a 49 50 4e 41  \$(TKSCRIPTZIPNA
9920: 4d 45 29 0a 0a 21 65 6c 73 65 20 23 20 65 66 66  ME)..!else # eff
9930: 65 63 74 69 76 65 6c 79 20 4e 45 45 44 5f 54 4b  ectively NEED_TK
9940: 0a 0a 21 69 66 20 24 28 54 4b 49 4e 53 54 41 4c  ..!if $(TKINSTAL
9950: 4c 29 20 23 20 42 75 69 6c 64 69 6e 67 20 61 67  L) # Building ag
9960: 61 69 6e 73 74 20 69 6e 73 74 61 6c 6c 65 64 20  ainst installed 
9970: 54 6b 0a 57 49 53 48 09 09 3d 20 24 28 5f 54 4b  Tk.WISH..= $(_TK
9980: 44 49 52 29 5c 62 69 6e 5c 24 28 57 49 53 48 4e  DIR)\bin\$(WISHN
9990: 41 4d 45 29 0a 54 4b 53 54 55 42 4c 49 42 09 3d  AME).TKSTUBLIB.=
99a0: 20 24 28 5f 54 4b 44 49 52 29 5c 6c 69 62 5c 24   $(_TKDIR)\lib\$
99b0: 28 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45 29 0a  (TKSTUBLIBNAME).
99c0: 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 4b  TKIMPLIB.= $(_TK
99d0: 44 49 52 29 5c 6c 69 62 5c 24 28 54 4b 49 4d 50  DIR)\lib\$(TKIMP
99e0: 4c 49 42 4e 41 4d 45 29 0a 23 20 57 68 65 6e 20  LIBNAME).# When 
99f0: 62 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73 69  building extensi
9a00: 6f 6e 73 2c 20 6d 61 79 20 62 65 20 6c 69 6e 6b  ons, may be link
9a10: 69 6e 67 20 61 67 61 69 6e 73 74 20 54 6b 20 74  ing against Tk t
9a20: 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 61 64 64  hat does not add
9a30: 0a 23 20 22 74 22 20 73 75 66 66 69 78 20 28 65  .# "t" suffix (e
9a40: 2e 67 2e 20 38 2e 35 20 6f 72 20 38 2e 37 29 2e  .g. 8.5 or 8.7).
9a50: 20 49 66 20 6c 69 62 20 6e 6f 74 20 66 6f 75 6e   If lib not foun
9a60: 64 20 63 68 65 63 6b 20 66 6f 72 20 74 68 61 74  d check for that
9a70: 20 70 6f 73 73 69 62 69 6c 69 74 79 2e 0a 21 69   possibility..!i
9a80: 66 20 21 65 78 69 73 74 28 22 24 28 54 4b 49 4d  f !exist("$(TKIM
9a90: 50 4c 49 42 29 22 29 0a 54 4b 49 4d 50 4c 49 42  PLIB)").TKIMPLIB
9aa0: 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45  NAME.= tk$(TK_VE
9ab0: 52 53 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29  RSION)$(SUFX:t=)
9ac0: 2e 6c 69 62 0a 54 4b 49 4d 50 4c 49 42 09 3d 20  .lib.TKIMPLIB.= 
9ad0: 24 28 5f 54 4b 44 49 52 29 5c 6c 69 62 5c 24 28  $(_TKDIR)\lib\$(
9ae0: 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0a 21 65  TKIMPLIBNAME).!e
9af0: 6e 64 69 66 0a 54 4b 5f 49 4e 43 4c 55 44 45 53  ndif.TK_INCLUDES
9b00: 20 20 20 20 20 3d 20 2d 49 22 24 28 5f 54 4b 44       = -I"$(_TKD
9b10: 49 52 29 5c 69 6e 63 6c 75 64 65 22 0a 54 4b 53  IR)\include".TKS
9b20: 43 52 49 50 54 5a 49 50 20 20 20 20 20 3d 20 24  CRIPTZIP     = $
9b30: 28 5f 54 4b 44 49 52 29 5c 6c 69 62 5c 24 28 54  (_TKDIR)\lib\$(T
9b40: 4b 53 43 52 49 50 54 5a 49 50 4e 41 4d 45 29 0a  KSCRIPTZIPNAME).
9b50: 0a 21 65 6c 73 65 20 23 20 42 75 69 6c 64 69 6e  .!else # Buildin
9b60: 67 20 61 67 61 69 6e 73 74 20 54 6b 20 73 6f 75  g against Tk sou
9b70: 72 63 65 73 0a 0a 57 49 53 48 09 09 3d 20 24 28  rces..WISH..= $(
9b80: 5f 54 4b 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  _TKDIR)\win\$(BU
9b90: 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 57 49 53  ILDDIRTOP)\$(WIS
9ba0: 48 4e 41 4d 45 29 0a 54 4b 53 54 55 42 4c 49 42  HNAME).TKSTUBLIB
9bb0: 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77 69 6e  .= $(_TKDIR)\win
9bc0: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c  \$(BUILDDIRTOP)\
9bd0: 24 28 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45 29  $(TKSTUBLIBNAME)
9be0: 0a 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54  .TKIMPLIB.= $(_T
9bf0: 4b 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c  KDIR)\win\$(BUIL
9c00: 44 44 49 52 54 4f 50 29 5c 24 28 54 4b 49 4d 50  DDIRTOP)\$(TKIMP
9c10: 4c 49 42 4e 41 4d 45 29 0a 23 20 57 68 65 6e 20  LIBNAME).# When 
9c20: 62 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73 69  building extensi
9c30: 6f 6e 73 2c 20 6d 61 79 20 62 65 20 6c 69 6e 6b  ons, may be link
9c40: 69 6e 67 20 61 67 61 69 6e 73 74 20 54 6b 20 74  ing against Tk t
9c50: 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 61 64 64  hat does not add
9c60: 0a 23 20 22 74 22 20 73 75 66 66 69 78 20 28 65  .# "t" suffix (e
9c70: 2e 67 2e 20 38 2e 35 20 6f 72 20 38 2e 37 29 2e  .g. 8.5 or 8.7).
9c80: 20 49 66 20 6c 69 62 20 6e 6f 74 20 66 6f 75 6e   If lib not foun
9c90: 64 20 63 68 65 63 6b 20 66 6f 72 20 74 68 61 74  d check for that
9ca0: 20 70 6f 73 73 69 62 69 6c 69 74 79 2e 0a 21 69   possibility..!i
9cb0: 66 20 21 65 78 69 73 74 28 22 24 28 54 4b 49 4d  f !exist("$(TKIM
9cc0: 50 4c 49 42 29 22 29 0a 54 4b 49 4d 50 4c 49 42  PLIB)").TKIMPLIB
9cd0: 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45  NAME.= tk$(TK_VE
9ce0: 52 53 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29  RSION)$(SUFX:t=)
9cf0: 2e 6c 69 62 0a 54 4b 49 4d 50 4c 49 42 09 3d 20  .lib.TKIMPLIB.= 
9d00: 24 28 5f 54 4b 44 49 52 29 5c 77 69 6e 5c 24 28  $(_TKDIR)\win\$(
9d10: 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 54  BUILDDIRTOP)\$(T
9d20: 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0a 21 65 6e  KIMPLIBNAME).!en
9d30: 64 69 66 0a 54 4b 5f 49 4e 43 4c 55 44 45 53 20  dif.TK_INCLUDES 
9d40: 20 20 20 20 3d 20 2d 49 22 24 28 5f 54 4b 44 49      = -I"$(_TKDI
9d50: 52 29 5c 67 65 6e 65 72 69 63 22 20 2d 49 22 24  R)\generic" -I"$
9d60: 28 5f 54 4b 44 49 52 29 5c 77 69 6e 22 20 2d 49  (_TKDIR)\win" -I
9d70: 22 24 28 5f 54 4b 44 49 52 29 5c 78 6c 69 62 22  "$(_TKDIR)\xlib"
9d80: 0a 54 4b 53 43 52 49 50 54 5a 49 50 20 20 20 20  .TKSCRIPTZIP    
9d90: 20 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77 69 6e   = $(_TKDIR)\win
9da0: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c  \$(BUILDDIRTOP)\
9db0: 24 28 54 4b 53 43 52 49 50 54 5a 49 50 4e 41 4d  $(TKSCRIPTZIPNAM
9dc0: 45 29 0a 0a 21 65 6e 64 69 66 20 23 20 54 4b 49  E)..!endif # TKI
9dd0: 4e 53 54 41 4c 4c 0a 0a 74 6b 6c 69 62 73 20 3d  NSTALL..tklibs =
9de0: 20 22 24 28 54 4b 53 54 55 42 4c 49 42 29 22 20   "$(TKSTUBLIB)" 
9df0: 22 24 28 54 4b 49 4d 50 4c 49 42 29 22 0a 0a 21  "$(TKIMPLIB)"..!
9e00: 65 6e 64 69 66 20 23 20 24 28 44 4f 49 4e 47 5f  endif # $(DOING_
9e10: 54 4b 29 0a 21 65 6e 64 69 66 20 23 20 24 28 44  TK).!endif # $(D
9e20: 4f 49 4e 47 5f 54 4b 29 20 7c 7c 20 24 28 4e 45  OING_TK) || $(NE
9e30: 45 44 5f 54 4b 29 0a 0a 23 20 56 61 72 69 6f 75  ED_TK)..# Variou
9e40: 73 20 6f 75 74 70 75 74 20 70 61 74 68 73 0a 50  s output paths.P
9e50: 52 4a 49 4d 50 4c 49 42 09 3d 20 24 28 4f 55 54  RJIMPLIB.= $(OUT
9e60: 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29  _DIR)\$(PROJECT)
9e70: 24 28 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58  $(VERSION)$(SUFX
9e80: 29 2e 6c 69 62 0a 50 52 4a 4c 49 42 4e 41 4d 45  ).lib.PRJLIBNAME
9e90: 38 09 3d 20 24 28 50 52 4f 4a 45 43 54 29 24 28  8.= $(PROJECT)$(
9ea0: 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e  VERSION)$(SUFX).
9eb0: 24 28 45 58 54 29 0a 50 52 4a 4c 49 42 4e 41 4d  $(EXT).PRJLIBNAM
9ec0: 45 39 09 3d 20 74 63 6c 39 24 28 50 52 4f 4a 45  E9.= tcl9$(PROJE
9ed0: 43 54 29 24 28 56 45 52 53 49 4f 4e 29 24 28 53  CT)$(VERSION)$(S
9ee0: 55 46 58 29 2e 24 28 45 58 54 29 0a 21 69 66 20  UFX).$(EXT).!if 
9ef0: 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53  $(TCL_MAJOR_VERS
9f00: 49 4f 4e 29 20 3d 3d 20 38 20 7c 7c 20 22 24 28  ION) == 8 || "$(
9f10: 54 43 4c 5f 42 55 49 4c 44 5f 46 4f 52 29 22 20  TCL_BUILD_FOR)" 
9f20: 3d 3d 20 22 38 22 0a 50 52 4a 4c 49 42 4e 41 4d  == "8".PRJLIBNAM
9f30: 45 09 3d 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45  E.= $(PRJLIBNAME
9f40: 38 29 0a 21 65 6c 73 65 0a 50 52 4a 4c 49 42 4e  8).!else.PRJLIBN
9f50: 41 4d 45 09 3d 20 24 28 50 52 4a 4c 49 42 4e 41  AME.= $(PRJLIBNA
9f60: 4d 45 39 29 0a 21 65 6e 64 69 66 0a 50 52 4a 4c  ME9).!endif.PRJL
9f70: 49 42 09 09 3d 20 24 28 4f 55 54 5f 44 49 52 29  IB..= $(OUT_DIR)
9f80: 5c 24 28 50 52 4a 4c 49 42 4e 41 4d 45 29 0a 0a  \$(PRJLIBNAME)..
9f90: 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f  !if $(TCL_MAJOR_
9fa0: 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 0a 50 52  VERSION) == 8.PR
9fb0: 4a 53 54 55 42 4c 49 42 4e 41 4d 45 09 3d 20 24  JSTUBLIBNAME.= $
9fc0: 28 53 54 55 42 50 52 45 46 49 58 29 24 28 56 45  (STUBPREFIX)$(VE
9fd0: 52 53 49 4f 4e 29 2e 6c 69 62 0a 21 65 6c 73 65  RSION).lib.!else
9fe0: 0a 50 52 4a 53 54 55 42 4c 49 42 4e 41 4d 45 09  .PRJSTUBLIBNAME.
9ff0: 3d 20 24 28 53 54 55 42 50 52 45 46 49 58 29 2e  = $(STUBPREFIX).
a000: 6c 69 62 0a 21 65 6e 64 69 66 0a 50 52 4a 53 54  lib.!endif.PRJST
a010: 55 42 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44 49  UBLIB.= $(OUT_DI
a020: 52 29 5c 24 28 50 52 4a 53 54 55 42 4c 49 42 4e  R)\$(PRJSTUBLIBN
a030: 41 4d 45 29 0a 0a 23 20 49 66 20 65 78 74 65 6e  AME)..# If exten
a040: 73 69 6f 6e 20 70 61 72 65 6e 74 20 6d 61 6b 65  sion parent make
a050: 66 69 6c 65 20 68 61 73 20 6e 6f 74 20 64 65 66  file has not def
a060: 69 6e 65 64 20 61 20 72 65 73 6f 75 72 63 65 20  ined a resource 
a070: 64 65 66 69 6e 69 74 69 6f 6e 20 66 69 6c 65 2c  definition file,
a080: 0a 23 20 77 65 20 77 69 6c 6c 20 67 65 6e 65 72  .# we will gener
a090: 61 74 65 20 6f 6e 65 20 66 72 6f 6d 20 73 74 61  ate one from sta
a0a0: 6e 64 61 72 64 20 74 65 6d 70 6c 61 74 65 2e 0a  ndard template..
a0b0: 21 69 66 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c  !if !$(DOING_TCL
a0c0: 29 20 26 26 20 21 24 28 44 4f 49 4e 47 5f 54 4b  ) && !$(DOING_TK
a0d0: 29 20 26 26 20 21 24 28 53 54 41 54 49 43 5f 42  ) && !$(STATIC_B
a0e0: 55 49 4c 44 29 0a 21 69 66 64 65 66 20 52 43 46  UILD).!ifdef RCF
a0f0: 49 4c 45 0a 52 45 53 46 49 4c 45 20 3d 20 24 28  ILE.RESFILE = $(
a100: 54 4d 50 5f 44 49 52 29 5c 24 28 52 43 46 49 4c  TMP_DIR)\$(RCFIL
a110: 45 3a 2e 72 63 3d 2e 72 65 73 29 0a 21 65 6c 73  E:.rc=.res).!els
a120: 65 0a 52 45 53 46 49 4c 45 20 3d 20 24 28 54 4d  e.RESFILE = $(TM
a130: 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54  P_DIR)\$(PROJECT
a140: 29 2e 72 65 73 0a 21 65 6e 64 69 66 0a 21 65 6e  ).res.!endif.!en
a150: 64 69 66 0a 0a 23 23 23 23 23 23 23 23 23 23 23  dif..###########
a160: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a170: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a180: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a190: 23 23 23 23 23 23 23 23 0a 23 20 31 31 2e 20 43  ########.# 11. C
a1a0: 6f 6e 73 74 72 75 63 74 20 74 68 65 20 70 61 74  onstruct the pat
a1b0: 68 73 20 66 6f 72 20 74 68 65 20 69 6e 73 74 61  hs for the insta
a1c0: 6c 6c 61 74 69 6f 6e 20 64 69 72 65 63 74 6f 72  llation director
a1d0: 69 65 73 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77  ies.# The follow
a1e0: 69 6e 67 20 6d 61 63 72 6f 73 20 67 65 74 20 64  ing macros get d
a1f0: 65 66 69 6e 65 64 20 69 6e 20 74 68 69 73 20 73  efined in this s
a200: 65 63 74 69 6f 6e 3a 0a 23 20 4c 49 42 5f 49 4e  ection:.# LIB_IN
a210: 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72  STALL_DIR - wher
a220: 65 20 6c 69 62 72 61 72 69 65 73 20 73 68 6f 75  e libraries shou
a230: 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a  ld be installed.
a240: 23 20 42 49 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49  # BIN_INSTALL_DI
a250: 52 20 2d 20 77 68 65 72 65 20 74 68 65 20 65 78  R - where the ex
a260: 65 63 75 74 61 62 6c 65 73 20 73 68 6f 75 6c 64  ecutables should
a270: 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23 20   be installed.# 
a280: 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20  DOC_INSTALL_DIR 
a290: 2d 20 77 68 65 72 65 20 64 6f 63 75 6d 65 6e 74  - where document
a2a0: 61 74 69 6f 6e 20 73 68 6f 75 6c 64 20 62 65 20  ation should be 
a2b0: 69 6e 73 74 61 6c 6c 65 64 0a 23 20 53 43 52 49  installed.# SCRI
a2c0: 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d  PT_INSTALL_DIR -
a2d0: 20 77 68 65 72 65 20 73 63 72 69 70 74 73 20 73   where scripts s
a2e0: 68 6f 75 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c  hould be install
a2f0: 65 64 0a 23 20 49 4e 43 4c 55 44 45 5f 49 4e 53  ed.# INCLUDE_INS
a300: 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72 65  TALL_DIR - where
a310: 20 43 20 69 6e 63 6c 75 64 65 20 66 69 6c 65 73   C include files
a320: 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 73 74 61   should be insta
a330: 6c 6c 65 64 0a 23 20 44 45 4d 4f 5f 49 4e 53 54  lled.# DEMO_INST
a340: 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72 65 20  ALL_DIR - where 
a350: 64 65 6d 6f 73 20 73 68 6f 75 6c 64 20 62 65 20  demos should be 
a360: 69 6e 73 74 61 6c 6c 65 64 0a 23 20 50 52 4a 5f  installed.# PRJ_
a370: 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68  INSTALL_DIR - wh
a380: 65 72 65 20 70 61 63 6b 61 67 65 20 77 69 6c 6c  ere package will
a390: 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 20 28 6e   be installed (n
a3a0: 6f 74 20 73 65 74 20 66 6f 72 20 54 63 6c 20 61  ot set for Tcl a
a3b0: 6e 64 20 54 6b 29 0a 0a 21 69 66 20 24 28 44 4f  nd Tk)..!if $(DO
a3c0: 49 4e 47 5f 54 43 4c 29 20 7c 7c 20 24 28 44 4f  ING_TCL) || $(DO
a3d0: 49 4e 47 5f 54 4b 29 0a 4c 49 42 5f 49 4e 53 54  ING_TK).LIB_INST
a3e0: 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 5f 49 4e  ALL_DIR..= $(_IN
a3f0: 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 0a 42 49  STALLDIR)\lib.BI
a400: 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d  N_INSTALL_DIR..=
a410: 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c   $(_INSTALLDIR)\
a420: 62 69 6e 0a 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f  bin.DOC_INSTALL_
a430: 44 49 52 09 09 3d 20 24 28 5f 49 4e 53 54 41 4c  DIR..= $(_INSTAL
a440: 4c 44 49 52 29 5c 64 6f 63 0a 21 69 66 20 24 28  LDIR)\doc.!if $(
a450: 44 4f 49 4e 47 5f 54 43 4c 29 0a 53 43 52 49 50  DOING_TCL).SCRIP
a460: 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20  T_INSTALL_DIR.= 
a470: 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c  $(_INSTALLDIR)\l
a480: 69 62 5c 24 28 50 52 4f 4a 45 43 54 29 24 28 54  ib\$(PROJECT)$(T
a490: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e  CL_MAJOR_VERSION
a4a0: 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45  ).$(TCL_MINOR_VE
a4b0: 52 53 49 4f 4e 29 0a 4d 4f 44 55 4c 45 5f 49 4e  RSION).MODULE_IN
a4c0: 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 5f 49  STALL_DIR.= $(_I
a4d0: 4e 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 5c 74  NSTALLDIR)\lib\t
a4e0: 63 6c 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45  cl$(TCL_MAJOR_VE
a4f0: 52 53 49 4f 4e 29 0a 21 65 6c 73 65 20 23 20 44  RSION).!else # D
a500: 4f 49 4e 47 5f 54 4b 0a 53 43 52 49 50 54 5f 49  OING_TK.SCRIPT_I
a510: 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 5f  NSTALL_DIR.= $(_
a520: 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 5c  INSTALLDIR)\lib\
a530: 24 28 50 52 4f 4a 45 43 54 29 24 28 54 4b 5f 4d  $(PROJECT)$(TK_M
a540: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28  AJOR_VERSION).$(
a550: 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e  TK_MINOR_VERSION
a560: 29 0a 21 65 6e 64 69 66 0a 44 45 4d 4f 5f 49 4e  ).!endif.DEMO_IN
a570: 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 53 43  STALL_DIR.= $(SC
a580: 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  RIPT_INSTALL_DIR
a590: 29 5c 64 65 6d 6f 73 0a 49 4e 43 4c 55 44 45 5f  )\demos.INCLUDE_
a5a0: 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28  INSTALL_DIR.= $(
a5b0: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63  _INSTALLDIR)\inc
a5c0: 6c 75 64 65 0a 0a 21 65 6c 73 65 20 23 20 65 78  lude..!else # ex
a5d0: 74 65 6e 73 69 6f 6e 20 6f 74 68 65 72 20 74 68  tension other th
a5e0: 61 6e 20 54 6b 0a 0a 50 52 4a 5f 49 4e 53 54 41  an Tk..PRJ_INSTA
a5f0: 4c 4c 5f 44 49 52 20 20 20 20 20 20 20 20 20 3d  LL_DIR         =
a600: 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c   $(_INSTALLDIR)\
a610: 24 28 50 52 4f 4a 45 43 54 29 24 28 44 4f 54 56  $(PROJECT)$(DOTV
a620: 45 52 53 49 4f 4e 29 0a 21 69 66 20 24 28 4d 55  ERSION).!if $(MU
a630: 4c 54 49 50 4c 41 54 46 4f 52 4d 5f 49 4e 53 54  LTIPLATFORM_INST
a640: 41 4c 4c 29 0a 4c 49 42 5f 49 4e 53 54 41 4c 4c  ALL).LIB_INSTALL
a650: 5f 44 49 52 09 09 3d 20 24 28 50 52 4a 5f 49 4e  _DIR..= $(PRJ_IN
a660: 53 54 41 4c 4c 5f 44 49 52 29 5c 24 28 50 4c 41  STALL_DIR)\$(PLA
a670: 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 29 0a  TFORM_IDENTIFY).
a680: 42 49 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09  BIN_INSTALL_DIR.
a690: 09 3d 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c  .= $(PRJ_INSTALL
a6a0: 5f 44 49 52 29 5c 24 28 50 4c 41 54 46 4f 52 4d  _DIR)\$(PLATFORM
a6b0: 5f 49 44 45 4e 54 49 46 59 29 0a 21 65 6c 73 65  _IDENTIFY).!else
a6c0: 0a 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  .LIB_INSTALL_DIR
a6d0: 09 09 3d 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c  ..= $(PRJ_INSTAL
a6e0: 4c 5f 44 49 52 29 0a 42 49 4e 5f 49 4e 53 54 41  L_DIR).BIN_INSTA
a6f0: 4c 4c 5f 44 49 52 09 09 3d 20 24 28 50 52 4a 5f  LL_DIR..= $(PRJ_
a700: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0a 21 65 6e  INSTALL_DIR).!en
a710: 64 69 66 0a 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f  dif.DOC_INSTALL_
a720: 44 49 52 09 09 3d 20 24 28 50 52 4a 5f 49 4e 53  DIR..= $(PRJ_INS
a730: 54 41 4c 4c 5f 44 49 52 29 0a 53 43 52 49 50 54  TALL_DIR).SCRIPT
a740: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24  _INSTALL_DIR.= $
a750: 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  (PRJ_INSTALL_DIR
a760: 29 0a 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44  ).DEMO_INSTALL_D
a770: 49 52 09 3d 20 24 28 50 52 4a 5f 49 4e 53 54 41  IR.= $(PRJ_INSTA
a780: 4c 4c 5f 44 49 52 29 5c 64 65 6d 6f 73 0a 49 4e  LL_DIR)\demos.IN
a790: 43 4c 55 44 45 5f 49 4e 53 54 41 4c 4c 5f 44 49  CLUDE_INSTALL_DI
a7a0: 52 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49  R.= $(_INSTALLDI
a7b0: 52 29 5c 2e 2e 5c 69 6e 63 6c 75 64 65 0a 0a 21  R)\..\include..!
a7c0: 65 6e 64 69 66 0a 0a 23 23 23 23 23 23 23 23 23  endif..#########
a7d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a7e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a7f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a800: 23 23 23 23 23 23 23 23 23 23 0a 23 20 31 32 2e  ##########.# 12.
a810: 20 53 65 74 20 75 70 20 61 63 74 75 61 6c 20 6f   Set up actual o
a820: 70 74 69 6f 6e 73 20 74 6f 20 62 65 20 70 61 73  ptions to be pas
a830: 73 65 64 20 74 6f 20 74 68 65 20 63 6f 6d 70 69  sed to the compi
a840: 6c 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72 0a 23  ler and linker.#
a850: 20 4e 6f 77 20 77 65 20 68 61 76 65 20 61 6c 6c   Now we have all
a860: 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e   the information
a870: 20 77 65 20 6e 65 65 64 2c 20 73 65 74 20 75 70   we need, set up
a880: 20 74 68 65 20 61 63 74 75 61 6c 20 66 6c 61 67   the actual flag
a890: 73 20 61 6e 64 0a 23 20 6f 70 74 69 6f 6e 73 20  s and.# options 
a8a0: 74 68 61 74 20 77 65 20 77 69 6c 6c 20 70 61 73  that we will pas
a8b0: 73 20 74 6f 20 74 68 65 20 63 6f 6d 70 69 6c 65  s to the compile
a8c0: 72 20 61 6e 64 20 6c 69 6e 6b 65 72 2e 20 54 68  r and linker. Th
a8d0: 65 20 6d 61 69 6e 0a 23 20 6d 61 6b 65 66 69 6c  e main.# makefil
a8e0: 65 20 73 68 6f 75 6c 64 20 75 73 65 20 74 68 65  e should use the
a8f0: 73 65 20 69 6e 20 63 6f 6d 62 69 6e 61 74 69 6f  se in combinatio
a900: 6e 20 77 69 74 68 20 77 68 61 74 65 76 65 72 20  n with whatever 
a910: 6f 74 68 65 72 20 66 6c 61 67 73 0a 23 20 61 6e  other flags.# an
a920: 64 20 73 77 69 74 63 68 65 73 20 61 72 65 20 73  d switches are s
a930: 70 65 63 69 66 69 63 20 74 6f 20 69 74 2e 0a 23  pecific to it..#
a940: 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d   The following m
a950: 61 63 72 6f 73 20 61 72 65 20 64 65 66 69 6e 65  acros are define
a960: 64 2c 20 6e 61 6d 65 73 20 61 72 65 20 66 6f 72  d, names are for
a970: 20 68 69 73 74 6f 72 69 63 61 6c 20 63 6f 6d 70   historical comp
a980: 61 74 69 62 69 6c 69 74 79 3a 0a 23 20 4f 50 54  atibility:.# OPT
a990: 44 45 46 49 4e 45 53 20 2d 20 2f 44 78 78 78 20  DEFINES - /Dxxx 
a9a0: 43 20 6d 61 63 72 6f 20 66 6c 61 67 73 20 62 61  C macro flags ba
a9b0: 73 65 64 20 6f 6e 20 75 73 65 72 2d 73 70 65 63  sed on user-spec
a9c0: 69 66 69 65 64 20 4f 50 54 53 0a 23 20 43 4f 4d  ified OPTS.# COM
a9d0: 50 49 4c 45 52 46 4c 41 47 53 20 2d 20 2f 44 78  PILERFLAGS - /Dx
a9e0: 78 78 20 43 20 6d 61 63 72 6f 20 66 6c 61 67 73  xx C macro flags
a9f0: 20 69 6e 64 65 70 65 6e 64 65 6e 74 20 6f 66 20   independent of 
aa00: 61 6e 79 20 63 6f 6e 66 69 67 75 72 61 74 69 6f  any configuratio
aa10: 6e 20 6f 70 74 69 6f 6e 73 0a 23 20 63 72 74 20  n options.# crt 
aa20: 2d 20 43 6f 6d 70 69 6c 65 72 20 73 77 69 74 63  - Compiler switc
aa30: 68 20 74 68 61 74 20 73 65 6c 65 63 74 73 20 74  h that selects t
aa40: 68 65 20 61 70 70 72 6f 70 72 69 61 74 65 20 43  he appropriate C
aa50: 20 72 75 6e 74 69 6d 65 0a 23 20 63 64 65 62 75   runtime.# cdebu
aa60: 67 20 2d 20 43 6f 6d 70 69 6c 65 72 20 73 77 69  g - Compiler swi
aa70: 74 63 68 65 73 20 72 65 6c 61 74 65 64 20 74 6f  tches related to
aa80: 20 64 65 62 75 67 20 41 4e 44 20 6f 70 74 69 6d   debug AND optim
aa90: 69 7a 61 74 69 6f 6e 73 0a 23 20 63 77 61 72 6e  izations.# cwarn
aaa0: 20 2d 20 43 6f 6d 70 69 6c 65 72 20 73 77 69 74   - Compiler swit
aab0: 63 68 65 73 20 74 68 61 74 20 73 65 74 20 77 61  ches that set wa
aac0: 72 6e 69 6e 67 20 6c 65 76 65 6c 73 0a 23 20 63  rning levels.# c
aad0: 66 6c 61 67 73 20 2d 20 63 6f 6d 70 6c 65 74 65  flags - complete
aae0: 20 63 6f 6d 70 69 6c 65 72 20 73 77 69 74 63 68   compiler switch
aaf0: 65 73 20 28 73 75 62 73 75 6d 65 73 20 63 64 65  es (subsumes cde
ab00: 62 75 67 20 61 6e 64 20 63 77 61 72 6e 29 0a 23  bug and cwarn).#
ab10: 20 6c 64 65 62 75 67 20 2d 20 4c 69 6e 6b 65 72   ldebug - Linker
ab20: 20 73 77 69 74 63 68 65 73 20 63 6f 6e 74 72 6f   switches contro
ab30: 6c 6c 69 6e 67 20 64 65 62 75 67 20 69 6e 66 6f  lling debug info
ab40: 72 6d 61 74 69 6f 6e 20 61 6e 64 20 6f 70 74 69  rmation and opti
ab50: 6d 69 7a 61 74 69 6f 6e 0a 23 20 6c 66 6c 61 67  mization.# lflag
ab60: 73 20 2d 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e  s - complete lin
ab70: 6b 65 72 20 73 77 69 74 63 68 65 73 20 28 73 75  ker switches (su
ab80: 62 73 75 6d 65 73 20 6c 64 65 62 75 67 29 20 65  bsumes ldebug) e
ab90: 78 63 65 70 74 20 73 75 62 73 79 73 74 65 6d 20  xcept subsystem 
aba0: 74 79 70 65 0a 23 20 64 6c 6c 6c 66 6c 61 67 73  type.# dlllflags
abb0: 20 2d 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e 6b   - complete link
abc0: 65 72 20 73 77 69 74 63 68 65 73 20 74 6f 20 62  er switches to b
abd0: 75 69 6c 64 20 44 4c 4c 73 20 28 73 75 62 73 75  uild DLLs (subsu
abe0: 6d 65 73 20 6c 66 6c 61 67 73 29 0a 23 20 63 6f  mes lflags).# co
abf0: 6e 6c 66 6c 61 67 73 20 2d 20 63 6f 6d 70 6c 65  nlflags - comple
ac00: 74 65 20 6c 69 6e 6b 65 72 20 73 77 69 74 63 68  te linker switch
ac10: 65 73 20 66 6f 72 20 63 6f 6e 73 6f 6c 65 20 70  es for console p
ac20: 72 6f 67 72 61 6d 20 28 73 75 62 73 75 6d 65 73  rogram (subsumes
ac30: 20 6c 66 6c 61 67 73 29 0a 23 20 67 75 69 6c 66   lflags).# guilf
ac40: 6c 61 67 73 20 2d 20 63 6f 6d 70 6c 65 74 65 20  lags - complete 
ac50: 6c 69 6e 6b 65 72 20 73 77 69 74 63 68 65 73 20  linker switches 
ac60: 66 6f 72 20 47 55 49 20 70 72 6f 67 72 61 6d 20  for GUI program 
ac70: 28 73 75 62 73 75 6d 65 73 20 6c 66 6c 61 67 73  (subsumes lflags
ac80: 29 0a 23 20 62 61 73 65 6c 69 62 73 20 2d 20 6d  ).# baselibs - m
ac90: 69 6e 69 6d 75 6d 20 57 69 6e 64 6f 77 73 20 6c  inimum Windows l
aca0: 69 62 72 61 72 69 65 73 20 72 65 71 75 69 72 65  ibraries require
acb0: 64 2e 20 50 61 72 65 6e 74 20 6d 61 6b 65 66 69  d. Parent makefi
acc0: 6c 65 20 63 61 6e 0a 23 20 20 20 20 64 65 66 69  le can.#    defi
acd0: 6e 65 20 50 52 4a 5f 4c 49 42 53 20 62 65 66 6f  ne PRJ_LIBS befo
ace0: 72 65 20 69 6e 63 6c 75 64 69 6e 67 20 72 75 6c  re including rul
acf0: 65 73 2e 72 63 20 69 66 20 61 64 64 69 74 69 6f  es.rc if additio
ad00: 6e 61 6c 20 6c 69 62 73 20 61 72 65 20 6e 65 65  nal libs are nee
ad10: 64 65 64 0a 0a 4f 50 54 44 45 46 49 4e 45 53 09  ded..OPTDEFINES.
ad20: 3d 20 2f 44 53 54 44 43 5f 48 45 41 44 45 52 53  = /DSTDC_HEADERS
ad30: 20 2f 44 55 53 45 5f 4e 4d 41 4b 45 3d 31 0a 21   /DUSE_NMAKE=1.!
ad40: 69 66 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20  if $(VCVERSION) 
ad50: 3e 20 31 36 30 30 0a 4f 50 54 44 45 46 49 4e 45  > 1600.OPTDEFINE
ad60: 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53  S.= $(OPTDEFINES
ad70: 29 20 2f 44 48 41 56 45 5f 53 54 44 49 4e 54 5f  ) /DHAVE_STDINT_
ad80: 48 3d 31 0a 21 65 6c 73 65 0a 4f 50 54 44 45 46  H=1.!else.OPTDEF
ad90: 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49  INES.= $(OPTDEFI
ada0: 4e 45 53 29 20 2f 44 4d 50 5f 4e 4f 5f 53 54 44  NES) /DMP_NO_STD
adb0: 49 4e 54 3d 31 0a 21 65 6e 64 69 66 0a 21 69 66  INT=1.!endif.!if
adc0: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 3d   $(VCVERSION) >=
add0: 20 31 38 30 30 0a 4f 50 54 44 45 46 49 4e 45 53   1800.OPTDEFINES
ade0: 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29  .= $(OPTDEFINES)
adf0: 20 2f 44 48 41 56 45 5f 49 4e 54 54 59 50 45 53   /DHAVE_INTTYPES
ae00: 5f 48 3d 31 20 2f 44 48 41 56 45 5f 53 54 44 42  _H=1 /DHAVE_STDB
ae10: 4f 4f 4c 5f 48 3d 31 0a 21 65 6e 64 69 66 0a 0a  OOL_H=1.!endif..
ae20: 21 69 66 20 24 28 54 43 4c 5f 4d 45 4d 5f 44 45  !if $(TCL_MEM_DE
ae30: 42 55 47 29 0a 4f 50 54 44 45 46 49 4e 45 53 09  BUG).OPTDEFINES.
ae40: 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20  = $(OPTDEFINES) 
ae50: 2f 44 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 0a  /DTCL_MEM_DEBUG.
ae60: 21 65 6e 64 69 66 0a 21 69 66 20 24 28 54 43 4c  !endif.!if $(TCL
ae70: 5f 43 4f 4d 50 49 4c 45 5f 44 45 42 55 47 29 0a  _COMPILE_DEBUG).
ae80: 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f  OPTDEFINES.= $(O
ae90: 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c  PTDEFINES) /DTCL
aea0: 5f 43 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 2f  _COMPILE_DEBUG /
aeb0: 44 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 53 54 41  DTCL_COMPILE_STA
aec0: 54 53 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28  TS.!endif.!if $(
aed0: 54 43 4c 5f 54 48 52 45 41 44 53 29 20 26 26 20  TCL_THREADS) && 
aee0: 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3c  $(TCL_VERSION) <
aef0: 20 38 37 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d   87.OPTDEFINES.=
af00: 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f   $(OPTDEFINES) /
af10: 44 54 43 4c 5f 54 48 52 45 41 44 53 3d 31 0a 21  DTCL_THREADS=1.!
af20: 69 66 20 24 28 55 53 45 5f 54 48 52 45 41 44 5f  if $(USE_THREAD_
af30: 41 4c 4c 4f 43 29 20 26 26 20 24 28 54 43 4c 5f  ALLOC) && $(TCL_
af40: 56 45 52 53 49 4f 4e 29 20 3c 20 38 37 0a 4f 50  VERSION) < 87.OP
af50: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54  TDEFINES.= $(OPT
af60: 44 45 46 49 4e 45 53 29 20 2f 44 55 53 45 5f 54  DEFINES) /DUSE_T
af70: 48 52 45 41 44 5f 41 4c 4c 4f 43 3d 31 0a 21 65  HREAD_ALLOC=1.!e
af80: 6e 64 69 66 0a 21 65 6e 64 69 66 0a 21 69 66 20  ndif.!endif.!if 
af90: 24 28 53 54 41 54 49 43 5f 42 55 49 4c 44 29 0a  $(STATIC_BUILD).
afa0: 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f  OPTDEFINES.= $(O
afb0: 50 54 44 45 46 49 4e 45 53 29 20 2f 44 53 54 41  PTDEFINES) /DSTA
afc0: 54 49 43 5f 42 55 49 4c 44 0a 21 65 6c 73 65 69  TIC_BUILD.!elsei
afd0: 66 20 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29  f $(TCL_VERSION)
afe0: 20 3e 20 38 36 0a 4f 50 54 44 45 46 49 4e 45 53   > 86.OPTDEFINES
aff0: 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29  .= $(OPTDEFINES)
b000: 20 2f 44 54 43 4c 5f 57 49 54 48 5f 45 58 54 45   /DTCL_WITH_EXTE
b010: 52 4e 41 4c 5f 54 4f 4d 4d 41 54 48 0a 21 69 66  RNAL_TOMMATH.!if
b020: 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d   "$(MACHINE)" ==
b030: 20 22 41 4d 44 36 34 22 20 7c 7c 20 22 24 28 4d   "AMD64" || "$(M
b040: 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 52 4d  ACHINE)" == "ARM
b050: 36 34 22 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d  64".OPTDEFINES.=
b060: 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f   $(OPTDEFINES) /
b070: 44 4d 50 5f 36 34 42 49 54 0a 21 65 6e 64 69 66  DMP_64BIT.!endif
b080: 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28 54 43  .!endif.!if $(TC
b090: 4c 5f 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 29  L_NO_DEPRECATED)
b0a0: 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28  .OPTDEFINES.= $(
b0b0: 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43  OPTDEFINES) /DTC
b0c0: 4c 5f 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 0a  L_NO_DEPRECATED.
b0d0: 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 55 53  !endif..!if $(US
b0e0: 45 5f 53 54 55 42 53 29 0a 23 20 4e 6f 74 65 20  E_STUBS).# Note 
b0f0: 77 65 20 64 6f 20 6e 6f 74 20 64 65 66 69 6e 65  we do not define
b100: 20 55 53 45 5f 54 43 4c 5f 53 54 55 42 53 20 65   USE_TCL_STUBS e
b110: 76 65 6e 20 77 68 65 6e 20 62 75 69 6c 64 69 6e  ven when buildin
b120: 67 20 74 6b 20 73 69 6e 63 65 20 73 6f 6d 65 0a  g tk since some.
b130: 23 20 74 65 73 74 20 74 61 72 67 65 74 73 20 69  # test targets i
b140: 6e 20 74 6b 20 64 6f 20 6e 6f 74 20 75 73 65 20  n tk do not use 
b150: 73 74 75 62 73 0a 21 69 66 20 21 24 28 44 4f 49  stubs.!if !$(DOI
b160: 4e 47 5f 54 43 4c 29 0a 55 53 45 5f 53 54 55 42  NG_TCL).USE_STUB
b170: 53 5f 44 45 46 53 20 20 3d 20 2f 44 55 53 45 5f  S_DEFS  = /DUSE_
b180: 54 43 4c 5f 53 54 55 42 53 20 2f 44 55 53 45 5f  TCL_STUBS /DUSE_
b190: 54 43 4c 4f 4f 5f 53 54 55 42 53 0a 21 69 66 20  TCLOO_STUBS.!if 
b1a0: 24 28 4e 45 45 44 5f 54 4b 29 0a 55 53 45 5f 53  $(NEED_TK).USE_S
b1b0: 54 55 42 53 5f 44 45 46 53 20 20 3d 20 24 28 55  TUBS_DEFS  = $(U
b1c0: 53 45 5f 53 54 55 42 53 5f 44 45 46 53 29 20 2f  SE_STUBS_DEFS) /
b1d0: 44 55 53 45 5f 54 4b 5f 53 54 55 42 53 0a 21 65  DUSE_TK_STUBS.!e
b1e0: 6e 64 69 66 0a 21 65 6e 64 69 66 0a 21 65 6e 64  ndif.!endif.!end
b1f0: 69 66 20 23 20 55 53 45 5f 53 54 55 42 53 0a 0a  if # USE_STUBS..
b200: 21 69 66 20 21 24 28 44 45 42 55 47 29 0a 4f 50  !if !$(DEBUG).OP
b210: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54  TDEFINES.= $(OPT
b220: 44 45 46 49 4e 45 53 29 20 2f 44 4e 44 45 42 55  DEFINES) /DNDEBU
b230: 47 0a 21 69 66 20 24 28 4f 50 54 49 4d 49 5a 49  G.!if $(OPTIMIZI
b240: 4e 47 29 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d  NG).OPTDEFINES.=
b250: 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f   $(OPTDEFINES) /
b260: 44 54 43 4c 5f 43 46 47 5f 4f 50 54 49 4d 49 5a  DTCL_CFG_OPTIMIZ
b270: 45 44 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  ED.!endif.!endif
b280: 0a 21 69 66 20 24 28 50 52 4f 46 49 4c 45 29 0a  .!if $(PROFILE).
b290: 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f  OPTDEFINES.= $(O
b2a0: 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c  PTDEFINES) /DTCL
b2b0: 5f 43 46 47 5f 50 52 4f 46 49 4c 45 44 0a 21 65  _CFG_PROFILED.!e
b2c0: 6e 64 69 66 0a 21 69 66 20 22 24 28 4d 41 43 48  ndif.!if "$(MACH
b2d0: 49 4e 45 29 22 20 3d 3d 20 22 41 4d 44 36 34 22  INE)" == "AMD64"
b2e0: 20 7c 7c 20 22 24 28 4d 41 43 48 49 4e 45 29 22   || "$(MACHINE)"
b2f0: 20 3d 3d 20 22 41 52 4d 36 34 22 0a 4f 50 54 44   == "ARM64".OPTD
b300: 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45  EFINES.= $(OPTDE
b310: 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 43 46 47  FINES) /DTCL_CFG
b320: 5f 44 4f 36 34 42 49 54 0a 21 65 6e 64 69 66 0a  _DO64BIT.!endif.
b330: 21 69 66 20 24 28 56 43 56 45 52 53 49 4f 4e 29  !if $(VCVERSION)
b340: 20 3c 20 31 33 30 30 0a 4f 50 54 44 45 46 49 4e   < 1300.OPTDEFIN
b350: 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45  ES.= $(OPTDEFINE
b360: 53 29 20 2f 44 4e 4f 5f 53 54 52 54 4f 49 36 34  S) /DNO_STRTOI64
b370: 3d 31 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 24  =1.!endif..!if $
b380: 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  (TCL_MAJOR_VERSI
b390: 4f 4e 29 20 3d 3d 20 38 0a 21 69 66 20 22 24 28  ON) == 8.!if "$(
b3a0: 5f 55 53 45 5f 36 34 42 49 54 5f 54 49 4d 45 5f  _USE_64BIT_TIME_
b3b0: 54 29 22 20 3d 3d 20 22 31 22 0a 4f 50 54 44 45  T)" == "1".OPTDE
b3c0: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46  FINES.= $(OPTDEF
b3d0: 49 4e 45 53 29 20 2f 44 5f 55 53 45 5f 36 34 42  INES) /D_USE_64B
b3e0: 49 54 5f 54 49 4d 45 5f 54 3d 31 0a 21 65 6e 64  IT_TIME_T=1.!end
b3f0: 69 66 0a 0a 23 20 5f 41 54 4c 5f 58 50 5f 54 41  if..# _ATL_XP_TA
b400: 52 47 45 54 49 4e 47 20 2d 20 4e 65 77 65 72 20  RGETING - Newer 
b410: 53 44 4b 27 73 20 6e 65 65 64 20 74 68 69 73 20  SDK's need this 
b420: 74 6f 20 62 75 69 6c 64 20 66 6f 72 20 58 50 0a  to build for XP.
b430: 43 4f 4d 50 49 4c 45 52 46 4c 41 47 53 20 20 3d  COMPILERFLAGS  =
b440: 20 2f 44 5f 41 54 4c 5f 58 50 5f 54 41 52 47 45   /D_ATL_XP_TARGE
b450: 54 49 4e 47 0a 21 65 6e 64 69 66 0a 21 69 66 20  TING.!endif.!if 
b460: 22 24 28 54 43 4c 5f 42 55 49 4c 44 5f 46 4f 52  "$(TCL_BUILD_FOR
b470: 29 22 20 3d 3d 20 22 38 22 0a 4f 50 54 44 45 46  )" == "8".OPTDEF
b480: 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49  INES.= $(OPTDEFI
b490: 4e 45 53 29 20 2f 44 54 43 4c 5f 4d 41 4a 4f 52  NES) /DTCL_MAJOR
b4a0: 5f 56 45 52 53 49 4f 4e 3d 38 0a 21 65 6e 64 69  _VERSION=8.!endi
b4b0: 66 0a 0a 23 20 4c 69 6b 65 20 74 68 65 20 54 45  f..# Like the TE
b4c0: 41 20 73 79 73 74 65 6d 20 6f 6e 6c 79 20 73 65  A system only se
b4d0: 74 20 74 68 69 73 20 6e 6f 6e 20 65 6d 70 74 79  t this non empty
b4e0: 20 66 6f 72 20 6e 6f 6e 2d 54 6b 20 65 78 74 65   for non-Tk exte
b4f0: 6e 73 69 6f 6e 73 0a 23 20 4e 6f 74 65 3a 20 73  nsions.# Note: s
b500: 6f 6d 65 20 65 78 74 65 6e 73 69 6f 6e 73 20 75  ome extensions u
b510: 73 65 20 50 41 43 4b 41 47 45 5f 4e 41 4d 45 20  se PACKAGE_NAME 
b520: 61 6e 64 20 6f 74 68 65 72 73 20 75 73 65 20 50  and others use P
b530: 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 0a 23  ACKAGE_TCLNAME.#
b540: 20 73 6f 20 77 65 20 70 61 73 73 20 62 6f 74 68   so we pass both
b550: 0a 21 69 66 20 21 24 28 44 4f 49 4e 47 5f 54 43  .!if !$(DOING_TC
b560: 4c 29 20 26 26 20 21 24 28 44 4f 49 4e 47 5f 54  L) && !$(DOING_T
b570: 4b 29 0a 50 4b 47 4e 41 4d 45 46 4c 41 47 53 20  K).PKGNAMEFLAGS 
b580: 3d 20 2f 44 50 41 43 4b 41 47 45 5f 4e 41 4d 45  = /DPACKAGE_NAME
b590: 3d 22 5c 22 24 28 50 52 4a 5f 50 41 43 4b 41 47  ="\"$(PRJ_PACKAG
b5a0: 45 5f 54 43 4c 4e 41 4d 45 29 5c 22 22 20 5c 0a  E_TCLNAME)\"" \.
b5b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f                 /
b5c0: 44 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45  DPACKAGE_TCLNAME
b5d0: 3d 22 5c 22 24 28 50 52 4a 5f 50 41 43 4b 41 47  ="\"$(PRJ_PACKAG
b5e0: 45 5f 54 43 4c 4e 41 4d 45 29 5c 22 22 20 5c 0a  E_TCLNAME)\"" \.
b5f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f                 /
b600: 44 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e  DPACKAGE_VERSION
b610: 3d 22 5c 22 24 28 44 4f 54 56 45 52 53 49 4f 4e  ="\"$(DOTVERSION
b620: 29 5c 22 22 20 5c 0a 20 20 20 20 20 20 20 20 20  )\"" \.         
b630: 20 20 20 20 20 20 2f 44 4d 4f 44 55 4c 45 5f 53        /DMODULE_S
b640: 43 4f 50 45 3d 65 78 74 65 72 6e 0a 21 65 6e 64  COPE=extern.!end
b650: 69 66 0a 0a 23 20 63 72 74 20 70 69 63 6b 73 20  if..# crt picks 
b660: 74 68 65 20 43 20 72 75 6e 20 74 69 6d 65 20 62  the C run time b
b670: 61 73 65 64 20 6f 6e 20 73 65 6c 65 63 74 65 64  ased on selected
b680: 20 4f 50 54 53 0a 21 69 66 20 24 28 4d 53 56 43   OPTS.!if $(MSVC
b690: 52 54 29 0a 21 69 66 20 24 28 44 45 42 55 47 29  RT).!if $(DEBUG)
b6a0: 20 26 26 20 21 24 28 55 4e 43 48 45 43 4b 45 44   && !$(UNCHECKED
b6b0: 29 0a 63 72 74 20 3d 20 2d 4d 44 64 0a 21 65 6c  ).crt = -MDd.!el
b6c0: 73 65 0a 63 72 74 20 3d 20 2d 4d 44 0a 21 65 6e  se.crt = -MD.!en
b6d0: 64 69 66 0a 21 65 6c 73 65 0a 21 69 66 20 24 28  dif.!else.!if $(
b6e0: 44 45 42 55 47 29 20 26 26 20 21 24 28 55 4e 43  DEBUG) && !$(UNC
b6f0: 48 45 43 4b 45 44 29 0a 63 72 74 20 3d 20 2d 4d  HECKED).crt = -M
b700: 54 64 0a 21 65 6c 73 65 0a 63 72 74 20 3d 20 2d  Td.!else.crt = -
b710: 4d 54 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  MT.!endif.!endif
b720: 0a 0a 23 20 63 64 65 62 75 67 20 69 6e 63 6c 75  ..# cdebug inclu
b730: 64 65 73 20 63 6f 6d 70 69 6c 65 72 20 6f 70 74  des compiler opt
b740: 69 6f 6e 73 20 66 6f 72 20 64 65 62 75 67 67 69  ions for debuggi
b750: 6e 67 20 61 73 20 77 65 6c 6c 20 61 73 20 6f 70  ng as well as op
b760: 74 69 6d 69 7a 61 74 69 6f 6e 2e 0a 21 69 66 20  timization..!if 
b770: 24 28 44 45 42 55 47 29 0a 0a 23 20 49 6e 20 64  $(DEBUG)..# In d
b780: 65 62 75 67 67 69 6e 67 20 6d 6f 64 65 2c 20 6f  ebugging mode, o
b790: 70 74 69 6d 69 7a 61 74 69 6f 6e 73 20 6e 65 65  ptimizations nee
b7a0: 64 20 74 6f 20 62 65 20 64 69 73 61 62 6c 65 64  d to be disabled
b7b0: 0a 63 64 65 62 75 67 20 3d 20 2d 5a 69 20 2d 4f  .cdebug = -Zi -O
b7c0: 64 20 24 28 44 45 42 55 47 46 4c 41 47 53 29 0a  d $(DEBUGFLAGS).
b7d0: 0a 21 65 6c 73 65 0a 0a 63 64 65 62 75 67 20 3d  .!else..cdebug =
b7e0: 20 24 28 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53   $(OPTIMIZATIONS
b7f0: 29 0a 21 69 66 20 24 28 53 59 4d 42 4f 4c 53 29  ).!if $(SYMBOLS)
b800: 0a 63 64 65 62 75 67 20 3d 20 24 28 63 64 65 62  .cdebug = $(cdeb
b810: 75 67 29 20 2d 5a 69 0a 21 65 6e 64 69 66 0a 0a  ug) -Zi.!endif..
b820: 21 65 6e 64 69 66 20 23 20 24 28 44 45 42 55 47  !endif # $(DEBUG
b830: 29 0a 0a 23 20 63 77 61 72 6e 20 69 6e 63 6c 75  )..# cwarn inclu
b840: 64 65 73 20 64 65 66 61 75 6c 74 20 77 61 72 6e  des default warn
b850: 69 6e 67 20 6c 65 76 65 6c 73 2c 20 61 6c 73 6f  ing levels, also
b860: 20 43 34 30 39 30 20 28 62 75 67 67 79 29 20 61   C4090 (buggy) a
b870: 6e 64 20 43 34 31 34 36 20 69 73 20 75 73 65 6c  nd C4146 is usel
b880: 65 73 73 2e 0a 63 77 61 72 6e 20 3d 20 24 28 57  ess..cwarn = $(W
b890: 41 52 4e 49 4e 47 53 29 20 2d 77 64 34 30 39 30  ARNINGS) -wd4090
b8a0: 20 2d 77 64 34 31 34 36 0a 0a 21 69 66 20 22 24   -wd4146..!if "$
b8b0: 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41  (MACHINE)" == "A
b8c0: 4d 44 36 34 22 20 7c 7c 20 22 24 28 4d 41 43 48  MD64" || "$(MACH
b8d0: 49 4e 45 29 22 20 3d 3d 20 22 41 52 4d 36 34 22  INE)" == "ARM64"
b8e0: 0a 23 20 44 69 73 61 62 6c 65 20 70 6f 69 6e 74  .# Disable point
b8f0: 65 72 3c 2d 3e 69 6e 74 20 77 61 72 6e 69 6e 67  er<->int warning
b900: 73 20 72 65 6c 61 74 65 64 20 74 6f 20 63 61 73  s related to cas
b910: 74 20 62 65 74 77 65 65 6e 20 64 69 66 66 65 72  t between differ
b920: 65 6e 74 20 73 69 7a 65 73 0a 23 20 54 68 65 72  ent sizes.# Ther
b930: 65 20 61 72 65 20 61 20 67 61 64 7a 69 6c 6c 69  e are a gadzilli
b940: 6f 6e 20 6f 66 20 74 68 65 73 65 20 64 75 65 20  on of these due 
b950: 74 6f 20 75 73 65 20 6f 66 20 43 6c 69 65 6e 74  to use of Client
b960: 44 61 74 61 20 61 6e 64 0a 23 20 63 6c 75 74 74  Data and.# clutt
b970: 65 72 20 75 70 20 63 6f 6d 70 69 6c 65 72 0a 23  er up compiler.#
b980: 20 6f 75 74 70 75 74 20 69 6e 63 72 65 61 73 69   output increasi
b990: 6e 67 20 63 68 61 6e 63 65 20 6f 66 20 61 20 72  ng chance of a r
b9a0: 65 61 6c 20 77 61 72 6e 69 6e 67 20 67 65 74 74  eal warning gett
b9b0: 69 6e 67 20 6c 6f 73 74 2e 20 53 6f 20 64 69 73  ing lost. So dis
b9c0: 61 62 6c 65 20 74 68 65 6d 2e 0a 23 20 45 76 65  able them..# Eve
b9d0: 6e 74 75 61 6c 6c 79 20 73 6f 6d 65 20 64 61 79  ntually some day
b9e0: 2c 20 54 63 6c 20 77 69 6c 6c 20 62 65 20 36 34  , Tcl will be 64
b9f0: 2d 62 69 74 20 63 6c 65 61 6e 2e 0a 63 77 61 72  -bit clean..cwar
ba00: 6e 20 3d 20 24 28 63 77 61 72 6e 29 20 2d 77 64  n = $(cwarn) -wd
ba10: 34 33 31 31 20 2d 77 64 34 33 31 32 0a 21 65 6e  4311 -wd4312.!en
ba20: 64 69 66 0a 0a 23 23 23 20 43 6f 6d 6d 6f 6e 20  dif..### Common 
ba30: 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e 73  compiler options
ba40: 20 74 68 61 74 20 61 72 65 20 61 72 63 68 69 74   that are archit
ba50: 65 63 74 75 72 65 20 73 70 65 63 69 66 69 63 0a  ecture specific.
ba60: 21 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22  !if "$(MACHINE)"
ba70: 20 3d 3d 20 22 41 52 4d 22 0a 63 61 72 63 68 20   == "ARM".carch 
ba80: 3d 20 2f 44 5f 41 52 4d 5f 57 49 4e 41 50 49 5f  = /D_ARM_WINAPI_
ba90: 50 41 52 54 49 54 49 4f 4e 5f 44 45 53 4b 54 4f  PARTITION_DESKTO
baa0: 50 5f 53 44 4b 5f 41 56 41 49 4c 41 42 4c 45 0a  P_SDK_AVAILABLE.
bab0: 21 65 6c 73 65 0a 63 61 72 63 68 20 3d 0a 21 65  !else.carch =.!e
bac0: 6e 64 69 66 0a 0a 23 20 63 70 75 69 64 20 69 73  ndif..# cpuid is
bad0: 20 6f 6e 6c 79 20 61 76 61 69 6c 61 62 6c 65 20   only available 
bae0: 6f 6e 20 69 6e 74 65 6c 20 6d 61 63 68 69 6e 65  on intel machine
baf0: 73 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e 45  s.!if "$(MACHINE
bb00: 29 22 20 3d 3d 20 22 49 58 38 36 22 20 7c 7c 20  )" == "IX86" || 
bb10: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
bb20: 22 41 4d 44 36 34 22 0a 63 61 72 63 68 20 3d 20  "AMD64".carch = 
bb30: 24 28 63 61 72 63 68 29 20 2f 44 48 41 56 45 5f  $(carch) /DHAVE_
bb40: 43 50 55 49 44 3d 31 0a 21 65 6e 64 69 66 0a 0a  CPUID=1.!endif..
bb50: 21 69 66 20 24 28 44 45 42 55 47 29 0a 23 20 54  !if $(DEBUG).# T
bb60: 75 72 6e 20 77 61 72 6e 69 6e 67 73 20 69 6e 74  urn warnings int
bb70: 6f 20 65 72 72 6f 72 73 0a 63 77 61 72 6e 20 3d  o errors.cwarn =
bb80: 20 24 28 63 77 61 72 6e 29 20 2d 57 58 0a 21 65   $(cwarn) -WX.!e
bb90: 6e 64 69 66 0a 0a 49 4e 43 4c 55 44 45 53 20 3d  ndif..INCLUDES =
bba0: 20 24 28 54 43 4c 5f 49 4e 43 4c 55 44 45 53 29   $(TCL_INCLUDES)
bbb0: 20 24 28 54 4b 5f 49 4e 43 4c 55 44 45 53 29 20   $(TK_INCLUDES) 
bbc0: 24 28 50 52 4a 5f 49 4e 43 4c 55 44 45 53 29 0a  $(PRJ_INCLUDES).
bbd0: 21 69 66 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c  !if !$(DOING_TCL
bbe0: 29 20 26 26 20 21 24 28 44 4f 49 4e 47 5f 54 4b  ) && !$(DOING_TK
bbf0: 29 0a 49 4e 43 4c 55 44 45 53 20 3d 20 24 28 49  ).INCLUDES = $(I
bc00: 4e 43 4c 55 44 45 53 29 20 2d 49 22 24 28 47 45  NCLUDES) -I"$(GE
bc10: 4e 45 52 49 43 44 49 52 29 22 20 2d 49 22 24 28  NERICDIR)" -I"$(
bc20: 57 49 4e 5f 44 49 52 29 22 20 2d 49 22 24 28 43  WIN_DIR)" -I"$(C
bc30: 4f 4d 50 41 54 44 49 52 29 22 0a 21 65 6e 64 69  OMPATDIR)".!endi
bc40: 66 0a 0a 23 20 54 68 65 73 65 20 66 6c 61 67 73  f..# These flags
bc50: 20 61 72 65 20 64 65 66 69 6e 65 64 20 72 6f 75   are defined rou
bc60: 67 68 6c 79 20 69 6e 20 74 68 65 20 6f 72 64 65  ghly in the orde
bc70: 72 20 6f 66 20 74 68 65 20 70 72 65 2d 72 65 66  r of the pre-ref
bc80: 6f 72 6d 0a 23 20 72 75 6c 65 73 2e 76 63 2f 6d  orm.# rules.vc/m
bc90: 61 6b 65 66 69 6c 65 2e 76 63 20 74 6f 20 68 65  akefile.vc to he
bca0: 6c 70 20 76 69 73 75 61 6c 6c 79 20 63 6f 6d 70  lp visually comp
bcb0: 61 72 65 20 74 68 61 74 20 74 68 65 20 70 72 65  are that the pre
bcc0: 2d 20 61 6e 64 0a 23 20 70 6f 73 74 2d 72 65 66  - and.# post-ref
bcd0: 6f 72 6d 20 62 75 69 6c 64 20 6c 6f 67 73 0a 0a  orm build logs..
bce0: 23 20 63 66 6c 61 67 73 20 63 6f 6e 74 61 69 6e  # cflags contain
bcf0: 73 20 67 65 6e 65 72 69 63 20 66 6c 61 67 73 20  s generic flags 
bd00: 75 73 65 64 20 66 6f 72 20 62 75 69 6c 64 69 6e  used for buildin
bd10: 67 20 70 72 61 63 74 69 63 61 6c 6c 79 20 61 6c  g practically al
bd20: 6c 20 6f 62 6a 65 63 74 20 66 69 6c 65 73 0a 63  l object files.c
bd30: 66 6c 61 67 73 20 3d 20 2d 6e 6f 6c 6f 67 6f 20  flags = -nologo 
bd40: 2d 63 20 24 28 43 4f 4d 50 49 4c 45 52 46 4c 41  -c $(COMPILERFLA
bd50: 47 53 29 20 24 28 63 61 72 63 68 29 20 24 28 63  GS) $(carch) $(c
bd60: 77 61 72 6e 29 20 2d 46 70 24 28 54 4d 50 5f 44  warn) -Fp$(TMP_D
bd70: 49 52 29 5e 5c 20 24 28 63 64 65 62 75 67 29 0a  IR)^\ $(cdebug).
bd80: 0a 23 20 61 70 70 63 66 6c 61 67 73 20 63 6f 6e  .# appcflags con
bd90: 74 61 69 6e 73 20 24 28 63 66 6c 61 67 73 29 20  tains $(cflags) 
bda0: 61 6e 64 20 66 6c 61 67 73 20 66 6f 72 20 62 75  and flags for bu
bdb0: 69 6c 64 69 6e 67 20 74 68 65 20 61 70 70 6c 69  ilding the appli
bdc0: 63 61 74 69 6f 6e 0a 23 20 6f 62 6a 65 63 74 20  cation.# object 
bdd0: 66 69 6c 65 73 20 28 65 2e 67 2e 20 74 63 6c 73  files (e.g. tcls
bde0: 68 2c 20 6f 72 20 77 69 73 68 29 20 70 6b 67 63  h, or wish) pkgc
bdf0: 66 6c 61 67 73 20 63 6f 6e 74 61 69 6e 73 20 24  flags contains $
be00: 28 63 66 6c 61 67 73 29 20 70 6c 75 73 0a 23 20  (cflags) plus.# 
be10: 66 6c 61 67 73 20 75 73 65 64 20 66 6f 72 20 62  flags used for b
be20: 75 69 6c 64 69 6e 67 20 73 68 61 72 65 64 20 6f  uilding shared o
be30: 62 6a 65 63 74 20 66 69 6c 65 73 20 54 68 65 20  bject files The 
be40: 74 77 6f 20 64 69 66 66 65 72 20 69 6e 20 74 68  two differ in th
be50: 65 0a 23 20 42 55 49 4c 44 5f 24 28 50 52 4f 4a  e.# BUILD_$(PROJ
be60: 45 43 54 29 20 6d 61 63 72 6f 20 77 68 69 63 68  ECT) macro which
be70: 20 73 68 6f 75 6c 64 20 62 65 20 64 65 66 69 6e   should be defin
be80: 65 64 20 6f 6e 6c 79 20 66 6f 72 20 74 68 65 20  ed only for the 
be90: 73 68 61 72 65 64 0a 23 20 6c 69 62 72 61 72 79  shared.# library
bea0: 20 2a 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e   *implementation
beb0: 2a 20 61 6e 64 20 6e 6f 74 20 66 6f 72 20 69 74  * and not for it
bec0: 73 20 63 61 6c 6c 65 72 20 69 6e 74 65 72 66 61  s caller interfa
bed0: 63 65 0a 0a 61 70 70 63 66 6c 61 67 73 5f 6e 6f  ce..appcflags_no
bee0: 73 74 75 62 73 20 3d 20 24 28 63 66 6c 61 67 73  stubs = $(cflags
bef0: 29 20 24 28 63 72 74 29 20 24 28 49 4e 43 4c 55  ) $(crt) $(INCLU
bf00: 44 45 53 29 20 24 28 54 43 4c 5f 44 45 46 49 4e  DES) $(TCL_DEFIN
bf10: 45 53 29 20 24 28 50 52 4a 5f 44 45 46 49 4e 45  ES) $(PRJ_DEFINE
bf20: 53 29 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29  S) $(OPTDEFINES)
bf30: 0a 61 70 70 63 66 6c 61 67 73 20 3d 20 24 28 61  .appcflags = $(a
bf40: 70 70 63 66 6c 61 67 73 5f 6e 6f 73 74 75 62 73  ppcflags_nostubs
bf50: 29 20 24 28 55 53 45 5f 53 54 55 42 53 5f 44 45  ) $(USE_STUBS_DE
bf60: 46 53 29 0a 70 6b 67 63 66 6c 61 67 73 20 3d 20  FS).pkgcflags = 
bf70: 24 28 61 70 70 63 66 6c 61 67 73 29 20 24 28 50  $(appcflags) $(P
bf80: 4b 47 4e 41 4d 45 46 4c 41 47 53 29 20 2f 44 42  KGNAMEFLAGS) /DB
bf90: 55 49 4c 44 5f 24 28 50 52 4f 4a 45 43 54 29 0a  UILD_$(PROJECT).
bfa0: 70 6b 67 63 66 6c 61 67 73 5f 6e 6f 73 74 75 62  pkgcflags_nostub
bfb0: 73 20 3d 20 24 28 61 70 70 63 66 6c 61 67 73 5f  s = $(appcflags_
bfc0: 6e 6f 73 74 75 62 73 29 20 24 28 50 4b 47 4e 41  nostubs) $(PKGNA
bfd0: 4d 45 46 4c 41 47 53 29 20 2f 44 42 55 49 4c 44  MEFLAGS) /DBUILD
bfe0: 5f 24 28 50 52 4f 4a 45 43 54 29 0a 0a 23 20 73  _$(PROJECT)..# s
bff0: 74 75 62 73 63 66 6c 61 67 73 20 63 6f 6e 74 61  tubscflags conta
c000: 69 6e 73 20 24 28 63 66 6c 61 67 73 29 20 70 6c  ins $(cflags) pl
c010: 75 73 20 66 6c 61 67 73 20 75 73 65 64 20 66 6f  us flags used fo
c020: 72 20 62 75 69 6c 64 69 6e 67 20 61 20 73 74 75  r building a stu
c030: 62 73 0a 23 20 6c 69 62 72 61 72 79 20 66 6f 72  bs.# library for
c040: 20 74 68 65 20 70 61 63 6b 61 67 65 2e 20 20 4e   the package.  N
c050: 6f 74 65 3a 20 2f 44 53 54 41 54 49 43 5f 42 55  ote: /DSTATIC_BU
c060: 49 4c 44 20 69 73 20 64 65 66 69 6e 65 64 20 69  ILD is defined i
c070: 6e 0a 23 20 24 28 4f 50 54 44 45 46 49 4e 45 53  n.# $(OPTDEFINES
c080: 29 20 6f 6e 6c 79 20 69 66 20 74 68 65 20 4f 50  ) only if the OP
c090: 54 53 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e  TS configuration
c0a0: 20 69 6e 64 69 63 61 74 65 73 20 61 20 73 74 61   indicates a sta
c0b0: 74 69 63 0a 23 20 6c 69 62 72 61 72 79 2e 20 48  tic.# library. H
c0c0: 6f 77 65 76 65 72 20 74 68 65 20 73 74 75 62 73  owever the stubs
c0d0: 20 6c 69 62 72 61 72 79 20 69 73 20 41 4c 57 41   library is ALWA
c0e0: 59 53 20 73 74 61 74 69 63 20 68 65 6e 63 65 20  YS static hence 
c0f0: 69 6e 63 6c 75 64 65 64 0a 23 20 68 65 72 65 20  included.# here 
c100: 69 72 72 65 73 70 65 63 74 69 76 65 20 6f 66 20  irrespective of 
c110: 74 68 65 20 4f 50 54 53 20 73 65 74 74 69 6e 67  the OPTS setting
c120: 2e 0a 23 0a 23 20 54 42 44 20 2d 20 74 63 6c 76  ..#.# TBD - tclv
c130: 66 73 20 68 61 73 20 61 20 63 6f 6d 6d 65 6e 74  fs has a comment
c140: 20 74 68 61 74 20 73 74 75 62 73 20 6c 69 62 73   that stubs libs
c150: 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 20 63   should not be c
c160: 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 2d 47 4c  ompiled with -GL
c170: 0a 23 20 77 69 74 68 6f 75 74 20 73 74 61 74 69  .# without stati
c180: 6e 67 20 77 68 79 2e 20 54 63 6c 20 69 74 73 65  ng why. Tcl itse
c190: 6c 66 20 63 6f 6d 70 69 6c 65 64 20 73 74 75 62  lf compiled stub
c1a0: 73 20 6c 69 62 73 20 77 69 74 68 20 74 68 69 73  s libs with this
c1b0: 20 66 6c 61 67 2e 0a 23 20 73 6f 20 77 65 20 64   flag..# so we d
c1c0: 6f 20 6e 6f 74 20 72 65 6d 6f 76 65 20 69 74 20  o not remove it 
c1d0: 66 72 6f 6d 20 63 66 6c 61 67 73 2e 20 2d 47 4c  from cflags. -GL
c1e0: 20 6d 61 79 20 70 72 65 76 65 6e 74 20 65 78 74   may prevent ext
c1f0: 65 6e 73 69 6f 6e 73 0a 23 20 63 6f 6d 70 69 6c  ensions.# compil
c200: 65 64 20 77 69 74 68 20 6f 6e 65 20 56 43 20 76  ed with one VC v
c210: 65 72 73 69 6f 6e 20 74 6f 20 66 61 69 6c 20 74  ersion to fail t
c220: 6f 20 6c 69 6e 6b 20 61 67 61 69 6e 73 74 20 73  o link against s
c230: 74 75 62 73 20 6c 69 62 72 61 72 79 0a 23 20 63  tubs library.# c
c240: 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 61 6e 6f  ompiled with ano
c250: 74 68 65 72 20 56 43 20 76 65 72 73 69 6f 6e 2e  ther VC version.
c260: 20 43 68 65 63 6b 20 66 6f 72 20 74 68 69 73 20   Check for this 
c270: 61 6e 64 20 66 69 78 20 61 63 63 6f 72 64 69 6e  and fix accordin
c280: 67 6c 79 2e 0a 73 74 75 62 73 63 66 6c 61 67 73  gly..stubscflags
c290: 20 3d 20 24 28 63 66 6c 61 67 73 29 20 24 28 50   = $(cflags) $(P
c2a0: 4b 47 4e 41 4d 45 46 4c 41 47 53 29 20 24 28 50  KGNAMEFLAGS) $(P
c2b0: 52 4a 5f 44 45 46 49 4e 45 53 29 20 24 28 4f 50  RJ_DEFINES) $(OP
c2c0: 54 44 45 46 49 4e 45 53 29 20 2f 5a 6c 20 2f 47  TDEFINES) /Zl /G
c2d0: 4c 2d 20 2f 44 53 54 41 54 49 43 5f 42 55 49 4c  L- /DSTATIC_BUIL
c2e0: 44 20 24 28 49 4e 43 4c 55 44 45 53 29 20 24 28  D $(INCLUDES) $(
c2f0: 55 53 45 5f 53 54 55 42 53 5f 44 45 46 53 29 0a  USE_STUBS_DEFS).
c300: 0a 23 20 4c 69 6e 6b 20 66 6c 61 67 73 0a 0a 21  .# Link flags..!
c310: 69 66 20 24 28 44 45 42 55 47 29 0a 6c 64 65 62  if $(DEBUG).ldeb
c320: 75 67 09 3d 20 2d 64 65 62 75 67 20 2d 64 65 62  ug.= -debug -deb
c330: 75 67 74 79 70 65 3a 63 76 0a 21 65 6c 73 65 0a  ugtype:cv.!else.
c340: 6c 64 65 62 75 67 09 3d 20 2d 72 65 6c 65 61 73  ldebug.= -releas
c350: 65 20 2d 6f 70 74 3a 72 65 66 20 2d 6f 70 74 3a  e -opt:ref -opt:
c360: 69 63 66 2c 33 0a 21 69 66 20 24 28 53 59 4d 42  icf,3.!if $(SYMB
c370: 4f 4c 53 29 0a 6c 64 65 62 75 67 09 3d 20 24 28  OLS).ldebug.= $(
c380: 6c 64 65 62 75 67 29 20 2d 64 65 62 75 67 20 2d  ldebug) -debug -
c390: 64 65 62 75 67 74 79 70 65 3a 63 76 0a 21 65 6e  debugtype:cv.!en
c3a0: 64 69 66 0a 21 65 6e 64 69 66 0a 0a 23 20 4e 6f  dif.!endif..# No
c3b0: 74 65 3a 20 50 72 6f 66 69 6c 69 6e 67 20 69 73  te: Profiling is
c3c0: 20 63 75 72 72 65 6e 74 6c 79 20 6f 6e 6c 79 20   currently only 
c3d0: 70 6f 73 73 69 62 6c 65 20 77 69 74 68 20 74 68  possible with th
c3e0: 65 20 56 69 73 75 61 6c 20 53 74 75 64 69 6f 20  e Visual Studio 
c3f0: 45 6e 74 65 72 70 72 69 73 65 0a 21 69 66 20 24  Enterprise.!if $
c400: 28 50 52 4f 46 49 4c 45 29 0a 6c 64 65 62 75 67  (PROFILE).ldebug
c410: 3d 20 24 28 6c 64 65 62 75 67 29 20 2d 70 72 6f  = $(ldebug) -pro
c420: 66 69 6c 65 0a 21 65 6e 64 69 66 0a 0a 23 23 23  file.!endif..###
c430: 20 44 65 63 6c 61 72 61 74 69 6f 6e 73 20 63 6f   Declarations co
c440: 6d 6d 6f 6e 20 74 6f 20 61 6c 6c 20 6c 69 6e 6b  mmon to all link
c450: 65 72 20 76 65 72 73 69 6f 6e 73 0a 6c 66 6c 61  er versions.lfla
c460: 67 73 09 3d 20 2d 6e 6f 6c 6f 67 6f 20 2d 6d 61  gs.= -nologo -ma
c470: 63 68 69 6e 65 3a 24 28 4d 41 43 48 49 4e 45 29  chine:$(MACHINE)
c480: 20 24 28 4c 49 4e 4b 45 52 46 4c 41 47 53 29 20   $(LINKERFLAGS) 
c490: 24 28 6c 64 65 62 75 67 29 0a 0a 21 69 66 20 24  $(ldebug)..!if $
c4a0: 28 4d 53 56 43 52 54 29 20 26 26 20 21 28 24 28  (MSVCRT) && !($(
c4b0: 44 45 42 55 47 29 20 26 26 20 21 24 28 55 4e 43  DEBUG) && !$(UNC
c4c0: 48 45 43 4b 45 44 29 29 20 26 26 20 24 28 56 43  HECKED)) && $(VC
c4d0: 56 45 52 53 49 4f 4e 29 20 3e 3d 20 31 39 30 30  VERSION) >= 1900
c4e0: 0a 6c 66 6c 61 67 73 09 3d 20 24 28 6c 66 6c 61  .lflags.= $(lfla
c4f0: 67 73 29 20 2d 6e 6f 64 65 66 61 75 6c 74 6c 69  gs) -nodefaultli
c500: 62 3a 6c 69 62 75 63 72 74 2e 6c 69 62 0a 21 65  b:libucrt.lib.!e
c510: 6e 64 69 66 0a 0a 64 6c 6c 6c 66 6c 61 67 73 20  ndif..dlllflags 
c520: 3d 20 24 28 6c 66 6c 61 67 73 29 20 2d 64 6c 6c  = $(lflags) -dll
c530: 0a 63 6f 6e 6c 66 6c 61 67 73 20 3d 20 24 28 6c  .conlflags = $(l
c540: 66 6c 61 67 73 29 20 2d 73 75 62 73 79 73 74 65  flags) -subsyste
c550: 6d 3a 63 6f 6e 73 6f 6c 65 0a 67 75 69 6c 66 6c  m:console.guilfl
c560: 61 67 73 20 3d 20 24 28 6c 66 6c 61 67 73 29 20  ags = $(lflags) 
c570: 2d 73 75 62 73 79 73 74 65 6d 3a 77 69 6e 64 6f  -subsystem:windo
c580: 77 73 0a 0a 23 20 4c 69 62 72 61 72 69 65 73 20  ws..# Libraries 
c590: 74 68 61 74 20 61 72 65 20 72 65 71 75 69 72 65  that are require
c5a0: 64 20 66 6f 72 20 65 76 65 72 79 20 69 6d 61 67  d for every imag
c5b0: 65 2e 0a 23 20 45 78 74 65 6e 73 69 6f 6e 73 20  e..# Extensions 
c5c0: 73 68 6f 75 6c 64 20 64 65 66 69 6e 65 20 61 6e  should define an
c5d0: 79 20 61 64 64 69 74 69 6f 6e 61 6c 20 6c 69 62  y additional lib
c5e0: 72 61 72 69 65 73 20 77 69 74 68 20 24 28 50 52  raries with $(PR
c5f0: 4a 5f 4c 49 42 53 29 0a 77 69 6e 6c 69 62 73 20  J_LIBS).winlibs 
c600: 20 20 3d 20 6b 65 72 6e 65 6c 33 32 2e 6c 69 62    = kernel32.lib
c610: 20 61 64 76 61 70 69 33 32 2e 6c 69 62 0a 0a 21   advapi32.lib..!
c620: 69 66 20 24 28 4e 45 45 44 5f 54 4b 29 0a 77 69  if $(NEED_TK).wi
c630: 6e 6c 69 62 73 20 3d 20 24 28 77 69 6e 6c 69 62  nlibs = $(winlib
c640: 73 29 20 67 64 69 33 32 2e 6c 69 62 20 75 73 65  s) gdi32.lib use
c650: 72 33 32 2e 6c 69 62 20 75 78 74 68 65 6d 65 2e  r32.lib uxtheme.
c660: 6c 69 62 0a 21 65 6e 64 69 66 0a 0a 23 20 41 76  lib.!endif..# Av
c670: 6f 69 64 20 27 75 6e 72 65 73 6f 6c 76 65 64 20  oid 'unresolved 
c680: 65 78 74 65 72 6e 61 6c 20 73 79 6d 62 6f 6c 20  external symbol 
c690: 5f 5f 73 65 63 75 72 69 74 79 5f 63 6f 6f 6b 69  __security_cooki
c6a0: 65 27 20 65 72 72 6f 72 73 2e 0a 23 20 63 2e 66  e' errors..# c.f
c6b0: 2e 20 68 74 74 70 3a 2f 2f 73 75 70 70 6f 72 74  . http://support
c6c0: 2e 6d 69 63 72 6f 73 6f 66 74 2e 63 6f 6d 2f 3f  .microsoft.com/?
c6d0: 69 64 3d 38 39 34 35 37 33 0a 21 69 66 20 22 24  id=894573.!if "$
c6e0: 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41  (MACHINE)" == "A
c6f0: 4d 44 36 34 22 0a 21 69 66 20 24 28 56 43 56 45  MD64".!if $(VCVE
c700: 52 53 49 4f 4e 29 20 3e 20 31 33 39 39 20 26 26  RSION) > 1399 &&
c710: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3c 20   $(VCVERSION) < 
c720: 31 35 30 30 0a 77 69 6e 6c 69 62 73 20 20 20 3d  1500.winlibs   =
c730: 20 24 28 77 69 6e 6c 69 62 73 29 20 62 75 66 66   $(winlibs) buff
c740: 65 72 6f 76 65 72 66 6c 6f 77 55 2e 6c 69 62 0a  eroverflowU.lib.
c750: 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a 62  !endif.!endif..b
c760: 61 73 65 6c 69 62 73 20 3d 20 24 28 77 69 6e 6c  aselibs = $(winl
c770: 69 62 73 29 20 24 28 50 52 4a 5f 4c 49 42 53 29  ibs) $(PRJ_LIBS)
c780: 0a 0a 21 69 66 20 24 28 4d 53 56 43 52 54 29 20  ..!if $(MSVCRT) 
c790: 26 26 20 21 28 24 28 44 45 42 55 47 29 20 26 26  && !($(DEBUG) &&
c7a0: 20 21 24 28 55 4e 43 48 45 43 4b 45 44 29 29 20   !$(UNCHECKED)) 
c7b0: 26 26 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20  && $(VCVERSION) 
c7c0: 3e 3d 20 31 39 30 30 0a 62 61 73 65 6c 69 62 73  >= 1900.baselibs
c7d0: 20 20 20 3d 20 24 28 62 61 73 65 6c 69 62 73 29     = $(baselibs)
c7e0: 20 75 63 72 74 2e 6c 69 62 0a 21 65 6e 64 69 66   ucrt.lib.!endif
c7f0: 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ..##############
c800: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c810: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c820: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c830: 23 23 0a 23 20 31 33 2e 20 44 65 66 69 6e 65 20  ##.# 13. Define 
c840: 73 74 61 6e 64 61 72 64 20 63 6f 6d 6d 61 6e 64  standard command
c850: 73 2c 20 63 6f 6d 6d 6f 6e 20 6d 61 6b 65 20 74  s, common make t
c860: 61 72 67 65 74 73 20 61 6e 64 20 69 6d 70 6c 69  argets and impli
c870: 63 69 74 20 72 75 6c 65 73 0a 0a 43 43 50 4b 47  cit rules..CCPKG
c880: 43 4d 44 20 3d 20 24 28 63 63 33 32 29 20 24 28  CMD = $(cc32) $(
c890: 70 6b 67 63 66 6c 61 67 73 29 20 2d 46 6f 24 28  pkgcflags) -Fo$(
c8a0: 54 4d 50 5f 44 49 52 29 5e 5c 0a 43 43 41 50 50  TMP_DIR)^\.CCAPP
c8b0: 43 4d 44 20 3d 20 24 28 63 63 33 32 29 20 24 28  CMD = $(cc32) $(
c8c0: 61 70 70 63 66 6c 61 67 73 29 20 2d 46 6f 24 28  appcflags) -Fo$(
c8d0: 54 4d 50 5f 44 49 52 29 5e 5c 0a 43 43 53 54 55  TMP_DIR)^\.CCSTU
c8e0: 42 53 43 4d 44 20 3d 20 24 28 63 63 33 32 29 20  BSCMD = $(cc32) 
c8f0: 24 28 73 74 75 62 73 63 66 6c 61 67 73 29 20 2d  $(stubscflags) -
c900: 46 6f 24 28 54 4d 50 5f 44 49 52 29 5e 5c 0a 0a  Fo$(TMP_DIR)^\..
c910: 4c 49 42 43 4d 44 20 3d 20 24 28 6c 69 62 33 32  LIBCMD = $(lib32
c920: 29 20 2d 6e 6f 6c 6f 67 6f 20 24 28 4c 49 4e 4b  ) -nologo $(LINK
c930: 45 52 46 4c 41 47 53 29 20 2d 6f 75 74 3a 24 40  ERFLAGS) -out:$@
c940: 0a 44 4c 4c 43 4d 44 20 3d 20 24 28 6c 69 6e 6b  .DLLCMD = $(link
c950: 33 32 29 20 24 28 64 6c 6c 6c 66 6c 61 67 73 29  32) $(dlllflags)
c960: 20 2d 6f 75 74 3a 24 40 20 24 28 62 61 73 65 6c   -out:$@ $(basel
c970: 69 62 73 29 20 24 28 74 63 6c 6c 69 62 73 29 20  ibs) $(tcllibs) 
c980: 24 28 74 6b 6c 69 62 73 29 0a 0a 43 4f 4e 45 58  $(tklibs)..CONEX
c990: 45 43 4d 44 20 3d 20 24 28 6c 69 6e 6b 33 32 29  ECMD = $(link32)
c9a0: 20 24 28 63 6f 6e 6c 66 6c 61 67 73 29 20 2d 6f   $(conlflags) -o
c9b0: 75 74 3a 24 40 20 24 28 62 61 73 65 6c 69 62 73  ut:$@ $(baselibs
c9c0: 29 20 24 28 74 63 6c 6c 69 62 73 29 20 24 28 74  ) $(tcllibs) $(t
c9d0: 6b 6c 69 62 73 29 0a 47 55 49 45 58 45 43 4d 44  klibs).GUIEXECMD
c9e0: 20 3d 20 24 28 6c 69 6e 6b 33 32 29 20 24 28 67   = $(link32) $(g
c9f0: 75 69 6c 66 6c 61 67 73 29 20 2d 6f 75 74 3a 24  uilflags) -out:$
ca00: 40 20 24 28 62 61 73 65 6c 69 62 73 29 20 24 28  @ $(baselibs) $(
ca10: 74 63 6c 6c 69 62 73 29 20 24 28 74 6b 6c 69 62  tcllibs) $(tklib
ca20: 73 29 0a 52 45 53 43 4d 44 20 20 3d 20 24 28 72  s).RESCMD  = $(r
ca30: 63 33 32 29 20 2d 66 6f 20 24 40 20 2d 72 20 2d  c32) -fo $@ -r -
ca40: 69 20 22 24 28 47 45 4e 45 52 49 43 44 49 52 29  i "$(GENERICDIR)
ca50: 22 20 2d 69 20 22 24 28 54 4d 50 5f 44 49 52 29  " -i "$(TMP_DIR)
ca60: 22 20 5c 0a 09 20 20 20 20 24 28 54 43 4c 5f 49  " \..    $(TCL_I
ca70: 4e 43 4c 55 44 45 53 29 20 5c 0a 09 20 20 20 20  NCLUDES) \..    
ca80: 2f 44 44 45 42 55 47 3d 24 28 44 45 42 55 47 29  /DDEBUG=$(DEBUG)
ca90: 20 2d 64 20 55 4e 43 48 45 43 4b 45 44 3d 24 28   -d UNCHECKED=$(
caa0: 55 4e 43 48 45 43 4b 45 44 29 20 5c 0a 09 20 20  UNCHECKED) \..  
cab0: 20 20 2f 44 43 4f 4d 4d 41 56 45 52 53 49 4f 4e    /DCOMMAVERSION
cac0: 3d 24 28 52 43 43 4f 4d 4d 41 56 45 52 53 49 4f  =$(RCCOMMAVERSIO
cad0: 4e 29 20 5c 0a 09 20 20 20 20 2f 44 44 4f 54 56  N) \..    /DDOTV
cae0: 45 52 53 49 4f 4e 3d 5c 22 24 28 44 4f 54 56 45  ERSION=\"$(DOTVE
caf0: 52 53 49 4f 4e 29 5c 22 20 5c 0a 09 20 20 20 20  RSION)\" \..    
cb00: 2f 44 56 45 52 53 49 4f 4e 3d 5c 22 24 28 56 45  /DVERSION=\"$(VE
cb10: 52 53 49 4f 4e 29 5c 22 20 5c 0a 09 20 20 20 20  RSION)\" \..    
cb20: 2f 44 53 55 46 58 3d 5c 22 24 28 53 55 46 58 29  /DSUFX=\"$(SUFX)
cb30: 5c 22 20 5c 0a 09 20 20 20 20 2f 44 50 52 4f 4a  \" \..    /DPROJ
cb40: 45 43 54 3d 5c 22 24 28 50 52 4f 4a 45 43 54 29  ECT=\"$(PROJECT)
cb50: 5c 22 20 5c 0a 09 20 20 20 20 2f 44 50 52 4a 4c  \" \..    /DPRJL
cb60: 49 42 4e 41 4d 45 3d 5c 22 24 28 50 52 4a 4c 49  IBNAME=\"$(PRJLI
cb70: 42 4e 41 4d 45 29 5c 22 0a 0a 21 69 66 6e 64 65  BNAME)\"..!ifnde
cb80: 66 20 44 45 46 41 55 4c 54 5f 42 55 49 4c 44 5f  f DEFAULT_BUILD_
cb90: 54 41 52 47 45 54 0a 44 45 46 41 55 4c 54 5f 42  TARGET.DEFAULT_B
cba0: 55 49 4c 44 5f 54 41 52 47 45 54 20 3d 20 24 28  UILD_TARGET = $(
cbb0: 50 52 4f 4a 45 43 54 29 0a 21 65 6e 64 69 66 0a  PROJECT).!endif.
cbc0: 0a 64 65 66 61 75 6c 74 2d 74 61 72 67 65 74 3a  .default-target:
cbd0: 20 24 28 44 45 46 41 55 4c 54 5f 42 55 49 4c 44   $(DEFAULT_BUILD
cbe0: 5f 54 41 52 47 45 54 29 0a 0a 21 69 66 20 24 28  _TARGET)..!if $(
cbf0: 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d 5f 49 4e  MULTIPLATFORM_IN
cc00: 53 54 41 4c 4c 29 0a 64 65 66 61 75 6c 74 2d 70  STALL).default-p
cc10: 6b 67 69 6e 64 65 78 3a 0a 09 40 65 63 68 6f 20  kgindex:..@echo 
cc20: 69 66 20 7b 5b 70 61 63 6b 61 67 65 20 76 73 61  if {[package vsa
cc30: 74 69 73 66 69 65 73 20 5b 70 61 63 6b 61 67 65  tisfies [package
cc40: 20 70 72 6f 76 69 64 65 20 54 63 6c 5d 20 39 2e   provide Tcl] 9.
cc50: 30 2d 5d 7d 20 7b 20 3e 20 24 28 4f 55 54 5f 44  0-]} { > $(OUT_D
cc60: 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c  IR)\pkgIndex.tcl
cc70: 0a 09 40 65 63 68 6f 20 70 61 63 6b 61 67 65 20  ..@echo package 
cc80: 69 66 6e 65 65 64 65 64 20 24 28 50 52 4a 5f 50  ifneeded $(PRJ_P
cc90: 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 20  ACKAGE_TCLNAME) 
cca0: 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 20 5c 0a  $(DOTVERSION) \.
ccb0: 09 20 20 20 20 5b 6c 69 73 74 20 6c 6f 61 64 20  .    [list load 
ccc0: 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 24 64 69 72  [file join $$dir
ccd0: 20 24 28 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e   $(PLATFORM_IDEN
cce0: 54 49 46 59 29 20 24 28 50 52 4a 4c 49 42 4e 41  TIFY) $(PRJLIBNA
ccf0: 4d 45 39 29 5d 5d 20 3e 3e 20 24 28 4f 55 54 5f  ME9)]] >> $(OUT_
cd00: 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63  DIR)\pkgIndex.tc
cd10: 6c 0a 09 40 65 63 68 6f 20 7d 20 65 6c 73 65 20  l..@echo } else 
cd20: 7b 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c  { >> $(OUT_DIR)\
cd30: 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 09 40 65  pkgIndex.tcl..@e
cd40: 63 68 6f 20 70 61 63 6b 61 67 65 20 69 66 6e 65  cho package ifne
cd50: 65 64 65 64 20 24 28 50 52 4a 5f 50 41 43 4b 41  eded $(PRJ_PACKA
cd60: 47 45 5f 54 43 4c 4e 41 4d 45 29 20 24 28 44 4f  GE_TCLNAME) $(DO
cd70: 54 56 45 52 53 49 4f 4e 29 20 5c 0a 09 20 20 20  TVERSION) \..   
cd80: 20 5b 6c 69 73 74 20 6c 6f 61 64 20 5b 66 69 6c   [list load [fil
cd90: 65 20 6a 6f 69 6e 20 24 24 64 69 72 20 24 28 50  e join $$dir $(P
cda0: 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59  LATFORM_IDENTIFY
cdb0: 29 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 38 29  ) $(PRJLIBNAME8)
cdc0: 5d 5d 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52 29  ]] >> $(OUT_DIR)
cdd0: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 09 40  \pkgIndex.tcl..@
cde0: 65 63 68 6f 20 7d 20 3e 3e 20 24 28 4f 55 54 5f  echo } >> $(OUT_
cdf0: 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63  DIR)\pkgIndex.tc
ce00: 6c 0a 21 65 6c 73 65 0a 64 65 66 61 75 6c 74 2d  l.!else.default-
ce10: 70 6b 67 69 6e 64 65 78 3a 0a 09 40 65 63 68 6f  pkgindex:..@echo
ce20: 20 69 66 20 7b 5b 70 61 63 6b 61 67 65 20 76 73   if {[package vs
ce30: 61 74 69 73 66 69 65 73 20 5b 70 61 63 6b 61 67  atisfies [packag
ce40: 65 20 70 72 6f 76 69 64 65 20 54 63 6c 5d 20 39  e provide Tcl] 9
ce50: 2e 30 2d 5d 7d 20 7b 20 3e 20 24 28 4f 55 54 5f  .0-]} { > $(OUT_
ce60: 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63  DIR)\pkgIndex.tc
ce70: 6c 0a 09 40 65 63 68 6f 20 70 61 63 6b 61 67 65  l..@echo package
ce80: 20 69 66 6e 65 65 64 65 64 20 24 28 50 52 4a 5f   ifneeded $(PRJ_
ce90: 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29  PACKAGE_TCLNAME)
cea0: 20 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 20 5c   $(DOTVERSION) \
ceb0: 0a 09 20 20 20 20 5b 6c 69 73 74 20 6c 6f 61 64  ..    [list load
cec0: 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 24 64 69   [file join $$di
ced0: 72 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 39 29  r $(PRJLIBNAME9)
cee0: 5d 5d 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52 29  ]] >> $(OUT_DIR)
cef0: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 09 40  \pkgIndex.tcl..@
cf00: 65 63 68 6f 20 7d 20 65 6c 73 65 20 7b 20 3e 3e  echo } else { >>
cf10: 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49   $(OUT_DIR)\pkgI
cf20: 6e 64 65 78 2e 74 63 6c 0a 09 40 65 63 68 6f 20  ndex.tcl..@echo 
cf30: 70 61 63 6b 61 67 65 20 69 66 6e 65 65 64 65 64  package ifneeded
cf40: 20 24 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54   $(PRJ_PACKAGE_T
cf50: 43 4c 4e 41 4d 45 29 20 24 28 44 4f 54 56 45 52  CLNAME) $(DOTVER
cf60: 53 49 4f 4e 29 20 5c 0a 09 20 20 20 20 5b 6c 69  SION) \..    [li
cf70: 73 74 20 6c 6f 61 64 20 5b 66 69 6c 65 20 6a 6f  st load [file jo
cf80: 69 6e 20 24 24 64 69 72 20 24 28 50 52 4a 4c 49  in $$dir $(PRJLI
cf90: 42 4e 41 4d 45 38 29 5d 5d 20 3e 3e 20 24 28 4f  BNAME8)]] >> $(O
cfa0: 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78  UT_DIR)\pkgIndex
cfb0: 2e 74 63 6c 0a 09 40 65 63 68 6f 20 7d 20 3e 3e  .tcl..@echo } >>
cfc0: 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49   $(OUT_DIR)\pkgI
cfd0: 6e 64 65 78 2e 74 63 6c 0a 21 65 6e 64 69 66 0a  ndex.tcl.!endif.
cfe0: 0a 64 65 66 61 75 6c 74 2d 70 6b 67 69 6e 64 65  .default-pkginde
cff0: 78 2d 74 65 61 3a 0a 09 40 69 66 20 65 78 69 73  x-tea:..@if exis
d000: 74 20 24 28 52 4f 4f 54 29 5c 70 6b 67 49 6e 64  t $(ROOT)\pkgInd
d010: 65 78 2e 74 63 6c 2e 69 6e 20 6e 6d 61 6b 65 68  ex.tcl.in nmakeh
d020: 6c 70 20 2d 73 20 3c 3c 20 24 28 52 4f 4f 54 29  lp -s << $(ROOT)
d030: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 2e 69 6e  \pkgIndex.tcl.in
d040: 20 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b   > $(OUT_DIR)\pk
d050: 67 49 6e 64 65 78 2e 74 63 6c 0a 40 50 41 43 4b  gIndex.tcl.@PACK
d060: 41 47 45 5f 56 45 52 53 49 4f 4e 40 20 20 20 20  AGE_VERSION@    
d070: 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 0a 40 50  $(DOTVERSION).@P
d080: 41 43 4b 41 47 45 5f 4e 41 4d 45 40 20 20 20 20  ACKAGE_NAME@    
d090: 20 20 20 24 28 50 52 4a 5f 50 41 43 4b 41 47 45     $(PRJ_PACKAGE
d0a0: 5f 54 43 4c 4e 41 4d 45 29 0a 40 50 41 43 4b 41  _TCLNAME).@PACKA
d0b0: 47 45 5f 54 43 4c 4e 41 4d 45 40 20 20 20 20 24  GE_TCLNAME@    $
d0c0: 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c  (PRJ_PACKAGE_TCL
d0d0: 4e 41 4d 45 29 0a 40 50 4b 47 5f 4c 49 42 5f 46  NAME).@PKG_LIB_F
d0e0: 49 4c 45 40 20 20 20 20 20 20 20 24 28 50 52 4a  ILE@       $(PRJ
d0f0: 4c 49 42 4e 41 4d 45 29 0a 40 50 4b 47 5f 4c 49  LIBNAME).@PKG_LI
d100: 42 5f 46 49 4c 45 38 40 20 20 20 20 20 20 24 28  B_FILE8@      $(
d110: 50 52 4a 4c 49 42 4e 41 4d 45 38 29 0a 40 50 4b  PRJLIBNAME8).@PK
d120: 47 5f 4c 49 42 5f 46 49 4c 45 39 40 20 20 20 20  G_LIB_FILE9@    
d130: 20 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 39 29    $(PRJLIBNAME9)
d140: 0a 3c 3c 0a 0a 64 65 66 61 75 6c 74 2d 69 6e 73  .<<..default-ins
d150: 74 61 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 69 6e  tall: default-in
d160: 73 74 61 6c 6c 2d 62 69 6e 61 72 69 65 73 20 64  stall-binaries d
d170: 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 6c  efault-install-l
d180: 69 62 72 61 72 69 65 73 0a 21 69 66 20 24 28 53  ibraries.!if $(S
d190: 59 4d 42 4f 4c 53 29 0a 64 65 66 61 75 6c 74 2d  YMBOLS).default-
d1a0: 69 6e 73 74 61 6c 6c 3a 20 64 65 66 61 75 6c 74  install: default
d1b0: 2d 69 6e 73 74 61 6c 6c 2d 70 64 62 73 0a 21 65  -install-pdbs.!e
d1c0: 6e 64 69 66 0a 0a 23 20 41 67 61 69 6e 20 74 6f  ndif..# Again to
d1d0: 20 64 65 61 6c 20 77 69 74 68 20 68 69 73 74 6f   deal with histo
d1e0: 72 69 63 61 6c 20 62 72 6f 6b 65 6e 6e 65 73 73  rical brokenness
d1f0: 2c 20 74 68 65 72 65 20 69 73 20 73 6f 6d 65 20  , there is some 
d200: 63 6f 6e 66 75 73 69 6f 6e 0a 23 20 69 6e 20 74  confusion.# in t
d210: 65 72 6d 69 6e 6c 6f 67 79 2e 20 46 6f 72 20 65  erminlogy. For e
d220: 78 74 65 6e 73 69 6f 6e 73 2c 20 74 68 65 20 22  xtensions, the "
d230: 69 6e 73 74 61 6c 6c 2d 62 69 6e 61 72 69 65 73  install-binaries
d240: 22 20 77 61 73 20 75 73 65 64 20 74 6f 0a 23 20  " was used to.# 
d250: 6c 6f 63 61 74 65 20 74 61 72 67 65 74 20 64 69  locate target di
d260: 72 65 63 74 6f 72 79 20 66 6f 72 20 2a 62 69 6e  rectory for *bin
d270: 61 72 79 20 73 68 61 72 65 64 20 6c 69 62 72 61  ary shared libra
d280: 72 69 65 73 2a 20 61 6e 64 20 74 68 75 73 0a 23  ries* and thus.#
d290: 20 74 68 65 20 61 70 70 72 6f 70 72 69 61 74 65   the appropriate
d2a0: 20 6d 61 63 72 6f 20 69 73 20 4c 49 42 5f 49 4e   macro is LIB_IN
d2b0: 53 54 41 4c 4c 5f 44 49 52 20 73 69 6e 63 65 20  STALL_DIR since 
d2c0: 42 49 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20  BIN_INSTALL_DIR 
d2d0: 69 73 0a 23 20 66 6f 72 20 65 78 65 63 75 74 61  is.# for executa
d2e0: 62 6c 65 73 20 28 65 78 65 73 29 2e 20 4f 6e 20  bles (exes). On 
d2f0: 74 68 65 20 6f 74 68 65 72 20 68 61 6e 64 20 74  the other hand t
d300: 68 65 20 22 69 6e 73 74 61 6c 6c 2d 6c 69 62 72  he "install-libr
d310: 61 72 69 65 73 22 0a 23 20 74 61 72 67 65 74 20  aries".# target 
d320: 69 73 20 66 6f 72 20 2a 73 63 72 69 70 74 73 2a  is for *scripts*
d330: 20 61 6e 64 20 73 68 6f 75 6c 64 20 68 61 76 65   and should have
d340: 20 62 65 65 6e 20 63 61 6c 6c 65 64 20 22 69 6e   been called "in
d350: 73 74 61 6c 6c 2d 73 63 72 69 70 74 73 22 2e 0a  stall-scripts"..
d360: 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d  default-install-
d370: 62 69 6e 61 72 69 65 73 3a 20 24 28 50 52 4a 4c  binaries: $(PRJL
d380: 49 42 29 0a 09 40 65 63 68 6f 20 49 6e 73 74 61  IB)..@echo Insta
d390: 6c 6c 69 6e 67 20 62 69 6e 61 72 69 65 73 20 74  lling binaries t
d3a0: 6f 20 27 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c  o '$(LIB_INSTALL
d3b0: 5f 44 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20  _DIR)'..@if not 
d3c0: 65 78 69 73 74 20 22 24 28 4c 49 42 5f 49 4e 53  exist "$(LIB_INS
d3d0: 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72  TALL_DIR)" mkdir
d3e0: 20 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f   "$(LIB_INSTALL_
d3f0: 44 49 52 29 22 0a 09 40 24 28 43 50 59 29 20 24  DIR)"..@$(CPY) $
d400: 28 50 52 4a 4c 49 42 29 20 22 24 28 4c 49 42 5f  (PRJLIB) "$(LIB_
d410: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 3e 4e  INSTALL_DIR)" >N
d420: 55 4c 0a 0a 23 20 41 6c 69 61 73 20 66 6f 72 20  UL..# Alias for 
d430: 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d  default-install-
d440: 73 63 72 69 70 74 73 0a 64 65 66 61 75 6c 74 2d  scripts.default-
d450: 69 6e 73 74 61 6c 6c 2d 6c 69 62 72 61 72 69 65  install-librarie
d460: 73 3a 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 61  s: default-insta
d470: 6c 6c 2d 73 63 72 69 70 74 73 0a 0a 64 65 66 61  ll-scripts..defa
d480: 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 73 63 72 69  ult-install-scri
d490: 70 74 73 3a 20 24 28 4f 55 54 5f 44 49 52 29 5c  pts: $(OUT_DIR)\
d4a0: 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 09 40 65  pkgIndex.tcl..@e
d4b0: 63 68 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 20 6c  cho Installing l
d4c0: 69 62 72 61 72 69 65 73 20 74 6f 20 27 24 28 53  ibraries to '$(S
d4d0: 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49  CRIPT_INSTALL_DI
d4e0: 52 29 27 0a 09 40 69 66 20 65 78 69 73 74 20 24  R)'..@if exist $
d4f0: 28 4c 49 42 44 49 52 29 20 24 28 43 50 59 29 20  (LIBDIR) $(CPY) 
d500: 24 28 4c 49 42 44 49 52 29 5c 2a 2e 74 63 6c 20  $(LIBDIR)\*.tcl 
d510: 22 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c  "$(SCRIPT_INSTAL
d520: 4c 5f 44 49 52 29 22 0a 09 40 65 63 68 6f 20 49  L_DIR)"..@echo I
d530: 6e 73 74 61 6c 6c 69 6e 67 20 70 61 63 6b 61 67  nstalling packag
d540: 65 20 69 6e 64 65 78 20 69 6e 20 27 24 28 53 43  e index in '$(SC
d550: 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  RIPT_INSTALL_DIR
d560: 29 27 0a 09 40 24 28 43 50 59 29 20 24 28 4f 55  )'..@$(CPY) $(OU
d570: 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e  T_DIR)\pkgIndex.
d580: 74 63 6c 20 24 28 53 43 52 49 50 54 5f 49 4e 53  tcl $(SCRIPT_INS
d590: 54 41 4c 4c 5f 44 49 52 29 0a 0a 64 65 66 61 75  TALL_DIR)..defau
d5a0: 6c 74 2d 69 6e 73 74 61 6c 6c 2d 73 74 75 62 73  lt-install-stubs
d5b0: 3a 0a 09 40 65 63 68 6f 20 49 6e 73 74 61 6c 6c  :..@echo Install
d5c0: 69 6e 67 20 73 74 75 62 73 20 6c 69 62 72 61 72  ing stubs librar
d5d0: 79 20 74 6f 20 27 24 28 53 43 52 49 50 54 5f 49  y to '$(SCRIPT_I
d5e0: 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69  NSTALL_DIR)'..@i
d5f0: 66 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28 53  f not exist "$(S
d600: 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49  CRIPT_INSTALL_DI
d610: 52 29 22 20 6d 6b 64 69 72 20 22 24 28 53 43 52  R)" mkdir "$(SCR
d620: 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29  IPT_INSTALL_DIR)
d630: 22 0a 09 40 24 28 43 50 59 29 20 24 28 50 52 4a  "..@$(CPY) $(PRJ
d640: 53 54 55 42 4c 49 42 29 20 22 24 28 53 43 52 49  STUBLIB) "$(SCRI
d650: 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22  PT_INSTALL_DIR)"
d660: 20 3e 4e 55 4c 0a 0a 64 65 66 61 75 6c 74 2d 69   >NUL..default-i
d670: 6e 73 74 61 6c 6c 2d 70 64 62 73 3a 0a 09 40 65  nstall-pdbs:..@e
d680: 63 68 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 20 50  cho Installing P
d690: 44 42 73 20 74 6f 20 27 24 28 4c 49 42 5f 49 4e  DBs to '$(LIB_IN
d6a0: 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66  STALL_DIR)'..@if
d6b0: 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28 4c 49   not exist "$(LI
d6c0: 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20  B_INSTALL_DIR)" 
d6d0: 6d 6b 64 69 72 20 22 24 28 4c 49 42 5f 49 4e 53  mkdir "$(LIB_INS
d6e0: 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 24 28 43  TALL_DIR)"..@$(C
d6f0: 50 59 29 20 22 24 28 4f 55 54 5f 44 49 52 29 5c  PY) "$(OUT_DIR)\
d700: 2a 2e 70 64 62 22 20 22 24 28 4c 49 42 5f 49 4e  *.pdb" "$(LIB_IN
d710: 53 54 41 4c 4c 5f 44 49 52 29 5c 22 0a 0a 23 20  STALL_DIR)\"..# 
d720: 22 65 6d 61 63 73 20 66 6f 6e 74 2d 6c 6f 63 6b  "emacs font-lock
d730: 20 68 69 67 68 6c 69 67 68 74 69 6e 67 20 66 69   highlighting fi
d740: 78 0a 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61  x..default-insta
d750: 6c 6c 2d 64 6f 63 73 2d 68 74 6d 6c 3a 0a 09 40  ll-docs-html:..@
d760: 65 63 68 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 20  echo Installing 
d770: 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 69  documentation fi
d780: 6c 65 73 20 74 6f 20 27 24 28 44 4f 43 5f 49 4e  les to '$(DOC_IN
d790: 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66  STALL_DIR)'..@if
d7a0: 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28 44 4f   not exist "$(DO
d7b0: 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20  C_INSTALL_DIR)" 
d7c0: 6d 6b 64 69 72 20 22 24 28 44 4f 43 5f 49 4e 53  mkdir "$(DOC_INS
d7d0: 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 69 66 20  TALL_DIR)"..@if 
d7e0: 65 78 69 73 74 20 24 28 44 4f 43 44 49 52 29 20  exist $(DOCDIR) 
d7f0: 66 6f 72 20 25 66 20 69 6e 20 28 22 24 28 44 4f  for %f in ("$(DO
d800: 43 44 49 52 29 5c 2a 2e 68 74 6d 6c 22 20 22 24  CDIR)\*.html" "$
d810: 28 44 4f 43 44 49 52 29 5c 2a 2e 63 73 73 22 20  (DOCDIR)\*.css" 
d820: 22 24 28 44 4f 43 44 49 52 29 5c 2a 2e 70 6e 67  "$(DOCDIR)\*.png
d830: 22 29 20 64 6f 20 40 24 28 43 4f 50 59 29 20 25  ") do @$(COPY) %
d840: 66 20 22 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c  f "$(DOC_INSTALL
d850: 5f 44 49 52 29 22 0a 0a 64 65 66 61 75 6c 74 2d  _DIR)"..default-
d860: 69 6e 73 74 61 6c 6c 2d 64 6f 63 73 2d 6e 3a 0a  install-docs-n:.
d870: 09 40 65 63 68 6f 20 49 6e 73 74 61 6c 6c 69 6e  .@echo Installin
d880: 67 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20  g documentation 
d890: 66 69 6c 65 73 20 74 6f 20 27 24 28 44 4f 43 5f  files to '$(DOC_
d8a0: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40  INSTALL_DIR)'..@
d8b0: 69 66 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28  if not exist "$(
d8c0: 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29  DOC_INSTALL_DIR)
d8d0: 22 20 6d 6b 64 69 72 20 22 24 28 44 4f 43 5f 49  " mkdir "$(DOC_I
d8e0: 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 69  NSTALL_DIR)"..@i
d8f0: 66 20 65 78 69 73 74 20 24 28 44 4f 43 44 49 52  f exist $(DOCDIR
d900: 29 20 66 6f 72 20 25 66 20 69 6e 20 28 22 24 28  ) for %f in ("$(
d910: 44 4f 43 44 49 52 29 5c 2a 2e 6e 22 29 20 64 6f  DOCDIR)\*.n") do
d920: 20 40 24 28 43 4f 50 59 29 20 25 66 20 22 24 28   @$(COPY) %f "$(
d930: 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29  DOC_INSTALL_DIR)
d940: 22 0a 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61  "..default-insta
d950: 6c 6c 2d 64 65 6d 6f 73 3a 0a 09 40 65 63 68 6f  ll-demos:..@echo
d960: 20 49 6e 73 74 61 6c 6c 69 6e 67 20 64 65 6d 6f   Installing demo
d970: 73 20 74 6f 20 27 24 28 44 45 4d 4f 5f 49 4e 53  s to '$(DEMO_INS
d980: 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 20  TALL_DIR)'..@if 
d990: 6e 6f 74 20 65 78 69 73 74 20 22 24 28 44 45 4d  not exist "$(DEM
d9a0: 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20  O_INSTALL_DIR)" 
d9b0: 6d 6b 64 69 72 20 22 24 28 44 45 4d 4f 5f 49 4e  mkdir "$(DEMO_IN
d9c0: 53 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 69 66  STALL_DIR)"..@if
d9d0: 20 65 78 69 73 74 20 24 28 44 45 4d 4f 44 49 52   exist $(DEMODIR
d9e0: 29 20 24 28 43 50 59 44 49 52 29 20 22 24 28 44  ) $(CPYDIR) "$(D
d9f0: 45 4d 4f 44 49 52 29 22 20 22 24 28 44 45 4d 4f  EMODIR)" "$(DEMO
da00: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a 0a  _INSTALL_DIR)"..
da10: 64 65 66 61 75 6c 74 2d 63 6c 65 61 6e 3a 0a 09  default-clean:..
da20: 40 65 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24  @echo Cleaning $
da30: 28 54 4d 50 5f 44 49 52 29 5c 2a 20 2e 2e 2e 0a  (TMP_DIR)\* ....
da40: 09 40 69 66 20 65 78 69 73 74 20 24 28 54 4d 50  .@if exist $(TMP
da50: 5f 44 49 52 29 5c 6e 75 6c 20 24 28 52 4d 44 49  _DIR)\nul $(RMDI
da60: 52 29 20 24 28 54 4d 50 5f 44 49 52 29 0a 09 40  R) $(TMP_DIR)..@
da70: 65 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24 28  echo Cleaning $(
da80: 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c  WIN_DIR)\nmakehl
da90: 70 2e 6f 62 6a 2c 20 6e 6d 61 6b 65 68 6c 70 2e  p.obj, nmakehlp.
daa0: 65 78 65 20 2e 2e 2e 0a 09 40 69 66 20 65 78 69  exe .....@if exi
dab0: 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d  st $(WIN_DIR)\nm
dac0: 61 6b 65 68 6c 70 2e 6f 62 6a 20 64 65 6c 20 24  akehlp.obj del $
dad0: 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68  (WIN_DIR)\nmakeh
dae0: 6c 70 2e 6f 62 6a 0a 09 40 69 66 20 65 78 69 73  lp.obj..@if exis
daf0: 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61  t $(WIN_DIR)\nma
db00: 6b 65 68 6c 70 2e 65 78 65 20 64 65 6c 20 24 28  kehlp.exe del $(
db10: 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c  WIN_DIR)\nmakehl
db20: 70 2e 65 78 65 0a 09 40 69 66 20 65 78 69 73 74  p.exe..@if exist
db30: 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b   $(WIN_DIR)\nmak
db40: 65 68 6c 70 2e 6f 75 74 20 64 65 6c 20 24 28 57  ehlp.out del $(W
db50: 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70  IN_DIR)\nmakehlp
db60: 2e 6f 75 74 0a 09 40 65 63 68 6f 20 43 6c 65 61  .out..@echo Clea
db70: 6e 69 6e 67 20 24 28 57 49 4e 5f 44 49 52 29 5c  ning $(WIN_DIR)\
db80: 6e 6d 68 6c 70 2d 6f 75 74 2e 74 78 74 20 2e 2e  nmhlp-out.txt ..
db90: 2e 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 57  ...@if exist $(W
dba0: 49 4e 5f 44 49 52 29 5c 6e 6d 68 6c 70 2d 6f 75  IN_DIR)\nmhlp-ou
dbb0: 74 2e 74 78 74 20 64 65 6c 20 24 28 57 49 4e 5f  t.txt del $(WIN_
dbc0: 44 49 52 29 5c 6e 6d 68 6c 70 2d 6f 75 74 2e 74  DIR)\nmhlp-out.t
dbd0: 78 74 0a 09 40 65 63 68 6f 20 43 6c 65 61 6e 69  xt..@echo Cleani
dbe0: 6e 67 20 24 28 57 49 4e 5f 44 49 52 29 5c 5f 6a  ng $(WIN_DIR)\_j
dbf0: 75 6e 6b 2e 70 63 68 20 2e 2e 2e 0a 09 40 69 66  unk.pch .....@if
dc00: 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44 49 52   exist $(WIN_DIR
dc10: 29 5c 5f 6a 75 6e 6b 2e 70 63 68 20 64 65 6c 20  )\_junk.pch del 
dc20: 24 28 57 49 4e 5f 44 49 52 29 5c 5f 6a 75 6e 6b  $(WIN_DIR)\_junk
dc30: 2e 70 63 68 0a 09 40 65 63 68 6f 20 43 6c 65 61  .pch..@echo Clea
dc40: 6e 69 6e 67 20 24 28 57 49 4e 5f 44 49 52 29 5c  ning $(WIN_DIR)\
dc50: 76 65 72 63 6c 2e 78 2c 20 76 65 72 63 6c 2e 69  vercl.x, vercl.i
dc60: 20 2e 2e 2e 0a 09 40 69 66 20 65 78 69 73 74 20   .....@if exist 
dc70: 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 63 6c  $(WIN_DIR)\vercl
dc80: 2e 78 20 64 65 6c 20 24 28 57 49 4e 5f 44 49 52  .x del $(WIN_DIR
dc90: 29 5c 76 65 72 63 6c 2e 78 0a 09 40 69 66 20 65  )\vercl.x..@if e
dca0: 78 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c  xist $(WIN_DIR)\
dcb0: 76 65 72 63 6c 2e 69 20 64 65 6c 20 24 28 57 49  vercl.i del $(WI
dcc0: 4e 5f 44 49 52 29 5c 76 65 72 63 6c 2e 69 0a 09  N_DIR)\vercl.i..
dcd0: 40 65 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24  @echo Cleaning $
dce0: 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 73 69 6f  (WIN_DIR)\versio
dcf0: 6e 73 2e 76 63 2c 20 76 65 72 73 69 6f 6e 2e 76  ns.vc, version.v
dd00: 63 20 2e 2e 2e 0a 09 40 69 66 20 65 78 69 73 74  c .....@if exist
dd10: 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 73   $(WIN_DIR)\vers
dd20: 69 6f 6e 73 2e 76 63 20 64 65 6c 20 24 28 57 49  ions.vc del $(WI
dd30: 4e 5f 44 49 52 29 5c 76 65 72 73 69 6f 6e 73 2e  N_DIR)\versions.
dd40: 76 63 0a 09 40 69 66 20 65 78 69 73 74 20 24 28  vc..@if exist $(
dd50: 57 49 4e 5f 44 49 52 29 5c 76 65 72 73 69 6f 6e  WIN_DIR)\version
dd60: 2e 76 63 20 64 65 6c 20 24 28 57 49 4e 5f 44 49  .vc del $(WIN_DI
dd70: 52 29 5c 76 65 72 73 69 6f 6e 2e 76 63 0a 0a 64  R)\version.vc..d
dd80: 65 66 61 75 6c 74 2d 68 6f 73 65 3a 20 64 65 66  efault-hose: def
dd90: 61 75 6c 74 2d 63 6c 65 61 6e 0a 09 40 65 63 68  ault-clean..@ech
dda0: 6f 20 48 6f 73 69 6e 67 20 24 28 4f 55 54 5f 44  o Hosing $(OUT_D
ddb0: 49 52 29 5c 2a 20 2e 2e 2e 0a 09 40 69 66 20 65  IR)\* .....@if e
ddc0: 78 69 73 74 20 24 28 4f 55 54 5f 44 49 52 29 5c  xist $(OUT_DIR)\
ddd0: 6e 75 6c 20 24 28 52 4d 44 49 52 29 20 24 28 4f  nul $(RMDIR) $(O
dde0: 55 54 5f 44 49 52 29 0a 0a 23 20 4f 6e 6c 79 20  UT_DIR)..# Only 
ddf0: 66 6f 72 20 62 61 63 6b 77 61 72 64 20 63 6f 6d  for backward com
de00: 70 61 74 69 62 69 6c 69 74 79 0a 64 65 66 61 75  patibility.defau
de10: 6c 74 2d 64 69 73 74 63 6c 65 61 6e 3a 20 64 65  lt-distclean: de
de20: 66 61 75 6c 74 2d 68 6f 73 65 0a 0a 64 65 66 61  fault-hose..defa
de30: 75 6c 74 2d 73 65 74 75 70 3a 0a 09 40 69 66 20  ult-setup:..@if 
de40: 6e 6f 74 20 65 78 69 73 74 20 24 28 4f 55 54 5f  not exist $(OUT_
de50: 44 49 52 29 5c 6e 75 6c 20 6d 6b 64 69 72 20 24  DIR)\nul mkdir $
de60: 28 4f 55 54 5f 44 49 52 29 0a 09 40 69 66 20 6e  (OUT_DIR)..@if n
de70: 6f 74 20 65 78 69 73 74 20 24 28 54 4d 50 5f 44  ot exist $(TMP_D
de80: 49 52 29 5c 6e 75 6c 20 6d 6b 64 69 72 20 24 28  IR)\nul mkdir $(
de90: 54 4d 50 5f 44 49 52 29 0a 0a 21 69 66 20 22 24  TMP_DIR)..!if "$
dea0: 28 54 45 53 54 50 41 54 29 22 20 21 3d 20 22 22  (TESTPAT)" != ""
deb0: 0a 54 45 53 54 46 4c 41 47 53 20 3d 20 24 28 54  .TESTFLAGS = $(T
dec0: 45 53 54 46 4c 41 47 53 29 20 2d 66 69 6c 65 20  ESTFLAGS) -file 
ded0: 24 28 54 45 53 54 50 41 54 29 0a 21 65 6e 64 69  $(TESTPAT).!endi
dee0: 66 0a 0a 64 65 66 61 75 6c 74 2d 74 65 73 74 3a  f..default-test:
def0: 20 64 65 66 61 75 6c 74 2d 73 65 74 75 70 20 24   default-setup $
df00: 28 50 52 4f 4a 45 43 54 29 0a 09 40 73 65 74 20  (PROJECT)..@set 
df10: 54 43 4c 4c 49 42 50 41 54 48 3d 24 28 4f 55 54  TCLLIBPATH=$(OUT
df20: 5f 44 49 52 3a 5c 3d 2f 29 0a 09 40 69 66 20 65  _DIR:\=/)..@if e
df30: 78 69 73 74 20 24 28 4c 49 42 44 49 52 29 20 66  xist $(LIBDIR) f
df40: 6f 72 20 25 66 20 69 6e 20 28 22 24 28 4c 49 42  or %f in ("$(LIB
df50: 44 49 52 29 5c 2a 2e 74 63 6c 22 29 20 64 6f 20  DIR)\*.tcl") do 
df60: 40 24 28 43 4f 50 59 29 20 25 66 20 22 24 28 4f  @$(COPY) %f "$(O
df70: 55 54 5f 44 49 52 29 22 0a 09 63 64 20 22 24 28  UT_DIR)"..cd "$(
df80: 54 45 53 54 44 49 52 29 22 20 26 26 20 24 28 44  TESTDIR)" && $(D
df90: 45 42 55 47 47 45 52 29 20 24 28 54 43 4c 53 48  EBUGGER) $(TCLSH
dfa0: 29 20 61 6c 6c 2e 74 63 6c 20 24 28 54 45 53 54  ) all.tcl $(TEST
dfb0: 46 4c 41 47 53 29 0a 0a 64 65 66 61 75 6c 74 2d  FLAGS)..default-
dfc0: 73 68 65 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 73  shell: default-s
dfd0: 65 74 75 70 20 24 28 50 52 4f 4a 45 43 54 29 0a  etup $(PROJECT).
dfe0: 09 40 73 65 74 20 54 43 4c 4c 49 42 50 41 54 48  .@set TCLLIBPATH
dff0: 3d 24 28 4f 55 54 5f 44 49 52 3a 5c 3d 2f 29 0a  =$(OUT_DIR:\=/).
e000: 09 40 69 66 20 65 78 69 73 74 20 24 28 4c 49 42  .@if exist $(LIB
e010: 44 49 52 29 20 66 6f 72 20 25 66 20 69 6e 20 28  DIR) for %f in (
e020: 22 24 28 4c 49 42 44 49 52 29 5c 2a 2e 74 63 6c  "$(LIBDIR)\*.tcl
e030: 22 29 20 64 6f 20 40 24 28 43 4f 50 59 29 20 25  ") do @$(COPY) %
e040: 66 20 22 24 28 4f 55 54 5f 44 49 52 29 22 0a 09  f "$(OUT_DIR)"..
e050: 24 28 44 45 42 55 47 47 45 52 29 20 24 28 54 43  $(DEBUGGER) $(TC
e060: 4c 53 48 29 0a 0a 23 20 47 65 6e 65 72 61 74 69  LSH)..# Generati
e070: 6f 6e 20 6f 66 20 57 69 6e 64 6f 77 73 20 76 65  on of Windows ve
e080: 72 73 69 6f 6e 20 72 65 73 6f 75 72 63 65 0a 21  rsion resource.!
e090: 69 66 64 65 66 20 52 43 46 49 4c 45 0a 0a 23 20  ifdef RCFILE..# 
e0a0: 4e 6f 74 65 3a 20 64 6f 6e 27 74 20 75 73 65 20  Note: don't use 
e0b0: 24 2a 2a 20 69 6e 20 62 65 6c 6f 77 20 72 75 6c  $** in below rul
e0c0: 65 20 62 65 63 61 75 73 65 20 74 68 65 72 65 20  e because there 
e0d0: 6d 61 79 20 62 65 20 6f 74 68 65 72 20 64 65 70  may be other dep
e0e0: 65 6e 64 65 6e 63 69 65 73 0a 23 20 61 6e 64 20  endencies.# and 
e0f0: 6f 6e 6c 79 20 74 68 65 20 22 6d 61 69 6e 22 20  only the "main" 
e100: 72 63 20 6d 75 73 74 20 62 65 20 70 61 73 73 65  rc must be passe
e110: 64 20 74 6f 20 74 68 65 20 72 65 73 6f 75 72 63  d to the resourc
e120: 65 20 63 6f 6d 70 69 6c 65 72 0a 24 28 54 4d 50  e compiler.$(TMP
e130: 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29  _DIR)\$(PROJECT)
e140: 2e 72 65 73 3a 20 24 28 52 43 44 49 52 29 5c 24  .res: $(RCDIR)\$
e150: 28 50 52 4f 4a 45 43 54 29 2e 72 63 0a 09 24 28  (PROJECT).rc..$(
e160: 52 45 53 43 4d 44 29 20 24 28 52 43 44 49 52 29  RESCMD) $(RCDIR)
e170: 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 63 0a 0a  \$(PROJECT).rc..
e180: 21 65 6c 73 65 0a 0a 23 20 49 66 20 70 61 72 65  !else..# If pare
e190: 6e 74 20 6d 61 6b 65 66 69 6c 65 20 68 61 73 20  nt makefile has 
e1a0: 6e 6f 74 20 64 65 66 69 6e 65 64 20 61 20 72 65  not defined a re
e1b0: 73 6f 75 72 63 65 20 64 65 66 69 6e 69 74 69 6f  source definitio
e1c0: 6e 20 66 69 6c 65 2c 0a 23 20 77 65 20 77 69 6c  n file,.# we wil
e1d0: 6c 20 67 65 6e 65 72 61 74 65 20 6f 6e 65 20 66  l generate one f
e1e0: 72 6f 6d 20 73 74 61 6e 64 61 72 64 20 74 65 6d  rom standard tem
e1f0: 70 6c 61 74 65 2e 0a 24 28 54 4d 50 5f 44 49 52  plate..$(TMP_DIR
e200: 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 65 73  )\$(PROJECT).res
e210: 3a 20 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 50  : $(TMP_DIR)\$(P
e220: 52 4f 4a 45 43 54 29 2e 72 63 0a 0a 24 28 54 4d  ROJECT).rc..$(TM
e230: 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54  P_DIR)\$(PROJECT
e240: 29 2e 72 63 3a 0a 09 40 24 28 43 4f 50 59 29 20  ).rc:..@$(COPY) 
e250: 3c 3c 20 24 28 54 4d 50 5f 44 49 52 29 5c 24 28  << $(TMP_DIR)\$(
e260: 50 52 4f 4a 45 43 54 29 2e 72 63 0a 23 69 6e 63  PROJECT).rc.#inc
e270: 6c 75 64 65 20 3c 77 69 6e 76 65 72 2e 68 3e 0a  lude <winver.h>.
e280: 0a 56 53 5f 56 45 52 53 49 4f 4e 5f 49 4e 46 4f  .VS_VERSION_INFO
e290: 20 56 45 52 53 49 4f 4e 49 4e 46 4f 0a 20 46 49   VERSIONINFO. FI
e2a0: 4c 45 56 45 52 53 49 4f 4e 09 43 4f 4d 4d 41 56  LEVERSION.COMMAV
e2b0: 45 52 53 49 4f 4e 0a 20 50 52 4f 44 55 43 54 56  ERSION. PRODUCTV
e2c0: 45 52 53 49 4f 4e 09 43 4f 4d 4d 41 56 45 52 53  ERSION.COMMAVERS
e2d0: 49 4f 4e 0a 20 46 49 4c 45 46 4c 41 47 53 4d 41  ION. FILEFLAGSMA
e2e0: 53 4b 09 30 78 33 66 4c 0a 23 69 66 64 65 66 20  SK.0x3fL.#ifdef 
e2f0: 44 45 42 55 47 0a 20 46 49 4c 45 46 4c 41 47 53  DEBUG. FILEFLAGS
e300: 09 56 53 5f 46 46 5f 44 45 42 55 47 0a 23 65 6c  .VS_FF_DEBUG.#el
e310: 73 65 0a 20 46 49 4c 45 46 4c 41 47 53 09 30 78  se. FILEFLAGS.0x
e320: 30 4c 0a 23 65 6e 64 69 66 0a 20 46 49 4c 45 4f  0L.#endif. FILEO
e330: 53 09 09 56 4f 53 5f 4e 54 5f 57 49 4e 44 4f 57  S..VOS_NT_WINDOW
e340: 53 33 32 0a 20 46 49 4c 45 54 59 50 45 09 56 46  S32. FILETYPE.VF
e350: 54 5f 44 4c 4c 0a 20 46 49 4c 45 53 55 42 54 59  T_DLL. FILESUBTY
e360: 50 45 09 30 78 30 4c 0a 42 45 47 49 4e 0a 20 20  PE.0x0L.BEGIN.  
e370: 20 20 42 4c 4f 43 4b 20 22 53 74 72 69 6e 67 46    BLOCK "StringF
e380: 69 6c 65 49 6e 66 6f 22 0a 20 20 20 20 42 45 47  ileInfo".    BEG
e390: 49 4e 0a 20 20 20 20 20 20 20 20 42 4c 4f 43 4b  IN.        BLOCK
e3a0: 20 22 30 34 30 39 30 34 62 30 22 0a 20 20 20 20   "040904b0".    
e3b0: 20 20 20 20 42 45 47 49 4e 0a 20 20 20 20 20 20      BEGIN.      
e3c0: 20 20 20 20 20 20 56 41 4c 55 45 20 22 46 69 6c        VALUE "Fil
e3d0: 65 44 65 73 63 72 69 70 74 69 6f 6e 22 2c 20 20  eDescription",  
e3e0: 22 54 63 6c 20 65 78 74 65 6e 73 69 6f 6e 20 22  "Tcl extension "
e3f0: 20 50 52 4f 4a 45 43 54 0a 20 20 20 20 20 20 20   PROJECT.       
e400: 20 20 20 20 20 56 41 4c 55 45 20 22 4f 72 69 67       VALUE "Orig
e410: 69 6e 61 6c 46 69 6c 65 6e 61 6d 65 22 2c 20 50  inalFilename", P
e420: 52 4a 4c 49 42 4e 41 4d 45 0a 20 20 20 20 20 20  RJLIBNAME.      
e430: 20 20 20 20 20 20 56 41 4c 55 45 20 22 46 69 6c        VALUE "Fil
e440: 65 56 65 72 73 69 6f 6e 22 2c 20 20 20 20 20 20  eVersion",      
e450: 44 4f 54 56 45 52 53 49 4f 4e 0a 20 20 20 20 20  DOTVERSION.     
e460: 20 20 20 20 20 20 20 56 41 4c 55 45 20 22 50 72         VALUE "Pr
e470: 6f 64 75 63 74 4e 61 6d 65 22 2c 20 20 20 20 20  oductName",     
e480: 20 22 50 61 63 6b 61 67 65 20 22 20 50 52 4f 4a   "Package " PROJ
e490: 45 43 54 20 22 20 66 6f 72 20 54 63 6c 22 0a 20  ECT " for Tcl". 
e4a0: 20 20 20 20 20 20 20 20 20 20 20 56 41 4c 55 45             VALUE
e4b0: 20 22 50 72 6f 64 75 63 74 56 65 72 73 69 6f 6e   "ProductVersion
e4c0: 22 2c 20 20 20 44 4f 54 56 45 52 53 49 4f 4e 0a  ",   DOTVERSION.
e4d0: 20 20 20 20 20 20 20 20 45 4e 44 0a 20 20 20 20          END.    
e4e0: 45 4e 44 0a 20 20 20 20 42 4c 4f 43 4b 20 22 56  END.    BLOCK "V
e4f0: 61 72 46 69 6c 65 49 6e 66 6f 22 0a 20 20 20 20  arFileInfo".    
e500: 42 45 47 49 4e 0a 20 20 20 20 20 20 20 20 56 41  BEGIN.        VA
e510: 4c 55 45 20 22 54 72 61 6e 73 6c 61 74 69 6f 6e  LUE "Translation
e520: 22 2c 20 30 78 34 30 39 2c 20 31 32 30 30 0a 20  ", 0x409, 1200. 
e530: 20 20 20 45 4e 44 0a 45 4e 44 0a 0a 3c 3c 0a 0a     END.END..<<..
e540: 21 65 6e 64 69 66 20 23 20 69 66 64 65 66 20 52  !endif # ifdef R
e550: 43 46 49 4c 45 0a 0a 21 69 66 6e 64 65 66 20 44  CFILE..!ifndef D
e560: 49 53 41 42 4c 45 5f 49 4d 50 4c 49 43 49 54 5f  ISABLE_IMPLICIT_
e570: 52 55 4c 45 53 0a 44 49 53 41 42 4c 45 5f 49 4d  RULES.DISABLE_IM
e580: 50 4c 49 43 49 54 5f 52 55 4c 45 53 20 3d 20 30  PLICIT_RULES = 0
e590: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 21 24 28  .!endif..!if !$(
e5a0: 44 49 53 41 42 4c 45 5f 49 4d 50 4c 49 43 49 54  DISABLE_IMPLICIT
e5b0: 5f 52 55 4c 45 53 29 0a 23 20 49 6d 70 6c 69 63  _RULES).# Implic
e5c0: 69 74 20 72 75 6c 65 20 64 65 66 69 6e 69 74 69  it rule definiti
e5d0: 6f 6e 73 20 2d 20 6f 6e 6c 79 20 66 6f 72 20 62  ons - only for b
e5e0: 75 69 6c 64 69 6e 67 20 6c 69 62 72 61 72 79 20  uilding library 
e5f0: 6f 62 6a 65 63 74 73 2e 20 46 6f 72 20 73 74 75  objects. For stu
e600: 62 73 20 61 6e 64 0a 23 20 6d 61 69 6e 20 61 70  bs and.# main ap
e610: 70 6c 69 63 61 74 69 6f 6e 2c 20 74 68 65 20 6d  plication, the m
e620: 61 6b 65 66 69 6c 65 20 73 68 6f 75 6c 64 20 64  akefile should d
e630: 65 66 69 6e 65 20 65 78 70 6c 69 63 69 74 20 72  efine explicit r
e640: 75 6c 65 73 2e 0a 0a 7b 24 28 52 4f 4f 54 29 7d  ules...{$(ROOT)}
e650: 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 6f  .c{$(TMP_DIR)}.o
e660: 62 6a 3a 3a 0a 09 24 28 43 43 50 4b 47 43 4d 44  bj::..$(CCPKGCMD
e670: 29 20 40 3c 3c 0a 24 3c 0a 3c 3c 0a 0a 7b 24 28  ) @<<.$<.<<..{$(
e680: 57 49 4e 5f 44 49 52 29 7d 2e 63 7b 24 28 54 4d  WIN_DIR)}.c{$(TM
e690: 50 5f 44 49 52 29 7d 2e 6f 62 6a 3a 3a 0a 09 24  P_DIR)}.obj::..$
e6a0: 28 43 43 50 4b 47 43 4d 44 29 20 40 3c 3c 0a 24  (CCPKGCMD) @<<.$
e6b0: 3c 0a 3c 3c 0a 0a 7b 24 28 47 45 4e 45 52 49 43  <.<<..{$(GENERIC
e6c0: 44 49 52 29 7d 2e 63 7b 24 28 54 4d 50 5f 44 49  DIR)}.c{$(TMP_DI
e6d0: 52 29 7d 2e 6f 62 6a 3a 3a 0a 09 24 28 43 43 50  R)}.obj::..$(CCP
e6e0: 4b 47 43 4d 44 29 20 40 3c 3c 0a 24 3c 0a 3c 3c  KGCMD) @<<.$<.<<
e6f0: 0a 0a 7b 24 28 43 4f 4d 50 41 54 44 49 52 29 7d  ..{$(COMPATDIR)}
e700: 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 6f  .c{$(TMP_DIR)}.o
e710: 62 6a 3a 3a 0a 09 24 28 43 43 50 4b 47 43 4d 44  bj::..$(CCPKGCMD
e720: 29 20 40 3c 3c 0a 24 3c 0a 3c 3c 0a 0a 7b 24 28  ) @<<.$<.<<..{$(
e730: 52 43 44 49 52 29 7d 2e 72 63 7b 24 28 54 4d 50  RCDIR)}.rc{$(TMP
e740: 5f 44 49 52 29 7d 2e 72 65 73 3a 0a 09 24 28 52  _DIR)}.res:..$(R
e750: 45 53 43 4d 44 29 20 24 3c 0a 0a 7b 24 28 57 49  ESCMD) $<..{$(WI
e760: 4e 5f 44 49 52 29 7d 2e 72 63 7b 24 28 54 4d 50  N_DIR)}.rc{$(TMP
e770: 5f 44 49 52 29 7d 2e 72 65 73 3a 0a 09 24 28 52  _DIR)}.res:..$(R
e780: 45 53 43 4d 44 29 20 24 3c 0a 0a 7b 24 28 54 4d  ESCMD) $<..{$(TM
e790: 50 5f 44 49 52 29 7d 2e 72 63 7b 24 28 54 4d 50  P_DIR)}.rc{$(TMP
e7a0: 5f 44 49 52 29 7d 2e 72 65 73 3a 0a 09 24 28 52  _DIR)}.res:..$(R
e7b0: 45 53 43 4d 44 29 20 24 3c 0a 0a 2e 53 55 46 46  ESCMD) $<...SUFF
e7c0: 49 58 45 53 3a 0a 2e 53 55 46 46 49 58 45 53 3a  IXES:..SUFFIXES:
e7d0: 2e 63 20 2e 72 63 0a 0a 21 65 6e 64 69 66 0a 0a  .c .rc..!endif..
e7e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e7f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e800: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e810: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e820: 0a 23 20 31 34 2e 20 53 61 6e 69 74 79 20 63 68  .# 14. Sanity ch
e830: 65 63 6b 20 73 65 6c 65 63 74 65 64 20 6f 70 74  eck selected opt
e840: 69 6f 6e 73 20 61 67 61 69 6e 73 74 20 54 63 6c  ions against Tcl
e850: 20 62 75 69 6c 64 20 6f 70 74 69 6f 6e 73 0a 23   build options.#
e860: 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 61   When building a
e870: 6e 20 65 78 74 65 6e 73 69 6f 6e 2c 20 63 65 72  n extension, cer
e880: 74 61 69 6e 20 63 6f 6e 66 69 67 75 72 61 74 69  tain configurati
e890: 6f 6e 20 6f 70 74 69 6f 6e 73 20 73 68 6f 75 6c  on options shoul
e8a0: 64 0a 23 20 6d 61 74 63 68 20 74 68 65 20 6f 6e  d.# match the on
e8b0: 65 73 20 75 73 65 64 20 77 68 65 6e 20 54 63 6c  es used when Tcl
e8c0: 20 77 61 73 20 62 75 69 6c 74 2e 20 48 65 72 65   was built. Here
e8d0: 20 77 65 20 63 68 65 63 6b 20 61 6e 64 0a 23 20   we check and.# 
e8e0: 77 61 72 6e 20 6f 6e 20 61 20 6d 69 73 6d 61 74  warn on a mismat
e8f0: 63 68 2e 0a 21 69 66 20 21 24 28 44 4f 49 4e 47  ch..!if !$(DOING
e900: 5f 54 43 4c 29 0a 0a 21 69 66 20 24 28 54 43 4c  _TCL)..!if $(TCL
e910: 49 4e 53 54 41 4c 4c 29 20 23 20 42 75 69 6c 64  INSTALL) # Build
e920: 69 6e 67 20 61 67 61 69 6e 73 74 20 61 6e 20 69  ing against an i
e930: 6e 73 74 61 6c 6c 65 64 20 54 63 6c 0a 21 69 66  nstalled Tcl.!if
e940: 20 65 78 69 73 74 28 22 24 28 5f 54 43 4c 44 49   exist("$(_TCLDI
e950: 52 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 74 63 6c  R)\lib\nmake\tcl
e960: 2e 6e 6d 61 6b 65 22 29 0a 54 43 4c 4e 4d 41 4b  .nmake").TCLNMAK
e970: 45 43 4f 4e 46 49 47 20 3d 20 22 24 28 5f 54 43  ECONFIG = "$(_TC
e980: 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c  LDIR)\lib\nmake\
e990: 74 63 6c 2e 6e 6d 61 6b 65 22 0a 21 65 6e 64 69  tcl.nmake".!endi
e9a0: 66 0a 21 65 6c 73 65 20 23 20 21 24 28 54 43 4c  f.!else # !$(TCL
e9b0: 49 4e 53 54 41 4c 4c 29 20 2d 20 62 75 69 6c 64  INSTALL) - build
e9c0: 69 6e 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20  ing against Tcl 
e9d0: 73 6f 75 72 63 65 0a 21 69 66 20 65 78 69 73 74  source.!if exist
e9e0: 28 22 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e  ("$(_TCLDIR)\win
e9f0: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c  \$(BUILDDIRTOP)\
ea00: 74 63 6c 2e 6e 6d 61 6b 65 22 29 0a 54 43 4c 4e  tcl.nmake").TCLN
ea10: 4d 41 4b 45 43 4f 4e 46 49 47 09 3d 20 22 24 28  MAKECONFIG.= "$(
ea20: 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42  _TCLDIR)\win\$(B
ea30: 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 2e  UILDDIRTOP)\tcl.
ea40: 6e 6d 61 6b 65 22 0a 21 65 6e 64 69 66 0a 21 65  nmake".!endif.!e
ea50: 6e 64 69 66 20 23 20 54 43 4c 49 4e 53 54 41 4c  ndif # TCLINSTAL
ea60: 4c 0a 0a 21 69 66 20 24 28 43 4f 4e 46 49 47 5f  L..!if $(CONFIG_
ea70: 43 48 45 43 4b 29 0a 21 69 66 64 65 66 20 54 43  CHECK).!ifdef TC
ea80: 4c 4e 4d 41 4b 45 43 4f 4e 46 49 47 0a 21 69 6e  LNMAKECONFIG.!in
ea90: 63 6c 75 64 65 20 24 28 54 43 4c 4e 4d 41 4b 45  clude $(TCLNMAKE
eaa0: 43 4f 4e 46 49 47 29 0a 0a 21 69 66 20 64 65 66  CONFIG)..!if def
eab0: 69 6e 65 64 28 43 4f 52 45 5f 4d 41 43 48 49 4e  ined(CORE_MACHIN
eac0: 45 29 20 26 26 20 22 24 28 43 4f 52 45 5f 4d 41  E) && "$(CORE_MA
ead0: 43 48 49 4e 45 29 22 20 21 3d 20 22 24 28 4d 41  CHINE)" != "$(MA
eae0: 43 48 49 4e 45 29 22 0a 21 65 72 72 6f 72 20 45  CHINE)".!error E
eaf0: 52 52 4f 52 3a 20 42 75 69 6c 64 20 74 61 72 67  RROR: Build targ
eb00: 65 74 20 28 24 28 4d 41 43 48 49 4e 45 29 29 20  et ($(MACHINE)) 
eb10: 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 74  does not match t
eb20: 68 65 20 54 63 6c 20 6c 69 62 72 61 72 79 20 61  he Tcl library a
eb30: 72 63 68 69 74 65 63 74 75 72 65 20 28 24 28 43  rchitecture ($(C
eb40: 4f 52 45 5f 4d 41 43 48 49 4e 45 29 29 2e 0a 21  ORE_MACHINE))..!
eb50: 65 6e 64 69 66 0a 21 69 66 20 24 28 54 43 4c 5f  endif.!if $(TCL_
eb60: 56 45 52 53 49 4f 4e 29 20 3c 20 38 37 20 26 26  VERSION) < 87 &&
eb70: 20 64 65 66 69 6e 65 64 28 43 4f 52 45 5f 55 53   defined(CORE_US
eb80: 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 20  E_THREAD_ALLOC) 
eb90: 26 26 20 24 28 43 4f 52 45 5f 55 53 45 5f 54 48  && $(CORE_USE_TH
eba0: 52 45 41 44 5f 41 4c 4c 4f 43 29 20 21 3d 20 24  READ_ALLOC) != $
ebb0: 28 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f  (USE_THREAD_ALLO
ebc0: 43 29 0a 21 6d 65 73 73 61 67 65 20 57 41 52 4e  C).!message WARN
ebd0: 49 4e 47 3a 20 56 61 6c 75 65 20 6f 66 20 55 53  ING: Value of US
ebe0: 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 20 28  E_THREAD_ALLOC (
ebf0: 24 28 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c  $(USE_THREAD_ALL
ec00: 4f 43 29 29 20 64 6f 65 73 20 6e 6f 74 20 6d 61  OC)) does not ma
ec10: 74 63 68 20 69 74 73 20 54 63 6c 20 63 6f 72 65  tch its Tcl core
ec20: 20 76 61 6c 75 65 20 28 24 28 43 4f 52 45 5f 55   value ($(CORE_U
ec30: 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29  SE_THREAD_ALLOC)
ec40: 29 2e 0a 21 65 6e 64 69 66 0a 21 69 66 20 64 65  )..!endif.!if de
ec50: 66 69 6e 65 64 28 43 4f 52 45 5f 44 45 42 55 47  fined(CORE_DEBUG
ec60: 29 20 26 26 20 24 28 43 4f 52 45 5f 44 45 42 55  ) && $(CORE_DEBU
ec70: 47 29 20 21 3d 20 24 28 44 45 42 55 47 29 0a 21  G) != $(DEBUG).!
ec80: 6d 65 73 73 61 67 65 20 57 41 52 4e 49 4e 47 3a  message WARNING:
ec90: 20 56 61 6c 75 65 20 6f 66 20 44 45 42 55 47 20   Value of DEBUG 
eca0: 28 24 28 44 45 42 55 47 29 29 20 64 6f 65 73 20  ($(DEBUG)) does 
ecb0: 6e 6f 74 20 6d 61 74 63 68 20 69 74 73 20 54 63  not match its Tc
ecc0: 6c 20 6c 69 62 72 61 72 79 20 63 6f 6e 66 69 67  l library config
ecd0: 75 72 61 74 69 6f 6e 20 28 24 28 44 45 42 55 47  uration ($(DEBUG
ece0: 29 29 2e 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69  ))..!endif.!endi
ecf0: 66 0a 0a 21 65 6e 64 69 66 20 23 20 54 43 4c 4e  f..!endif # TCLN
ed00: 4d 41 4b 45 43 4f 4e 46 49 47 0a 0a 21 65 6e 64  MAKECONFIG..!end
ed10: 69 66 20 23 20 21 24 28 44 4f 49 4e 47 5f 54 43  if # !$(DOING_TC
ed20: 4c 29 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  L)...#----------
ed30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ed40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ed50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ed60: 0a 23 20 44 69 73 70 6c 61 79 20 73 74 61 74 73  .# Display stats
ed70: 20 62 65 69 6e 67 20 75 73 65 64 2e 0a 23 2d 2d   being used..#--
ed80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ed90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
eda0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
edb0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 21 69 66 20 21 24  --------..!if !$
edc0: 28 44 4f 49 4e 47 5f 54 43 4c 29 0a 21 6d 65 73  (DOING_TCL).!mes
edd0: 73 61 67 65 20 2a 2a 2a 20 42 75 69 6c 64 69 6e  sage *** Buildin
ede0: 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 61 74  g against Tcl at
edf0: 20 27 24 28 5f 54 43 4c 44 49 52 29 27 0a 21 65   '$(_TCLDIR)'.!e
ee00: 6e 64 69 66 0a 21 69 66 20 21 24 28 44 4f 49 4e  ndif.!if !$(DOIN
ee10: 47 5f 54 4b 29 20 26 26 20 24 28 4e 45 45 44 5f  G_TK) && $(NEED_
ee20: 54 4b 29 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  TK).!message ***
ee30: 20 42 75 69 6c 64 69 6e 67 20 61 67 61 69 6e 73   Building agains
ee40: 74 20 54 6b 20 61 74 20 27 24 28 5f 54 4b 44 49  t Tk at '$(_TKDI
ee50: 52 29 27 0a 21 65 6e 64 69 66 0a 21 6d 65 73 73  R)'.!endif.!mess
ee60: 61 67 65 20 2a 2a 2a 20 49 6e 74 65 72 6d 65 64  age *** Intermed
ee70: 69 61 74 65 20 64 69 72 65 63 74 6f 72 79 20 77  iate directory w
ee80: 69 6c 6c 20 62 65 20 27 24 28 54 4d 50 5f 44 49  ill be '$(TMP_DI
ee90: 52 29 27 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  R)'.!message ***
eea0: 20 4f 75 74 70 75 74 20 64 69 72 65 63 74 6f 72   Output director
eeb0: 79 20 77 69 6c 6c 20 62 65 20 27 24 28 4f 55 54  y will be '$(OUT
eec0: 5f 44 49 52 29 27 0a 21 6d 65 73 73 61 67 65 20  _DIR)'.!message 
eed0: 2a 2a 2a 20 49 6e 73 74 61 6c 6c 61 74 69 6f 6e  *** Installation
eee0: 2c 20 69 66 20 73 65 6c 65 63 74 65 64 2c 20 77  , if selected, w
eef0: 69 6c 6c 20 62 65 20 69 6e 20 27 24 28 5f 49 4e  ill be in '$(_IN
ef00: 53 54 41 4c 4c 44 49 52 29 27 0a 21 6d 65 73 73  STALLDIR)'.!mess
ef10: 61 67 65 20 2a 2a 2a 20 53 75 66 66 69 78 20 66  age *** Suffix f
ef20: 6f 72 20 62 69 6e 61 72 69 65 73 20 77 69 6c 6c  or binaries will
ef30: 20 62 65 20 27 24 28 53 55 46 58 29 27 0a 21 6d   be '$(SUFX)'.!m
ef40: 65 73 73 61 67 65 20 2a 2a 2a 20 43 6f 6d 70 69  essage *** Compi
ef50: 6c 65 72 20 76 65 72 73 69 6f 6e 20 24 28 56 43  ler version $(VC
ef60: 56 45 52 29 2e 20 54 61 72 67 65 74 20 24 28 4d  VER). Target $(M
ef70: 41 43 48 49 4e 45 29 2c 20 68 6f 73 74 20 24 28  ACHINE), host $(
ef80: 4e 41 54 49 56 45 5f 41 52 43 48 29 2e 0a 0a 21  NATIVE_ARCH)...!
ef90: 65 6e 64 69 66 20 23 20 69 66 64 65 66 20 5f 52  endif # ifdef _R
efa0: 55 4c 45 53 5f 56 43 0a                          ULES_VC.