Hex Artifact Content

Artifact 95d32dd9c5fc6165ea5cb92aec865ab7b00bdb30e593a25c54238e24c0a1a4d8:


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 35 0a 0a  ION_MINOR = 15..
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 45 78 74 72  atures.# 6. Extr
09d0: 61 63 74 20 54 63 6c 2c 20 54 6b 2c 20 61 6e 64  act Tcl, Tk, and
09e0: 20 70 6f 73 73 69 62 6c 79 20 65 78 74 65 6e 73   possibly extens
09f0: 69 6f 6e 73 2c 20 76 65 72 73 69 6f 6e 20 6e 75  ions, version nu
0a00: 6d 62 65 72 73 20 66 72 6f 6d 20 74 68 65 0a 23  mbers from the.#
0a10: 20 20 20 20 68 65 61 64 65 72 73 0a 23 20 37 2e      headers.# 7.
0a20: 20 50 61 72 73 65 20 74 68 65 20 4f 50 54 53 20   Parse the OPTS 
0a30: 6d 61 63 72 6f 20 76 61 6c 75 65 20 66 6f 72 20  macro value for 
0a40: 75 73 65 72 2d 73 70 65 63 69 66 69 65 64 20 62  user-specified b
0a50: 75 69 6c 64 20 63 6f 6e 66 69 67 75 72 61 74 69  uild configurati
0a60: 6f 6e 0a 23 20 38 2e 20 50 61 72 73 65 20 74 68  on.# 8. Parse th
0a70: 65 20 53 54 41 54 53 20 6d 61 63 72 6f 20 76 61  e STATS macro va
0a80: 6c 75 65 20 66 6f 72 20 73 74 61 74 69 73 74 69  lue for statisti
0a90: 63 73 20 69 6e 73 74 72 75 6d 65 6e 74 61 74 69  cs instrumentati
0aa0: 6f 6e 0a 23 20 39 2e 20 50 61 72 73 65 20 74 68  on.# 9. Parse th
0ab0: 65 20 43 48 45 43 4b 53 20 6d 61 63 72 6f 20 66  e CHECKS macro f
0ac0: 6f 72 20 61 64 64 69 74 69 6f 6e 61 6c 20 63 6f  or additional co
0ad0: 6d 70 69 6c 61 74 69 6f 6e 20 63 68 65 63 6b 73  mpilation checks
0ae0: 0a 23 20 31 30 2e 20 42 61 73 65 64 20 6f 6e 20  .# 10. Based on 
0af0: 74 68 69 73 20 73 65 6c 65 63 74 65 64 20 63 6f  this selected co
0b00: 6e 66 69 67 75 72 61 74 69 6f 6e 2c 20 63 6f 6e  nfiguration, con
0b10: 73 74 72 75 63 74 20 74 68 65 20 6f 75 74 70 75  struct the outpu
0b20: 74 0a 23 20 20 20 20 20 64 69 72 65 63 74 6f 72  t.#     director
0b30: 79 20 61 6e 64 20 66 69 6c 65 20 70 61 74 68 73  y and file paths
0b40: 0a 23 20 31 31 2e 20 43 6f 6e 73 74 72 75 63 74  .# 11. Construct
0b50: 20 74 68 65 20 70 61 74 68 73 20 77 68 65 72 65   the paths where
0b60: 20 74 68 65 20 70 61 63 6b 61 67 65 20 69 73 20   the package is 
0b70: 74 6f 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a  to be installed.
0b80: 23 20 31 32 2e 20 53 65 74 20 75 70 20 74 68 65  # 12. Set up the
0b90: 20 61 63 74 75 61 6c 20 6f 70 74 69 6f 6e 73 20   actual options 
0ba0: 70 61 73 73 65 64 20 74 6f 20 63 6f 6d 70 69 6c  passed to compil
0bb0: 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72 20 62 61  er and linker ba
0bc0: 73 65 64 0a 23 20 20 20 20 20 6f 6e 20 74 68 65  sed.#     on the
0bd0: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 67 61 74   information gat
0be0: 68 65 72 65 64 20 61 62 6f 76 65 2e 0a 23 20 31  hered above..# 1
0bf0: 33 2e 20 44 65 66 69 6e 65 20 73 6f 6d 65 20 73  3. Define some s
0c00: 74 61 6e 64 61 72 64 20 62 75 69 6c 64 20 74 61  tandard build ta
0c10: 72 67 65 74 73 20 61 6e 64 20 69 6d 70 6c 69 63  rgets and implic
0c20: 69 74 20 72 75 6c 65 73 2e 20 54 68 65 73 65 20  it rules. These 
0c30: 6d 61 79 0a 23 20 20 20 20 20 62 65 20 6f 70 74  may.#     be opt
0c40: 69 6f 6e 61 6c 6c 79 20 64 69 73 61 62 6c 65 64  ionally disabled
0c50: 20 62 79 20 74 68 65 20 70 61 72 65 6e 74 20 6d   by the parent m
0c60: 61 6b 65 66 69 6c 65 2e 0a 23 20 31 34 2e 20 28  akefile..# 14. (
0c70: 46 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 20 6f  For extensions o
0c80: 6e 6c 79 2e 29 20 43 6f 6d 70 61 72 65 20 74 68  nly.) Compare th
0c90: 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20  e configuration 
0ca0: 6f 66 20 74 68 65 20 74 61 72 67 65 74 0a 23 20  of the target.# 
0cb0: 20 20 20 20 54 63 6c 20 61 6e 64 20 74 68 65 20      Tcl and the 
0cc0: 65 78 74 65 6e 73 69 6f 6e 73 20 61 6e 64 20 77  extensions and w
0cd0: 61 72 6e 20 61 67 61 69 6e 73 74 20 64 69 73 63  arn against disc
0ce0: 72 65 70 61 6e 63 69 65 73 2e 0a 23 0a 23 20 4f  repancies..#.# O
0cf0: 6e 65 20 66 69 6e 61 6c 20 6e 6f 74 65 20 61 62  ne final note ab
0d00: 6f 75 74 20 74 68 65 20 6d 61 63 72 6f 20 6e 61  out the macro na
0d10: 6d 65 73 20 75 73 65 64 2e 20 54 68 65 79 20 61  mes used. They a
0d20: 72 65 20 61 73 20 74 68 65 79 20 61 72 65 0a 23  re as they are.#
0d30: 20 66 6f 72 20 68 69 73 74 6f 72 69 63 61 6c 20   for historical 
0d40: 72 65 61 73 6f 6e 73 2e 20 57 65 20 77 6f 75 6c  reasons. We woul
0d50: 64 20 6c 69 6b 65 20 6c 65 67 61 63 79 20 65 78  d like legacy ex
0d60: 74 65 6e 73 69 6f 6e 73 20 74 6f 0a 23 20 63 6f  tensions to.# co
0d70: 6e 74 69 6e 75 65 20 74 6f 20 77 6f 72 6b 20 77  ntinue to work w
0d80: 69 74 68 20 74 68 69 73 20 6d 61 6b 65 20 69 6e  ith this make in
0d90: 63 6c 75 64 65 20 66 69 6c 65 20 73 6f 20 62 65  clude file so be
0da0: 20 77 61 72 79 20 6f 66 0a 23 20 63 68 61 6e 67   wary of.# chang
0db0: 69 6e 67 20 74 68 65 6d 20 66 6f 72 20 63 6f 6e  ing them for con
0dc0: 73 69 73 74 65 6e 63 79 20 6f 72 20 63 6c 61 72  sistency or clar
0dd0: 69 74 79 2e 0a 0a 23 20 30 2e 20 53 61 6e 69 74  ity...# 0. Sanit
0de0: 79 20 63 68 65 63 6b 20 63 6f 6d 70 69 6c 65 72  y check compiler
0df0: 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a 0a 23 20   environment..# 
0e00: 43 68 65 63 6b 20 74 6f 20 73 65 65 20 77 65 20  Check to see we 
0e10: 61 72 65 20 63 6f 6e 66 69 67 75 72 65 64 20 74  are configured t
0e20: 6f 20 62 75 69 6c 64 20 77 69 74 68 20 4d 53 56  o build with MSV
0e30: 43 20 28 4d 53 44 45 56 44 49 52 2c 20 4d 53 56  C (MSDEVDIR, MSV
0e40: 43 44 49 52 20 6f 72 0a 23 20 56 43 49 4e 53 54  CDIR or.# VCINST
0e50: 41 4c 4c 44 49 52 29 20 6f 72 20 77 69 74 68 20  ALLDIR) or with 
0e60: 74 68 65 20 4d 53 20 50 6c 61 74 66 6f 72 6d 20  the MS Platform 
0e70: 53 44 4b 20 28 4d 53 53 44 4b 20 6f 72 20 57 69  SDK (MSSDK or Wi
0e80: 6e 64 6f 77 73 53 44 4b 44 69 72 29 0a 0a 21 69  ndowsSDKDir)..!i
0e90: 66 20 21 64 65 66 69 6e 65 64 28 4d 53 44 45 56  f !defined(MSDEV
0ea0: 44 49 52 29 20 26 26 20 21 64 65 66 69 6e 65 64  DIR) && !defined
0eb0: 28 4d 53 56 43 44 49 52 29 20 26 26 20 21 64 65  (MSVCDIR) && !de
0ec0: 66 69 6e 65 64 28 56 43 49 4e 53 54 41 4c 4c 44  fined(VCINSTALLD
0ed0: 49 52 29 20 26 26 20 21 64 65 66 69 6e 65 64 28  IR) && !defined(
0ee0: 4d 53 53 44 4b 29 20 26 26 20 21 64 65 66 69 6e  MSSDK) && !defin
0ef0: 65 64 28 57 49 4e 44 4f 57 53 53 44 4b 44 49 52  ed(WINDOWSSDKDIR
0f00: 29 0a 4d 53 47 20 3d 20 5e 0a 56 69 73 75 61 6c  ).MSG = ^.Visual
0f10: 20 43 2b 2b 20 63 6f 6d 70 69 6c 65 72 20 65 6e   C++ compiler en
0f20: 76 69 72 6f 6e 6d 65 6e 74 20 6e 6f 74 20 69 6e  vironment not in
0f30: 69 74 69 61 6c 69 7a 65 64 2e 0a 21 65 72 72 6f  itialized..!erro
0f40: 72 20 24 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a  r $(MSG).!endif.
0f50: 0a 23 20 57 65 20 6e 65 65 64 20 74 6f 20 72 75  .# We need to ru
0f60: 6e 20 66 72 6f 6d 20 74 68 65 20 64 69 72 65 63  n from the direc
0f70: 74 6f 72 79 20 74 68 65 20 70 61 72 65 6e 74 20  tory the parent 
0f80: 6d 61 6b 65 66 69 6c 65 20 69 73 20 6c 6f 63 61  makefile is loca
0f90: 74 65 64 20 69 6e 2e 0a 23 20 6e 6d 61 6b 65 20  ted in..# nmake 
0fa0: 64 6f 65 73 20 6e 6f 74 20 74 65 6c 6c 20 75 73  does not tell us
0fb0: 20 77 68 61 74 20 6d 61 6b 65 66 69 6c 65 20 77   what makefile w
0fc0: 61 73 20 75 73 65 64 20 74 6f 20 69 6e 76 6f 6b  as used to invok
0fd0: 65 20 69 74 20 73 6f 20 70 61 72 65 6e 74 0a 23  e it so parent.#
0fe0: 20 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 74 6f   makefile has to
0ff0: 20 73 65 74 20 74 68 65 20 4d 41 4b 45 46 49 4c   set the MAKEFIL
1000: 45 56 43 20 6d 61 63 72 6f 20 6f 72 20 77 65 20  EVC macro or we 
1010: 6a 75 73 74 20 6d 61 6b 65 20 61 20 67 75 65 73  just make a gues
1020: 73 20 61 6e 64 0a 23 20 77 61 72 6e 20 69 66 20  s and.# warn if 
1030: 77 65 20 74 68 69 6e 6b 20 74 68 61 74 20 69 73  we think that is
1040: 20 6e 6f 74 20 74 68 65 20 63 61 73 65 2e 0a 21   not the case..!
1050: 69 66 20 22 24 28 4d 41 4b 45 46 49 4c 45 56 43  if "$(MAKEFILEVC
1060: 29 22 20 3d 3d 20 22 22 0a 0a 21 69 66 20 65 78  )" == ""..!if ex
1070: 69 73 74 28 22 24 28 50 52 4f 4a 45 43 54 29 2e  ist("$(PROJECT).
1080: 76 63 22 29 0a 4d 41 4b 45 46 49 4c 45 56 43 20  vc").MAKEFILEVC 
1090: 3d 20 24 28 50 52 4f 4a 45 43 54 29 2e 76 63 0a  = $(PROJECT).vc.
10a0: 21 65 6c 73 65 69 66 20 65 78 69 73 74 28 22 6d  !elseif exist("m
10b0: 61 6b 65 66 69 6c 65 2e 76 63 22 29 0a 4d 41 4b  akefile.vc").MAK
10c0: 45 46 49 4c 45 56 43 20 3d 20 6d 61 6b 65 66 69  EFILEVC = makefi
10d0: 6c 65 2e 76 63 0a 21 65 6e 64 69 66 0a 21 65 6e  le.vc.!endif.!en
10e0: 64 69 66 20 23 20 22 24 28 4d 41 4b 45 46 49 4c  dif # "$(MAKEFIL
10f0: 45 56 43 29 22 20 3d 3d 20 22 22 0a 0a 21 69 66  EVC)" == ""..!if
1100: 20 21 65 78 69 73 74 28 22 24 28 4d 41 4b 45 46   !exist("$(MAKEF
1110: 49 4c 45 56 43 29 22 29 0a 4d 53 47 20 3d 20 5e  ILEVC)").MSG = ^
1120: 0a 59 6f 75 20 6d 75 73 74 20 72 75 6e 20 6e 6d  .You must run nm
1130: 61 6b 65 20 66 72 6f 6d 20 74 68 65 20 64 69 72  ake from the dir
1140: 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e  ectory containin
1150: 67 20 74 68 65 20 70 72 6f 6a 65 63 74 20 6d 61  g the project ma
1160: 6b 65 66 69 6c 65 2e 5e 0a 49 66 20 79 6f 75 20  kefile.^.If you 
1170: 61 72 65 20 64 6f 69 6e 67 20 74 68 61 74 20 61  are doing that a
1180: 6e 64 20 67 65 74 74 69 6e 67 20 74 68 69 73 20  nd getting this 
1190: 6d 65 73 73 61 67 65 2c 20 73 65 74 20 74 68 65  message, set the
11a0: 20 4d 41 4b 45 46 49 4c 45 56 43 5e 0a 6d 61 63   MAKEFILEVC^.mac
11b0: 72 6f 20 74 6f 20 74 68 65 20 6e 61 6d 65 20 6f  ro to the name o
11c0: 66 20 74 68 65 20 70 72 6f 6a 65 63 74 20 6d 61  f the project ma
11d0: 6b 65 66 69 6c 65 2e 0a 21 6d 65 73 73 61 67 65  kefile..!message
11e0: 20 57 41 52 4e 49 4e 47 3a 20 24 28 4d 53 47 29   WARNING: $(MSG)
11f0: 0a 21 65 6e 64 69 66 0a 0a 0a 23 23 23 23 23 23  .!endif...######
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 23 23 23 23 23 23 23  ################
1230: 23 23 23 23 23 23 23 23 23 23 0a 23 20 31 2e 20  ##########.# 1. 
1240: 44 65 66 69 6e 65 20 65 78 74 65 72 6e 61 6c 20  Define external 
1250: 70 72 6f 67 72 61 6d 73 20 62 65 69 6e 67 20 75  programs being u
1260: 73 65 64 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  sed..#----------
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 2d  ----------------
1290: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12a0: 0a 23 20 53 65 74 20 74 68 65 20 70 72 6f 70 65  .# Set the prope
12b0: 72 20 63 6f 70 79 20 6d 65 74 68 6f 64 20 74 6f  r copy method to
12c0: 20 61 76 6f 69 64 20 6f 76 65 72 77 72 69 74 65   avoid overwrite
12d0: 20 71 75 65 73 74 69 6f 6e 73 0a 23 20 74 6f 20   questions.# to 
12e0: 74 68 65 20 75 73 65 72 20 77 68 65 6e 20 63 6f  the user when co
12f0: 70 79 69 6e 67 20 66 69 6c 65 73 20 61 6e 64 20  pying files and 
1300: 73 65 6c 65 63 74 69 6e 67 20 74 68 65 20 72 69  selecting the ri
1310: 67 68 74 0a 23 20 22 64 65 6c 65 74 65 20 61 6c  ght.# "delete al
1320: 6c 22 20 6d 65 74 68 6f 64 2e 0a 23 2d 2d 2d 2d  l" method..#----
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 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1360: 2d 2d 2d 2d 2d 2d 0a 0a 52 4d 44 49 52 09 3d 20  ------..RMDIR.= 
1370: 72 6d 64 69 72 20 2f 53 20 2f 51 0a 43 50 59 09  rmdir /S /Q.CPY.
1380: 3d 20 78 63 6f 70 79 20 2f 69 20 2f 79 20 3e 4e  = xcopy /i /y >N
1390: 55 4c 0a 43 50 59 44 49 52 20 20 3d 20 78 63 6f  UL.CPYDIR  = xco
13a0: 70 79 20 2f 65 20 2f 69 20 2f 79 20 3e 4e 55 4c  py /e /i /y >NUL
13b0: 0a 43 4f 50 59 09 3d 20 63 6f 70 79 20 2f 79 20  .COPY.= copy /y 
13c0: 3e 4e 55 4c 0a 4d 4b 44 49 52 20 20 20 3d 20 6d  >NUL.MKDIR   = m
13d0: 6b 64 69 72 0a 0a 23 23 23 23 23 23 23 23 23 23  kdir..##########
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 23 23 23 23 23  ################
1410: 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 32  ############.# 2
1420: 2e 20 46 69 67 75 72 65 20 6f 75 74 20 6f 75 72  . Figure out our
1430: 20 62 75 69 6c 64 20 65 6e 76 69 72 6f 6e 6d 65   build environme
1440: 6e 74 20 69 6e 20 74 65 72 6d 73 20 6f 66 20 77  nt in terms of w
1450: 68 61 74 20 77 65 27 72 65 20 62 75 69 6c 64 69  hat we're buildi
1460: 6e 67 2e 0a 23 0a 23 20 28 61 29 20 54 63 6c 20  ng..#.# (a) Tcl 
1470: 69 74 73 65 6c 66 0a 23 20 28 62 29 20 54 6b 0a  itself.# (b) Tk.
1480: 23 20 28 63 29 20 61 20 54 63 6c 20 65 78 74 65  # (c) a Tcl exte
1490: 6e 73 69 6f 6e 20 75 73 69 6e 67 20 6c 69 62 72  nsion using libr
14a0: 61 72 69 65 73 2f 69 6e 63 6c 75 64 65 73 20 66  aries/includes f
14b0: 72 6f 6d 20 61 6e 20 2a 69 6e 73 74 61 6c 6c 65  rom an *installe
14c0: 64 2a 20 54 63 6c 0a 23 20 28 64 29 20 61 20 54  d* Tcl.# (d) a T
14d0: 63 6c 20 65 78 74 65 6e 73 69 6f 6e 20 75 73 69  cl extension usi
14e0: 6e 67 20 6c 69 62 72 61 72 69 65 73 2f 69 6e 63  ng libraries/inc
14f0: 6c 75 64 65 73 20 66 72 6f 6d 20 54 63 6c 20 73  ludes from Tcl s
1500: 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 0a  ource directory.
1510: 23 0a 23 20 54 68 69 73 20 6c 61 73 74 20 69 73  #.# This last is
1520: 20 6e 65 65 64 65 64 20 62 65 63 61 75 73 65 20   needed because 
1530: 73 6f 6d 65 20 65 78 74 65 6e 73 69 6f 6e 73 20  some extensions 
1540: 73 74 69 6c 6c 20 6e 65 65 64 0a 23 20 73 6f 6d  still need.# som
1550: 65 20 54 63 6c 20 69 6e 74 65 72 66 61 63 65 73  e Tcl interfaces
1560: 20 74 68 61 74 20 61 72 65 20 6e 6f 74 20 70 75   that are not pu
1570: 62 6c 69 63 6c 79 20 65 78 70 6f 73 65 64 2e 0a  blicly exposed..
1580: 23 0a 23 20 54 68 65 20 66 72 61 67 6d 65 6e 74  #.# The fragment
1590: 20 77 69 6c 6c 20 73 65 74 20 74 68 65 20 66 6f   will set the fo
15a0: 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 3a 0a  llowing macros:.
15b0: 23 20 52 4f 4f 54 20 2d 20 72 6f 6f 74 20 6f 66  # ROOT - root of
15c0: 20 74 68 69 73 20 6d 6f 64 75 6c 65 20 73 6f 75   this module sou
15d0: 72 63 65 73 0a 23 20 43 4f 4d 50 41 54 44 49 52  rces.# COMPATDIR
15e0: 20 2d 20 73 6f 75 72 63 65 20 64 69 72 65 63 74   - source direct
15f0: 6f 72 79 20 74 68 61 74 20 68 6f 6c 64 73 20 63  ory that holds c
1600: 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 73 6f 75  ompatibility sou
1610: 72 63 65 73 0a 23 20 44 4f 43 44 49 52 20 2d 20  rces.# DOCDIR - 
1620: 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72 79  source directory
1630: 20 63 6f 6e 74 61 69 6e 69 6e 67 20 64 6f 63 75   containing docu
1640: 6d 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65 73 0a  mentation files.
1650: 23 20 47 45 4e 45 52 49 43 44 49 52 20 2d 20 70  # GENERICDIR - p
1660: 6c 61 74 66 6f 72 6d 2d 69 6e 64 65 70 65 6e 64  latform-independ
1670: 65 6e 74 20 73 6f 75 72 63 65 20 64 69 72 65 63  ent source direc
1680: 74 6f 72 79 0a 23 20 57 49 4e 5f 44 49 52 20 2d  tory.# WIN_DIR -
1690: 20 57 69 6e 64 6f 77 73 2d 73 70 65 63 69 66 69   Windows-specifi
16a0: 63 20 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f  c source directo
16b0: 72 79 0a 23 20 54 45 53 54 44 49 52 20 2d 20 64  ry.# TESTDIR - d
16c0: 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e  irectory contain
16d0: 69 6e 67 20 74 65 73 74 20 66 69 6c 65 73 0a 23  ing test files.#
16e0: 20 54 4f 4f 4c 53 44 49 52 20 2d 20 64 69 72 65   TOOLSDIR - dire
16f0: 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67  ctory containing
1700: 20 62 75 69 6c 64 20 74 6f 6f 6c 73 0a 23 20 5f   build tools.# _
1710: 54 43 4c 44 49 52 20 2d 20 72 6f 6f 74 20 6f 66  TCLDIR - root of
1720: 20 74 68 65 20 54 63 6c 20 69 6e 73 74 61 6c 6c   the Tcl install
1730: 61 74 69 6f 6e 20 4f 52 20 74 68 65 20 54 63 6c  ation OR the Tcl
1740: 20 73 6f 75 72 63 65 73 2e 20 4e 6f 74 20 73 65   sources. Not se
1750: 74 0a 23 20 20 20 20 77 68 65 6e 20 62 75 69 6c  t.#    when buil
1760: 64 69 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 2e  ding Tcl itself.
1770: 0a 23 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 2d  .# _INSTALLDIR -
1780: 20 6e 61 74 69 76 65 20 66 6f 72 6d 20 6f 66 20   native form of 
1790: 74 68 65 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e  the installation
17a0: 20 70 61 74 68 2e 20 46 6f 72 20 54 63 6c 0a 23   path. For Tcl.#
17b0: 20 20 20 20 74 68 69 73 20 77 69 6c 6c 20 62 65      this will be
17c0: 20 74 68 65 20 72 6f 6f 74 20 6f 66 20 74 68 65   the root of the
17d0: 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61 74 69 6f   Tcl installatio
17e0: 6e 2e 20 46 6f 72 20 65 78 74 65 6e 73 69 6f 6e  n. For extension
17f0: 73 0a 23 20 20 20 20 74 68 69 73 20 77 69 6c 6c  s.#    this will
1800: 20 62 65 20 74 68 65 20 6c 69 62 20 64 69 72 65   be the lib dire
1810: 63 74 6f 72 79 20 75 6e 64 65 72 20 74 68 65 20  ctory under the 
1820: 72 6f 6f 74 2e 0a 23 20 54 43 4c 49 4e 53 54 41  root..# TCLINSTA
1830: 4c 4c 20 20 2d 20 73 65 74 20 74 6f 20 31 20 69  LL  - set to 1 i
1840: 66 20 5f 54 43 4c 44 49 52 20 72 65 66 65 72 73  f _TCLDIR refers
1850: 20 74 6f 0a 23 20 20 20 20 68 65 61 64 65 72 73   to.#    headers
1860: 20 61 6e 64 20 6c 69 62 72 61 72 69 65 73 20 66   and libraries f
1870: 72 6f 6d 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64  rom an installed
1880: 20 54 63 6c 2c 20 61 6e 64 20 30 20 69 66 20 62   Tcl, and 0 if b
1890: 75 69 6c 74 20 61 67 61 69 6e 73 74 0a 23 20 20  uilt against.#  
18a0: 20 20 54 63 6c 20 73 6f 75 72 63 65 73 2e 20 4e    Tcl sources. N
18b0: 6f 74 20 73 65 74 20 77 68 65 6e 20 62 75 69 6c  ot set when buil
18c0: 64 69 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 2e  ding Tcl itself.
18d0: 20 59 65 73 2c 20 6e 6f 74 20 76 65 72 79 20 77   Yes, not very w
18e0: 65 6c 6c 0a 23 20 20 20 20 6e 61 6d 65 64 2e 0a  ell.#    named..
18f0: 23 20 5f 54 43 4c 5f 48 20 2d 20 6e 61 74 69 76  # _TCL_H - nativ
1900: 65 20 70 61 74 68 20 74 6f 20 74 68 65 20 74 63  e path to the tc
1910: 6c 2e 68 20 66 69 6c 65 0a 23 0a 23 20 49 66 20  l.h file.#.# If 
1920: 54 6b 20 69 73 20 69 6e 76 6f 6c 76 65 64 2c 20  Tk is involved, 
1930: 61 6c 73 6f 20 73 65 74 73 20 74 68 65 20 66 6f  also sets the fo
1940: 6c 6c 6f 77 69 6e 67 0a 23 20 5f 54 4b 44 49 52  llowing.# _TKDIR
1950: 20 2d 20 6e 61 74 69 76 65 20 66 6f 72 6d 20 54   - native form T
1960: 6b 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 4f  k installation O
1970: 52 20 54 6b 20 73 6f 75 72 63 65 2e 20 4e 6f 74  R Tk source. Not
1980: 20 73 65 74 20 69 66 20 62 75 69 6c 64 69 6e 67   set if building
1990: 0a 23 20 20 20 20 54 6b 20 69 74 73 65 6c 66 2e  .#    Tk itself.
19a0: 0a 23 20 54 4b 49 4e 53 54 41 4c 4c 20 2d 20 73  .# TKINSTALL - s
19b0: 65 74 20 31 20 69 66 20 5f 54 4b 44 49 52 20 72  et 1 if _TKDIR r
19c0: 65 66 65 72 73 20 74 6f 20 69 6e 73 74 61 6c 6c  efers to install
19d0: 65 64 20 54 6b 20 61 6e 64 20 30 20 69 66 20 54  ed Tk and 0 if T
19e0: 6b 20 73 6f 75 72 63 65 73 0a 23 20 5f 54 4b 5f  k sources.# _TK_
19f0: 48 20 2d 20 6e 61 74 69 76 65 20 70 61 74 68 20  H - native path 
1a00: 74 6f 20 74 68 65 20 74 6b 2e 68 20 66 69 6c 65  to the tk.h file
1a10: 0a 0a 23 20 52 6f 6f 74 20 64 69 72 65 63 74 6f  ..# Root directo
1a20: 72 79 20 66 6f 72 20 73 6f 75 72 63 65 73 20 61  ry for sources a
1a30: 6e 64 20 61 73 73 75 6d 65 64 20 73 75 62 64 69  nd assumed subdi
1a40: 72 65 63 74 6f 72 69 65 73 0a 52 4f 4f 54 20 3d  rectories.ROOT =
1a50: 20 24 28 4d 41 4b 45 44 49 52 29 5c 2e 2e 0a 23   $(MAKEDIR)\...#
1a60: 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 70   The following p
1a70: 61 74 68 73 20 43 41 4e 4e 4f 54 20 68 61 76 65  aths CANNOT have
1a80: 20 73 70 61 63 65 73 20 69 6e 20 74 68 65 6d 20   spaces in them 
1a90: 61 73 20 74 68 65 79 20 61 70 70 65 61 72 20 6f  as they appear o
1aa0: 6e 20 74 68 65 0a 23 20 6c 65 66 74 20 73 69 64  n the.# left sid
1ab0: 65 20 6f 66 20 69 6d 70 6c 69 63 69 74 20 72 75  e of implicit ru
1ac0: 6c 65 73 2e 0a 21 69 66 6e 64 65 66 20 43 4f 4d  les..!ifndef COM
1ad0: 50 41 54 44 49 52 0a 43 4f 4d 50 41 54 44 49 52  PATDIR.COMPATDIR
1ae0: 09 3d 20 24 28 52 4f 4f 54 29 5c 63 6f 6d 70 61  .= $(ROOT)\compa
1af0: 74 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64 65 66  t.!endif.!ifndef
1b00: 20 44 4f 43 44 49 52 0a 44 4f 43 44 49 52 09 09   DOCDIR.DOCDIR..
1b10: 3d 20 24 28 52 4f 4f 54 29 5c 64 6f 63 0a 21 65  = $(ROOT)\doc.!e
1b20: 6e 64 69 66 0a 21 69 66 6e 64 65 66 20 47 45 4e  ndif.!ifndef GEN
1b30: 45 52 49 43 44 49 52 0a 47 45 4e 45 52 49 43 44  ERICDIR.GENERICD
1b40: 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c 67 65 6e  IR.= $(ROOT)\gen
1b50: 65 72 69 63 0a 21 65 6e 64 69 66 0a 21 69 66 6e  eric.!endif.!ifn
1b60: 64 65 66 20 54 4f 4f 4c 53 44 49 52 0a 54 4f 4f  def TOOLSDIR.TOO
1b70: 4c 53 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c  LSDIR.= $(ROOT)\
1b80: 74 6f 6f 6c 73 0a 21 65 6e 64 69 66 0a 21 69 66  tools.!endif.!if
1b90: 6e 64 65 66 20 54 45 53 54 44 49 52 0a 54 45 53  ndef TESTDIR.TES
1ba0: 54 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c 74  TDIR.= $(ROOT)\t
1bb0: 65 73 74 73 0a 21 65 6e 64 69 66 0a 21 69 66 6e  ests.!endif.!ifn
1bc0: 64 65 66 20 4c 49 42 44 49 52 0a 21 69 66 20 65  def LIBDIR.!if e
1bd0: 78 69 73 74 28 22 24 28 52 4f 4f 54 29 5c 6c 69  xist("$(ROOT)\li
1be0: 62 72 61 72 79 22 29 0a 4c 49 42 44 49 52 20 20  brary").LIBDIR  
1bf0: 20 20 20 20 20 20 20 20 3d 20 24 28 52 4f 4f 54          = $(ROOT
1c00: 29 5c 6c 69 62 72 61 72 79 0a 21 65 6c 73 65 0a  )\library.!else.
1c10: 4c 49 42 44 49 52 20 20 20 20 20 20 20 20 20 20  LIBDIR          
1c20: 3d 20 24 28 52 4f 4f 54 29 5c 6c 69 62 0a 21 65  = $(ROOT)\lib.!e
1c30: 6e 64 69 66 0a 21 65 6e 64 69 66 0a 21 69 66 6e  ndif.!endif.!ifn
1c40: 64 65 66 20 44 45 4d 4f 44 49 52 0a 21 69 66 20  def DEMODIR.!if 
1c50: 65 78 69 73 74 28 22 24 28 4c 49 42 44 49 52 29  exist("$(LIBDIR)
1c60: 5c 64 65 6d 6f 73 22 29 0a 44 45 4d 4f 44 49 52  \demos").DEMODIR
1c70: 09 09 3d 20 24 28 4c 49 42 44 49 52 29 5c 64 65  ..= $(LIBDIR)\de
1c80: 6d 6f 73 0a 21 65 6c 73 65 0a 44 45 4d 4f 44 49  mos.!else.DEMODI
1c90: 52 09 09 3d 20 24 28 52 4f 4f 54 29 5c 64 65 6d  R..= $(ROOT)\dem
1ca0: 6f 73 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  os.!endif.!endif
1cb0: 20 23 20 69 66 6e 64 65 66 20 44 45 4d 4f 44 49   # ifndef DEMODI
1cc0: 52 0a 23 20 44 6f 20 4e 4f 54 20 75 73 65 20 57  R.# Do NOT use W
1cd0: 49 4e 44 49 52 20 62 65 63 61 75 73 65 20 69 74  INDIR because it
1ce0: 20 69 73 20 57 69 6e 64 6f 77 73 20 69 6e 74 65   is Windows inte
1cf0: 72 6e 61 6c 20 65 6e 76 69 72 6f 6e 6d 65 6e 74  rnal environment
1d00: 0a 23 20 76 61 72 69 61 62 6c 65 20 74 6f 20 70  .# variable to p
1d10: 6f 69 6e 74 20 74 6f 20 63 3a 5c 77 69 6e 64 6f  oint to c:\windo
1d20: 77 73 21 0a 57 49 4e 5f 44 49 52 09 09 3d 20 24  ws!.WIN_DIR..= $
1d30: 28 52 4f 4f 54 29 5c 77 69 6e 0a 0a 21 69 66 6e  (ROOT)\win..!ifn
1d40: 64 65 66 20 52 43 44 49 52 0a 21 69 66 20 65 78  def RCDIR.!if ex
1d50: 69 73 74 28 22 24 28 57 49 4e 5f 44 49 52 29 5c  ist("$(WIN_DIR)\
1d60: 72 63 22 29 0a 52 43 44 49 52 20 20 20 20 20 20  rc").RCDIR      
1d70: 20 20 20 20 20 3d 20 24 28 57 49 4e 5f 44 49 52       = $(WIN_DIR
1d80: 29 5c 72 63 0a 21 65 6c 73 65 0a 52 43 44 49 52  )\rc.!else.RCDIR
1d90: 20 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 57             = $(W
1da0: 49 4e 5f 44 49 52 29 0a 21 65 6e 64 69 66 0a 21  IN_DIR).!endif.!
1db0: 65 6e 64 69 66 0a 52 43 44 49 52 20 3d 20 24 28  endif.RCDIR = $(
1dc0: 52 43 44 49 52 3a 2f 3d 5c 29 0a 0a 23 20 54 68  RCDIR:/=\)..# Th
1dd0: 65 20 74 61 72 67 65 74 20 64 69 72 65 63 74 6f  e target directo
1de0: 72 79 20 77 68 65 72 65 20 74 68 65 20 62 75 69  ry where the bui
1df0: 6c 74 20 70 61 63 6b 61 67 65 73 20 61 6e 64 20  lt packages and 
1e00: 62 69 6e 61 72 69 65 73 20 77 69 6c 6c 20 62 65  binaries will be
1e10: 20 69 6e 73 74 61 6c 6c 65 64 2e 0a 23 20 49 4e   installed..# IN
1e20: 53 54 41 4c 4c 44 49 52 20 69 73 20 74 68 65 20  STALLDIR is the 
1e30: 28 6f 70 74 69 6f 6e 61 6c 29 20 70 61 74 68 20  (optional) path 
1e40: 73 70 65 63 69 66 69 65 64 20 62 79 20 74 68 65  specified by the
1e50: 20 75 73 65 72 2e 0a 23 20 5f 49 4e 53 54 41 4c   user..# _INSTAL
1e60: 4c 44 49 52 20 69 73 20 49 4e 53 54 41 4c 4c 44  LDIR is INSTALLD
1e70: 49 52 20 75 73 69 6e 67 20 74 68 65 20 62 61 63  IR using the bac
1e80: 6b 73 6c 61 73 68 20 73 65 70 61 72 61 74 6f 72  kslash separator
1e90: 20 73 79 6e 74 61 78 0a 21 69 66 64 65 66 20 49   syntax.!ifdef I
1ea0: 4e 53 54 41 4c 4c 44 49 52 0a 23 23 23 20 46 69  NSTALLDIR.### Fi
1eb0: 78 20 74 68 65 20 70 61 74 68 20 73 65 70 61 72  x the path separ
1ec0: 61 74 6f 72 73 2e 0a 5f 49 4e 53 54 41 4c 4c 44  ators.._INSTALLD
1ed0: 49 52 09 3d 20 24 28 49 4e 53 54 41 4c 4c 44 49  IR.= $(INSTALLDI
1ee0: 52 3a 2f 3d 5c 29 0a 21 65 6c 73 65 0a 23 23 23  R:/=\).!else.###
1ef0: 20 41 73 73 75 6d 65 20 74 68 65 20 6e 6f 72 6d   Assume the norm
1f00: 61 6c 20 64 65 66 61 75 6c 74 2e 0a 5f 49 4e 53  al default.._INS
1f10: 54 41 4c 4c 44 49 52 09 3d 20 24 28 48 4f 4d 45  TALLDIR.= $(HOME
1f20: 44 52 49 56 45 29 5c 54 63 6c 0a 21 65 6e 64 69  DRIVE)\Tcl.!endi
1f30: 66 0a 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54  f..!if $(DOING_T
1f40: 43 4c 29 0a 0a 23 20 42 45 47 49 4e 20 43 61 73  CL)..# BEGIN Cas
1f50: 65 20 32 28 61 29 20 2d 20 42 75 69 6c 64 69 6e  e 2(a) - Buildin
1f60: 67 20 54 63 6c 20 69 74 73 65 6c 66 0a 0a 23 20  g Tcl itself..# 
1f70: 4f 6e 6c 79 20 6e 65 65 64 20 74 6f 20 64 65 66  Only need to def
1f80: 69 6e 65 20 5f 54 43 4c 5f 48 0a 5f 54 43 4c 5f  ine _TCL_H._TCL_
1f90: 48 20 3d 20 2e 2e 5c 67 65 6e 65 72 69 63 5c 74  H = ..\generic\t
1fa0: 63 6c 2e 68 0a 0a 23 20 45 4e 44 20 43 61 73 65  cl.h..# END Case
1fb0: 20 32 28 61 29 20 2d 20 42 75 69 6c 64 69 6e 67   2(a) - Building
1fc0: 20 54 63 6c 20 69 74 73 65 6c 66 0a 0a 21 65 6c   Tcl itself..!el
1fd0: 73 65 69 66 20 24 28 44 4f 49 4e 47 5f 54 4b 29  seif $(DOING_TK)
1fe0: 0a 0a 23 20 42 45 47 49 4e 20 43 61 73 65 20 32  ..# BEGIN Case 2
1ff0: 28 62 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 54  (b) - Building T
2000: 6b 0a 0a 54 43 4c 49 4e 53 54 41 4c 4c 20 3d 20  k..TCLINSTALL = 
2010: 30 20 23 20 54 6b 20 61 6c 77 61 79 73 20 62 75  0 # Tk always bu
2020: 69 6c 64 73 20 61 67 61 69 6e 73 74 20 54 63 6c  ilds against Tcl
2030: 20 73 6f 75 72 63 65 2c 20 6e 6f 74 20 61 6e 20   source, not an 
2040: 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c 0a 21 69  installed Tcl.!i
2050: 66 20 22 24 28 54 43 4c 44 49 52 29 22 20 3d 3d  f "$(TCLDIR)" ==
2060: 20 22 22 0a 21 69 66 20 5b 65 63 68 6f 20 54 43   "".!if [echo TC
2070: 4c 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68  LDIR = \> nmakeh
2080: 6c 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c 20  lp.out] \.   || 
2090: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20 67 65 6e  [nmakehlp -L gen
20a0: 65 72 69 63 5c 74 63 6c 2e 68 20 3e 3e 20 6e 6d  eric\tcl.h >> nm
20b0: 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72  akehlp.out].!err
20c0: 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74  or *** Could not
20d0: 20 6c 6f 63 61 74 65 20 54 63 6c 20 73 6f 75 72   locate Tcl sour
20e0: 63 65 20 64 69 72 65 63 74 6f 72 79 2e 0a 21 65  ce directory..!e
20f0: 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d  ndif.!include nm
2100: 61 6b 65 68 6c 70 2e 6f 75 74 0a 21 65 6e 64 69  akehlp.out.!endi
2110: 66 20 23 20 54 43 4c 44 49 52 20 3d 3d 20 22 22  f # TCLDIR == ""
2120: 0a 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 54 43  .._TCLDIR.= $(TC
2130: 4c 44 49 52 3a 2f 3d 5c 29 0a 5f 54 43 4c 5f 48  LDIR:/=\)._TCL_H
2140: 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 67    = $(_TCLDIR)\g
2150: 65 6e 65 72 69 63 5c 74 63 6c 2e 68 0a 21 69 66  eneric\tcl.h.!if
2160: 20 21 65 78 69 73 74 28 22 24 28 5f 54 43 4c 5f   !exist("$(_TCL_
2170: 48 29 22 29 0a 21 65 72 72 6f 72 20 43 6f 75 6c  H)").!error Coul
2180: 64 20 6e 6f 74 20 6c 6f 63 61 74 65 20 74 63 6c  d not locate tcl
2190: 2e 68 2e 20 50 6c 65 61 73 65 20 73 65 74 20 74  .h. Please set t
21a0: 68 65 20 54 43 4c 44 49 52 20 6d 61 63 72 6f 20  he TCLDIR macro 
21b0: 74 6f 20 70 6f 69 6e 74 20 74 6f 20 74 68 65 20  to point to the 
21c0: 54 63 6c 20 2a 73 6f 75 72 63 65 2a 20 64 69 72  Tcl *source* dir
21d0: 65 63 74 6f 72 79 2e 0a 21 65 6e 64 69 66 0a 0a  ectory..!endif..
21e0: 5f 54 4b 5f 48 20 3d 20 2e 2e 5c 67 65 6e 65 72  _TK_H = ..\gener
21f0: 69 63 5c 74 6b 2e 68 0a 0a 23 20 45 4e 44 20 43  ic\tk.h..# END C
2200: 61 73 65 20 32 28 62 29 20 2d 20 42 75 69 6c 64  ase 2(b) - Build
2210: 69 6e 67 20 54 6b 0a 0a 21 65 6c 73 65 0a 0a 23  ing Tk..!else..#
2220: 20 42 45 47 49 4e 20 43 61 73 65 20 32 28 63 29   BEGIN Case 2(c)
2230: 20 6f 72 20 28 64 29 20 2d 20 42 75 69 6c 64 69   or (d) - Buildi
2240: 6e 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20  ng an extension 
2250: 6f 74 68 65 72 20 74 68 61 6e 20 54 6b 0a 0a 23  other than Tk..#
2260: 20 49 66 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65   If command line
2270: 20 68 61 73 20 73 70 65 63 69 66 69 65 64 20 54   has specified T
2280: 63 6c 20 6c 6f 63 61 74 69 6f 6e 20 74 68 72 6f  cl location thro
2290: 75 67 68 20 54 43 4c 44 49 52 2c 20 75 73 65 20  ugh TCLDIR, use 
22a0: 69 74 0a 23 20 65 6c 73 65 20 64 65 66 61 75 6c  it.# else defaul
22b0: 74 20 74 6f 20 74 68 65 20 49 4e 53 54 41 4c 4c  t to the INSTALL
22c0: 44 49 52 20 73 65 74 74 69 6e 67 0a 21 69 66 20  DIR setting.!if 
22d0: 22 24 28 54 43 4c 44 49 52 29 22 20 21 3d 20 22  "$(TCLDIR)" != "
22e0: 22 0a 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 54  ".._TCLDIR.= $(T
22f0: 43 4c 44 49 52 3a 2f 3d 5c 29 0a 21 69 66 20 65  CLDIR:/=\).!if e
2300: 78 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29  xist("$(_TCLDIR)
2310: 5c 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 22 29  \include\tcl.h")
2320: 20 23 20 43 61 73 65 20 32 28 63 29 20 77 69 74   # Case 2(c) wit
2330: 68 20 54 43 4c 44 49 52 20 64 65 66 69 6e 65 64  h TCLDIR defined
2340: 0a 54 43 4c 49 4e 53 54 41 4c 4c 09 3d 20 31 0a  .TCLINSTALL.= 1.
2350: 5f 54 43 4c 5f 48 20 20 20 20 20 20 20 20 20 20  _TCL_H          
2360: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e 63  = $(_TCLDIR)\inc
2370: 6c 75 64 65 5c 74 63 6c 2e 68 0a 21 65 6c 73 65  lude\tcl.h.!else
2380: 69 66 20 65 78 69 73 74 28 22 24 28 5f 54 43 4c  if exist("$(_TCL
2390: 44 49 52 29 5c 67 65 6e 65 72 69 63 5c 74 63 6c  DIR)\generic\tcl
23a0: 2e 68 22 29 20 23 20 43 61 73 65 20 32 28 64 29  .h") # Case 2(d)
23b0: 20 77 69 74 68 20 54 43 4c 44 49 52 20 64 65 66   with TCLDIR def
23c0: 69 6e 65 64 0a 54 43 4c 49 4e 53 54 41 4c 4c 09  ined.TCLINSTALL.
23d0: 3d 20 30 0a 5f 54 43 4c 5f 48 20 20 20 20 20 20  = 0._TCL_H      
23e0: 20 20 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29      = $(_TCLDIR)
23f0: 5c 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 0a 21  \generic\tcl.h.!
2400: 65 6e 64 69 66 0a 0a 21 65 6c 73 65 20 20 23 20  endif..!else  # 
2410: 20 23 20 43 61 73 65 20 32 28 63 29 20 66 6f 72   # Case 2(c) for
2420: 20 65 78 74 65 6e 73 69 6f 6e 73 20 77 69 74 68   extensions with
2430: 20 54 43 4c 44 49 52 20 75 6e 64 65 66 69 6e 65   TCLDIR undefine
2440: 64 0a 0a 23 20 4e 65 65 64 20 74 6f 20 6c 6f 63  d..# Need to loc
2450: 61 74 65 20 54 63 6c 20 64 65 70 65 6e 64 69 6e  ate Tcl dependin
2460: 67 20 6f 6e 20 77 68 65 74 68 65 72 20 69 74 20  g on whether it 
2470: 6e 65 65 64 73 20 54 63 6c 20 73 6f 75 72 63 65  needs Tcl source
2480: 20 6f 72 20 6e 6f 74 2e 0a 23 20 49 66 20 77 65   or not..# If we
2490: 20 64 6f 6e 27 74 2c 20 63 68 65 63 6b 20 74 68   don't, check th
24a0: 65 20 49 4e 53 54 41 4c 4c 44 49 52 20 66 6f 72  e INSTALLDIR for
24b0: 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63   an installed Tc
24c0: 6c 20 66 69 72 73 74 0a 0a 21 69 66 20 65 78 69  l first..!if exi
24d0: 73 74 28 22 24 28 5f 49 4e 53 54 41 4c 4c 44 49  st("$(_INSTALLDI
24e0: 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68  R)\include\tcl.h
24f0: 22 29 20 26 26 20 21 24 28 4e 45 45 44 5f 54 43  ") && !$(NEED_TC
2500: 4c 5f 53 4f 55 52 43 45 29 0a 0a 54 43 4c 49 4e  L_SOURCE)..TCLIN
2510: 53 54 41 4c 4c 09 3d 20 31 0a 54 43 4c 44 49 52  STALL.= 1.TCLDIR
2520: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 49            = $(_I
2530: 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0a 23 20  NSTALLDIR)\...# 
2540: 4e 4f 54 45 3a 20 77 65 20 77 69 6c 6c 20 62 65  NOTE: we will be
2550: 20 72 65 73 65 74 74 69 6e 67 20 5f 49 4e 53 54   resetting _INST
2560: 41 4c 4c 44 49 52 20 74 6f 20 5f 49 4e 53 54 41  ALLDIR to _INSTA
2570: 4c 4c 44 49 52 2f 6c 69 62 20 66 6f 72 20 65 78  LLDIR/lib for ex
2580: 74 65 6e 73 69 6f 6e 73 0a 23 20 6c 61 74 65 72  tensions.# later
2590: 20 73 6f 20 74 68 65 20 5c 2e 2e 20 61 63 63 6f   so the \.. acco
25a0: 75 6e 74 73 20 66 6f 72 20 74 68 65 20 2f 6c 69  unts for the /li
25b0: 62 0a 5f 54 43 4c 44 49 52 09 09 3d 20 24 28 5f  b._TCLDIR..= $(_
25c0: 49 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0a 5f  INSTALLDIR)\..._
25d0: 54 43 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d  TCL_H          =
25e0: 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e 63 6c   $(_TCLDIR)\incl
25f0: 75 64 65 5c 74 63 6c 2e 68 0a 0a 21 65 6c 73 65  ude\tcl.h..!else
2600: 20 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 26 26   # exist(...) &&
2610: 20 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f 55   !$(NEED_TCL_SOU
2620: 52 43 45 29 0a 0a 21 69 66 20 5b 65 63 68 6f 20  RCE)..!if [echo 
2630: 5f 54 43 4c 44 49 52 20 3d 20 5c 3e 20 6e 6d 61  _TCLDIR = \> nma
2640: 6b 65 68 6c 70 2e 6f 75 74 5d 20 5c 0a 20 20 20  kehlp.out] \.   
2650: 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20  || [nmakehlp -L 
2660: 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 20 3e 3e  generic\tcl.h >>
2670: 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21   nmakehlp.out].!
2680: 65 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20  error *** Could 
2690: 6e 6f 74 20 6c 6f 63 61 74 65 20 54 63 6c 20 73  not locate Tcl s
26a0: 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 2e  ource directory.
26b0: 0a 21 65 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65  .!endif.!include
26c0: 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0a 54 43   nmakehlp.out.TC
26d0: 4c 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20  LINSTALL      = 
26e0: 30 0a 54 43 4c 44 49 52 20 20 20 20 20 20 20 20  0.TCLDIR        
26f0: 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 0a 5f 54   = $(_TCLDIR)._T
2700: 43 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20  CL_H          = 
2710: 24 28 5f 54 43 4c 44 49 52 29 5c 67 65 6e 65 72  $(_TCLDIR)\gener
2720: 69 63 5c 74 63 6c 2e 68 0a 0a 21 65 6e 64 69 66  ic\tcl.h..!endif
2730: 20 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 26 26   # exist(...) &&
2740: 20 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f 55   !$(NEED_TCL_SOU
2750: 52 43 45 29 0a 0a 21 65 6e 64 69 66 20 23 20 54  RCE)..!endif # T
2760: 43 4c 44 49 52 0a 0a 21 69 66 6e 64 65 66 20 5f  CLDIR..!ifndef _
2770: 54 43 4c 5f 48 0a 4d 53 47 20 3d 5e 0a 46 61 69  TCL_H.MSG =^.Fai
2780: 6c 65 64 20 74 6f 20 66 69 6e 64 20 74 63 6c 2e  led to find tcl.
2790: 68 2e 20 54 68 65 20 54 43 4c 44 49 52 20 6d 61  h. The TCLDIR ma
27a0: 63 72 6f 20 69 73 20 73 65 74 20 69 6e 63 6f 72  cro is set incor
27b0: 72 65 63 74 6c 79 20 6f 72 20 69 73 20 6e 6f 74  rectly or is not
27c0: 20 73 65 74 20 61 6e 64 20 64 65 66 61 75 6c 74   set and default
27d0: 20 70 61 74 68 20 64 6f 65 73 20 6e 6f 74 20 63   path does not c
27e0: 6f 6e 74 61 69 6e 20 74 63 6c 2e 68 2e 0a 21 65  ontain tcl.h..!e
27f0: 72 72 6f 72 20 24 28 4d 53 47 29 0a 21 65 6e 64  rror $(MSG).!end
2800: 69 66 0a 0a 23 20 4e 6f 77 20 64 6f 20 74 68 65  if..# Now do the
2810: 20 73 61 6d 65 20 74 6f 20 6c 6f 63 61 74 65 20   same to locate 
2820: 54 6b 20 68 65 61 64 65 72 73 20 61 6e 64 20 6c  Tk headers and l
2830: 69 62 73 20 69 66 20 70 72 6f 6a 65 63 74 20 72  ibs if project r
2840: 65 71 75 69 72 65 73 20 54 6b 0a 21 69 66 20 24  equires Tk.!if $
2850: 28 4e 45 45 44 5f 54 4b 29 0a 0a 21 69 66 20 22  (NEED_TK)..!if "
2860: 24 28 54 4b 44 49 52 29 22 20 21 3d 20 22 22 0a  $(TKDIR)" != "".
2870: 0a 5f 54 4b 44 49 52 20 3d 20 24 28 54 4b 44 49  ._TKDIR = $(TKDI
2880: 52 3a 2f 3d 5c 29 0a 21 69 66 20 65 78 69 73 74  R:/=\).!if exist
2890: 28 22 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c  ("$(_TKDIR)\incl
28a0: 75 64 65 5c 74 6b 2e 68 22 29 0a 54 4b 49 4e 53  ude\tk.h").TKINS
28b0: 54 41 4c 4c 20 20 20 20 20 20 3d 20 31 0a 5f 54  TALL      = 1._T
28c0: 4b 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24  K_H          = $
28d0: 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75 64 65  (_TKDIR)\include
28e0: 5c 74 6b 2e 68 0a 21 65 6c 73 65 69 66 20 65 78  \tk.h.!elseif ex
28f0: 69 73 74 28 22 24 28 5f 54 4b 44 49 52 29 5c 67  ist("$(_TKDIR)\g
2900: 65 6e 65 72 69 63 5c 74 6b 2e 68 22 29 0a 54 4b  eneric\tk.h").TK
2910: 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 30  INSTALL      = 0
2920: 0a 5f 54 4b 5f 48 20 20 20 20 20 20 20 20 20 20  ._TK_H          
2930: 3d 20 24 28 5f 54 4b 44 49 52 29 5c 67 65 6e 65  = $(_TKDIR)\gene
2940: 72 69 63 5c 74 6b 2e 68 0a 21 65 6e 64 69 66 0a  ric\tk.h.!endif.
2950: 0a 21 65 6c 73 65 20 23 20 54 4b 44 49 52 20 6e  .!else # TKDIR n
2960: 6f 74 20 64 65 66 69 6e 65 64 0a 0a 23 20 4e 65  ot defined..# Ne
2970: 65 64 20 74 6f 20 6c 6f 63 61 74 65 20 54 63 6c  ed to locate Tcl
2980: 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 77 68   depending on wh
2990: 65 74 68 65 72 20 69 74 20 6e 65 65 64 73 20 54  ether it needs T
29a0: 63 6c 20 73 6f 75 72 63 65 20 6f 72 20 6e 6f 74  cl source or not
29b0: 2e 0a 23 20 49 66 20 77 65 20 64 6f 6e 27 74 2c  ..# If we don't,
29c0: 20 63 68 65 63 6b 20 74 68 65 20 49 4e 53 54 41   check the INSTA
29d0: 4c 4c 44 49 52 20 66 6f 72 20 61 6e 20 69 6e 73  LLDIR for an ins
29e0: 74 61 6c 6c 65 64 20 54 63 6c 20 66 69 72 73 74  talled Tcl first
29f0: 0a 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f  ..!if exist("$(_
2a00: 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63 6c  INSTALLDIR)\incl
2a10: 75 64 65 5c 74 6b 2e 68 22 29 20 26 26 20 21 24  ude\tk.h") && !$
2a20: 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29  (NEED_TK_SOURCE)
2a30: 0a 0a 54 4b 49 4e 53 54 41 4c 4c 20 20 20 20 20  ..TKINSTALL     
2a40: 20 3d 20 31 0a 23 20 4e 4f 54 45 3a 20 77 65 20   = 1.# NOTE: we 
2a50: 77 69 6c 6c 20 62 65 20 72 65 73 65 74 74 69 6e  will be resettin
2a60: 67 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 74 6f  g _INSTALLDIR to
2a70: 20 5f 49 4e 53 54 41 4c 4c 44 49 52 2f 6c 69 62   _INSTALLDIR/lib
2a80: 20 66 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 0a   for extensions.
2a90: 23 20 6c 61 74 65 72 20 73 6f 20 74 68 65 20 5c  # later so the \
2aa0: 2e 2e 20 61 63 63 6f 75 6e 74 73 20 66 6f 72 20  .. accounts for 
2ab0: 74 68 65 20 2f 6c 69 62 0a 5f 54 4b 44 49 52 20  the /lib._TKDIR 
2ac0: 20 20 20 20 20 20 20 20 3d 20 24 28 5f 49 4e 53          = $(_INS
2ad0: 54 41 4c 4c 44 49 52 29 5c 2e 2e 0a 5f 54 4b 5f  TALLDIR)\..._TK_
2ae0: 48 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f  H          = $(_
2af0: 54 4b 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74  TKDIR)\include\t
2b00: 6b 2e 68 0a 54 4b 44 49 52 20 20 20 20 20 20 20  k.h.TKDIR       
2b10: 20 20 20 3d 20 24 28 5f 54 4b 44 49 52 29 0a 0a     = $(_TKDIR)..
2b20: 21 65 6c 73 65 20 23 20 65 78 69 73 74 28 22 24  !else # exist("$
2b30: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e  (_INSTALLDIR)\in
2b40: 63 6c 75 64 65 5c 74 6b 2e 68 22 29 20 26 26 20  clude\tk.h") && 
2b50: 21 24 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43  !$(NEED_TK_SOURC
2b60: 45 29 0a 0a 21 69 66 20 5b 65 63 68 6f 20 5f 54  E)..!if [echo _T
2b70: 4b 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68  KDIR = \> nmakeh
2b80: 6c 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c 20  lp.out] \.   || 
2b90: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20 67 65 6e  [nmakehlp -L gen
2ba0: 65 72 69 63 5c 74 6b 2e 68 20 3e 3e 20 6e 6d 61  eric\tk.h >> nma
2bb0: 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72 6f  kehlp.out].!erro
2bc0: 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20  r *** Could not 
2bd0: 6c 6f 63 61 74 65 20 54 6b 20 73 6f 75 72 63 65  locate Tk source
2be0: 20 64 69 72 65 63 74 6f 72 79 2e 0a 21 65 6e 64   directory..!end
2bf0: 69 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 6b  if.!include nmak
2c00: 65 68 6c 70 2e 6f 75 74 0a 54 4b 49 4e 53 54 41  ehlp.out.TKINSTA
2c10: 4c 4c 20 20 20 20 20 20 3d 20 30 0a 54 4b 44 49  LL      = 0.TKDI
2c20: 52 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f  R          = $(_
2c30: 54 4b 44 49 52 29 0a 5f 54 4b 5f 48 20 20 20 20  TKDIR)._TK_H    
2c40: 20 20 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 52        = $(_TKDIR
2c50: 29 5c 67 65 6e 65 72 69 63 5c 74 6b 2e 68 0a 0a  )\generic\tk.h..
2c60: 21 65 6e 64 69 66 20 23 20 65 78 69 73 74 28 22  !endif # exist("
2c70: 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69  $(_INSTALLDIR)\i
2c80: 6e 63 6c 75 64 65 5c 74 6b 2e 68 22 29 20 26 26  nclude\tk.h") &&
2c90: 20 21 24 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52   !$(NEED_TK_SOUR
2ca0: 43 45 29 0a 0a 21 65 6e 64 69 66 20 23 20 54 4b  CE)..!endif # TK
2cb0: 44 49 52 0a 0a 21 69 66 6e 64 65 66 20 5f 54 4b  DIR..!ifndef _TK
2cc0: 5f 48 0a 4d 53 47 20 3d 5e 0a 46 61 69 6c 65 64  _H.MSG =^.Failed
2cd0: 20 74 6f 20 66 69 6e 64 20 74 6b 2e 68 2e 20 54   to find tk.h. T
2ce0: 68 65 20 54 4b 44 49 52 20 6d 61 63 72 6f 20 69  he TKDIR macro i
2cf0: 73 20 73 65 74 20 69 6e 63 6f 72 72 65 63 74 6c  s set incorrectl
2d00: 79 20 6f 72 20 69 73 20 6e 6f 74 20 73 65 74 20  y or is not set 
2d10: 61 6e 64 20 64 65 66 61 75 6c 74 20 70 61 74 68  and default path
2d20: 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69   does not contai
2d30: 6e 20 74 6b 2e 68 2e 0a 21 65 72 72 6f 72 20 24  n tk.h..!error $
2d40: 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a 0a 21 65  (MSG).!endif..!e
2d50: 6e 64 69 66 20 23 20 4e 45 45 44 5f 54 4b 0a 0a  ndif # NEED_TK..
2d60: 21 69 66 20 24 28 4e 45 45 44 5f 54 43 4c 5f 53  !if $(NEED_TCL_S
2d70: 4f 55 52 43 45 29 20 26 26 20 24 28 54 43 4c 49  OURCE) && $(TCLI
2d80: 4e 53 54 41 4c 4c 29 0a 4d 53 47 20 3d 20 5e 0a  NSTALL).MSG = ^.
2d90: 2a 2a 2a 20 57 61 72 6e 69 6e 67 3a 20 54 68 69  *** Warning: Thi
2da0: 73 20 65 78 74 65 6e 73 69 6f 6e 20 72 65 71 75  s extension requ
2db0: 69 72 65 73 20 74 68 65 20 73 6f 75 72 63 65 20  ires the source 
2dc0: 64 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 20  distribution of 
2dd0: 54 63 6c 2e 5e 0a 2a 2a 2a 20 50 6c 65 61 73 65  Tcl.^.*** Please
2de0: 20 73 65 74 20 74 68 65 20 54 43 4c 44 49 52 20   set the TCLDIR 
2df0: 6d 61 63 72 6f 20 74 6f 20 70 6f 69 6e 74 20 74  macro to point t
2e00: 6f 20 74 68 65 20 54 63 6c 20 73 6f 75 72 63 65  o the Tcl source
2e10: 73 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53 47 29  s..!error $(MSG)
2e20: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 4e  .!endif..!if $(N
2e30: 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0a 21  EED_TK_SOURCE).!
2e40: 69 66 20 24 28 54 4b 49 4e 53 54 41 4c 4c 29 0a  if $(TKINSTALL).
2e50: 4d 53 47 20 3d 20 5e 0a 2a 2a 2a 20 57 61 72 6e  MSG = ^.*** Warn
2e60: 69 6e 67 3a 20 54 68 69 73 20 65 78 74 65 6e 73  ing: This extens
2e70: 69 6f 6e 20 72 65 71 75 69 72 65 73 20 74 68 65  ion requires the
2e80: 20 73 6f 75 72 63 65 20 64 69 73 74 72 69 62 75   source distribu
2e90: 74 69 6f 6e 20 6f 66 20 54 6b 2e 5e 0a 2a 2a 2a  tion of Tk.^.***
2ea0: 20 50 6c 65 61 73 65 20 73 65 74 20 74 68 65 20   Please set the 
2eb0: 54 4b 44 49 52 20 6d 61 63 72 6f 20 74 6f 20 70  TKDIR macro to p
2ec0: 6f 69 6e 74 20 74 6f 20 74 68 65 20 54 6b 20 73  oint to the Tk s
2ed0: 6f 75 72 63 65 73 2e 0a 21 65 72 72 6f 72 20 24  ources..!error $
2ee0: 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a 21 65 6e  (MSG).!endif.!en
2ef0: 64 69 66 0a 0a 0a 23 20 49 66 20 49 4e 53 54 41  dif...# If INSTA
2f00: 4c 4c 44 49 52 20 73 65 74 20 74 6f 20 54 63 6c  LLDIR set to Tcl
2f10: 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 72 6f   installation ro
2f20: 6f 74 20 64 69 72 20 74 68 65 6e 20 72 65 73 65  ot dir then rese
2f30: 74 20 74 6f 20 74 68 65 0a 23 20 6c 69 62 20 64  t to the.# lib d
2f40: 69 72 20 66 6f 72 20 69 6e 73 74 61 6c 6c 69 6e  ir for installin
2f50: 67 20 65 78 74 65 6e 73 69 6f 6e 73 0a 21 69 66  g extensions.!if
2f60: 20 65 78 69 73 74 28 22 24 28 5f 49 4e 53 54 41   exist("$(_INSTA
2f70: 4c 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74  LLDIR)\include\t
2f80: 63 6c 2e 68 22 29 0a 5f 49 4e 53 54 41 4c 4c 44  cl.h")._INSTALLD
2f90: 49 52 3d 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52  IR=$(_INSTALLDIR
2fa0: 29 5c 6c 69 62 0a 21 65 6e 64 69 66 0a 0a 23 20  )\lib.!endif..# 
2fb0: 45 4e 44 20 43 61 73 65 20 32 28 63 29 20 6f 72  END Case 2(c) or
2fc0: 20 28 64 29 20 2d 20 42 75 69 6c 64 69 6e 67 20   (d) - Building 
2fd0: 61 6e 20 65 78 74 65 6e 73 69 6f 6e 0a 21 65 6e  an extension.!en
2fe0: 64 69 66 20 23 20 69 66 20 24 28 44 4f 49 4e 47  dif # if $(DOING
2ff0: 5f 54 43 4c 29 0a 0a 23 23 23 23 23 23 23 23 23  _TCL)..#########
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 23 23 23 23 23 23 23 23 23 23  ################
3030: 23 23 23 23 23 23 23 0a 23 20 33 2e 20 44 65 74  #######.# 3. Det
3040: 65 72 6d 69 6e 65 20 63 6f 6d 70 69 6c 65 72 20  ermine compiler 
3050: 76 65 72 73 69 6f 6e 20 61 6e 64 20 61 72 63 68  version and arch
3060: 69 74 65 63 74 75 72 65 0a 23 20 49 6e 20 74 68  itecture.# In th
3070: 69 73 20 73 65 63 74 69 6f 6e 2c 20 77 65 20 66  is section, we f
3080: 69 67 75 72 65 20 6f 75 74 20 74 68 65 20 63 6f  igure out the co
3090: 6d 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 61  mpiler version a
30a0: 6e 64 20 74 68 65 0a 23 20 61 72 63 68 69 74 65  nd the.# archite
30b0: 63 74 75 72 65 20 66 6f 72 20 77 68 69 63 68 20  cture for which 
30c0: 77 65 20 61 72 65 20 62 75 69 6c 64 69 6e 67 2e  we are building.
30d0: 20 54 68 69 73 20 73 65 74 73 20 74 68 65 0a 23   This sets the.#
30e0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f   following macro
30f0: 73 3a 0a 23 20 56 43 56 45 52 53 49 4f 4e 20 2d  s:.# VCVERSION -
3100: 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 63 6f   the internal co
3110: 6d 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 61  mpiler version a
3120: 73 20 31 32 30 30 2c 20 31 34 30 30 2c 20 31 39  s 1200, 1400, 19
3130: 31 30 20 65 74 63 2e 0a 23 20 20 20 20 20 54 68  10 etc..#     Th
3140: 69 73 20 69 73 20 61 6c 73 6f 20 70 72 69 6e 74  is is also print
3150: 65 64 20 62 79 20 74 68 65 20 63 6f 6d 70 69 6c  ed by the compil
3160: 65 72 20 69 6e 20 64 6f 74 74 65 64 20 66 6f 72  er in dotted for
3170: 6d 20 31 39 2e 31 30 20 65 74 63 2e 0a 23 20 56  m 19.10 etc..# V
3180: 43 56 45 52 20 2d 20 74 68 65 20 22 6d 61 72 6b  CVER - the "mark
3190: 65 74 69 6e 67 20 76 65 72 73 69 6f 6e 22 2c 20  eting version", 
31a0: 66 6f 72 20 65 78 61 6d 70 6c 65 20 56 69 73 75  for example Visu
31b0: 61 6c 20 43 2b 2b 20 36 20 66 6f 72 20 69 6e 74  al C++ 6 for int
31c0: 65 72 6e 61 6c 0a 23 20 20 20 20 20 63 6f 6d 70  ernal.#     comp
31d0: 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 31 32 30  iler version 120
31e0: 30 2e 20 54 68 69 73 20 69 73 20 6b 65 70 74 20  0. This is kept 
31f0: 6f 6e 6c 79 20 66 6f 72 20 6c 65 67 61 63 79 20  only for legacy 
3200: 72 65 61 73 6f 6e 73 20 61 73 20 69 74 0a 23 20  reasons as it.# 
3210: 20 20 20 20 64 6f 65 73 20 6e 6f 74 20 6d 61 6b      does not mak
3220: 65 20 73 65 6e 73 65 20 66 6f 72 20 72 65 63 65  e sense for rece
3230: 6e 74 20 4d 69 63 72 6f 73 6f 66 74 20 63 6f 6d  nt Microsoft com
3240: 70 69 6c 65 72 73 2e 20 4f 6e 6c 79 20 75 73 65  pilers. Only use
3250: 64 20 66 6f 72 0a 23 20 20 20 20 20 6f 75 74 70  d for.#     outp
3260: 75 74 20 64 69 72 65 63 74 6f 72 79 20 6e 61 6d  ut directory nam
3270: 65 73 2e 0a 23 20 41 52 43 48 20 2d 20 73 65 74  es..# ARCH - set
3280: 20 74 6f 20 49 58 38 36 2c 20 41 52 4d 36 34 20   to IX86, ARM64 
3290: 6f 72 20 41 4d 44 36 34 20 64 65 70 65 6e 64 69  or AMD64 dependi
32a0: 6e 67 20 6f 6e 20 33 32 2d 20 6f 72 20 36 34 2d  ng on 32- or 64-
32b0: 62 69 74 20 74 61 72 67 65 74 0a 23 20 4e 41 54  bit target.# NAT
32c0: 49 56 45 5f 41 52 43 48 20 2d 20 73 65 74 20 74  IVE_ARCH - set t
32d0: 6f 20 49 58 38 36 2c 20 41 52 4d 36 34 20 6f 72  o IX86, ARM64 or
32e0: 20 41 4d 44 36 34 20 66 6f 72 20 74 68 65 20 68   AMD64 for the h
32f0: 6f 73 74 20 6d 61 63 68 69 6e 65 0a 23 20 4d 41  ost machine.# MA
3300: 43 48 49 4e 45 20 2d 20 73 61 6d 65 20 61 73 20  CHINE - same as 
3310: 24 28 41 52 43 48 29 20 2d 20 6c 65 67 61 63 79  $(ARCH) - legacy
3320: 0a 23 20 5f 56 43 5f 4d 41 4e 49 46 45 53 54 5f  .# _VC_MANIFEST_
3330: 45 4d 42 45 44 5f 7b 44 4c 4c 2c 45 58 45 7d 20  EMBED_{DLL,EXE} 
3340: 2d 20 63 6f 6d 6d 61 6e 64 73 20 66 6f 72 20 65  - commands for e
3350: 6d 62 65 64 64 69 6e 67 20 61 20 6d 61 6e 69 66  mbedding a manif
3360: 65 73 74 20 69 66 20 6e 65 65 64 65 64 0a 0a 63  est if needed..c
3370: 63 33 32 09 09 3d 20 24 28 43 43 29 20 20 20 23  c32..= $(CC)   #
3380: 20 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c   built-in defaul
3390: 74 2e 0a 6c 69 6e 6b 33 32 09 09 3d 20 6c 69 6e  t..link32..= lin
33a0: 6b 0a 6c 69 62 33 32 09 09 3d 20 6c 69 62 0a 72  k.lib32..= lib.r
33b0: 63 33 32 09 09 3d 20 24 28 52 43 29 20 20 20 23  c32..= $(RC)   #
33c0: 20 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c   built-in defaul
33d0: 74 2e 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  t...#-----------
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 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3410: 2d 2d 2d 2d 2d 0a 23 20 46 69 67 75 72 65 20 6f  -----.# Figure o
3420: 75 74 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20  ut the compiler 
3430: 61 72 63 68 69 74 65 63 74 75 72 65 20 61 6e 64  architecture and
3440: 20 76 65 72 73 69 6f 6e 20 62 79 20 77 72 69 74   version by writ
3450: 69 6e 67 0a 23 20 74 68 65 20 43 20 6d 61 63 72  ing.# the C macr
3460: 6f 73 20 74 6f 20 61 20 66 69 6c 65 2c 20 70 72  os to a file, pr
3470: 65 70 72 6f 63 65 73 73 69 6e 67 20 74 68 65 6d  eprocessing them
3480: 20 77 69 74 68 20 74 68 65 20 43 0a 23 20 70 72   with the C.# pr
3490: 65 70 72 6f 63 65 73 73 6f 72 20 61 6e 64 20 72  eprocessor and r
34a0: 65 61 64 69 6e 67 20 62 61 63 6b 20 74 68 65 20  eading back the 
34b0: 63 72 65 61 74 65 64 20 66 69 6c 65 0a 0a 5f 48  created file.._H
34c0: 41 53 48 3d 5e 23 0a 5f 56 43 5f 4d 41 4e 49 46  ASH=^#._VC_MANIF
34d0: 45 53 54 5f 45 4d 42 45 44 5f 45 58 45 3d 0a 5f  EST_EMBED_EXE=._
34e0: 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45  VC_MANIFEST_EMBE
34f0: 44 5f 44 4c 4c 3d 0a 56 43 56 45 52 3d 30 0a 21  D_DLL=.VCVER=0.!
3500: 69 66 20 21 5b 65 63 68 6f 20 56 43 56 45 52 53  if ![echo VCVERS
3510: 49 4f 4e 3d 5f 4d 53 43 5f 56 45 52 20 3e 20 76  ION=_MSC_VER > v
3520: 65 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26  ercl.x] \.    &&
3530: 20 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29   ![echo $(_HASH)
3540: 69 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 49 58  if defined(_M_IX
3550: 38 36 29 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20  86) >> vercl.x] 
3560: 5c 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20  \.    && ![echo 
3570: 41 52 43 48 3d 49 58 38 36 20 3e 3e 20 76 65 72  ARCH=IX86 >> ver
3580: 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20 21  cl.x] \.    && !
3590: 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29 65 6c  [echo $(_HASH)el
35a0: 69 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 41 4d  if defined(_M_AM
35b0: 44 36 34 29 20 3e 3e 20 76 65 72 63 6c 2e 78 5d  D64) >> vercl.x]
35c0: 20 5c 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f   \.    && ![echo
35d0: 20 41 52 43 48 3d 41 4d 44 36 34 20 3e 3e 20 76   ARCH=AMD64 >> v
35e0: 65 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26  ercl.x] \.    &&
35f0: 20 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29   ![echo $(_HASH)
3600: 65 6c 69 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f  elif defined(_M_
3610: 41 52 4d 36 34 29 20 3e 3e 20 76 65 72 63 6c 2e  ARM64) >> vercl.
3620: 78 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b 65 63  x] \.    && ![ec
3630: 68 6f 20 41 52 43 48 3d 41 52 4d 36 34 20 3e 3e  ho ARCH=ARM64 >>
3640: 20 76 65 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20   vercl.x] \.    
3650: 26 26 20 21 5b 65 63 68 6f 20 24 28 5f 48 41 53  && ![echo $(_HAS
3660: 48 29 65 6e 64 69 66 20 3e 3e 20 76 65 72 63 6c  H)endif >> vercl
3670: 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b 24  .x] \.    && ![$
3680: 28 63 63 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20 2d  (cc32) -nologo -
3690: 54 43 20 2d 50 20 76 65 72 63 6c 2e 78 20 32 3e  TC -P vercl.x 2>
36a0: 4e 55 4c 5d 0a 21 69 6e 63 6c 75 64 65 20 76 65  NUL].!include ve
36b0: 72 63 6c 2e 69 0a 21 69 66 20 24 28 56 43 56 45  rcl.i.!if $(VCVE
36c0: 52 53 49 4f 4e 29 20 3c 20 31 39 30 30 0a 21 69  RSION) < 1900.!i
36d0: 66 20 21 5b 65 63 68 6f 20 56 43 56 45 52 3d 20  f ![echo VCVER= 
36e0: 5e 5c 3e 20 76 65 72 63 6c 2e 76 63 5d 20 5c 0a  ^\> vercl.vc] \.
36f0: 20 20 20 20 26 26 20 21 5b 73 65 74 20 2f 61 20      && ![set /a 
3700: 24 28 56 43 56 45 52 53 49 4f 4e 29 20 2f 20 31  $(VCVERSION) / 1
3710: 30 30 20 2d 20 36 20 3e 3e 20 76 65 72 63 6c 2e  00 - 6 >> vercl.
3720: 76 63 5d 0a 21 69 6e 63 6c 75 64 65 20 76 65 72  vc].!include ver
3730: 63 6c 2e 76 63 0a 21 65 6e 64 69 66 0a 21 65 6c  cl.vc.!endif.!el
3740: 73 65 0a 23 20 54 68 65 20 73 69 6d 70 6c 65 20  se.# The simple 
3750: 63 61 6c 63 75 6c 61 74 69 6f 6e 20 61 62 6f 76  calculation abov
3760: 65 20 64 6f 65 73 20 6e 6f 74 20 61 70 70 6c 79  e does not apply
3770: 20 74 6f 20 6e 65 77 20 56 69 73 75 61 6c 20 53   to new Visual S
3780: 74 75 64 69 6f 20 72 65 6c 65 61 73 65 73 0a 23  tudio releases.#
3790: 20 4b 65 65 70 20 74 68 65 20 63 6f 6d 70 69 6c   Keep the compil
37a0: 65 72 20 76 65 72 73 69 6f 6e 20 69 6e 20 69 74  er version in it
37b0: 73 20 6e 61 74 69 76 65 20 66 6f 72 6d 2e 0a 56  s native form..V
37c0: 43 56 45 52 20 3d 20 24 28 56 43 56 45 52 53 49  CVER = $(VCVERSI
37d0: 4f 4e 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69  ON).!endif.!endi
37e0: 66 0a 0a 21 69 66 20 21 5b 64 65 6c 20 32 3e 4e  f..!if ![del 2>N
37f0: 55 4c 20 2f 71 2f 66 20 76 65 72 63 6c 2e 78 20  UL /q/f vercl.x 
3800: 76 65 72 63 6c 2e 69 20 76 65 72 63 6c 2e 76 63  vercl.i vercl.vc
3810: 5d 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d  ].!endif..#-----
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 2d 2d 2d 2d 2d 2d  ----------------
3850: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 68  -----------.# Th
3860: 65 20 4d 41 43 48 49 4e 45 20 6d 61 63 72 6f 20  e MACHINE macro 
3870: 69 73 20 75 73 65 64 20 62 79 20 6c 65 67 61 63  is used by legac
3880: 79 20 6d 61 6b 65 66 69 6c 65 73 20 73 6f 20 73  y makefiles so s
3890: 65 74 20 69 74 20 61 73 20 77 65 6c 6c 0a 21 69  et it as well.!i
38a0: 66 64 65 66 20 4d 41 43 48 49 4e 45 0a 21 69 66  fdef MACHINE.!if
38b0: 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d   "$(MACHINE)" ==
38c0: 20 22 78 38 36 22 0a 21 75 6e 64 65 66 20 4d 41   "x86".!undef MA
38d0: 43 48 49 4e 45 0a 4d 41 43 48 49 4e 45 20 3d 20  CHINE.MACHINE = 
38e0: 49 58 38 36 0a 21 65 6c 73 65 69 66 20 22 24 28  IX86.!elseif "$(
38f0: 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 61 72  MACHINE)" == "ar
3900: 6d 36 34 22 0a 21 75 6e 64 65 66 20 4d 41 43 48  m64".!undef MACH
3910: 49 4e 45 0a 4d 41 43 48 49 4e 45 20 3d 20 41 52  INE.MACHINE = AR
3920: 4d 36 34 0a 21 65 6c 73 65 69 66 20 22 24 28 4d  M64.!elseif "$(M
3930: 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 78 36 34  ACHINE)" == "x64
3940: 22 0a 21 75 6e 64 65 66 20 4d 41 43 48 49 4e 45  ".!undef MACHINE
3950: 0a 4d 41 43 48 49 4e 45 20 3d 20 41 4d 44 36 34  .MACHINE = AMD64
3960: 0a 21 65 6e 64 69 66 0a 21 69 66 20 22 24 28 4d  .!endif.!if "$(M
3970: 41 43 48 49 4e 45 29 22 20 21 3d 20 22 24 28 41  ACHINE)" != "$(A
3980: 52 43 48 29 22 0a 21 65 72 72 6f 72 20 53 70 65  RCH)".!error Spe
3990: 63 69 66 69 65 64 20 4d 41 43 48 49 4e 45 20 6d  cified MACHINE m
39a0: 61 63 72 6f 20 24 28 4d 41 43 48 49 4e 45 29 20  acro $(MACHINE) 
39b0: 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 64  does not match d
39c0: 65 74 65 63 74 65 64 20 74 61 72 67 65 74 20 61  etected target a
39d0: 72 63 68 69 74 65 63 74 75 72 65 20 24 28 41 52  rchitecture $(AR
39e0: 43 48 29 2e 0a 21 65 6e 64 69 66 0a 21 65 6c 73  CH)..!endif.!els
39f0: 65 0a 4d 41 43 48 49 4e 45 3d 24 28 41 52 43 48  e.MACHINE=$(ARCH
3a00: 29 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d  ).!endif..#-----
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 2d 2d 2d 2d 2d 2d 2d  ----------------
3a40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 68 65  ----------.# The
3a50: 20 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49   PLATFORM_IDENTI
3a60: 46 59 20 6d 61 63 72 6f 20 6d 61 74 63 68 65 73  FY macro matches
3a70: 20 74 68 65 20 76 61 6c 75 65 73 20 72 65 74 75   the values retu
3a80: 72 6e 65 64 20 62 79 0a 23 20 74 68 65 20 54 63  rned by.# the Tc
3a90: 6c 20 70 6c 61 74 66 6f 72 6d 3a 3a 69 64 65 6e  l platform::iden
3aa0: 74 69 66 79 20 63 6f 6d 6d 61 6e 64 0a 21 69 66  tify command.!if
3ab0: 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d   "$(MACHINE)" ==
3ac0: 20 22 41 4d 44 36 34 22 0a 50 4c 41 54 46 4f 52   "AMD64".PLATFOR
3ad0: 4d 5f 49 44 45 4e 54 49 46 59 20 3d 20 77 69 6e  M_IDENTIFY = win
3ae0: 33 32 2d 78 38 36 5f 36 34 0a 21 65 6c 73 65 69  32-x86_64.!elsei
3af0: 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d  f "$(MACHINE)" =
3b00: 3d 20 22 41 52 4d 36 34 22 0a 50 4c 41 54 46 4f  = "ARM64".PLATFO
3b10: 52 4d 5f 49 44 45 4e 54 49 46 59 20 3d 20 77 69  RM_IDENTIFY = wi
3b20: 6e 33 32 2d 61 72 6d 0a 21 65 6c 73 65 0a 50 4c  n32-arm.!else.PL
3b30: 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 20  ATFORM_IDENTIFY 
3b40: 3d 20 77 69 6e 33 32 2d 69 78 38 36 0a 21 65 6e  = win32-ix86.!en
3b50: 64 69 66 0a 0a 23 20 54 68 65 20 4d 55 4c 54 49  dif..# The MULTI
3b60: 50 4c 41 54 46 4f 52 4d 20 6d 61 63 72 6f 20 63  PLATFORM macro c
3b70: 6f 6e 74 72 6f 6c 73 20 77 68 65 74 68 65 72 20  ontrols whether 
3b80: 62 69 6e 61 72 79 20 65 78 74 65 6e 73 69 6f 6e  binary extension
3b90: 73 20 61 72 65 20 69 6e 73 74 61 6c 6c 65 64 0a  s are installed.
3ba0: 23 20 69 6e 20 70 6c 61 74 66 6f 72 6d 2d 73 70  # in platform-sp
3bb0: 65 63 69 66 69 63 20 64 69 72 65 63 74 6f 72 69  ecific directori
3bc0: 65 73 2e 20 49 6e 74 65 6e 64 65 64 20 74 6f 20  es. Intended to 
3bd0: 62 65 20 73 65 74 2f 75 73 65 64 20 62 79 20 65  be set/used by e
3be0: 78 74 65 6e 73 69 6f 6e 73 2e 0a 21 69 66 6e 64  xtensions..!ifnd
3bf0: 65 66 20 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d  ef MULTIPLATFORM
3c00: 5f 49 4e 53 54 41 4c 4c 0a 4d 55 4c 54 49 50 4c  _INSTALL.MULTIPL
3c10: 41 54 46 4f 52 4d 5f 49 4e 53 54 41 4c 4c 20 3d  ATFORM_INSTALL =
3c20: 20 30 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d   0.!endif..#----
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 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3c60: 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 46 69 67 75 72  --------.# Figur
3c70: 65 20 6f 75 74 20 74 68 65 20 2a 68 6f 73 74 2a  e out the *host*
3c80: 20 61 72 63 68 69 74 65 63 74 75 72 65 20 62 79   architecture by
3c90: 20 72 65 61 64 69 6e 67 20 74 68 65 20 72 65 67   reading the reg
3ca0: 69 73 74 72 79 0a 0a 21 69 66 20 21 5b 72 65 67  istry..!if ![reg
3cb0: 20 71 75 65 72 79 20 48 4b 4c 4d 5c 48 61 72 64   query HKLM\Hard
3cc0: 77 61 72 65 5c 44 65 73 63 72 69 70 74 69 6f 6e  ware\Description
3cd0: 5c 53 79 73 74 65 6d 5c 43 65 6e 74 72 61 6c 50  \System\CentralP
3ce0: 72 6f 63 65 73 73 6f 72 5c 30 20 2f 76 20 49 64  rocessor\0 /v Id
3cf0: 65 6e 74 69 66 69 65 72 20 7c 20 66 69 6e 64 73  entifier | finds
3d00: 74 72 20 2f 69 20 78 38 36 5d 0a 4e 41 54 49 56  tr /i x86].NATIV
3d10: 45 5f 41 52 43 48 3d 49 58 38 36 0a 21 65 6c 73  E_ARCH=IX86.!els
3d20: 65 69 66 20 21 5b 72 65 67 20 71 75 65 72 79 20  eif ![reg query 
3d30: 48 4b 4c 4d 5c 48 61 72 64 77 61 72 65 5c 44 65  HKLM\Hardware\De
3d40: 73 63 72 69 70 74 69 6f 6e 5c 53 79 73 74 65 6d  scription\System
3d50: 5c 43 65 6e 74 72 61 6c 50 72 6f 63 65 73 73 6f  \CentralProcesso
3d60: 72 5c 30 20 2f 76 20 49 64 65 6e 74 69 66 69 65  r\0 /v Identifie
3d70: 72 20 7c 20 66 69 6e 64 73 74 72 20 2f 69 20 41  r | findstr /i A
3d80: 52 4d 20 7c 20 66 69 6e 64 73 74 72 20 2f 69 20  RM | findstr /i 
3d90: 36 34 2d 62 69 74 5d 0a 4e 41 54 49 56 45 5f 41  64-bit].NATIVE_A
3da0: 52 43 48 3d 41 52 4d 36 34 0a 21 65 6c 73 65 0a  RCH=ARM64.!else.
3db0: 4e 41 54 49 56 45 5f 41 52 43 48 3d 41 4d 44 36  NATIVE_ARCH=AMD6
3dc0: 34 0a 21 65 6e 64 69 66 0a 0a 23 20 53 69 6e 63  4.!endif..# Sinc
3dd0: 65 20 4d 53 56 43 38 20 77 65 20 6d 75 73 74 20  e MSVC8 we must 
3de0: 64 65 61 6c 20 77 69 74 68 20 6d 61 6e 69 66 65  deal with manife
3df0: 73 74 20 72 65 73 6f 75 72 63 65 73 2e 0a 21 69  st resources..!i
3e00: 66 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3e  f $(VCVERSION) >
3e10: 3d 20 31 34 30 30 0a 5f 56 43 5f 4d 41 4e 49 46  = 1400._VC_MANIF
3e20: 45 53 54 5f 45 4d 42 45 44 5f 45 58 45 3d 69 66  EST_EMBED_EXE=if
3e30: 20 65 78 69 73 74 20 24 40 2e 6d 61 6e 69 66 65   exist $@.manife
3e40: 73 74 20 6d 74 20 2d 6e 6f 6c 6f 67 6f 20 2d 6d  st mt -nologo -m
3e50: 61 6e 69 66 65 73 74 20 24 40 2e 6d 61 6e 69 66  anifest $@.manif
3e60: 65 73 74 20 2d 6f 75 74 70 75 74 72 65 73 6f 75  est -outputresou
3e70: 72 63 65 3a 24 40 3b 31 0a 5f 56 43 5f 4d 41 4e  rce:$@;1._VC_MAN
3e80: 49 46 45 53 54 5f 45 4d 42 45 44 5f 44 4c 4c 3d  IFEST_EMBED_DLL=
3e90: 69 66 20 65 78 69 73 74 20 24 40 2e 6d 61 6e 69  if exist $@.mani
3ea0: 66 65 73 74 20 6d 74 20 2d 6e 6f 6c 6f 67 6f 20  fest mt -nologo 
3eb0: 2d 6d 61 6e 69 66 65 73 74 20 24 40 2e 6d 61 6e  -manifest $@.man
3ec0: 69 66 65 73 74 20 2d 6f 75 74 70 75 74 72 65 73  ifest -outputres
3ed0: 6f 75 72 63 65 3a 24 40 3b 32 0a 21 65 6e 64 69  ource:$@;2.!endi
3ee0: 66 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23  f..#############
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 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3f20: 23 23 23 0a 23 20 34 2e 20 42 75 69 6c 64 20 74  ###.# 4. Build t
3f30: 68 65 20 6e 6d 61 6b 65 68 6c 70 20 70 72 6f 67  he nmakehlp prog
3f40: 72 61 6d 0a 23 20 54 68 69 73 20 69 73 20 61 20  ram.# This is a 
3f50: 68 65 6c 70 65 72 20 61 70 70 20 77 65 20 6e 65  helper app we ne
3f60: 65 64 20 74 6f 20 6f 76 65 72 63 6f 6d 65 20 6e  ed to overcome n
3f70: 6d 61 6b 65 27 73 20 6c 69 6d 69 74 69 6e 67 0a  make's limiting.
3f80: 23 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e 20 57  # environment. W
3f90: 65 20 77 69 6c 6c 20 63 61 6c 6c 20 6f 75 74 20  e will call out 
3fa0: 74 6f 20 69 74 20 74 6f 20 67 65 74 20 76 61 72  to it to get var
3fb0: 69 6f 75 73 20 62 69 74 73 20 6f 66 0a 23 20 69  ious bits of.# i
3fc0: 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74  nformation about
3fd0: 20 73 75 70 70 6f 72 74 65 64 20 63 6f 6d 70 69   supported compi
3fe0: 6c 65 72 20 6f 70 74 69 6f 6e 73 20 65 74 63 2e  ler options etc.
3ff0: 0a 23 0a 23 20 54 63 6c 20 69 74 73 65 6c 66 20  .#.# Tcl itself 
4000: 77 69 6c 6c 20 61 6c 77 61 79 73 20 75 73 65 20  will always use 
4010: 74 68 65 20 6e 6d 61 6b 65 68 6c 70 2e 63 20 70  the nmakehlp.c p
4020: 72 6f 67 72 61 6d 20 77 68 69 63 68 20 69 73 0a  rogram which is.
4030: 23 20 69 6e 20 69 74 73 20 6f 77 6e 20 73 6f 75  # in its own sou
4040: 72 63 65 2e 20 49 74 20 77 69 6c 6c 20 62 65 20  rce. It will be 
4050: 6b 65 70 74 20 75 70 64 61 74 65 64 20 74 68 65  kept updated the
4060: 72 65 2e 0a 23 0a 23 20 45 78 74 65 6e 73 69 6f  re..#.# Extensio
4070: 6e 73 20 62 75 69 6c 74 20 61 67 61 69 6e 73 74  ns built against
4080: 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63   an installed Tc
4090: 6c 20 77 69 6c 6c 20 75 73 65 20 74 68 65 20 69  l will use the i
40a0: 6e 73 74 61 6c 6c 65 64 0a 23 20 63 6f 70 79 20  nstalled.# copy 
40b0: 6f 66 20 54 63 6c 27 73 20 6e 6d 61 6b 65 68 6c  of Tcl's nmakehl
40c0: 70 2e 63 20 69 66 20 74 68 65 72 65 20 69 73 20  p.c if there is 
40d0: 6f 6e 65 20 61 6e 64 20 74 68 65 69 72 20 6f 77  one and their ow
40e0: 6e 20 76 65 72 73 69 6f 6e 0a 23 20 6f 74 68 65  n version.# othe
40f0: 72 77 69 73 65 2e 20 49 6e 20 74 68 65 20 6c 61  rwise. In the la
4100: 74 74 65 72 20 63 61 73 65 2c 20 74 68 65 79 20  tter case, they 
4110: 77 6f 75 6c 64 20 61 6c 73 6f 20 62 65 20 75 73  would also be us
4120: 69 6e 67 20 74 68 65 69 72 20 6f 77 6e 0a 23 20  ing their own.# 
4130: 72 75 6c 65 73 2e 76 63 2e 20 4e 6f 74 65 20 74  rules.vc. Note t
4140: 68 61 74 20 6f 6c 64 65 72 20 76 65 72 73 69 6f  hat older versio
4150: 6e 73 20 6f 66 20 54 63 6c 20 64 6f 20 6e 6f 74  ns of Tcl do not
4160: 20 69 6e 73 74 61 6c 6c 20 6e 6d 61 6b 65 68 6c   install nmakehl
4170: 70 2e 63 0a 23 20 6f 72 20 72 75 6c 65 73 2e 76  p.c.# or rules.v
4180: 63 2e 0a 23 0a 23 20 45 78 74 65 6e 73 69 6f 6e  c..#.# Extension
4190: 73 20 62 75 69 6c 74 20 61 67 61 69 6e 73 74 20  s built against 
41a0: 54 63 6c 20 73 6f 75 72 63 65 73 20 77 69 6c 6c  Tcl sources will
41b0: 20 75 73 65 20 74 68 65 20 6f 6e 65 20 66 72 6f   use the one fro
41c0: 6d 20 74 68 65 20 54 63 6c 20 73 6f 75 72 63 65  m the Tcl source
41d0: 2e 0a 23 0a 23 20 57 68 65 6e 20 62 75 69 6c 64  ..#.# When build
41e0: 69 6e 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e  ing an extension
41f0: 20 75 73 69 6e 67 20 61 20 73 75 66 66 69 63 69   using a suffici
4200: 65 6e 74 6c 79 20 6e 65 77 20 76 65 72 73 69 6f  ently new versio
4210: 6e 20 6f 66 20 54 63 6c 2c 0a 23 20 72 75 6c 65  n of Tcl,.# rule
4220: 73 2d 65 78 74 2e 76 63 20 77 69 6c 6c 20 64 65  s-ext.vc will de
4230: 66 69 6e 65 20 4e 4d 41 4b 45 48 4c 50 43 20 61  fine NMAKEHLPC a
4240: 70 70 72 6f 70 72 69 61 74 65 6c 79 20 74 6f 20  ppropriately to 
4250: 70 6f 69 6e 74 20 74 6f 20 74 68 65 0a 23 20 63  point to the.# c
4260: 6f 70 79 20 6f 66 20 6e 6d 61 6b 65 68 6c 70 2e  opy of nmakehlp.
4270: 63 20 74 6f 20 62 65 20 75 73 65 64 2e 0a 0a 21  c to be used...!
4280: 69 66 6e 64 65 66 20 4e 4d 41 4b 45 48 4c 50 43  ifndef NMAKEHLPC
4290: 0a 23 20 44 65 66 61 75 6c 74 20 74 6f 20 74 68  .# Default to th
42a0: 65 20 6f 6e 65 20 69 6e 20 74 68 65 20 63 75 72  e one in the cur
42b0: 72 65 6e 74 20 64 69 72 65 63 74 6f 72 79 20 28  rent directory (
42c0: 74 68 65 20 65 78 74 65 6e 73 69 6f 6e 27 73 20  the extension's 
42d0: 6f 77 6e 20 6e 6d 61 6b 65 68 6c 70 2e 63 29 0a  own nmakehlp.c).
42e0: 4e 4d 41 4b 45 48 4c 50 43 20 3d 20 6e 6d 61 6b  NMAKEHLPC = nmak
42f0: 65 68 6c 70 2e 63 0a 0a 21 69 66 20 21 24 28 44  ehlp.c..!if !$(D
4300: 4f 49 4e 47 5f 54 43 4c 29 0a 21 69 66 20 24 28  OING_TCL).!if $(
4310: 54 43 4c 49 4e 53 54 41 4c 4c 29 0a 21 69 66 20  TCLINSTALL).!if 
4320: 65 78 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52  exist("$(_TCLDIR
4330: 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 6e 6d 61 6b  )\lib\nmake\nmak
4340: 65 68 6c 70 2e 63 22 29 0a 4e 4d 41 4b 45 48 4c  ehlp.c").NMAKEHL
4350: 50 43 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  PC = $(_TCLDIR)\
4360: 6c 69 62 5c 6e 6d 61 6b 65 5c 6e 6d 61 6b 65 68  lib\nmake\nmakeh
4370: 6c 70 2e 63 0a 21 65 6e 64 69 66 0a 21 65 6c 73  lp.c.!endif.!els
4380: 65 20 23 20 21 24 28 54 43 4c 49 4e 53 54 41 4c  e # !$(TCLINSTAL
4390: 4c 29 0a 21 69 66 20 65 78 69 73 74 28 22 24 28  L).!if exist("$(
43a0: 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 6e 6d 61  _TCLDIR)\win\nma
43b0: 6b 65 68 6c 70 2e 63 22 29 0a 4e 4d 41 4b 45 48  kehlp.c").NMAKEH
43c0: 4c 50 43 20 3d 20 24 28 5f 54 43 4c 44 49 52 29  LPC = $(_TCLDIR)
43d0: 5c 77 69 6e 5c 6e 6d 61 6b 65 68 6c 70 2e 63 0a  \win\nmakehlp.c.
43e0: 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20  !endif.!endif # 
43f0: 24 28 54 43 4c 49 4e 53 54 41 4c 4c 29 0a 21 65  $(TCLINSTALL).!e
4400: 6e 64 69 66 20 23 20 21 24 28 44 4f 49 4e 47 5f  ndif # !$(DOING_
4410: 54 43 4c 29 0a 0a 21 65 6e 64 69 66 20 23 20 4e  TCL)..!endif # N
4420: 4d 41 4b 45 48 4c 50 43 0a 0a 23 20 57 65 20 61  MAKEHLPC..# We a
4430: 6c 77 61 79 73 20 62 75 69 6c 64 20 6e 6d 61 6b  lways build nmak
4440: 65 68 6c 70 20 65 76 65 6e 20 69 66 20 69 74 20  ehlp even if it 
4450: 65 78 69 73 74 73 20 73 69 6e 63 65 20 77 65 20  exists since we 
4460: 64 6f 20 6e 6f 74 20 6b 6e 6f 77 0a 23 20 77 68  do not know.# wh
4470: 61 74 20 73 6f 75 72 63 65 20 69 74 20 77 61 73  at source it was
4480: 20 62 75 69 6c 74 20 66 72 6f 6d 2e 0a 21 69 66   built from..!if
4490: 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d   "$(MACHINE)" ==
44a0: 20 22 49 58 38 36 22 20 7c 7c 20 22 24 28 4d 41   "IX86" || "$(MA
44b0: 43 48 49 4e 45 29 22 20 3d 3d 20 22 24 28 4e 41  CHINE)" == "$(NA
44c0: 54 49 56 45 5f 41 52 43 48 29 22 0a 21 69 66 20  TIVE_ARCH)".!if 
44d0: 5b 24 28 63 63 33 32 29 20 2d 6e 6f 6c 6f 67 6f  [$(cc32) -nologo
44e0: 20 22 24 28 4e 4d 41 4b 45 48 4c 50 43 29 22 20   "$(NMAKEHLPC)" 
44f0: 2d 6c 69 6e 6b 20 2d 73 75 62 73 79 73 74 65 6d  -link -subsystem
4500: 3a 63 6f 6e 73 6f 6c 65 20 3e 20 6e 75 6c 5d 0a  :console > nul].
4510: 21 65 6e 64 69 66 0a 21 65 6c 73 65 0a 21 69 66  !endif.!else.!if
4520: 20 5b 63 6f 70 79 20 24 28 4e 4d 41 4b 45 48 4c   [copy $(NMAKEHL
4530: 50 43 3a 6e 6d 61 6b 65 68 6c 70 2e 63 3d 78 38  PC:nmakehlp.c=x8
4540: 36 5f 36 34 2d 77 36 34 2d 6d 69 6e 67 77 33 32  6_64-w64-mingw32
4550: 2d 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 29 20 6e  -nmakehlp.exe) n
4560: 6d 61 6b 65 68 6c 70 2e 65 78 65 20 3e 4e 55 4c  makehlp.exe >NUL
4570: 5d 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  ].!endif.!endif.
4580: 0a 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: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
45c0: 23 0a 23 20 35 2e 20 54 65 73 74 20 66 6f 72 20  #.# 5. Test for 
45d0: 63 6f 6d 70 69 6c 65 72 20 66 65 61 74 75 72 65  compiler feature
45e0: 73 0a 23 20 56 69 73 75 61 6c 20 43 2b 2b 20 63  s.# Visual C++ c
45f0: 6f 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e 73 20  ompiler options 
4600: 68 61 76 65 20 63 68 61 6e 67 65 64 20 6f 76 65  have changed ove
4610: 72 20 74 68 65 20 79 65 61 72 73 2e 20 43 68 65  r the years. Che
4620: 63 6b 0a 23 20 77 68 69 63 68 20 6f 70 74 69 6f  ck.# which optio
4630: 6e 73 20 61 72 65 20 73 75 70 70 6f 72 74 65 64  ns are supported
4640: 20 62 79 20 74 68 65 20 63 6f 6d 70 69 6c 65 72   by the compiler
4650: 20 69 6e 20 75 73 65 2e 0a 23 0a 23 20 54 68 65   in use..#.# The
4660: 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f   following macro
4670: 73 20 61 72 65 20 73 65 74 3a 0a 23 20 4f 50 54  s are set:.# OPT
4680: 49 4d 49 5a 41 54 49 4f 4e 53 20 2d 20 74 68 65  IMIZATIONS - the
4690: 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73 20   compiler flags 
46a0: 74 6f 20 62 65 20 75 73 65 64 20 66 6f 72 20 6f  to be used for o
46b0: 70 74 69 6d 69 7a 65 64 20 62 75 69 6c 64 73 0a  ptimized builds.
46c0: 23 20 44 45 42 55 47 46 4c 41 47 53 20 2d 20 74  # DEBUGFLAGS - t
46d0: 68 65 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67  he compiler flag
46e0: 73 20 74 6f 20 62 65 20 75 73 65 64 20 66 6f 72  s to be used for
46f0: 20 64 65 62 75 67 20 62 75 69 6c 64 73 0a 23 20   debug builds.# 
4700: 4c 49 4e 4b 45 52 46 4c 41 47 53 20 2d 20 46 6c  LINKERFLAGS - Fl
4710: 61 67 73 20 70 61 73 73 65 64 20 74 6f 20 74 68  ags passed to th
4720: 65 20 6c 69 6e 6b 65 72 0a 23 0a 23 20 4e 6f 74  e linker.#.# Not
4730: 65 20 74 68 61 74 20 74 68 65 73 65 20 61 72 65  e that these are
4740: 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 73 65   the compiler se
4750: 74 74 69 6e 67 73 20 2a 61 76 61 69 6c 61 62 6c  ttings *availabl
4760: 65 2a 2c 20 6e 6f 74 20 74 68 6f 73 65 0a 23 20  e*, not those.# 
4770: 74 68 61 74 20 77 69 6c 6c 20 62 65 20 2a 75 73  that will be *us
4780: 65 64 2a 2e 20 54 68 65 20 6c 61 74 74 65 72 20  ed*. The latter 
4790: 64 65 70 65 6e 64 73 20 6f 6e 20 74 68 65 20 4f  depends on the O
47a0: 50 54 53 20 6d 61 63 72 6f 20 73 65 74 74 69 6e  PTS macro settin
47b0: 67 73 0a 23 20 77 68 69 63 68 20 77 65 20 68 61  gs.# which we ha
47c0: 76 65 20 6e 6f 74 20 79 65 74 20 70 61 72 73 65  ve not yet parse
47d0: 64 2e 0a 23 0a 23 20 41 6c 73 6f 20 6e 6f 74 65  d..#.# Also note
47e0: 20 74 68 61 74 20 73 6f 6d 65 20 6f 66 20 74 68   that some of th
47f0: 65 20 66 6c 61 67 73 20 69 6e 20 4f 50 54 49 4d  e flags in OPTIM
4800: 49 5a 41 54 49 4f 4e 53 20 61 72 65 20 6e 6f 74  IZATIONS are not
4810: 20 72 65 61 6c 6c 79 0a 23 20 72 65 6c 61 74 65   really.# relate
4820: 64 20 74 6f 20 6f 70 74 69 6d 69 7a 61 74 69 6f  d to optimizatio
4830: 6e 2e 20 54 68 65 79 20 61 72 65 20 70 6c 61 63  n. They are plac
4840: 65 64 20 74 68 65 72 65 20 6f 6e 6c 79 20 66 6f  ed there only fo
4850: 72 20 6c 65 67 61 63 79 20 72 65 61 73 6f 6e 73  r legacy reasons
4860: 0a 23 20 61 73 20 73 6f 6d 65 20 65 78 74 65 6e  .# as some exten
4870: 73 69 6f 6e 73 20 65 78 70 65 63 74 20 74 68 65  sions expect the
4880: 6d 20 74 6f 20 62 65 20 69 6e 63 6c 75 64 65 64  m to be included
4890: 20 69 6e 20 74 68 61 74 20 6d 61 63 72 6f 2e 0a   in that macro..
48a0: 0a 23 20 2d 4f 70 20 69 6d 70 72 6f 76 65 73 20  .# -Op improves 
48b0: 66 6c 6f 61 74 20 63 6f 6e 73 69 73 74 65 6e 63  float consistenc
48c0: 79 2e 20 4e 6f 74 65 20 6f 6e 6c 79 20 6e 65 65  y. Note only nee
48d0: 64 65 64 20 66 6f 72 20 6f 6c 64 65 72 20 63 6f  ded for older co
48e0: 6d 70 69 6c 65 72 73 0a 23 20 4e 65 77 65 72 20  mpilers.# Newer 
48f0: 63 6f 6d 70 69 6c 65 72 73 20 64 6f 20 6e 6f 74  compilers do not
4900: 20 6e 65 65 64 20 6f 72 20 73 75 70 70 6f 72 74   need or support
4910: 20 74 68 69 73 20 6f 70 74 69 6f 6e 2e 0a 21 69   this option..!i
4920: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63 20 2d  f [nmakehlp -c -
4930: 4f 70 5d 0a 46 50 4f 50 54 53 20 20 3d 20 2d 4f  Op].FPOPTS  = -O
4940: 70 0a 21 65 6e 64 69 66 0a 0a 23 20 53 74 72 69  p.!endif..# Stri
4950: 63 74 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e  ct floating poin
4960: 74 20 73 65 6d 61 6e 74 69 63 73 20 2d 20 70 72  t semantics - pr
4970: 65 73 65 6e 74 20 69 6e 20 6e 65 77 65 72 20 63  esent in newer c
4980: 6f 6d 70 69 6c 65 72 73 20 69 6e 20 6c 69 65 75  ompilers in lieu
4990: 20 6f 66 20 2d 4f 70 0a 21 69 66 20 5b 6e 6d 61   of -Op.!if [nma
49a0: 6b 65 68 6c 70 20 2d 63 20 2d 66 70 3a 73 74 72  kehlp -c -fp:str
49b0: 69 63 74 5d 0a 46 50 4f 50 54 53 20 20 3d 20 24  ict].FPOPTS  = $
49c0: 28 46 50 4f 50 54 53 29 20 2d 66 70 3a 73 74 72  (FPOPTS) -fp:str
49d0: 69 63 74 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20  ict.!endif..!if 
49e0: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
49f0: 22 49 58 38 36 22 0a 23 23 23 20 74 65 73 74 20  "IX86".### test 
4a00: 66 6f 72 20 70 65 6e 74 69 75 6d 20 65 72 72 61  for pentium erra
4a10: 74 61 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70  ta.!if [nmakehlp
4a20: 20 2d 63 20 2d 51 49 30 66 5d 0a 21 6d 65 73 73   -c -QI0f].!mess
4a30: 61 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72  age *** Compiler
4a40: 20 68 61 73 20 27 50 65 6e 74 69 75 6d 20 30 78   has 'Pentium 0x
4a50: 30 66 20 66 69 78 27 0a 46 50 4f 50 54 53 20 20  0f fix'.FPOPTS  
4a60: 3d 20 24 28 46 50 4f 50 54 53 29 20 2d 51 49 30  = $(FPOPTS) -QI0
4a70: 66 0a 21 65 6c 73 65 0a 21 6d 65 73 73 61 67 65  f.!else.!message
4a80: 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 20 64 6f   *** Compiler do
4a90: 65 73 20 6e 6f 74 20 68 61 76 65 20 27 50 65 6e  es not have 'Pen
4aa0: 74 69 75 6d 20 30 78 30 66 20 66 69 78 27 0a 21  tium 0x0f fix'.!
4ab0: 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a 23 23  endif.!endif..##
4ac0: 23 20 74 65 73 74 20 66 6f 72 20 6f 70 74 69 6d  # test for optim
4ad0: 69 7a 61 74 69 6f 6e 73 0a 23 20 2f 4f 32 20 6f  izations.# /O2 o
4ae0: 70 74 69 6d 69 7a 61 74 69 6f 6e 20 69 6e 63 6c  ptimization incl
4af0: 75 64 65 73 20 2f 4f 67 20 2f 4f 69 20 2f 4f 74  udes /Og /Oi /Ot
4b00: 20 2f 4f 79 20 2f 4f 62 32 20 2f 47 73 20 2f 47   /Oy /Ob2 /Gs /G
4b10: 46 20 2f 47 79 20 61 73 20 70 65 72 0a 23 20 64  F /Gy as per.# d
4b20: 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 20 4e 6f  ocumentation. No
4b30: 74 65 20 77 65 20 64 6f 20 4e 4f 54 20 77 61 6e  te we do NOT wan
4b40: 74 20 2f 47 73 20 61 73 20 74 68 61 74 20 69 6e  t /Gs as that in
4b50: 73 65 72 74 73 20 61 20 5f 63 68 6b 73 74 6b 0a  serts a _chkstk.
4b60: 23 20 73 74 61 63 6b 20 70 72 6f 62 65 20 61 74  # stack probe at
4b70: 20 2a 65 76 65 72 79 2a 20 66 75 6e 63 74 69 6f   *every* functio
4b80: 6e 20 65 6e 74 72 79 2c 20 6e 6f 74 20 6a 75 73  n entry, not jus
4b90: 74 20 74 68 6f 73 65 20 77 69 74 68 20 6d 6f 72  t those with mor
4ba0: 65 20 74 68 61 6e 0a 23 20 61 20 70 61 67 65 20  e than.# a page 
4bb0: 6f 66 20 73 74 61 63 6b 20 61 6c 6c 6f 63 61 74  of stack allocat
4bc0: 69 6f 6e 20 72 65 73 75 6c 74 69 6e 67 20 69 6e  ion resulting in
4bd0: 20 61 20 70 65 72 66 6f 72 6d 61 6e 63 65 20 68   a performance h
4be0: 69 74 2e 20 20 48 6f 77 65 76 65 72 2c 0a 23 20  it.  However,.# 
4bf0: 2f 4f 32 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f  /O2 documentatio
4c00: 6e 20 69 73 20 6d 69 73 6c 65 61 64 69 6e 67 20  n is misleading 
4c10: 61 73 20 69 74 73 20 73 74 61 63 6b 20 70 72 6f  as its stack pro
4c20: 62 65 73 20 61 72 65 20 73 69 6d 70 6c 79 20 74  bes are simply t
4c30: 68 65 0a 23 20 64 65 66 61 75 6c 74 20 70 61 67  he.# default pag
4c40: 65 20 73 69 7a 65 20 6c 6f 63 61 6c 73 20 61 6c  e size locals al
4c50: 6c 6f 63 61 74 69 6f 6e 20 70 72 6f 62 65 73 20  location probes 
4c60: 61 6e 64 20 6e 6f 74 20 77 68 61 74 20 69 73 20  and not what is 
4c70: 69 6d 70 6c 69 65 64 0a 23 20 62 79 20 61 6e 20  implied.# by an 
4c80: 65 78 70 6c 69 63 69 74 20 2f 47 73 20 6f 70 74  explicit /Gs opt
4c90: 69 6f 6e 2e 0a 0a 4f 50 54 49 4d 49 5a 41 54 49  ion...OPTIMIZATI
4ca0: 4f 4e 53 20 3d 20 24 28 46 50 4f 50 54 53 29 0a  ONS = $(FPOPTS).
4cb0: 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  .!if [nmakehlp -
4cc0: 63 20 2d 4f 32 5d 0a 4f 50 54 49 4d 49 5a 49 4e  c -O2].OPTIMIZIN
4cd0: 47 20 3d 20 31 0a 4f 50 54 49 4d 49 5a 41 54 49  G = 1.OPTIMIZATI
4ce0: 4f 4e 53 20 20 20 3d 20 24 28 4f 50 54 49 4d 49  ONS   = $(OPTIMI
4cf0: 5a 41 54 49 4f 4e 53 29 20 2d 4f 32 0a 21 65 6c  ZATIONS) -O2.!el
4d00: 73 65 0a 23 20 4c 65 67 61 63 79 2c 20 72 65 61  se.# Legacy, rea
4d10: 6c 6c 79 2e 20 41 6c 6c 20 6d 6f 64 65 72 6e 20  lly. All modern 
4d20: 63 6f 6d 70 69 6c 65 72 73 20 73 75 70 70 6f 72  compilers suppor
4d30: 74 20 74 68 69 73 0a 21 6d 65 73 73 61 67 65 20  t this.!message 
4d40: 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 20 64 6f 65  *** Compiler doe
4d50: 73 20 6e 6f 74 20 68 61 76 65 20 27 4f 70 74 69  s not have 'Opti
4d60: 6d 69 7a 61 74 69 6f 6e 73 27 0a 4f 50 54 49 4d  mizations'.OPTIM
4d70: 49 5a 49 4e 47 20 3d 20 30 0a 21 65 6e 64 69 66  IZING = 0.!endif
4d80: 0a 0a 23 20 43 68 65 63 6b 73 20 66 6f 72 20 62  ..# Checks for b
4d90: 75 66 66 65 72 20 6f 76 65 72 66 6c 6f 77 73 20  uffer overflows 
4da0: 69 6e 20 6c 6f 63 61 6c 20 61 72 72 61 79 73 0a  in local arrays.
4db0: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63  !if [nmakehlp -c
4dc0: 20 2d 47 53 5d 0a 4f 50 54 49 4d 49 5a 41 54 49   -GS].OPTIMIZATI
4dd0: 4f 4e 53 20 20 3d 20 24 28 4f 50 54 49 4d 49 5a  ONS  = $(OPTIMIZ
4de0: 41 54 49 4f 4e 53 29 20 2d 47 53 0a 21 65 6e 64  ATIONS) -GS.!end
4df0: 69 66 0a 0a 23 20 4c 69 6e 6b 20 74 69 6d 65 20  if..# Link time 
4e00: 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 2e 20 4e 6f  optimization. No
4e10: 74 65 20 74 68 61 74 20 74 68 69 73 20 6f 70 74  te that this opt
4e20: 69 6f 6e 20 28 70 6f 74 65 6e 74 69 61 6c 6c 79  ion (potentially
4e30: 29 20 6d 61 6b 65 73 0a 23 20 67 65 6e 65 72 61  ) makes.# genera
4e40: 74 65 64 20 6c 69 62 72 61 72 69 65 73 20 6f 6e  ted libraries on
4e50: 6c 79 20 75 73 61 62 6c 65 20 62 79 20 74 68 65  ly usable by the
4e60: 20 73 70 65 63 69 66 69 63 20 56 43 2b 2b 20 76   specific VC++ v
4e70: 65 72 73 69 6f 6e 20 74 68 61 74 0a 23 20 63 72  ersion that.# cr
4e80: 65 61 74 65 64 20 69 74 2e 20 52 65 71 75 69 72  eated it. Requir
4e90: 65 73 20 2f 4c 54 43 47 20 6c 69 6e 6b 65 72 20  es /LTCG linker 
4ea0: 6f 70 74 69 6f 6e 0a 21 69 66 20 5b 6e 6d 61 6b  option.!if [nmak
4eb0: 65 68 6c 70 20 2d 63 20 2d 47 4c 5d 0a 4f 50 54  ehlp -c -GL].OPT
4ec0: 49 4d 49 5a 41 54 49 4f 4e 53 20 20 3d 20 24 28  IMIZATIONS  = $(
4ed0: 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 29 20 2d  OPTIMIZATIONS) -
4ee0: 47 4c 0a 43 43 5f 47 4c 5f 4f 50 54 5f 45 4e 41  GL.CC_GL_OPT_ENA
4ef0: 42 4c 45 44 20 3d 20 31 0a 21 65 6c 73 65 0a 23  BLED = 1.!else.#
4f00: 20 49 6e 20 6e 65 77 65 72 20 63 6f 6d 70 69 6c   In newer compil
4f10: 65 72 73 20 2d 47 4c 20 61 6e 64 20 2d 59 58 20  ers -GL and -YX 
4f20: 61 72 65 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65  are incompatible
4f30: 2e 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  ..!if [nmakehlp 
4f40: 2d 63 20 2d 59 58 5d 0a 4f 50 54 49 4d 49 5a 41  -c -YX].OPTIMIZA
4f50: 54 49 4f 4e 53 20 20 3d 20 24 28 4f 50 54 49 4d  TIONS  = $(OPTIM
4f60: 49 5a 41 54 49 4f 4e 53 29 20 2d 59 58 0a 21 65  IZATIONS) -YX.!e
4f70: 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20 5b 6e  ndif.!endif # [n
4f80: 6d 61 6b 65 68 6c 70 20 2d 63 20 2d 47 4c 5d 0a  makehlp -c -GL].
4f90: 0a 44 45 42 55 47 46 4c 41 47 53 20 20 20 20 20  .DEBUGFLAGS     
4fa0: 3d 20 24 28 46 50 4f 50 54 53 29 0a 0a 23 20 52  = $(FPOPTS)..# R
4fb0: 75 6e 20 74 69 6d 65 20 65 72 72 6f 72 20 63 68  un time error ch
4fc0: 65 63 6b 73 2e 20 4e 6f 74 20 61 76 61 69 6c 61  ecks. Not availa
4fd0: 62 6c 65 20 6f 72 20 76 61 6c 69 64 20 69 6e 20  ble or valid in 
4fe0: 61 20 72 65 6c 65 61 73 65 2c 20 6e 6f 6e 2d 64  a release, non-d
4ff0: 65 62 75 67 20 62 75 69 6c 64 0a 23 20 52 54 43  ebug build.# RTC
5000: 20 69 73 20 66 6f 72 20 6d 6f 64 65 72 6e 20 63   is for modern c
5010: 6f 6d 70 69 6c 65 72 73 2c 20 2d 47 5a 20 69 73  ompilers, -GZ is
5020: 20 6c 65 67 61 63 79 0a 21 69 66 20 5b 6e 6d 61   legacy.!if [nma
5030: 6b 65 68 6c 70 20 2d 63 20 2d 52 54 43 31 5d 0a  kehlp -c -RTC1].
5040: 44 45 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d  DEBUGFLAGS     =
5050: 20 24 28 44 45 42 55 47 46 4c 41 47 53 29 20 2d   $(DEBUGFLAGS) -
5060: 52 54 43 31 0a 21 65 6c 73 65 69 66 20 5b 6e 6d  RTC1.!elseif [nm
5070: 61 6b 65 68 6c 70 20 2d 63 20 2d 47 5a 5d 0a 44  akehlp -c -GZ].D
5080: 45 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d 20  EBUGFLAGS     = 
5090: 24 28 44 45 42 55 47 46 4c 41 47 53 29 20 2d 47  $(DEBUGFLAGS) -G
50a0: 5a 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d  Z.!endif..#-----
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 2d 2d 2d 2d 2d 2d  ----------------
50e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 4c 69  -----------.# Li
50f0: 6e 6b 65 72 20 66 6c 61 67 73 0a 0a 23 20 4c 49  nker flags..# LI
5100: 4e 4b 45 52 5f 54 45 53 54 46 4c 41 47 53 20 61  NKER_TESTFLAGS a
5110: 72 65 20 66 6f 72 20 69 6e 74 65 72 6e 61 6c 20  re for internal 
5120: 75 73 65 20 77 68 65 6e 20 77 65 20 63 61 6c 6c  use when we call
5130: 20 6e 6d 61 6b 65 68 6c 70 20 74 6f 20 74 65 73   nmakehlp to tes
5140: 74 0a 23 20 69 66 20 74 68 65 20 6c 69 6e 6b 65  t.# if the linke
5150: 72 20 73 75 70 70 6f 72 74 73 20 61 20 73 70 65  r supports a spe
5160: 63 69 66 69 63 20 6f 70 74 69 6f 6e 2e 20 57 69  cific option. Wi
5170: 74 68 6f 75 74 20 74 68 65 73 65 20 66 6c 61 67  thout these flag
5180: 73 20 6c 69 6e 6b 20 77 69 6c 6c 0a 23 20 72 65  s link will.# re
5190: 74 75 72 6e 20 22 4c 4e 4b 31 35 36 31 3a 20 65  turn "LNK1561: e
51a0: 6e 74 72 79 20 70 6f 69 6e 74 20 6d 75 73 74 20  ntry point must 
51b0: 62 65 20 64 65 66 69 6e 65 64 22 20 65 72 72 6f  be defined" erro
51c0: 72 20 63 6f 6d 70 69 6c 69 6e 67 20 66 72 6f 6d  r compiling from
51d0: 20 56 53 2d 49 44 45 3a 0a 23 20 54 68 65 79 20   VS-IDE:.# They 
51e0: 61 72 65 20 6e 6f 74 20 70 61 73 73 65 64 20 74  are not passed t
51f0: 68 72 6f 75 67 68 20 74 6f 20 74 68 65 20 61 63  hrough to the ac
5200: 74 75 61 6c 20 61 70 70 6c 69 63 61 74 69 6f 6e  tual application
5210: 20 2f 20 65 78 74 65 6e 73 69 6f 6e 0a 23 20 6c   / extension.# l
5220: 69 6e 6b 20 72 75 6c 65 73 2e 0a 21 69 66 6e 64  ink rules..!ifnd
5230: 65 66 20 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c  ef LINKER_TESTFL
5240: 41 47 53 0a 4c 49 4e 4b 45 52 5f 54 45 53 54 46  AGS.LINKER_TESTF
5250: 4c 41 47 53 20 3d 20 2f 44 4c 4c 20 2f 4e 4f 45  LAGS = /DLL /NOE
5260: 4e 54 52 59 20 2f 4f 55 54 3a 6e 6d 61 6b 65 68  NTRY /OUT:nmakeh
5270: 6c 70 2e 6f 75 74 0a 21 65 6e 64 69 66 0a 0a 4c  lp.out.!endif..L
5280: 49 4e 4b 45 52 46 4c 41 47 53 20 20 20 20 20 3d  INKERFLAGS     =
5290: 0a 0a 23 20 49 66 20 63 6f 6d 70 69 6c 65 72 20  ..# If compiler 
52a0: 68 61 73 20 65 6e 61 62 6c 65 64 20 6c 69 6e 6b  has enabled link
52b0: 20 74 69 6d 65 20 6f 70 74 69 6d 69 7a 61 74 69   time optimizati
52c0: 6f 6e 2c 20 6c 69 6e 6b 65 72 20 6d 75 73 74 20  on, linker must 
52d0: 74 6f 6f 20 77 69 74 68 20 2d 6c 74 63 67 0a 21  too with -ltcg.!
52e0: 69 66 64 65 66 20 43 43 5f 47 4c 5f 4f 50 54 5f  ifdef CC_GL_OPT_
52f0: 45 4e 41 42 4c 45 44 0a 21 69 66 20 5b 6e 6d 61  ENABLED.!if [nma
5300: 6b 65 68 6c 70 20 2d 6c 20 2d 6c 74 63 67 20 24  kehlp -l -ltcg $
5310: 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41 47  (LINKER_TESTFLAG
5320: 53 29 5d 0a 4c 49 4e 4b 45 52 46 4c 41 47 53 20  S)].LINKERFLAGS 
5330: 20 20 20 20 3d 20 24 28 4c 49 4e 4b 45 52 46 4c      = $(LINKERFL
5340: 41 47 53 29 20 2d 6c 74 63 67 0a 21 65 6e 64 69  AGS) -ltcg.!endi
5350: 66 0a 21 65 6e 64 69 66 0a 0a 0a 23 23 23 23 23  f.!endif...#####
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 23 23 23 23 23 23  ################
5390: 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 36 2e  ###########.# 6.
53a0: 20 45 78 74 72 61 63 74 20 76 61 72 69 6f 75 73   Extract various
53b0: 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73   version numbers
53c0: 20 66 72 6f 6d 20 68 65 61 64 65 72 73 0a 23 20   from headers.# 
53d0: 46 6f 72 20 54 63 6c 20 61 6e 64 20 54 6b 2c 20  For Tcl and Tk, 
53e0: 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20  version numbers 
53f0: 61 72 65 20 65 78 74 72 61 63 74 65 64 20 66 72  are extracted fr
5400: 6f 6d 20 74 63 6c 2e 68 20 61 6e 64 20 74 6b 2e  om tcl.h and tk.
5410: 68 0a 23 20 72 65 73 70 65 63 74 69 76 65 6c 79  h.# respectively
5420: 2e 20 46 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73  . For extensions
5430: 2c 20 76 65 72 73 69 6f 6e 73 20 61 72 65 20 65  , versions are e
5440: 78 74 72 61 63 74 65 64 20 66 72 6f 6d 20 74 68  xtracted from th
5450: 65 0a 23 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e  e.# configure.in
5460: 20 6f 72 20 63 6f 6e 66 69 67 75 72 65 2e 61 63   or configure.ac
5470: 20 66 72 6f 6d 20 74 68 65 20 54 45 41 20 63 6f   from the TEA co
5480: 6e 66 69 67 75 72 61 74 69 6f 6e 20 69 66 20 69  nfiguration if i
5490: 74 0a 23 20 65 78 69 73 74 73 2c 20 61 6e 64 20  t.# exists, and 
54a0: 75 6e 73 65 74 20 6f 74 68 65 72 77 69 73 65 2e  unset otherwise.
54b0: 0a 23 20 53 65 74 73 20 74 68 65 20 66 6f 6c 6c  .# Sets the foll
54c0: 6f 77 69 6e 67 20 6d 61 63 72 6f 73 3a 0a 23 20  owing macros:.# 
54d0: 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f  TCL_MAJOR_VERSIO
54e0: 4e 0a 23 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45  N.# TCL_MINOR_VE
54f0: 52 53 49 4f 4e 0a 23 20 54 43 4c 5f 52 45 4c 45  RSION.# TCL_RELE
5500: 41 53 45 5f 53 45 52 49 41 4c 0a 23 20 54 43 4c  ASE_SERIAL.# TCL
5510: 5f 50 41 54 43 48 5f 4c 45 56 45 4c 0a 23 20 54  _PATCH_LEVEL.# T
5520: 43 4c 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 0a  CL_PATCH_LETTER.
5530: 23 20 54 43 4c 5f 56 45 52 53 49 4f 4e 0a 23 20  # TCL_VERSION.# 
5540: 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e  TK_MAJOR_VERSION
5550: 0a 23 20 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53  .# TK_MINOR_VERS
5560: 49 4f 4e 0a 23 20 54 4b 5f 52 45 4c 45 41 53 45  ION.# TK_RELEASE
5570: 5f 53 45 52 49 41 4c 0a 23 20 54 4b 5f 50 41 54  _SERIAL.# TK_PAT
5580: 43 48 5f 4c 45 56 45 4c 0a 23 20 54 4b 5f 50 41  CH_LEVEL.# TK_PA
5590: 54 43 48 5f 4c 45 54 54 45 52 0a 23 20 54 4b 5f  TCH_LETTER.# TK_
55a0: 56 45 52 53 49 4f 4e 0a 23 20 44 4f 54 56 45 52  VERSION.# DOTVER
55b0: 53 49 4f 4e 20 2d 20 73 65 74 20 61 73 20 28 66  SION - set as (f
55c0: 6f 72 20 65 78 61 6d 70 6c 65 29 20 32 2e 35 0a  or example) 2.5.
55d0: 23 20 56 45 52 53 49 4f 4e 20 2d 20 73 65 74 20  # VERSION - set 
55e0: 61 73 20 28 66 6f 72 20 65 78 61 6d 70 6c 65 20  as (for example 
55f0: 32 35 29 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  25).#-----------
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 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5630: 2d 2d 2d 0a 0a 21 69 66 20 5b 65 63 68 6f 20 52  ---..!if [echo R
5640: 45 4d 20 3d 20 54 68 69 73 20 66 69 6c 65 20 69  EM = This file i
5650: 73 20 67 65 6e 65 72 61 74 65 64 20 66 72 6f 6d  s generated from
5660: 20 72 75 6c 65 73 2e 76 63 20 3e 20 76 65 72 73   rules.vc > vers
5670: 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a  ions.vc].!endif.
5680: 21 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 4d 41  !if [echo TCL_MA
5690: 4a 4f 52 5f 56 45 52 53 49 4f 4e 20 3d 20 5c 3e  JOR_VERSION = \>
56a0: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c  > versions.vc] \
56b0: 0a 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70  .   && [nmakehlp
56c0: 20 2d 56 20 22 24 28 5f 54 43 4c 5f 48 29 22 20   -V "$(_TCL_H)" 
56d0: 22 64 65 66 69 6e 65 20 54 43 4c 5f 4d 41 4a 4f  "define TCL_MAJO
56e0: 52 5f 56 45 52 53 49 4f 4e 22 20 3e 3e 20 76 65  R_VERSION" >> ve
56f0: 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69  rsions.vc].!endi
5700: 66 0a 21 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f  f.!if [echo TCL_
5710: 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 20 3d 20  MINOR_VERSION = 
5720: 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d  \>> versions.vc]
5730: 20 5c 0a 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68   \.   && [nmakeh
5740: 6c 70 20 2d 56 20 22 24 28 5f 54 43 4c 5f 48 29  lp -V "$(_TCL_H)
5750: 22 20 22 64 65 66 69 6e 65 20 54 43 4c 5f 4d 49  " "define TCL_MI
5760: 4e 4f 52 5f 56 45 52 53 49 4f 4e 22 20 3e 3e 20  NOR_VERSION" >> 
5770: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e  versions.vc].!en
5780: 64 69 66 0a 21 69 66 20 5b 65 63 68 6f 20 54 43  dif.!if [echo TC
5790: 4c 5f 52 45 4c 45 41 53 45 5f 53 45 52 49 41 4c  L_RELEASE_SERIAL
57a0: 20 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e   = \>> versions.
57b0: 76 63 5d 20 5c 0a 20 20 20 26 26 20 5b 6e 6d 61  vc] \.   && [nma
57c0: 6b 65 68 6c 70 20 2d 56 20 22 24 28 5f 54 43 4c  kehlp -V "$(_TCL
57d0: 5f 48 29 22 20 54 43 4c 5f 52 45 4c 45 41 53 45  _H)" TCL_RELEASE
57e0: 5f 53 45 52 49 41 4c 20 3e 3e 20 76 65 72 73 69  _SERIAL >> versi
57f0: 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21  ons.vc].!endif.!
5800: 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 50 41 54  if [echo TCL_PAT
5810: 43 48 5f 4c 45 56 45 4c 20 3d 20 5c 3e 3e 20 76  CH_LEVEL = \>> v
5820: 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20  ersions.vc] \.  
5830: 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56   && [nmakehlp -V
5840: 20 22 24 28 5f 54 43 4c 5f 48 29 22 20 54 43 4c   "$(_TCL_H)" TCL
5850: 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20 3e 3e 20  _PATCH_LEVEL >> 
5860: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e  versions.vc].!en
5870: 64 69 66 0a 0a 21 69 66 20 64 65 66 69 6e 65 64  dif..!if defined
5880: 28 5f 54 4b 5f 48 29 0a 21 69 66 20 5b 65 63 68  (_TK_H).!if [ech
5890: 6f 20 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  o TK_MAJOR_VERSI
58a0: 4f 4e 20 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e  ON = \>> version
58b0: 73 2e 76 63 5d 20 5c 0a 20 20 20 26 26 20 5b 6e  s.vc] \.   && [n
58c0: 6d 61 6b 65 68 6c 70 20 2d 56 20 24 28 5f 54 4b  makehlp -V $(_TK
58d0: 5f 48 29 20 22 64 65 66 69 6e 65 20 54 4b 5f 4d  _H) "define TK_M
58e0: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 22 20 3e 3e  AJOR_VERSION" >>
58f0: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65   versions.vc].!e
5900: 6e 64 69 66 0a 21 69 66 20 5b 65 63 68 6f 20 54  ndif.!if [echo T
5910: 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 20  K_MINOR_VERSION 
5920: 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  = \>> versions.v
5930: 63 5d 20 5c 0a 20 20 20 26 26 20 5b 6e 6d 61 6b  c] \.   && [nmak
5940: 65 68 6c 70 20 2d 56 20 24 28 5f 54 4b 5f 48 29  ehlp -V $(_TK_H)
5950: 20 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f   TK_MINOR_VERSIO
5960: 4e 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63  N >> versions.vc
5970: 5d 0a 21 65 6e 64 69 66 0a 21 69 66 20 5b 65 63  ].!endif.!if [ec
5980: 68 6f 20 54 4b 5f 52 45 4c 45 41 53 45 5f 53 45  ho TK_RELEASE_SE
5990: 52 49 41 4c 20 3d 20 5c 3e 3e 20 76 65 72 73 69  RIAL = \>> versi
59a0: 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 26 26 20  ons.vc] \.   && 
59b0: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56 20 22 24 28  [nmakehlp -V "$(
59c0: 5f 54 4b 5f 48 29 22 20 54 4b 5f 52 45 4c 45 41  _TK_H)" TK_RELEA
59d0: 53 45 5f 53 45 52 49 41 4c 20 3e 3e 20 76 65 72  SE_SERIAL >> ver
59e0: 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66  sions.vc].!endif
59f0: 0a 21 69 66 20 5b 65 63 68 6f 20 54 4b 5f 50 41  .!if [echo TK_PA
5a00: 54 43 48 5f 4c 45 56 45 4c 20 3d 20 5c 3e 3e 20  TCH_LEVEL = \>> 
5a10: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20  versions.vc] \. 
5a20: 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d    && [nmakehlp -
5a30: 56 20 24 28 5f 54 4b 5f 48 29 20 54 4b 5f 50 41  V $(_TK_H) TK_PA
5a40: 54 43 48 5f 4c 45 56 45 4c 20 3e 3e 20 76 65 72  TCH_LEVEL >> ver
5a50: 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66  sions.vc].!endif
5a60: 0a 21 65 6e 64 69 66 20 23 20 5f 54 4b 5f 48 0a  .!endif # _TK_H.
5a70: 0a 21 69 6e 63 6c 75 64 65 20 76 65 72 73 69 6f  .!include versio
5a80: 6e 73 2e 76 63 0a 0a 54 43 4c 5f 56 45 52 53 49  ns.vc..TCL_VERSI
5a90: 4f 4e 09 3d 20 24 28 54 43 4c 5f 4d 41 4a 4f 52  ON.= $(TCL_MAJOR
5aa0: 5f 56 45 52 53 49 4f 4e 29 24 28 54 43 4c 5f 4d  _VERSION)$(TCL_M
5ab0: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 54 43  INOR_VERSION).TC
5ac0: 4c 5f 44 4f 54 56 45 52 53 49 4f 4e 09 3d 20 24  L_DOTVERSION.= $
5ad0: 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  (TCL_MAJOR_VERSI
5ae0: 4f 4e 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f  ON).$(TCL_MINOR_
5af0: 56 45 52 53 49 4f 4e 29 0a 21 69 66 20 5b 6e 6d  VERSION).!if [nm
5b00: 61 6b 65 68 6c 70 20 2d 66 20 24 28 54 43 4c 5f  akehlp -f $(TCL_
5b10: 50 41 54 43 48 5f 4c 45 56 45 4c 29 20 22 61 22  PATCH_LEVEL) "a"
5b20: 5d 0a 54 43 4c 5f 50 41 54 43 48 5f 4c 45 54 54  ].TCL_PATCH_LETT
5b30: 45 52 20 3d 20 61 0a 21 65 6c 73 65 69 66 20 5b  ER = a.!elseif [
5b40: 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 54 43  nmakehlp -f $(TC
5b50: 4c 5f 50 41 54 43 48 5f 4c 45 56 45 4c 29 20 22  L_PATCH_LEVEL) "
5b60: 62 22 5d 0a 54 43 4c 5f 50 41 54 43 48 5f 4c 45  b"].TCL_PATCH_LE
5b70: 54 54 45 52 20 3d 20 62 0a 21 65 6c 73 65 0a 54  TTER = b.!else.T
5b80: 43 4c 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 20  CL_PATCH_LETTER 
5b90: 3d 20 2e 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20  = ..!endif..!if 
5ba0: 64 65 66 69 6e 65 64 28 5f 54 4b 5f 48 29 0a 0a  defined(_TK_H)..
5bb0: 54 4b 5f 56 45 52 53 49 4f 4e 09 3d 20 24 28 54  TK_VERSION.= $(T
5bc0: 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29  K_MAJOR_VERSION)
5bd0: 24 28 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49  $(TK_MINOR_VERSI
5be0: 4f 4e 29 0a 54 4b 5f 44 4f 54 56 45 52 53 49 4f  ON).TK_DOTVERSIO
5bf0: 4e 09 3d 20 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56  N.= $(TK_MAJOR_V
5c00: 45 52 53 49 4f 4e 29 2e 24 28 54 4b 5f 4d 49 4e  ERSION).$(TK_MIN
5c10: 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 21 69 66 20  OR_VERSION).!if 
5c20: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 54  [nmakehlp -f $(T
5c30: 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 29 20 22  K_PATCH_LEVEL) "
5c40: 61 22 5d 0a 54 4b 5f 50 41 54 43 48 5f 4c 45 54  a"].TK_PATCH_LET
5c50: 54 45 52 20 3d 20 61 0a 21 65 6c 73 65 69 66 20  TER = a.!elseif 
5c60: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 54  [nmakehlp -f $(T
5c70: 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 29 20 22  K_PATCH_LEVEL) "
5c80: 62 22 5d 0a 54 4b 5f 50 41 54 43 48 5f 4c 45 54  b"].TK_PATCH_LET
5c90: 54 45 52 20 3d 20 62 0a 21 65 6c 73 65 0a 54 4b  TER = b.!else.TK
5ca0: 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 20 3d 20  _PATCH_LETTER = 
5cb0: 2e 0a 21 65 6e 64 69 66 0a 0a 21 65 6e 64 69 66  ..!endif..!endif
5cc0: 0a 0a 23 20 53 65 74 20 44 4f 54 56 45 52 53 49  ..# Set DOTVERSI
5cd0: 4f 4e 20 61 6e 64 20 56 45 52 53 49 4f 4e 0a 21  ON and VERSION.!
5ce0: 69 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0a  if $(DOING_TCL).
5cf0: 0a 44 4f 54 56 45 52 53 49 4f 4e 20 3d 20 24 28  .DOTVERSION = $(
5d00: 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f  TCL_MAJOR_VERSIO
5d10: 4e 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56  N).$(TCL_MINOR_V
5d20: 45 52 53 49 4f 4e 29 0a 56 45 52 53 49 4f 4e 20  ERSION).VERSION 
5d30: 3d 20 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29  = $(TCL_VERSION)
5d40: 0a 0a 21 65 6c 73 65 69 66 20 24 28 44 4f 49 4e  ..!elseif $(DOIN
5d50: 47 5f 54 4b 29 0a 0a 44 4f 54 56 45 52 53 49 4f  G_TK)..DOTVERSIO
5d60: 4e 20 3d 20 24 28 54 4b 5f 44 4f 54 56 45 52 53  N = $(TK_DOTVERS
5d70: 49 4f 4e 29 0a 56 45 52 53 49 4f 4e 20 3d 20 24  ION).VERSION = $
5d80: 28 54 4b 5f 56 45 52 53 49 4f 4e 29 0a 0a 21 65  (TK_VERSION)..!e
5d90: 6c 73 65 20 23 20 44 6f 69 6e 67 20 61 20 6e 6f  lse # Doing a no
5da0: 6e 2d 54 6b 20 65 78 74 65 6e 73 69 6f 6e 0a 0a  n-Tk extension..
5db0: 23 20 49 66 20 70 61 72 65 6e 74 20 6d 61 6b 65  # If parent make
5dc0: 66 69 6c 65 20 68 61 73 20 6e 6f 74 20 64 65 66  file has not def
5dd0: 69 6e 65 64 20 44 4f 54 56 45 52 53 49 4f 4e 2c  ined DOTVERSION,
5de0: 20 74 72 79 20 74 6f 20 67 65 74 20 69 74 20 66   try to get it f
5df0: 72 6f 6d 20 54 45 41 0a 23 20 66 69 72 73 74 20  rom TEA.# first 
5e00: 66 72 6f 6d 20 61 20 63 6f 6e 66 69 67 75 72 65  from a configure
5e10: 2e 69 6e 20 66 69 6c 65 2c 20 61 6e 64 20 74 68  .in file, and th
5e20: 65 6e 20 66 72 6f 6d 20 63 6f 6e 66 69 67 75 72  en from configur
5e30: 65 2e 61 63 0a 21 69 66 6e 64 65 66 20 44 4f 54  e.ac.!ifndef DOT
5e40: 56 45 52 53 49 4f 4e 0a 21 69 66 20 5b 65 63 68  VERSION.!if [ech
5e50: 6f 20 44 4f 54 56 45 52 53 49 4f 4e 20 3d 20 5c  o DOTVERSION = \
5e60: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c  > versions.vc] \
5e70: 0a 20 20 20 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70  .   || [nmakehlp
5e80: 20 2d 56 20 24 28 52 4f 4f 54 29 5c 63 6f 6e 66   -V $(ROOT)\conf
5e90: 69 67 75 72 65 2e 69 6e 20 5e 5b 24 28 50 52 4f  igure.in ^[$(PRO
5ea0: 4a 45 43 54 29 5e 5d 20 3e 3e 20 76 65 72 73 69  JECT)^] >> versi
5eb0: 6f 6e 73 2e 76 63 5d 0a 21 69 66 20 5b 65 63 68  ons.vc].!if [ech
5ec0: 6f 20 44 4f 54 56 45 52 53 49 4f 4e 20 3d 20 5c  o DOTVERSION = \
5ed0: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c  > versions.vc] \
5ee0: 0a 20 20 20 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70  .   || [nmakehlp
5ef0: 20 2d 56 20 24 28 52 4f 4f 54 29 5c 63 6f 6e 66   -V $(ROOT)\conf
5f00: 69 67 75 72 65 2e 61 63 20 5e 5b 24 28 50 52 4f  igure.ac ^[$(PRO
5f10: 4a 45 43 54 29 5e 5d 20 3e 3e 20 76 65 72 73 69  JECT)^] >> versi
5f20: 6f 6e 73 2e 76 63 5d 0a 21 65 72 72 6f 72 20 2a  ons.vc].!error *
5f30: 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 69 67  ** Could not fig
5f40: 75 72 65 20 6f 75 74 20 65 78 74 65 6e 73 69 6f  ure out extensio
5f50: 6e 20 76 65 72 73 69 6f 6e 2e 20 50 6c 65 61 73  n version. Pleas
5f60: 65 20 64 65 66 69 6e 65 20 44 4f 54 56 45 52 53  e define DOTVERS
5f70: 49 4f 4e 20 69 6e 20 70 61 72 65 6e 74 20 6d 61  ION in parent ma
5f80: 6b 65 66 69 6c 65 20 62 65 66 6f 72 65 20 69 6e  kefile before in
5f90: 63 6c 75 64 69 6e 67 20 72 75 6c 65 73 2e 76 63  cluding rules.vc
5fa0: 2e 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  ..!endif.!endif.
5fb0: 21 69 6e 63 6c 75 64 65 20 76 65 72 73 69 6f 6e  !include version
5fc0: 73 2e 76 63 0a 21 65 6e 64 69 66 20 23 20 44 4f  s.vc.!endif # DO
5fd0: 54 56 45 52 53 49 4f 4e 0a 56 45 52 53 49 4f 4e  TVERSION.VERSION
5fe0: 20 20 20 20 20 20 20 20 20 3d 20 24 28 44 4f 54           = $(DOT
5ff0: 56 45 52 53 49 4f 4e 3a 2e 3d 29 0a 0a 21 65 6e  VERSION:.=)..!en
6000: 64 69 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 43  dif # $(DOING_TC
6010: 4c 29 20 2e 2e 2e 20 65 74 63 2e 0a 0a 23 20 57  L) ... etc...# W
6020: 69 6e 64 6f 77 73 20 52 43 20 66 69 6c 65 73 20  indows RC files 
6030: 68 61 76 65 20 33 20 76 65 72 73 69 6f 6e 20 63  have 3 version c
6040: 6f 6d 70 6f 6e 65 6e 74 73 2e 20 45 6e 73 75 72  omponents. Ensur
6050: 65 20 74 68 69 73 20 69 72 72 65 73 70 65 63 74  e this irrespect
6060: 69 76 65 0a 23 20 6f 66 20 68 6f 77 20 6d 61 6e  ive.# of how man
6070: 79 20 63 6f 6d 70 6f 6e 65 6e 74 73 20 74 68 65  y components the
6080: 20 70 61 63 6b 61 67 65 20 68 61 73 20 73 70 65   package has spe
6090: 63 69 66 69 65 64 2e 20 42 61 73 69 63 61 6c 6c  cified. Basicall
60a0: 79 2c 20 65 6e 73 75 72 65 0a 23 20 6d 69 6e 69  y, ensure.# mini
60b0: 6d 75 6d 20 34 20 63 6f 6d 70 6f 6e 65 6e 74 73  mum 4 components
60c0: 20 62 79 20 61 70 70 65 6e 64 69 6e 67 20 34 20   by appending 4 
60d0: 30 27 73 20 61 6e 64 20 74 68 65 6e 20 70 69 63  0's and then pic
60e0: 6b 20 6f 75 74 20 74 68 65 20 66 69 72 73 74 20  k out the first 
60f0: 34 2e 0a 23 20 41 6c 73 6f 20 74 61 6b 65 20 63  4..# Also take c
6100: 61 72 65 20 6f 66 20 74 68 65 20 66 61 63 74 20  are of the fact 
6110: 74 68 61 74 20 44 4f 54 56 45 52 53 49 4f 4e 20  that DOTVERSION 
6120: 6d 61 79 20 68 61 76 65 20 22 61 22 20 6f 72 20  may have "a" or 
6130: 22 62 22 20 69 6e 73 74 65 61 64 0a 23 20 6f 66  "b" instead.# of
6140: 20 22 2e 22 20 73 65 70 61 72 61 74 69 6e 67 20   "." separating 
6150: 74 68 65 20 76 65 72 73 69 6f 6e 20 63 6f 6d 70  the version comp
6160: 6f 6e 65 6e 74 73 2e 0a 44 4f 54 53 45 50 41 52  onents..DOTSEPAR
6170: 41 54 45 44 3d 24 28 44 4f 54 56 45 52 53 49 4f  ATED=$(DOTVERSIO
6180: 4e 3a 61 3d 2e 29 0a 44 4f 54 53 45 50 41 52 41  N:a=.).DOTSEPARA
6190: 54 45 44 3d 24 28 44 4f 54 53 45 50 41 52 41 54  TED=$(DOTSEPARAT
61a0: 45 44 3a 62 3d 2e 29 0a 21 69 66 20 5b 65 63 68  ED:b=.).!if [ech
61b0: 6f 20 52 43 43 4f 4d 4d 41 56 45 52 53 49 4f 4e  o RCCOMMAVERSION
61c0: 20 3d 20 5c 3e 20 76 65 72 73 69 6f 6e 73 2e 76   = \> versions.v
61d0: 63 5d 20 5c 0a 20 20 7c 7c 20 5b 66 6f 72 20 2f  c] \.  || [for /
61e0: 66 20 22 74 6f 6b 65 6e 73 3d 31 2c 32 2c 33 2c  f "tokens=1,2,3,
61f0: 34 2c 35 2a 20 64 65 6c 69 6d 73 3d 2e 22 20 25  4,5* delims=." %
6200: 61 20 69 6e 20 28 22 24 28 44 4f 54 53 45 50 41  a in ("$(DOTSEPA
6210: 52 41 54 45 44 29 2e 30 2e 30 2e 30 2e 30 22 29  RATED).0.0.0.0")
6220: 20 64 6f 20 65 63 68 6f 20 25 61 2c 25 62 2c 25   do echo %a,%b,%
6230: 63 2c 25 64 20 3e 3e 20 76 65 72 73 69 6f 6e 73  c,%d >> versions
6240: 2e 76 63 5d 0a 21 65 72 72 6f 72 20 2a 2a 2a 20  .vc].!error *** 
6250: 43 6f 75 6c 64 20 6e 6f 74 20 67 65 6e 65 72 61  Could not genera
6260: 74 65 20 52 43 43 4f 4d 4d 41 56 45 52 53 49 4f  te RCCOMMAVERSIO
6270: 4e 20 2a 2a 2a 0a 21 65 6e 64 69 66 0a 21 69 6e  N ***.!endif.!in
6280: 63 6c 75 64 65 20 76 65 72 73 69 6f 6e 73 2e 76  clude versions.v
6290: 63 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23  c..#############
62a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
62b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
62c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
62d0: 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 37 2e  ###########.# 7.
62e0: 20 50 61 72 73 65 20 74 68 65 20 4f 50 54 53 20   Parse the OPTS 
62f0: 6d 61 63 72 6f 20 74 6f 20 77 6f 72 6b 20 6f 75  macro to work ou
6300: 74 20 74 68 65 20 72 65 71 75 65 73 74 65 64 20  t the requested 
6310: 62 75 69 6c 64 20 63 6f 6e 66 69 67 75 72 61 74  build configurat
6320: 69 6f 6e 2e 0a 23 20 42 61 73 65 64 20 6f 6e 20  ion..# Based on 
6330: 74 68 69 73 2c 20 77 65 20 77 69 6c 6c 20 63 6f  this, we will co
6340: 6e 73 74 72 75 63 74 20 74 68 65 20 61 63 74 75  nstruct the actu
6350: 61 6c 20 73 77 69 74 63 68 65 73 20 74 6f 20 62  al switches to b
6360: 65 20 70 61 73 73 65 64 20 74 6f 20 74 68 65 0a  e passed to the.
6370: 23 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64 20 6c  # compiler and l
6380: 69 6e 6b 65 72 20 75 73 69 6e 67 20 74 68 65 20  inker using the 
6390: 6d 61 63 72 6f 73 20 64 65 66 69 6e 65 64 20 69  macros defined i
63a0: 6e 20 74 68 65 20 70 72 65 76 69 6f 75 73 20 73  n the previous s
63b0: 65 63 74 69 6f 6e 2e 0a 23 20 54 68 65 20 66 6f  ection..# The fo
63c0: 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 20 61  llowing macros a
63d0: 72 65 20 64 65 66 69 6e 65 64 20 62 79 20 74 68  re defined by th
63e0: 69 73 20 73 65 63 74 69 6f 6e 20 62 61 73 65 64  is section based
63f0: 20 6f 6e 20 4f 50 54 53 0a 23 20 53 54 41 54 49   on OPTS.# STATI
6400: 43 5f 42 55 49 4c 44 20 2d 20 30 20 2d 3e 20 54  C_BUILD - 0 -> T
6410: 63 6c 20 69 73 20 74 6f 20 62 65 20 62 75 69 6c  cl is to be buil
6420: 74 20 61 73 20 61 20 73 68 61 72 65 64 20 6c 69  t as a shared li
6430: 62 72 61 72 79 0a 23 20 20 20 20 20 20 20 20 20  brary.#         
6440: 20 20 20 20 20 20 20 31 20 2d 3e 20 62 75 69 6c         1 -> buil
6450: 64 20 61 73 20 61 20 73 74 61 74 69 63 20 6c 69  d as a static li
6460: 62 72 61 72 79 20 61 6e 64 20 73 68 65 6c 6c 0a  brary and shell.
6470: 23 20 54 43 4c 5f 54 48 52 45 41 44 53 20 2d 20  # TCL_THREADS - 
6480: 6c 65 67 61 63 79 20 62 75 74 20 61 6c 77 61 79  legacy but alway
6490: 73 20 31 20 6f 6e 20 57 69 6e 64 6f 77 73 20 73  s 1 on Windows s
64a0: 69 6e 63 65 20 77 69 6e 73 6f 63 6b 20 72 65 71  ince winsock req
64b0: 75 69 72 65 73 20 69 74 2e 0a 23 20 44 45 42 55  uires it..# DEBU
64c0: 47 20 2d 20 31 20 2d 3e 20 64 65 62 75 67 20 62  G - 1 -> debug b
64d0: 75 69 6c 64 2c 20 30 20 2d 3e 20 72 65 6c 65 61  uild, 0 -> relea
64e0: 73 65 20 62 75 69 6c 64 73 0a 23 20 53 59 4d 42  se builds.# SYMB
64f0: 4f 4c 53 20 2d 20 31 20 2d 3e 20 67 65 6e 65 72  OLS - 1 -> gener
6500: 61 74 65 20 50 44 42 27 73 2c 20 30 20 2d 3e 20  ate PDB's, 0 -> 
6510: 6e 6f 20 50 44 42 27 73 0a 23 20 50 52 4f 46 49  no PDB's.# PROFI
6520: 4c 45 20 2d 20 31 20 2d 3e 20 67 65 6e 65 72 61  LE - 1 -> genera
6530: 74 65 20 70 72 6f 66 69 6c 69 6e 67 20 69 6e 66  te profiling inf
6540: 6f 2c 20 30 20 2d 3e 20 6e 6f 20 70 72 6f 66 69  o, 0 -> no profi
6550: 6c 69 6e 67 0a 23 20 50 47 4f 20 20 20 20 20 2d  ling.# PGO     -
6560: 20 31 20 2d 3e 20 70 72 6f 66 69 6c 65 20 62 61   1 -> profile ba
6570: 73 65 64 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e  sed optimization
6580: 2c 20 30 20 2d 3e 20 6e 6f 0a 23 20 4d 53 56 43  , 0 -> no.# MSVC
6590: 52 54 20 20 2d 20 31 20 2d 3e 20 6c 69 6e 6b 20  RT  - 1 -> link 
65a0: 74 6f 20 64 79 6e 61 6d 69 63 20 43 20 72 75 6e  to dynamic C run
65b0: 74 69 6d 65 20 65 76 65 6e 20 77 68 65 6e 20 62  time even when b
65c0: 75 69 6c 64 69 6e 67 20 73 74 61 74 69 63 20 54  uilding static T
65d0: 63 6c 20 62 75 69 6c 64 0a 23 20 20 20 20 20 20  cl build.#      
65e0: 20 20 20 20 20 30 20 2d 3e 20 6c 69 6e 6b 20 74       0 -> link t
65f0: 6f 20 73 74 61 74 69 63 20 43 20 72 75 6e 74 69  o static C runti
6600: 6d 65 20 66 6f 72 20 73 74 61 74 69 63 20 54 63  me for static Tc
6610: 6c 20 62 75 69 6c 64 2e 0a 23 20 20 20 20 20 20  l build..#      
6620: 20 20 20 20 20 44 6f 65 73 20 6e 6f 74 20 69 6d       Does not im
6630: 70 61 63 74 20 73 68 61 72 65 64 20 54 63 6c 20  pact shared Tcl 
6640: 62 75 69 6c 64 73 20 28 53 54 41 54 49 43 5f 42  builds (STATIC_B
6650: 55 49 4c 44 20 3d 3d 20 30 29 0a 23 20 20 20 20  UILD == 0).#    
6660: 20 20 20 20 20 20 20 44 65 66 61 75 6c 74 3a 20         Default: 
6670: 31 20 66 6f 72 20 54 63 6c 20 38 2e 37 20 61 6e  1 for Tcl 8.7 an
6680: 64 20 75 70 2c 20 30 20 6f 74 68 65 72 77 69 73  d up, 0 otherwis
6690: 65 2e 0a 23 20 54 43 4c 5f 55 53 45 5f 53 54 41  e..# TCL_USE_STA
66a0: 54 49 43 5f 50 41 43 4b 41 47 45 53 20 2d 20 31  TIC_PACKAGES - 1
66b0: 20 2d 3e 20 73 74 61 74 69 63 61 6c 6c 79 20 6c   -> statically l
66c0: 69 6e 6b 20 74 68 65 20 72 65 67 69 73 74 72 79  ink the registry
66d0: 20 61 6e 64 20 64 64 65 20 65 78 74 65 6e 73 69   and dde extensi
66e0: 6f 6e 73 0a 23 20 20 20 20 20 20 20 20 20 20 20  ons.#           
66f0: 69 6e 20 74 68 65 20 54 63 6c 20 61 6e 64 20 57  in the Tcl and W
6700: 69 73 68 20 73 68 65 6c 6c 2e 20 30 20 2d 3e 20  ish shell. 0 -> 
6710: 6b 65 65 70 20 74 68 65 6d 20 61 73 20 73 68 61  keep them as sha
6720: 72 65 64 20 6c 69 62 72 61 72 69 65 73 2e 20 44  red libraries. D
6730: 6f 65 73 0a 23 20 20 20 20 20 20 20 20 20 20 20  oes.#           
6740: 6e 6f 74 20 69 6d 70 61 63 74 20 73 68 61 72 65  not impact share
6750: 64 20 54 63 6c 20 62 75 69 6c 64 73 2e 20 49 6d  d Tcl builds. Im
6760: 70 6c 69 65 64 20 62 79 20 53 54 41 54 49 43 5f  plied by STATIC_
6770: 42 55 49 4c 44 20 73 69 6e 63 65 20 54 63 6c 20  BUILD since Tcl 
6780: 38 2e 37 2e 0a 23 20 55 53 45 5f 54 48 52 45 41  8.7..# USE_THREA
6790: 44 5f 41 4c 4c 4f 43 20 2d 20 31 20 2d 3e 20 55  D_ALLOC - 1 -> U
67a0: 73 65 20 61 20 73 68 61 72 65 64 20 67 6c 6f 62  se a shared glob
67b0: 61 6c 20 66 72 65 65 20 70 6f 6f 6c 20 66 6f 72  al free pool for
67c0: 20 61 6c 6c 6f 63 61 74 69 6f 6e 2e 0a 23 20 20   allocation..#  
67d0: 20 20 20 20 20 20 20 20 20 30 20 2d 3e 20 55 73           0 -> Us
67e0: 65 20 74 68 65 20 6e 6f 6e 2d 74 68 72 65 61 64  e the non-thread
67f0: 20 61 6c 6c 6f 63 61 74 6f 72 2e 0a 23 20 55 4e   allocator..# UN
6800: 43 48 45 43 4b 45 44 20 2d 20 31 20 2d 3e 20 77  CHECKED - 1 -> w
6810: 68 65 6e 20 64 6f 69 6e 67 20 61 20 64 65 62 75  hen doing a debu
6820: 67 20 62 75 69 6c 64 20 77 69 74 68 20 73 79 6d  g build with sym
6830: 62 6f 6c 73 2c 20 75 73 65 20 74 68 65 20 72 65  bols, use the re
6840: 6c 65 61 73 65 0a 23 20 20 20 20 20 20 20 20 20  lease.#         
6850: 20 20 43 20 72 75 6e 74 69 6d 65 2c 20 30 20 2d    C runtime, 0 -
6860: 3e 20 75 73 65 20 74 68 65 20 64 65 62 75 67 20  > use the debug 
6870: 43 20 72 75 6e 74 69 6d 65 2e 0a 23 20 55 53 45  C runtime..# USE
6880: 5f 53 54 55 42 53 20 2d 20 31 20 2d 3e 20 63 6f  _STUBS - 1 -> co
6890: 6d 70 69 6c 65 20 74 6f 20 75 73 65 20 73 74 75  mpile to use stu
68a0: 62 73 20 69 6e 74 65 72 66 61 63 65 73 2c 20 30  bs interfaces, 0
68b0: 20 2d 3e 20 64 69 72 65 63 74 20 6c 69 6e 6b 69   -> direct linki
68c0: 6e 67 0a 23 20 43 4f 4e 46 49 47 5f 43 48 45 43  ng.# CONFIG_CHEC
68d0: 4b 20 2d 20 31 20 2d 3e 20 63 68 65 63 6b 20 63  K - 1 -> check c
68e0: 75 72 72 65 6e 74 20 62 75 69 6c 64 20 63 6f 6e  urrent build con
68f0: 66 69 67 75 72 61 74 69 6f 6e 20 61 67 61 69 6e  figuration again
6900: 73 74 20 54 63 6c 0a 23 20 20 20 20 20 20 20 20  st Tcl.#        
6910: 20 20 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e     configuration
6920: 20 28 69 67 6e 6f 72 65 64 20 66 6f 72 20 54 63   (ignored for Tc
6930: 6c 20 69 74 73 65 6c 66 29 0a 23 20 5f 55 53 45  l itself).# _USE
6940: 5f 36 34 42 49 54 5f 54 49 4d 45 5f 54 20 2d 20  _64BIT_TIME_T - 
6950: 66 6f 72 63 65 73 20 61 20 62 75 69 6c 64 20 75  forces a build u
6960: 73 69 6e 67 20 36 34 2d 62 69 74 20 74 69 6d 65  sing 64-bit time
6970: 5f 74 20 66 6f 72 20 33 32 2d 62 69 74 20 62 75  _t for 32-bit bu
6980: 69 6c 64 0a 23 20 20 20 20 20 20 20 20 20 20 20  ild.#           
6990: 28 43 52 54 20 6c 69 62 72 61 72 79 20 73 68 6f  (CRT library sho
69a0: 75 6c 64 20 73 75 70 70 6f 72 74 20 74 68 69 73  uld support this
69b0: 2c 20 6e 6f 74 20 6e 65 65 64 65 64 20 66 6f 72  , not needed for
69c0: 20 54 63 6c 20 39 2e 78 29 0a 23 20 46 75 72 74   Tcl 9.x).# Furt
69d0: 68 65 72 2c 20 4c 49 4e 4b 45 52 46 4c 41 47 53  her, LINKERFLAGS
69e0: 20 61 72 65 20 6d 6f 64 69 66 69 65 64 20 62 61   are modified ba
69f0: 73 65 64 20 6f 6e 20 61 62 6f 76 65 2e 0a 0a 23  sed on above...#
6a00: 20 44 65 66 61 75 6c 74 20 76 61 6c 75 65 73 20   Default values 
6a10: 66 6f 72 20 61 6c 6c 20 74 68 65 20 61 62 6f 76  for all the abov
6a20: 65 0a 53 54 41 54 49 43 5f 42 55 49 4c 44 09 3d  e.STATIC_BUILD.=
6a30: 20 30 0a 54 43 4c 5f 54 48 52 45 41 44 53 09 3d   0.TCL_THREADS.=
6a40: 20 31 0a 44 45 42 55 47 09 09 3d 20 30 0a 53 59   1.DEBUG..= 0.SY
6a50: 4d 42 4f 4c 53 09 09 3d 20 30 0a 50 52 4f 46 49  MBOLS..= 0.PROFI
6a60: 4c 45 09 09 3d 20 30 0a 50 47 4f 09 09 3d 20 30  LE..= 0.PGO..= 0
6a70: 0a 4d 53 56 43 52 54 09 09 3d 20 31 0a 54 43 4c  .MSVCRT..= 1.TCL
6a80: 5f 55 53 45 5f 53 54 41 54 49 43 5f 50 41 43 4b  _USE_STATIC_PACK
6a90: 41 47 45 53 09 3d 20 30 0a 55 53 45 5f 54 48 52  AGES.= 0.USE_THR
6aa0: 45 41 44 5f 41 4c 4c 4f 43 20 3d 20 31 0a 55 4e  EAD_ALLOC = 1.UN
6ab0: 43 48 45 43 4b 45 44 09 3d 20 30 0a 43 4f 4e 46  CHECKED.= 0.CONF
6ac0: 49 47 5f 43 48 45 43 4b 20 20 20 20 3d 20 31 0a  IG_CHECK    = 1.
6ad0: 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29  !if $(DOING_TCL)
6ae0: 0a 55 53 45 5f 53 54 55 42 53 20 20 20 20 20 20  .USE_STUBS      
6af0: 20 3d 20 30 0a 21 65 6c 73 65 0a 55 53 45 5f 53   = 0.!else.USE_S
6b00: 54 55 42 53 20 20 20 20 20 20 20 3d 20 31 0a 21  TUBS       = 1.!
6b10: 65 6e 64 69 66 0a 0a 23 20 49 66 20 4f 50 54 53  endif..# If OPTS
6b20: 20 69 73 20 6e 6f 74 20 65 6d 70 74 79 20 41 4e   is not empty AN
6b30: 44 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61  D does not conta
6b40: 69 6e 20 22 6e 6f 6e 65 22 20 77 68 69 63 68 20  in "none" which 
6b50: 74 75 72 6e 73 20 6f 66 66 20 61 6c 6c 20 4f 50  turns off all OP
6b60: 54 53 0a 23 20 73 65 74 20 74 68 65 20 61 62 6f  TS.# set the abo
6b70: 76 65 20 6d 61 63 72 6f 73 20 62 61 73 65 64 20  ve macros based 
6b80: 6f 6e 20 4f 50 54 53 20 63 6f 6e 74 65 6e 74 0a  on OPTS content.
6b90: 21 69 66 20 22 24 28 4f 50 54 53 29 22 20 21 3d  !if "$(OPTS)" !=
6ba0: 20 22 22 20 26 26 20 21 5b 6e 6d 61 6b 65 68 6c   "" && ![nmakehl
6bb0: 70 20 2d 66 20 22 24 28 4f 50 54 53 29 22 20 22  p -f "$(OPTS)" "
6bc0: 6e 6f 6e 65 22 5d 0a 0a 23 20 4f 50 54 53 20 61  none"]..# OPTS a
6bd0: 72 65 20 73 70 65 63 69 66 69 65 64 2c 20 70 61  re specified, pa
6be0: 72 73 65 20 74 68 65 6d 0a 0a 21 69 66 20 5b 6e  rse them..!if [n
6bf0: 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54  makehlp -f $(OPT
6c00: 53 29 20 22 73 74 61 74 69 63 22 5d 0a 21 6d 65  S) "static"].!me
6c10: 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20  ssage *** Doing 
6c20: 73 74 61 74 69 63 0a 53 54 41 54 49 43 5f 42 55  static.STATIC_BU
6c30: 49 4c 44 09 3d 20 31 0a 21 65 6e 64 69 66 0a 0a  ILD.= 1.!endif..
6c40: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66  !if [nmakehlp -f
6c50: 20 24 28 4f 50 54 53 29 20 22 6e 6f 73 74 75 62   $(OPTS) "nostub
6c60: 73 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  s"].!message ***
6c70: 20 4e 6f 74 20 75 73 69 6e 67 20 73 74 75 62 73   Not using stubs
6c80: 0a 55 53 45 5f 53 54 55 42 53 09 3d 20 30 0a 21  .USE_STUBS.= 0.!
6c90: 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b  endif..!if [nmak
6ca0: 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20  ehlp -f $(OPTS) 
6cb0: 22 6e 6f 6d 73 76 63 72 74 22 5d 0a 21 6d 65 73  "nomsvcrt"].!mes
6cc0: 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 6e  sage *** Doing n
6cd0: 6f 6d 73 76 63 72 74 0a 4d 53 56 43 52 54 09 09  omsvcrt.MSVCRT..
6ce0: 3d 20 30 0a 21 65 6c 73 65 0a 21 69 66 20 5b 6e  = 0.!else.!if [n
6cf0: 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54  makehlp -f $(OPT
6d00: 53 29 20 22 6d 73 76 63 72 74 22 5d 0a 21 6d 65  S) "msvcrt"].!me
6d10: 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20  ssage *** Doing 
6d20: 6d 73 76 63 72 74 0a 21 65 6c 73 65 0a 21 69 66  msvcrt.!else.!if
6d30: 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52   $(TCL_MAJOR_VER
6d40: 53 49 4f 4e 29 20 3d 3d 20 38 20 26 26 20 24 28  SION) == 8 && $(
6d50: 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f  TCL_MINOR_VERSIO
6d60: 4e 29 20 3c 20 37 20 26 26 20 24 28 53 54 41 54  N) < 7 && $(STAT
6d70: 49 43 5f 42 55 49 4c 44 29 0a 4d 53 56 43 52 54  IC_BUILD).MSVCRT
6d80: 09 09 3d 20 30 0a 21 65 6e 64 69 66 0a 21 65 6e  ..= 0.!endif.!en
6d90: 64 69 66 0a 21 65 6e 64 69 66 20 23 20 5b 6e 6d  dif.!endif # [nm
6da0: 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53  akehlp -f $(OPTS
6db0: 29 20 22 6e 6f 6d 73 76 63 72 74 22 5d 0a 0a 21  ) "nomsvcrt"]..!
6dc0: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20  if [nmakehlp -f 
6dd0: 24 28 4f 50 54 53 29 20 22 73 74 61 74 69 63 70  $(OPTS) "staticp
6de0: 6b 67 22 5d 20 26 26 20 24 28 53 54 41 54 49 43  kg"] && $(STATIC
6df0: 5f 42 55 49 4c 44 29 0a 21 6d 65 73 73 61 67 65  _BUILD).!message
6e00: 20 2a 2a 2a 20 44 6f 69 6e 67 20 73 74 61 74 69   *** Doing stati
6e10: 63 70 6b 67 0a 54 43 4c 5f 55 53 45 5f 53 54 41  cpkg.TCL_USE_STA
6e20: 54 49 43 5f 50 41 43 4b 41 47 45 53 09 3d 20 31  TIC_PACKAGES.= 1
6e30: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d  .!endif..!if [nm
6e40: 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53  akehlp -f $(OPTS
6e50: 29 20 22 6e 6f 74 68 72 65 61 64 73 22 5d 0a 21  ) "nothreads"].!
6e60: 6d 65 73 73 61 67 65 20 2a 2a 2a 20 43 6f 6d 70  message *** Comp
6e70: 69 6c 65 20 65 78 70 6c 69 63 69 74 6c 79 20 66  ile explicitly f
6e80: 6f 72 20 6e 6f 6e 2d 74 68 72 65 61 64 65 64 20  or non-threaded 
6e90: 74 63 6c 0a 54 43 4c 5f 54 48 52 45 41 44 53 20  tcl.TCL_THREADS 
6ea0: 3d 20 30 0a 55 53 45 5f 54 48 52 45 41 44 5f 41  = 0.USE_THREAD_A
6eb0: 4c 4c 4f 43 3d 20 30 0a 21 65 6e 64 69 66 0a 0a  LLOC= 0.!endif..
6ec0: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66  !if [nmakehlp -f
6ed0: 20 24 28 4f 50 54 53 29 20 22 74 63 6c 38 22 5d   $(OPTS) "tcl8"]
6ee0: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 42 75  .!message *** Bu
6ef0: 69 6c 64 20 66 6f 72 20 54 63 6c 38 0a 54 43 4c  ild for Tcl8.TCL
6f00: 5f 42 55 49 4c 44 5f 46 4f 52 20 3d 20 38 0a 21  _BUILD_FOR = 8.!
6f10: 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 54 43 4c  endif..!if $(TCL
6f20: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20  _MAJOR_VERSION) 
6f30: 3d 3d 20 38 0a 21 69 66 20 5b 6e 6d 61 6b 65 68  == 8.!if [nmakeh
6f40: 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 74  lp -f $(OPTS) "t
6f50: 69 6d 65 36 34 62 69 74 22 5d 0a 21 6d 65 73 73  ime64bit"].!mess
6f60: 61 67 65 20 2a 2a 2a 20 46 6f 72 63 65 20 36 34  age *** Force 64
6f70: 2d 62 69 74 20 74 69 6d 65 5f 74 0a 5f 55 53 45  -bit time_t._USE
6f80: 5f 36 34 42 49 54 5f 54 49 4d 45 5f 54 20 3d 20  _64BIT_TIME_T = 
6f90: 31 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  1.!endif.!endif.
6fa0: 0a 23 20 59 65 73 2c 20 69 74 27 73 20 77 65 69  .# Yes, it's wei
6fb0: 72 64 20 74 68 61 74 20 74 68 65 20 22 73 79 6d  rd that the "sym
6fc0: 62 6f 6c 73 22 20 6f 70 74 69 6f 6e 20 63 6f 6e  bols" option con
6fd0: 74 72 6f 6c 73 20 44 45 42 55 47 20 61 6e 64 0a  trols DEBUG and.
6fe0: 23 20 74 68 65 20 22 70 64 62 73 22 20 6f 70 74  # the "pdbs" opt
6ff0: 69 6f 6e 20 63 6f 6e 74 72 6f 6c 73 20 53 59 4d  ion controls SYM
7000: 42 4f 4c 53 2e 20 54 68 61 74 27 73 20 68 69 73  BOLS. That's his
7010: 74 6f 72 69 63 61 6c 2e 0a 21 69 66 20 5b 6e 6d  torical..!if [nm
7020: 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53  akehlp -f $(OPTS
7030: 29 20 22 73 79 6d 62 6f 6c 73 22 5d 0a 21 6d 65  ) "symbols"].!me
7040: 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20  ssage *** Doing 
7050: 73 79 6d 62 6f 6c 73 0a 44 45 42 55 47 09 09 3d  symbols.DEBUG..=
7060: 20 31 0a 21 65 6c 73 65 0a 44 45 42 55 47 09 09   1.!else.DEBUG..
7070: 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20  = 0.!endif..!if 
7080: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f  [nmakehlp -f $(O
7090: 50 54 53 29 20 22 70 64 62 73 22 5d 0a 21 6d 65  PTS) "pdbs"].!me
70a0: 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20  ssage *** Doing 
70b0: 70 64 62 73 0a 53 59 4d 42 4f 4c 53 09 09 3d 20  pdbs.SYMBOLS..= 
70c0: 31 0a 21 65 6c 73 65 0a 53 59 4d 42 4f 4c 53 09  1.!else.SYMBOLS.
70d0: 09 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66  .= 0.!endif..!if
70e0: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28   [nmakehlp -f $(
70f0: 4f 50 54 53 29 20 22 70 72 6f 66 69 6c 65 22 5d  OPTS) "profile"]
7100: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f  .!message *** Do
7110: 69 6e 67 20 70 72 6f 66 69 6c 65 0a 50 52 4f 46  ing profile.PROF
7120: 49 4c 45 09 09 3d 20 31 0a 21 65 6c 73 65 0a 50  ILE..= 1.!else.P
7130: 52 4f 46 49 4c 45 09 09 3d 20 30 0a 21 65 6e 64  ROFILE..= 0.!end
7140: 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c  if..!if [nmakehl
7150: 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 70 67  p -f $(OPTS) "pg
7160: 69 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  i"].!message ***
7170: 20 44 6f 69 6e 67 20 70 72 6f 66 69 6c 65 20 67   Doing profile g
7180: 75 69 64 65 64 20 6f 70 74 69 6d 69 7a 61 74 69  uided optimizati
7190: 6f 6e 20 69 6e 73 74 72 75 6d 65 6e 74 61 74 69  on instrumentati
71a0: 6f 6e 0a 50 47 4f 09 09 3d 20 31 0a 21 65 6c 73  on.PGO..= 1.!els
71b0: 65 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66  eif [nmakehlp -f
71c0: 20 24 28 4f 50 54 53 29 20 22 70 67 6f 22 5d 0a   $(OPTS) "pgo"].
71d0: 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69  !message *** Doi
71e0: 6e 67 20 70 72 6f 66 69 6c 65 20 67 75 69 64 65  ng profile guide
71f0: 64 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 0a 50  d optimization.P
7200: 47 4f 09 09 3d 20 32 0a 21 65 6c 73 65 0a 50 47  GO..= 2.!else.PG
7210: 4f 09 09 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21  O..= 0.!endif..!
7220: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20  if [nmakehlp -f 
7230: 24 28 4f 50 54 53 29 20 22 6c 6f 69 6d 70 61 63  $(OPTS) "loimpac
7240: 74 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  t"].!message ***
7250: 20 57 61 72 6e 69 6e 67 3a 20 69 67 6e 6f 72 69   Warning: ignori
7260: 6e 67 20 6f 70 74 69 6f 6e 20 22 6c 6f 69 6d 70  ng option "loimp
7270: 61 63 74 22 20 2d 20 64 65 70 72 65 63 61 74 65  act" - deprecate
7280: 64 20 6f 6e 20 6d 6f 64 65 72 6e 20 57 69 6e 64  d on modern Wind
7290: 6f 77 73 2e 0a 21 65 6e 64 69 66 0a 0a 23 20 54  ows..!endif..# T
72a0: 42 44 20 2d 20 73 68 6f 75 6c 64 20 67 65 74 20  BD - should get 
72b0: 72 69 64 20 6f 66 20 74 68 69 73 20 6f 70 74 69  rid of this opti
72c0: 6f 6e 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70  on.!if [nmakehlp
72d0: 20 2d 66 20 24 28 4f 50 54 53 29 20 22 74 68 72   -f $(OPTS) "thr
72e0: 64 61 6c 6c 6f 63 22 5d 0a 21 6d 65 73 73 61 67  dalloc"].!messag
72f0: 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 74 68 72 64  e *** Doing thrd
7300: 61 6c 6c 6f 63 0a 55 53 45 5f 54 48 52 45 41 44  alloc.USE_THREAD
7310: 5f 41 4c 4c 4f 43 20 3d 20 31 0a 21 65 6e 64 69  _ALLOC = 1.!endi
7320: 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70  f..!if [nmakehlp
7330: 20 2d 66 20 24 28 4f 50 54 53 29 20 22 74 63 6c   -f $(OPTS) "tcl
7340: 61 6c 6c 6f 63 22 5d 0a 55 53 45 5f 54 48 52 45  alloc"].USE_THRE
7350: 41 44 5f 41 4c 4c 4f 43 20 3d 20 30 0a 21 65 6e  AD_ALLOC = 0.!en
7360: 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68  dif..!if [nmakeh
7370: 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 75  lp -f $(OPTS) "u
7380: 6e 63 68 65 63 6b 65 64 22 5d 0a 21 6d 65 73 73  nchecked"].!mess
7390: 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 75 6e  age *** Doing un
73a0: 63 68 65 63 6b 65 64 0a 55 4e 43 48 45 43 4b 45  checked.UNCHECKE
73b0: 44 20 3d 20 31 0a 21 65 6c 73 65 0a 55 4e 43 48  D = 1.!else.UNCH
73c0: 45 43 4b 45 44 20 3d 20 30 0a 21 65 6e 64 69 66  ECKED = 0.!endif
73d0: 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  ..!if [nmakehlp 
73e0: 2d 66 20 24 28 4f 50 54 53 29 20 22 6e 6f 63 6f  -f $(OPTS) "noco
73f0: 6e 66 69 67 63 68 65 63 6b 22 5d 0a 43 4f 4e 46  nfigcheck"].CONF
7400: 49 47 5f 43 48 45 43 4b 20 3d 20 31 0a 21 65 6c  IG_CHECK = 1.!el
7410: 73 65 0a 43 4f 4e 46 49 47 5f 43 48 45 43 4b 20  se.CONFIG_CHECK 
7420: 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 65 6e 64  = 0.!endif..!end
7430: 69 66 20 23 20 22 24 28 4f 50 54 53 29 22 20 21  if # "$(OPTS)" !
7440: 3d 20 22 22 20 20 26 26 20 2e 2e 2e 20 70 61 72  = ""  && ... par
7450: 73 69 6e 67 20 6f 66 20 4f 50 54 53 0a 0a 23 20  sing of OPTS..# 
7460: 53 65 74 20 6c 69 6e 6b 65 72 20 66 6c 61 67 73  Set linker flags
7470: 20 62 61 73 65 64 20 6f 6e 20 61 62 6f 76 65 0a   based on above.
7480: 0a 21 69 66 20 24 28 50 47 4f 29 20 3e 20 31 0a  .!if $(PGO) > 1.
7490: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 6c  !if [nmakehlp -l
74a0: 20 2d 6c 74 63 67 3a 70 67 6f 70 74 69 6d 69 7a   -ltcg:pgoptimiz
74b0: 65 20 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46  e $(LINKER_TESTF
74c0: 4c 41 47 53 29 5d 0a 4c 49 4e 4b 45 52 46 4c 41  LAGS)].LINKERFLA
74d0: 47 53 09 3d 20 24 28 4c 49 4e 4b 45 52 46 4c 41  GS.= $(LINKERFLA
74e0: 47 53 3a 2d 6c 74 63 67 3d 29 20 2d 6c 74 63 67  GS:-ltcg=) -ltcg
74f0: 3a 70 67 6f 70 74 69 6d 69 7a 65 0a 21 65 6c 73  :pgoptimize.!els
7500: 65 0a 4d 53 47 3d 5e 0a 54 68 69 73 20 63 6f 6d  e.MSG=^.This com
7510: 70 69 6c 65 72 20 64 6f 65 73 20 6e 6f 74 20 73  piler does not s
7520: 75 70 70 6f 72 74 20 70 72 6f 66 69 6c 65 20 67  upport profile g
7530: 75 69 64 65 64 20 6f 70 74 69 6d 69 7a 61 74 69  uided optimizati
7540: 6f 6e 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53 47  on..!error $(MSG
7550: 29 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65 69 66  ).!endif.!elseif
7560: 20 24 28 50 47 4f 29 20 3e 20 30 0a 21 69 66 20   $(PGO) > 0.!if 
7570: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 6c 20 2d 6c 74  [nmakehlp -l -lt
7580: 63 67 3a 70 67 69 6e 73 74 72 75 6d 65 6e 74 20  cg:pginstrument 
7590: 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41  $(LINKER_TESTFLA
75a0: 47 53 29 5d 0a 4c 49 4e 4b 45 52 46 4c 41 47 53  GS)].LINKERFLAGS
75b0: 09 3d 20 24 28 4c 49 4e 4b 45 52 46 4c 41 47 53  .= $(LINKERFLAGS
75c0: 3a 2d 6c 74 63 67 3d 29 20 2d 6c 74 63 67 3a 70  :-ltcg=) -ltcg:p
75d0: 67 69 6e 73 74 72 75 6d 65 6e 74 0a 21 65 6c 73  ginstrument.!els
75e0: 65 0a 4d 53 47 3d 5e 0a 54 68 69 73 20 63 6f 6d  e.MSG=^.This com
75f0: 70 69 6c 65 72 20 64 6f 65 73 20 6e 6f 74 20 73  piler does not s
7600: 75 70 70 6f 72 74 20 70 72 6f 66 69 6c 65 20 67  upport profile g
7610: 75 69 64 65 64 20 6f 70 74 69 6d 69 7a 61 74 69  uided optimizati
7620: 6f 6e 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53 47  on..!error $(MSG
7630: 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  ).!endif.!endif.
7640: 0a 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 23 23 23 23 23 23 23  ################
7660: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7670: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7680: 23 0a 23 20 38 2e 20 50 61 72 73 65 20 74 68 65  #.# 8. Parse the
7690: 20 53 54 41 54 53 20 6d 61 63 72 6f 20 74 6f 20   STATS macro to 
76a0: 63 6f 6e 66 69 67 75 72 65 20 63 6f 64 65 20 69  configure code i
76b0: 6e 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0a 23  nstrumentation.#
76c0: 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d   The following m
76d0: 61 63 72 6f 73 20 61 72 65 20 73 65 74 20 62 79  acros are set by
76e0: 20 74 68 69 73 20 73 65 63 74 69 6f 6e 3a 0a 23   this section:.#
76f0: 20 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 20 2d   TCL_MEM_DEBUG -
7700: 20 31 20 2d 3e 20 65 6e 61 62 6c 65 73 20 6d 65   1 -> enables me
7710: 6d 6f 72 79 20 61 6c 6c 6f 63 61 74 69 6f 6e 20  mory allocation 
7720: 69 6e 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0a  instrumentation.
7730: 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  #               
7740: 20 20 30 20 2d 3e 20 64 69 73 61 62 6c 65 73 0a    0 -> disables.
7750: 23 20 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 44 45  # TCL_COMPILE_DE
7760: 42 55 47 20 2d 20 31 20 2d 3e 20 65 6e 61 62 6c  BUG - 1 -> enabl
7770: 65 73 20 62 79 74 65 20 63 6f 6d 70 69 6c 65 72  es byte compiler
7780: 20 6c 6f 67 67 69 6e 67 0a 23 20 20 20 20 20 20   logging.#      
7790: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30                 0
77a0: 20 2d 3e 20 64 69 73 61 62 6c 65 73 0a 0a 23 20   -> disables..# 
77b0: 44 65 66 61 75 6c 74 20 62 6f 74 68 20 61 72 65  Default both are
77c0: 20 6f 66 66 0a 54 43 4c 5f 4d 45 4d 5f 44 45 42   off.TCL_MEM_DEB
77d0: 55 47 09 20 20 20 20 3d 20 30 0a 54 43 4c 5f 43  UG.    = 0.TCL_C
77e0: 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 20 20 3d  OMPILE_DEBUG   =
77f0: 20 30 0a 0a 21 69 66 20 22 24 28 53 54 41 54 53   0..!if "$(STATS
7800: 29 22 20 21 3d 20 22 22 20 26 26 20 21 5b 6e 6d  )" != "" && ![nm
7810: 61 6b 65 68 6c 70 20 2d 66 20 22 24 28 53 54 41  akehlp -f "$(STA
7820: 54 53 29 22 20 22 6e 6f 6e 65 22 5d 0a 0a 21 69  TS)" "none"]..!i
7830: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24  f [nmakehlp -f $
7840: 28 53 54 41 54 53 29 20 22 6d 65 6d 64 62 67 22  (STATS) "memdbg"
7850: 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44  ].!message *** D
7860: 6f 69 6e 67 20 6d 65 6d 64 62 67 0a 54 43 4c 5f  oing memdbg.TCL_
7870: 4d 45 4d 5f 44 45 42 55 47 09 20 20 20 20 3d 20  MEM_DEBUG.    = 
7880: 31 0a 21 65 6c 73 65 0a 54 43 4c 5f 4d 45 4d 5f  1.!else.TCL_MEM_
7890: 44 45 42 55 47 09 20 20 20 20 3d 20 30 0a 21 65  DEBUG.    = 0.!e
78a0: 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65  ndif..!if [nmake
78b0: 68 6c 70 20 2d 66 20 24 28 53 54 41 54 53 29 20  hlp -f $(STATS) 
78c0: 22 63 6f 6d 70 64 62 67 22 5d 0a 21 6d 65 73 73  "compdbg"].!mess
78d0: 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 63 6f  age *** Doing co
78e0: 6d 70 64 62 67 0a 54 43 4c 5f 43 4f 4d 50 49 4c  mpdbg.TCL_COMPIL
78f0: 45 5f 44 45 42 55 47 20 20 20 3d 20 31 0a 21 65  E_DEBUG   = 1.!e
7900: 6c 73 65 0a 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f  lse.TCL_COMPILE_
7910: 44 45 42 55 47 20 20 20 3d 20 30 0a 21 65 6e 64  DEBUG   = 0.!end
7920: 69 66 0a 0a 21 65 6e 64 69 66 0a 0a 23 23 23 23  if..!endif..####
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 23 23 23 23 23 23 23 23  ################
7950: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7960: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7970: 0a 23 20 39 2e 20 50 61 72 73 65 20 74 68 65 20  .# 9. Parse the 
7980: 43 48 45 43 4b 53 20 6d 61 63 72 6f 20 74 6f 20  CHECKS macro to 
7990: 63 6f 6e 66 69 67 75 72 65 20 61 64 64 69 74 69  configure additi
79a0: 6f 6e 61 6c 20 63 6f 6d 70 69 6c 65 72 20 63 68  onal compiler ch
79b0: 65 63 6b 73 0a 23 20 54 68 65 20 66 6f 6c 6c 6f  ecks.# The follo
79c0: 77 69 6e 67 20 6d 61 63 72 6f 73 20 61 72 65 20  wing macros are 
79d0: 73 65 74 20 62 79 20 74 68 69 73 20 73 65 63 74  set by this sect
79e0: 69 6f 6e 3a 0a 23 20 57 41 52 4e 49 4e 47 53 20  ion:.# WARNINGS 
79f0: 2d 20 63 6f 6d 70 69 6c 65 72 20 73 77 69 74 63  - compiler switc
7a00: 68 65 73 20 74 68 61 74 20 63 6f 6e 74 72 6f 6c  hes that control
7a10: 20 74 68 65 20 77 61 72 6e 69 6e 67 73 20 6c 65   the warnings le
7a20: 76 65 6c 0a 23 20 54 43 4c 5f 4e 4f 5f 44 45 50  vel.# TCL_NO_DEP
7a30: 52 45 43 41 54 45 44 20 2d 20 31 20 2d 3e 20 64  RECATED - 1 -> d
7a40: 69 73 61 62 6c 65 20 73 75 70 70 6f 72 74 20 66  isable support f
7a50: 6f 72 20 64 65 70 72 65 63 61 74 65 64 20 66 75  or deprecated fu
7a60: 6e 63 74 69 6f 6e 73 0a 23 20 20 20 20 20 20 20  nctions.#       
7a70: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20                0 
7a80: 2d 3e 20 65 6e 61 62 6c 65 20 64 65 70 72 65 63  -> enable deprec
7a90: 61 74 65 64 20 66 75 6e 63 74 69 6f 6e 73 0a 0a  ated functions..
7aa0: 23 20 44 65 66 61 75 6c 74 73 20 2d 20 50 65 72  # Defaults - Per
7ab0: 6d 69 74 20 64 65 70 72 65 63 61 74 65 64 20 66  mit deprecated f
7ac0: 75 6e 63 74 69 6f 6e 73 20 61 6e 64 20 77 61 72  unctions and war
7ad0: 6e 69 6e 67 20 6c 65 76 65 6c 20 33 0a 54 43 4c  ning level 3.TCL
7ae0: 5f 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 09 20  _NO_DEPRECATED. 
7af0: 20 20 20 3d 20 30 0a 57 41 52 4e 49 4e 47 53 09     = 0.WARNINGS.
7b00: 09 20 20 20 20 3d 20 2d 57 33 0a 0a 21 69 66 20  .    = -W3..!if 
7b10: 22 24 28 43 48 45 43 4b 53 29 22 20 21 3d 20 22  "$(CHECKS)" != "
7b20: 22 20 26 26 20 21 5b 6e 6d 61 6b 65 68 6c 70 20  " && ![nmakehlp 
7b30: 2d 66 20 22 24 28 43 48 45 43 4b 53 29 22 20 22  -f "$(CHECKS)" "
7b40: 6e 6f 6e 65 22 5d 0a 0a 21 69 66 20 5b 6e 6d 61  none"]..!if [nma
7b50: 6b 65 68 6c 70 20 2d 66 20 24 28 43 48 45 43 4b  kehlp -f $(CHECK
7b60: 53 29 20 22 6e 6f 64 65 70 22 5d 0a 21 6d 65 73  S) "nodep"].!mes
7b70: 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 6e  sage *** Doing n
7b80: 6f 64 65 70 20 63 68 65 63 6b 0a 54 43 4c 5f 4e  odep check.TCL_N
7b90: 4f 5f 44 45 50 52 45 43 41 54 45 44 09 20 20 20  O_DEPRECATED.   
7ba0: 20 3d 20 31 0a 21 65 6e 64 69 66 0a 0a 21 69 66   = 1.!endif..!if
7bb0: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28   [nmakehlp -f $(
7bc0: 43 48 45 43 4b 53 29 20 22 66 75 6c 6c 77 61 72  CHECKS) "fullwar
7bd0: 6e 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  n"].!message ***
7be0: 20 44 6f 69 6e 67 20 66 75 6c 6c 20 77 61 72 6e   Doing full warn
7bf0: 69 6e 67 73 20 63 68 65 63 6b 0a 57 41 52 4e 49  ings check.WARNI
7c00: 4e 47 53 09 09 20 20 20 20 3d 20 2d 57 34 0a 21  NGS..    = -W4.!
7c10: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 6c 20  if [nmakehlp -l 
7c20: 2d 77 61 72 6e 3a 33 20 24 28 4c 49 4e 4b 45 52  -warn:3 $(LINKER
7c30: 5f 54 45 53 54 46 4c 41 47 53 29 5d 0a 4c 49 4e  _TESTFLAGS)].LIN
7c40: 4b 45 52 46 4c 41 47 53 09 09 20 20 20 20 3d 20  KERFLAGS..    = 
7c50: 24 28 4c 49 4e 4b 45 52 46 4c 41 47 53 29 20 2d  $(LINKERFLAGS) -
7c60: 77 61 72 6e 3a 33 0a 21 65 6e 64 69 66 0a 21 65  warn:3.!endif.!e
7c70: 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65  ndif..!if [nmake
7c80: 68 6c 70 20 2d 66 20 24 28 43 48 45 43 4b 53 29  hlp -f $(CHECKS)
7c90: 20 22 36 34 62 69 74 22 5d 20 26 26 20 5b 6e 6d   "64bit"] && [nm
7ca0: 61 6b 65 68 6c 70 20 2d 63 20 2d 57 70 36 34 5d  akehlp -c -Wp64]
7cb0: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f  .!message *** Do
7cc0: 69 6e 67 20 36 34 62 69 74 20 70 6f 72 74 61 62  ing 64bit portab
7cd0: 69 6c 69 74 79 20 77 61 72 6e 69 6e 67 73 0a 57  ility warnings.W
7ce0: 41 52 4e 49 4e 47 53 09 09 20 20 20 20 3d 20 24  ARNINGS..    = $
7cf0: 28 57 41 52 4e 49 4e 47 53 29 20 2d 57 70 36 34  (WARNINGS) -Wp64
7d00: 0a 21 65 6e 64 69 66 0a 0a 21 65 6e 64 69 66 0a  .!endif..!endif.
7d10: 0a 0a 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 23 23 23 23 23 23  ################
7d30: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7d40: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7d50: 23 23 0a 23 20 31 30 2e 20 43 6f 6e 73 74 72 75  ##.# 10. Constru
7d60: 63 74 20 6f 75 74 70 75 74 20 64 69 72 65 63 74  ct output direct
7d70: 6f 72 79 20 61 6e 64 20 66 69 6c 65 20 70 61 74  ory and file pat
7d80: 68 73 0a 23 20 46 69 67 75 72 65 2d 6f 75 74 20  hs.# Figure-out 
7d90: 68 6f 77 20 74 6f 20 6e 61 6d 65 20 6f 75 72 20  how to name our 
7da0: 69 6e 74 65 72 6d 65 64 69 61 74 65 20 61 6e 64  intermediate and
7db0: 20 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f 72   output director
7dc0: 69 65 73 2e 0a 23 20 49 6e 20 6f 72 64 65 72 20  ies..# In order 
7dd0: 74 6f 20 61 76 6f 69 64 20 69 6e 61 64 76 65 72  to avoid inadver
7de0: 74 65 6e 74 20 6d 69 78 69 6e 67 20 6f 66 20 6f  tent mixing of o
7df0: 62 6a 65 63 74 20 66 69 6c 65 73 20 62 75 69 6c  bject files buil
7e00: 74 20 75 73 69 6e 67 0a 23 20 64 69 66 66 65 72  t using.# differ
7e10: 65 6e 74 20 63 6f 6d 70 69 6c 65 72 73 2c 20 62  ent compilers, b
7e20: 75 69 6c 64 20 63 6f 6e 66 69 67 75 72 61 74 69  uild configurati
7e30: 6f 6e 73 20 65 74 63 2e 2c 0a 23 0a 23 20 4e 61  ons etc.,.#.# Na
7e40: 6d 69 6e 67 20 63 6f 6e 76 65 6e 74 69 6f 6e 20  ming convention 
7e50: 28 73 75 66 66 69 78 65 73 29 3a 0a 23 20 20 20  (suffixes):.#   
7e60: 74 20 3d 20 66 75 6c 6c 20 74 68 72 65 61 64 20  t = full thread 
7e70: 73 75 70 70 6f 72 74 2e 20 28 4e 6f 74 20 75 73  support. (Not us
7e80: 65 64 20 66 6f 72 20 54 63 6c 20 3e 3d 20 38 2e  ed for Tcl >= 8.
7e90: 37 29 0a 23 20 20 20 73 20 3d 20 73 74 61 74 69  7).#   s = stati
7ea0: 63 20 6c 69 62 72 61 72 79 20 28 61 73 20 6f 70  c library (as op
7eb0: 70 6f 73 65 64 20 74 6f 20 61 6e 20 69 6d 70 6f  posed to an impo
7ec0: 72 74 20 6c 69 62 72 61 72 79 29 0a 23 20 20 20  rt library).#   
7ed0: 67 20 3d 20 6c 69 6e 6b 65 64 20 74 6f 20 74 68  g = linked to th
7ee0: 65 20 64 65 62 75 67 20 65 6e 61 62 6c 65 64 20  e debug enabled 
7ef0: 43 20 72 75 6e 2d 74 69 6d 65 2e 0a 23 20 20 20  C run-time..#   
7f00: 78 20 3d 20 73 70 65 63 69 61 6c 20 73 74 61 74  x = special stat
7f10: 69 63 20 62 75 69 6c 64 20 77 68 65 6e 20 69 74  ic build when it
7f20: 20 6c 69 6e 6b 73 20 74 6f 20 74 68 65 20 64 79   links to the dy
7f30: 6e 61 6d 69 63 20 43 20 72 75 6e 2d 74 69 6d 65  namic C run-time
7f40: 2e 0a 23 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77  ..#.# The follow
7f50: 69 6e 67 20 6d 61 63 72 6f 73 20 61 72 65 20 73  ing macros are s
7f60: 65 74 20 69 6e 20 74 68 69 73 20 73 65 63 74 69  et in this secti
7f70: 6f 6e 3a 0a 23 20 53 55 46 58 20 2d 20 74 68 65  on:.# SUFX - the
7f80: 20 73 75 66 66 69 78 20 74 6f 20 75 73 65 20 66   suffix to use f
7f90: 6f 72 20 62 69 6e 61 72 69 65 73 20 62 61 73 65  or binaries base
7fa0: 64 20 6f 6e 20 61 62 6f 76 65 20 6e 61 6d 69 6e  d on above namin
7fb0: 67 20 63 6f 6e 76 65 6e 74 69 6f 6e 0a 23 20 42  g convention.# B
7fc0: 55 49 4c 44 44 49 52 54 4f 50 20 2d 20 74 68 65  UILDDIRTOP - the
7fd0: 20 74 6f 70 6c 65 76 65 6c 20 64 65 66 61 75 6c   toplevel defaul
7fe0: 74 20 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f  t output directo
7ff0: 72 79 0a 23 20 20 20 20 20 20 69 73 20 6f 66 20  ry.#      is of 
8000: 74 68 65 20 66 6f 72 6d 20 7b 52 65 6c 65 61 73  the form {Releas
8010: 65 2c 44 65 62 75 67 7d 5b 5f 41 4d 44 36 34 5d  e,Debug}[_AMD64]
8020: 5b 5f 43 4f 4d 50 49 4c 45 52 56 45 52 53 49 4f  [_COMPILERVERSIO
8030: 4e 5d 0a 23 20 54 4d 50 5f 44 49 52 20 2d 20 64  N].# TMP_DIR - d
8040: 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 20 6f  irectory where o
8050: 62 6a 65 63 74 20 66 69 6c 65 73 20 61 72 65 20  bject files are 
8060: 63 72 65 61 74 65 64 0a 23 20 4f 55 54 5f 44 49  created.# OUT_DI
8070: 52 20 2d 20 64 69 72 65 63 74 6f 72 79 20 77 68  R - directory wh
8080: 65 72 65 20 6f 75 74 70 75 74 20 65 78 65 63 75  ere output execu
8090: 74 61 62 6c 65 73 20 61 72 65 20 63 72 65 61 74  tables are creat
80a0: 65 64 0a 23 20 42 6f 74 68 20 54 4d 50 5f 44 49  ed.# Both TMP_DI
80b0: 52 20 61 6e 64 20 4f 55 54 5f 44 49 52 20 61 72  R and OUT_DIR ar
80c0: 65 20 64 65 66 61 75 6c 74 65 64 20 6f 6e 6c 79  e defaulted only
80d0: 20 69 66 20 6e 6f 74 20 64 65 66 69 6e 65 64 20   if not defined 
80e0: 62 79 20 74 68 65 0a 23 20 70 61 72 65 6e 74 20  by the.# parent 
80f0: 6d 61 6b 65 66 69 6c 65 20 28 6f 72 20 63 6f 6d  makefile (or com
8100: 6d 61 6e 64 20 6c 69 6e 65 29 2e 20 54 68 65 20  mand line). The 
8110: 64 65 66 61 75 6c 74 20 76 61 6c 75 65 73 20 61  default values a
8120: 72 65 0a 23 20 62 61 73 65 64 20 6f 6e 20 42 55  re.# based on BU
8130: 49 4c 44 44 49 52 54 4f 50 2e 0a 23 20 53 54 55  ILDDIRTOP..# STU
8140: 42 50 52 45 46 49 58 20 2d 20 6e 61 6d 65 20 6f  BPREFIX - name o
8150: 66 20 74 68 65 20 73 74 75 62 73 20 6c 69 62 72  f the stubs libr
8160: 61 72 79 20 66 6f 72 20 74 68 69 73 20 70 72 6f  ary for this pro
8170: 6a 65 63 74 0a 23 20 50 52 4a 49 4d 50 4c 49 42  ject.# PRJIMPLIB
8180: 20 2d 20 6f 75 74 70 75 74 20 70 61 74 68 20 6f   - output path o
8190: 66 20 74 68 65 20 67 65 6e 65 72 61 74 65 64 20  f the generated 
81a0: 70 72 6f 6a 65 63 74 20 69 6d 70 6f 72 74 20 6c  project import l
81b0: 69 62 72 61 72 79 0a 23 20 50 52 4a 4c 49 42 4e  ibrary.# PRJLIBN
81c0: 41 4d 45 20 2d 20 6e 61 6d 65 20 6f 66 20 67 65  AME - name of ge
81d0: 6e 65 72 61 74 65 64 20 70 72 6f 6a 65 63 74 20  nerated project 
81e0: 6c 69 62 72 61 72 79 0a 23 20 50 52 4a 4c 49 42  library.# PRJLIB
81f0: 20 20 20 20 20 2d 20 6f 75 74 70 75 74 20 70 61       - output pa
8200: 74 68 20 6f 66 20 67 65 6e 65 72 61 74 65 64 20  th of generated 
8210: 70 72 6f 6a 65 63 74 20 6c 69 62 72 61 72 79 0a  project library.
8220: 23 20 50 52 4a 53 54 55 42 4c 49 42 4e 41 4d 45  # PRJSTUBLIBNAME
8230: 20 2d 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 67   - name of the g
8240: 65 6e 65 72 61 74 65 64 20 70 72 6f 6a 65 63 74  enerated project
8250: 20 73 74 75 62 73 20 6c 69 62 72 61 72 79 0a 23   stubs library.#
8260: 20 50 52 4a 53 54 55 42 4c 49 42 20 2d 20 6f 75   PRJSTUBLIB - ou
8270: 74 70 75 74 20 70 61 74 68 20 6f 66 20 74 68 65  tput path of the
8280: 20 67 65 6e 65 72 61 74 65 64 20 70 72 6f 6a 65   generated proje
8290: 63 74 20 73 74 75 62 73 20 6c 69 62 72 61 72 79  ct stubs library
82a0: 0a 23 20 52 45 53 46 49 4c 45 20 2d 20 6f 75 74  .# RESFILE - out
82b0: 70 75 74 20 72 65 73 6f 75 72 63 65 20 66 69 6c  put resource fil
82c0: 65 20 28 6f 6e 6c 79 20 69 66 20 6e 6f 74 20 73  e (only if not s
82d0: 74 61 74 69 63 20 62 75 69 6c 64 29 0a 0a 53 55  tatic build)..SU
82e0: 46 58 09 20 20 20 20 3d 20 74 73 67 78 0a 0a 21  FX.    = tsgx..!
82f0: 69 66 20 24 28 44 45 42 55 47 29 0a 42 55 49 4c  if $(DEBUG).BUIL
8300: 44 44 49 52 54 4f 50 20 3d 20 44 65 62 75 67 0a  DDIRTOP = Debug.
8310: 21 65 6c 73 65 0a 42 55 49 4c 44 44 49 52 54 4f  !else.BUILDDIRTO
8320: 50 20 3d 20 52 65 6c 65 61 73 65 0a 21 65 6e 64  P = Release.!end
8330: 69 66 0a 0a 21 69 66 20 22 24 28 4d 41 43 48 49  if..!if "$(MACHI
8340: 4e 45 29 22 20 21 3d 20 22 49 58 38 36 22 0a 42  NE)" != "IX86".B
8350: 55 49 4c 44 44 49 52 54 4f 50 20 3d 24 28 42 55  UILDDIRTOP =$(BU
8360: 49 4c 44 44 49 52 54 4f 50 29 5f 24 28 4d 41 43  ILDDIRTOP)_$(MAC
8370: 48 49 4e 45 29 0a 21 65 6e 64 69 66 0a 21 69 66  HINE).!endif.!if
8380: 20 24 28 56 43 56 45 52 29 20 3e 20 36 0a 42 55   $(VCVER) > 6.BU
8390: 49 4c 44 44 49 52 54 4f 50 20 3d 24 28 42 55 49  ILDDIRTOP =$(BUI
83a0: 4c 44 44 49 52 54 4f 50 29 5f 56 43 24 28 56 43  LDDIRTOP)_VC$(VC
83b0: 56 45 52 29 0a 21 65 6e 64 69 66 0a 0a 21 69 66  VER).!endif..!if
83c0: 20 21 24 28 44 45 42 55 47 29 20 7c 7c 20 24 28   !$(DEBUG) || $(
83d0: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3e 20 38  TCL_VERSION) > 8
83e0: 36 20 7c 7c 20 24 28 44 45 42 55 47 29 20 26 26  6 || $(DEBUG) &&
83f0: 20 24 28 55 4e 43 48 45 43 4b 45 44 29 0a 53 55   $(UNCHECKED).SU
8400: 46 58 09 20 20 20 20 3d 20 24 28 53 55 46 58 3a  FX.    = $(SUFX:
8410: 67 3d 29 0a 21 65 6e 64 69 66 0a 0a 54 4d 50 5f  g=).!endif..TMP_
8420: 44 49 52 46 55 4c 4c 20 3d 20 2e 5c 24 28 42 55  DIRFULL = .\$(BU
8430: 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 50 52 4f  ILDDIRTOP)\$(PRO
8440: 4a 45 43 54 29 5f 54 68 72 65 61 64 65 64 44 79  JECT)_ThreadedDy
8450: 6e 61 6d 69 63 53 74 61 74 69 63 58 0a 0a 21 69  namicStaticX..!i
8460: 66 20 21 24 28 53 54 41 54 49 43 5f 42 55 49 4c  f !$(STATIC_BUIL
8470: 44 29 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d  D).TMP_DIRFULL =
8480: 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 53   $(TMP_DIRFULL:S
8490: 74 61 74 69 63 3d 29 0a 53 55 46 58 09 20 20 20  tatic=).SUFX.   
84a0: 20 3d 20 24 28 53 55 46 58 3a 73 3d 29 0a 45 58   = $(SUFX:s=).EX
84b0: 54 09 20 20 20 20 3d 20 64 6c 6c 0a 54 4d 50 5f  T.    = dll.TMP_
84c0: 44 49 52 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f  DIRFULL = $(TMP_
84d0: 44 49 52 46 55 4c 4c 3a 58 3d 29 0a 53 55 46 58  DIRFULL:X=).SUFX
84e0: 09 20 20 20 20 3d 20 24 28 53 55 46 58 3a 78 3d  .    = $(SUFX:x=
84f0: 29 0a 21 65 6c 73 65 0a 54 4d 50 5f 44 49 52 46  ).!else.TMP_DIRF
8500: 55 4c 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52 46  ULL = $(TMP_DIRF
8510: 55 4c 4c 3a 44 79 6e 61 6d 69 63 3d 29 0a 45 58  ULL:Dynamic=).EX
8520: 54 09 20 20 20 20 3d 20 6c 69 62 0a 21 69 66 20  T.    = lib.!if 
8530: 24 28 4d 53 56 43 52 54 29 20 26 26 20 24 28 54  $(MSVCRT) && $(T
8540: 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3e 20 38 36  CL_VERSION) > 86
8550: 20 7c 7c 20 21 24 28 4d 53 56 43 52 54 29 20 26   || !$(MSVCRT) &
8560: 26 20 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29  & $(TCL_VERSION)
8570: 20 3c 20 38 37 0a 54 4d 50 5f 44 49 52 46 55 4c   < 87.TMP_DIRFUL
8580: 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 4c  L = $(TMP_DIRFUL
8590: 4c 3a 58 3d 29 0a 53 55 46 58 09 20 20 20 20 3d  L:X=).SUFX.    =
85a0: 20 24 28 53 55 46 58 3a 78 3d 29 0a 21 65 6e 64   $(SUFX:x=).!end
85b0: 69 66 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 21  if.!endif..!if !
85c0: 24 28 54 43 4c 5f 54 48 52 45 41 44 53 29 20 7c  $(TCL_THREADS) |
85d0: 7c 20 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29  | $(TCL_VERSION)
85e0: 20 3e 20 38 36 0a 54 4d 50 5f 44 49 52 46 55 4c   > 86.TMP_DIRFUL
85f0: 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 4c  L = $(TMP_DIRFUL
8600: 4c 3a 54 68 72 65 61 64 65 64 3d 29 0a 53 55 46  L:Threaded=).SUF
8610: 58 09 20 20 20 20 3d 20 24 28 53 55 46 58 3a 74  X.    = $(SUFX:t
8620: 3d 29 0a 21 65 6e 64 69 66 0a 0a 21 69 66 6e 64  =).!endif..!ifnd
8630: 65 66 20 54 4d 50 5f 44 49 52 0a 54 4d 50 5f 44  ef TMP_DIR.TMP_D
8640: 49 52 09 20 20 20 20 3d 20 24 28 54 4d 50 5f 44  IR.    = $(TMP_D
8650: 49 52 46 55 4c 4c 29 0a 21 69 66 6e 64 65 66 20  IRFULL).!ifndef 
8660: 4f 55 54 5f 44 49 52 0a 4f 55 54 5f 44 49 52 09  OUT_DIR.OUT_DIR.
8670: 20 20 20 20 3d 20 2e 5c 24 28 42 55 49 4c 44 44      = .\$(BUILDD
8680: 49 52 54 4f 50 29 0a 21 65 6e 64 69 66 0a 21 65  IRTOP).!endif.!e
8690: 6c 73 65 0a 21 69 66 6e 64 65 66 20 4f 55 54 5f  lse.!ifndef OUT_
86a0: 44 49 52 0a 4f 55 54 5f 44 49 52 09 20 20 20 20  DIR.OUT_DIR.    
86b0: 3d 20 24 28 54 4d 50 5f 44 49 52 29 0a 21 65 6e  = $(TMP_DIR).!en
86c0: 64 69 66 0a 21 65 6e 64 69 66 0a 0a 23 20 52 65  dif.!endif..# Re
86d0: 6c 61 74 69 76 65 20 70 61 74 68 73 20 2d 3e 20  lative paths -> 
86e0: 61 62 73 6f 6c 75 74 65 0a 21 69 66 20 5b 65 63  absolute.!if [ec
86f0: 68 6f 20 4f 55 54 5f 44 49 52 20 3d 20 5c 3e 20  ho OUT_DIR = \> 
8700: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20 5c 0a  nmakehlp.out] \.
8710: 20 20 20 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70 20     || [nmakehlp 
8720: 2d 51 20 22 24 28 4f 55 54 5f 44 49 52 29 22 20  -Q "$(OUT_DIR)" 
8730: 3e 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d  >> nmakehlp.out]
8740: 0a 21 65 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c  .!error *** Coul
8750: 64 20 6e 6f 74 20 66 75 6c 6c 79 20 71 75 61 6c  d not fully qual
8760: 69 66 79 20 70 61 74 68 20 4f 55 54 5f 44 49 52  ify path OUT_DIR
8770: 3d 24 28 4f 55 54 5f 44 49 52 29 0a 21 65 6e 64  =$(OUT_DIR).!end
8780: 69 66 0a 21 69 66 20 5b 65 63 68 6f 20 54 4d 50  if.!if [echo TMP
8790: 5f 44 49 52 20 3d 20 5c 3e 3e 20 6e 6d 61 6b 65  _DIR = \>> nmake
87a0: 68 6c 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c  hlp.out] \.   ||
87b0: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 51 20 22 24   [nmakehlp -Q "$
87c0: 28 54 4d 50 5f 44 49 52 29 22 20 3e 3e 20 6e 6d  (TMP_DIR)" >> nm
87d0: 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72  akehlp.out].!err
87e0: 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74  or *** Could not
87f0: 20 66 75 6c 6c 79 20 71 75 61 6c 69 66 79 20 70   fully qualify p
8800: 61 74 68 20 54 4d 50 5f 44 49 52 3d 24 28 54 4d  ath TMP_DIR=$(TM
8810: 50 5f 44 49 52 29 0a 21 65 6e 64 69 66 0a 21 69  P_DIR).!endif.!i
8820: 6e 63 6c 75 64 65 20 6e 6d 61 6b 65 68 6c 70 2e  nclude nmakehlp.
8830: 6f 75 74 0a 0a 23 20 54 68 65 20 6e 61 6d 65 20  out..# The name 
8840: 6f 66 20 74 68 65 20 73 74 75 62 73 20 6c 69 62  of the stubs lib
8850: 72 61 72 79 20 66 6f 72 20 74 68 65 20 70 72 6f  rary for the pro
8860: 6a 65 63 74 20 62 65 69 6e 67 20 62 75 69 6c 74  ject being built
8870: 0a 53 54 55 42 50 52 45 46 49 58 20 20 20 20 20  .STUBPREFIX     
8880: 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 73 74 75   = $(PROJECT)stu
8890: 62 0a 0a 23 0a 23 20 53 65 74 20 75 70 20 70 61  b..#.# Set up pa
88a0: 74 68 73 20 74 6f 20 76 61 72 69 6f 75 73 20 54  ths to various T
88b0: 63 6c 20 65 78 65 63 75 74 61 62 6c 65 73 20 61  cl executables a
88c0: 6e 64 20 6c 69 62 72 61 72 69 65 73 20 6e 65 65  nd libraries nee
88d0: 64 65 64 20 62 79 20 65 78 74 65 6e 73 69 6f 6e  ded by extension
88e0: 73 0a 23 0a 0a 23 20 54 49 50 20 34 33 30 2e 20  s.#..# TIP 430. 
88f0: 55 6e 75 73 65 64 20 66 6f 72 20 38 2e 36 20 62  Unused for 8.6 b
8900: 75 74 20 6e 6f 20 68 61 72 6d 20 64 65 66 69 6e  ut no harm defin
8910: 69 6e 67 20 69 74 20 74 6f 20 61 6c 6c 6f 77 20  ing it to allow 
8920: 61 20 63 6f 6d 6d 6f 6e 20 72 75 6c 65 73 2e 76  a common rules.v
8930: 63 0a 54 43 4c 5f 5a 49 50 5f 46 49 4c 45 20 3d  c.TCL_ZIP_FILE =
8940: 20 6c 69 62 74 63 6c 24 28 54 43 4c 5f 4d 41 4a   libtcl$(TCL_MAJ
8950: 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28 54 43  OR_VERSION).$(TC
8960: 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29  L_MINOR_VERSION)
8970: 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45 54 54  $(TCL_PATCH_LETT
8980: 45 52 29 24 28 54 43 4c 5f 52 45 4c 45 41 53 45  ER)$(TCL_RELEASE
8990: 5f 53 45 52 49 41 4c 29 2e 7a 69 70 0a 54 4b 5f  _SERIAL).zip.TK_
89a0: 5a 49 50 5f 46 49 4c 45 20 3d 20 6c 69 62 74 6b  ZIP_FILE = libtk
89b0: 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  $(TK_MAJOR_VERSI
89c0: 4f 4e 29 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f 56  ON).$(TK_MINOR_V
89d0: 45 52 53 49 4f 4e 29 24 28 54 4b 5f 50 41 54 43  ERSION)$(TK_PATC
89e0: 48 5f 4c 45 54 54 45 52 29 24 28 54 4b 5f 52 45  H_LETTER)$(TK_RE
89f0: 4c 45 41 53 45 5f 53 45 52 49 41 4c 29 2e 7a 69  LEASE_SERIAL).zi
8a00: 70 0a 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54  p..!if $(DOING_T
8a10: 43 4c 29 0a 54 43 4c 53 48 4e 41 4d 45 20 20 20  CL).TCLSHNAME   
8a20: 20 20 20 20 3d 20 24 28 50 52 4f 4a 45 43 54 29      = $(PROJECT)
8a30: 73 68 24 28 56 45 52 53 49 4f 4e 29 24 28 53 55  sh$(VERSION)$(SU
8a40: 46 58 29 2e 65 78 65 0a 54 43 4c 53 48 09 09 3d  FX).exe.TCLSH..=
8a50: 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 43   $(OUT_DIR)\$(TC
8a60: 4c 53 48 4e 41 4d 45 29 0a 54 43 4c 49 4d 50 4c  LSHNAME).TCLIMPL
8a70: 49 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c  IB.= $(OUT_DIR)\
8a80: 24 28 50 52 4f 4a 45 43 54 29 24 28 56 45 52 53  $(PROJECT)$(VERS
8a90: 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 0a  ION)$(SUFX).lib.
8aa0: 54 43 4c 4c 49 42 4e 41 4d 45 09 3d 20 24 28 50  TCLLIBNAME.= $(P
8ab0: 52 4f 4a 45 43 54 29 24 28 56 45 52 53 49 4f 4e  ROJECT)$(VERSION
8ac0: 29 24 28 53 55 46 58 29 2e 24 28 45 58 54 29 0a  )$(SUFX).$(EXT).
8ad0: 54 43 4c 4c 49 42 09 09 3d 20 24 28 4f 55 54 5f  TCLLIB..= $(OUT_
8ae0: 44 49 52 29 5c 24 28 54 43 4c 4c 49 42 4e 41 4d  DIR)\$(TCLLIBNAM
8af0: 45 29 0a 54 43 4c 53 43 52 49 50 54 5a 49 50 20  E).TCLSCRIPTZIP 
8b00: 20 20 20 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c     = $(OUT_DIR)\
8b10: 24 28 54 43 4c 5f 5a 49 50 5f 46 49 4c 45 29 0a  $(TCL_ZIP_FILE).
8b20: 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52  .!if $(TCL_MAJOR
8b30: 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 0a 54  _VERSION) == 8.T
8b40: 43 4c 53 54 55 42 4c 49 42 4e 41 4d 45 09 3d 20  CLSTUBLIBNAME.= 
8b50: 24 28 53 54 55 42 50 52 45 46 49 58 29 24 28 56  $(STUBPREFIX)$(V
8b60: 45 52 53 49 4f 4e 29 2e 6c 69 62 0a 21 65 6c 73  ERSION).lib.!els
8b70: 65 0a 54 43 4c 53 54 55 42 4c 49 42 4e 41 4d 45  e.TCLSTUBLIBNAME
8b80: 09 3d 20 24 28 53 54 55 42 50 52 45 46 49 58 29  .= $(STUBPREFIX)
8b90: 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 54 43 4c 53  .lib.!endif.TCLS
8ba0: 54 55 42 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44  TUBLIB.= $(OUT_D
8bb0: 49 52 29 5c 24 28 54 43 4c 53 54 55 42 4c 49 42  IR)\$(TCLSTUBLIB
8bc0: 4e 41 4d 45 29 0a 54 43 4c 5f 49 4e 43 4c 55 44  NAME).TCL_INCLUD
8bd0: 45 53 20 20 20 20 3d 20 2d 49 22 24 28 57 49 4e  ES    = -I"$(WIN
8be0: 5f 44 49 52 29 22 20 2d 49 22 24 28 47 45 4e 45  _DIR)" -I"$(GENE
8bf0: 52 49 43 44 49 52 29 22 0a 0a 21 65 6c 73 65 20  RICDIR)"..!else 
8c00: 23 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0a  # !$(DOING_TCL).
8c10: 0a 21 69 66 20 24 28 54 43 4c 49 4e 53 54 41 4c  .!if $(TCLINSTAL
8c20: 4c 29 20 23 20 42 75 69 6c 64 69 6e 67 20 61 67  L) # Building ag
8c30: 61 69 6e 73 74 20 61 6e 20 69 6e 73 74 61 6c 6c  ainst an install
8c40: 65 64 20 54 63 6c 0a 0a 23 20 57 68 65 6e 20 62  ed Tcl..# When b
8c50: 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73 69 6f  uilding extensio
8c60: 6e 73 2c 20 77 65 20 6e 65 65 64 20 74 6f 20 6c  ns, we need to l
8c70: 6f 63 61 74 65 20 74 63 6c 73 68 2e 20 44 65 70  ocate tclsh. Dep
8c80: 65 6e 64 69 6e 67 20 6f 6e 20 76 65 72 73 69 6f  ending on versio
8c90: 6e 0a 23 20 6f 66 20 54 63 6c 20 77 65 20 61 72  n.# of Tcl we ar
8ca0: 65 20 62 75 69 6c 64 69 6e 67 20 61 67 61 69 6e  e building again
8cb0: 73 74 2c 20 74 68 69 73 20 6d 61 79 20 6f 72 20  st, this may or 
8cc0: 6d 61 79 20 6e 6f 74 20 68 61 76 65 20 61 20 22  may not have a "
8cd0: 74 22 20 73 75 66 66 69 78 2e 0a 23 20 54 72 79  t" suffix..# Try
8ce0: 20 76 61 72 69 6f 75 73 20 70 6f 73 73 69 62 69   various possibi
8cf0: 6c 69 74 69 65 73 20 69 6e 20 74 75 72 6e 2e 0a  lities in turn..
8d00: 54 43 4c 53 48 09 09 3d 20 24 28 5f 54 43 4c 44  TCLSH..= $(_TCLD
8d10: 49 52 29 5c 62 69 6e 5c 74 63 6c 73 68 24 28 54  IR)\bin\tclsh$(T
8d20: 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46  CL_VERSION)$(SUF
8d30: 58 3a 74 3d 29 2e 65 78 65 0a 21 69 66 20 21 65  X:t=).exe.!if !e
8d40: 78 69 73 74 28 22 24 28 54 43 4c 53 48 29 22 29  xist("$(TCLSH)")
8d50: 0a 54 43 4c 53 48 20 20 20 20 20 20 20 20 20 20  .TCLSH          
8d60: 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 62 69   = $(_TCLDIR)\bi
8d70: 6e 5c 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 52  n\tclsh$(TCL_VER
8d80: 53 49 4f 4e 29 74 24 28 53 55 46 58 3a 74 3d 29  SION)t$(SUFX:t=)
8d90: 2e 65 78 65 0a 21 65 6e 64 69 66 0a 0a 21 69 66  .exe.!endif..!if
8da0: 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52   $(TCL_MAJOR_VER
8db0: 53 49 4f 4e 29 20 3d 3d 20 38 0a 54 43 4c 53 54  SION) == 8.TCLST
8dc0: 55 42 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49  UBLIB.= $(_TCLDI
8dd0: 52 29 5c 6c 69 62 5c 74 63 6c 73 74 75 62 24 28  R)\lib\tclstub$(
8de0: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 2e 6c 69 62  TCL_VERSION).lib
8df0: 0a 21 65 6c 73 65 0a 54 43 4c 53 54 55 42 4c 49  .!else.TCLSTUBLI
8e00: 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c  B.= $(_TCLDIR)\l
8e10: 69 62 5c 74 63 6c 73 74 75 62 2e 6c 69 62 0a 21  ib\tclstub.lib.!
8e20: 65 6e 64 69 66 0a 54 43 4c 49 4d 50 4c 49 42 09  endif.TCLIMPLIB.
8e30: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62  = $(_TCLDIR)\lib
8e40: 5c 74 63 6c 24 28 54 43 4c 5f 56 45 52 53 49 4f  \tcl$(TCL_VERSIO
8e50: 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62  N)$(SUFX:t=).lib
8e60: 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67  .# When building
8e70: 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 79   extensions, may
8e80: 20 62 65 20 6c 69 6e 6b 69 6e 67 20 61 67 61 69   be linking agai
8e90: 6e 73 74 20 54 63 6c 20 74 68 61 74 20 64 6f 65  nst Tcl that doe
8ea0: 73 20 6e 6f 74 20 61 64 64 0a 23 20 22 74 22 20  s not add.# "t" 
8eb0: 73 75 66 66 69 78 20 28 65 2e 67 2e 20 38 2e 35  suffix (e.g. 8.5
8ec0: 20 6f 72 20 38 2e 37 29 2e 20 49 66 20 6c 69 62   or 8.7). If lib
8ed0: 20 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65 63 6b   not found check
8ee0: 20 66 6f 72 20 74 68 61 74 20 70 6f 73 73 69 62   for that possib
8ef0: 69 6c 69 74 79 2e 0a 21 69 66 20 21 65 78 69 73  ility..!if !exis
8f00: 74 28 22 24 28 54 43 4c 49 4d 50 4c 49 42 29 22  t("$(TCLIMPLIB)"
8f10: 29 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20 24 28  ).TCLIMPLIB.= $(
8f20: 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c  _TCLDIR)\lib\tcl
8f30: 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 74 24  $(TCL_VERSION)t$
8f40: 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a 21 65  (SUFX:t=).lib.!e
8f50: 6e 64 69 66 0a 54 43 4c 5f 4c 49 42 52 41 52 59  ndif.TCL_LIBRARY
8f60: 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69  .= $(_TCLDIR)\li
8f70: 62 0a 54 43 4c 52 45 47 4c 49 42 09 3d 20 24 28  b.TCLREGLIB.= $(
8f80: 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c  _TCLDIR)\lib\tcl
8f90: 72 65 67 31 33 24 28 53 55 46 58 3a 74 3d 29 2e  reg13$(SUFX:t=).
8fa0: 6c 69 62 0a 54 43 4c 44 44 45 4c 49 42 09 3d 20  lib.TCLDDELIB.= 
8fb0: 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74  $(_TCLDIR)\lib\t
8fc0: 63 6c 64 64 65 31 34 24 28 53 55 46 58 3a 74 3d  cldde14$(SUFX:t=
8fd0: 29 2e 6c 69 62 0a 54 43 4c 53 43 52 49 50 54 5a  ).lib.TCLSCRIPTZ
8fe0: 49 50 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  IP.= $(_TCLDIR)\
8ff0: 6c 69 62 5c 24 28 54 43 4c 5f 5a 49 50 5f 46 49  lib\$(TCL_ZIP_FI
9000: 4c 45 29 0a 54 43 4c 54 4f 4f 4c 53 44 49 52 09  LE).TCLTOOLSDIR.
9010: 3d 20 5c 6d 75 73 74 5c 68 61 76 65 5c 74 63 6c  = \must\have\tcl
9020: 5c 73 6f 75 72 63 65 73 5c 74 6f 5c 62 75 69 6c  \sources\to\buil
9030: 64 5c 74 68 69 73 5c 74 61 72 67 65 74 0a 54 43  d\this\target.TC
9040: 4c 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 3d 20  L_INCLUDES    = 
9050: 2d 49 22 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e  -I"$(_TCLDIR)\in
9060: 63 6c 75 64 65 22 0a 0a 21 65 6c 73 65 20 23 20  clude"..!else # 
9070: 42 75 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74  Building against
9080: 20 54 63 6c 20 73 6f 75 72 63 65 73 0a 0a 54 43   Tcl sources..TC
9090: 4c 53 48 09 09 3d 20 24 28 5f 54 43 4c 44 49 52  LSH..= $(_TCLDIR
90a0: 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52  )\win\$(BUILDDIR
90b0: 54 4f 50 29 5c 74 63 6c 73 68 24 28 54 43 4c 5f  TOP)\tclsh$(TCL_
90c0: 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 3a 74  VERSION)$(SUFX:t
90d0: 3d 29 2e 65 78 65 0a 21 69 66 20 21 65 78 69 73  =).exe.!if !exis
90e0: 74 28 24 28 54 43 4c 53 48 29 29 0a 54 43 4c 53  t($(TCLSH)).TCLS
90f0: 48 09 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  H..= $(_TCLDIR)\
9100: 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f  win\$(BUILDDIRTO
9110: 50 29 5c 74 63 6c 73 68 24 28 54 43 4c 5f 56 45  P)\tclsh$(TCL_VE
9120: 52 53 49 4f 4e 29 74 24 28 53 55 46 58 3a 74 3d  RSION)t$(SUFX:t=
9130: 29 2e 65 78 65 0a 21 65 6e 64 69 66 0a 21 69 66  ).exe.!endif.!if
9140: 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52   $(TCL_MAJOR_VER
9150: 53 49 4f 4e 29 20 3d 3d 20 38 0a 54 43 4c 53 54  SION) == 8.TCLST
9160: 55 42 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49  UBLIB.= $(_TCLDI
9170: 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49  R)\win\$(BUILDDI
9180: 52 54 4f 50 29 5c 74 63 6c 73 74 75 62 24 28 54  RTOP)\tclstub$(T
9190: 43 4c 5f 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0a  CL_VERSION).lib.
91a0: 21 65 6c 73 65 0a 54 43 4c 53 54 55 42 4c 49 42  !else.TCLSTUBLIB
91b0: 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69  .= $(_TCLDIR)\wi
91c0: 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29  n\$(BUILDDIRTOP)
91d0: 5c 74 63 6c 73 74 75 62 2e 6c 69 62 0a 21 65 6e  \tclstub.lib.!en
91e0: 64 69 66 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20  dif.TCLIMPLIB.= 
91f0: 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24  $(_TCLDIR)\win\$
9200: 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63  (BUILDDIRTOP)\tc
9210: 6c 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24  l$(TCL_VERSION)$
9220: 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a 23 20  (SUFX:t=).lib.# 
9230: 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 65 78  When building ex
9240: 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 79 20 62 65  tensions, may be
9250: 20 6c 69 6e 6b 69 6e 67 20 61 67 61 69 6e 73 74   linking against
9260: 20 54 63 6c 20 74 68 61 74 20 64 6f 65 73 20 6e   Tcl that does n
9270: 6f 74 20 61 64 64 0a 23 20 22 74 22 20 73 75 66  ot add.# "t" suf
9280: 66 69 78 20 28 65 2e 67 2e 20 38 2e 35 20 6f 72  fix (e.g. 8.5 or
9290: 20 38 2e 37 29 2e 20 49 66 20 6c 69 62 20 6e 6f   8.7). If lib no
92a0: 74 20 66 6f 75 6e 64 20 63 68 65 63 6b 20 66 6f  t found check fo
92b0: 72 20 74 68 61 74 20 70 6f 73 73 69 62 69 6c 69  r that possibili
92c0: 74 79 2e 0a 21 69 66 20 21 65 78 69 73 74 28 22  ty..!if !exist("
92d0: 24 28 54 43 4c 49 4d 50 4c 49 42 29 22 29 0a 54  $(TCLIMPLIB)").T
92e0: 43 4c 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 43  CLIMPLIB.= $(_TC
92f0: 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c  LDIR)\win\$(BUIL
9300: 44 44 49 52 54 4f 50 29 5c 74 63 6c 24 28 54 43  DDIRTOP)\tcl$(TC
9310: 4c 5f 56 45 52 53 49 4f 4e 29 74 24 28 53 55 46  L_VERSION)t$(SUF
9320: 58 3a 74 3d 29 2e 6c 69 62 0a 21 65 6e 64 69 66  X:t=).lib.!endif
9330: 0a 54 43 4c 5f 4c 49 42 52 41 52 59 09 3d 20 24  .TCL_LIBRARY.= $
9340: 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 72 61 72  (_TCLDIR)\librar
9350: 79 0a 54 43 4c 52 45 47 4c 49 42 09 3d 20 24 28  y.TCLREGLIB.= $(
9360: 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42  _TCLDIR)\win\$(B
9370: 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 72  UILDDIRTOP)\tclr
9380: 65 67 31 33 24 28 53 55 46 58 3a 74 3d 29 2e 6c  eg13$(SUFX:t=).l
9390: 69 62 0a 54 43 4c 44 44 45 4c 49 42 09 3d 20 24  ib.TCLDDELIB.= $
93a0: 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28  (_TCLDIR)\win\$(
93b0: 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c  BUILDDIRTOP)\tcl
93c0: 64 64 65 31 34 24 28 53 55 46 58 3a 74 3d 29 2e  dde14$(SUFX:t=).
93d0: 6c 69 62 0a 54 43 4c 53 43 52 49 50 54 5a 49 50  lib.TCLSCRIPTZIP
93e0: 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69  .= $(_TCLDIR)\wi
93f0: 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29  n\$(BUILDDIRTOP)
9400: 5c 24 28 54 43 4c 5f 5a 49 50 5f 46 49 4c 45 29  \$(TCL_ZIP_FILE)
9410: 0a 54 43 4c 54 4f 4f 4c 53 44 49 52 09 3d 20 24  .TCLTOOLSDIR.= $
9420: 28 5f 54 43 4c 44 49 52 29 5c 74 6f 6f 6c 73 0a  (_TCLDIR)\tools.
9430: 54 43 4c 5f 49 4e 43 4c 55 44 45 53 09 3d 20 2d  TCL_INCLUDES.= -
9440: 49 22 24 28 5f 54 43 4c 44 49 52 29 5c 67 65 6e  I"$(_TCLDIR)\gen
9450: 65 72 69 63 22 20 2d 49 22 24 28 5f 54 43 4c 44  eric" -I"$(_TCLD
9460: 49 52 29 5c 77 69 6e 22 0a 0a 21 65 6e 64 69 66  IR)\win"..!endif
9470: 20 23 20 54 43 4c 49 4e 53 54 41 4c 4c 0a 0a 21   # TCLINSTALL..!
9480: 69 66 20 21 24 28 53 54 41 54 49 43 5f 42 55 49  if !$(STATIC_BUI
9490: 4c 44 29 20 26 26 20 22 24 28 54 43 4c 5f 42 55  LD) && "$(TCL_BU
94a0: 49 4c 44 5f 46 4f 52 29 22 20 3d 3d 20 22 38 22  ILD_FOR)" == "8"
94b0: 0a 74 63 6c 6c 69 62 73 20 3d 20 22 24 28 54 43  .tcllibs = "$(TC
94c0: 4c 53 54 55 42 4c 49 42 29 22 0a 21 65 6c 73 65  LSTUBLIB)".!else
94d0: 0a 74 63 6c 6c 69 62 73 20 3d 20 22 24 28 54 43  .tcllibs = "$(TC
94e0: 4c 53 54 55 42 4c 49 42 29 22 20 22 24 28 54 43  LSTUBLIB)" "$(TC
94f0: 4c 49 4d 50 4c 49 42 29 22 0a 21 65 6e 64 69 66  LIMPLIB)".!endif
9500: 0a 0a 21 65 6e 64 69 66 20 23 20 24 28 44 4f 49  ..!endif # $(DOI
9510: 4e 47 5f 54 43 4c 29 0a 0a 23 20 57 65 20 6e 65  NG_TCL)..# We ne
9520: 65 64 20 61 20 74 63 6c 73 68 20 74 68 61 74 20  ed a tclsh that 
9530: 77 69 6c 6c 20 72 75 6e 20 6f 6e 20 74 68 65 20  will run on the 
9540: 68 6f 73 74 20 6d 61 63 68 69 6e 65 20 61 73 20  host machine as 
9550: 70 61 72 74 20 6f 66 20 74 68 65 20 62 75 69 6c  part of the buil
9560: 64 2e 0a 23 20 49 58 38 36 20 72 75 6e 73 20 6f  d..# IX86 runs o
9570: 6e 20 61 6c 6c 20 61 72 63 68 69 74 65 63 74 75  n all architectu
9580: 72 65 73 2e 0a 21 69 66 6e 64 65 66 20 54 43 4c  res..!ifndef TCL
9590: 53 48 5f 4e 41 54 49 56 45 0a 21 69 66 20 22 24  SH_NATIVE.!if "$
95a0: 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 49  (MACHINE)" == "I
95b0: 58 38 36 22 20 7c 7c 20 22 24 28 4d 41 43 48 49  X86" || "$(MACHI
95c0: 4e 45 29 22 20 3d 3d 20 22 24 28 4e 41 54 49 56  NE)" == "$(NATIV
95d0: 45 5f 41 52 43 48 29 22 0a 54 43 4c 53 48 5f 4e  E_ARCH)".TCLSH_N
95e0: 41 54 49 56 45 09 3d 20 24 28 54 43 4c 53 48 29  ATIVE.= $(TCLSH)
95f0: 0a 21 65 6c 73 65 0a 21 65 72 72 6f 72 20 59 6f  .!else.!error Yo
9600: 75 20 6d 75 73 74 20 65 78 70 6c 69 63 69 74 6c  u must explicitl
9610: 79 20 73 65 74 20 54 43 4c 53 48 5f 4e 41 54 49  y set TCLSH_NATI
9620: 56 45 20 66 6f 72 20 63 72 6f 73 73 2d 63 6f 6d  VE for cross-com
9630: 70 69 6c 61 74 69 6f 6e 0a 21 65 6e 64 69 66 0a  pilation.!endif.
9640: 21 65 6e 64 69 66 0a 0a 23 20 44 6f 20 74 68 65  !endif..# Do the
9650: 20 73 61 6d 65 20 66 6f 72 20 54 6b 20 61 6e 64   same for Tk and
9660: 20 54 6b 20 65 78 74 65 6e 73 69 6f 6e 73 20 74   Tk extensions t
9670: 68 61 74 20 72 65 71 75 69 72 65 20 74 68 65 20  hat require the 
9680: 54 6b 20 6c 69 62 72 61 72 69 65 73 0a 21 69 66  Tk libraries.!if
9690: 20 24 28 44 4f 49 4e 47 5f 54 4b 29 20 7c 7c 20   $(DOING_TK) || 
96a0: 24 28 4e 45 45 44 5f 54 4b 29 0a 57 49 53 48 4e  $(NEED_TK).WISHN
96b0: 41 4d 45 50 52 45 46 49 58 20 3d 20 77 69 73 68  AMEPREFIX = wish
96c0: 0a 57 49 53 48 4e 41 4d 45 20 3d 20 24 28 57 49  .WISHNAME = $(WI
96d0: 53 48 4e 41 4d 45 50 52 45 46 49 58 29 24 28 54  SHNAMEPREFIX)$(T
96e0: 4b 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58  K_VERSION)$(SUFX
96f0: 29 2e 65 78 65 0a 54 4b 4c 49 42 4e 41 4d 45 38  ).exe.TKLIBNAME8
9700: 09 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f  .= tk$(TK_VERSIO
9710: 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58 54 29  N)$(SUFX).$(EXT)
9720: 0a 54 4b 4c 49 42 4e 41 4d 45 39 09 3d 20 74 63  .TKLIBNAME9.= tc
9730: 6c 39 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f 4e  l9tk$(TK_VERSION
9740: 29 24 28 53 55 46 58 29 2e 24 28 45 58 54 29 0a  )$(SUFX).$(EXT).
9750: 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f  !if $(TCL_MAJOR_
9760: 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 20 7c 7c  VERSION) == 8 ||
9770: 20 22 24 28 54 43 4c 5f 42 55 49 4c 44 5f 46 4f   "$(TCL_BUILD_FO
9780: 52 29 22 20 3d 3d 20 22 38 22 0a 54 4b 4c 49 42  R)" == "8".TKLIB
9790: 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45  NAME.= tk$(TK_VE
97a0: 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 28  RSION)$(SUFX).$(
97b0: 45 58 54 29 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d  EXT).TKIMPLIBNAM
97c0: 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53 49  E.= tk$(TK_VERSI
97d0: 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 0a 21  ON)$(SUFX).lib.!
97e0: 65 6c 73 65 0a 54 4b 4c 49 42 4e 41 4d 45 09 3d  else.TKLIBNAME.=
97f0: 20 74 63 6c 39 74 6b 24 28 54 4b 5f 56 45 52 53   tcl9tk$(TK_VERS
9800: 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58  ION)$(SUFX).$(EX
9810: 54 29 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 09  T).TKIMPLIBNAME.
9820: 3d 20 74 63 6c 39 74 6b 24 28 54 4b 5f 56 45 52  = tcl9tk$(TK_VER
9830: 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69 62  SION)$(SUFX).lib
9840: 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28 54 4b  .!endif.!if $(TK
9850: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20  _MAJOR_VERSION) 
9860: 3d 3d 20 38 0a 54 4b 53 54 55 42 4c 49 42 4e 41  == 8.TKSTUBLIBNA
9870: 4d 45 09 3d 20 74 6b 73 74 75 62 24 28 54 4b 5f  ME.= tkstub$(TK_
9880: 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0a 21 65 6c  VERSION).lib.!el
9890: 73 65 0a 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45  se.TKSTUBLIBNAME
98a0: 09 3d 20 74 6b 73 74 75 62 2e 6c 69 62 0a 21 65  .= tkstub.lib.!e
98b0: 6e 64 69 66 0a 0a 21 69 66 20 24 28 44 4f 49 4e  ndif..!if $(DOIN
98c0: 47 5f 54 4b 29 0a 57 49 53 48 09 09 3d 20 24 28  G_TK).WISH..= $(
98d0: 4f 55 54 5f 44 49 52 29 5c 24 28 57 49 53 48 4e  OUT_DIR)\$(WISHN
98e0: 41 4d 45 29 0a 54 4b 53 54 55 42 4c 49 42 09 3d  AME).TKSTUBLIB.=
98f0: 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 4b   $(OUT_DIR)\$(TK
9900: 53 54 55 42 4c 49 42 4e 41 4d 45 29 0a 54 4b 49  STUBLIBNAME).TKI
9910: 4d 50 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44 49  MPLIB.= $(OUT_DI
9920: 52 29 5c 24 28 54 4b 49 4d 50 4c 49 42 4e 41 4d  R)\$(TKIMPLIBNAM
9930: 45 29 0a 54 4b 4c 49 42 09 09 3d 20 24 28 4f 55  E).TKLIB..= $(OU
9940: 54 5f 44 49 52 29 5c 24 28 54 4b 4c 49 42 4e 41  T_DIR)\$(TKLIBNA
9950: 4d 45 29 0a 54 4b 5f 49 4e 43 4c 55 44 45 53 20  ME).TK_INCLUDES 
9960: 20 20 20 20 3d 20 2d 49 22 24 28 57 49 4e 5f 44      = -I"$(WIN_D
9970: 49 52 29 22 20 2d 49 22 24 28 47 45 4e 45 52 49  IR)" -I"$(GENERI
9980: 43 44 49 52 29 22 0a 54 4b 53 43 52 49 50 54 5a  CDIR)".TKSCRIPTZ
9990: 49 50 20 20 20 20 20 3d 20 24 28 4f 55 54 5f 44  IP     = $(OUT_D
99a0: 49 52 29 5c 24 28 54 4b 5f 5a 49 50 5f 46 49 4c  IR)\$(TK_ZIP_FIL
99b0: 45 29 0a 0a 21 65 6c 73 65 20 23 20 65 66 66 65  E)..!else # effe
99c0: 63 74 69 76 65 6c 79 20 4e 45 45 44 5f 54 4b 0a  ctively NEED_TK.
99d0: 0a 21 69 66 20 24 28 54 4b 49 4e 53 54 41 4c 4c  .!if $(TKINSTALL
99e0: 29 20 23 20 42 75 69 6c 64 69 6e 67 20 61 67 61  ) # Building aga
99f0: 69 6e 73 74 20 69 6e 73 74 61 6c 6c 65 64 20 54  inst installed T
9a00: 6b 0a 57 49 53 48 09 09 3d 20 24 28 5f 54 4b 44  k.WISH..= $(_TKD
9a10: 49 52 29 5c 62 69 6e 5c 24 28 57 49 53 48 4e 41  IR)\bin\$(WISHNA
9a20: 4d 45 29 0a 54 4b 53 54 55 42 4c 49 42 09 3d 20  ME).TKSTUBLIB.= 
9a30: 24 28 5f 54 4b 44 49 52 29 5c 6c 69 62 5c 24 28  $(_TKDIR)\lib\$(
9a40: 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45 29 0a 54  TKSTUBLIBNAME).T
9a50: 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 4b 44  KIMPLIB.= $(_TKD
9a60: 49 52 29 5c 6c 69 62 5c 24 28 54 4b 49 4d 50 4c  IR)\lib\$(TKIMPL
9a70: 49 42 4e 41 4d 45 29 0a 23 20 57 68 65 6e 20 62  IBNAME).# When b
9a80: 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73 69 6f  uilding extensio
9a90: 6e 73 2c 20 6d 61 79 20 62 65 20 6c 69 6e 6b 69  ns, may be linki
9aa0: 6e 67 20 61 67 61 69 6e 73 74 20 54 6b 20 74 68  ng against Tk th
9ab0: 61 74 20 64 6f 65 73 20 6e 6f 74 20 61 64 64 0a  at does not add.
9ac0: 23 20 22 74 22 20 73 75 66 66 69 78 20 28 65 2e  # "t" suffix (e.
9ad0: 67 2e 20 38 2e 35 20 6f 72 20 38 2e 37 29 2e 20  g. 8.5 or 8.7). 
9ae0: 49 66 20 6c 69 62 20 6e 6f 74 20 66 6f 75 6e 64  If lib not found
9af0: 20 63 68 65 63 6b 20 66 6f 72 20 74 68 61 74 20   check for that 
9b00: 70 6f 73 73 69 62 69 6c 69 74 79 2e 0a 21 69 66  possibility..!if
9b10: 20 21 65 78 69 73 74 28 22 24 28 54 4b 49 4d 50   !exist("$(TKIMP
9b20: 4c 49 42 29 22 29 0a 54 4b 49 4d 50 4c 49 42 4e  LIB)").TKIMPLIBN
9b30: 41 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45 52  AME.= tk$(TK_VER
9b40: 53 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e  SION)$(SUFX:t=).
9b50: 6c 69 62 0a 54 4b 49 4d 50 4c 49 42 09 3d 20 24  lib.TKIMPLIB.= $
9b60: 28 5f 54 4b 44 49 52 29 5c 6c 69 62 5c 24 28 54  (_TKDIR)\lib\$(T
9b70: 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0a 21 65 6e  KIMPLIBNAME).!en
9b80: 64 69 66 0a 54 4b 5f 49 4e 43 4c 55 44 45 53 20  dif.TK_INCLUDES 
9b90: 20 20 20 20 3d 20 2d 49 22 24 28 5f 54 4b 44 49      = -I"$(_TKDI
9ba0: 52 29 5c 69 6e 63 6c 75 64 65 22 0a 54 4b 53 43  R)\include".TKSC
9bb0: 52 49 50 54 5a 49 50 20 20 20 20 20 3d 20 24 28  RIPTZIP     = $(
9bc0: 5f 54 4b 44 49 52 29 5c 6c 69 62 5c 24 28 54 4b  _TKDIR)\lib\$(TK
9bd0: 5f 5a 49 50 5f 46 49 4c 45 29 0a 0a 21 65 6c 73  _ZIP_FILE)..!els
9be0: 65 20 23 20 42 75 69 6c 64 69 6e 67 20 61 67 61  e # Building aga
9bf0: 69 6e 73 74 20 54 6b 20 73 6f 75 72 63 65 73 0a  inst Tk sources.
9c00: 0a 57 49 53 48 09 09 3d 20 24 28 5f 54 4b 44 49  .WISH..= $(_TKDI
9c10: 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49  R)\win\$(BUILDDI
9c20: 52 54 4f 50 29 5c 24 28 57 49 53 48 4e 41 4d 45  RTOP)\$(WISHNAME
9c30: 29 0a 54 4b 53 54 55 42 4c 49 42 09 3d 20 24 28  ).TKSTUBLIB.= $(
9c40: 5f 54 4b 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  _TKDIR)\win\$(BU
9c50: 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 54 4b 53  ILDDIRTOP)\$(TKS
9c60: 54 55 42 4c 49 42 4e 41 4d 45 29 0a 54 4b 49 4d  TUBLIBNAME).TKIM
9c70: 50 4c 49 42 09 3d 20 24 28 5f 54 4b 44 49 52 29  PLIB.= $(_TKDIR)
9c80: 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54  \win\$(BUILDDIRT
9c90: 4f 50 29 5c 24 28 54 4b 49 4d 50 4c 49 42 4e 41  OP)\$(TKIMPLIBNA
9ca0: 4d 45 29 0a 23 20 57 68 65 6e 20 62 75 69 6c 64  ME).# When build
9cb0: 69 6e 67 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20  ing extensions, 
9cc0: 6d 61 79 20 62 65 20 6c 69 6e 6b 69 6e 67 20 61  may be linking a
9cd0: 67 61 69 6e 73 74 20 54 6b 20 74 68 61 74 20 64  gainst Tk that d
9ce0: 6f 65 73 20 6e 6f 74 20 61 64 64 0a 23 20 22 74  oes not add.# "t
9cf0: 22 20 73 75 66 66 69 78 20 28 65 2e 67 2e 20 38  " suffix (e.g. 8
9d00: 2e 35 20 6f 72 20 38 2e 37 29 2e 20 49 66 20 6c  .5 or 8.7). If l
9d10: 69 62 20 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65  ib not found che
9d20: 63 6b 20 66 6f 72 20 74 68 61 74 20 70 6f 73 73  ck for that poss
9d30: 69 62 69 6c 69 74 79 2e 0a 21 69 66 20 21 65 78  ibility..!if !ex
9d40: 69 73 74 28 22 24 28 54 4b 49 4d 50 4c 49 42 29  ist("$(TKIMPLIB)
9d50: 22 29 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 09  ").TKIMPLIBNAME.
9d60: 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f 4e  = tk$(TK_VERSION
9d70: 29 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a  )$(SUFX:t=).lib.
9d80: 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 4b  TKIMPLIB.= $(_TK
9d90: 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44  DIR)\win\$(BUILD
9da0: 44 49 52 54 4f 50 29 5c 24 28 54 4b 49 4d 50 4c  DIRTOP)\$(TKIMPL
9db0: 49 42 4e 41 4d 45 29 0a 21 65 6e 64 69 66 0a 54  IBNAME).!endif.T
9dc0: 4b 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 20 3d  K_INCLUDES     =
9dd0: 20 2d 49 22 24 28 5f 54 4b 44 49 52 29 5c 67 65   -I"$(_TKDIR)\ge
9de0: 6e 65 72 69 63 22 20 2d 49 22 24 28 5f 54 4b 44  neric" -I"$(_TKD
9df0: 49 52 29 5c 77 69 6e 22 20 2d 49 22 24 28 5f 54  IR)\win" -I"$(_T
9e00: 4b 44 49 52 29 5c 78 6c 69 62 22 0a 54 4b 53 43  KDIR)\xlib".TKSC
9e10: 52 49 50 54 5a 49 50 20 20 20 20 20 3d 20 24 28  RIPTZIP     = $(
9e20: 5f 54 4b 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  _TKDIR)\win\$(BU
9e30: 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 54 4b 5f  ILDDIRTOP)\$(TK_
9e40: 5a 49 50 5f 46 49 4c 45 29 0a 0a 21 65 6e 64 69  ZIP_FILE)..!endi
9e50: 66 20 23 20 54 4b 49 4e 53 54 41 4c 4c 0a 0a 74  f # TKINSTALL..t
9e60: 6b 6c 69 62 73 20 3d 20 22 24 28 54 4b 53 54 55  klibs = "$(TKSTU
9e70: 42 4c 49 42 29 22 20 22 24 28 54 4b 49 4d 50 4c  BLIB)" "$(TKIMPL
9e80: 49 42 29 22 0a 0a 21 65 6e 64 69 66 20 23 20 24  IB)"..!endif # $
9e90: 28 44 4f 49 4e 47 5f 54 4b 29 0a 21 65 6e 64 69  (DOING_TK).!endi
9ea0: 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 4b 29 20  f # $(DOING_TK) 
9eb0: 7c 7c 20 24 28 4e 45 45 44 5f 54 4b 29 0a 0a 23  || $(NEED_TK)..#
9ec0: 20 56 61 72 69 6f 75 73 20 6f 75 74 70 75 74 20   Various output 
9ed0: 70 61 74 68 73 0a 50 52 4a 49 4d 50 4c 49 42 09  paths.PRJIMPLIB.
9ee0: 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 50  = $(OUT_DIR)\$(P
9ef0: 52 4f 4a 45 43 54 29 24 28 56 45 52 53 49 4f 4e  ROJECT)$(VERSION
9f00: 29 24 28 53 55 46 58 29 2e 6c 69 62 0a 23 20 45  )$(SUFX).lib.# E
9f10: 76 65 6e 20 77 68 65 6e 20 62 75 69 6c 64 69 6e  ven when buildin
9f20: 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 39 2c  g against Tcl 9,
9f30: 20 50 52 4a 4c 49 42 4e 41 4d 45 38 20 6d 75 73   PRJLIBNAME8 mus
9f40: 74 20 68 61 76 65 20 22 74 22 0a 50 52 4a 4c 49  t have "t".PRJLI
9f50: 42 4e 41 4d 45 38 09 3d 20 24 28 50 52 4f 4a 45  BNAME8.= $(PROJE
9f60: 43 54 29 24 28 56 45 52 53 49 4f 4e 29 74 24 28  CT)$(VERSION)t$(
9f70: 53 55 46 58 3a 74 3d 29 2e 24 28 45 58 54 29 0a  SUFX:t=).$(EXT).
9f80: 23 20 45 76 65 6e 20 77 68 65 6e 20 62 75 69 6c  # Even when buil
9f90: 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54 63 6c  ding against Tcl
9fa0: 20 38 2c 20 50 52 4a 4c 49 42 4e 41 4d 45 39 20   8, PRJLIBNAME9 
9fb0: 6d 75 73 74 20 6e 6f 74 20 68 61 76 65 20 22 74  must not have "t
9fc0: 22 0a 50 52 4a 4c 49 42 4e 41 4d 45 39 09 3d 20  ".PRJLIBNAME9.= 
9fd0: 74 63 6c 39 24 28 50 52 4f 4a 45 43 54 29 24 28  tcl9$(PROJECT)$(
9fe0: 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 3a 74  VERSION)$(SUFX:t
9ff0: 3d 29 2e 24 28 45 58 54 29 0a 21 69 66 20 24 28  =).$(EXT).!if $(
a000: 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f  TCL_MAJOR_VERSIO
a010: 4e 29 20 3d 3d 20 38 20 7c 7c 20 22 24 28 54 43  N) == 8 || "$(TC
a020: 4c 5f 42 55 49 4c 44 5f 46 4f 52 29 22 20 3d 3d  L_BUILD_FOR)" ==
a030: 20 22 38 22 0a 50 52 4a 4c 49 42 4e 41 4d 45 09   "8".PRJLIBNAME.
a040: 3d 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 38 29  = $(PRJLIBNAME8)
a050: 0a 21 65 6c 73 65 0a 50 52 4a 4c 49 42 4e 41 4d  .!else.PRJLIBNAM
a060: 45 09 3d 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45  E.= $(PRJLIBNAME
a070: 39 29 0a 21 65 6e 64 69 66 0a 50 52 4a 4c 49 42  9).!endif.PRJLIB
a080: 09 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24  ..= $(OUT_DIR)\$
a090: 28 50 52 4a 4c 49 42 4e 41 4d 45 29 0a 0a 21 69  (PRJLIBNAME)..!i
a0a0: 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45  f $(TCL_MAJOR_VE
a0b0: 52 53 49 4f 4e 29 20 3d 3d 20 38 0a 50 52 4a 53  RSION) == 8.PRJS
a0c0: 54 55 42 4c 49 42 4e 41 4d 45 09 3d 20 24 28 53  TUBLIBNAME.= $(S
a0d0: 54 55 42 50 52 45 46 49 58 29 24 28 56 45 52 53  TUBPREFIX)$(VERS
a0e0: 49 4f 4e 29 2e 6c 69 62 0a 21 65 6c 73 65 0a 50  ION).lib.!else.P
a0f0: 52 4a 53 54 55 42 4c 49 42 4e 41 4d 45 09 3d 20  RJSTUBLIBNAME.= 
a100: 24 28 53 54 55 42 50 52 45 46 49 58 29 2e 6c 69  $(STUBPREFIX).li
a110: 62 0a 21 65 6e 64 69 66 0a 50 52 4a 53 54 55 42  b.!endif.PRJSTUB
a120: 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 29  LIB.= $(OUT_DIR)
a130: 5c 24 28 50 52 4a 53 54 55 42 4c 49 42 4e 41 4d  \$(PRJSTUBLIBNAM
a140: 45 29 0a 0a 23 20 49 66 20 65 78 74 65 6e 73 69  E)..# If extensi
a150: 6f 6e 20 70 61 72 65 6e 74 20 6d 61 6b 65 66 69  on parent makefi
a160: 6c 65 20 68 61 73 20 6e 6f 74 20 64 65 66 69 6e  le has not defin
a170: 65 64 20 61 20 72 65 73 6f 75 72 63 65 20 64 65  ed a resource de
a180: 66 69 6e 69 74 69 6f 6e 20 66 69 6c 65 2c 0a 23  finition file,.#
a190: 20 77 65 20 77 69 6c 6c 20 67 65 6e 65 72 61 74   we will generat
a1a0: 65 20 6f 6e 65 20 66 72 6f 6d 20 73 74 61 6e 64  e one from stand
a1b0: 61 72 64 20 74 65 6d 70 6c 61 74 65 2e 0a 21 69  ard template..!i
a1c0: 66 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 20  f !$(DOING_TCL) 
a1d0: 26 26 20 21 24 28 44 4f 49 4e 47 5f 54 4b 29 20  && !$(DOING_TK) 
a1e0: 26 26 20 21 24 28 53 54 41 54 49 43 5f 42 55 49  && !$(STATIC_BUI
a1f0: 4c 44 29 0a 21 69 66 64 65 66 20 52 43 46 49 4c  LD).!ifdef RCFIL
a200: 45 0a 52 45 53 46 49 4c 45 20 3d 20 24 28 54 4d  E.RESFILE = $(TM
a210: 50 5f 44 49 52 29 5c 24 28 52 43 46 49 4c 45 3a  P_DIR)\$(RCFILE:
a220: 2e 72 63 3d 2e 72 65 73 29 0a 21 65 6c 73 65 0a  .rc=.res).!else.
a230: 52 45 53 46 49 4c 45 20 3d 20 24 28 54 4d 50 5f  RESFILE = $(TMP_
a240: 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e  DIR)\$(PROJECT).
a250: 72 65 73 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69  res.!endif.!endi
a260: 66 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23  f..#############
a270: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a280: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a290: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a2a0: 23 23 23 23 23 23 0a 23 20 31 31 2e 20 43 6f 6e  ######.# 11. Con
a2b0: 73 74 72 75 63 74 20 74 68 65 20 70 61 74 68 73  struct the paths
a2c0: 20 66 6f 72 20 74 68 65 20 69 6e 73 74 61 6c 6c   for the install
a2d0: 61 74 69 6f 6e 20 64 69 72 65 63 74 6f 72 69 65  ation directorie
a2e0: 73 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e  s.# The followin
a2f0: 67 20 6d 61 63 72 6f 73 20 67 65 74 20 64 65 66  g macros get def
a300: 69 6e 65 64 20 69 6e 20 74 68 69 73 20 73 65 63  ined in this sec
a310: 74 69 6f 6e 3a 0a 23 20 4c 49 42 5f 49 4e 53 54  tion:.# LIB_INST
a320: 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72 65 20  ALL_DIR - where 
a330: 6c 69 62 72 61 72 69 65 73 20 73 68 6f 75 6c 64  libraries should
a340: 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23 20   be installed.# 
a350: 42 49 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20  BIN_INSTALL_DIR 
a360: 2d 20 77 68 65 72 65 20 74 68 65 20 65 78 65 63  - where the exec
a370: 75 74 61 62 6c 65 73 20 73 68 6f 75 6c 64 20 62  utables should b
a380: 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23 20 44 4f  e installed.# DO
a390: 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20  C_INSTALL_DIR - 
a3a0: 77 68 65 72 65 20 64 6f 63 75 6d 65 6e 74 61 74  where documentat
a3b0: 69 6f 6e 20 73 68 6f 75 6c 64 20 62 65 20 69 6e  ion should be in
a3c0: 73 74 61 6c 6c 65 64 0a 23 20 53 43 52 49 50 54  stalled.# SCRIPT
a3d0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77  _INSTALL_DIR - w
a3e0: 68 65 72 65 20 73 63 72 69 70 74 73 20 73 68 6f  here scripts sho
a3f0: 75 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64  uld be installed
a400: 0a 23 20 49 4e 43 4c 55 44 45 5f 49 4e 53 54 41  .# INCLUDE_INSTA
a410: 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72 65 20 43  LL_DIR - where C
a420: 20 69 6e 63 6c 75 64 65 20 66 69 6c 65 73 20 73   include files s
a430: 68 6f 75 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c  hould be install
a440: 65 64 0a 23 20 44 45 4d 4f 5f 49 4e 53 54 41 4c  ed.# DEMO_INSTAL
a450: 4c 5f 44 49 52 20 2d 20 77 68 65 72 65 20 64 65  L_DIR - where de
a460: 6d 6f 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e  mos should be in
a470: 73 74 61 6c 6c 65 64 0a 23 20 50 52 4a 5f 49 4e  stalled.# PRJ_IN
a480: 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72  STALL_DIR - wher
a490: 65 20 70 61 63 6b 61 67 65 20 77 69 6c 6c 20 62  e package will b
a4a0: 65 20 69 6e 73 74 61 6c 6c 65 64 20 28 6e 6f 74  e installed (not
a4b0: 20 73 65 74 20 66 6f 72 20 54 63 6c 20 61 6e 64   set for Tcl and
a4c0: 20 54 6b 29 0a 0a 21 69 66 20 24 28 44 4f 49 4e   Tk)..!if $(DOIN
a4d0: 47 5f 54 43 4c 29 20 7c 7c 20 24 28 44 4f 49 4e  G_TCL) || $(DOIN
a4e0: 47 5f 54 4b 29 0a 4c 49 42 5f 49 4e 53 54 41 4c  G_TK).LIB_INSTAL
a4f0: 4c 5f 44 49 52 09 09 3d 20 24 28 5f 49 4e 53 54  L_DIR..= $(_INST
a500: 41 4c 4c 44 49 52 29 5c 6c 69 62 0a 42 49 4e 5f  ALLDIR)\lib.BIN_
a510: 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24  INSTALL_DIR..= $
a520: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 62 69  (_INSTALLDIR)\bi
a530: 6e 0a 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49  n.DOC_INSTALL_DI
a540: 52 09 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44  R..= $(_INSTALLD
a550: 49 52 29 5c 64 6f 63 0a 21 69 66 20 24 28 44 4f  IR)\doc.!if $(DO
a560: 49 4e 47 5f 54 43 4c 29 0a 53 43 52 49 50 54 5f  ING_TCL).SCRIPT_
a570: 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28  INSTALL_DIR.= $(
a580: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62  _INSTALLDIR)\lib
a590: 5c 24 28 50 52 4f 4a 45 43 54 29 24 28 54 43 4c  \$(PROJECT)$(TCL
a5a0: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e  _MAJOR_VERSION).
a5b0: 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53  $(TCL_MINOR_VERS
a5c0: 49 4f 4e 29 0a 4d 4f 44 55 4c 45 5f 49 4e 53 54  ION).MODULE_INST
a5d0: 41 4c 4c 5f 44 49 52 09 3d 20 24 28 5f 49 4e 53  ALL_DIR.= $(_INS
a5e0: 54 41 4c 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c  TALLDIR)\lib\tcl
a5f0: 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53  $(TCL_MAJOR_VERS
a600: 49 4f 4e 29 0a 21 65 6c 73 65 20 23 20 44 4f 49  ION).!else # DOI
a610: 4e 47 5f 54 4b 0a 53 43 52 49 50 54 5f 49 4e 53  NG_TK.SCRIPT_INS
a620: 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 5f 49 4e  TALL_DIR.= $(_IN
a630: 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 5c 24 28  STALLDIR)\lib\$(
a640: 50 52 4f 4a 45 43 54 29 24 28 54 4b 5f 4d 41 4a  PROJECT)$(TK_MAJ
a650: 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28 54 4b  OR_VERSION).$(TK
a660: 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a  _MINOR_VERSION).
a670: 21 65 6e 64 69 66 0a 44 45 4d 4f 5f 49 4e 53 54  !endif.DEMO_INST
a680: 41 4c 4c 5f 44 49 52 09 3d 20 24 28 53 43 52 49  ALL_DIR.= $(SCRI
a690: 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 5c  PT_INSTALL_DIR)\
a6a0: 64 65 6d 6f 73 0a 49 4e 43 4c 55 44 45 5f 49 4e  demos.INCLUDE_IN
a6b0: 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 5f 49  STALL_DIR.= $(_I
a6c0: 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75  NSTALLDIR)\inclu
a6d0: 64 65 0a 0a 21 65 6c 73 65 20 23 20 65 78 74 65  de..!else # exte
a6e0: 6e 73 69 6f 6e 20 6f 74 68 65 72 20 74 68 61 6e  nsion other than
a6f0: 20 54 6b 0a 0a 50 52 4a 5f 49 4e 53 54 41 4c 4c   Tk..PRJ_INSTALL
a700: 5f 44 49 52 20 20 20 20 20 20 20 20 20 3d 20 24  _DIR         = $
a710: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 24 28  (_INSTALLDIR)\$(
a720: 50 52 4f 4a 45 43 54 29 24 28 44 4f 54 56 45 52  PROJECT)$(DOTVER
a730: 53 49 4f 4e 29 0a 21 69 66 20 24 28 4d 55 4c 54  SION).!if $(MULT
a740: 49 50 4c 41 54 46 4f 52 4d 5f 49 4e 53 54 41 4c  IPLATFORM_INSTAL
a750: 4c 29 0a 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44  L).LIB_INSTALL_D
a760: 49 52 09 09 3d 20 24 28 50 52 4a 5f 49 4e 53 54  IR..= $(PRJ_INST
a770: 41 4c 4c 5f 44 49 52 29 5c 24 28 50 4c 41 54 46  ALL_DIR)\$(PLATF
a780: 4f 52 4d 5f 49 44 45 4e 54 49 46 59 29 0a 42 49  ORM_IDENTIFY).BI
a790: 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d  N_INSTALL_DIR..=
a7a0: 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44   $(PRJ_INSTALL_D
a7b0: 49 52 29 5c 24 28 50 4c 41 54 46 4f 52 4d 5f 49  IR)\$(PLATFORM_I
a7c0: 44 45 4e 54 49 46 59 29 0a 21 65 6c 73 65 0a 4c  DENTIFY).!else.L
a7d0: 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09  IB_INSTALL_DIR..
a7e0: 3d 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f  = $(PRJ_INSTALL_
a7f0: 44 49 52 29 0a 42 49 4e 5f 49 4e 53 54 41 4c 4c  DIR).BIN_INSTALL
a800: 5f 44 49 52 09 09 3d 20 24 28 50 52 4a 5f 49 4e  _DIR..= $(PRJ_IN
a810: 53 54 41 4c 4c 5f 44 49 52 29 0a 21 65 6e 64 69  STALL_DIR).!endi
a820: 66 0a 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49  f.DOC_INSTALL_DI
a830: 52 09 09 3d 20 24 28 50 52 4a 5f 49 4e 53 54 41  R..= $(PRJ_INSTA
a840: 4c 4c 5f 44 49 52 29 0a 53 43 52 49 50 54 5f 49  LL_DIR).SCRIPT_I
a850: 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 50  NSTALL_DIR.= $(P
a860: 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0a  RJ_INSTALL_DIR).
a870: 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  DEMO_INSTALL_DIR
a880: 09 3d 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c  .= $(PRJ_INSTALL
a890: 5f 44 49 52 29 5c 64 65 6d 6f 73 0a 49 4e 43 4c  _DIR)\demos.INCL
a8a0: 55 44 45 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09  UDE_INSTALL_DIR.
a8b0: 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29  = $(_INSTALLDIR)
a8c0: 5c 2e 2e 5c 69 6e 63 6c 75 64 65 0a 0a 21 65 6e  \..\include..!en
a8d0: 64 69 66 0a 0a 23 23 23 23 23 23 23 23 23 23 23  dif..###########
a8e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a8f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a900: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a910: 23 23 23 23 23 23 23 23 0a 23 20 31 32 2e 20 53  ########.# 12. S
a920: 65 74 20 75 70 20 61 63 74 75 61 6c 20 6f 70 74  et up actual opt
a930: 69 6f 6e 73 20 74 6f 20 62 65 20 70 61 73 73 65  ions to be passe
a940: 64 20 74 6f 20 74 68 65 20 63 6f 6d 70 69 6c 65  d to the compile
a950: 72 20 61 6e 64 20 6c 69 6e 6b 65 72 0a 23 20 4e  r and linker.# N
a960: 6f 77 20 77 65 20 68 61 76 65 20 61 6c 6c 20 74  ow we have all t
a970: 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 77  he information w
a980: 65 20 6e 65 65 64 2c 20 73 65 74 20 75 70 20 74  e need, set up t
a990: 68 65 20 61 63 74 75 61 6c 20 66 6c 61 67 73 20  he actual flags 
a9a0: 61 6e 64 0a 23 20 6f 70 74 69 6f 6e 73 20 74 68  and.# options th
a9b0: 61 74 20 77 65 20 77 69 6c 6c 20 70 61 73 73 20  at we will pass 
a9c0: 74 6f 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20  to the compiler 
a9d0: 61 6e 64 20 6c 69 6e 6b 65 72 2e 20 54 68 65 20  and linker. The 
a9e0: 6d 61 69 6e 0a 23 20 6d 61 6b 65 66 69 6c 65 20  main.# makefile 
a9f0: 73 68 6f 75 6c 64 20 75 73 65 20 74 68 65 73 65  should use these
aa00: 20 69 6e 20 63 6f 6d 62 69 6e 61 74 69 6f 6e 20   in combination 
aa10: 77 69 74 68 20 77 68 61 74 65 76 65 72 20 6f 74  with whatever ot
aa20: 68 65 72 20 66 6c 61 67 73 0a 23 20 61 6e 64 20  her flags.# and 
aa30: 73 77 69 74 63 68 65 73 20 61 72 65 20 73 70 65  switches are spe
aa40: 63 69 66 69 63 20 74 6f 20 69 74 2e 0a 23 20 54  cific to it..# T
aa50: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63  he following mac
aa60: 72 6f 73 20 61 72 65 20 64 65 66 69 6e 65 64 2c  ros are defined,
aa70: 20 6e 61 6d 65 73 20 61 72 65 20 66 6f 72 20 68   names are for h
aa80: 69 73 74 6f 72 69 63 61 6c 20 63 6f 6d 70 61 74  istorical compat
aa90: 69 62 69 6c 69 74 79 3a 0a 23 20 4f 50 54 44 45  ibility:.# OPTDE
aaa0: 46 49 4e 45 53 20 2d 20 2f 44 78 78 78 20 43 20  FINES - /Dxxx C 
aab0: 6d 61 63 72 6f 20 66 6c 61 67 73 20 62 61 73 65  macro flags base
aac0: 64 20 6f 6e 20 75 73 65 72 2d 73 70 65 63 69 66  d on user-specif
aad0: 69 65 64 20 4f 50 54 53 0a 23 20 43 4f 4d 50 49  ied OPTS.# COMPI
aae0: 4c 45 52 46 4c 41 47 53 20 2d 20 2f 44 78 78 78  LERFLAGS - /Dxxx
aaf0: 20 43 20 6d 61 63 72 6f 20 66 6c 61 67 73 20 69   C macro flags i
ab00: 6e 64 65 70 65 6e 64 65 6e 74 20 6f 66 20 61 6e  ndependent of an
ab10: 79 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20  y configuration 
ab20: 6f 70 74 69 6f 6e 73 0a 23 20 63 72 74 20 2d 20  options.# crt - 
ab30: 43 6f 6d 70 69 6c 65 72 20 73 77 69 74 63 68 20  Compiler switch 
ab40: 74 68 61 74 20 73 65 6c 65 63 74 73 20 74 68 65  that selects the
ab50: 20 61 70 70 72 6f 70 72 69 61 74 65 20 43 20 72   appropriate C r
ab60: 75 6e 74 69 6d 65 0a 23 20 63 64 65 62 75 67 20  untime.# cdebug 
ab70: 2d 20 43 6f 6d 70 69 6c 65 72 20 73 77 69 74 63  - Compiler switc
ab80: 68 65 73 20 72 65 6c 61 74 65 64 20 74 6f 20 64  hes related to d
ab90: 65 62 75 67 20 41 4e 44 20 6f 70 74 69 6d 69 7a  ebug AND optimiz
aba0: 61 74 69 6f 6e 73 0a 23 20 63 77 61 72 6e 20 2d  ations.# cwarn -
abb0: 20 43 6f 6d 70 69 6c 65 72 20 73 77 69 74 63 68   Compiler switch
abc0: 65 73 20 74 68 61 74 20 73 65 74 20 77 61 72 6e  es that set warn
abd0: 69 6e 67 20 6c 65 76 65 6c 73 0a 23 20 63 66 6c  ing levels.# cfl
abe0: 61 67 73 20 2d 20 63 6f 6d 70 6c 65 74 65 20 63  ags - complete c
abf0: 6f 6d 70 69 6c 65 72 20 73 77 69 74 63 68 65 73  ompiler switches
ac00: 20 28 73 75 62 73 75 6d 65 73 20 63 64 65 62 75   (subsumes cdebu
ac10: 67 20 61 6e 64 20 63 77 61 72 6e 29 0a 23 20 6c  g and cwarn).# l
ac20: 64 65 62 75 67 20 2d 20 4c 69 6e 6b 65 72 20 73  debug - Linker s
ac30: 77 69 74 63 68 65 73 20 63 6f 6e 74 72 6f 6c 6c  witches controll
ac40: 69 6e 67 20 64 65 62 75 67 20 69 6e 66 6f 72 6d  ing debug inform
ac50: 61 74 69 6f 6e 20 61 6e 64 20 6f 70 74 69 6d 69  ation and optimi
ac60: 7a 61 74 69 6f 6e 0a 23 20 6c 66 6c 61 67 73 20  zation.# lflags 
ac70: 2d 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e 6b 65  - complete linke
ac80: 72 20 73 77 69 74 63 68 65 73 20 28 73 75 62 73  r switches (subs
ac90: 75 6d 65 73 20 6c 64 65 62 75 67 29 20 65 78 63  umes ldebug) exc
aca0: 65 70 74 20 73 75 62 73 79 73 74 65 6d 20 74 79  ept subsystem ty
acb0: 70 65 0a 23 20 64 6c 6c 6c 66 6c 61 67 73 20 2d  pe.# dlllflags -
acc0: 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e 6b 65 72   complete linker
acd0: 20 73 77 69 74 63 68 65 73 20 74 6f 20 62 75 69   switches to bui
ace0: 6c 64 20 44 4c 4c 73 20 28 73 75 62 73 75 6d 65  ld DLLs (subsume
acf0: 73 20 6c 66 6c 61 67 73 29 0a 23 20 63 6f 6e 6c  s lflags).# conl
ad00: 66 6c 61 67 73 20 2d 20 63 6f 6d 70 6c 65 74 65  flags - complete
ad10: 20 6c 69 6e 6b 65 72 20 73 77 69 74 63 68 65 73   linker switches
ad20: 20 66 6f 72 20 63 6f 6e 73 6f 6c 65 20 70 72 6f   for console pro
ad30: 67 72 61 6d 20 28 73 75 62 73 75 6d 65 73 20 6c  gram (subsumes l
ad40: 66 6c 61 67 73 29 0a 23 20 67 75 69 6c 66 6c 61  flags).# guilfla
ad50: 67 73 20 2d 20 63 6f 6d 70 6c 65 74 65 20 6c 69  gs - complete li
ad60: 6e 6b 65 72 20 73 77 69 74 63 68 65 73 20 66 6f  nker switches fo
ad70: 72 20 47 55 49 20 70 72 6f 67 72 61 6d 20 28 73  r GUI program (s
ad80: 75 62 73 75 6d 65 73 20 6c 66 6c 61 67 73 29 0a  ubsumes lflags).
ad90: 23 20 62 61 73 65 6c 69 62 73 20 2d 20 6d 69 6e  # baselibs - min
ada0: 69 6d 75 6d 20 57 69 6e 64 6f 77 73 20 6c 69 62  imum Windows lib
adb0: 72 61 72 69 65 73 20 72 65 71 75 69 72 65 64 2e  raries required.
adc0: 20 50 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65   Parent makefile
add0: 20 63 61 6e 0a 23 20 20 20 20 64 65 66 69 6e 65   can.#    define
ade0: 20 50 52 4a 5f 4c 49 42 53 20 62 65 66 6f 72 65   PRJ_LIBS before
adf0: 20 69 6e 63 6c 75 64 69 6e 67 20 72 75 6c 65 73   including rules
ae00: 2e 72 63 20 69 66 20 61 64 64 69 74 69 6f 6e 61  .rc if additiona
ae10: 6c 20 6c 69 62 73 20 61 72 65 20 6e 65 65 64 65  l libs are neede
ae20: 64 0a 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20  d..OPTDEFINES.= 
ae30: 2f 44 53 54 44 43 5f 48 45 41 44 45 52 53 20 2f  /DSTDC_HEADERS /
ae40: 44 55 53 45 5f 4e 4d 41 4b 45 3d 31 0a 21 69 66  DUSE_NMAKE=1.!if
ae50: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 20   $(VCVERSION) > 
ae60: 31 36 30 30 0a 4f 50 54 44 45 46 49 4e 45 53 09  1600.OPTDEFINES.
ae70: 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20  = $(OPTDEFINES) 
ae80: 2f 44 48 41 56 45 5f 53 54 44 49 4e 54 5f 48 3d  /DHAVE_STDINT_H=
ae90: 31 0a 21 65 6c 73 65 0a 4f 50 54 44 45 46 49 4e  1.!else.OPTDEFIN
aea0: 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45  ES.= $(OPTDEFINE
aeb0: 53 29 20 2f 44 4d 50 5f 4e 4f 5f 53 54 44 49 4e  S) /DMP_NO_STDIN
aec0: 54 3d 31 0a 21 65 6e 64 69 66 0a 21 69 66 20 24  T=1.!endif.!if $
aed0: 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 3d 20 31  (VCVERSION) >= 1
aee0: 38 30 30 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d  800.OPTDEFINES.=
aef0: 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f   $(OPTDEFINES) /
af00: 44 48 41 56 45 5f 49 4e 54 54 59 50 45 53 5f 48  DHAVE_INTTYPES_H
af10: 3d 31 20 2f 44 48 41 56 45 5f 53 54 44 42 4f 4f  =1 /DHAVE_STDBOO
af20: 4c 5f 48 3d 31 0a 21 65 6e 64 69 66 0a 0a 21 69  L_H=1.!endif..!i
af30: 66 20 24 28 54 43 4c 5f 4d 45 4d 5f 44 45 42 55  f $(TCL_MEM_DEBU
af40: 47 29 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20  G).OPTDEFINES.= 
af50: 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44  $(OPTDEFINES) /D
af60: 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 0a 21 65  TCL_MEM_DEBUG.!e
af70: 6e 64 69 66 0a 21 69 66 20 24 28 54 43 4c 5f 43  ndif.!if $(TCL_C
af80: 4f 4d 50 49 4c 45 5f 44 45 42 55 47 29 0a 4f 50  OMPILE_DEBUG).OP
af90: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54  TDEFINES.= $(OPT
afa0: 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 43  DEFINES) /DTCL_C
afb0: 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 2f 44 54  OMPILE_DEBUG /DT
afc0: 43 4c 5f 43 4f 4d 50 49 4c 45 5f 53 54 41 54 53  CL_COMPILE_STATS
afd0: 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28 54 43  .!endif.!if $(TC
afe0: 4c 5f 54 48 52 45 41 44 53 29 20 26 26 20 24 28  L_THREADS) && $(
aff0: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3c 20 38  TCL_VERSION) < 8
b000: 37 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24  7.OPTDEFINES.= $
b010: 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54  (OPTDEFINES) /DT
b020: 43 4c 5f 54 48 52 45 41 44 53 3d 31 0a 21 69 66  CL_THREADS=1.!if
b030: 20 24 28 55 53 45 5f 54 48 52 45 41 44 5f 41 4c   $(USE_THREAD_AL
b040: 4c 4f 43 29 20 26 26 20 24 28 54 43 4c 5f 56 45  LOC) && $(TCL_VE
b050: 52 53 49 4f 4e 29 20 3c 20 38 37 0a 4f 50 54 44  RSION) < 87.OPTD
b060: 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45  EFINES.= $(OPTDE
b070: 46 49 4e 45 53 29 20 2f 44 55 53 45 5f 54 48 52  FINES) /DUSE_THR
b080: 45 41 44 5f 41 4c 4c 4f 43 3d 31 0a 21 65 6e 64  EAD_ALLOC=1.!end
b090: 69 66 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28  if.!endif.!if $(
b0a0: 53 54 41 54 49 43 5f 42 55 49 4c 44 29 0a 4f 50  STATIC_BUILD).OP
b0b0: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54  TDEFINES.= $(OPT
b0c0: 44 45 46 49 4e 45 53 29 20 2f 44 53 54 41 54 49  DEFINES) /DSTATI
b0d0: 43 5f 42 55 49 4c 44 0a 21 65 6c 73 65 69 66 20  C_BUILD.!elseif 
b0e0: 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3e  $(TCL_VERSION) >
b0f0: 20 38 36 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d   86.OPTDEFINES.=
b100: 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f   $(OPTDEFINES) /
b110: 44 54 43 4c 5f 57 49 54 48 5f 45 58 54 45 52 4e  DTCL_WITH_EXTERN
b120: 41 4c 5f 54 4f 4d 4d 41 54 48 0a 21 69 66 20 22  AL_TOMMATH.!if "
b130: 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22  $(MACHINE)" == "
b140: 41 4d 44 36 34 22 20 7c 7c 20 22 24 28 4d 41 43  AMD64" || "$(MAC
b150: 48 49 4e 45 29 22 20 3d 3d 20 22 41 52 4d 36 34  HINE)" == "ARM64
b160: 22 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24  ".OPTDEFINES.= $
b170: 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 4d  (OPTDEFINES) /DM
b180: 50 5f 36 34 42 49 54 0a 21 65 6e 64 69 66 0a 21  P_64BIT.!endif.!
b190: 65 6e 64 69 66 0a 21 69 66 20 24 28 54 43 4c 5f  endif.!if $(TCL_
b1a0: 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 29 0a 4f  NO_DEPRECATED).O
b1b0: 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50  PTDEFINES.= $(OP
b1c0: 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f  TDEFINES) /DTCL_
b1d0: 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 0a 21 65  NO_DEPRECATED.!e
b1e0: 6e 64 69 66 0a 0a 21 69 66 20 24 28 55 53 45 5f  ndif..!if $(USE_
b1f0: 53 54 55 42 53 29 0a 23 20 4e 6f 74 65 20 77 65  STUBS).# Note we
b200: 20 64 6f 20 6e 6f 74 20 64 65 66 69 6e 65 20 55   do not define U
b210: 53 45 5f 54 43 4c 5f 53 54 55 42 53 20 65 76 65  SE_TCL_STUBS eve
b220: 6e 20 77 68 65 6e 20 62 75 69 6c 64 69 6e 67 20  n when building 
b230: 74 6b 20 73 69 6e 63 65 20 73 6f 6d 65 0a 23 20  tk since some.# 
b240: 74 65 73 74 20 74 61 72 67 65 74 73 20 69 6e 20  test targets in 
b250: 74 6b 20 64 6f 20 6e 6f 74 20 75 73 65 20 73 74  tk do not use st
b260: 75 62 73 0a 21 69 66 20 21 24 28 44 4f 49 4e 47  ubs.!if !$(DOING
b270: 5f 54 43 4c 29 0a 55 53 45 5f 53 54 55 42 53 5f  _TCL).USE_STUBS_
b280: 44 45 46 53 20 20 3d 20 2f 44 55 53 45 5f 54 43  DEFS  = /DUSE_TC
b290: 4c 5f 53 54 55 42 53 20 2f 44 55 53 45 5f 54 43  L_STUBS /DUSE_TC
b2a0: 4c 4f 4f 5f 53 54 55 42 53 0a 21 69 66 20 24 28  LOO_STUBS.!if $(
b2b0: 4e 45 45 44 5f 54 4b 29 0a 55 53 45 5f 53 54 55  NEED_TK).USE_STU
b2c0: 42 53 5f 44 45 46 53 20 20 3d 20 24 28 55 53 45  BS_DEFS  = $(USE
b2d0: 5f 53 54 55 42 53 5f 44 45 46 53 29 20 2f 44 55  _STUBS_DEFS) /DU
b2e0: 53 45 5f 54 4b 5f 53 54 55 42 53 0a 21 65 6e 64  SE_TK_STUBS.!end
b2f0: 69 66 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  if.!endif.!endif
b300: 20 23 20 55 53 45 5f 53 54 55 42 53 0a 0a 21 69   # USE_STUBS..!i
b310: 66 20 21 24 28 44 45 42 55 47 29 0a 4f 50 54 44  f !$(DEBUG).OPTD
b320: 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45  EFINES.= $(OPTDE
b330: 46 49 4e 45 53 29 20 2f 44 4e 44 45 42 55 47 0a  FINES) /DNDEBUG.
b340: 21 69 66 20 24 28 4f 50 54 49 4d 49 5a 49 4e 47  !if $(OPTIMIZING
b350: 29 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24  ).OPTDEFINES.= $
b360: 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54  (OPTDEFINES) /DT
b370: 43 4c 5f 43 46 47 5f 4f 50 54 49 4d 49 5a 45 44  CL_CFG_OPTIMIZED
b380: 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 21  .!endif.!endif.!
b390: 69 66 20 24 28 50 52 4f 46 49 4c 45 29 0a 4f 50  if $(PROFILE).OP
b3a0: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54  TDEFINES.= $(OPT
b3b0: 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 43  DEFINES) /DTCL_C
b3c0: 46 47 5f 50 52 4f 46 49 4c 45 44 0a 21 65 6e 64  FG_PROFILED.!end
b3d0: 69 66 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e  if.!if "$(MACHIN
b3e0: 45 29 22 20 3d 3d 20 22 41 4d 44 36 34 22 20 7c  E)" == "AMD64" |
b3f0: 7c 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d  | "$(MACHINE)" =
b400: 3d 20 22 41 52 4d 36 34 22 0a 4f 50 54 44 45 46  = "ARM64".OPTDEF
b410: 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49  INES.= $(OPTDEFI
b420: 4e 45 53 29 20 2f 44 54 43 4c 5f 43 46 47 5f 44  NES) /DTCL_CFG_D
b430: 4f 36 34 42 49 54 0a 21 65 6e 64 69 66 0a 21 69  O64BIT.!endif.!i
b440: 66 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3c  f $(VCVERSION) <
b450: 20 31 33 30 30 0a 4f 50 54 44 45 46 49 4e 45 53   1300.OPTDEFINES
b460: 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29  .= $(OPTDEFINES)
b470: 20 2f 44 4e 4f 5f 53 54 52 54 4f 49 36 34 3d 31   /DNO_STRTOI64=1
b480: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 54  .!endif..!if $(T
b490: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e  CL_MAJOR_VERSION
b4a0: 29 20 3d 3d 20 38 0a 21 69 66 20 22 24 28 5f 55  ) == 8.!if "$(_U
b4b0: 53 45 5f 36 34 42 49 54 5f 54 49 4d 45 5f 54 29  SE_64BIT_TIME_T)
b4c0: 22 20 3d 3d 20 22 31 22 0a 4f 50 54 44 45 46 49  " == "1".OPTDEFI
b4d0: 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e  NES.= $(OPTDEFIN
b4e0: 45 53 29 20 2f 44 5f 55 53 45 5f 36 34 42 49 54  ES) /D_USE_64BIT
b4f0: 5f 54 49 4d 45 5f 54 3d 31 0a 21 65 6e 64 69 66  _TIME_T=1.!endif
b500: 0a 21 65 6e 64 69 66 0a 21 69 66 20 22 24 28 54  .!endif.!if "$(T
b510: 43 4c 5f 42 55 49 4c 44 5f 46 4f 52 29 22 20 3d  CL_BUILD_FOR)" =
b520: 3d 20 22 38 22 0a 4f 50 54 44 45 46 49 4e 45 53  = "8".OPTDEFINES
b530: 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29  .= $(OPTDEFINES)
b540: 20 2f 44 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52   /DTCL_MAJOR_VER
b550: 53 49 4f 4e 3d 38 20 2f 44 54 4b 5f 4d 41 4a 4f  SION=8 /DTK_MAJO
b560: 52 5f 56 45 52 53 49 4f 4e 3d 38 0a 21 65 6e 64  R_VERSION=8.!end
b570: 69 66 0a 0a 23 20 4c 69 6b 65 20 74 68 65 20 54  if..# Like the T
b580: 45 41 20 73 79 73 74 65 6d 20 6f 6e 6c 79 20 73  EA system only s
b590: 65 74 20 74 68 69 73 20 6e 6f 6e 20 65 6d 70 74  et this non empt
b5a0: 79 20 66 6f 72 20 6e 6f 6e 2d 54 6b 20 65 78 74  y for non-Tk ext
b5b0: 65 6e 73 69 6f 6e 73 0a 23 20 4e 6f 74 65 3a 20  ensions.# Note: 
b5c0: 73 6f 6d 65 20 65 78 74 65 6e 73 69 6f 6e 73 20  some extensions 
b5d0: 75 73 65 20 50 41 43 4b 41 47 45 5f 4e 41 4d 45  use PACKAGE_NAME
b5e0: 20 61 6e 64 20 6f 74 68 65 72 73 20 75 73 65 20   and others use 
b5f0: 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 0a  PACKAGE_TCLNAME.
b600: 23 20 73 6f 20 77 65 20 70 61 73 73 20 62 6f 74  # so we pass bot
b610: 68 0a 21 69 66 20 21 24 28 44 4f 49 4e 47 5f 54  h.!if !$(DOING_T
b620: 43 4c 29 20 26 26 20 21 24 28 44 4f 49 4e 47 5f  CL) && !$(DOING_
b630: 54 4b 29 0a 50 4b 47 4e 41 4d 45 46 4c 41 47 53  TK).PKGNAMEFLAGS
b640: 20 3d 20 2f 44 50 41 43 4b 41 47 45 5f 4e 41 4d   = /DPACKAGE_NAM
b650: 45 3d 22 5c 22 24 28 50 52 4a 5f 50 41 43 4b 41  E="\"$(PRJ_PACKA
b660: 47 45 5f 54 43 4c 4e 41 4d 45 29 5c 22 22 20 5c  GE_TCLNAME)\"" \
b670: 0a 09 2f 44 50 41 43 4b 41 47 45 5f 54 43 4c 4e  ../DPACKAGE_TCLN
b680: 41 4d 45 3d 22 5c 22 24 28 50 52 4a 5f 50 41 43  AME="\"$(PRJ_PAC
b690: 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 5c 22 22  KAGE_TCLNAME)\""
b6a0: 20 5c 0a 09 2f 44 50 41 43 4b 41 47 45 5f 56 45   \../DPACKAGE_VE
b6b0: 52 53 49 4f 4e 3d 22 5c 22 24 28 44 4f 54 56 45  RSION="\"$(DOTVE
b6c0: 52 53 49 4f 4e 29 5c 22 22 20 5c 0a 09 2f 44 4d  RSION)\"" \../DM
b6d0: 4f 44 55 4c 45 5f 53 43 4f 50 45 3d 65 78 74 65  ODULE_SCOPE=exte
b6e0: 72 6e 0a 21 65 6e 64 69 66 0a 0a 23 20 63 72 74  rn.!endif..# crt
b6f0: 20 70 69 63 6b 73 20 74 68 65 20 43 20 72 75 6e   picks the C run
b700: 20 74 69 6d 65 20 62 61 73 65 64 20 6f 6e 20 73   time based on s
b710: 65 6c 65 63 74 65 64 20 4f 50 54 53 0a 21 69 66  elected OPTS.!if
b720: 20 24 28 4d 53 56 43 52 54 29 0a 21 69 66 20 24   $(MSVCRT).!if $
b730: 28 44 45 42 55 47 29 20 26 26 20 21 24 28 55 4e  (DEBUG) && !$(UN
b740: 43 48 45 43 4b 45 44 29 0a 63 72 74 20 3d 20 2d  CHECKED).crt = -
b750: 4d 44 64 0a 21 65 6c 73 65 0a 63 72 74 20 3d 20  MDd.!else.crt = 
b760: 2d 4d 44 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65  -MD.!endif.!else
b770: 0a 21 69 66 20 24 28 44 45 42 55 47 29 20 26 26  .!if $(DEBUG) &&
b780: 20 21 24 28 55 4e 43 48 45 43 4b 45 44 29 0a 63   !$(UNCHECKED).c
b790: 72 74 20 3d 20 2d 4d 54 64 0a 21 65 6c 73 65 0a  rt = -MTd.!else.
b7a0: 63 72 74 20 3d 20 2d 4d 54 0a 21 65 6e 64 69 66  crt = -MT.!endif
b7b0: 0a 21 65 6e 64 69 66 0a 0a 23 20 63 64 65 62 75  .!endif..# cdebu
b7c0: 67 20 69 6e 63 6c 75 64 65 73 20 63 6f 6d 70 69  g includes compi
b7d0: 6c 65 72 20 6f 70 74 69 6f 6e 73 20 66 6f 72 20  ler options for 
b7e0: 64 65 62 75 67 67 69 6e 67 20 61 73 20 77 65 6c  debugging as wel
b7f0: 6c 20 61 73 20 6f 70 74 69 6d 69 7a 61 74 69 6f  l as optimizatio
b800: 6e 2e 0a 21 69 66 20 24 28 44 45 42 55 47 29 0a  n..!if $(DEBUG).
b810: 0a 23 20 49 6e 20 64 65 62 75 67 67 69 6e 67 20  .# In debugging 
b820: 6d 6f 64 65 2c 20 6f 70 74 69 6d 69 7a 61 74 69  mode, optimizati
b830: 6f 6e 73 20 6e 65 65 64 20 74 6f 20 62 65 20 64  ons need to be d
b840: 69 73 61 62 6c 65 64 0a 63 64 65 62 75 67 20 3d  isabled.cdebug =
b850: 20 2d 5a 69 20 2d 4f 64 20 24 28 44 45 42 55 47   -Zi -Od $(DEBUG
b860: 46 4c 41 47 53 29 0a 0a 21 65 6c 73 65 0a 0a 63  FLAGS)..!else..c
b870: 64 65 62 75 67 20 3d 20 24 28 4f 50 54 49 4d 49  debug = $(OPTIMI
b880: 5a 41 54 49 4f 4e 53 29 0a 21 69 66 20 24 28 53  ZATIONS).!if $(S
b890: 59 4d 42 4f 4c 53 29 0a 63 64 65 62 75 67 20 3d  YMBOLS).cdebug =
b8a0: 20 24 28 63 64 65 62 75 67 29 20 2d 5a 69 0a 21   $(cdebug) -Zi.!
b8b0: 65 6e 64 69 66 0a 0a 21 65 6e 64 69 66 20 23 20  endif..!endif # 
b8c0: 24 28 44 45 42 55 47 29 0a 0a 23 20 63 77 61 72  $(DEBUG)..# cwar
b8d0: 6e 20 69 6e 63 6c 75 64 65 73 20 64 65 66 61 75  n includes defau
b8e0: 6c 74 20 77 61 72 6e 69 6e 67 20 6c 65 76 65 6c  lt warning level
b8f0: 73 2c 20 61 6c 73 6f 20 43 34 30 39 30 20 28 62  s, also C4090 (b
b900: 75 67 67 79 29 20 61 6e 64 20 43 34 31 34 36 20  uggy) and C4146 
b910: 69 73 20 75 73 65 6c 65 73 73 2e 0a 63 77 61 72  is useless..cwar
b920: 6e 20 3d 20 24 28 57 41 52 4e 49 4e 47 53 29 20  n = $(WARNINGS) 
b930: 2d 77 64 34 30 39 30 20 2d 77 64 34 31 34 36 0a  -wd4090 -wd4146.
b940: 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29  .!if "$(MACHINE)
b950: 22 20 3d 3d 20 22 41 4d 44 36 34 22 20 7c 7c 20  " == "AMD64" || 
b960: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
b970: 22 41 52 4d 36 34 22 0a 23 20 44 69 73 61 62 6c  "ARM64".# Disabl
b980: 65 20 70 6f 69 6e 74 65 72 3c 2d 3e 69 6e 74 20  e pointer<->int 
b990: 77 61 72 6e 69 6e 67 73 20 72 65 6c 61 74 65 64  warnings related
b9a0: 20 74 6f 20 63 61 73 74 20 62 65 74 77 65 65 6e   to cast between
b9b0: 20 64 69 66 66 65 72 65 6e 74 20 73 69 7a 65 73   different sizes
b9c0: 0a 23 20 54 68 65 72 65 20 61 72 65 20 61 20 67  .# There are a g
b9d0: 61 64 7a 69 6c 6c 69 6f 6e 20 6f 66 20 74 68 65  adzillion of the
b9e0: 73 65 20 64 75 65 20 74 6f 20 75 73 65 20 6f 66  se due to use of
b9f0: 20 43 6c 69 65 6e 74 44 61 74 61 20 61 6e 64 0a   ClientData and.
ba00: 23 20 63 6c 75 74 74 65 72 20 75 70 20 63 6f 6d  # clutter up com
ba10: 70 69 6c 65 72 0a 23 20 6f 75 74 70 75 74 20 69  piler.# output i
ba20: 6e 63 72 65 61 73 69 6e 67 20 63 68 61 6e 63 65  ncreasing chance
ba30: 20 6f 66 20 61 20 72 65 61 6c 20 77 61 72 6e 69   of a real warni
ba40: 6e 67 20 67 65 74 74 69 6e 67 20 6c 6f 73 74 2e  ng getting lost.
ba50: 20 53 6f 20 64 69 73 61 62 6c 65 20 74 68 65 6d   So disable them
ba60: 2e 0a 23 20 45 76 65 6e 74 75 61 6c 6c 79 20 73  ..# Eventually s
ba70: 6f 6d 65 20 64 61 79 2c 20 54 63 6c 20 77 69 6c  ome day, Tcl wil
ba80: 6c 20 62 65 20 36 34 2d 62 69 74 20 63 6c 65 61  l be 64-bit clea
ba90: 6e 2e 0a 63 77 61 72 6e 20 3d 20 24 28 63 77 61  n..cwarn = $(cwa
baa0: 72 6e 29 20 2d 77 64 34 33 31 31 20 2d 77 64 34  rn) -wd4311 -wd4
bab0: 33 31 32 0a 21 65 6e 64 69 66 0a 0a 23 23 23 20  312.!endif..### 
bac0: 43 6f 6d 6d 6f 6e 20 63 6f 6d 70 69 6c 65 72 20  Common compiler 
bad0: 6f 70 74 69 6f 6e 73 20 74 68 61 74 20 61 72 65  options that are
bae0: 20 61 72 63 68 69 74 65 63 74 75 72 65 20 73 70   architecture sp
baf0: 65 63 69 66 69 63 0a 21 69 66 20 22 24 28 4d 41  ecific.!if "$(MA
bb00: 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 52 4d 22  CHINE)" == "ARM"
bb10: 0a 63 61 72 63 68 20 3d 20 2f 44 5f 41 52 4d 5f  .carch = /D_ARM_
bb20: 57 49 4e 41 50 49 5f 50 41 52 54 49 54 49 4f 4e  WINAPI_PARTITION
bb30: 5f 44 45 53 4b 54 4f 50 5f 53 44 4b 5f 41 56 41  _DESKTOP_SDK_AVA
bb40: 49 4c 41 42 4c 45 0a 21 65 6c 73 65 0a 63 61 72  ILABLE.!else.car
bb50: 63 68 20 3d 0a 21 65 6e 64 69 66 0a 0a 23 20 63  ch =.!endif..# c
bb60: 70 75 69 64 20 69 73 20 6f 6e 6c 79 20 61 76 61  puid is only ava
bb70: 69 6c 61 62 6c 65 20 6f 6e 20 69 6e 74 65 6c 20  ilable on intel 
bb80: 6d 61 63 68 69 6e 65 73 0a 21 69 66 20 22 24 28  machines.!if "$(
bb90: 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 49 58  MACHINE)" == "IX
bba0: 38 36 22 20 7c 7c 20 22 24 28 4d 41 43 48 49 4e  86" || "$(MACHIN
bbb0: 45 29 22 20 3d 3d 20 22 41 4d 44 36 34 22 0a 63  E)" == "AMD64".c
bbc0: 61 72 63 68 20 3d 20 24 28 63 61 72 63 68 29 20  arch = $(carch) 
bbd0: 2f 44 48 41 56 45 5f 43 50 55 49 44 3d 31 0a 21  /DHAVE_CPUID=1.!
bbe0: 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 44 45 42  endif..!if $(DEB
bbf0: 55 47 29 0a 23 20 54 75 72 6e 20 77 61 72 6e 69  UG).# Turn warni
bc00: 6e 67 73 20 69 6e 74 6f 20 65 72 72 6f 72 73 0a  ngs into errors.
bc10: 63 77 61 72 6e 20 3d 20 24 28 63 77 61 72 6e 29  cwarn = $(cwarn)
bc20: 20 2d 57 58 0a 21 65 6e 64 69 66 0a 0a 49 4e 43   -WX.!endif..INC
bc30: 4c 55 44 45 53 20 3d 20 24 28 54 43 4c 5f 49 4e  LUDES = $(TCL_IN
bc40: 43 4c 55 44 45 53 29 20 24 28 54 4b 5f 49 4e 43  CLUDES) $(TK_INC
bc50: 4c 55 44 45 53 29 20 24 28 50 52 4a 5f 49 4e 43  LUDES) $(PRJ_INC
bc60: 4c 55 44 45 53 29 0a 21 69 66 20 21 24 28 44 4f  LUDES).!if !$(DO
bc70: 49 4e 47 5f 54 43 4c 29 20 26 26 20 21 24 28 44  ING_TCL) && !$(D
bc80: 4f 49 4e 47 5f 54 4b 29 0a 49 4e 43 4c 55 44 45  OING_TK).INCLUDE
bc90: 53 20 3d 20 24 28 49 4e 43 4c 55 44 45 53 29 20  S = $(INCLUDES) 
bca0: 2d 49 22 24 28 47 45 4e 45 52 49 43 44 49 52 29  -I"$(GENERICDIR)
bcb0: 22 20 2d 49 22 24 28 57 49 4e 5f 44 49 52 29 22  " -I"$(WIN_DIR)"
bcc0: 20 2d 49 22 24 28 43 4f 4d 50 41 54 44 49 52 29   -I"$(COMPATDIR)
bcd0: 22 0a 21 65 6e 64 69 66 0a 0a 23 20 54 68 65 73  ".!endif..# Thes
bce0: 65 20 66 6c 61 67 73 20 61 72 65 20 64 65 66 69  e flags are defi
bcf0: 6e 65 64 20 72 6f 75 67 68 6c 79 20 69 6e 20 74  ned roughly in t
bd00: 68 65 20 6f 72 64 65 72 20 6f 66 20 74 68 65 20  he order of the 
bd10: 70 72 65 2d 72 65 66 6f 72 6d 0a 23 20 72 75 6c  pre-reform.# rul
bd20: 65 73 2e 76 63 2f 6d 61 6b 65 66 69 6c 65 2e 76  es.vc/makefile.v
bd30: 63 20 74 6f 20 68 65 6c 70 20 76 69 73 75 61 6c  c to help visual
bd40: 6c 79 20 63 6f 6d 70 61 72 65 20 74 68 61 74 20  ly compare that 
bd50: 74 68 65 20 70 72 65 2d 20 61 6e 64 0a 23 20 70  the pre- and.# p
bd60: 6f 73 74 2d 72 65 66 6f 72 6d 20 62 75 69 6c 64  ost-reform build
bd70: 20 6c 6f 67 73 0a 0a 23 20 63 66 6c 61 67 73 20   logs..# cflags 
bd80: 63 6f 6e 74 61 69 6e 73 20 67 65 6e 65 72 69 63  contains generic
bd90: 20 66 6c 61 67 73 20 75 73 65 64 20 66 6f 72 20   flags used for 
bda0: 62 75 69 6c 64 69 6e 67 20 70 72 61 63 74 69 63  building practic
bdb0: 61 6c 6c 79 20 61 6c 6c 20 6f 62 6a 65 63 74 20  ally all object 
bdc0: 66 69 6c 65 73 0a 63 66 6c 61 67 73 20 3d 20 2d  files.cflags = -
bdd0: 6e 6f 6c 6f 67 6f 20 2d 63 20 24 28 43 4f 4d 50  nologo -c $(COMP
bde0: 49 4c 45 52 46 4c 41 47 53 29 20 24 28 63 61 72  ILERFLAGS) $(car
bdf0: 63 68 29 20 24 28 63 77 61 72 6e 29 20 2d 46 70  ch) $(cwarn) -Fp
be00: 24 28 54 4d 50 5f 44 49 52 29 5e 5c 20 24 28 63  $(TMP_DIR)^\ $(c
be10: 64 65 62 75 67 29 0a 0a 21 69 66 20 24 28 54 43  debug)..!if $(TC
be20: 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29  L_MAJOR_VERSION)
be30: 20 3d 3d 20 38 20 26 26 20 24 28 54 43 4c 5f 4d   == 8 && $(TCL_M
be40: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3c 20  INOR_VERSION) < 
be50: 37 0a 63 66 6c 61 67 73 20 3d 20 24 28 63 66 6c  7.cflags = $(cfl
be60: 61 67 73 29 20 2d 44 54 63 6c 5f 53 69 7a 65 3d  ags) -DTcl_Size=
be70: 69 6e 74 0a 21 65 6e 64 69 66 0a 0a 23 20 61 70  int.!endif..# ap
be80: 70 63 66 6c 61 67 73 20 63 6f 6e 74 61 69 6e 73  pcflags contains
be90: 20 24 28 63 66 6c 61 67 73 29 20 61 6e 64 20 66   $(cflags) and f
bea0: 6c 61 67 73 20 66 6f 72 20 62 75 69 6c 64 69 6e  lags for buildin
beb0: 67 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f  g the applicatio
bec0: 6e 0a 23 20 6f 62 6a 65 63 74 20 66 69 6c 65 73  n.# object files
bed0: 20 28 65 2e 67 2e 20 74 63 6c 73 68 2c 20 6f 72   (e.g. tclsh, or
bee0: 20 77 69 73 68 29 20 70 6b 67 63 66 6c 61 67 73   wish) pkgcflags
bef0: 20 63 6f 6e 74 61 69 6e 73 20 24 28 63 66 6c 61   contains $(cfla
bf00: 67 73 29 20 70 6c 75 73 0a 23 20 66 6c 61 67 73  gs) plus.# flags
bf10: 20 75 73 65 64 20 66 6f 72 20 62 75 69 6c 64 69   used for buildi
bf20: 6e 67 20 73 68 61 72 65 64 20 6f 62 6a 65 63 74  ng shared object
bf30: 20 66 69 6c 65 73 20 54 68 65 20 74 77 6f 20 64   files The two d
bf40: 69 66 66 65 72 20 69 6e 20 74 68 65 0a 23 20 42  iffer in the.# B
bf50: 55 49 4c 44 5f 24 28 50 52 4f 4a 45 43 54 29 20  UILD_$(PROJECT) 
bf60: 6d 61 63 72 6f 20 77 68 69 63 68 20 73 68 6f 75  macro which shou
bf70: 6c 64 20 62 65 20 64 65 66 69 6e 65 64 20 6f 6e  ld be defined on
bf80: 6c 79 20 66 6f 72 20 74 68 65 20 73 68 61 72 65  ly for the share
bf90: 64 0a 23 20 6c 69 62 72 61 72 79 20 2a 69 6d 70  d.# library *imp
bfa0: 6c 65 6d 65 6e 74 61 74 69 6f 6e 2a 20 61 6e 64  lementation* and
bfb0: 20 6e 6f 74 20 66 6f 72 20 69 74 73 20 63 61 6c   not for its cal
bfc0: 6c 65 72 20 69 6e 74 65 72 66 61 63 65 0a 0a 61  ler interface..a
bfd0: 70 70 63 66 6c 61 67 73 5f 6e 6f 73 74 75 62 73  ppcflags_nostubs
bfe0: 20 3d 20 24 28 63 66 6c 61 67 73 29 20 24 28 63   = $(cflags) $(c
bff0: 72 74 29 20 24 28 49 4e 43 4c 55 44 45 53 29 20  rt) $(INCLUDES) 
c000: 24 28 54 43 4c 5f 44 45 46 49 4e 45 53 29 20 24  $(TCL_DEFINES) $
c010: 28 50 52 4a 5f 44 45 46 49 4e 45 53 29 20 24 28  (PRJ_DEFINES) $(
c020: 4f 50 54 44 45 46 49 4e 45 53 29 0a 61 70 70 63  OPTDEFINES).appc
c030: 66 6c 61 67 73 20 3d 20 24 28 61 70 70 63 66 6c  flags = $(appcfl
c040: 61 67 73 5f 6e 6f 73 74 75 62 73 29 20 24 28 55  ags_nostubs) $(U
c050: 53 45 5f 53 54 55 42 53 5f 44 45 46 53 29 0a 70  SE_STUBS_DEFS).p
c060: 6b 67 63 66 6c 61 67 73 20 3d 20 24 28 61 70 70  kgcflags = $(app
c070: 63 66 6c 61 67 73 29 20 24 28 50 4b 47 4e 41 4d  cflags) $(PKGNAM
c080: 45 46 4c 41 47 53 29 20 2f 44 42 55 49 4c 44 5f  EFLAGS) /DBUILD_
c090: 24 28 50 52 4f 4a 45 43 54 29 0a 70 6b 67 63 66  $(PROJECT).pkgcf
c0a0: 6c 61 67 73 5f 6e 6f 73 74 75 62 73 20 3d 20 24  lags_nostubs = $
c0b0: 28 61 70 70 63 66 6c 61 67 73 5f 6e 6f 73 74 75  (appcflags_nostu
c0c0: 62 73 29 20 24 28 50 4b 47 4e 41 4d 45 46 4c 41  bs) $(PKGNAMEFLA
c0d0: 47 53 29 20 2f 44 42 55 49 4c 44 5f 24 28 50 52  GS) /DBUILD_$(PR
c0e0: 4f 4a 45 43 54 29 0a 0a 23 20 73 74 75 62 73 63  OJECT)..# stubsc
c0f0: 66 6c 61 67 73 20 63 6f 6e 74 61 69 6e 73 20 24  flags contains $
c100: 28 63 66 6c 61 67 73 29 20 70 6c 75 73 20 66 6c  (cflags) plus fl
c110: 61 67 73 20 75 73 65 64 20 66 6f 72 20 62 75 69  ags used for bui
c120: 6c 64 69 6e 67 20 61 20 73 74 75 62 73 0a 23 20  lding a stubs.# 
c130: 6c 69 62 72 61 72 79 20 66 6f 72 20 74 68 65 20  library for the 
c140: 70 61 63 6b 61 67 65 2e 20 20 4e 6f 74 65 3a 20  package.  Note: 
c150: 2f 44 53 54 41 54 49 43 5f 42 55 49 4c 44 20 69  /DSTATIC_BUILD i
c160: 73 20 64 65 66 69 6e 65 64 20 69 6e 0a 23 20 24  s defined in.# $
c170: 28 4f 50 54 44 45 46 49 4e 45 53 29 20 6f 6e 6c  (OPTDEFINES) onl
c180: 79 20 69 66 20 74 68 65 20 4f 50 54 53 20 63 6f  y if the OPTS co
c190: 6e 66 69 67 75 72 61 74 69 6f 6e 20 69 6e 64 69  nfiguration indi
c1a0: 63 61 74 65 73 20 61 20 73 74 61 74 69 63 0a 23  cates a static.#
c1b0: 20 6c 69 62 72 61 72 79 2e 20 48 6f 77 65 76 65   library. Howeve
c1c0: 72 20 74 68 65 20 73 74 75 62 73 20 6c 69 62 72  r the stubs libr
c1d0: 61 72 79 20 69 73 20 41 4c 57 41 59 53 20 73 74  ary is ALWAYS st
c1e0: 61 74 69 63 20 68 65 6e 63 65 20 69 6e 63 6c 75  atic hence inclu
c1f0: 64 65 64 0a 23 20 68 65 72 65 20 69 72 72 65 73  ded.# here irres
c200: 70 65 63 74 69 76 65 20 6f 66 20 74 68 65 20 4f  pective of the O
c210: 50 54 53 20 73 65 74 74 69 6e 67 2e 0a 23 0a 23  PTS setting..#.#
c220: 20 54 42 44 20 2d 20 74 63 6c 76 66 73 20 68 61   TBD - tclvfs ha
c230: 73 20 61 20 63 6f 6d 6d 65 6e 74 20 74 68 61 74  s a comment that
c240: 20 73 74 75 62 73 20 6c 69 62 73 20 73 68 6f 75   stubs libs shou
c250: 6c 64 20 6e 6f 74 20 62 65 20 63 6f 6d 70 69 6c  ld not be compil
c260: 65 64 20 77 69 74 68 20 2d 47 4c 0a 23 20 77 69  ed with -GL.# wi
c270: 74 68 6f 75 74 20 73 74 61 74 69 6e 67 20 77 68  thout stating wh
c280: 79 2e 20 54 63 6c 20 69 74 73 65 6c 66 20 63 6f  y. Tcl itself co
c290: 6d 70 69 6c 65 64 20 73 74 75 62 73 20 6c 69 62  mpiled stubs lib
c2a0: 73 20 77 69 74 68 20 74 68 69 73 20 66 6c 61 67  s with this flag
c2b0: 2e 0a 23 20 73 6f 20 77 65 20 64 6f 20 6e 6f 74  ..# so we do not
c2c0: 20 72 65 6d 6f 76 65 20 69 74 20 66 72 6f 6d 20   remove it from 
c2d0: 63 66 6c 61 67 73 2e 20 2d 47 4c 20 6d 61 79 20  cflags. -GL may 
c2e0: 70 72 65 76 65 6e 74 20 65 78 74 65 6e 73 69 6f  prevent extensio
c2f0: 6e 73 0a 23 20 63 6f 6d 70 69 6c 65 64 20 77 69  ns.# compiled wi
c300: 74 68 20 6f 6e 65 20 56 43 20 76 65 72 73 69 6f  th one VC versio
c310: 6e 20 74 6f 20 66 61 69 6c 20 74 6f 20 6c 69 6e  n to fail to lin
c320: 6b 20 61 67 61 69 6e 73 74 20 73 74 75 62 73 20  k against stubs 
c330: 6c 69 62 72 61 72 79 0a 23 20 63 6f 6d 70 69 6c  library.# compil
c340: 65 64 20 77 69 74 68 20 61 6e 6f 74 68 65 72 20  ed with another 
c350: 56 43 20 76 65 72 73 69 6f 6e 2e 20 43 68 65 63  VC version. Chec
c360: 6b 20 66 6f 72 20 74 68 69 73 20 61 6e 64 20 66  k for this and f
c370: 69 78 20 61 63 63 6f 72 64 69 6e 67 6c 79 2e 0a  ix accordingly..
c380: 73 74 75 62 73 63 66 6c 61 67 73 20 3d 20 24 28  stubscflags = $(
c390: 63 66 6c 61 67 73 29 20 24 28 50 4b 47 4e 41 4d  cflags) $(PKGNAM
c3a0: 45 46 4c 41 47 53 29 20 24 28 50 52 4a 5f 44 45  EFLAGS) $(PRJ_DE
c3b0: 46 49 4e 45 53 29 20 24 28 4f 50 54 44 45 46 49  FINES) $(OPTDEFI
c3c0: 4e 45 53 29 20 2f 5a 6c 20 2f 47 4c 2d 20 2f 44  NES) /Zl /GL- /D
c3d0: 53 54 41 54 49 43 5f 42 55 49 4c 44 20 24 28 49  STATIC_BUILD $(I
c3e0: 4e 43 4c 55 44 45 53 29 20 24 28 55 53 45 5f 53  NCLUDES) $(USE_S
c3f0: 54 55 42 53 5f 44 45 46 53 29 0a 0a 23 20 4c 69  TUBS_DEFS)..# Li
c400: 6e 6b 20 66 6c 61 67 73 0a 0a 21 69 66 20 24 28  nk flags..!if $(
c410: 44 45 42 55 47 29 0a 6c 64 65 62 75 67 09 3d 20  DEBUG).ldebug.= 
c420: 2d 64 65 62 75 67 20 2d 64 65 62 75 67 74 79 70  -debug -debugtyp
c430: 65 3a 63 76 0a 21 65 6c 73 65 0a 6c 64 65 62 75  e:cv.!else.ldebu
c440: 67 09 3d 20 2d 72 65 6c 65 61 73 65 20 2d 6f 70  g.= -release -op
c450: 74 3a 72 65 66 20 2d 6f 70 74 3a 69 63 66 2c 33  t:ref -opt:icf,3
c460: 0a 21 69 66 20 24 28 53 59 4d 42 4f 4c 53 29 0a  .!if $(SYMBOLS).
c470: 6c 64 65 62 75 67 09 3d 20 24 28 6c 64 65 62 75  ldebug.= $(ldebu
c480: 67 29 20 2d 64 65 62 75 67 20 2d 64 65 62 75 67  g) -debug -debug
c490: 74 79 70 65 3a 63 76 0a 21 65 6e 64 69 66 0a 21  type:cv.!endif.!
c4a0: 65 6e 64 69 66 0a 0a 23 20 4e 6f 74 65 3a 20 50  endif..# Note: P
c4b0: 72 6f 66 69 6c 69 6e 67 20 69 73 20 63 75 72 72  rofiling is curr
c4c0: 65 6e 74 6c 79 20 6f 6e 6c 79 20 70 6f 73 73 69  ently only possi
c4d0: 62 6c 65 20 77 69 74 68 20 74 68 65 20 56 69 73  ble with the Vis
c4e0: 75 61 6c 20 53 74 75 64 69 6f 20 45 6e 74 65 72  ual Studio Enter
c4f0: 70 72 69 73 65 0a 21 69 66 20 24 28 50 52 4f 46  prise.!if $(PROF
c500: 49 4c 45 29 0a 6c 64 65 62 75 67 3d 20 24 28 6c  ILE).ldebug= $(l
c510: 64 65 62 75 67 29 20 2d 70 72 6f 66 69 6c 65 0a  debug) -profile.
c520: 21 65 6e 64 69 66 0a 0a 23 23 23 20 44 65 63 6c  !endif..### Decl
c530: 61 72 61 74 69 6f 6e 73 20 63 6f 6d 6d 6f 6e 20  arations common 
c540: 74 6f 20 61 6c 6c 20 6c 69 6e 6b 65 72 20 76 65  to all linker ve
c550: 72 73 69 6f 6e 73 0a 6c 66 6c 61 67 73 09 3d 20  rsions.lflags.= 
c560: 2d 6e 6f 6c 6f 67 6f 20 2d 6d 61 63 68 69 6e 65  -nologo -machine
c570: 3a 24 28 4d 41 43 48 49 4e 45 29 20 24 28 4c 49  :$(MACHINE) $(LI
c580: 4e 4b 45 52 46 4c 41 47 53 29 20 24 28 6c 64 65  NKERFLAGS) $(lde
c590: 62 75 67 29 0a 0a 21 69 66 20 24 28 4d 53 56 43  bug)..!if $(MSVC
c5a0: 52 54 29 20 26 26 20 21 28 24 28 44 45 42 55 47  RT) && !($(DEBUG
c5b0: 29 20 26 26 20 21 24 28 55 4e 43 48 45 43 4b 45  ) && !$(UNCHECKE
c5c0: 44 29 29 20 26 26 20 24 28 56 43 56 45 52 53 49  D)) && $(VCVERSI
c5d0: 4f 4e 29 20 3e 3d 20 31 39 30 30 0a 6c 66 6c 61  ON) >= 1900.lfla
c5e0: 67 73 09 3d 20 24 28 6c 66 6c 61 67 73 29 20 2d  gs.= $(lflags) -
c5f0: 6e 6f 64 65 66 61 75 6c 74 6c 69 62 3a 75 63 72  nodefaultlib:ucr
c600: 74 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 0a 64 6c  t.lib.!endif..dl
c610: 6c 6c 66 6c 61 67 73 20 3d 20 24 28 6c 66 6c 61  llflags = $(lfla
c620: 67 73 29 20 2d 64 6c 6c 0a 63 6f 6e 6c 66 6c 61  gs) -dll.conlfla
c630: 67 73 20 3d 20 24 28 6c 66 6c 61 67 73 29 20 2d  gs = $(lflags) -
c640: 73 75 62 73 79 73 74 65 6d 3a 63 6f 6e 73 6f 6c  subsystem:consol
c650: 65 0a 67 75 69 6c 66 6c 61 67 73 20 3d 20 24 28  e.guilflags = $(
c660: 6c 66 6c 61 67 73 29 20 2d 73 75 62 73 79 73 74  lflags) -subsyst
c670: 65 6d 3a 77 69 6e 64 6f 77 73 0a 0a 23 20 4c 69  em:windows..# Li
c680: 62 72 61 72 69 65 73 20 74 68 61 74 20 61 72 65  braries that are
c690: 20 72 65 71 75 69 72 65 64 20 66 6f 72 20 65 76   required for ev
c6a0: 65 72 79 20 69 6d 61 67 65 2e 0a 23 20 45 78 74  ery image..# Ext
c6b0: 65 6e 73 69 6f 6e 73 20 73 68 6f 75 6c 64 20 64  ensions should d
c6c0: 65 66 69 6e 65 20 61 6e 79 20 61 64 64 69 74 69  efine any additi
c6d0: 6f 6e 61 6c 20 6c 69 62 72 61 72 69 65 73 20 77  onal libraries w
c6e0: 69 74 68 20 24 28 50 52 4a 5f 4c 49 42 53 29 0a  ith $(PRJ_LIBS).
c6f0: 77 69 6e 6c 69 62 73 20 20 20 3d 20 6b 65 72 6e  winlibs   = kern
c700: 65 6c 33 32 2e 6c 69 62 20 61 64 76 61 70 69 33  el32.lib advapi3
c710: 32 2e 6c 69 62 0a 0a 21 69 66 20 24 28 4e 45 45  2.lib..!if $(NEE
c720: 44 5f 54 4b 29 0a 77 69 6e 6c 69 62 73 20 3d 20  D_TK).winlibs = 
c730: 24 28 77 69 6e 6c 69 62 73 29 20 67 64 69 33 32  $(winlibs) gdi32
c740: 2e 6c 69 62 20 75 73 65 72 33 32 2e 6c 69 62 20  .lib user32.lib 
c750: 75 78 74 68 65 6d 65 2e 6c 69 62 0a 21 65 6e 64  uxtheme.lib.!end
c760: 69 66 0a 0a 23 20 41 76 6f 69 64 20 27 75 6e 72  if..# Avoid 'unr
c770: 65 73 6f 6c 76 65 64 20 65 78 74 65 72 6e 61 6c  esolved external
c780: 20 73 79 6d 62 6f 6c 20 5f 5f 73 65 63 75 72 69   symbol __securi
c790: 74 79 5f 63 6f 6f 6b 69 65 27 20 65 72 72 6f 72  ty_cookie' error
c7a0: 73 2e 0a 23 20 63 2e 66 2e 20 68 74 74 70 3a 2f  s..# c.f. http:/
c7b0: 2f 73 75 70 70 6f 72 74 2e 6d 69 63 72 6f 73 6f  /support.microso
c7c0: 66 74 2e 63 6f 6d 2f 3f 69 64 3d 38 39 34 35 37  ft.com/?id=89457
c7d0: 33 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e 45  3.!if "$(MACHINE
c7e0: 29 22 20 3d 3d 20 22 41 4d 44 36 34 22 0a 21 69  )" == "AMD64".!i
c7f0: 66 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3e  f $(VCVERSION) >
c800: 20 31 33 39 39 20 26 26 20 24 28 56 43 56 45 52   1399 && $(VCVER
c810: 53 49 4f 4e 29 20 3c 20 31 35 30 30 0a 77 69 6e  SION) < 1500.win
c820: 6c 69 62 73 20 20 20 3d 20 24 28 77 69 6e 6c 69  libs   = $(winli
c830: 62 73 29 20 62 75 66 66 65 72 6f 76 65 72 66 6c  bs) bufferoverfl
c840: 6f 77 55 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 21  owU.lib.!endif.!
c850: 65 6e 64 69 66 0a 0a 62 61 73 65 6c 69 62 73 20  endif..baselibs 
c860: 3d 20 24 28 77 69 6e 6c 69 62 73 29 20 24 28 50  = $(winlibs) $(P
c870: 52 4a 5f 4c 49 42 53 29 0a 0a 21 69 66 20 24 28  RJ_LIBS)..!if $(
c880: 4d 53 56 43 52 54 29 20 26 26 20 21 28 24 28 44  MSVCRT) && !($(D
c890: 45 42 55 47 29 20 26 26 20 21 24 28 55 4e 43 48  EBUG) && !$(UNCH
c8a0: 45 43 4b 45 44 29 29 20 26 26 20 24 28 56 43 56  ECKED)) && $(VCV
c8b0: 45 52 53 49 4f 4e 29 20 3e 3d 20 31 39 30 30 0a  ERSION) >= 1900.
c8c0: 62 61 73 65 6c 69 62 73 20 20 20 3d 20 24 28 62  baselibs   = $(b
c8d0: 61 73 65 6c 69 62 73 29 20 75 63 72 74 2e 6c 69  aselibs) ucrt.li
c8e0: 62 0a 21 65 6e 64 69 66 0a 0a 23 23 23 23 23 23  b.!endif..######
c8f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c900: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c910: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c920: 23 23 23 23 23 23 23 23 23 23 0a 23 20 31 33 2e  ##########.# 13.
c930: 20 44 65 66 69 6e 65 20 73 74 61 6e 64 61 72 64   Define standard
c940: 20 63 6f 6d 6d 61 6e 64 73 2c 20 63 6f 6d 6d 6f   commands, commo
c950: 6e 20 6d 61 6b 65 20 74 61 72 67 65 74 73 20 61  n make targets a
c960: 6e 64 20 69 6d 70 6c 69 63 69 74 20 72 75 6c 65  nd implicit rule
c970: 73 0a 0a 43 43 50 4b 47 43 4d 44 20 3d 20 24 28  s..CCPKGCMD = $(
c980: 63 63 33 32 29 20 24 28 70 6b 67 63 66 6c 61 67  cc32) $(pkgcflag
c990: 73 29 20 2d 46 6f 24 28 54 4d 50 5f 44 49 52 29  s) -Fo$(TMP_DIR)
c9a0: 5e 5c 0a 43 43 41 50 50 43 4d 44 20 3d 20 24 28  ^\.CCAPPCMD = $(
c9b0: 63 63 33 32 29 20 24 28 61 70 70 63 66 6c 61 67  cc32) $(appcflag
c9c0: 73 29 20 2d 46 6f 24 28 54 4d 50 5f 44 49 52 29  s) -Fo$(TMP_DIR)
c9d0: 5e 5c 0a 43 43 53 54 55 42 53 43 4d 44 20 3d 20  ^\.CCSTUBSCMD = 
c9e0: 24 28 63 63 33 32 29 20 24 28 73 74 75 62 73 63  $(cc32) $(stubsc
c9f0: 66 6c 61 67 73 29 20 2d 46 6f 24 28 54 4d 50 5f  flags) -Fo$(TMP_
ca00: 44 49 52 29 5e 5c 0a 0a 4c 49 42 43 4d 44 20 3d  DIR)^\..LIBCMD =
ca10: 20 24 28 6c 69 62 33 32 29 20 2d 6e 6f 6c 6f 67   $(lib32) -nolog
ca20: 6f 20 24 28 4c 49 4e 4b 45 52 46 4c 41 47 53 29  o $(LINKERFLAGS)
ca30: 20 2d 6f 75 74 3a 24 40 0a 44 4c 4c 43 4d 44 20   -out:$@.DLLCMD 
ca40: 3d 20 24 28 6c 69 6e 6b 33 32 29 20 24 28 64 6c  = $(link32) $(dl
ca50: 6c 6c 66 6c 61 67 73 29 20 2d 6f 75 74 3a 24 40  llflags) -out:$@
ca60: 20 24 28 62 61 73 65 6c 69 62 73 29 20 24 28 74   $(baselibs) $(t
ca70: 63 6c 6c 69 62 73 29 20 24 28 74 6b 6c 69 62 73  cllibs) $(tklibs
ca80: 29 0a 0a 43 4f 4e 45 58 45 43 4d 44 20 3d 20 24  )..CONEXECMD = $
ca90: 28 6c 69 6e 6b 33 32 29 20 24 28 63 6f 6e 6c 66  (link32) $(conlf
caa0: 6c 61 67 73 29 20 2d 6f 75 74 3a 24 40 20 24 28  lags) -out:$@ $(
cab0: 62 61 73 65 6c 69 62 73 29 20 24 28 74 63 6c 6c  baselibs) $(tcll
cac0: 69 62 73 29 20 24 28 74 6b 6c 69 62 73 29 0a 47  ibs) $(tklibs).G
cad0: 55 49 45 58 45 43 4d 44 20 3d 20 24 28 6c 69 6e  UIEXECMD = $(lin
cae0: 6b 33 32 29 20 24 28 67 75 69 6c 66 6c 61 67 73  k32) $(guilflags
caf0: 29 20 2d 6f 75 74 3a 24 40 20 24 28 62 61 73 65  ) -out:$@ $(base
cb00: 6c 69 62 73 29 20 24 28 74 63 6c 6c 69 62 73 29  libs) $(tcllibs)
cb10: 20 24 28 74 6b 6c 69 62 73 29 0a 52 45 53 43 4d   $(tklibs).RESCM
cb20: 44 20 20 3d 20 24 28 72 63 33 32 29 20 2d 66 6f  D  = $(rc32) -fo
cb30: 20 24 40 20 2d 72 20 2d 69 20 22 24 28 47 45 4e   $@ -r -i "$(GEN
cb40: 45 52 49 43 44 49 52 29 22 20 2d 69 20 22 24 28  ERICDIR)" -i "$(
cb50: 54 4d 50 5f 44 49 52 29 22 20 5c 0a 09 20 20 20  TMP_DIR)" \..   
cb60: 20 24 28 54 43 4c 5f 49 4e 43 4c 55 44 45 53 29   $(TCL_INCLUDES)
cb70: 20 2f 44 53 54 41 54 49 43 5f 42 55 49 4c 44 3d   /DSTATIC_BUILD=
cb80: 24 28 53 54 41 54 49 43 5f 42 55 49 4c 44 29 20  $(STATIC_BUILD) 
cb90: 5c 0a 09 20 20 20 20 2f 44 44 45 42 55 47 3d 24  \..    /DDEBUG=$
cba0: 28 44 45 42 55 47 29 20 2d 64 20 55 4e 43 48 45  (DEBUG) -d UNCHE
cbb0: 43 4b 45 44 3d 24 28 55 4e 43 48 45 43 4b 45 44  CKED=$(UNCHECKED
cbc0: 29 20 5c 0a 09 20 20 20 20 2f 44 43 4f 4d 4d 41  ) \..    /DCOMMA
cbd0: 56 45 52 53 49 4f 4e 3d 24 28 52 43 43 4f 4d 4d  VERSION=$(RCCOMM
cbe0: 41 56 45 52 53 49 4f 4e 29 20 5c 0a 09 20 20 20  AVERSION) \..   
cbf0: 20 2f 44 44 4f 54 56 45 52 53 49 4f 4e 3d 5c 22   /DDOTVERSION=\"
cc00: 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 5c 22 20  $(DOTVERSION)\" 
cc10: 5c 0a 09 20 20 20 20 2f 44 56 45 52 53 49 4f 4e  \..    /DVERSION
cc20: 3d 5c 22 24 28 56 45 52 53 49 4f 4e 29 5c 22 20  =\"$(VERSION)\" 
cc30: 5c 0a 09 20 20 20 20 2f 44 53 55 46 58 3d 5c 22  \..    /DSUFX=\"
cc40: 24 28 53 55 46 58 29 5c 22 20 5c 0a 09 20 20 20  $(SUFX)\" \..   
cc50: 20 2f 44 50 52 4f 4a 45 43 54 3d 5c 22 24 28 50   /DPROJECT=\"$(P
cc60: 52 4f 4a 45 43 54 29 5c 22 20 5c 0a 09 20 20 20  ROJECT)\" \..   
cc70: 20 2f 44 50 52 4a 4c 49 42 4e 41 4d 45 3d 5c 22   /DPRJLIBNAME=\"
cc80: 24 28 50 52 4a 4c 49 42 4e 41 4d 45 29 5c 22 0a  $(PRJLIBNAME)\".
cc90: 0a 21 69 66 6e 64 65 66 20 44 45 46 41 55 4c 54  .!ifndef DEFAULT
cca0: 5f 42 55 49 4c 44 5f 54 41 52 47 45 54 0a 44 45  _BUILD_TARGET.DE
ccb0: 46 41 55 4c 54 5f 42 55 49 4c 44 5f 54 41 52 47  FAULT_BUILD_TARG
ccc0: 45 54 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 0a  ET = $(PROJECT).
ccd0: 21 65 6e 64 69 66 0a 0a 64 65 66 61 75 6c 74 2d  !endif..default-
cce0: 74 61 72 67 65 74 3a 20 24 28 44 45 46 41 55 4c  target: $(DEFAUL
ccf0: 54 5f 42 55 49 4c 44 5f 54 41 52 47 45 54 29 0a  T_BUILD_TARGET).
cd00: 0a 21 69 66 20 24 28 4d 55 4c 54 49 50 4c 41 54  .!if $(MULTIPLAT
cd10: 46 4f 52 4d 5f 49 4e 53 54 41 4c 4c 29 0a 64 65  FORM_INSTALL).de
cd20: 66 61 75 6c 74 2d 70 6b 67 69 6e 64 65 78 3a 0a  fault-pkgindex:.
cd30: 09 40 65 63 68 6f 20 69 66 20 7b 5b 70 61 63 6b  .@echo if {[pack
cd40: 61 67 65 20 76 73 61 74 69 73 66 69 65 73 20 5b  age vsatisfies [
cd50: 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20  package provide 
cd60: 54 63 6c 5d 20 39 2e 30 5d 7d 20 7b 20 3e 20 24  Tcl] 9.0]} { > $
cd70: 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64  (OUT_DIR)\pkgInd
cd80: 65 78 2e 74 63 6c 0a 09 40 65 63 68 6f 20 70 61  ex.tcl..@echo pa
cd90: 63 6b 61 67 65 20 69 66 6e 65 65 64 65 64 20 24  ckage ifneeded $
cda0: 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c  (PRJ_PACKAGE_TCL
cdb0: 4e 41 4d 45 29 20 24 28 44 4f 54 56 45 52 53 49  NAME) $(DOTVERSI
cdc0: 4f 4e 29 20 5c 0a 09 20 20 20 20 5b 6c 69 73 74  ON) \..    [list
cdd0: 20 6c 6f 61 64 20 5b 66 69 6c 65 20 6a 6f 69 6e   load [file join
cde0: 20 24 24 64 69 72 20 24 28 50 4c 41 54 46 4f 52   $$dir $(PLATFOR
cdf0: 4d 5f 49 44 45 4e 54 49 46 59 29 20 24 28 50 52  M_IDENTIFY) $(PR
ce00: 4a 4c 49 42 4e 41 4d 45 39 29 5d 5d 20 3e 3e 20  JLIBNAME9)]] >> 
ce10: 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e  $(OUT_DIR)\pkgIn
ce20: 64 65 78 2e 74 63 6c 0a 09 40 65 63 68 6f 20 7d  dex.tcl..@echo }
ce30: 20 65 6c 73 65 20 7b 20 3e 3e 20 24 28 4f 55 54   else { >> $(OUT
ce40: 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74  _DIR)\pkgIndex.t
ce50: 63 6c 0a 09 40 65 63 68 6f 20 70 61 63 6b 61 67  cl..@echo packag
ce60: 65 20 69 66 6e 65 65 64 65 64 20 24 28 50 52 4a  e ifneeded $(PRJ
ce70: 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45  _PACKAGE_TCLNAME
ce80: 29 20 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 20  ) $(DOTVERSION) 
ce90: 5c 0a 09 20 20 20 20 5b 6c 69 73 74 20 6c 6f 61  \..    [list loa
cea0: 64 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 24 64  d [file join $$d
ceb0: 69 72 20 24 28 50 4c 41 54 46 4f 52 4d 5f 49 44  ir $(PLATFORM_ID
cec0: 45 4e 54 49 46 59 29 20 24 28 50 52 4a 4c 49 42  ENTIFY) $(PRJLIB
ced0: 4e 41 4d 45 38 29 5d 5d 20 3e 3e 20 24 28 4f 55  NAME8)]] >> $(OU
cee0: 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e  T_DIR)\pkgIndex.
cef0: 74 63 6c 0a 09 40 65 63 68 6f 20 7d 20 3e 3e 20  tcl..@echo } >> 
cf00: 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e  $(OUT_DIR)\pkgIn
cf10: 64 65 78 2e 74 63 6c 0a 21 65 6c 73 65 0a 64 65  dex.tcl.!else.de
cf20: 66 61 75 6c 74 2d 70 6b 67 69 6e 64 65 78 3a 0a  fault-pkgindex:.
cf30: 09 40 65 63 68 6f 20 69 66 20 7b 5b 70 61 63 6b  .@echo if {[pack
cf40: 61 67 65 20 76 73 61 74 69 73 66 69 65 73 20 5b  age vsatisfies [
cf50: 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20  package provide 
cf60: 54 63 6c 5d 20 39 2e 30 5d 7d 20 7b 20 3e 20 24  Tcl] 9.0]} { > $
cf70: 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64  (OUT_DIR)\pkgInd
cf80: 65 78 2e 74 63 6c 0a 09 40 65 63 68 6f 20 70 61  ex.tcl..@echo pa
cf90: 63 6b 61 67 65 20 69 66 6e 65 65 64 65 64 20 24  ckage ifneeded $
cfa0: 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c  (PRJ_PACKAGE_TCL
cfb0: 4e 41 4d 45 29 20 24 28 44 4f 54 56 45 52 53 49  NAME) $(DOTVERSI
cfc0: 4f 4e 29 20 5c 0a 09 20 20 20 20 5b 6c 69 73 74  ON) \..    [list
cfd0: 20 6c 6f 61 64 20 5b 66 69 6c 65 20 6a 6f 69 6e   load [file join
cfe0: 20 24 24 64 69 72 20 24 28 50 52 4a 4c 49 42 4e   $$dir $(PRJLIBN
cff0: 41 4d 45 39 29 5d 5d 20 3e 3e 20 24 28 4f 55 54  AME9)]] >> $(OUT
d000: 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74  _DIR)\pkgIndex.t
d010: 63 6c 0a 09 40 65 63 68 6f 20 7d 20 65 6c 73 65  cl..@echo } else
d020: 20 7b 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52 29   { >> $(OUT_DIR)
d030: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 09 40  \pkgIndex.tcl..@
d040: 65 63 68 6f 20 70 61 63 6b 61 67 65 20 69 66 6e  echo package ifn
d050: 65 65 64 65 64 20 24 28 50 52 4a 5f 50 41 43 4b  eeded $(PRJ_PACK
d060: 41 47 45 5f 54 43 4c 4e 41 4d 45 29 20 24 28 44  AGE_TCLNAME) $(D
d070: 4f 54 56 45 52 53 49 4f 4e 29 20 5c 0a 09 20 20  OTVERSION) \..  
d080: 20 20 5b 6c 69 73 74 20 6c 6f 61 64 20 5b 66 69    [list load [fi
d090: 6c 65 20 6a 6f 69 6e 20 24 24 64 69 72 20 24 28  le join $$dir $(
d0a0: 50 52 4a 4c 49 42 4e 41 4d 45 38 29 5d 5d 20 3e  PRJLIBNAME8)]] >
d0b0: 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67  > $(OUT_DIR)\pkg
d0c0: 49 6e 64 65 78 2e 74 63 6c 0a 09 40 65 63 68 6f  Index.tcl..@echo
d0d0: 20 7d 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52 29   } >> $(OUT_DIR)
d0e0: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 21 65  \pkgIndex.tcl.!e
d0f0: 6e 64 69 66 0a 0a 64 65 66 61 75 6c 74 2d 70 6b  ndif..default-pk
d100: 67 69 6e 64 65 78 2d 74 65 61 3a 0a 09 40 69 66  gindex-tea:..@if
d110: 20 65 78 69 73 74 20 24 28 52 4f 4f 54 29 5c 70   exist $(ROOT)\p
d120: 6b 67 49 6e 64 65 78 2e 74 63 6c 2e 69 6e 20 6e  kgIndex.tcl.in n
d130: 6d 61 6b 65 68 6c 70 20 2d 73 20 3c 3c 20 24 28  makehlp -s << $(
d140: 52 4f 4f 54 29 5c 70 6b 67 49 6e 64 65 78 2e 74  ROOT)\pkgIndex.t
d150: 63 6c 2e 69 6e 20 3e 20 24 28 4f 55 54 5f 44 49  cl.in > $(OUT_DI
d160: 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a  R)\pkgIndex.tcl.
d170: 40 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e  @PACKAGE_VERSION
d180: 40 20 20 20 20 24 28 44 4f 54 56 45 52 53 49 4f  @    $(DOTVERSIO
d190: 4e 29 0a 40 50 41 43 4b 41 47 45 5f 4e 41 4d 45  N).@PACKAGE_NAME
d1a0: 40 20 20 20 20 20 20 20 24 28 50 52 4a 5f 50 41  @       $(PRJ_PA
d1b0: 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 0a 40  CKAGE_TCLNAME).@
d1c0: 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 40  PACKAGE_TCLNAME@
d1d0: 20 20 20 20 24 28 50 52 4a 5f 50 41 43 4b 41 47      $(PRJ_PACKAG
d1e0: 45 5f 54 43 4c 4e 41 4d 45 29 0a 40 50 4b 47 5f  E_TCLNAME).@PKG_
d1f0: 4c 49 42 5f 46 49 4c 45 40 20 20 20 20 20 20 20  LIB_FILE@       
d200: 24 28 50 52 4a 4c 49 42 4e 41 4d 45 29 0a 40 50  $(PRJLIBNAME).@P
d210: 4b 47 5f 4c 49 42 5f 46 49 4c 45 38 40 20 20 20  KG_LIB_FILE8@   
d220: 20 20 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 38     $(PRJLIBNAME8
d230: 29 0a 40 50 4b 47 5f 4c 49 42 5f 46 49 4c 45 39  ).@PKG_LIB_FILE9
d240: 40 20 20 20 20 20 20 24 28 50 52 4a 4c 49 42 4e  @      $(PRJLIBN
d250: 41 4d 45 39 29 0a 3c 3c 0a 0a 64 65 66 61 75 6c  AME9).<<..defaul
d260: 74 2d 69 6e 73 74 61 6c 6c 3a 20 64 65 66 61 75  t-install: defau
d270: 6c 74 2d 69 6e 73 74 61 6c 6c 2d 62 69 6e 61 72  lt-install-binar
d280: 69 65 73 20 64 65 66 61 75 6c 74 2d 69 6e 73 74  ies default-inst
d290: 61 6c 6c 2d 6c 69 62 72 61 72 69 65 73 0a 21 69  all-libraries.!i
d2a0: 66 20 24 28 53 59 4d 42 4f 4c 53 29 0a 64 65 66  f $(SYMBOLS).def
d2b0: 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 3a 20 64 65  ault-install: de
d2c0: 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 70 64  fault-install-pd
d2d0: 62 73 0a 21 65 6e 64 69 66 0a 0a 23 20 41 67 61  bs.!endif..# Aga
d2e0: 69 6e 20 74 6f 20 64 65 61 6c 20 77 69 74 68 20  in to deal with 
d2f0: 68 69 73 74 6f 72 69 63 61 6c 20 62 72 6f 6b 65  historical broke
d300: 6e 6e 65 73 73 2c 20 74 68 65 72 65 20 69 73 20  nness, there is 
d310: 73 6f 6d 65 20 63 6f 6e 66 75 73 69 6f 6e 0a 23  some confusion.#
d320: 20 69 6e 20 74 65 72 6d 69 6e 6c 6f 67 79 2e 20   in terminlogy. 
d330: 46 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20  For extensions, 
d340: 74 68 65 20 22 69 6e 73 74 61 6c 6c 2d 62 69 6e  the "install-bin
d350: 61 72 69 65 73 22 20 77 61 73 20 75 73 65 64 20  aries" was used 
d360: 74 6f 0a 23 20 6c 6f 63 61 74 65 20 74 61 72 67  to.# locate targ
d370: 65 74 20 64 69 72 65 63 74 6f 72 79 20 66 6f 72  et directory for
d380: 20 2a 62 69 6e 61 72 79 20 73 68 61 72 65 64 20   *binary shared 
d390: 6c 69 62 72 61 72 69 65 73 2a 20 61 6e 64 20 74  libraries* and t
d3a0: 68 75 73 0a 23 20 74 68 65 20 61 70 70 72 6f 70  hus.# the approp
d3b0: 72 69 61 74 65 20 6d 61 63 72 6f 20 69 73 20 4c  riate macro is L
d3c0: 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 73  IB_INSTALL_DIR s
d3d0: 69 6e 63 65 20 42 49 4e 5f 49 4e 53 54 41 4c 4c  ince BIN_INSTALL
d3e0: 5f 44 49 52 20 69 73 0a 23 20 66 6f 72 20 65 78  _DIR is.# for ex
d3f0: 65 63 75 74 61 62 6c 65 73 20 28 65 78 65 73 29  ecutables (exes)
d400: 2e 20 4f 6e 20 74 68 65 20 6f 74 68 65 72 20 68  . On the other h
d410: 61 6e 64 20 74 68 65 20 22 69 6e 73 74 61 6c 6c  and the "install
d420: 2d 6c 69 62 72 61 72 69 65 73 22 0a 23 20 74 61  -libraries".# ta
d430: 72 67 65 74 20 69 73 20 66 6f 72 20 2a 73 63 72  rget is for *scr
d440: 69 70 74 73 2a 20 61 6e 64 20 73 68 6f 75 6c 64  ipts* and should
d450: 20 68 61 76 65 20 62 65 65 6e 20 63 61 6c 6c 65   have been calle
d460: 64 20 22 69 6e 73 74 61 6c 6c 2d 73 63 72 69 70  d "install-scrip
d470: 74 73 22 2e 0a 64 65 66 61 75 6c 74 2d 69 6e 73  ts"..default-ins
d480: 74 61 6c 6c 2d 62 69 6e 61 72 69 65 73 3a 20 24  tall-binaries: $
d490: 28 50 52 4a 4c 49 42 29 0a 09 40 65 63 68 6f 20  (PRJLIB)..@echo 
d4a0: 49 6e 73 74 61 6c 6c 69 6e 67 20 62 69 6e 61 72  Installing binar
d4b0: 69 65 73 20 74 6f 20 27 24 28 4c 49 42 5f 49 4e  ies to '$(LIB_IN
d4c0: 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66  STALL_DIR)'..@if
d4d0: 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28 4c 49   not exist "$(LI
d4e0: 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20  B_INSTALL_DIR)" 
d4f0: 6d 6b 64 69 72 20 22 24 28 4c 49 42 5f 49 4e 53  mkdir "$(LIB_INS
d500: 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 24 28 43  TALL_DIR)"..@$(C
d510: 50 59 29 20 24 28 50 52 4a 4c 49 42 29 20 22 24  PY) $(PRJLIB) "$
d520: 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  (LIB_INSTALL_DIR
d530: 29 22 20 3e 4e 55 4c 0a 0a 23 20 41 6c 69 61 73  )" >NUL..# Alias
d540: 20 66 6f 72 20 64 65 66 61 75 6c 74 2d 69 6e 73   for default-ins
d550: 74 61 6c 6c 2d 73 63 72 69 70 74 73 0a 64 65 66  tall-scripts.def
d560: 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 6c 69 62  ault-install-lib
d570: 72 61 72 69 65 73 3a 20 64 65 66 61 75 6c 74 2d  raries: default-
d580: 69 6e 73 74 61 6c 6c 2d 73 63 72 69 70 74 73 0a  install-scripts.
d590: 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c  .default-install
d5a0: 2d 73 63 72 69 70 74 73 3a 20 24 28 4f 55 54 5f  -scripts: $(OUT_
d5b0: 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63  DIR)\pkgIndex.tc
d5c0: 6c 0a 09 40 65 63 68 6f 20 49 6e 73 74 61 6c 6c  l..@echo Install
d5d0: 69 6e 67 20 6c 69 62 72 61 72 69 65 73 20 74 6f  ing libraries to
d5e0: 20 27 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41   '$(SCRIPT_INSTA
d5f0: 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 20 6e 6f  LL_DIR)'..@if no
d600: 74 20 65 78 69 73 74 20 22 24 28 53 43 52 49 50  t exist "$(SCRIP
d610: 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20  T_INSTALL_DIR)" 
d620: 6d 6b 64 69 72 20 22 24 28 53 43 52 49 50 54 5f  mkdir "$(SCRIPT_
d630: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40  INSTALL_DIR)"..@
d640: 69 66 20 65 78 69 73 74 20 24 28 4c 49 42 44 49  if exist $(LIBDI
d650: 52 29 20 24 28 43 50 59 29 20 24 28 4c 49 42 44  R) $(CPY) $(LIBD
d660: 49 52 29 5c 2a 2e 74 63 6c 20 22 24 28 53 43 52  IR)\*.tcl "$(SCR
d670: 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29  IPT_INSTALL_DIR)
d680: 22 0a 09 40 65 63 68 6f 20 49 6e 73 74 61 6c 6c  "..@echo Install
d690: 69 6e 67 20 70 61 63 6b 61 67 65 20 69 6e 64 65  ing package inde
d6a0: 78 20 69 6e 20 27 24 28 53 43 52 49 50 54 5f 49  x in '$(SCRIPT_I
d6b0: 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 24  NSTALL_DIR)'..@$
d6c0: 28 43 50 59 29 20 24 28 4f 55 54 5f 44 49 52 29  (CPY) $(OUT_DIR)
d6d0: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 20 24 28  \pkgIndex.tcl $(
d6e0: 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44  SCRIPT_INSTALL_D
d6f0: 49 52 29 0a 0a 64 65 66 61 75 6c 74 2d 69 6e 73  IR)..default-ins
d700: 74 61 6c 6c 2d 73 74 75 62 73 3a 0a 09 40 65 63  tall-stubs:..@ec
d710: 68 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 20 73 74  ho Installing st
d720: 75 62 73 20 6c 69 62 72 61 72 79 20 74 6f 20 27  ubs library to '
d730: 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c  $(SCRIPT_INSTALL
d740: 5f 44 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20  _DIR)'..@if not 
d750: 65 78 69 73 74 20 22 24 28 53 43 52 49 50 54 5f  exist "$(SCRIPT_
d760: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b  INSTALL_DIR)" mk
d770: 64 69 72 20 22 24 28 53 43 52 49 50 54 5f 49 4e  dir "$(SCRIPT_IN
d780: 53 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 24 28  STALL_DIR)"..@$(
d790: 43 50 59 29 20 24 28 50 52 4a 53 54 55 42 4c 49  CPY) $(PRJSTUBLI
d7a0: 42 29 20 22 24 28 53 43 52 49 50 54 5f 49 4e 53  B) "$(SCRIPT_INS
d7b0: 54 41 4c 4c 5f 44 49 52 29 22 20 3e 4e 55 4c 0a  TALL_DIR)" >NUL.
d7c0: 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c  .default-install
d7d0: 2d 70 64 62 73 3a 0a 09 40 65 63 68 6f 20 49 6e  -pdbs:..@echo In
d7e0: 73 74 61 6c 6c 69 6e 67 20 50 44 42 73 20 74 6f  stalling PDBs to
d7f0: 20 27 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f   '$(LIB_INSTALL_
d800: 44 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20 65  DIR)'..@if not e
d810: 78 69 73 74 20 22 24 28 4c 49 42 5f 49 4e 53 54  xist "$(LIB_INST
d820: 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72 20  ALL_DIR)" mkdir 
d830: 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44  "$(LIB_INSTALL_D
d840: 49 52 29 22 0a 09 40 24 28 43 50 59 29 20 22 24  IR)"..@$(CPY) "$
d850: 28 4f 55 54 5f 44 49 52 29 5c 2a 2e 70 64 62 22  (OUT_DIR)\*.pdb"
d860: 20 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f   "$(LIB_INSTALL_
d870: 44 49 52 29 5c 22 0a 0a 23 20 22 65 6d 61 63 73  DIR)\"..# "emacs
d880: 20 66 6f 6e 74 2d 6c 6f 63 6b 20 68 69 67 68 6c   font-lock highl
d890: 69 67 68 74 69 6e 67 20 66 69 78 0a 0a 64 65 66  ighting fix..def
d8a0: 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 64 6f 63  ault-install-doc
d8b0: 73 2d 68 74 6d 6c 3a 0a 09 40 65 63 68 6f 20 49  s-html:..@echo I
d8c0: 6e 73 74 61 6c 6c 69 6e 67 20 64 6f 63 75 6d 65  nstalling docume
d8d0: 6e 74 61 74 69 6f 6e 20 66 69 6c 65 73 20 74 6f  ntation files to
d8e0: 20 27 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f   '$(DOC_INSTALL_
d8f0: 44 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20 65  DIR)'..@if not e
d900: 78 69 73 74 20 22 24 28 44 4f 43 5f 49 4e 53 54  xist "$(DOC_INST
d910: 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72 20  ALL_DIR)" mkdir 
d920: 22 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44  "$(DOC_INSTALL_D
d930: 49 52 29 22 0a 09 40 69 66 20 65 78 69 73 74 20  IR)"..@if exist 
d940: 24 28 44 4f 43 44 49 52 29 20 66 6f 72 20 25 66  $(DOCDIR) for %f
d950: 20 69 6e 20 28 22 24 28 44 4f 43 44 49 52 29 5c   in ("$(DOCDIR)\
d960: 2a 2e 68 74 6d 6c 22 20 22 24 28 44 4f 43 44 49  *.html" "$(DOCDI
d970: 52 29 5c 2a 2e 63 73 73 22 20 22 24 28 44 4f 43  R)\*.css" "$(DOC
d980: 44 49 52 29 5c 2a 2e 70 6e 67 22 29 20 64 6f 20  DIR)\*.png") do 
d990: 40 24 28 43 4f 50 59 29 20 25 66 20 22 24 28 44  @$(COPY) %f "$(D
d9a0: 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22  OC_INSTALL_DIR)"
d9b0: 0a 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c  ..default-instal
d9c0: 6c 2d 64 6f 63 73 2d 6e 3a 0a 09 40 65 63 68 6f  l-docs-n:..@echo
d9d0: 20 49 6e 73 74 61 6c 6c 69 6e 67 20 64 6f 63 75   Installing docu
d9e0: 6d 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65 73 20  mentation files 
d9f0: 74 6f 20 27 24 28 44 4f 43 5f 49 4e 53 54 41 4c  to '$(DOC_INSTAL
da00: 4c 5f 44 49 52 29 27 0a 09 40 69 66 20 6e 6f 74  L_DIR)'..@if not
da10: 20 65 78 69 73 74 20 22 24 28 44 4f 43 5f 49 4e   exist "$(DOC_IN
da20: 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69  STALL_DIR)" mkdi
da30: 72 20 22 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c  r "$(DOC_INSTALL
da40: 5f 44 49 52 29 22 0a 09 40 69 66 20 65 78 69 73  _DIR)"..@if exis
da50: 74 20 24 28 44 4f 43 44 49 52 29 20 66 6f 72 20  t $(DOCDIR) for 
da60: 25 66 20 69 6e 20 28 22 24 28 44 4f 43 44 49 52  %f in ("$(DOCDIR
da70: 29 5c 2a 2e 6e 22 29 20 64 6f 20 40 24 28 43 4f  )\*.n") do @$(CO
da80: 50 59 29 20 25 66 20 22 24 28 44 4f 43 5f 49 4e  PY) %f "$(DOC_IN
da90: 53 54 41 4c 4c 5f 44 49 52 29 22 0a 0a 64 65 66  STALL_DIR)"..def
daa0: 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 64 65 6d  ault-install-dem
dab0: 6f 73 3a 0a 09 40 65 63 68 6f 20 49 6e 73 74 61  os:..@echo Insta
dac0: 6c 6c 69 6e 67 20 64 65 6d 6f 73 20 74 6f 20 27  lling demos to '
dad0: 24 28 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44  $(DEMO_INSTALL_D
dae0: 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20 65 78  IR)'..@if not ex
daf0: 69 73 74 20 22 24 28 44 45 4d 4f 5f 49 4e 53 54  ist "$(DEMO_INST
db00: 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72 20  ALL_DIR)" mkdir 
db10: 22 24 28 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f  "$(DEMO_INSTALL_
db20: 44 49 52 29 22 0a 09 40 69 66 20 65 78 69 73 74  DIR)"..@if exist
db30: 20 24 28 44 45 4d 4f 44 49 52 29 20 24 28 43 50   $(DEMODIR) $(CP
db40: 59 44 49 52 29 20 22 24 28 44 45 4d 4f 44 49 52  YDIR) "$(DEMODIR
db50: 29 22 20 22 24 28 44 45 4d 4f 5f 49 4e 53 54 41  )" "$(DEMO_INSTA
db60: 4c 4c 5f 44 49 52 29 22 0a 0a 64 65 66 61 75 6c  LL_DIR)"..defaul
db70: 74 2d 63 6c 65 61 6e 3a 0a 09 40 65 63 68 6f 20  t-clean:..@echo 
db80: 43 6c 65 61 6e 69 6e 67 20 24 28 54 4d 50 5f 44  Cleaning $(TMP_D
db90: 49 52 29 5c 2a 20 2e 2e 2e 0a 09 40 69 66 20 65  IR)\* .....@if e
dba0: 78 69 73 74 20 24 28 54 4d 50 5f 44 49 52 29 5c  xist $(TMP_DIR)\
dbb0: 6e 75 6c 20 24 28 52 4d 44 49 52 29 20 24 28 54  nul $(RMDIR) $(T
dbc0: 4d 50 5f 44 49 52 29 0a 09 40 65 63 68 6f 20 43  MP_DIR)..@echo C
dbd0: 6c 65 61 6e 69 6e 67 20 24 28 57 49 4e 5f 44 49  leaning $(WIN_DI
dbe0: 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f 62 6a 2c  R)\nmakehlp.obj,
dbf0: 20 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 20 2e 2e   nmakehlp.exe ..
dc00: 2e 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 57  ...@if exist $(W
dc10: 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70  IN_DIR)\nmakehlp
dc20: 2e 6f 62 6a 20 64 65 6c 20 24 28 57 49 4e 5f 44  .obj del $(WIN_D
dc30: 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f 62 6a  IR)\nmakehlp.obj
dc40: 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 57 49  ..@if exist $(WI
dc50: 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e  N_DIR)\nmakehlp.
dc60: 65 78 65 20 64 65 6c 20 24 28 57 49 4e 5f 44 49  exe del $(WIN_DI
dc70: 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 0a  R)\nmakehlp.exe.
dc80: 09 40 69 66 20 65 78 69 73 74 20 24 28 57 49 4e  .@if exist $(WIN
dc90: 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f  _DIR)\nmakehlp.o
dca0: 75 74 20 64 65 6c 20 24 28 57 49 4e 5f 44 49 52  ut del $(WIN_DIR
dcb0: 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0a 09  )\nmakehlp.out..
dcc0: 40 65 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24  @echo Cleaning $
dcd0: 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 68 6c 70 2d  (WIN_DIR)\nmhlp-
dce0: 6f 75 74 2e 74 78 74 20 2e 2e 2e 0a 09 40 69 66  out.txt .....@if
dcf0: 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44 49 52   exist $(WIN_DIR
dd00: 29 5c 6e 6d 68 6c 70 2d 6f 75 74 2e 74 78 74 20  )\nmhlp-out.txt 
dd10: 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e  del $(WIN_DIR)\n
dd20: 6d 68 6c 70 2d 6f 75 74 2e 74 78 74 0a 09 40 65  mhlp-out.txt..@e
dd30: 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24 28 57  cho Cleaning $(W
dd40: 49 4e 5f 44 49 52 29 5c 5f 6a 75 6e 6b 2e 70 63  IN_DIR)\_junk.pc
dd50: 68 20 2e 2e 2e 0a 09 40 69 66 20 65 78 69 73 74  h .....@if exist
dd60: 20 24 28 57 49 4e 5f 44 49 52 29 5c 5f 6a 75 6e   $(WIN_DIR)\_jun
dd70: 6b 2e 70 63 68 20 64 65 6c 20 24 28 57 49 4e 5f  k.pch del $(WIN_
dd80: 44 49 52 29 5c 5f 6a 75 6e 6b 2e 70 63 68 0a 09  DIR)\_junk.pch..
dd90: 40 65 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24  @echo Cleaning $
dda0: 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 63 6c 2e  (WIN_DIR)\vercl.
ddb0: 78 2c 20 76 65 72 63 6c 2e 69 20 2e 2e 2e 0a 09  x, vercl.i .....
ddc0: 40 69 66 20 65 78 69 73 74 20 24 28 57 49 4e 5f  @if exist $(WIN_
ddd0: 44 49 52 29 5c 76 65 72 63 6c 2e 78 20 64 65 6c  DIR)\vercl.x del
dde0: 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 63   $(WIN_DIR)\verc
ddf0: 6c 2e 78 0a 09 40 69 66 20 65 78 69 73 74 20 24  l.x..@if exist $
de00: 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 63 6c 2e  (WIN_DIR)\vercl.
de10: 69 20 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29  i del $(WIN_DIR)
de20: 5c 76 65 72 63 6c 2e 69 0a 09 40 65 63 68 6f 20  \vercl.i..@echo 
de30: 43 6c 65 61 6e 69 6e 67 20 24 28 57 49 4e 5f 44  Cleaning $(WIN_D
de40: 49 52 29 5c 76 65 72 73 69 6f 6e 73 2e 76 63 2c  IR)\versions.vc,
de50: 20 76 65 72 73 69 6f 6e 2e 76 63 20 2e 2e 2e 0a   version.vc ....
de60: 09 40 69 66 20 65 78 69 73 74 20 24 28 57 49 4e  .@if exist $(WIN
de70: 5f 44 49 52 29 5c 76 65 72 73 69 6f 6e 73 2e 76  _DIR)\versions.v
de80: 63 20 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29  c del $(WIN_DIR)
de90: 5c 76 65 72 73 69 6f 6e 73 2e 76 63 0a 09 40 69  \versions.vc..@i
dea0: 66 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44 49  f exist $(WIN_DI
deb0: 52 29 5c 76 65 72 73 69 6f 6e 2e 76 63 20 64 65  R)\version.vc de
dec0: 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 72  l $(WIN_DIR)\ver
ded0: 73 69 6f 6e 2e 76 63 0a 0a 64 65 66 61 75 6c 74  sion.vc..default
dee0: 2d 68 6f 73 65 3a 20 64 65 66 61 75 6c 74 2d 63  -hose: default-c
def0: 6c 65 61 6e 0a 09 40 65 63 68 6f 20 48 6f 73 69  lean..@echo Hosi
df00: 6e 67 20 24 28 4f 55 54 5f 44 49 52 29 5c 2a 20  ng $(OUT_DIR)\* 
df10: 2e 2e 2e 0a 09 40 69 66 20 65 78 69 73 74 20 24  .....@if exist $
df20: 28 4f 55 54 5f 44 49 52 29 5c 6e 75 6c 20 24 28  (OUT_DIR)\nul $(
df30: 52 4d 44 49 52 29 20 24 28 4f 55 54 5f 44 49 52  RMDIR) $(OUT_DIR
df40: 29 0a 0a 23 20 4f 6e 6c 79 20 66 6f 72 20 62 61  )..# Only for ba
df50: 63 6b 77 61 72 64 20 63 6f 6d 70 61 74 69 62 69  ckward compatibi
df60: 6c 69 74 79 0a 64 65 66 61 75 6c 74 2d 64 69 73  lity.default-dis
df70: 74 63 6c 65 61 6e 3a 20 64 65 66 61 75 6c 74 2d  tclean: default-
df80: 68 6f 73 65 0a 0a 64 65 66 61 75 6c 74 2d 73 65  hose..default-se
df90: 74 75 70 3a 0a 09 40 69 66 20 6e 6f 74 20 65 78  tup:..@if not ex
dfa0: 69 73 74 20 24 28 4f 55 54 5f 44 49 52 29 5c 6e  ist $(OUT_DIR)\n
dfb0: 75 6c 20 6d 6b 64 69 72 20 24 28 4f 55 54 5f 44  ul mkdir $(OUT_D
dfc0: 49 52 29 0a 09 40 69 66 20 6e 6f 74 20 65 78 69  IR)..@if not exi
dfd0: 73 74 20 24 28 54 4d 50 5f 44 49 52 29 5c 6e 75  st $(TMP_DIR)\nu
dfe0: 6c 20 6d 6b 64 69 72 20 24 28 54 4d 50 5f 44 49  l mkdir $(TMP_DI
dff0: 52 29 0a 0a 21 69 66 20 22 24 28 54 45 53 54 50  R)..!if "$(TESTP
e000: 41 54 29 22 20 21 3d 20 22 22 0a 54 45 53 54 46  AT)" != "".TESTF
e010: 4c 41 47 53 20 3d 20 24 28 54 45 53 54 46 4c 41  LAGS = $(TESTFLA
e020: 47 53 29 20 2d 66 69 6c 65 20 24 28 54 45 53 54  GS) -file $(TEST
e030: 50 41 54 29 0a 21 65 6e 64 69 66 0a 0a 64 65 66  PAT).!endif..def
e040: 61 75 6c 74 2d 74 65 73 74 3a 20 64 65 66 61 75  ault-test: defau
e050: 6c 74 2d 73 65 74 75 70 20 24 28 50 52 4f 4a 45  lt-setup $(PROJE
e060: 43 54 29 0a 09 40 73 65 74 20 54 43 4c 4c 49 42  CT)..@set TCLLIB
e070: 50 41 54 48 3d 24 28 4f 55 54 5f 44 49 52 3a 5c  PATH=$(OUT_DIR:\
e080: 3d 2f 29 0a 09 40 69 66 20 65 78 69 73 74 20 24  =/)..@if exist $
e090: 28 4c 49 42 44 49 52 29 20 66 6f 72 20 25 66 20  (LIBDIR) for %f 
e0a0: 69 6e 20 28 22 24 28 4c 49 42 44 49 52 29 5c 2a  in ("$(LIBDIR)\*
e0b0: 2e 74 63 6c 22 29 20 64 6f 20 40 24 28 43 4f 50  .tcl") do @$(COP
e0c0: 59 29 20 25 66 20 22 24 28 4f 55 54 5f 44 49 52  Y) %f "$(OUT_DIR
e0d0: 29 22 0a 09 63 64 20 22 24 28 54 45 53 54 44 49  )"..cd "$(TESTDI
e0e0: 52 29 22 20 26 26 20 24 28 44 45 42 55 47 47 45  R)" && $(DEBUGGE
e0f0: 52 29 20 24 28 54 43 4c 53 48 29 20 61 6c 6c 2e  R) $(TCLSH) all.
e100: 74 63 6c 20 24 28 54 45 53 54 46 4c 41 47 53 29  tcl $(TESTFLAGS)
e110: 0a 0a 64 65 66 61 75 6c 74 2d 73 68 65 6c 6c 3a  ..default-shell:
e120: 20 64 65 66 61 75 6c 74 2d 73 65 74 75 70 20 24   default-setup $
e130: 28 50 52 4f 4a 45 43 54 29 0a 09 40 73 65 74 20  (PROJECT)..@set 
e140: 54 43 4c 4c 49 42 50 41 54 48 3d 24 28 4f 55 54  TCLLIBPATH=$(OUT
e150: 5f 44 49 52 3a 5c 3d 2f 29 0a 09 40 69 66 20 65  _DIR:\=/)..@if e
e160: 78 69 73 74 20 24 28 4c 49 42 44 49 52 29 20 66  xist $(LIBDIR) f
e170: 6f 72 20 25 66 20 69 6e 20 28 22 24 28 4c 49 42  or %f in ("$(LIB
e180: 44 49 52 29 5c 2a 2e 74 63 6c 22 29 20 64 6f 20  DIR)\*.tcl") do 
e190: 40 24 28 43 4f 50 59 29 20 25 66 20 22 24 28 4f  @$(COPY) %f "$(O
e1a0: 55 54 5f 44 49 52 29 22 0a 09 24 28 44 45 42 55  UT_DIR)"..$(DEBU
e1b0: 47 47 45 52 29 20 24 28 54 43 4c 53 48 29 0a 0a  GGER) $(TCLSH)..
e1c0: 23 20 47 65 6e 65 72 61 74 69 6f 6e 20 6f 66 20  # Generation of 
e1d0: 57 69 6e 64 6f 77 73 20 76 65 72 73 69 6f 6e 20  Windows version 
e1e0: 72 65 73 6f 75 72 63 65 0a 21 69 66 64 65 66 20  resource.!ifdef 
e1f0: 52 43 46 49 4c 45 0a 0a 23 20 4e 6f 74 65 3a 20  RCFILE..# Note: 
e200: 64 6f 6e 27 74 20 75 73 65 20 24 2a 2a 20 69 6e  don't use $** in
e210: 20 62 65 6c 6f 77 20 72 75 6c 65 20 62 65 63 61   below rule beca
e220: 75 73 65 20 74 68 65 72 65 20 6d 61 79 20 62 65  use there may be
e230: 20 6f 74 68 65 72 20 64 65 70 65 6e 64 65 6e 63   other dependenc
e240: 69 65 73 0a 23 20 61 6e 64 20 6f 6e 6c 79 20 74  ies.# and only t
e250: 68 65 20 22 6d 61 69 6e 22 20 72 63 20 6d 75 73  he "main" rc mus
e260: 74 20 62 65 20 70 61 73 73 65 64 20 74 6f 20 74  t be passed to t
e270: 68 65 20 72 65 73 6f 75 72 63 65 20 63 6f 6d 70  he resource comp
e280: 69 6c 65 72 0a 24 28 54 4d 50 5f 44 49 52 29 5c  iler.$(TMP_DIR)\
e290: 24 28 50 52 4f 4a 45 43 54 29 2e 72 65 73 3a 20  $(PROJECT).res: 
e2a0: 24 28 52 43 44 49 52 29 5c 24 28 50 52 4f 4a 45  $(RCDIR)\$(PROJE
e2b0: 43 54 29 2e 72 63 0a 09 24 28 52 45 53 43 4d 44  CT).rc..$(RESCMD
e2c0: 29 20 24 28 52 43 44 49 52 29 5c 24 28 50 52 4f  ) $(RCDIR)\$(PRO
e2d0: 4a 45 43 54 29 2e 72 63 0a 0a 21 65 6c 73 65 0a  JECT).rc..!else.
e2e0: 0a 23 20 49 66 20 70 61 72 65 6e 74 20 6d 61 6b  .# If parent mak
e2f0: 65 66 69 6c 65 20 68 61 73 20 6e 6f 74 20 64 65  efile has not de
e300: 66 69 6e 65 64 20 61 20 72 65 73 6f 75 72 63 65  fined a resource
e310: 20 64 65 66 69 6e 69 74 69 6f 6e 20 66 69 6c 65   definition file
e320: 2c 0a 23 20 77 65 20 77 69 6c 6c 20 67 65 6e 65  ,.# we will gene
e330: 72 61 74 65 20 6f 6e 65 20 66 72 6f 6d 20 73 74  rate one from st
e340: 61 6e 64 61 72 64 20 74 65 6d 70 6c 61 74 65 2e  andard template.
e350: 0a 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 50 52  .$(TMP_DIR)\$(PR
e360: 4f 4a 45 43 54 29 2e 72 65 73 3a 20 24 28 54 4d  OJECT).res: $(TM
e370: 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54  P_DIR)\$(PROJECT
e380: 29 2e 72 63 0a 0a 24 28 54 4d 50 5f 44 49 52 29  ).rc..$(TMP_DIR)
e390: 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 63 3a 0a  \$(PROJECT).rc:.
e3a0: 09 40 24 28 43 4f 50 59 29 20 3c 3c 20 24 28 54  .@$(COPY) << $(T
e3b0: 4d 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43  MP_DIR)\$(PROJEC
e3c0: 54 29 2e 72 63 0a 23 69 6e 63 6c 75 64 65 20 3c  T).rc.#include <
e3d0: 77 69 6e 76 65 72 2e 68 3e 0a 0a 56 53 5f 56 45  winver.h>..VS_VE
e3e0: 52 53 49 4f 4e 5f 49 4e 46 4f 20 56 45 52 53 49  RSION_INFO VERSI
e3f0: 4f 4e 49 4e 46 4f 0a 20 46 49 4c 45 56 45 52 53  ONINFO. FILEVERS
e400: 49 4f 4e 09 43 4f 4d 4d 41 56 45 52 53 49 4f 4e  ION.COMMAVERSION
e410: 0a 20 50 52 4f 44 55 43 54 56 45 52 53 49 4f 4e  . PRODUCTVERSION
e420: 09 43 4f 4d 4d 41 56 45 52 53 49 4f 4e 0a 20 46  .COMMAVERSION. F
e430: 49 4c 45 46 4c 41 47 53 4d 41 53 4b 09 30 78 33  ILEFLAGSMASK.0x3
e440: 66 4c 0a 23 69 66 64 65 66 20 44 45 42 55 47 0a  fL.#ifdef DEBUG.
e450: 20 46 49 4c 45 46 4c 41 47 53 09 56 53 5f 46 46   FILEFLAGS.VS_FF
e460: 5f 44 45 42 55 47 0a 23 65 6c 73 65 0a 20 46 49  _DEBUG.#else. FI
e470: 4c 45 46 4c 41 47 53 09 30 78 30 4c 0a 23 65 6e  LEFLAGS.0x0L.#en
e480: 64 69 66 0a 20 46 49 4c 45 4f 53 09 09 56 4f 53  dif. FILEOS..VOS
e490: 5f 4e 54 5f 57 49 4e 44 4f 57 53 33 32 0a 20 46  _NT_WINDOWS32. F
e4a0: 49 4c 45 54 59 50 45 09 56 46 54 5f 44 4c 4c 0a  ILETYPE.VFT_DLL.
e4b0: 20 46 49 4c 45 53 55 42 54 59 50 45 09 30 78 30   FILESUBTYPE.0x0
e4c0: 4c 0a 42 45 47 49 4e 0a 20 20 20 20 42 4c 4f 43  L.BEGIN.    BLOC
e4d0: 4b 20 22 53 74 72 69 6e 67 46 69 6c 65 49 6e 66  K "StringFileInf
e4e0: 6f 22 0a 20 20 20 20 42 45 47 49 4e 0a 09 42 4c  o".    BEGIN..BL
e4f0: 4f 43 4b 20 22 30 34 30 39 30 34 62 30 22 0a 09  OCK "040904b0"..
e500: 42 45 47 49 4e 0a 09 20 20 20 20 56 41 4c 55 45  BEGIN..    VALUE
e510: 20 22 46 69 6c 65 44 65 73 63 72 69 70 74 69 6f   "FileDescriptio
e520: 6e 22 2c 20 20 22 54 63 6c 20 65 78 74 65 6e 73  n",  "Tcl extens
e530: 69 6f 6e 20 22 20 50 52 4f 4a 45 43 54 0a 09 20  ion " PROJECT.. 
e540: 20 20 20 56 41 4c 55 45 20 22 4f 72 69 67 69 6e     VALUE "Origin
e550: 61 6c 46 69 6c 65 6e 61 6d 65 22 2c 20 50 52 4a  alFilename", PRJ
e560: 4c 49 42 4e 41 4d 45 0a 09 20 20 20 20 56 41 4c  LIBNAME..    VAL
e570: 55 45 20 22 46 69 6c 65 56 65 72 73 69 6f 6e 22  UE "FileVersion"
e580: 2c 20 20 20 20 20 20 44 4f 54 56 45 52 53 49 4f  ,      DOTVERSIO
e590: 4e 0a 09 20 20 20 20 56 41 4c 55 45 20 22 50 72  N..    VALUE "Pr
e5a0: 6f 64 75 63 74 4e 61 6d 65 22 2c 20 20 20 20 20  oductName",     
e5b0: 20 22 50 61 63 6b 61 67 65 20 22 20 50 52 4f 4a   "Package " PROJ
e5c0: 45 43 54 20 22 20 66 6f 72 20 54 63 6c 22 0a 09  ECT " for Tcl"..
e5d0: 20 20 20 20 56 41 4c 55 45 20 22 50 72 6f 64 75      VALUE "Produ
e5e0: 63 74 56 65 72 73 69 6f 6e 22 2c 20 20 20 44 4f  ctVersion",   DO
e5f0: 54 56 45 52 53 49 4f 4e 0a 09 45 4e 44 0a 20 20  TVERSION..END.  
e600: 20 20 45 4e 44 0a 20 20 20 20 42 4c 4f 43 4b 20    END.    BLOCK 
e610: 22 56 61 72 46 69 6c 65 49 6e 66 6f 22 0a 20 20  "VarFileInfo".  
e620: 20 20 42 45 47 49 4e 0a 09 56 41 4c 55 45 20 22    BEGIN..VALUE "
e630: 54 72 61 6e 73 6c 61 74 69 6f 6e 22 2c 20 30 78  Translation", 0x
e640: 34 30 39 2c 20 31 32 30 30 0a 20 20 20 20 45 4e  409, 1200.    EN
e650: 44 0a 45 4e 44 0a 0a 3c 3c 0a 0a 21 65 6e 64 69  D.END..<<..!endi
e660: 66 20 23 20 69 66 64 65 66 20 52 43 46 49 4c 45  f # ifdef RCFILE
e670: 0a 0a 21 69 66 6e 64 65 66 20 44 49 53 41 42 4c  ..!ifndef DISABL
e680: 45 5f 49 4d 50 4c 49 43 49 54 5f 52 55 4c 45 53  E_IMPLICIT_RULES
e690: 0a 44 49 53 41 42 4c 45 5f 49 4d 50 4c 49 43 49  .DISABLE_IMPLICI
e6a0: 54 5f 52 55 4c 45 53 20 3d 20 30 0a 21 65 6e 64  T_RULES = 0.!end
e6b0: 69 66 0a 0a 21 69 66 20 21 24 28 44 49 53 41 42  if..!if !$(DISAB
e6c0: 4c 45 5f 49 4d 50 4c 49 43 49 54 5f 52 55 4c 45  LE_IMPLICIT_RULE
e6d0: 53 29 0a 23 20 49 6d 70 6c 69 63 69 74 20 72 75  S).# Implicit ru
e6e0: 6c 65 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 2d  le definitions -
e6f0: 20 6f 6e 6c 79 20 66 6f 72 20 62 75 69 6c 64 69   only for buildi
e700: 6e 67 20 6c 69 62 72 61 72 79 20 6f 62 6a 65 63  ng library objec
e710: 74 73 2e 20 46 6f 72 20 73 74 75 62 73 20 61 6e  ts. For stubs an
e720: 64 0a 23 20 6d 61 69 6e 20 61 70 70 6c 69 63 61  d.# main applica
e730: 74 69 6f 6e 2c 20 74 68 65 20 6d 61 6b 65 66 69  tion, the makefi
e740: 6c 65 20 73 68 6f 75 6c 64 20 64 65 66 69 6e 65  le should define
e750: 20 65 78 70 6c 69 63 69 74 20 72 75 6c 65 73 2e   explicit rules.
e760: 0a 0a 7b 24 28 52 4f 4f 54 29 7d 2e 63 7b 24 28  ..{$(ROOT)}.c{$(
e770: 54 4d 50 5f 44 49 52 29 7d 2e 6f 62 6a 3a 3a 0a  TMP_DIR)}.obj::.
e780: 09 24 28 43 43 50 4b 47 43 4d 44 29 20 40 3c 3c  .$(CCPKGCMD) @<<
e790: 0a 24 3c 0a 3c 3c 0a 0a 7b 24 28 57 49 4e 5f 44  .$<.<<..{$(WIN_D
e7a0: 49 52 29 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52  IR)}.c{$(TMP_DIR
e7b0: 29 7d 2e 6f 62 6a 3a 3a 0a 09 24 28 43 43 50 4b  )}.obj::..$(CCPK
e7c0: 47 43 4d 44 29 20 40 3c 3c 0a 24 3c 0a 3c 3c 0a  GCMD) @<<.$<.<<.
e7d0: 0a 7b 24 28 47 45 4e 45 52 49 43 44 49 52 29 7d  .{$(GENERICDIR)}
e7e0: 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 6f  .c{$(TMP_DIR)}.o
e7f0: 62 6a 3a 3a 0a 09 24 28 43 43 50 4b 47 43 4d 44  bj::..$(CCPKGCMD
e800: 29 20 40 3c 3c 0a 24 3c 0a 3c 3c 0a 0a 7b 24 28  ) @<<.$<.<<..{$(
e810: 43 4f 4d 50 41 54 44 49 52 29 7d 2e 63 7b 24 28  COMPATDIR)}.c{$(
e820: 54 4d 50 5f 44 49 52 29 7d 2e 6f 62 6a 3a 3a 0a  TMP_DIR)}.obj::.
e830: 09 24 28 43 43 50 4b 47 43 4d 44 29 20 40 3c 3c  .$(CCPKGCMD) @<<
e840: 0a 24 3c 0a 3c 3c 0a 0a 7b 24 28 52 43 44 49 52  .$<.<<..{$(RCDIR
e850: 29 7d 2e 72 63 7b 24 28 54 4d 50 5f 44 49 52 29  )}.rc{$(TMP_DIR)
e860: 7d 2e 72 65 73 3a 0a 09 24 28 52 45 53 43 4d 44  }.res:..$(RESCMD
e870: 29 20 24 3c 0a 0a 7b 24 28 57 49 4e 5f 44 49 52  ) $<..{$(WIN_DIR
e880: 29 7d 2e 72 63 7b 24 28 54 4d 50 5f 44 49 52 29  )}.rc{$(TMP_DIR)
e890: 7d 2e 72 65 73 3a 0a 09 24 28 52 45 53 43 4d 44  }.res:..$(RESCMD
e8a0: 29 20 24 3c 0a 0a 7b 24 28 54 4d 50 5f 44 49 52  ) $<..{$(TMP_DIR
e8b0: 29 7d 2e 72 63 7b 24 28 54 4d 50 5f 44 49 52 29  )}.rc{$(TMP_DIR)
e8c0: 7d 2e 72 65 73 3a 0a 09 24 28 52 45 53 43 4d 44  }.res:..$(RESCMD
e8d0: 29 20 24 3c 0a 0a 2e 53 55 46 46 49 58 45 53 3a  ) $<...SUFFIXES:
e8e0: 0a 2e 53 55 46 46 49 58 45 53 3a 2e 63 20 2e 72  ..SUFFIXES:.c .r
e8f0: 63 0a 0a 21 65 6e 64 69 66 0a 0a 23 23 23 23 23  c..!endif..#####
e900: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e910: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e920: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e930: 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 31 34  ###########.# 14
e940: 2e 20 53 61 6e 69 74 79 20 63 68 65 63 6b 20 73  . Sanity check s
e950: 65 6c 65 63 74 65 64 20 6f 70 74 69 6f 6e 73 20  elected options 
e960: 61 67 61 69 6e 73 74 20 54 63 6c 20 62 75 69 6c  against Tcl buil
e970: 64 20 6f 70 74 69 6f 6e 73 0a 23 20 57 68 65 6e  d options.# When
e980: 20 62 75 69 6c 64 69 6e 67 20 61 6e 20 65 78 74   building an ext
e990: 65 6e 73 69 6f 6e 2c 20 63 65 72 74 61 69 6e 20  ension, certain 
e9a0: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 6f 70  configuration op
e9b0: 74 69 6f 6e 73 20 73 68 6f 75 6c 64 0a 23 20 6d  tions should.# m
e9c0: 61 74 63 68 20 74 68 65 20 6f 6e 65 73 20 75 73  atch the ones us
e9d0: 65 64 20 77 68 65 6e 20 54 63 6c 20 77 61 73 20  ed when Tcl was 
e9e0: 62 75 69 6c 74 2e 20 48 65 72 65 20 77 65 20 63  built. Here we c
e9f0: 68 65 63 6b 20 61 6e 64 0a 23 20 77 61 72 6e 20  heck and.# warn 
ea00: 6f 6e 20 61 20 6d 69 73 6d 61 74 63 68 2e 0a 21  on a mismatch..!
ea10: 69 66 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29  if !$(DOING_TCL)
ea20: 0a 0a 21 69 66 20 24 28 54 43 4c 49 4e 53 54 41  ..!if $(TCLINSTA
ea30: 4c 4c 29 20 23 20 42 75 69 6c 64 69 6e 67 20 61  LL) # Building a
ea40: 67 61 69 6e 73 74 20 61 6e 20 69 6e 73 74 61 6c  gainst an instal
ea50: 6c 65 64 20 54 63 6c 0a 21 69 66 20 65 78 69 73  led Tcl.!if exis
ea60: 74 28 22 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69  t("$(_TCLDIR)\li
ea70: 62 5c 6e 6d 61 6b 65 5c 74 63 6c 2e 6e 6d 61 6b  b\nmake\tcl.nmak
ea80: 65 22 29 0a 54 43 4c 4e 4d 41 4b 45 43 4f 4e 46  e").TCLNMAKECONF
ea90: 49 47 20 3d 20 22 24 28 5f 54 43 4c 44 49 52 29  IG = "$(_TCLDIR)
eaa0: 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 74 63 6c 2e 6e  \lib\nmake\tcl.n
eab0: 6d 61 6b 65 22 0a 21 65 6e 64 69 66 0a 21 65 6c  make".!endif.!el
eac0: 73 65 20 23 20 21 24 28 54 43 4c 49 4e 53 54 41  se # !$(TCLINSTA
ead0: 4c 4c 29 20 2d 20 62 75 69 6c 64 69 6e 67 20 61  LL) - building a
eae0: 67 61 69 6e 73 74 20 54 63 6c 20 73 6f 75 72 63  gainst Tcl sourc
eaf0: 65 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f  e.!if exist("$(_
eb00: 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  TCLDIR)\win\$(BU
eb10: 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 2e 6e  ILDDIRTOP)\tcl.n
eb20: 6d 61 6b 65 22 29 0a 54 43 4c 4e 4d 41 4b 45 43  make").TCLNMAKEC
eb30: 4f 4e 46 49 47 09 3d 20 22 24 28 5f 54 43 4c 44  ONFIG.= "$(_TCLD
eb40: 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44  IR)\win\$(BUILDD
eb50: 49 52 54 4f 50 29 5c 74 63 6c 2e 6e 6d 61 6b 65  IRTOP)\tcl.nmake
eb60: 22 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 20  ".!endif.!endif 
eb70: 23 20 54 43 4c 49 4e 53 54 41 4c 4c 0a 0a 21 69  # TCLINSTALL..!i
eb80: 66 20 24 28 43 4f 4e 46 49 47 5f 43 48 45 43 4b  f $(CONFIG_CHECK
eb90: 29 0a 21 69 66 64 65 66 20 54 43 4c 4e 4d 41 4b  ).!ifdef TCLNMAK
eba0: 45 43 4f 4e 46 49 47 0a 21 69 6e 63 6c 75 64 65  ECONFIG.!include
ebb0: 20 24 28 54 43 4c 4e 4d 41 4b 45 43 4f 4e 46 49   $(TCLNMAKECONFI
ebc0: 47 29 0a 0a 21 69 66 20 64 65 66 69 6e 65 64 28  G)..!if defined(
ebd0: 43 4f 52 45 5f 4d 41 43 48 49 4e 45 29 20 26 26  CORE_MACHINE) &&
ebe0: 20 22 24 28 43 4f 52 45 5f 4d 41 43 48 49 4e 45   "$(CORE_MACHINE
ebf0: 29 22 20 21 3d 20 22 24 28 4d 41 43 48 49 4e 45  )" != "$(MACHINE
ec00: 29 22 0a 21 65 72 72 6f 72 20 45 52 52 4f 52 3a  )".!error ERROR:
ec10: 20 42 75 69 6c 64 20 74 61 72 67 65 74 20 28 24   Build target ($
ec20: 28 4d 41 43 48 49 4e 45 29 29 20 64 6f 65 73 20  (MACHINE)) does 
ec30: 6e 6f 74 20 6d 61 74 63 68 20 74 68 65 20 54 63  not match the Tc
ec40: 6c 20 6c 69 62 72 61 72 79 20 61 72 63 68 69 74  l library archit
ec50: 65 63 74 75 72 65 20 28 24 28 43 4f 52 45 5f 4d  ecture ($(CORE_M
ec60: 41 43 48 49 4e 45 29 29 2e 0a 21 65 6e 64 69 66  ACHINE))..!endif
ec70: 0a 21 69 66 20 24 28 54 43 4c 5f 56 45 52 53 49  .!if $(TCL_VERSI
ec80: 4f 4e 29 20 3c 20 38 37 20 26 26 20 64 65 66 69  ON) < 87 && defi
ec90: 6e 65 64 28 43 4f 52 45 5f 55 53 45 5f 54 48 52  ned(CORE_USE_THR
eca0: 45 41 44 5f 41 4c 4c 4f 43 29 20 26 26 20 24 28  EAD_ALLOC) && $(
ecb0: 43 4f 52 45 5f 55 53 45 5f 54 48 52 45 41 44 5f  CORE_USE_THREAD_
ecc0: 41 4c 4c 4f 43 29 20 21 3d 20 24 28 55 53 45 5f  ALLOC) != $(USE_
ecd0: 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 0a 21 6d  THREAD_ALLOC).!m
ece0: 65 73 73 61 67 65 20 57 41 52 4e 49 4e 47 3a 20  essage WARNING: 
ecf0: 56 61 6c 75 65 20 6f 66 20 55 53 45 5f 54 48 52  Value of USE_THR
ed00: 45 41 44 5f 41 4c 4c 4f 43 20 28 24 28 55 53 45  EAD_ALLOC ($(USE
ed10: 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 29 20  _THREAD_ALLOC)) 
ed20: 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 69  does not match i
ed30: 74 73 20 54 63 6c 20 63 6f 72 65 20 76 61 6c 75  ts Tcl core valu
ed40: 65 20 28 24 28 43 4f 52 45 5f 55 53 45 5f 54 48  e ($(CORE_USE_TH
ed50: 52 45 41 44 5f 41 4c 4c 4f 43 29 29 2e 0a 21 65  READ_ALLOC))..!e
ed60: 6e 64 69 66 0a 21 69 66 20 64 65 66 69 6e 65 64  ndif.!if defined
ed70: 28 43 4f 52 45 5f 44 45 42 55 47 29 20 26 26 20  (CORE_DEBUG) && 
ed80: 24 28 43 4f 52 45 5f 44 45 42 55 47 29 20 21 3d  $(CORE_DEBUG) !=
ed90: 20 24 28 44 45 42 55 47 29 0a 21 6d 65 73 73 61   $(DEBUG).!messa
eda0: 67 65 20 57 41 52 4e 49 4e 47 3a 20 56 61 6c 75  ge WARNING: Valu
edb0: 65 20 6f 66 20 44 45 42 55 47 20 28 24 28 44 45  e of DEBUG ($(DE
edc0: 42 55 47 29 29 20 64 6f 65 73 20 6e 6f 74 20 6d  BUG)) does not m
edd0: 61 74 63 68 20 69 74 73 20 54 63 6c 20 6c 69 62  atch its Tcl lib
ede0: 72 61 72 79 20 63 6f 6e 66 69 67 75 72 61 74 69  rary configurati
edf0: 6f 6e 20 28 24 28 44 45 42 55 47 29 29 2e 0a 21  on ($(DEBUG))..!
ee00: 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a 21 65  endif.!endif..!e
ee10: 6e 64 69 66 20 23 20 54 43 4c 4e 4d 41 4b 45 43  ndif # TCLNMAKEC
ee20: 4f 4e 46 49 47 0a 0a 21 65 6e 64 69 66 20 23 20  ONFIG..!endif # 
ee30: 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0a 0a 0a  !$(DOING_TCL)...
ee40: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
ee50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ee60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ee70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 44 69  -----------.# Di
ee80: 73 70 6c 61 79 20 73 74 61 74 73 20 62 65 69 6e  splay stats bein
ee90: 67 20 75 73 65 64 2e 0a 23 2d 2d 2d 2d 2d 2d 2d  g used..#-------
eea0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
eeb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
eec0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
eed0: 2d 2d 2d 0a 0a 21 69 66 20 21 24 28 44 4f 49 4e  ---..!if !$(DOIN
eee0: 47 5f 54 43 4c 29 0a 21 6d 65 73 73 61 67 65 20  G_TCL).!message 
eef0: 2a 2a 2a 20 42 75 69 6c 64 69 6e 67 20 61 67 61  *** Building aga
ef00: 69 6e 73 74 20 54 63 6c 20 61 74 20 27 24 28 5f  inst Tcl at '$(_
ef10: 54 43 4c 44 49 52 29 27 0a 21 65 6e 64 69 66 0a  TCLDIR)'.!endif.
ef20: 21 69 66 20 21 24 28 44 4f 49 4e 47 5f 54 4b 29  !if !$(DOING_TK)
ef30: 20 26 26 20 24 28 4e 45 45 44 5f 54 4b 29 0a 21   && $(NEED_TK).!
ef40: 6d 65 73 73 61 67 65 20 2a 2a 2a 20 42 75 69 6c  message *** Buil
ef50: 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54 6b 20  ding against Tk 
ef60: 61 74 20 27 24 28 5f 54 4b 44 49 52 29 27 0a 21  at '$(_TKDIR)'.!
ef70: 65 6e 64 69 66 0a 21 6d 65 73 73 61 67 65 20 2a  endif.!message *
ef80: 2a 2a 20 49 6e 74 65 72 6d 65 64 69 61 74 65 20  ** Intermediate 
ef90: 64 69 72 65 63 74 6f 72 79 20 77 69 6c 6c 20 62  directory will b
efa0: 65 20 27 24 28 54 4d 50 5f 44 49 52 29 27 0a 21  e '$(TMP_DIR)'.!
efb0: 6d 65 73 73 61 67 65 20 2a 2a 2a 20 4f 75 74 70  message *** Outp
efc0: 75 74 20 64 69 72 65 63 74 6f 72 79 20 77 69 6c  ut directory wil
efd0: 6c 20 62 65 20 27 24 28 4f 55 54 5f 44 49 52 29  l be '$(OUT_DIR)
efe0: 27 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 49  '.!message *** I
eff0: 6e 73 74 61 6c 6c 61 74 69 6f 6e 2c 20 69 66 20  nstallation, if 
f000: 73 65 6c 65 63 74 65 64 2c 20 77 69 6c 6c 20 62  selected, will b
f010: 65 20 69 6e 20 27 24 28 5f 49 4e 53 54 41 4c 4c  e in '$(_INSTALL
f020: 44 49 52 29 27 0a 21 6d 65 73 73 61 67 65 20 2a  DIR)'.!message *
f030: 2a 2a 20 53 75 66 66 69 78 20 66 6f 72 20 62 69  ** Suffix for bi
f040: 6e 61 72 69 65 73 20 77 69 6c 6c 20 62 65 20 27  naries will be '
f050: 24 28 53 55 46 58 29 27 0a 21 6d 65 73 73 61 67  $(SUFX)'.!messag
f060: 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 20 76  e *** Compiler v
f070: 65 72 73 69 6f 6e 20 24 28 56 43 56 45 52 29 2e  ersion $(VCVER).
f080: 20 54 61 72 67 65 74 20 24 28 4d 41 43 48 49 4e   Target $(MACHIN
f090: 45 29 2c 20 68 6f 73 74 20 24 28 4e 41 54 49 56  E), host $(NATIV
f0a0: 45 5f 41 52 43 48 29 2e 0a 0a 21 65 6e 64 69 66  E_ARCH)...!endif
f0b0: 20 23 20 69 66 64 65 66 20 5f 52 55 4c 45 53 5f   # ifdef _RULES_
f0c0: 56 43 0a                                         VC.