Hex Artifact Content

Artifact 79247ddfc94ee0255ff3d7c8b21a54b6eb6147182f1aafeb2f0bca9546fc7a23:


0000: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 2d  -------------- -
0040: 2a 2d 20 6d 61 6b 65 66 69 6c 65 20 2d 2a 2d 0a  *- makefile -*-.
0050: 23 20 72 75 6c 65 73 2e 76 63 20 2d 2d 0a 23 0a  # rules.vc --.#.
0060: 23 20 50 61 72 74 20 6f 66 20 74 68 65 20 6e 6d  # Part of the nm
0070: 61 6b 65 20 62 61 73 65 64 20 62 75 69 6c 64 20  ake based build 
0080: 73 79 73 74 65 6d 20 66 6f 72 20 54 63 6c 20 61  system for Tcl a
0090: 6e 64 20 69 74 73 20 65 78 74 65 6e 73 69 6f 6e  nd its extension
00a0: 73 2e 0a 23 20 54 68 69 73 20 66 69 6c 65 20 64  s..# This file d
00b0: 6f 65 73 20 61 6c 6c 20 74 68 65 20 68 61 72 64  oes all the hard
00c0: 20 77 6f 72 6b 20 69 6e 20 74 65 72 6d 73 20 6f   work in terms o
00d0: 66 20 70 61 72 73 69 6e 67 20 62 75 69 6c 64 20  f parsing build 
00e0: 6f 70 74 69 6f 6e 73 2c 0a 23 20 63 6f 6d 70 69  options,.# compi
00f0: 6c 65 72 20 73 77 69 74 63 68 65 73 2c 20 64 65  ler switches, de
0100: 66 69 6e 69 6e 67 20 63 6f 6d 6d 6f 6e 20 74 61  fining common ta
0110: 72 67 65 74 73 20 61 6e 64 20 6d 61 63 72 6f 73  rgets and macros
0120: 2e 20 54 68 65 20 54 63 6c 20 6d 61 6b 65 66 69  . The Tcl makefi
0130: 6c 65 0a 23 20 64 69 72 65 63 74 6c 79 20 69 6e  le.# directly in
0140: 63 6c 75 64 65 73 20 74 68 69 73 2e 20 45 78 74  cludes this. Ext
0150: 65 6e 73 69 6f 6e 73 20 69 6e 63 6c 75 64 65 20  ensions include 
0160: 69 74 20 76 69 61 20 22 72 75 6c 65 73 2d 65 78  it via "rules-ex
0170: 74 2e 76 63 22 2e 0a 23 0a 23 20 53 65 65 20 54  t.vc"..#.# See T
0180: 49 50 20 34 37 37 20 28 68 74 74 70 73 3a 2f 2f  IP 477 (https://
0190: 63 6f 72 65 2e 74 63 6c 2d 6c 61 6e 67 2e 6f 72  core.tcl-lang.or
01a0: 67 2f 74 69 70 73 2f 64 6f 63 2f 6d 61 69 6e 2f  g/tips/doc/main/
01b0: 74 69 70 2f 34 37 37 2e 6d 64 29 20 66 6f 72 0a  tip/477.md) for.
01c0: 23 20 64 65 74 61 69 6c 65 64 20 64 6f 63 75 6d  # detailed docum
01d0: 65 6e 74 61 74 69 6f 6e 2e 0a 23 0a 23 20 53 65  entation..#.# Se
01e0: 65 20 74 68 65 20 66 69 6c 65 20 22 6c 69 63 65  e the file "lice
01f0: 6e 73 65 2e 74 65 72 6d 73 22 20 66 6f 72 20 69  nse.terms" for i
0200: 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 75 73  nformation on us
0210: 61 67 65 20 61 6e 64 20 72 65 64 69 73 74 72 69  age and redistri
0220: 62 75 74 69 6f 6e 0a 23 20 6f 66 20 74 68 69 73  bution.# of this
0230: 20 66 69 6c 65 2c 20 61 6e 64 20 66 6f 72 20 61   file, and for a
0240: 20 44 49 53 43 4c 41 49 4d 45 52 20 4f 46 20 41   DISCLAIMER OF A
0250: 4c 4c 20 57 41 52 52 41 4e 54 49 45 53 2e 0a 23  LL WARRANTIES..#
0260: 0a 23 20 43 6f 70 79 72 69 67 68 74 20 28 63 29  .# Copyright (c)
0270: 20 32 30 30 31 2d 32 30 30 33 20 44 61 76 69 64   2001-2003 David
0280: 20 47 72 61 76 65 72 65 61 75 78 2e 0a 23 20 43   Gravereaux..# C
0290: 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 30  opyright (c) 200
02a0: 33 2d 32 30 30 38 20 50 61 74 72 69 63 6b 20 54  3-2008 Patrick T
02b0: 68 6f 79 74 73 0a 23 20 43 6f 70 79 72 69 67 68  hoyts.# Copyrigh
02c0: 74 20 28 63 29 20 32 30 31 37 20 20 20 20 20 20  t (c) 2017      
02d0: 41 73 68 6f 6b 20 50 2e 20 4e 61 64 6b 61 72 6e  Ashok P. Nadkarn
02e0: 69 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  i.#-------------
02f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0300: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0310: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0320: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0330: 2d 0a 0a 21 69 66 6e 64 65 66 20 5f 52 55 4c 45  -..!ifndef _RULE
0340: 53 5f 56 43 0a 5f 52 55 4c 45 53 5f 56 43 20 3d  S_VC._RULES_VC =
0350: 20 31 0a 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77   1..# The follow
0360: 69 6e 67 20 6d 61 63 72 6f 73 20 64 65 66 69 6e  ing macros defin
0370: 65 20 74 68 65 20 76 65 72 73 69 6f 6e 20 6f 66  e the version of
0380: 20 74 68 65 20 72 75 6c 65 73 2e 76 63 20 6e 6d   the rules.vc nm
0390: 61 6b 65 20 62 75 69 6c 64 20 73 79 73 74 65 6d  ake build system
03a0: 0a 23 20 46 6f 72 20 6d 6f 64 69 66 69 63 61 74  .# For modificat
03b0: 69 6f 6e 73 20 74 68 61 74 20 61 72 65 20 6e 6f  ions that are no
03c0: 74 20 62 61 63 6b 77 61 72 64 2d 63 6f 6d 70 61  t backward-compa
03d0: 74 69 62 6c 65 2c 20 79 6f 75 20 2a 6d 75 73 74  tible, you *must
03e0: 2a 20 63 68 61 6e 67 65 0a 23 20 74 68 65 20 6d  * change.# the m
03f0: 61 6a 6f 72 20 76 65 72 73 69 6f 6e 2e 0a 52 55  ajor version..RU
0400: 4c 45 53 5f 56 45 52 53 49 4f 4e 5f 4d 41 4a 4f  LES_VERSION_MAJO
0410: 52 20 3d 20 31 0a 52 55 4c 45 53 5f 56 45 52 53  R = 1.RULES_VERS
0420: 49 4f 4e 5f 4d 49 4e 4f 52 20 3d 20 31 31 0a 0a  ION_MINOR = 11..
0430: 23 20 54 68 65 20 50 52 4f 4a 45 43 54 20 6d 61  # The PROJECT ma
0440: 63 72 6f 20 6d 75 73 74 20 62 65 20 64 65 66 69  cro must be defi
0450: 6e 65 64 20 62 79 20 70 61 72 65 6e 74 20 6d 61  ned by parent ma
0460: 6b 65 66 69 6c 65 2e 0a 21 69 66 20 22 24 28 50  kefile..!if "$(P
0470: 52 4f 4a 45 43 54 29 22 20 3d 3d 20 22 22 0a 21  ROJECT)" == "".!
0480: 65 72 72 6f 72 20 2a 2a 2a 20 45 72 72 6f 72 3a  error *** Error:
0490: 20 4d 61 63 72 6f 20 50 52 4f 4a 45 43 54 20 6e   Macro PROJECT n
04a0: 6f 74 20 64 65 66 69 6e 65 64 21 20 50 6c 65 61  ot defined! Plea
04b0: 73 65 20 64 65 66 69 6e 65 20 69 74 20 62 65 66  se define it bef
04c0: 6f 72 65 20 69 6e 63 6c 75 64 69 6e 67 20 72 75  ore including ru
04d0: 6c 65 73 2e 76 63 0a 21 65 6e 64 69 66 0a 0a 21  les.vc.!endif..!
04e0: 69 66 20 22 24 28 50 52 4a 5f 50 41 43 4b 41 47  if "$(PRJ_PACKAG
04f0: 45 5f 54 43 4c 4e 41 4d 45 29 22 20 3d 3d 20 22  E_TCLNAME)" == "
0500: 22 0a 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43  ".PRJ_PACKAGE_TC
0510: 4c 4e 41 4d 45 20 3d 20 24 28 50 52 4f 4a 45 43  LNAME = $(PROJEC
0520: 54 29 0a 21 65 6e 64 69 66 0a 0a 23 20 41 6c 73  T).!endif..# Als
0530: 6f 20 73 70 65 63 69 61 6c 20 63 61 73 65 20 54  o special case T
0540: 63 6c 20 61 6e 64 20 54 6b 20 74 6f 20 73 61 76  cl and Tk to sav
0550: 65 20 73 6f 6d 65 20 74 79 70 69 6e 67 20 6c 61  e some typing la
0560: 74 65 72 0a 44 4f 49 4e 47 5f 54 43 4c 20 3d 20  ter.DOING_TCL = 
0570: 30 0a 44 4f 49 4e 47 5f 54 4b 20 20 3d 20 30 0a  0.DOING_TK  = 0.
0580: 21 69 66 20 22 24 28 50 52 4f 4a 45 43 54 29 22  !if "$(PROJECT)"
0590: 20 3d 3d 20 22 74 63 6c 22 0a 44 4f 49 4e 47 5f   == "tcl".DOING_
05a0: 54 43 4c 20 3d 20 31 0a 21 65 6c 73 65 69 66 20  TCL = 1.!elseif 
05b0: 22 24 28 50 52 4f 4a 45 43 54 29 22 20 3d 3d 20  "$(PROJECT)" == 
05c0: 22 74 6b 22 0a 44 4f 49 4e 47 5f 54 4b 20 3d 20  "tk".DOING_TK = 
05d0: 31 0a 21 65 6e 64 69 66 0a 0a 21 69 66 6e 64 65  1.!endif..!ifnde
05e0: 66 20 4e 45 45 44 5f 54 4b 0a 23 20 42 61 63 6b  f NEED_TK.# Back
05f0: 77 61 72 64 73 20 63 6f 6d 70 61 74 69 62 69 6c  wards compatibil
0600: 69 74 79 0a 21 69 66 64 65 66 20 50 52 4f 4a 45  ity.!ifdef PROJE
0610: 43 54 5f 52 45 51 55 49 52 45 53 5f 54 4b 0a 4e  CT_REQUIRES_TK.N
0620: 45 45 44 5f 54 4b 20 3d 20 24 28 50 52 4f 4a 45  EED_TK = $(PROJE
0630: 43 54 5f 52 45 51 55 49 52 45 53 5f 54 4b 29 0a  CT_REQUIRES_TK).
0640: 21 65 6c 73 65 0a 4e 45 45 44 5f 54 4b 20 3d 20  !else.NEED_TK = 
0650: 30 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  0.!endif.!endif.
0660: 0a 21 69 66 6e 64 65 66 20 4e 45 45 44 5f 54 43  .!ifndef NEED_TC
0670: 4c 5f 53 4f 55 52 43 45 0a 4e 45 45 44 5f 54 43  L_SOURCE.NEED_TC
0680: 4c 5f 53 4f 55 52 43 45 20 3d 20 30 0a 21 65 6e  L_SOURCE = 0.!en
0690: 64 69 66 0a 0a 21 69 66 64 65 66 20 4e 45 45 44  dif..!ifdef NEED
06a0: 5f 54 4b 5f 53 4f 55 52 43 45 0a 21 69 66 20 24  _TK_SOURCE.!if $
06b0: 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29  (NEED_TK_SOURCE)
06c0: 0a 4e 45 45 44 5f 54 4b 20 3d 20 31 0a 21 65 6e  .NEED_TK = 1.!en
06d0: 64 69 66 0a 21 65 6c 73 65 0a 4e 45 45 44 5f 54  dif.!else.NEED_T
06e0: 4b 5f 53 4f 55 52 43 45 20 3d 20 30 0a 21 65 6e  K_SOURCE = 0.!en
06f0: 64 69 66 0a 0a 23 23 23 23 23 23 23 23 23 23 23  dif..###########
0700: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
0710: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
0720: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
0730: 23 23 23 23 23 0a 23 20 4e 6d 61 6b 65 20 69 73  #####.# Nmake is
0740: 20 61 20 70 72 65 74 74 79 20 77 65 61 6b 20 65   a pretty weak e
0750: 6e 76 69 72 6f 6e 6d 65 6e 74 20 69 6e 20 73 79  nvironment in sy
0760: 6e 74 61 78 20 61 6e 64 20 63 61 70 61 62 69 6c  ntax and capabil
0770: 69 74 69 65 73 0a 23 20 73 6f 20 74 68 69 73 20  ities.# so this 
0780: 66 69 6c 65 20 69 73 20 6e 65 63 65 73 73 61 72  file is necessar
0790: 69 6c 79 20 76 65 72 62 6f 73 65 2e 20 49 74 27  ily verbose. It'
07a0: 73 20 62 72 6f 6b 65 6e 20 64 6f 77 6e 20 69 6e  s broken down in
07b0: 74 6f 0a 23 20 74 68 65 20 66 6f 6c 6c 6f 77 69  to.# the followi
07c0: 6e 67 20 70 61 72 74 73 2e 0a 23 0a 23 20 30 2e  ng parts..#.# 0.
07d0: 20 53 61 6e 69 74 79 20 63 68 65 63 6b 20 74 68   Sanity check th
07e0: 61 74 20 63 6f 6d 70 69 6c 65 72 20 65 6e 76 69  at compiler envi
07f0: 72 6f 6e 6d 65 6e 74 20 69 73 20 73 65 74 20 75  ronment is set u
0800: 70 20 61 6e 64 20 69 6e 69 74 69 61 6c 69 7a 65  p and initialize
0810: 0a 23 20 20 20 20 61 6e 79 20 62 75 69 6c 74 2d  .#    any built-
0820: 69 6e 20 73 65 74 74 69 6e 67 73 20 66 72 6f 6d  in settings from
0830: 20 74 68 65 20 70 61 72 65 6e 74 20 6d 61 6b 65   the parent make
0840: 66 69 6c 65 0a 23 20 31 2e 20 46 69 72 73 74 20  file.# 1. First 
0850: 64 65 66 69 6e 65 20 74 68 65 20 65 78 74 65 72  define the exter
0860: 6e 61 6c 20 74 6f 6f 6c 73 20 75 73 65 64 20 66  nal tools used f
0870: 6f 72 20 63 6f 6d 70 69 6c 69 6e 67 2c 20 63 6f  or compiling, co
0880: 70 79 69 6e 67 20 65 74 63 2e 0a 23 20 20 20 20  pying etc..#    
0890: 61 73 20 74 68 69 73 20 69 73 20 69 6e 64 65 70  as this is indep
08a0: 65 6e 64 65 6e 74 20 6f 66 20 65 76 65 72 79 74  endent of everyt
08b0: 68 69 6e 67 20 65 6c 73 65 2e 0a 23 20 32 2e 20  hing else..# 2. 
08c0: 46 69 67 75 72 65 20 6f 75 74 20 6f 75 72 20 62  Figure out our b
08d0: 75 69 6c 64 20 73 74 72 75 63 74 75 72 65 20 69  uild structure i
08e0: 6e 20 74 65 72 6d 73 20 6f 66 20 74 68 65 20 64  n terms of the d
08f0: 69 72 65 63 74 6f 72 79 2c 20 77 68 65 74 68 65  irectory, whethe
0900: 72 0a 23 20 20 20 20 77 65 20 61 72 65 20 62 75  r.#    we are bu
0910: 69 6c 64 69 6e 67 20 54 63 6c 20 6f 72 20 61 6e  ilding Tcl or an
0920: 20 65 78 74 65 6e 73 69 6f 6e 2c 20 65 74 63 2e   extension, etc.
0930: 0a 23 20 33 2e 20 44 65 74 65 72 6d 69 6e 65 20  .# 3. Determine 
0940: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64  the compiler and
0950: 20 6c 69 6e 6b 65 72 20 76 65 72 73 69 6f 6e 73   linker versions
0960: 0a 23 20 34 2e 20 42 75 69 6c 64 20 74 68 65 20  .# 4. Build the 
0970: 6e 6d 61 6b 65 68 6c 70 20 68 65 6c 70 65 72 20  nmakehlp helper 
0980: 61 70 70 6c 69 63 61 74 69 6f 6e 0a 23 20 35 2e  application.# 5.
0990: 20 44 65 74 65 72 6d 69 6e 65 20 74 68 65 20 73   Determine the s
09a0: 75 70 70 6f 72 74 65 64 20 63 6f 6d 70 69 6c 65  upported compile
09b0: 72 20 6f 70 74 69 6f 6e 73 20 61 6e 64 20 66 65  r options and fe
09c0: 61 74 75 72 65 73 0a 23 20 36 2e 20 50 61 72 73  atures.# 6. Pars
09d0: 65 20 74 68 65 20 4f 50 54 53 20 6d 61 63 72 6f  e the OPTS macro
09e0: 20 76 61 6c 75 65 20 66 6f 72 20 75 73 65 72 2d   value for user-
09f0: 73 70 65 63 69 66 69 65 64 20 62 75 69 6c 64 20  specified build 
0a00: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0a 23 20  configuration.# 
0a10: 37 2e 20 50 61 72 73 65 20 74 68 65 20 53 54 41  7. Parse the STA
0a20: 54 53 20 6d 61 63 72 6f 20 76 61 6c 75 65 20 66  TS macro value f
0a30: 6f 72 20 73 74 61 74 69 73 74 69 63 73 20 69 6e  or statistics in
0a40: 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0a 23 20  strumentation.# 
0a50: 38 2e 20 50 61 72 73 65 20 74 68 65 20 43 48 45  8. Parse the CHE
0a60: 43 4b 53 20 6d 61 63 72 6f 20 66 6f 72 20 61 64  CKS macro for ad
0a70: 64 69 74 69 6f 6e 61 6c 20 63 6f 6d 70 69 6c 61  ditional compila
0a80: 74 69 6f 6e 20 63 68 65 63 6b 73 0a 23 20 39 2e  tion checks.# 9.
0a90: 20 45 78 74 72 61 63 74 20 54 63 6c 2c 20 61 6e   Extract Tcl, an
0aa0: 64 20 70 6f 73 73 69 62 6c 79 20 54 6b 2c 20 76  d possibly Tk, v
0ab0: 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20 66  ersion numbers f
0ac0: 72 6f 6d 20 74 68 65 20 68 65 61 64 65 72 73 0a  rom the headers.
0ad0: 23 20 31 30 2e 20 42 61 73 65 64 20 6f 6e 20 74  # 10. Based on t
0ae0: 68 69 73 20 73 65 6c 65 63 74 65 64 20 63 6f 6e  his selected con
0af0: 66 69 67 75 72 61 74 69 6f 6e 2c 20 63 6f 6e 73  figuration, cons
0b00: 74 72 75 63 74 20 74 68 65 20 6f 75 74 70 75 74  truct the output
0b10: 0a 23 20 20 20 20 20 64 69 72 65 63 74 6f 72 79  .#     directory
0b20: 20 61 6e 64 20 66 69 6c 65 20 70 61 74 68 73 0a   and file paths.
0b30: 23 20 31 31 2e 20 43 6f 6e 73 74 72 75 63 74 20  # 11. Construct 
0b40: 74 68 65 20 70 61 74 68 73 20 77 68 65 72 65 20  the paths where 
0b50: 74 68 65 20 70 61 63 6b 61 67 65 20 69 73 20 74  the package is t
0b60: 6f 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23  o be installed.#
0b70: 20 31 32 2e 20 53 65 74 20 75 70 20 74 68 65 20   12. Set up the 
0b80: 61 63 74 75 61 6c 20 6f 70 74 69 6f 6e 73 20 70  actual options p
0b90: 61 73 73 65 64 20 74 6f 20 63 6f 6d 70 69 6c 65  assed to compile
0ba0: 72 20 61 6e 64 20 6c 69 6e 6b 65 72 20 62 61 73  r and linker bas
0bb0: 65 64 0a 23 20 20 20 20 20 6f 6e 20 74 68 65 20  ed.#     on the 
0bc0: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 67 61 74 68  information gath
0bd0: 65 72 65 64 20 61 62 6f 76 65 2e 0a 23 20 31 33  ered above..# 13
0be0: 2e 20 44 65 66 69 6e 65 20 73 6f 6d 65 20 73 74  . Define some st
0bf0: 61 6e 64 61 72 64 20 62 75 69 6c 64 20 74 61 72  andard build tar
0c00: 67 65 74 73 20 61 6e 64 20 69 6d 70 6c 69 63 69  gets and implici
0c10: 74 20 72 75 6c 65 73 2e 20 54 68 65 73 65 20 6d  t rules. These m
0c20: 61 79 0a 23 20 20 20 20 20 62 65 20 6f 70 74 69  ay.#     be opti
0c30: 6f 6e 61 6c 6c 79 20 64 69 73 61 62 6c 65 64 20  onally disabled 
0c40: 62 79 20 74 68 65 20 70 61 72 65 6e 74 20 6d 61  by the parent ma
0c50: 6b 65 66 69 6c 65 2e 0a 23 20 31 34 2e 20 28 46  kefile..# 14. (F
0c60: 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 20 6f 6e  or extensions on
0c70: 6c 79 2e 29 20 43 6f 6d 70 61 72 65 20 74 68 65  ly.) Compare the
0c80: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 6f   configuration o
0c90: 66 20 74 68 65 20 74 61 72 67 65 74 0a 23 20 20  f the target.#  
0ca0: 20 20 20 54 63 6c 20 61 6e 64 20 74 68 65 20 65     Tcl and the e
0cb0: 78 74 65 6e 73 69 6f 6e 73 20 61 6e 64 20 77 61  xtensions and wa
0cc0: 72 6e 20 61 67 61 69 6e 73 74 20 64 69 73 63 72  rn against discr
0cd0: 65 70 61 6e 63 69 65 73 2e 0a 23 0a 23 20 4f 6e  epancies..#.# On
0ce0: 65 20 66 69 6e 61 6c 20 6e 6f 74 65 20 61 62 6f  e final note abo
0cf0: 75 74 20 74 68 65 20 6d 61 63 72 6f 20 6e 61 6d  ut the macro nam
0d00: 65 73 20 75 73 65 64 2e 20 54 68 65 79 20 61 72  es used. They ar
0d10: 65 20 61 73 20 74 68 65 79 20 61 72 65 0a 23 20  e as they are.# 
0d20: 66 6f 72 20 68 69 73 74 6f 72 69 63 61 6c 20 72  for historical r
0d30: 65 61 73 6f 6e 73 2e 20 57 65 20 77 6f 75 6c 64  easons. We would
0d40: 20 6c 69 6b 65 20 6c 65 67 61 63 79 20 65 78 74   like legacy ext
0d50: 65 6e 73 69 6f 6e 73 20 74 6f 0a 23 20 63 6f 6e  ensions to.# con
0d60: 74 69 6e 75 65 20 74 6f 20 77 6f 72 6b 20 77 69  tinue to work wi
0d70: 74 68 20 74 68 69 73 20 6d 61 6b 65 20 69 6e 63  th this make inc
0d80: 6c 75 64 65 20 66 69 6c 65 20 73 6f 20 62 65 20  lude file so be 
0d90: 77 61 72 79 20 6f 66 0a 23 20 63 68 61 6e 67 69  wary of.# changi
0da0: 6e 67 20 74 68 65 6d 20 66 6f 72 20 63 6f 6e 73  ng them for cons
0db0: 69 73 74 65 6e 63 79 20 6f 72 20 63 6c 61 72 69  istency or clari
0dc0: 74 79 2e 0a 0a 23 20 30 2e 20 53 61 6e 69 74 79  ty...# 0. Sanity
0dd0: 20 63 68 65 63 6b 20 63 6f 6d 70 69 6c 65 72 20   check compiler 
0de0: 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a 0a 23 20 43  environment..# C
0df0: 68 65 63 6b 20 74 6f 20 73 65 65 20 77 65 20 61  heck to see we a
0e00: 72 65 20 63 6f 6e 66 69 67 75 72 65 64 20 74 6f  re configured to
0e10: 20 62 75 69 6c 64 20 77 69 74 68 20 4d 53 56 43   build with MSVC
0e20: 20 28 4d 53 44 45 56 44 49 52 2c 20 4d 53 56 43   (MSDEVDIR, MSVC
0e30: 44 49 52 20 6f 72 0a 23 20 56 43 49 4e 53 54 41  DIR or.# VCINSTA
0e40: 4c 4c 44 49 52 29 20 6f 72 20 77 69 74 68 20 74  LLDIR) or with t
0e50: 68 65 20 4d 53 20 50 6c 61 74 66 6f 72 6d 20 53  he MS Platform S
0e60: 44 4b 20 28 4d 53 53 44 4b 20 6f 72 20 57 69 6e  DK (MSSDK or Win
0e70: 64 6f 77 73 53 44 4b 44 69 72 29 0a 0a 21 69 66  dowsSDKDir)..!if
0e80: 20 21 64 65 66 69 6e 65 64 28 4d 53 44 45 56 44   !defined(MSDEVD
0e90: 49 52 29 20 26 26 20 21 64 65 66 69 6e 65 64 28  IR) && !defined(
0ea0: 4d 53 56 43 44 49 52 29 20 26 26 20 21 64 65 66  MSVCDIR) && !def
0eb0: 69 6e 65 64 28 56 43 49 4e 53 54 41 4c 4c 44 49  ined(VCINSTALLDI
0ec0: 52 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 4d  R) && !defined(M
0ed0: 53 53 44 4b 29 20 26 26 20 21 64 65 66 69 6e 65  SSDK) && !define
0ee0: 64 28 57 49 4e 44 4f 57 53 53 44 4b 44 49 52 29  d(WINDOWSSDKDIR)
0ef0: 0a 4d 53 47 20 3d 20 5e 0a 56 69 73 75 61 6c 20  .MSG = ^.Visual 
0f00: 43 2b 2b 20 63 6f 6d 70 69 6c 65 72 20 65 6e 76  C++ compiler env
0f10: 69 72 6f 6e 6d 65 6e 74 20 6e 6f 74 20 69 6e 69  ironment not ini
0f20: 74 69 61 6c 69 7a 65 64 2e 0a 21 65 72 72 6f 72  tialized..!error
0f30: 20 24 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a 0a   $(MSG).!endif..
0f40: 23 20 57 65 20 6e 65 65 64 20 74 6f 20 72 75 6e  # We need to run
0f50: 20 66 72 6f 6d 20 74 68 65 20 64 69 72 65 63 74   from the direct
0f60: 6f 72 79 20 74 68 65 20 70 61 72 65 6e 74 20 6d  ory the parent m
0f70: 61 6b 65 66 69 6c 65 20 69 73 20 6c 6f 63 61 74  akefile is locat
0f80: 65 64 20 69 6e 2e 0a 23 20 6e 6d 61 6b 65 20 64  ed in..# nmake d
0f90: 6f 65 73 20 6e 6f 74 20 74 65 6c 6c 20 75 73 20  oes not tell us 
0fa0: 77 68 61 74 20 6d 61 6b 65 66 69 6c 65 20 77 61  what makefile wa
0fb0: 73 20 75 73 65 64 20 74 6f 20 69 6e 76 6f 6b 65  s used to invoke
0fc0: 20 69 74 20 73 6f 20 70 61 72 65 6e 74 0a 23 20   it so parent.# 
0fd0: 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 74 6f 20  makefile has to 
0fe0: 73 65 74 20 74 68 65 20 4d 41 4b 45 46 49 4c 45  set the MAKEFILE
0ff0: 56 43 20 6d 61 63 72 6f 20 6f 72 20 77 65 20 6a  VC macro or we j
1000: 75 73 74 20 6d 61 6b 65 20 61 20 67 75 65 73 73  ust make a guess
1010: 20 61 6e 64 0a 23 20 77 61 72 6e 20 69 66 20 77   and.# warn if w
1020: 65 20 74 68 69 6e 6b 20 74 68 61 74 20 69 73 20  e think that is 
1030: 6e 6f 74 20 74 68 65 20 63 61 73 65 2e 0a 21 69  not the case..!i
1040: 66 20 22 24 28 4d 41 4b 45 46 49 4c 45 56 43 29  f "$(MAKEFILEVC)
1050: 22 20 3d 3d 20 22 22 0a 0a 21 69 66 20 65 78 69  " == ""..!if exi
1060: 73 74 28 22 24 28 50 52 4f 4a 45 43 54 29 2e 76  st("$(PROJECT).v
1070: 63 22 29 0a 4d 41 4b 45 46 49 4c 45 56 43 20 3d  c").MAKEFILEVC =
1080: 20 24 28 50 52 4f 4a 45 43 54 29 2e 76 63 0a 21   $(PROJECT).vc.!
1090: 65 6c 73 65 69 66 20 65 78 69 73 74 28 22 6d 61  elseif exist("ma
10a0: 6b 65 66 69 6c 65 2e 76 63 22 29 0a 4d 41 4b 45  kefile.vc").MAKE
10b0: 46 49 4c 45 56 43 20 3d 20 6d 61 6b 65 66 69 6c  FILEVC = makefil
10c0: 65 2e 76 63 0a 21 65 6e 64 69 66 0a 21 65 6e 64  e.vc.!endif.!end
10d0: 69 66 20 23 20 22 24 28 4d 41 4b 45 46 49 4c 45  if # "$(MAKEFILE
10e0: 56 43 29 22 20 3d 3d 20 22 22 0a 0a 21 69 66 20  VC)" == ""..!if 
10f0: 21 65 78 69 73 74 28 22 24 28 4d 41 4b 45 46 49  !exist("$(MAKEFI
1100: 4c 45 56 43 29 22 29 0a 4d 53 47 20 3d 20 5e 0a  LEVC)").MSG = ^.
1110: 59 6f 75 20 6d 75 73 74 20 72 75 6e 20 6e 6d 61  You must run nma
1120: 6b 65 20 66 72 6f 6d 20 74 68 65 20 64 69 72 65  ke from the dire
1130: 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67  ctory containing
1140: 20 74 68 65 20 70 72 6f 6a 65 63 74 20 6d 61 6b   the project mak
1150: 65 66 69 6c 65 2e 5e 0a 49 66 20 79 6f 75 20 61  efile.^.If you a
1160: 72 65 20 64 6f 69 6e 67 20 74 68 61 74 20 61 6e  re doing that an
1170: 64 20 67 65 74 74 69 6e 67 20 74 68 69 73 20 6d  d getting this m
1180: 65 73 73 61 67 65 2c 20 73 65 74 20 74 68 65 20  essage, set the 
1190: 4d 41 4b 45 46 49 4c 45 56 43 5e 0a 6d 61 63 72  MAKEFILEVC^.macr
11a0: 6f 20 74 6f 20 74 68 65 20 6e 61 6d 65 20 6f 66  o to the name of
11b0: 20 74 68 65 20 70 72 6f 6a 65 63 74 20 6d 61 6b   the project mak
11c0: 65 66 69 6c 65 2e 0a 21 6d 65 73 73 61 67 65 20  efile..!message 
11d0: 57 41 52 4e 49 4e 47 3a 20 24 28 4d 53 47 29 0a  WARNING: $(MSG).
11e0: 21 65 6e 64 69 66 0a 0a 0a 23 23 23 23 23 23 23  !endif...#######
11f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1200: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1210: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1220: 23 23 23 23 23 23 23 23 23 0a 23 20 31 2e 20 44  #########.# 1. D
1230: 65 66 69 6e 65 20 65 78 74 65 72 6e 61 6c 20 70  efine external p
1240: 72 6f 67 72 61 6d 73 20 62 65 69 6e 67 20 75 73  rograms being us
1250: 65 64 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ed..#-----------
1260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1280: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
1290: 23 20 53 65 74 20 74 68 65 20 70 72 6f 70 65 72  # Set the proper
12a0: 20 63 6f 70 79 20 6d 65 74 68 6f 64 20 74 6f 20   copy method to 
12b0: 61 76 6f 69 64 20 6f 76 65 72 77 72 69 74 65 20  avoid overwrite 
12c0: 71 75 65 73 74 69 6f 6e 73 0a 23 20 74 6f 20 74  questions.# to t
12d0: 68 65 20 75 73 65 72 20 77 68 65 6e 20 63 6f 70  he user when cop
12e0: 79 69 6e 67 20 66 69 6c 65 73 20 61 6e 64 20 73  ying files and s
12f0: 65 6c 65 63 74 69 6e 67 20 74 68 65 20 72 69 67  electing the rig
1300: 68 74 0a 23 20 22 64 65 6c 65 74 65 20 61 6c 6c  ht.# "delete all
1310: 22 20 6d 65 74 68 6f 64 2e 0a 23 2d 2d 2d 2d 2d  " method..#-----
1320: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1330: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1340: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1350: 2d 2d 2d 2d 2d 0a 0a 52 4d 44 49 52 09 3d 20 72  -----..RMDIR.= r
1360: 6d 64 69 72 20 2f 53 20 2f 51 0a 43 50 59 09 3d  mdir /S /Q.CPY.=
1370: 20 78 63 6f 70 79 20 2f 69 20 2f 79 20 3e 4e 55   xcopy /i /y >NU
1380: 4c 0a 43 50 59 44 49 52 20 20 3d 20 78 63 6f 70  L.CPYDIR  = xcop
1390: 79 20 2f 65 20 2f 69 20 2f 79 20 3e 4e 55 4c 0a  y /e /i /y >NUL.
13a0: 43 4f 50 59 09 3d 20 63 6f 70 79 20 2f 79 20 3e  COPY.= copy /y >
13b0: 4e 55 4c 0a 4d 4b 44 49 52 20 20 20 3d 20 6d 6b  NUL.MKDIR   = mk
13c0: 64 69 72 0a 0a 23 23 23 23 23 23 23 23 23 23 23  dir..###########
13d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
13e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
13f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1400: 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 32 2e  ###########.# 2.
1410: 20 46 69 67 75 72 65 20 6f 75 74 20 6f 75 72 20   Figure out our 
1420: 62 75 69 6c 64 20 65 6e 76 69 72 6f 6e 6d 65 6e  build environmen
1430: 74 20 69 6e 20 74 65 72 6d 73 20 6f 66 20 77 68  t in terms of wh
1440: 61 74 20 77 65 27 72 65 20 62 75 69 6c 64 69 6e  at we're buildin
1450: 67 2e 0a 23 0a 23 20 28 61 29 20 54 63 6c 20 69  g..#.# (a) Tcl i
1460: 74 73 65 6c 66 0a 23 20 28 62 29 20 54 6b 0a 23  tself.# (b) Tk.#
1470: 20 28 63 29 20 61 20 54 63 6c 20 65 78 74 65 6e   (c) a Tcl exten
1480: 73 69 6f 6e 20 75 73 69 6e 67 20 6c 69 62 72 61  sion using libra
1490: 72 69 65 73 2f 69 6e 63 6c 75 64 65 73 20 66 72  ries/includes fr
14a0: 6f 6d 20 61 6e 20 2a 69 6e 73 74 61 6c 6c 65 64  om an *installed
14b0: 2a 20 54 63 6c 0a 23 20 28 64 29 20 61 20 54 63  * Tcl.# (d) a Tc
14c0: 6c 20 65 78 74 65 6e 73 69 6f 6e 20 75 73 69 6e  l extension usin
14d0: 67 20 6c 69 62 72 61 72 69 65 73 2f 69 6e 63 6c  g libraries/incl
14e0: 75 64 65 73 20 66 72 6f 6d 20 54 63 6c 20 73 6f  udes from Tcl so
14f0: 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 0a 23  urce directory.#
1500: 0a 23 20 54 68 69 73 20 6c 61 73 74 20 69 73 20  .# This last is 
1510: 6e 65 65 64 65 64 20 62 65 63 61 75 73 65 20 73  needed because s
1520: 6f 6d 65 20 65 78 74 65 6e 73 69 6f 6e 73 20 73  ome extensions s
1530: 74 69 6c 6c 20 6e 65 65 64 0a 23 20 73 6f 6d 65  till need.# some
1540: 20 54 63 6c 20 69 6e 74 65 72 66 61 63 65 73 20   Tcl interfaces 
1550: 74 68 61 74 20 61 72 65 20 6e 6f 74 20 70 75 62  that are not pub
1560: 6c 69 63 6c 79 20 65 78 70 6f 73 65 64 2e 0a 23  licly exposed..#
1570: 0a 23 20 54 68 65 20 66 72 61 67 6d 65 6e 74 20  .# The fragment 
1580: 77 69 6c 6c 20 73 65 74 20 74 68 65 20 66 6f 6c  will set the fol
1590: 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 3a 0a 23  lowing macros:.#
15a0: 20 52 4f 4f 54 20 2d 20 72 6f 6f 74 20 6f 66 20   ROOT - root of 
15b0: 74 68 69 73 20 6d 6f 64 75 6c 65 20 73 6f 75 72  this module sour
15c0: 63 65 73 0a 23 20 43 4f 4d 50 41 54 44 49 52 20  ces.# COMPATDIR 
15d0: 2d 20 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f  - source directo
15e0: 72 79 20 74 68 61 74 20 68 6f 6c 64 73 20 63 6f  ry that holds co
15f0: 6d 70 61 74 69 62 69 6c 69 74 79 20 73 6f 75 72  mpatibility sour
1600: 63 65 73 0a 23 20 44 4f 43 44 49 52 20 2d 20 73  ces.# DOCDIR - s
1610: 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 20  ource directory 
1620: 63 6f 6e 74 61 69 6e 69 6e 67 20 64 6f 63 75 6d  containing docum
1630: 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65 73 0a 23  entation files.#
1640: 20 47 45 4e 45 52 49 43 44 49 52 20 2d 20 70 6c   GENERICDIR - pl
1650: 61 74 66 6f 72 6d 2d 69 6e 64 65 70 65 6e 64 65  atform-independe
1660: 6e 74 20 73 6f 75 72 63 65 20 64 69 72 65 63 74  nt source direct
1670: 6f 72 79 0a 23 20 57 49 4e 5f 44 49 52 20 2d 20  ory.# WIN_DIR - 
1680: 57 69 6e 64 6f 77 73 2d 73 70 65 63 69 66 69 63  Windows-specific
1690: 20 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72   source director
16a0: 79 0a 23 20 54 45 53 54 44 49 52 20 2d 20 64 69  y.# TESTDIR - di
16b0: 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69  rectory containi
16c0: 6e 67 20 74 65 73 74 20 66 69 6c 65 73 0a 23 20  ng test files.# 
16d0: 54 4f 4f 4c 53 44 49 52 20 2d 20 64 69 72 65 63  TOOLSDIR - direc
16e0: 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20  tory containing 
16f0: 62 75 69 6c 64 20 74 6f 6f 6c 73 0a 23 20 5f 54  build tools.# _T
1700: 43 4c 44 49 52 20 2d 20 72 6f 6f 74 20 6f 66 20  CLDIR - root of 
1710: 74 68 65 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61  the Tcl installa
1720: 74 69 6f 6e 20 4f 52 20 74 68 65 20 54 63 6c 20  tion OR the Tcl 
1730: 73 6f 75 72 63 65 73 2e 20 4e 6f 74 20 73 65 74  sources. Not set
1740: 0a 23 20 20 20 20 77 68 65 6e 20 62 75 69 6c 64  .#    when build
1750: 69 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 2e 0a  ing Tcl itself..
1760: 23 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 2d 20  # _INSTALLDIR - 
1770: 6e 61 74 69 76 65 20 66 6f 72 6d 20 6f 66 20 74  native form of t
1780: 68 65 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20  he installation 
1790: 70 61 74 68 2e 20 46 6f 72 20 54 63 6c 0a 23 20  path. For Tcl.# 
17a0: 20 20 20 74 68 69 73 20 77 69 6c 6c 20 62 65 20     this will be 
17b0: 74 68 65 20 72 6f 6f 74 20 6f 66 20 74 68 65 20  the root of the 
17c0: 54 63 6c 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e  Tcl installation
17d0: 2e 20 46 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73  . For extensions
17e0: 0a 23 20 20 20 20 74 68 69 73 20 77 69 6c 6c 20  .#    this will 
17f0: 62 65 20 74 68 65 20 6c 69 62 20 64 69 72 65 63  be the lib direc
1800: 74 6f 72 79 20 75 6e 64 65 72 20 74 68 65 20 72  tory under the r
1810: 6f 6f 74 2e 0a 23 20 54 43 4c 49 4e 53 54 41 4c  oot..# TCLINSTAL
1820: 4c 20 20 2d 20 73 65 74 20 74 6f 20 31 20 69 66  L  - set to 1 if
1830: 20 5f 54 43 4c 44 49 52 20 72 65 66 65 72 73 20   _TCLDIR refers 
1840: 74 6f 0a 23 20 20 20 20 68 65 61 64 65 72 73 20  to.#    headers 
1850: 61 6e 64 20 6c 69 62 72 61 72 69 65 73 20 66 72  and libraries fr
1860: 6f 6d 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20  om an installed 
1870: 54 63 6c 2c 20 61 6e 64 20 30 20 69 66 20 62 75  Tcl, and 0 if bu
1880: 69 6c 74 20 61 67 61 69 6e 73 74 0a 23 20 20 20  ilt against.#   
1890: 20 54 63 6c 20 73 6f 75 72 63 65 73 2e 20 4e 6f   Tcl sources. No
18a0: 74 20 73 65 74 20 77 68 65 6e 20 62 75 69 6c 64  t set when build
18b0: 69 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 2e 20  ing Tcl itself. 
18c0: 59 65 73 2c 20 6e 6f 74 20 76 65 72 79 20 77 65  Yes, not very we
18d0: 6c 6c 0a 23 20 20 20 20 6e 61 6d 65 64 2e 0a 23  ll.#    named..#
18e0: 20 5f 54 43 4c 5f 48 20 2d 20 6e 61 74 69 76 65   _TCL_H - native
18f0: 20 70 61 74 68 20 74 6f 20 74 68 65 20 74 63 6c   path to the tcl
1900: 2e 68 20 66 69 6c 65 0a 23 0a 23 20 49 66 20 54  .h file.#.# If T
1910: 6b 20 69 73 20 69 6e 76 6f 6c 76 65 64 2c 20 61  k is involved, a
1920: 6c 73 6f 20 73 65 74 73 20 74 68 65 20 66 6f 6c  lso sets the fol
1930: 6c 6f 77 69 6e 67 0a 23 20 5f 54 4b 44 49 52 20  lowing.# _TKDIR 
1940: 2d 20 6e 61 74 69 76 65 20 66 6f 72 6d 20 54 6b  - native form Tk
1950: 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 4f 52   installation OR
1960: 20 54 6b 20 73 6f 75 72 63 65 2e 20 4e 6f 74 20   Tk source. Not 
1970: 73 65 74 20 69 66 20 62 75 69 6c 64 69 6e 67 0a  set if building.
1980: 23 20 20 20 20 54 6b 20 69 74 73 65 6c 66 2e 0a  #    Tk itself..
1990: 23 20 54 4b 49 4e 53 54 41 4c 4c 20 2d 20 73 65  # TKINSTALL - se
19a0: 74 20 31 20 69 66 20 5f 54 4b 44 49 52 20 72 65  t 1 if _TKDIR re
19b0: 66 65 72 73 20 74 6f 20 69 6e 73 74 61 6c 6c 65  fers to installe
19c0: 64 20 54 6b 20 61 6e 64 20 30 20 69 66 20 54 6b  d Tk and 0 if Tk
19d0: 20 73 6f 75 72 63 65 73 0a 23 20 5f 54 4b 5f 48   sources.# _TK_H
19e0: 20 2d 20 6e 61 74 69 76 65 20 70 61 74 68 20 74   - native path t
19f0: 6f 20 74 68 65 20 74 6b 2e 68 20 66 69 6c 65 0a  o the tk.h file.
1a00: 0a 23 20 52 6f 6f 74 20 64 69 72 65 63 74 6f 72  .# Root director
1a10: 79 20 66 6f 72 20 73 6f 75 72 63 65 73 20 61 6e  y for sources an
1a20: 64 20 61 73 73 75 6d 65 64 20 73 75 62 64 69 72  d assumed subdir
1a30: 65 63 74 6f 72 69 65 73 0a 52 4f 4f 54 20 3d 20  ectories.ROOT = 
1a40: 24 28 4d 41 4b 45 44 49 52 29 5c 2e 2e 0a 23 20  $(MAKEDIR)\...# 
1a50: 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 70 61  The following pa
1a60: 74 68 73 20 43 41 4e 4e 4f 54 20 68 61 76 65 20  ths CANNOT have 
1a70: 73 70 61 63 65 73 20 69 6e 20 74 68 65 6d 20 61  spaces in them a
1a80: 73 20 74 68 65 79 20 61 70 70 65 61 72 20 6f 6e  s they appear on
1a90: 20 74 68 65 0a 23 20 6c 65 66 74 20 73 69 64 65   the.# left side
1aa0: 20 6f 66 20 69 6d 70 6c 69 63 69 74 20 72 75 6c   of implicit rul
1ab0: 65 73 2e 0a 21 69 66 6e 64 65 66 20 43 4f 4d 50  es..!ifndef COMP
1ac0: 41 54 44 49 52 0a 43 4f 4d 50 41 54 44 49 52 09  ATDIR.COMPATDIR.
1ad0: 3d 20 24 28 52 4f 4f 54 29 5c 63 6f 6d 70 61 74  = $(ROOT)\compat
1ae0: 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64 65 66 20  .!endif.!ifndef 
1af0: 44 4f 43 44 49 52 0a 44 4f 43 44 49 52 09 09 3d  DOCDIR.DOCDIR..=
1b00: 20 24 28 52 4f 4f 54 29 5c 64 6f 63 0a 21 65 6e   $(ROOT)\doc.!en
1b10: 64 69 66 0a 21 69 66 6e 64 65 66 20 47 45 4e 45  dif.!ifndef GENE
1b20: 52 49 43 44 49 52 0a 47 45 4e 45 52 49 43 44 49  RICDIR.GENERICDI
1b30: 52 09 3d 20 24 28 52 4f 4f 54 29 5c 67 65 6e 65  R.= $(ROOT)\gene
1b40: 72 69 63 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64  ric.!endif.!ifnd
1b50: 65 66 20 54 4f 4f 4c 53 44 49 52 0a 54 4f 4f 4c  ef TOOLSDIR.TOOL
1b60: 53 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c 74  SDIR.= $(ROOT)\t
1b70: 6f 6f 6c 73 0a 21 65 6e 64 69 66 0a 21 69 66 6e  ools.!endif.!ifn
1b80: 64 65 66 20 54 45 53 54 44 49 52 0a 54 45 53 54  def TESTDIR.TEST
1b90: 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c 74 65  DIR.= $(ROOT)\te
1ba0: 73 74 73 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64  sts.!endif.!ifnd
1bb0: 65 66 20 4c 49 42 44 49 52 0a 21 69 66 20 65 78  ef LIBDIR.!if ex
1bc0: 69 73 74 28 22 24 28 52 4f 4f 54 29 5c 6c 69 62  ist("$(ROOT)\lib
1bd0: 72 61 72 79 22 29 0a 4c 49 42 44 49 52 20 20 20  rary").LIBDIR   
1be0: 20 20 20 20 20 20 20 3d 20 24 28 52 4f 4f 54 29         = $(ROOT)
1bf0: 5c 6c 69 62 72 61 72 79 0a 21 65 6c 73 65 0a 4c  \library.!else.L
1c00: 49 42 44 49 52 20 20 20 20 20 20 20 20 20 20 3d  IBDIR          =
1c10: 20 24 28 52 4f 4f 54 29 5c 6c 69 62 0a 21 65 6e   $(ROOT)\lib.!en
1c20: 64 69 66 0a 21 65 6e 64 69 66 0a 21 69 66 6e 64  dif.!endif.!ifnd
1c30: 65 66 20 44 45 4d 4f 44 49 52 0a 21 69 66 20 65  ef DEMODIR.!if e
1c40: 78 69 73 74 28 22 24 28 4c 49 42 44 49 52 29 5c  xist("$(LIBDIR)\
1c50: 64 65 6d 6f 73 22 29 0a 44 45 4d 4f 44 49 52 09  demos").DEMODIR.
1c60: 09 3d 20 24 28 4c 49 42 44 49 52 29 5c 64 65 6d  .= $(LIBDIR)\dem
1c70: 6f 73 0a 21 65 6c 73 65 0a 44 45 4d 4f 44 49 52  os.!else.DEMODIR
1c80: 09 09 3d 20 24 28 52 4f 4f 54 29 5c 64 65 6d 6f  ..= $(ROOT)\demo
1c90: 73 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 20  s.!endif.!endif 
1ca0: 23 20 69 66 6e 64 65 66 20 44 45 4d 4f 44 49 52  # ifndef DEMODIR
1cb0: 0a 23 20 44 6f 20 4e 4f 54 20 75 73 65 20 57 49  .# Do NOT use WI
1cc0: 4e 44 49 52 20 62 65 63 61 75 73 65 20 69 74 20  NDIR because it 
1cd0: 69 73 20 57 69 6e 64 6f 77 73 20 69 6e 74 65 72  is Windows inter
1ce0: 6e 61 6c 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 0a  nal environment.
1cf0: 23 20 76 61 72 69 61 62 6c 65 20 74 6f 20 70 6f  # variable to po
1d00: 69 6e 74 20 74 6f 20 63 3a 5c 77 69 6e 64 6f 77  int to c:\window
1d10: 73 21 0a 57 49 4e 5f 44 49 52 09 09 3d 20 24 28  s!.WIN_DIR..= $(
1d20: 52 4f 4f 54 29 5c 77 69 6e 0a 0a 21 69 66 6e 64  ROOT)\win..!ifnd
1d30: 65 66 20 52 43 44 49 52 0a 21 69 66 20 65 78 69  ef RCDIR.!if exi
1d40: 73 74 28 22 24 28 57 49 4e 5f 44 49 52 29 5c 72  st("$(WIN_DIR)\r
1d50: 63 22 29 0a 52 43 44 49 52 20 20 20 20 20 20 20  c").RCDIR       
1d60: 20 20 20 20 3d 20 24 28 57 49 4e 5f 44 49 52 29      = $(WIN_DIR)
1d70: 5c 72 63 0a 21 65 6c 73 65 0a 52 43 44 49 52 20  \rc.!else.RCDIR 
1d80: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 57 49            = $(WI
1d90: 4e 5f 44 49 52 29 0a 21 65 6e 64 69 66 0a 21 65  N_DIR).!endif.!e
1da0: 6e 64 69 66 0a 52 43 44 49 52 20 3d 20 24 28 52  ndif.RCDIR = $(R
1db0: 43 44 49 52 3a 2f 3d 5c 29 0a 0a 23 20 54 68 65  CDIR:/=\)..# The
1dc0: 20 74 61 72 67 65 74 20 64 69 72 65 63 74 6f 72   target director
1dd0: 79 20 77 68 65 72 65 20 74 68 65 20 62 75 69 6c  y where the buil
1de0: 74 20 70 61 63 6b 61 67 65 73 20 61 6e 64 20 62  t packages and b
1df0: 69 6e 61 72 69 65 73 20 77 69 6c 6c 20 62 65 20  inaries will be 
1e00: 69 6e 73 74 61 6c 6c 65 64 2e 0a 23 20 49 4e 53  installed..# INS
1e10: 54 41 4c 4c 44 49 52 20 69 73 20 74 68 65 20 28  TALLDIR is the (
1e20: 6f 70 74 69 6f 6e 61 6c 29 20 70 61 74 68 20 73  optional) path s
1e30: 70 65 63 69 66 69 65 64 20 62 79 20 74 68 65 20  pecified by the 
1e40: 75 73 65 72 2e 0a 23 20 5f 49 4e 53 54 41 4c 4c  user..# _INSTALL
1e50: 44 49 52 20 69 73 20 49 4e 53 54 41 4c 4c 44 49  DIR is INSTALLDI
1e60: 52 20 75 73 69 6e 67 20 74 68 65 20 62 61 63 6b  R using the back
1e70: 73 6c 61 73 68 20 73 65 70 61 72 61 74 6f 72 20  slash separator 
1e80: 73 79 6e 74 61 78 0a 21 69 66 64 65 66 20 49 4e  syntax.!ifdef IN
1e90: 53 54 41 4c 4c 44 49 52 0a 23 23 23 20 46 69 78  STALLDIR.### Fix
1ea0: 20 74 68 65 20 70 61 74 68 20 73 65 70 61 72 61   the path separa
1eb0: 74 6f 72 73 2e 0a 5f 49 4e 53 54 41 4c 4c 44 49  tors.._INSTALLDI
1ec0: 52 09 3d 20 24 28 49 4e 53 54 41 4c 4c 44 49 52  R.= $(INSTALLDIR
1ed0: 3a 2f 3d 5c 29 0a 21 65 6c 73 65 0a 23 23 23 20  :/=\).!else.### 
1ee0: 41 73 73 75 6d 65 20 74 68 65 20 6e 6f 72 6d 61  Assume the norma
1ef0: 6c 20 64 65 66 61 75 6c 74 2e 0a 5f 49 4e 53 54  l default.._INST
1f00: 41 4c 4c 44 49 52 09 3d 20 24 28 48 4f 4d 45 44  ALLDIR.= $(HOMED
1f10: 52 49 56 45 29 5c 54 63 6c 0a 21 65 6e 64 69 66  RIVE)\Tcl.!endif
1f20: 0a 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43  ..!if $(DOING_TC
1f30: 4c 29 0a 0a 23 20 42 45 47 49 4e 20 43 61 73 65  L)..# BEGIN Case
1f40: 20 32 28 61 29 20 2d 20 42 75 69 6c 64 69 6e 67   2(a) - Building
1f50: 20 54 63 6c 20 69 74 73 65 6c 66 0a 0a 23 20 4f   Tcl itself..# O
1f60: 6e 6c 79 20 6e 65 65 64 20 74 6f 20 64 65 66 69  nly need to defi
1f70: 6e 65 20 5f 54 43 4c 5f 48 0a 5f 54 43 4c 5f 48  ne _TCL_H._TCL_H
1f80: 20 3d 20 2e 2e 5c 67 65 6e 65 72 69 63 5c 74 63   = ..\generic\tc
1f90: 6c 2e 68 0a 0a 23 20 45 4e 44 20 43 61 73 65 20  l.h..# END Case 
1fa0: 32 28 61 29 20 2d 20 42 75 69 6c 64 69 6e 67 20  2(a) - Building 
1fb0: 54 63 6c 20 69 74 73 65 6c 66 0a 0a 21 65 6c 73  Tcl itself..!els
1fc0: 65 69 66 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0a  eif $(DOING_TK).
1fd0: 0a 23 20 42 45 47 49 4e 20 43 61 73 65 20 32 28  .# BEGIN Case 2(
1fe0: 62 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 54 6b  b) - Building Tk
1ff0: 0a 0a 54 43 4c 49 4e 53 54 41 4c 4c 20 3d 20 30  ..TCLINSTALL = 0
2000: 20 23 20 54 6b 20 61 6c 77 61 79 73 20 62 75 69   # Tk always bui
2010: 6c 64 73 20 61 67 61 69 6e 73 74 20 54 63 6c 20  lds against Tcl 
2020: 73 6f 75 72 63 65 2c 20 6e 6f 74 20 61 6e 20 69  source, not an i
2030: 6e 73 74 61 6c 6c 65 64 20 54 63 6c 0a 21 69 66  nstalled Tcl.!if
2040: 20 22 24 28 54 43 4c 44 49 52 29 22 20 3d 3d 20   "$(TCLDIR)" == 
2050: 22 22 0a 21 69 66 20 5b 65 63 68 6f 20 54 43 4c  "".!if [echo TCL
2060: 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c  DIR = \> nmakehl
2070: 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b  p.out] \.   || [
2080: 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20 67 65 6e 65  nmakehlp -L gene
2090: 72 69 63 5c 74 63 6c 2e 68 20 3e 3e 20 6e 6d 61  ric\tcl.h >> nma
20a0: 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72 6f  kehlp.out].!erro
20b0: 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20  r *** Could not 
20c0: 6c 6f 63 61 74 65 20 54 63 6c 20 73 6f 75 72 63  locate Tcl sourc
20d0: 65 20 64 69 72 65 63 74 6f 72 79 2e 0a 21 65 6e  e directory..!en
20e0: 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61  dif.!include nma
20f0: 6b 65 68 6c 70 2e 6f 75 74 0a 21 65 6e 64 69 66  kehlp.out.!endif
2100: 20 23 20 54 43 4c 44 49 52 20 3d 3d 20 22 22 0a   # TCLDIR == "".
2110: 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 54 43 4c  ._TCLDIR.= $(TCL
2120: 44 49 52 3a 2f 3d 5c 29 0a 5f 54 43 4c 5f 48 20  DIR:/=\)._TCL_H 
2130: 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 67 65   = $(_TCLDIR)\ge
2140: 6e 65 72 69 63 5c 74 63 6c 2e 68 0a 21 69 66 20  neric\tcl.h.!if 
2150: 21 65 78 69 73 74 28 22 24 28 5f 54 43 4c 5f 48  !exist("$(_TCL_H
2160: 29 22 29 0a 21 65 72 72 6f 72 20 43 6f 75 6c 64  )").!error Could
2170: 20 6e 6f 74 20 6c 6f 63 61 74 65 20 74 63 6c 2e   not locate tcl.
2180: 68 2e 20 50 6c 65 61 73 65 20 73 65 74 20 74 68  h. Please set th
2190: 65 20 54 43 4c 44 49 52 20 6d 61 63 72 6f 20 74  e TCLDIR macro t
21a0: 6f 20 70 6f 69 6e 74 20 74 6f 20 74 68 65 20 54  o point to the T
21b0: 63 6c 20 2a 73 6f 75 72 63 65 2a 20 64 69 72 65  cl *source* dire
21c0: 63 74 6f 72 79 2e 0a 21 65 6e 64 69 66 0a 0a 5f  ctory..!endif.._
21d0: 54 4b 5f 48 20 3d 20 2e 2e 5c 67 65 6e 65 72 69  TK_H = ..\generi
21e0: 63 5c 74 6b 2e 68 0a 0a 23 20 45 4e 44 20 43 61  c\tk.h..# END Ca
21f0: 73 65 20 32 28 62 29 20 2d 20 42 75 69 6c 64 69  se 2(b) - Buildi
2200: 6e 67 20 54 6b 0a 0a 21 65 6c 73 65 0a 0a 23 20  ng Tk..!else..# 
2210: 42 45 47 49 4e 20 43 61 73 65 20 32 28 63 29 20  BEGIN Case 2(c) 
2220: 6f 72 20 28 64 29 20 2d 20 42 75 69 6c 64 69 6e  or (d) - Buildin
2230: 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20 6f  g an extension o
2240: 74 68 65 72 20 74 68 61 6e 20 54 6b 0a 0a 23 20  ther than Tk..# 
2250: 49 66 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20  If command line 
2260: 68 61 73 20 73 70 65 63 69 66 69 65 64 20 54 63  has specified Tc
2270: 6c 20 6c 6f 63 61 74 69 6f 6e 20 74 68 72 6f 75  l location throu
2280: 67 68 20 54 43 4c 44 49 52 2c 20 75 73 65 20 69  gh TCLDIR, use i
2290: 74 0a 23 20 65 6c 73 65 20 64 65 66 61 75 6c 74  t.# else default
22a0: 20 74 6f 20 74 68 65 20 49 4e 53 54 41 4c 4c 44   to the INSTALLD
22b0: 49 52 20 73 65 74 74 69 6e 67 0a 21 69 66 20 22  IR setting.!if "
22c0: 24 28 54 43 4c 44 49 52 29 22 20 21 3d 20 22 22  $(TCLDIR)" != ""
22d0: 0a 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 54 43  .._TCLDIR.= $(TC
22e0: 4c 44 49 52 3a 2f 3d 5c 29 0a 21 69 66 20 65 78  LDIR:/=\).!if ex
22f0: 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29 5c  ist("$(_TCLDIR)\
2300: 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 22 29 20  include\tcl.h") 
2310: 23 20 43 61 73 65 20 32 28 63 29 20 77 69 74 68  # Case 2(c) with
2320: 20 54 43 4c 44 49 52 20 64 65 66 69 6e 65 64 0a   TCLDIR defined.
2330: 54 43 4c 49 4e 53 54 41 4c 4c 09 3d 20 31 0a 5f  TCLINSTALL.= 1._
2340: 54 43 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d  TCL_H          =
2350: 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e 63 6c   $(_TCLDIR)\incl
2360: 75 64 65 5c 74 63 6c 2e 68 0a 21 65 6c 73 65 69  ude\tcl.h.!elsei
2370: 66 20 65 78 69 73 74 28 22 24 28 5f 54 43 4c 44  f exist("$(_TCLD
2380: 49 52 29 5c 67 65 6e 65 72 69 63 5c 74 63 6c 2e  IR)\generic\tcl.
2390: 68 22 29 20 23 20 43 61 73 65 20 32 28 64 29 20  h") # Case 2(d) 
23a0: 77 69 74 68 20 54 43 4c 44 49 52 20 64 65 66 69  with TCLDIR defi
23b0: 6e 65 64 0a 54 43 4c 49 4e 53 54 41 4c 4c 09 3d  ned.TCLINSTALL.=
23c0: 20 30 0a 5f 54 43 4c 5f 48 20 20 20 20 20 20 20   0._TCL_H       
23d0: 20 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c     = $(_TCLDIR)\
23e0: 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 0a 21 65  generic\tcl.h.!e
23f0: 6e 64 69 66 0a 0a 21 65 6c 73 65 20 20 23 20 20  ndif..!else  #  
2400: 23 20 43 61 73 65 20 32 28 63 29 20 66 6f 72 20  # Case 2(c) for 
2410: 65 78 74 65 6e 73 69 6f 6e 73 20 77 69 74 68 20  extensions with 
2420: 54 43 4c 44 49 52 20 75 6e 64 65 66 69 6e 65 64  TCLDIR undefined
2430: 0a 0a 23 20 4e 65 65 64 20 74 6f 20 6c 6f 63 61  ..# Need to loca
2440: 74 65 20 54 63 6c 20 64 65 70 65 6e 64 69 6e 67  te Tcl depending
2450: 20 6f 6e 20 77 68 65 74 68 65 72 20 69 74 20 6e   on whether it n
2460: 65 65 64 73 20 54 63 6c 20 73 6f 75 72 63 65 20  eeds Tcl source 
2470: 6f 72 20 6e 6f 74 2e 0a 23 20 49 66 20 77 65 20  or not..# If we 
2480: 64 6f 6e 27 74 2c 20 63 68 65 63 6b 20 74 68 65  don't, check the
2490: 20 49 4e 53 54 41 4c 4c 44 49 52 20 66 6f 72 20   INSTALLDIR for 
24a0: 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c  an installed Tcl
24b0: 20 66 69 72 73 74 0a 0a 21 69 66 20 65 78 69 73   first..!if exis
24c0: 74 28 22 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52  t("$(_INSTALLDIR
24d0: 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 22  )\include\tcl.h"
24e0: 29 20 26 26 20 21 24 28 4e 45 45 44 5f 54 43 4c  ) && !$(NEED_TCL
24f0: 5f 53 4f 55 52 43 45 29 0a 0a 54 43 4c 49 4e 53  _SOURCE)..TCLINS
2500: 54 41 4c 4c 09 3d 20 31 0a 54 43 4c 44 49 52 20  TALL.= 1.TCLDIR 
2510: 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 49 4e           = $(_IN
2520: 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0a 23 20 4e  STALLDIR)\...# N
2530: 4f 54 45 3a 20 77 65 20 77 69 6c 6c 20 62 65 20  OTE: we will be 
2540: 72 65 73 65 74 74 69 6e 67 20 5f 49 4e 53 54 41  resetting _INSTA
2550: 4c 4c 44 49 52 20 74 6f 20 5f 49 4e 53 54 41 4c  LLDIR to _INSTAL
2560: 4c 44 49 52 2f 6c 69 62 20 66 6f 72 20 65 78 74  LDIR/lib for ext
2570: 65 6e 73 69 6f 6e 73 0a 23 20 6c 61 74 65 72 20  ensions.# later 
2580: 73 6f 20 74 68 65 20 5c 2e 2e 20 61 63 63 6f 75  so the \.. accou
2590: 6e 74 73 20 66 6f 72 20 74 68 65 20 2f 6c 69 62  nts for the /lib
25a0: 0a 5f 54 43 4c 44 49 52 09 09 3d 20 24 28 5f 49  ._TCLDIR..= $(_I
25b0: 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0a 5f 54  NSTALLDIR)\..._T
25c0: 43 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20  CL_H          = 
25d0: 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e 63 6c 75  $(_TCLDIR)\inclu
25e0: 64 65 5c 74 63 6c 2e 68 0a 0a 21 65 6c 73 65 20  de\tcl.h..!else 
25f0: 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 26 26 20  # exist(...) && 
2600: 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f 55 52  !$(NEED_TCL_SOUR
2610: 43 45 29 0a 0a 21 69 66 20 5b 65 63 68 6f 20 5f  CE)..!if [echo _
2620: 54 43 4c 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b  TCLDIR = \> nmak
2630: 65 68 6c 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c  ehlp.out] \.   |
2640: 7c 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20 67  | [nmakehlp -L g
2650: 65 6e 65 72 69 63 5c 74 63 6c 2e 68 20 3e 3e 20  eneric\tcl.h >> 
2660: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65  nmakehlp.out].!e
2670: 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e  rror *** Could n
2680: 6f 74 20 6c 6f 63 61 74 65 20 54 63 6c 20 73 6f  ot locate Tcl so
2690: 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 2e 0a  urce directory..
26a0: 21 65 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65 20  !endif.!include 
26b0: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0a 54 43 4c  nmakehlp.out.TCL
26c0: 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 30  INSTALL      = 0
26d0: 0a 54 43 4c 44 49 52 20 20 20 20 20 20 20 20 20  .TCLDIR         
26e0: 3d 20 24 28 5f 54 43 4c 44 49 52 29 0a 5f 54 43  = $(_TCLDIR)._TC
26f0: 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24  L_H          = $
2700: 28 5f 54 43 4c 44 49 52 29 5c 67 65 6e 65 72 69  (_TCLDIR)\generi
2710: 63 5c 74 63 6c 2e 68 0a 0a 21 65 6e 64 69 66 20  c\tcl.h..!endif 
2720: 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 26 26 20  # exist(...) && 
2730: 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f 55 52  !$(NEED_TCL_SOUR
2740: 43 45 29 0a 0a 21 65 6e 64 69 66 20 23 20 54 43  CE)..!endif # TC
2750: 4c 44 49 52 0a 0a 21 69 66 6e 64 65 66 20 5f 54  LDIR..!ifndef _T
2760: 43 4c 5f 48 0a 4d 53 47 20 3d 5e 0a 46 61 69 6c  CL_H.MSG =^.Fail
2770: 65 64 20 74 6f 20 66 69 6e 64 20 74 63 6c 2e 68  ed to find tcl.h
2780: 2e 20 54 68 65 20 54 43 4c 44 49 52 20 6d 61 63  . The TCLDIR mac
2790: 72 6f 20 69 73 20 73 65 74 20 69 6e 63 6f 72 72  ro is set incorr
27a0: 65 63 74 6c 79 20 6f 72 20 69 73 20 6e 6f 74 20  ectly or is not 
27b0: 73 65 74 20 61 6e 64 20 64 65 66 61 75 6c 74 20  set and default 
27c0: 70 61 74 68 20 64 6f 65 73 20 6e 6f 74 20 63 6f  path does not co
27d0: 6e 74 61 69 6e 20 74 63 6c 2e 68 2e 0a 21 65 72  ntain tcl.h..!er
27e0: 72 6f 72 20 24 28 4d 53 47 29 0a 21 65 6e 64 69  ror $(MSG).!endi
27f0: 66 0a 0a 23 20 4e 6f 77 20 64 6f 20 74 68 65 20  f..# Now do the 
2800: 73 61 6d 65 20 74 6f 20 6c 6f 63 61 74 65 20 54  same to locate T
2810: 6b 20 68 65 61 64 65 72 73 20 61 6e 64 20 6c 69  k headers and li
2820: 62 73 20 69 66 20 70 72 6f 6a 65 63 74 20 72 65  bs if project re
2830: 71 75 69 72 65 73 20 54 6b 0a 21 69 66 20 24 28  quires Tk.!if $(
2840: 4e 45 45 44 5f 54 4b 29 0a 0a 21 69 66 20 22 24  NEED_TK)..!if "$
2850: 28 54 4b 44 49 52 29 22 20 21 3d 20 22 22 0a 0a  (TKDIR)" != ""..
2860: 5f 54 4b 44 49 52 20 3d 20 24 28 54 4b 44 49 52  _TKDIR = $(TKDIR
2870: 3a 2f 3d 5c 29 0a 21 69 66 20 65 78 69 73 74 28  :/=\).!if exist(
2880: 22 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75  "$(_TKDIR)\inclu
2890: 64 65 5c 74 6b 2e 68 22 29 0a 54 4b 49 4e 53 54  de\tk.h").TKINST
28a0: 41 4c 4c 20 20 20 20 20 20 3d 20 31 0a 5f 54 4b  ALL      = 1._TK
28b0: 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24 28  _H          = $(
28c0: 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c  _TKDIR)\include\
28d0: 74 6b 2e 68 0a 21 65 6c 73 65 69 66 20 65 78 69  tk.h.!elseif exi
28e0: 73 74 28 22 24 28 5f 54 4b 44 49 52 29 5c 67 65  st("$(_TKDIR)\ge
28f0: 6e 65 72 69 63 5c 74 6b 2e 68 22 29 0a 54 4b 49  neric\tk.h").TKI
2900: 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 30 0a  NSTALL      = 0.
2910: 5f 54 4b 5f 48 20 20 20 20 20 20 20 20 20 20 3d  _TK_H          =
2920: 20 24 28 5f 54 4b 44 49 52 29 5c 67 65 6e 65 72   $(_TKDIR)\gener
2930: 69 63 5c 74 6b 2e 68 0a 21 65 6e 64 69 66 0a 0a  ic\tk.h.!endif..
2940: 21 65 6c 73 65 20 23 20 54 4b 44 49 52 20 6e 6f  !else # TKDIR no
2950: 74 20 64 65 66 69 6e 65 64 0a 0a 23 20 4e 65 65  t defined..# Nee
2960: 64 20 74 6f 20 6c 6f 63 61 74 65 20 54 63 6c 20  d to locate Tcl 
2970: 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 77 68 65  depending on whe
2980: 74 68 65 72 20 69 74 20 6e 65 65 64 73 20 54 63  ther it needs Tc
2990: 6c 20 73 6f 75 72 63 65 20 6f 72 20 6e 6f 74 2e  l source or not.
29a0: 0a 23 20 49 66 20 77 65 20 64 6f 6e 27 74 2c 20  .# If we don't, 
29b0: 63 68 65 63 6b 20 74 68 65 20 49 4e 53 54 41 4c  check the INSTAL
29c0: 4c 44 49 52 20 66 6f 72 20 61 6e 20 69 6e 73 74  LDIR for an inst
29d0: 61 6c 6c 65 64 20 54 63 6c 20 66 69 72 73 74 0a  alled Tcl first.
29e0: 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f 49  .!if exist("$(_I
29f0: 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75  NSTALLDIR)\inclu
2a00: 64 65 5c 74 6b 2e 68 22 29 20 26 26 20 21 24 28  de\tk.h") && !$(
2a10: 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0a  NEED_TK_SOURCE).
2a20: 0a 54 4b 49 4e 53 54 41 4c 4c 20 20 20 20 20 20  .TKINSTALL      
2a30: 3d 20 31 0a 23 20 4e 4f 54 45 3a 20 77 65 20 77  = 1.# NOTE: we w
2a40: 69 6c 6c 20 62 65 20 72 65 73 65 74 74 69 6e 67  ill be resetting
2a50: 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 74 6f 20   _INSTALLDIR to 
2a60: 5f 49 4e 53 54 41 4c 4c 44 49 52 2f 6c 69 62 20  _INSTALLDIR/lib 
2a70: 66 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 0a 23  for extensions.#
2a80: 20 6c 61 74 65 72 20 73 6f 20 74 68 65 20 5c 2e   later so the \.
2a90: 2e 20 61 63 63 6f 75 6e 74 73 20 66 6f 72 20 74  . accounts for t
2aa0: 68 65 20 2f 6c 69 62 0a 5f 54 4b 44 49 52 20 20  he /lib._TKDIR  
2ab0: 20 20 20 20 20 20 20 3d 20 24 28 5f 49 4e 53 54         = $(_INST
2ac0: 41 4c 4c 44 49 52 29 5c 2e 2e 0a 5f 54 4b 5f 48  ALLDIR)\..._TK_H
2ad0: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54            = $(_T
2ae0: 4b 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 6b  KDIR)\include\tk
2af0: 2e 68 0a 54 4b 44 49 52 20 20 20 20 20 20 20 20  .h.TKDIR        
2b00: 20 20 3d 20 24 28 5f 54 4b 44 49 52 29 0a 0a 21    = $(_TKDIR)..!
2b10: 65 6c 73 65 20 23 20 65 78 69 73 74 28 22 24 28  else # exist("$(
2b20: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63  _INSTALLDIR)\inc
2b30: 6c 75 64 65 5c 74 6b 2e 68 22 29 20 26 26 20 21  lude\tk.h") && !
2b40: 24 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45  $(NEED_TK_SOURCE
2b50: 29 0a 0a 21 69 66 20 5b 65 63 68 6f 20 5f 54 4b  )..!if [echo _TK
2b60: 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c  DIR = \> nmakehl
2b70: 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b  p.out] \.   || [
2b80: 6e 6d 61 6b 65 68 6c 70 20 2d 4c 20 67 65 6e 65  nmakehlp -L gene
2b90: 72 69 63 5c 74 6b 2e 68 20 3e 3e 20 6e 6d 61 6b  ric\tk.h >> nmak
2ba0: 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72 6f 72  ehlp.out].!error
2bb0: 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 6c   *** Could not l
2bc0: 6f 63 61 74 65 20 54 6b 20 73 6f 75 72 63 65 20  ocate Tk source 
2bd0: 64 69 72 65 63 74 6f 72 79 2e 0a 21 65 6e 64 69  directory..!endi
2be0: 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 6b 65  f.!include nmake
2bf0: 68 6c 70 2e 6f 75 74 0a 54 4b 49 4e 53 54 41 4c  hlp.out.TKINSTAL
2c00: 4c 20 20 20 20 20 20 3d 20 30 0a 54 4b 44 49 52  L      = 0.TKDIR
2c10: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54            = $(_T
2c20: 4b 44 49 52 29 0a 5f 54 4b 5f 48 20 20 20 20 20  KDIR)._TK_H     
2c30: 20 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 52 29       = $(_TKDIR)
2c40: 5c 67 65 6e 65 72 69 63 5c 74 6b 2e 68 0a 0a 21  \generic\tk.h..!
2c50: 65 6e 64 69 66 20 23 20 65 78 69 73 74 28 22 24  endif # exist("$
2c60: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e  (_INSTALLDIR)\in
2c70: 63 6c 75 64 65 5c 74 6b 2e 68 22 29 20 26 26 20  clude\tk.h") && 
2c80: 21 24 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43  !$(NEED_TK_SOURC
2c90: 45 29 0a 0a 21 65 6e 64 69 66 20 23 20 54 4b 44  E)..!endif # TKD
2ca0: 49 52 0a 0a 21 69 66 6e 64 65 66 20 5f 54 4b 5f  IR..!ifndef _TK_
2cb0: 48 0a 4d 53 47 20 3d 5e 0a 46 61 69 6c 65 64 20  H.MSG =^.Failed 
2cc0: 74 6f 20 66 69 6e 64 20 74 6b 2e 68 2e 20 54 68  to find tk.h. Th
2cd0: 65 20 54 4b 44 49 52 20 6d 61 63 72 6f 20 69 73  e TKDIR macro is
2ce0: 20 73 65 74 20 69 6e 63 6f 72 72 65 63 74 6c 79   set incorrectly
2cf0: 20 6f 72 20 69 73 20 6e 6f 74 20 73 65 74 20 61   or is not set a
2d00: 6e 64 20 64 65 66 61 75 6c 74 20 70 61 74 68 20  nd default path 
2d10: 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e  does not contain
2d20: 20 74 6b 2e 68 2e 0a 21 65 72 72 6f 72 20 24 28   tk.h..!error $(
2d30: 4d 53 47 29 0a 21 65 6e 64 69 66 0a 0a 21 65 6e  MSG).!endif..!en
2d40: 64 69 66 20 23 20 4e 45 45 44 5f 54 4b 0a 0a 21  dif # NEED_TK..!
2d50: 69 66 20 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f  if $(NEED_TCL_SO
2d60: 55 52 43 45 29 20 26 26 20 24 28 54 43 4c 49 4e  URCE) && $(TCLIN
2d70: 53 54 41 4c 4c 29 0a 4d 53 47 20 3d 20 5e 0a 2a  STALL).MSG = ^.*
2d80: 2a 2a 20 57 61 72 6e 69 6e 67 3a 20 54 68 69 73  ** Warning: This
2d90: 20 65 78 74 65 6e 73 69 6f 6e 20 72 65 71 75 69   extension requi
2da0: 72 65 73 20 74 68 65 20 73 6f 75 72 63 65 20 64  res the source d
2db0: 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 20 54  istribution of T
2dc0: 63 6c 2e 5e 0a 2a 2a 2a 20 50 6c 65 61 73 65 20  cl.^.*** Please 
2dd0: 73 65 74 20 74 68 65 20 54 43 4c 44 49 52 20 6d  set the TCLDIR m
2de0: 61 63 72 6f 20 74 6f 20 70 6f 69 6e 74 20 74 6f  acro to point to
2df0: 20 74 68 65 20 54 63 6c 20 73 6f 75 72 63 65 73   the Tcl sources
2e00: 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53 47 29 0a  ..!error $(MSG).
2e10: 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 4e 45  !endif..!if $(NE
2e20: 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0a 21 69  ED_TK_SOURCE).!i
2e30: 66 20 24 28 54 4b 49 4e 53 54 41 4c 4c 29 0a 4d  f $(TKINSTALL).M
2e40: 53 47 20 3d 20 5e 0a 2a 2a 2a 20 57 61 72 6e 69  SG = ^.*** Warni
2e50: 6e 67 3a 20 54 68 69 73 20 65 78 74 65 6e 73 69  ng: This extensi
2e60: 6f 6e 20 72 65 71 75 69 72 65 73 20 74 68 65 20  on requires the 
2e70: 73 6f 75 72 63 65 20 64 69 73 74 72 69 62 75 74  source distribut
2e80: 69 6f 6e 20 6f 66 20 54 6b 2e 5e 0a 2a 2a 2a 20  ion of Tk.^.*** 
2e90: 50 6c 65 61 73 65 20 73 65 74 20 74 68 65 20 54  Please set the T
2ea0: 4b 44 49 52 20 6d 61 63 72 6f 20 74 6f 20 70 6f  KDIR macro to po
2eb0: 69 6e 74 20 74 6f 20 74 68 65 20 54 6b 20 73 6f  int to the Tk so
2ec0: 75 72 63 65 73 2e 0a 21 65 72 72 6f 72 20 24 28  urces..!error $(
2ed0: 4d 53 47 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64  MSG).!endif.!end
2ee0: 69 66 0a 0a 0a 23 20 49 66 20 49 4e 53 54 41 4c  if...# If INSTAL
2ef0: 4c 44 49 52 20 73 65 74 20 74 6f 20 54 63 6c 20  LDIR set to Tcl 
2f00: 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 72 6f 6f  installation roo
2f10: 74 20 64 69 72 20 74 68 65 6e 20 72 65 73 65 74  t dir then reset
2f20: 20 74 6f 20 74 68 65 0a 23 20 6c 69 62 20 64 69   to the.# lib di
2f30: 72 20 66 6f 72 20 69 6e 73 74 61 6c 6c 69 6e 67  r for installing
2f40: 20 65 78 74 65 6e 73 69 6f 6e 73 0a 21 69 66 20   extensions.!if 
2f50: 65 78 69 73 74 28 22 24 28 5f 49 4e 53 54 41 4c  exist("$(_INSTAL
2f60: 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63  LDIR)\include\tc
2f70: 6c 2e 68 22 29 0a 5f 49 4e 53 54 41 4c 4c 44 49  l.h")._INSTALLDI
2f80: 52 3d 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29  R=$(_INSTALLDIR)
2f90: 5c 6c 69 62 0a 21 65 6e 64 69 66 0a 0a 23 20 45  \lib.!endif..# E
2fa0: 4e 44 20 43 61 73 65 20 32 28 63 29 20 6f 72 20  ND Case 2(c) or 
2fb0: 28 64 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 61  (d) - Building a
2fc0: 6e 20 65 78 74 65 6e 73 69 6f 6e 0a 21 65 6e 64  n extension.!end
2fd0: 69 66 20 23 20 69 66 20 24 28 44 4f 49 4e 47 5f  if # if $(DOING_
2fe0: 54 43 4c 29 0a 0a 23 23 23 23 23 23 23 23 23 23  TCL)..##########
2ff0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3000: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3010: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3020: 23 23 23 23 23 23 0a 23 20 33 2e 20 44 65 74 65  ######.# 3. Dete
3030: 72 6d 69 6e 65 20 63 6f 6d 70 69 6c 65 72 20 76  rmine compiler v
3040: 65 72 73 69 6f 6e 20 61 6e 64 20 61 72 63 68 69  ersion and archi
3050: 74 65 63 74 75 72 65 0a 23 20 49 6e 20 74 68 69  tecture.# In thi
3060: 73 20 73 65 63 74 69 6f 6e 2c 20 77 65 20 66 69  s section, we fi
3070: 67 75 72 65 20 6f 75 74 20 74 68 65 20 63 6f 6d  gure out the com
3080: 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 61 6e  piler version an
3090: 64 20 74 68 65 0a 23 20 61 72 63 68 69 74 65 63  d the.# architec
30a0: 74 75 72 65 20 66 6f 72 20 77 68 69 63 68 20 77  ture for which w
30b0: 65 20 61 72 65 20 62 75 69 6c 64 69 6e 67 2e 20  e are building. 
30c0: 54 68 69 73 20 73 65 74 73 20 74 68 65 0a 23 20  This sets the.# 
30d0: 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73  following macros
30e0: 3a 0a 23 20 56 43 56 45 52 53 49 4f 4e 20 2d 20  :.# VCVERSION - 
30f0: 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 63 6f 6d  the internal com
3100: 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 61 73  piler version as
3110: 20 31 32 30 30 2c 20 31 34 30 30 2c 20 31 39 31   1200, 1400, 191
3120: 30 20 65 74 63 2e 0a 23 20 20 20 20 20 54 68 69  0 etc..#     Thi
3130: 73 20 69 73 20 61 6c 73 6f 20 70 72 69 6e 74 65  s is also printe
3140: 64 20 62 79 20 74 68 65 20 63 6f 6d 70 69 6c 65  d by the compile
3150: 72 20 69 6e 20 64 6f 74 74 65 64 20 66 6f 72 6d  r in dotted form
3160: 20 31 39 2e 31 30 20 65 74 63 2e 0a 23 20 56 43   19.10 etc..# VC
3170: 56 45 52 20 2d 20 74 68 65 20 22 6d 61 72 6b 65  VER - the "marke
3180: 74 69 6e 67 20 76 65 72 73 69 6f 6e 22 2c 20 66  ting version", f
3190: 6f 72 20 65 78 61 6d 70 6c 65 20 56 69 73 75 61  or example Visua
31a0: 6c 20 43 2b 2b 20 36 20 66 6f 72 20 69 6e 74 65  l C++ 6 for inte
31b0: 72 6e 61 6c 0a 23 20 20 20 20 20 63 6f 6d 70 69  rnal.#     compi
31c0: 6c 65 72 20 76 65 72 73 69 6f 6e 20 31 32 30 30  ler version 1200
31d0: 2e 20 54 68 69 73 20 69 73 20 6b 65 70 74 20 6f  . This is kept o
31e0: 6e 6c 79 20 66 6f 72 20 6c 65 67 61 63 79 20 72  nly for legacy r
31f0: 65 61 73 6f 6e 73 20 61 73 20 69 74 0a 23 20 20  easons as it.#  
3200: 20 20 20 64 6f 65 73 20 6e 6f 74 20 6d 61 6b 65     does not make
3210: 20 73 65 6e 73 65 20 66 6f 72 20 72 65 63 65 6e   sense for recen
3220: 74 20 4d 69 63 72 6f 73 6f 66 74 20 63 6f 6d 70  t Microsoft comp
3230: 69 6c 65 72 73 2e 20 4f 6e 6c 79 20 75 73 65 64  ilers. Only used
3240: 20 66 6f 72 0a 23 20 20 20 20 20 6f 75 74 70 75   for.#     outpu
3250: 74 20 64 69 72 65 63 74 6f 72 79 20 6e 61 6d 65  t directory name
3260: 73 2e 0a 23 20 41 52 43 48 20 2d 20 73 65 74 20  s..# ARCH - set 
3270: 74 6f 20 49 58 38 36 2c 20 41 52 4d 36 34 20 6f  to IX86, ARM64 o
3280: 72 20 41 4d 44 36 34 20 64 65 70 65 6e 64 69 6e  r AMD64 dependin
3290: 67 20 6f 6e 20 33 32 2d 20 6f 72 20 36 34 2d 62  g on 32- or 64-b
32a0: 69 74 20 74 61 72 67 65 74 0a 23 20 4e 41 54 49  it target.# NATI
32b0: 56 45 5f 41 52 43 48 20 2d 20 73 65 74 20 74 6f  VE_ARCH - set to
32c0: 20 49 58 38 36 2c 20 41 52 4d 36 34 20 6f 72 20   IX86, ARM64 or 
32d0: 41 4d 44 36 34 20 66 6f 72 20 74 68 65 20 68 6f  AMD64 for the ho
32e0: 73 74 20 6d 61 63 68 69 6e 65 0a 23 20 4d 41 43  st machine.# MAC
32f0: 48 49 4e 45 20 2d 20 73 61 6d 65 20 61 73 20 24  HINE - same as $
3300: 28 41 52 43 48 29 20 2d 20 6c 65 67 61 63 79 0a  (ARCH) - legacy.
3310: 23 20 5f 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45  # _VC_MANIFEST_E
3320: 4d 42 45 44 5f 7b 44 4c 4c 2c 45 58 45 7d 20 2d  MBED_{DLL,EXE} -
3330: 20 63 6f 6d 6d 61 6e 64 73 20 66 6f 72 20 65 6d   commands for em
3340: 62 65 64 64 69 6e 67 20 61 20 6d 61 6e 69 66 65  bedding a manife
3350: 73 74 20 69 66 20 6e 65 65 64 65 64 0a 0a 63 63  st if needed..cc
3360: 33 32 09 09 3d 20 24 28 43 43 29 20 20 20 23 20  32..= $(CC)   # 
3370: 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c 74  built-in default
3380: 2e 0a 6c 69 6e 6b 33 32 09 09 3d 20 6c 69 6e 6b  ..link32..= link
3390: 0a 6c 69 62 33 32 09 09 3d 20 6c 69 62 0a 72 63  .lib32..= lib.rc
33a0: 33 32 09 09 3d 20 24 28 52 43 29 20 20 20 23 20  32..= $(RC)   # 
33b0: 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c 74  built-in default
33c0: 2e 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ...#------------
33d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
33e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
33f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3400: 2d 2d 2d 2d 0a 23 20 46 69 67 75 72 65 20 6f 75  ----.# Figure ou
3410: 74 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61  t the compiler a
3420: 72 63 68 69 74 65 63 74 75 72 65 20 61 6e 64 20  rchitecture and 
3430: 76 65 72 73 69 6f 6e 20 62 79 20 77 72 69 74 69  version by writi
3440: 6e 67 0a 23 20 74 68 65 20 43 20 6d 61 63 72 6f  ng.# the C macro
3450: 73 20 74 6f 20 61 20 66 69 6c 65 2c 20 70 72 65  s to a file, pre
3460: 70 72 6f 63 65 73 73 69 6e 67 20 74 68 65 6d 20  processing them 
3470: 77 69 74 68 20 74 68 65 20 43 0a 23 20 70 72 65  with the C.# pre
3480: 70 72 6f 63 65 73 73 6f 72 20 61 6e 64 20 72 65  processor and re
3490: 61 64 69 6e 67 20 62 61 63 6b 20 74 68 65 20 63  ading back the c
34a0: 72 65 61 74 65 64 20 66 69 6c 65 0a 0a 5f 48 41  reated file.._HA
34b0: 53 48 3d 5e 23 0a 5f 56 43 5f 4d 41 4e 49 46 45  SH=^#._VC_MANIFE
34c0: 53 54 5f 45 4d 42 45 44 5f 45 58 45 3d 0a 5f 56  ST_EMBED_EXE=._V
34d0: 43 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 44  C_MANIFEST_EMBED
34e0: 5f 44 4c 4c 3d 0a 56 43 56 45 52 3d 30 0a 21 69  _DLL=.VCVER=0.!i
34f0: 66 20 21 5b 65 63 68 6f 20 56 43 56 45 52 53 49  f ![echo VCVERSI
3500: 4f 4e 3d 5f 4d 53 43 5f 56 45 52 20 3e 20 76 65  ON=_MSC_VER > ve
3510: 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20  rcl.x] \.    && 
3520: 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29 69  ![echo $(_HASH)i
3530: 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 49 58 38  f defined(_M_IX8
3540: 36 29 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 5c  6) >> vercl.x] \
3550: 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20 41  .    && ![echo A
3560: 52 43 48 3d 49 58 38 36 20 3e 3e 20 76 65 72 63  RCH=IX86 >> verc
3570: 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b  l.x] \.    && ![
3580: 65 63 68 6f 20 24 28 5f 48 41 53 48 29 65 6c 69  echo $(_HASH)eli
3590: 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 41 4d 44  f defined(_M_AMD
35a0: 36 34 29 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20  64) >> vercl.x] 
35b0: 5c 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20  \.    && ![echo 
35c0: 41 52 43 48 3d 41 4d 44 36 34 20 3e 3e 20 76 65  ARCH=AMD64 >> ve
35d0: 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20  rcl.x] \.    && 
35e0: 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29 65  ![echo $(_HASH)e
35f0: 6c 69 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 41  lif defined(_M_A
3600: 52 4d 36 34 29 20 3e 3e 20 76 65 72 63 6c 2e 78  RM64) >> vercl.x
3610: 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b 65 63 68  ] \.    && ![ech
3620: 6f 20 41 52 43 48 3d 41 52 4d 36 34 20 3e 3e 20  o ARCH=ARM64 >> 
3630: 76 65 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26  vercl.x] \.    &
3640: 26 20 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48  & ![echo $(_HASH
3650: 29 65 6e 64 69 66 20 3e 3e 20 76 65 72 63 6c 2e  )endif >> vercl.
3660: 78 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b 24 28  x] \.    && ![$(
3670: 63 63 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20 2d 54  cc32) -nologo -T
3680: 43 20 2d 50 20 76 65 72 63 6c 2e 78 20 32 3e 4e  C -P vercl.x 2>N
3690: 55 4c 5d 0a 21 69 6e 63 6c 75 64 65 20 76 65 72  UL].!include ver
36a0: 63 6c 2e 69 0a 21 69 66 20 24 28 56 43 56 45 52  cl.i.!if $(VCVER
36b0: 53 49 4f 4e 29 20 3c 20 31 39 30 30 0a 21 69 66  SION) < 1900.!if
36c0: 20 21 5b 65 63 68 6f 20 56 43 56 45 52 3d 20 5e   ![echo VCVER= ^
36d0: 5c 3e 20 76 65 72 63 6c 2e 76 63 5d 20 5c 0a 20  \> vercl.vc] \. 
36e0: 20 20 20 26 26 20 21 5b 73 65 74 20 2f 61 20 24     && ![set /a $
36f0: 28 56 43 56 45 52 53 49 4f 4e 29 20 2f 20 31 30  (VCVERSION) / 10
3700: 30 20 2d 20 36 20 3e 3e 20 76 65 72 63 6c 2e 76  0 - 6 >> vercl.v
3710: 63 5d 0a 21 69 6e 63 6c 75 64 65 20 76 65 72 63  c].!include verc
3720: 6c 2e 76 63 0a 21 65 6e 64 69 66 0a 21 65 6c 73  l.vc.!endif.!els
3730: 65 0a 23 20 54 68 65 20 73 69 6d 70 6c 65 20 63  e.# The simple c
3740: 61 6c 63 75 6c 61 74 69 6f 6e 20 61 62 6f 76 65  alculation above
3750: 20 64 6f 65 73 20 6e 6f 74 20 61 70 70 6c 79 20   does not apply 
3760: 74 6f 20 6e 65 77 20 56 69 73 75 61 6c 20 53 74  to new Visual St
3770: 75 64 69 6f 20 72 65 6c 65 61 73 65 73 0a 23 20  udio releases.# 
3780: 4b 65 65 70 20 74 68 65 20 63 6f 6d 70 69 6c 65  Keep the compile
3790: 72 20 76 65 72 73 69 6f 6e 20 69 6e 20 69 74 73  r version in its
37a0: 20 6e 61 74 69 76 65 20 66 6f 72 6d 2e 0a 56 43   native form..VC
37b0: 56 45 52 20 3d 20 24 28 56 43 56 45 52 53 49 4f  VER = $(VCVERSIO
37c0: 4e 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  N).!endif.!endif
37d0: 0a 0a 21 69 66 20 21 5b 64 65 6c 20 32 3e 4e 55  ..!if ![del 2>NU
37e0: 4c 20 2f 71 2f 66 20 76 65 72 63 6c 2e 78 20 76  L /q/f vercl.x v
37f0: 65 72 63 6c 2e 69 20 76 65 72 63 6c 2e 76 63 5d  ercl.i vercl.vc]
3800: 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d 2d  .!endif..#------
3810: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3820: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3830: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3840: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 68 65  ----------.# The
3850: 20 4d 41 43 48 49 4e 45 20 6d 61 63 72 6f 20 69   MACHINE macro i
3860: 73 20 75 73 65 64 20 62 79 20 6c 65 67 61 63 79  s used by legacy
3870: 20 6d 61 6b 65 66 69 6c 65 73 20 73 6f 20 73 65   makefiles so se
3880: 74 20 69 74 20 61 73 20 77 65 6c 6c 0a 21 69 66  t it as well.!if
3890: 64 65 66 20 4d 41 43 48 49 4e 45 0a 21 69 66 20  def MACHINE.!if 
38a0: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
38b0: 22 78 38 36 22 0a 21 75 6e 64 65 66 20 4d 41 43  "x86".!undef MAC
38c0: 48 49 4e 45 0a 4d 41 43 48 49 4e 45 20 3d 20 49  HINE.MACHINE = I
38d0: 58 38 36 0a 21 65 6c 73 65 69 66 20 22 24 28 4d  X86.!elseif "$(M
38e0: 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 61 72 6d  ACHINE)" == "arm
38f0: 36 34 22 0a 21 75 6e 64 65 66 20 4d 41 43 48 49  64".!undef MACHI
3900: 4e 45 0a 4d 41 43 48 49 4e 45 20 3d 20 41 52 4d  NE.MACHINE = ARM
3910: 36 34 0a 21 65 6c 73 65 69 66 20 22 24 28 4d 41  64.!elseif "$(MA
3920: 43 48 49 4e 45 29 22 20 3d 3d 20 22 78 36 34 22  CHINE)" == "x64"
3930: 0a 21 75 6e 64 65 66 20 4d 41 43 48 49 4e 45 0a  .!undef MACHINE.
3940: 4d 41 43 48 49 4e 45 20 3d 20 41 4d 44 36 34 0a  MACHINE = AMD64.
3950: 21 65 6e 64 69 66 0a 21 69 66 20 22 24 28 4d 41  !endif.!if "$(MA
3960: 43 48 49 4e 45 29 22 20 21 3d 20 22 24 28 41 52  CHINE)" != "$(AR
3970: 43 48 29 22 0a 21 65 72 72 6f 72 20 53 70 65 63  CH)".!error Spec
3980: 69 66 69 65 64 20 4d 41 43 48 49 4e 45 20 6d 61  ified MACHINE ma
3990: 63 72 6f 20 24 28 4d 41 43 48 49 4e 45 29 20 64  cro $(MACHINE) d
39a0: 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 64 65  oes not match de
39b0: 74 65 63 74 65 64 20 74 61 72 67 65 74 20 61 72  tected target ar
39c0: 63 68 69 74 65 63 74 75 72 65 20 24 28 41 52 43  chitecture $(ARC
39d0: 48 29 2e 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65  H)..!endif.!else
39e0: 0a 4d 41 43 48 49 4e 45 3d 24 28 41 52 43 48 29  .MACHINE=$(ARCH)
39f0: 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d 2d  .!endif..#------
3a00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3a10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3a20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3a30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 68 65 20  ---------.# The 
3a40: 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46  PLATFORM_IDENTIF
3a50: 59 20 6d 61 63 72 6f 20 6d 61 74 63 68 65 73 20  Y macro matches 
3a60: 74 68 65 20 76 61 6c 75 65 73 20 72 65 74 75 72  the values retur
3a70: 6e 65 64 20 62 79 0a 23 20 74 68 65 20 54 63 6c  ned by.# the Tcl
3a80: 20 70 6c 61 74 66 6f 72 6d 3a 3a 69 64 65 6e 74   platform::ident
3a90: 69 66 79 20 63 6f 6d 6d 61 6e 64 0a 21 69 66 20  ify command.!if 
3aa0: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
3ab0: 22 41 4d 44 36 34 22 0a 50 4c 41 54 46 4f 52 4d  "AMD64".PLATFORM
3ac0: 5f 49 44 45 4e 54 49 46 59 20 3d 20 77 69 6e 33  _IDENTIFY = win3
3ad0: 32 2d 78 38 36 5f 36 34 0a 21 65 6c 73 65 69 66  2-x86_64.!elseif
3ae0: 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d   "$(MACHINE)" ==
3af0: 20 22 41 52 4d 36 34 22 0a 50 4c 41 54 46 4f 52   "ARM64".PLATFOR
3b00: 4d 5f 49 44 45 4e 54 49 46 59 20 3d 20 77 69 6e  M_IDENTIFY = win
3b10: 33 32 2d 61 72 6d 0a 21 65 6c 73 65 0a 50 4c 41  32-arm.!else.PLA
3b20: 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 20 3d  TFORM_IDENTIFY =
3b30: 20 77 69 6e 33 32 2d 69 78 38 36 0a 21 65 6e 64   win32-ix86.!end
3b40: 69 66 0a 0a 23 20 54 68 65 20 4d 55 4c 54 49 50  if..# The MULTIP
3b50: 4c 41 54 46 4f 52 4d 20 6d 61 63 72 6f 20 63 6f  LATFORM macro co
3b60: 6e 74 72 6f 6c 73 20 77 68 65 74 68 65 72 20 62  ntrols whether b
3b70: 69 6e 61 72 79 20 65 78 74 65 6e 73 69 6f 6e 73  inary extensions
3b80: 20 61 72 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23   are installed.#
3b90: 20 69 6e 20 70 6c 61 74 66 6f 72 6d 2d 73 70 65   in platform-spe
3ba0: 63 69 66 69 63 20 64 69 72 65 63 74 6f 72 69 65  cific directorie
3bb0: 73 2e 20 49 6e 74 65 6e 64 65 64 20 74 6f 20 62  s. Intended to b
3bc0: 65 20 73 65 74 2f 75 73 65 64 20 62 79 20 65 78  e set/used by ex
3bd0: 74 65 6e 73 69 6f 6e 73 2e 0a 21 69 66 6e 64 65  tensions..!ifnde
3be0: 66 20 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d 5f  f MULTIPLATFORM_
3bf0: 49 4e 53 54 41 4c 4c 0a 4d 55 4c 54 49 50 4c 41  INSTALL.MULTIPLA
3c00: 54 46 4f 52 4d 5f 49 4e 53 54 41 4c 4c 20 3d 20  TFORM_INSTALL = 
3c10: 30 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d  0.!endif..#-----
3c20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3c30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3c40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3c50: 2d 2d 2d 2d 2d 2d 2d 0a 23 20 46 69 67 75 72 65  -------.# Figure
3c60: 20 6f 75 74 20 74 68 65 20 2a 68 6f 73 74 2a 20   out the *host* 
3c70: 61 72 63 68 69 74 65 63 74 75 72 65 20 62 79 20  architecture by 
3c80: 72 65 61 64 69 6e 67 20 74 68 65 20 72 65 67 69  reading the regi
3c90: 73 74 72 79 0a 0a 21 69 66 20 21 5b 72 65 67 20  stry..!if ![reg 
3ca0: 71 75 65 72 79 20 48 4b 4c 4d 5c 48 61 72 64 77  query HKLM\Hardw
3cb0: 61 72 65 5c 44 65 73 63 72 69 70 74 69 6f 6e 5c  are\Description\
3cc0: 53 79 73 74 65 6d 5c 43 65 6e 74 72 61 6c 50 72  System\CentralPr
3cd0: 6f 63 65 73 73 6f 72 5c 30 20 2f 76 20 49 64 65  ocessor\0 /v Ide
3ce0: 6e 74 69 66 69 65 72 20 7c 20 66 69 6e 64 73 74  ntifier | findst
3cf0: 72 20 2f 69 20 78 38 36 5d 0a 4e 41 54 49 56 45  r /i x86].NATIVE
3d00: 5f 41 52 43 48 3d 49 58 38 36 0a 21 65 6c 73 65  _ARCH=IX86.!else
3d10: 69 66 20 21 5b 72 65 67 20 71 75 65 72 79 20 48  if ![reg query H
3d20: 4b 4c 4d 5c 48 61 72 64 77 61 72 65 5c 44 65 73  KLM\Hardware\Des
3d30: 63 72 69 70 74 69 6f 6e 5c 53 79 73 74 65 6d 5c  cription\System\
3d40: 43 65 6e 74 72 61 6c 50 72 6f 63 65 73 73 6f 72  CentralProcessor
3d50: 5c 30 20 2f 76 20 49 64 65 6e 74 69 66 69 65 72  \0 /v Identifier
3d60: 20 7c 20 66 69 6e 64 73 74 72 20 2f 69 20 41 52   | findstr /i AR
3d70: 4d 20 7c 20 66 69 6e 64 73 74 72 20 2f 69 20 36  M | findstr /i 6
3d80: 34 2d 62 69 74 5d 0a 4e 41 54 49 56 45 5f 41 52  4-bit].NATIVE_AR
3d90: 43 48 3d 41 52 4d 36 34 0a 21 65 6c 73 65 0a 4e  CH=ARM64.!else.N
3da0: 41 54 49 56 45 5f 41 52 43 48 3d 41 4d 44 36 34  ATIVE_ARCH=AMD64
3db0: 0a 21 65 6e 64 69 66 0a 0a 23 20 53 69 6e 63 65  .!endif..# Since
3dc0: 20 4d 53 56 43 38 20 77 65 20 6d 75 73 74 20 64   MSVC8 we must d
3dd0: 65 61 6c 20 77 69 74 68 20 6d 61 6e 69 66 65 73  eal with manifes
3de0: 74 20 72 65 73 6f 75 72 63 65 73 2e 0a 21 69 66  t resources..!if
3df0: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 3d   $(VCVERSION) >=
3e00: 20 31 34 30 30 0a 5f 56 43 5f 4d 41 4e 49 46 45   1400._VC_MANIFE
3e10: 53 54 5f 45 4d 42 45 44 5f 45 58 45 3d 69 66 20  ST_EMBED_EXE=if 
3e20: 65 78 69 73 74 20 24 40 2e 6d 61 6e 69 66 65 73  exist $@.manifes
3e30: 74 20 6d 74 20 2d 6e 6f 6c 6f 67 6f 20 2d 6d 61  t mt -nologo -ma
3e40: 6e 69 66 65 73 74 20 24 40 2e 6d 61 6e 69 66 65  nifest $@.manife
3e50: 73 74 20 2d 6f 75 74 70 75 74 72 65 73 6f 75 72  st -outputresour
3e60: 63 65 3a 24 40 3b 31 0a 5f 56 43 5f 4d 41 4e 49  ce:$@;1._VC_MANI
3e70: 46 45 53 54 5f 45 4d 42 45 44 5f 44 4c 4c 3d 69  FEST_EMBED_DLL=i
3e80: 66 20 65 78 69 73 74 20 24 40 2e 6d 61 6e 69 66  f exist $@.manif
3e90: 65 73 74 20 6d 74 20 2d 6e 6f 6c 6f 67 6f 20 2d  est mt -nologo -
3ea0: 6d 61 6e 69 66 65 73 74 20 24 40 2e 6d 61 6e 69  manifest $@.mani
3eb0: 66 65 73 74 20 2d 6f 75 74 70 75 74 72 65 73 6f  fest -outputreso
3ec0: 75 72 63 65 3a 24 40 3b 32 0a 21 65 6e 64 69 66  urce:$@;2.!endif
3ed0: 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ..##############
3ee0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3ef0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3f00: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3f10: 23 23 0a 23 20 34 2e 20 42 75 69 6c 64 20 74 68  ##.# 4. Build th
3f20: 65 20 6e 6d 61 6b 65 68 6c 70 20 70 72 6f 67 72  e nmakehlp progr
3f30: 61 6d 0a 23 20 54 68 69 73 20 69 73 20 61 20 68  am.# This is a h
3f40: 65 6c 70 65 72 20 61 70 70 20 77 65 20 6e 65 65  elper app we nee
3f50: 64 20 74 6f 20 6f 76 65 72 63 6f 6d 65 20 6e 6d  d to overcome nm
3f60: 61 6b 65 27 73 20 6c 69 6d 69 74 69 6e 67 0a 23  ake's limiting.#
3f70: 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e 20 57 65   environment. We
3f80: 20 77 69 6c 6c 20 63 61 6c 6c 20 6f 75 74 20 74   will call out t
3f90: 6f 20 69 74 20 74 6f 20 67 65 74 20 76 61 72 69  o it to get vari
3fa0: 6f 75 73 20 62 69 74 73 20 6f 66 0a 23 20 69 6e  ous bits of.# in
3fb0: 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20  formation about 
3fc0: 73 75 70 70 6f 72 74 65 64 20 63 6f 6d 70 69 6c  supported compil
3fd0: 65 72 20 6f 70 74 69 6f 6e 73 20 65 74 63 2e 0a  er options etc..
3fe0: 23 0a 23 20 54 63 6c 20 69 74 73 65 6c 66 20 77  #.# Tcl itself w
3ff0: 69 6c 6c 20 61 6c 77 61 79 73 20 75 73 65 20 74  ill always use t
4000: 68 65 20 6e 6d 61 6b 65 68 6c 70 2e 63 20 70 72  he nmakehlp.c pr
4010: 6f 67 72 61 6d 20 77 68 69 63 68 20 69 73 0a 23  ogram which is.#
4020: 20 69 6e 20 69 74 73 20 6f 77 6e 20 73 6f 75 72   in its own sour
4030: 63 65 2e 20 49 74 20 77 69 6c 6c 20 62 65 20 6b  ce. It will be k
4040: 65 70 74 20 75 70 64 61 74 65 64 20 74 68 65 72  ept updated ther
4050: 65 2e 0a 23 0a 23 20 45 78 74 65 6e 73 69 6f 6e  e..#.# Extension
4060: 73 20 62 75 69 6c 74 20 61 67 61 69 6e 73 74 20  s built against 
4070: 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c  an installed Tcl
4080: 20 77 69 6c 6c 20 75 73 65 20 74 68 65 20 69 6e   will use the in
4090: 73 74 61 6c 6c 65 64 0a 23 20 63 6f 70 79 20 6f  stalled.# copy o
40a0: 66 20 54 63 6c 27 73 20 6e 6d 61 6b 65 68 6c 70  f Tcl's nmakehlp
40b0: 2e 63 20 69 66 20 74 68 65 72 65 20 69 73 20 6f  .c if there is o
40c0: 6e 65 20 61 6e 64 20 74 68 65 69 72 20 6f 77 6e  ne and their own
40d0: 20 76 65 72 73 69 6f 6e 0a 23 20 6f 74 68 65 72   version.# other
40e0: 77 69 73 65 2e 20 49 6e 20 74 68 65 20 6c 61 74  wise. In the lat
40f0: 74 65 72 20 63 61 73 65 2c 20 74 68 65 79 20 77  ter case, they w
4100: 6f 75 6c 64 20 61 6c 73 6f 20 62 65 20 75 73 69  ould also be usi
4110: 6e 67 20 74 68 65 69 72 20 6f 77 6e 0a 23 20 72  ng their own.# r
4120: 75 6c 65 73 2e 76 63 2e 20 4e 6f 74 65 20 74 68  ules.vc. Note th
4130: 61 74 20 6f 6c 64 65 72 20 76 65 72 73 69 6f 6e  at older version
4140: 73 20 6f 66 20 54 63 6c 20 64 6f 20 6e 6f 74 20  s of Tcl do not 
4150: 69 6e 73 74 61 6c 6c 20 6e 6d 61 6b 65 68 6c 70  install nmakehlp
4160: 2e 63 0a 23 20 6f 72 20 72 75 6c 65 73 2e 76 63  .c.# or rules.vc
4170: 2e 0a 23 0a 23 20 45 78 74 65 6e 73 69 6f 6e 73  ..#.# Extensions
4180: 20 62 75 69 6c 74 20 61 67 61 69 6e 73 74 20 54   built against T
4190: 63 6c 20 73 6f 75 72 63 65 73 20 77 69 6c 6c 20  cl sources will 
41a0: 75 73 65 20 74 68 65 20 6f 6e 65 20 66 72 6f 6d  use the one from
41b0: 20 74 68 65 20 54 63 6c 20 73 6f 75 72 63 65 2e   the Tcl source.
41c0: 0a 23 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69  .#.# When buildi
41d0: 6e 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20  ng an extension 
41e0: 75 73 69 6e 67 20 61 20 73 75 66 66 69 63 69 65  using a sufficie
41f0: 6e 74 6c 79 20 6e 65 77 20 76 65 72 73 69 6f 6e  ntly new version
4200: 20 6f 66 20 54 63 6c 2c 0a 23 20 72 75 6c 65 73   of Tcl,.# rules
4210: 2d 65 78 74 2e 76 63 20 77 69 6c 6c 20 64 65 66  -ext.vc will def
4220: 69 6e 65 20 4e 4d 41 4b 45 48 4c 50 43 20 61 70  ine NMAKEHLPC ap
4230: 70 72 6f 70 72 69 61 74 65 6c 79 20 74 6f 20 70  propriately to p
4240: 6f 69 6e 74 20 74 6f 20 74 68 65 0a 23 20 63 6f  oint to the.# co
4250: 70 79 20 6f 66 20 6e 6d 61 6b 65 68 6c 70 2e 63  py of nmakehlp.c
4260: 20 74 6f 20 62 65 20 75 73 65 64 2e 0a 0a 21 69   to be used...!i
4270: 66 6e 64 65 66 20 4e 4d 41 4b 45 48 4c 50 43 0a  fndef NMAKEHLPC.
4280: 23 20 44 65 66 61 75 6c 74 20 74 6f 20 74 68 65  # Default to the
4290: 20 6f 6e 65 20 69 6e 20 74 68 65 20 63 75 72 72   one in the curr
42a0: 65 6e 74 20 64 69 72 65 63 74 6f 72 79 20 28 74  ent directory (t
42b0: 68 65 20 65 78 74 65 6e 73 69 6f 6e 27 73 20 6f  he extension's o
42c0: 77 6e 20 6e 6d 61 6b 65 68 6c 70 2e 63 29 0a 4e  wn nmakehlp.c).N
42d0: 4d 41 4b 45 48 4c 50 43 20 3d 20 6e 6d 61 6b 65  MAKEHLPC = nmake
42e0: 68 6c 70 2e 63 0a 0a 21 69 66 20 21 24 28 44 4f  hlp.c..!if !$(DO
42f0: 49 4e 47 5f 54 43 4c 29 0a 21 69 66 20 24 28 54  ING_TCL).!if $(T
4300: 43 4c 49 4e 53 54 41 4c 4c 29 0a 21 69 66 20 65  CLINSTALL).!if e
4310: 78 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29  xist("$(_TCLDIR)
4320: 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 6e 6d 61 6b 65  \lib\nmake\nmake
4330: 68 6c 70 2e 63 22 29 0a 4e 4d 41 4b 45 48 4c 50  hlp.c").NMAKEHLP
4340: 43 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c  C = $(_TCLDIR)\l
4350: 69 62 5c 6e 6d 61 6b 65 5c 6e 6d 61 6b 65 68 6c  ib\nmake\nmakehl
4360: 70 2e 63 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65  p.c.!endif.!else
4370: 20 23 20 21 24 28 54 43 4c 49 4e 53 54 41 4c 4c   # !$(TCLINSTALL
4380: 29 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f  ).!if exist("$(_
4390: 54 43 4c 44 49 52 29 5c 77 69 6e 5c 6e 6d 61 6b  TCLDIR)\win\nmak
43a0: 65 68 6c 70 2e 63 22 29 0a 4e 4d 41 4b 45 48 4c  ehlp.c").NMAKEHL
43b0: 50 43 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  PC = $(_TCLDIR)\
43c0: 77 69 6e 5c 6e 6d 61 6b 65 68 6c 70 2e 63 0a 21  win\nmakehlp.c.!
43d0: 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20 24  endif.!endif # $
43e0: 28 54 43 4c 49 4e 53 54 41 4c 4c 29 0a 21 65 6e  (TCLINSTALL).!en
43f0: 64 69 66 20 23 20 21 24 28 44 4f 49 4e 47 5f 54  dif # !$(DOING_T
4400: 43 4c 29 0a 0a 21 65 6e 64 69 66 20 23 20 4e 4d  CL)..!endif # NM
4410: 41 4b 45 48 4c 50 43 0a 0a 23 20 57 65 20 61 6c  AKEHLPC..# We al
4420: 77 61 79 73 20 62 75 69 6c 64 20 6e 6d 61 6b 65  ways build nmake
4430: 68 6c 70 20 65 76 65 6e 20 69 66 20 69 74 20 65  hlp even if it e
4440: 78 69 73 74 73 20 73 69 6e 63 65 20 77 65 20 64  xists since we d
4450: 6f 20 6e 6f 74 20 6b 6e 6f 77 0a 23 20 77 68 61  o not know.# wha
4460: 74 20 73 6f 75 72 63 65 20 69 74 20 77 61 73 20  t source it was 
4470: 62 75 69 6c 74 20 66 72 6f 6d 2e 0a 21 69 66 20  built from..!if 
4480: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
4490: 22 49 58 38 36 22 20 7c 7c 20 22 24 28 4d 41 43  "IX86" || "$(MAC
44a0: 48 49 4e 45 29 22 20 3d 3d 20 22 24 28 4e 41 54  HINE)" == "$(NAT
44b0: 49 56 45 5f 41 52 43 48 29 22 0a 21 69 66 20 5b  IVE_ARCH)".!if [
44c0: 24 28 63 63 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20  $(cc32) -nologo 
44d0: 22 24 28 4e 4d 41 4b 45 48 4c 50 43 29 22 20 2d  "$(NMAKEHLPC)" -
44e0: 6c 69 6e 6b 20 2d 73 75 62 73 79 73 74 65 6d 3a  link -subsystem:
44f0: 63 6f 6e 73 6f 6c 65 20 3e 20 6e 75 6c 5d 0a 21  console > nul].!
4500: 65 6e 64 69 66 0a 21 65 6c 73 65 0a 21 69 66 20  endif.!else.!if 
4510: 5b 63 6f 70 79 20 24 28 4e 4d 41 4b 45 48 4c 50  [copy $(NMAKEHLP
4520: 43 3a 6e 6d 61 6b 65 68 6c 70 2e 63 3d 78 38 36  C:nmakehlp.c=x86
4530: 5f 36 34 2d 77 36 34 2d 6d 69 6e 67 77 33 32 2d  _64-w64-mingw32-
4540: 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 29 20 6e 6d  nmakehlp.exe) nm
4550: 61 6b 65 68 6c 70 2e 65 78 65 20 3e 4e 55 4c 5d  akehlp.exe >NUL]
4560: 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a  .!endif.!endif..
4570: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4580: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4590: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
45a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
45b0: 0a 23 20 35 2e 20 54 65 73 74 20 66 6f 72 20 63  .# 5. Test for c
45c0: 6f 6d 70 69 6c 65 72 20 66 65 61 74 75 72 65 73  ompiler features
45d0: 0a 23 20 56 69 73 75 61 6c 20 43 2b 2b 20 63 6f  .# Visual C++ co
45e0: 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e 73 20 68  mpiler options h
45f0: 61 76 65 20 63 68 61 6e 67 65 64 20 6f 76 65 72  ave changed over
4600: 20 74 68 65 20 79 65 61 72 73 2e 20 43 68 65 63   the years. Chec
4610: 6b 0a 23 20 77 68 69 63 68 20 6f 70 74 69 6f 6e  k.# which option
4620: 73 20 61 72 65 20 73 75 70 70 6f 72 74 65 64 20  s are supported 
4630: 62 79 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20  by the compiler 
4640: 69 6e 20 75 73 65 2e 0a 23 0a 23 20 54 68 65 20  in use..#.# The 
4650: 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73  following macros
4660: 20 61 72 65 20 73 65 74 3a 0a 23 20 4f 50 54 49   are set:.# OPTI
4670: 4d 49 5a 41 54 49 4f 4e 53 20 2d 20 74 68 65 20  MIZATIONS - the 
4680: 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73 20 74  compiler flags t
4690: 6f 20 62 65 20 75 73 65 64 20 66 6f 72 20 6f 70  o be used for op
46a0: 74 69 6d 69 7a 65 64 20 62 75 69 6c 64 73 0a 23  timized builds.#
46b0: 20 44 45 42 55 47 46 4c 41 47 53 20 2d 20 74 68   DEBUGFLAGS - th
46c0: 65 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73  e compiler flags
46d0: 20 74 6f 20 62 65 20 75 73 65 64 20 66 6f 72 20   to be used for 
46e0: 64 65 62 75 67 20 62 75 69 6c 64 73 0a 23 20 4c  debug builds.# L
46f0: 49 4e 4b 45 52 46 4c 41 47 53 20 2d 20 46 6c 61  INKERFLAGS - Fla
4700: 67 73 20 70 61 73 73 65 64 20 74 6f 20 74 68 65  gs passed to the
4710: 20 6c 69 6e 6b 65 72 0a 23 0a 23 20 4e 6f 74 65   linker.#.# Note
4720: 20 74 68 61 74 20 74 68 65 73 65 20 61 72 65 20   that these are 
4730: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 73 65 74  the compiler set
4740: 74 69 6e 67 73 20 2a 61 76 61 69 6c 61 62 6c 65  tings *available
4750: 2a 2c 20 6e 6f 74 20 74 68 6f 73 65 0a 23 20 74  *, not those.# t
4760: 68 61 74 20 77 69 6c 6c 20 62 65 20 2a 75 73 65  hat will be *use
4770: 64 2a 2e 20 54 68 65 20 6c 61 74 74 65 72 20 64  d*. The latter d
4780: 65 70 65 6e 64 73 20 6f 6e 20 74 68 65 20 4f 50  epends on the OP
4790: 54 53 20 6d 61 63 72 6f 20 73 65 74 74 69 6e 67  TS macro setting
47a0: 73 0a 23 20 77 68 69 63 68 20 77 65 20 68 61 76  s.# which we hav
47b0: 65 20 6e 6f 74 20 79 65 74 20 70 61 72 73 65 64  e not yet parsed
47c0: 2e 0a 23 0a 23 20 41 6c 73 6f 20 6e 6f 74 65 20  ..#.# Also note 
47d0: 74 68 61 74 20 73 6f 6d 65 20 6f 66 20 74 68 65  that some of the
47e0: 20 66 6c 61 67 73 20 69 6e 20 4f 50 54 49 4d 49   flags in OPTIMI
47f0: 5a 41 54 49 4f 4e 53 20 61 72 65 20 6e 6f 74 20  ZATIONS are not 
4800: 72 65 61 6c 6c 79 0a 23 20 72 65 6c 61 74 65 64  really.# related
4810: 20 74 6f 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e   to optimization
4820: 2e 20 54 68 65 79 20 61 72 65 20 70 6c 61 63 65  . They are place
4830: 64 20 74 68 65 72 65 20 6f 6e 6c 79 20 66 6f 72  d there only for
4840: 20 6c 65 67 61 63 79 20 72 65 61 73 6f 6e 73 0a   legacy reasons.
4850: 23 20 61 73 20 73 6f 6d 65 20 65 78 74 65 6e 73  # as some extens
4860: 69 6f 6e 73 20 65 78 70 65 63 74 20 74 68 65 6d  ions expect them
4870: 20 74 6f 20 62 65 20 69 6e 63 6c 75 64 65 64 20   to be included 
4880: 69 6e 20 74 68 61 74 20 6d 61 63 72 6f 2e 0a 0a  in that macro...
4890: 23 20 2d 4f 70 20 69 6d 70 72 6f 76 65 73 20 66  # -Op improves f
48a0: 6c 6f 61 74 20 63 6f 6e 73 69 73 74 65 6e 63 79  loat consistency
48b0: 2e 20 4e 6f 74 65 20 6f 6e 6c 79 20 6e 65 65 64  . Note only need
48c0: 65 64 20 66 6f 72 20 6f 6c 64 65 72 20 63 6f 6d  ed for older com
48d0: 70 69 6c 65 72 73 0a 23 20 4e 65 77 65 72 20 63  pilers.# Newer c
48e0: 6f 6d 70 69 6c 65 72 73 20 64 6f 20 6e 6f 74 20  ompilers do not 
48f0: 6e 65 65 64 20 6f 72 20 73 75 70 70 6f 72 74 20  need or support 
4900: 74 68 69 73 20 6f 70 74 69 6f 6e 2e 0a 21 69 66  this option..!if
4910: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63 20 2d 4f   [nmakehlp -c -O
4920: 70 5d 0a 46 50 4f 50 54 53 20 20 3d 20 2d 4f 70  p].FPOPTS  = -Op
4930: 0a 21 65 6e 64 69 66 0a 0a 23 20 53 74 72 69 63  .!endif..# Stric
4940: 74 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74  t floating point
4950: 20 73 65 6d 61 6e 74 69 63 73 20 2d 20 70 72 65   semantics - pre
4960: 73 65 6e 74 20 69 6e 20 6e 65 77 65 72 20 63 6f  sent in newer co
4970: 6d 70 69 6c 65 72 73 20 69 6e 20 6c 69 65 75 20  mpilers in lieu 
4980: 6f 66 20 2d 4f 70 0a 21 69 66 20 5b 6e 6d 61 6b  of -Op.!if [nmak
4990: 65 68 6c 70 20 2d 63 20 2d 66 70 3a 73 74 72 69  ehlp -c -fp:stri
49a0: 63 74 5d 0a 46 50 4f 50 54 53 20 20 3d 20 24 28  ct].FPOPTS  = $(
49b0: 46 50 4f 50 54 53 29 20 2d 66 70 3a 73 74 72 69  FPOPTS) -fp:stri
49c0: 63 74 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 22  ct.!endif..!if "
49d0: 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22  $(MACHINE)" == "
49e0: 49 58 38 36 22 0a 23 23 23 20 74 65 73 74 20 66  IX86".### test f
49f0: 6f 72 20 70 65 6e 74 69 75 6d 20 65 72 72 61 74  or pentium errat
4a00: 61 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  a.!if [nmakehlp 
4a10: 2d 63 20 2d 51 49 30 66 5d 0a 21 6d 65 73 73 61  -c -QI0f].!messa
4a20: 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 20  ge *** Compiler 
4a30: 68 61 73 20 27 50 65 6e 74 69 75 6d 20 30 78 30  has 'Pentium 0x0
4a40: 66 20 66 69 78 27 0a 46 50 4f 50 54 53 20 20 3d  f fix'.FPOPTS  =
4a50: 20 24 28 46 50 4f 50 54 53 29 20 2d 51 49 30 66   $(FPOPTS) -QI0f
4a60: 0a 21 65 6c 73 65 0a 21 6d 65 73 73 61 67 65 20  .!else.!message 
4a70: 2a 2a 2a 20 43 6f 6d 70 69 6c 65 72 20 64 6f 65  *** Compiler doe
4a80: 73 20 6e 6f 74 20 68 61 76 65 20 27 50 65 6e 74  s not have 'Pent
4a90: 69 75 6d 20 30 78 30 66 20 66 69 78 27 0a 21 65  ium 0x0f fix'.!e
4aa0: 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a 23 23 23  ndif.!endif..###
4ab0: 20 74 65 73 74 20 66 6f 72 20 6f 70 74 69 6d 69   test for optimi
4ac0: 7a 61 74 69 6f 6e 73 0a 23 20 2f 4f 32 20 6f 70  zations.# /O2 op
4ad0: 74 69 6d 69 7a 61 74 69 6f 6e 20 69 6e 63 6c 75  timization inclu
4ae0: 64 65 73 20 2f 4f 67 20 2f 4f 69 20 2f 4f 74 20  des /Og /Oi /Ot 
4af0: 2f 4f 79 20 2f 4f 62 32 20 2f 47 73 20 2f 47 46  /Oy /Ob2 /Gs /GF
4b00: 20 2f 47 79 20 61 73 20 70 65 72 0a 23 20 64 6f   /Gy as per.# do
4b10: 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 20 4e 6f 74  cumentation. Not
4b20: 65 20 77 65 20 64 6f 20 4e 4f 54 20 77 61 6e 74  e we do NOT want
4b30: 20 2f 47 73 20 61 73 20 74 68 61 74 20 69 6e 73   /Gs as that ins
4b40: 65 72 74 73 20 61 20 5f 63 68 6b 73 74 6b 0a 23  erts a _chkstk.#
4b50: 20 73 74 61 63 6b 20 70 72 6f 62 65 20 61 74 20   stack probe at 
4b60: 2a 65 76 65 72 79 2a 20 66 75 6e 63 74 69 6f 6e  *every* function
4b70: 20 65 6e 74 72 79 2c 20 6e 6f 74 20 6a 75 73 74   entry, not just
4b80: 20 74 68 6f 73 65 20 77 69 74 68 20 6d 6f 72 65   those with more
4b90: 20 74 68 61 6e 0a 23 20 61 20 70 61 67 65 20 6f   than.# a page o
4ba0: 66 20 73 74 61 63 6b 20 61 6c 6c 6f 63 61 74 69  f stack allocati
4bb0: 6f 6e 20 72 65 73 75 6c 74 69 6e 67 20 69 6e 20  on resulting in 
4bc0: 61 20 70 65 72 66 6f 72 6d 61 6e 63 65 20 68 69  a performance hi
4bd0: 74 2e 20 20 48 6f 77 65 76 65 72 2c 0a 23 20 2f  t.  However,.# /
4be0: 4f 32 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e  O2 documentation
4bf0: 20 69 73 20 6d 69 73 6c 65 61 64 69 6e 67 20 61   is misleading a
4c00: 73 20 69 74 73 20 73 74 61 63 6b 20 70 72 6f 62  s its stack prob
4c10: 65 73 20 61 72 65 20 73 69 6d 70 6c 79 20 74 68  es are simply th
4c20: 65 0a 23 20 64 65 66 61 75 6c 74 20 70 61 67 65  e.# default page
4c30: 20 73 69 7a 65 20 6c 6f 63 61 6c 73 20 61 6c 6c   size locals all
4c40: 6f 63 61 74 69 6f 6e 20 70 72 6f 62 65 73 20 61  ocation probes a
4c50: 6e 64 20 6e 6f 74 20 77 68 61 74 20 69 73 20 69  nd not what is i
4c60: 6d 70 6c 69 65 64 0a 23 20 62 79 20 61 6e 20 65  mplied.# by an e
4c70: 78 70 6c 69 63 69 74 20 2f 47 73 20 6f 70 74 69  xplicit /Gs opti
4c80: 6f 6e 2e 0a 0a 4f 50 54 49 4d 49 5a 41 54 49 4f  on...OPTIMIZATIO
4c90: 4e 53 20 3d 20 24 28 46 50 4f 50 54 53 29 0a 0a  NS = $(FPOPTS)..
4ca0: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63  !if [nmakehlp -c
4cb0: 20 2d 4f 32 5d 0a 4f 50 54 49 4d 49 5a 49 4e 47   -O2].OPTIMIZING
4cc0: 20 3d 20 31 0a 4f 50 54 49 4d 49 5a 41 54 49 4f   = 1.OPTIMIZATIO
4cd0: 4e 53 20 20 20 3d 20 24 28 4f 50 54 49 4d 49 5a  NS   = $(OPTIMIZ
4ce0: 41 54 49 4f 4e 53 29 20 2d 4f 32 0a 21 65 6c 73  ATIONS) -O2.!els
4cf0: 65 0a 23 20 4c 65 67 61 63 79 2c 20 72 65 61 6c  e.# Legacy, real
4d00: 6c 79 2e 20 41 6c 6c 20 6d 6f 64 65 72 6e 20 63  ly. All modern c
4d10: 6f 6d 70 69 6c 65 72 73 20 73 75 70 70 6f 72 74  ompilers support
4d20: 20 74 68 69 73 0a 21 6d 65 73 73 61 67 65 20 2a   this.!message *
4d30: 2a 2a 20 43 6f 6d 70 69 6c 65 72 20 64 6f 65 73  ** Compiler does
4d40: 20 6e 6f 74 20 68 61 76 65 20 27 4f 70 74 69 6d   not have 'Optim
4d50: 69 7a 61 74 69 6f 6e 73 27 0a 4f 50 54 49 4d 49  izations'.OPTIMI
4d60: 5a 49 4e 47 20 3d 20 30 0a 21 65 6e 64 69 66 0a  ZING = 0.!endif.
4d70: 0a 23 20 43 68 65 63 6b 73 20 66 6f 72 20 62 75  .# Checks for bu
4d80: 66 66 65 72 20 6f 76 65 72 66 6c 6f 77 73 20 69  ffer overflows i
4d90: 6e 20 6c 6f 63 61 6c 20 61 72 72 61 79 73 0a 21  n local arrays.!
4da0: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 63 20  if [nmakehlp -c 
4db0: 2d 47 53 5d 0a 4f 50 54 49 4d 49 5a 41 54 49 4f  -GS].OPTIMIZATIO
4dc0: 4e 53 20 20 3d 20 24 28 4f 50 54 49 4d 49 5a 41  NS  = $(OPTIMIZA
4dd0: 54 49 4f 4e 53 29 20 2d 47 53 0a 21 65 6e 64 69  TIONS) -GS.!endi
4de0: 66 0a 0a 23 20 4c 69 6e 6b 20 74 69 6d 65 20 6f  f..# Link time o
4df0: 70 74 69 6d 69 7a 61 74 69 6f 6e 2e 20 4e 6f 74  ptimization. Not
4e00: 65 20 74 68 61 74 20 74 68 69 73 20 6f 70 74 69  e that this opti
4e10: 6f 6e 20 28 70 6f 74 65 6e 74 69 61 6c 6c 79 29  on (potentially)
4e20: 20 6d 61 6b 65 73 0a 23 20 67 65 6e 65 72 61 74   makes.# generat
4e30: 65 64 20 6c 69 62 72 61 72 69 65 73 20 6f 6e 6c  ed libraries onl
4e40: 79 20 75 73 61 62 6c 65 20 62 79 20 74 68 65 20  y usable by the 
4e50: 73 70 65 63 69 66 69 63 20 56 43 2b 2b 20 76 65  specific VC++ ve
4e60: 72 73 69 6f 6e 20 74 68 61 74 0a 23 20 63 72 65  rsion that.# cre
4e70: 61 74 65 64 20 69 74 2e 20 52 65 71 75 69 72 65  ated it. Require
4e80: 73 20 2f 4c 54 43 47 20 6c 69 6e 6b 65 72 20 6f  s /LTCG linker o
4e90: 70 74 69 6f 6e 0a 21 69 66 20 5b 6e 6d 61 6b 65  ption.!if [nmake
4ea0: 68 6c 70 20 2d 63 20 2d 47 4c 5d 0a 4f 50 54 49  hlp -c -GL].OPTI
4eb0: 4d 49 5a 41 54 49 4f 4e 53 20 20 3d 20 24 28 4f  MIZATIONS  = $(O
4ec0: 50 54 49 4d 49 5a 41 54 49 4f 4e 53 29 20 2d 47  PTIMIZATIONS) -G
4ed0: 4c 0a 43 43 5f 47 4c 5f 4f 50 54 5f 45 4e 41 42  L.CC_GL_OPT_ENAB
4ee0: 4c 45 44 20 3d 20 31 0a 21 65 6c 73 65 0a 23 20  LED = 1.!else.# 
4ef0: 49 6e 20 6e 65 77 65 72 20 63 6f 6d 70 69 6c 65  In newer compile
4f00: 72 73 20 2d 47 4c 20 61 6e 64 20 2d 59 58 20 61  rs -GL and -YX a
4f10: 72 65 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 2e  re incompatible.
4f20: 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  .!if [nmakehlp -
4f30: 63 20 2d 59 58 5d 0a 4f 50 54 49 4d 49 5a 41 54  c -YX].OPTIMIZAT
4f40: 49 4f 4e 53 20 20 3d 20 24 28 4f 50 54 49 4d 49  IONS  = $(OPTIMI
4f50: 5a 41 54 49 4f 4e 53 29 20 2d 59 58 0a 21 65 6e  ZATIONS) -YX.!en
4f60: 64 69 66 0a 21 65 6e 64 69 66 20 23 20 5b 6e 6d  dif.!endif # [nm
4f70: 61 6b 65 68 6c 70 20 2d 63 20 2d 47 4c 5d 0a 0a  akehlp -c -GL]..
4f80: 44 45 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d  DEBUGFLAGS     =
4f90: 20 24 28 46 50 4f 50 54 53 29 0a 0a 23 20 52 75   $(FPOPTS)..# Ru
4fa0: 6e 20 74 69 6d 65 20 65 72 72 6f 72 20 63 68 65  n time error che
4fb0: 63 6b 73 2e 20 4e 6f 74 20 61 76 61 69 6c 61 62  cks. Not availab
4fc0: 6c 65 20 6f 72 20 76 61 6c 69 64 20 69 6e 20 61  le or valid in a
4fd0: 20 72 65 6c 65 61 73 65 2c 20 6e 6f 6e 2d 64 65   release, non-de
4fe0: 62 75 67 20 62 75 69 6c 64 0a 23 20 52 54 43 20  bug build.# RTC 
4ff0: 69 73 20 66 6f 72 20 6d 6f 64 65 72 6e 20 63 6f  is for modern co
5000: 6d 70 69 6c 65 72 73 2c 20 2d 47 5a 20 69 73 20  mpilers, -GZ is 
5010: 6c 65 67 61 63 79 0a 21 69 66 20 5b 6e 6d 61 6b  legacy.!if [nmak
5020: 65 68 6c 70 20 2d 63 20 2d 52 54 43 31 5d 0a 44  ehlp -c -RTC1].D
5030: 45 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d 20  EBUGFLAGS     = 
5040: 24 28 44 45 42 55 47 46 4c 41 47 53 29 20 2d 52  $(DEBUGFLAGS) -R
5050: 54 43 31 0a 21 65 6c 73 65 69 66 20 5b 6e 6d 61  TC1.!elseif [nma
5060: 6b 65 68 6c 70 20 2d 63 20 2d 47 5a 5d 0a 44 45  kehlp -c -GZ].DE
5070: 42 55 47 46 4c 41 47 53 20 20 20 20 20 3d 20 24  BUGFLAGS     = $
5080: 28 44 45 42 55 47 46 4c 41 47 53 29 20 2d 47 5a  (DEBUGFLAGS) -GZ
5090: 0a 21 65 6e 64 69 66 0a 0a 23 2d 2d 2d 2d 2d 2d  .!endif..#------
50a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
50b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
50c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
50d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 4c 69 6e  ----------.# Lin
50e0: 6b 65 72 20 66 6c 61 67 73 0a 0a 23 20 4c 49 4e  ker flags..# LIN
50f0: 4b 45 52 5f 54 45 53 54 46 4c 41 47 53 20 61 72  KER_TESTFLAGS ar
5100: 65 20 66 6f 72 20 69 6e 74 65 72 6e 61 6c 20 75  e for internal u
5110: 73 65 20 77 68 65 6e 20 77 65 20 63 61 6c 6c 20  se when we call 
5120: 6e 6d 61 6b 65 68 6c 70 20 74 6f 20 74 65 73 74  nmakehlp to test
5130: 0a 23 20 69 66 20 74 68 65 20 6c 69 6e 6b 65 72  .# if the linker
5140: 20 73 75 70 70 6f 72 74 73 20 61 20 73 70 65 63   supports a spec
5150: 69 66 69 63 20 6f 70 74 69 6f 6e 2e 20 57 69 74  ific option. Wit
5160: 68 6f 75 74 20 74 68 65 73 65 20 66 6c 61 67 73  hout these flags
5170: 20 6c 69 6e 6b 20 77 69 6c 6c 0a 23 20 72 65 74   link will.# ret
5180: 75 72 6e 20 22 4c 4e 4b 31 35 36 31 3a 20 65 6e  urn "LNK1561: en
5190: 74 72 79 20 70 6f 69 6e 74 20 6d 75 73 74 20 62  try point must b
51a0: 65 20 64 65 66 69 6e 65 64 22 20 65 72 72 6f 72  e defined" error
51b0: 20 63 6f 6d 70 69 6c 69 6e 67 20 66 72 6f 6d 20   compiling from 
51c0: 56 53 2d 49 44 45 3a 0a 23 20 54 68 65 79 20 61  VS-IDE:.# They a
51d0: 72 65 20 6e 6f 74 20 70 61 73 73 65 64 20 74 68  re not passed th
51e0: 72 6f 75 67 68 20 74 6f 20 74 68 65 20 61 63 74  rough to the act
51f0: 75 61 6c 20 61 70 70 6c 69 63 61 74 69 6f 6e 20  ual application 
5200: 2f 20 65 78 74 65 6e 73 69 6f 6e 0a 23 20 6c 69  / extension.# li
5210: 6e 6b 20 72 75 6c 65 73 2e 0a 21 69 66 6e 64 65  nk rules..!ifnde
5220: 66 20 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41  f LINKER_TESTFLA
5230: 47 53 0a 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c  GS.LINKER_TESTFL
5240: 41 47 53 20 3d 20 2f 44 4c 4c 20 2f 4e 4f 45 4e  AGS = /DLL /NOEN
5250: 54 52 59 20 2f 4f 55 54 3a 6e 6d 61 6b 65 68 6c  TRY /OUT:nmakehl
5260: 70 2e 6f 75 74 0a 21 65 6e 64 69 66 0a 0a 4c 49  p.out.!endif..LI
5270: 4e 4b 45 52 46 4c 41 47 53 20 20 20 20 20 3d 0a  NKERFLAGS     =.
5280: 0a 23 20 49 66 20 63 6f 6d 70 69 6c 65 72 20 68  .# If compiler h
5290: 61 73 20 65 6e 61 62 6c 65 64 20 6c 69 6e 6b 20  as enabled link 
52a0: 74 69 6d 65 20 6f 70 74 69 6d 69 7a 61 74 69 6f  time optimizatio
52b0: 6e 2c 20 6c 69 6e 6b 65 72 20 6d 75 73 74 20 74  n, linker must t
52c0: 6f 6f 20 77 69 74 68 20 2d 6c 74 63 67 0a 21 69  oo with -ltcg.!i
52d0: 66 64 65 66 20 43 43 5f 47 4c 5f 4f 50 54 5f 45  fdef CC_GL_OPT_E
52e0: 4e 41 42 4c 45 44 0a 21 69 66 20 5b 6e 6d 61 6b  NABLED.!if [nmak
52f0: 65 68 6c 70 20 2d 6c 20 2d 6c 74 63 67 20 24 28  ehlp -l -ltcg $(
5300: 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41 47 53  LINKER_TESTFLAGS
5310: 29 5d 0a 4c 49 4e 4b 45 52 46 4c 41 47 53 20 20  )].LINKERFLAGS  
5320: 20 20 20 3d 20 24 28 4c 49 4e 4b 45 52 46 4c 41     = $(LINKERFLA
5330: 47 53 29 20 2d 6c 74 63 67 0a 21 65 6e 64 69 66  GS) -ltcg.!endif
5340: 0a 21 65 6e 64 69 66 0a 0a 0a 23 23 23 23 23 23  .!endif...######
5350: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5360: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5370: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5380: 23 23 23 23 23 23 23 23 23 23 0a 23 20 36 2e 20  ##########.# 6. 
5390: 45 78 74 72 61 63 74 20 76 61 72 69 6f 75 73 20  Extract various 
53a0: 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20  version numbers 
53b0: 66 72 6f 6d 20 68 65 61 64 65 72 73 0a 23 20 46  from headers.# F
53c0: 6f 72 20 54 63 6c 20 61 6e 64 20 54 6b 2c 20 76  or Tcl and Tk, v
53d0: 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20 61  ersion numbers a
53e0: 72 65 20 65 78 74 72 61 63 74 65 64 20 66 72 6f  re extracted fro
53f0: 6d 20 74 63 6c 2e 68 20 61 6e 64 20 74 6b 2e 68  m tcl.h and tk.h
5400: 0a 23 20 72 65 73 70 65 63 74 69 76 65 6c 79 2e  .# respectively.
5410: 20 46 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 2c   For extensions,
5420: 20 76 65 72 73 69 6f 6e 73 20 61 72 65 20 65 78   versions are ex
5430: 74 72 61 63 74 65 64 20 66 72 6f 6d 20 74 68 65  tracted from the
5440: 0a 23 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20  .# configure.in 
5450: 6f 72 20 63 6f 6e 66 69 67 75 72 65 2e 61 63 20  or configure.ac 
5460: 66 72 6f 6d 20 74 68 65 20 54 45 41 20 63 6f 6e  from the TEA con
5470: 66 69 67 75 72 61 74 69 6f 6e 20 69 66 20 69 74  figuration if it
5480: 0a 23 20 65 78 69 73 74 73 2c 20 61 6e 64 20 75  .# exists, and u
5490: 6e 73 65 74 20 6f 74 68 65 72 77 69 73 65 2e 0a  nset otherwise..
54a0: 23 20 53 65 74 73 20 74 68 65 20 66 6f 6c 6c 6f  # Sets the follo
54b0: 77 69 6e 67 20 6d 61 63 72 6f 73 3a 0a 23 20 54  wing macros:.# T
54c0: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e  CL_MAJOR_VERSION
54d0: 0a 23 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52  .# TCL_MINOR_VER
54e0: 53 49 4f 4e 0a 23 20 54 43 4c 5f 52 45 4c 45 41  SION.# TCL_RELEA
54f0: 53 45 5f 53 45 52 49 41 4c 0a 23 20 54 43 4c 5f  SE_SERIAL.# TCL_
5500: 50 41 54 43 48 5f 4c 45 56 45 4c 0a 23 20 54 43  PATCH_LEVEL.# TC
5510: 4c 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 0a 23  L_PATCH_LETTER.#
5520: 20 54 43 4c 5f 56 45 52 53 49 4f 4e 0a 23 20 54   TCL_VERSION.# T
5530: 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 0a  K_MAJOR_VERSION.
5540: 23 20 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49  # TK_MINOR_VERSI
5550: 4f 4e 0a 23 20 54 4b 5f 52 45 4c 45 41 53 45 5f  ON.# TK_RELEASE_
5560: 53 45 52 49 41 4c 0a 23 20 54 4b 5f 50 41 54 43  SERIAL.# TK_PATC
5570: 48 5f 4c 45 56 45 4c 0a 23 20 54 4b 5f 50 41 54  H_LEVEL.# TK_PAT
5580: 43 48 5f 4c 45 54 54 45 52 0a 23 20 54 4b 5f 56  CH_LETTER.# TK_V
5590: 45 52 53 49 4f 4e 0a 23 20 44 4f 54 56 45 52 53  ERSION.# DOTVERS
55a0: 49 4f 4e 20 2d 20 73 65 74 20 61 73 20 28 66 6f  ION - set as (fo
55b0: 72 20 65 78 61 6d 70 6c 65 29 20 32 2e 35 0a 23  r example) 2.5.#
55c0: 20 56 45 52 53 49 4f 4e 20 2d 20 73 65 74 20 61   VERSION - set a
55d0: 73 20 28 66 6f 72 20 65 78 61 6d 70 6c 65 20 32  s (for example 2
55e0: 35 29 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  5).#------------
55f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5610: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5620: 2d 2d 0a 0a 21 69 66 20 5b 65 63 68 6f 20 52 45  --..!if [echo RE
5630: 4d 20 3d 20 54 68 69 73 20 66 69 6c 65 20 69 73  M = This file is
5640: 20 67 65 6e 65 72 61 74 65 64 20 66 72 6f 6d 20   generated from 
5650: 72 75 6c 65 73 2e 76 63 20 3e 20 76 65 72 73 69  rules.vc > versi
5660: 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21  ons.vc].!endif.!
5670: 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 4d 41 4a  if [echo TCL_MAJ
5680: 4f 52 5f 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e  OR_VERSION = \>>
5690: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a   versions.vc] \.
56a0: 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20     && [nmakehlp 
56b0: 2d 56 20 22 24 28 5f 54 43 4c 5f 48 29 22 20 22  -V "$(_TCL_H)" "
56c0: 64 65 66 69 6e 65 20 54 43 4c 5f 4d 41 4a 4f 52  define TCL_MAJOR
56d0: 5f 56 45 52 53 49 4f 4e 22 20 3e 3e 20 76 65 72  _VERSION" >> ver
56e0: 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66  sions.vc].!endif
56f0: 0a 21 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 4d  .!if [echo TCL_M
5700: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 20 3d 20 5c  INOR_VERSION = \
5710: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20  >> versions.vc] 
5720: 5c 0a 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c  \.   && [nmakehl
5730: 70 20 2d 56 20 22 24 28 5f 54 43 4c 5f 48 29 22  p -V "$(_TCL_H)"
5740: 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49   TCL_MINOR_VERSI
5750: 4f 4e 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  ON >> versions.v
5760: 63 5d 0a 21 65 6e 64 69 66 0a 21 69 66 20 5b 65  c].!endif.!if [e
5770: 63 68 6f 20 54 43 4c 5f 52 45 4c 45 41 53 45 5f  cho TCL_RELEASE_
5780: 53 45 52 49 41 4c 20 3d 20 5c 3e 3e 20 76 65 72  SERIAL = \>> ver
5790: 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 26  sions.vc] \.   &
57a0: 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56 20 22  & [nmakehlp -V "
57b0: 24 28 5f 54 43 4c 5f 48 29 22 20 54 43 4c 5f 52  $(_TCL_H)" TCL_R
57c0: 45 4c 45 41 53 45 5f 53 45 52 49 41 4c 20 3e 3e  ELEASE_SERIAL >>
57d0: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65   versions.vc].!e
57e0: 6e 64 69 66 0a 21 69 66 20 5b 65 63 68 6f 20 54  ndif.!if [echo T
57f0: 43 4c 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20 3d  CL_PATCH_LEVEL =
5800: 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63   \>> versions.vc
5810: 5d 20 5c 0a 20 20 20 26 26 20 5b 6e 6d 61 6b 65  ] \.   && [nmake
5820: 68 6c 70 20 2d 56 20 22 24 28 5f 54 43 4c 5f 48  hlp -V "$(_TCL_H
5830: 29 22 20 54 43 4c 5f 50 41 54 43 48 5f 4c 45 56  )" TCL_PATCH_LEV
5840: 45 4c 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  EL >> versions.v
5850: 63 5d 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 64  c].!endif..!if d
5860: 65 66 69 6e 65 64 28 5f 54 4b 5f 48 29 0a 21 69  efined(_TK_H).!i
5870: 66 20 5b 65 63 68 6f 20 54 4b 5f 4d 41 4a 4f 52  f [echo TK_MAJOR
5880: 5f 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76  _VERSION = \>> v
5890: 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20  ersions.vc] \.  
58a0: 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56   && [nmakehlp -V
58b0: 20 24 28 5f 54 4b 5f 48 29 20 22 64 65 66 69 6e   $(_TK_H) "defin
58c0: 65 20 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  e TK_MAJOR_VERSI
58d0: 4f 4e 22 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e  ON" >> versions.
58e0: 76 63 5d 0a 21 65 6e 64 69 66 0a 21 69 66 20 5b  vc].!endif.!if [
58f0: 65 63 68 6f 20 54 4b 5f 4d 49 4e 4f 52 5f 56 45  echo TK_MINOR_VE
5900: 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76 65 72 73  RSION = \>> vers
5910: 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 26 26  ions.vc] \.   &&
5920: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 56 20 24 28   [nmakehlp -V $(
5930: 5f 54 4b 5f 48 29 20 54 4b 5f 4d 49 4e 4f 52 5f  _TK_H) TK_MINOR_
5940: 56 45 52 53 49 4f 4e 20 3e 3e 20 76 65 72 73 69  VERSION >> versi
5950: 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21  ons.vc].!endif.!
5960: 69 66 20 5b 65 63 68 6f 20 54 4b 5f 52 45 4c 45  if [echo TK_RELE
5970: 41 53 45 5f 53 45 52 49 41 4c 20 3d 20 5c 3e 3e  ASE_SERIAL = \>>
5980: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a   versions.vc] \.
5990: 20 20 20 26 26 20 5b 6e 6d 61 6b 65 68 6c 70 20     && [nmakehlp 
59a0: 2d 56 20 22 24 28 5f 54 4b 5f 48 29 22 20 54 4b  -V "$(_TK_H)" TK
59b0: 5f 52 45 4c 45 41 53 45 5f 53 45 52 49 41 4c 20  _RELEASE_SERIAL 
59c0: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a  >> versions.vc].
59d0: 21 65 6e 64 69 66 0a 21 69 66 20 5b 65 63 68 6f  !endif.!if [echo
59e0: 20 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20   TK_PATCH_LEVEL 
59f0: 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  = \>> versions.v
5a00: 63 5d 20 5c 0a 20 20 20 26 26 20 5b 6e 6d 61 6b  c] \.   && [nmak
5a10: 65 68 6c 70 20 2d 56 20 24 28 5f 54 4b 5f 48 29  ehlp -V $(_TK_H)
5a20: 20 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20   TK_PATCH_LEVEL 
5a30: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a  >> versions.vc].
5a40: 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20  !endif.!endif # 
5a50: 5f 54 4b 5f 48 0a 0a 21 69 6e 63 6c 75 64 65 20  _TK_H..!include 
5a60: 76 65 72 73 69 6f 6e 73 2e 76 63 0a 0a 54 43 4c  versions.vc..TCL
5a70: 5f 56 45 52 53 49 4f 4e 09 3d 20 24 28 54 43 4c  _VERSION.= $(TCL
5a80: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 24  _MAJOR_VERSION)$
5a90: 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49  (TCL_MINOR_VERSI
5aa0: 4f 4e 29 0a 54 43 4c 5f 44 4f 54 56 45 52 53 49  ON).TCL_DOTVERSI
5ab0: 4f 4e 09 3d 20 24 28 54 43 4c 5f 4d 41 4a 4f 52  ON.= $(TCL_MAJOR
5ac0: 5f 56 45 52 53 49 4f 4e 29 2e 24 28 54 43 4c 5f  _VERSION).$(TCL_
5ad0: 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 21  MINOR_VERSION).!
5ae0: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20  if [nmakehlp -f 
5af0: 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45 56 45  $(TCL_PATCH_LEVE
5b00: 4c 29 20 22 61 22 5d 0a 54 43 4c 5f 50 41 54 43  L) "a"].TCL_PATC
5b10: 48 5f 4c 45 54 54 45 52 20 3d 20 61 0a 21 65 6c  H_LETTER = a.!el
5b20: 73 65 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  seif [nmakehlp -
5b30: 66 20 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45  f $(TCL_PATCH_LE
5b40: 56 45 4c 29 20 22 62 22 5d 0a 54 43 4c 5f 50 41  VEL) "b"].TCL_PA
5b50: 54 43 48 5f 4c 45 54 54 45 52 20 3d 20 62 0a 21  TCH_LETTER = b.!
5b60: 65 6c 73 65 0a 54 43 4c 5f 50 41 54 43 48 5f 4c  else.TCL_PATCH_L
5b70: 45 54 54 45 52 20 3d 20 2e 0a 21 65 6e 64 69 66  ETTER = ..!endif
5b80: 0a 0a 21 69 66 20 64 65 66 69 6e 65 64 28 5f 54  ..!if defined(_T
5b90: 4b 5f 48 29 0a 0a 54 4b 5f 56 45 52 53 49 4f 4e  K_H)..TK_VERSION
5ba0: 09 3d 20 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45  .= $(TK_MAJOR_VE
5bb0: 52 53 49 4f 4e 29 24 28 54 4b 5f 4d 49 4e 4f 52  RSION)$(TK_MINOR
5bc0: 5f 56 45 52 53 49 4f 4e 29 0a 54 4b 5f 44 4f 54  _VERSION).TK_DOT
5bd0: 56 45 52 53 49 4f 4e 09 3d 20 24 28 54 4b 5f 4d  VERSION.= $(TK_M
5be0: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28  AJOR_VERSION).$(
5bf0: 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e  TK_MINOR_VERSION
5c00: 29 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  ).!if [nmakehlp 
5c10: 2d 66 20 24 28 54 4b 5f 50 41 54 43 48 5f 4c 45  -f $(TK_PATCH_LE
5c20: 56 45 4c 29 20 22 61 22 5d 0a 54 4b 5f 50 41 54  VEL) "a"].TK_PAT
5c30: 43 48 5f 4c 45 54 54 45 52 20 3d 20 61 0a 21 65  CH_LETTER = a.!e
5c40: 6c 73 65 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  lseif [nmakehlp 
5c50: 2d 66 20 24 28 54 4b 5f 50 41 54 43 48 5f 4c 45  -f $(TK_PATCH_LE
5c60: 56 45 4c 29 20 22 62 22 5d 0a 54 4b 5f 50 41 54  VEL) "b"].TK_PAT
5c70: 43 48 5f 4c 45 54 54 45 52 20 3d 20 62 0a 21 65  CH_LETTER = b.!e
5c80: 6c 73 65 0a 54 4b 5f 50 41 54 43 48 5f 4c 45 54  lse.TK_PATCH_LET
5c90: 54 45 52 20 3d 20 2e 0a 21 65 6e 64 69 66 0a 0a  TER = ..!endif..
5ca0: 21 65 6e 64 69 66 0a 0a 23 20 53 65 74 20 44 4f  !endif..# Set DO
5cb0: 54 56 45 52 53 49 4f 4e 20 61 6e 64 20 56 45 52  TVERSION and VER
5cc0: 53 49 4f 4e 0a 21 69 66 20 24 28 44 4f 49 4e 47  SION.!if $(DOING
5cd0: 5f 54 43 4c 29 0a 0a 44 4f 54 56 45 52 53 49 4f  _TCL)..DOTVERSIO
5ce0: 4e 20 3d 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f  N = $(TCL_MAJOR_
5cf0: 56 45 52 53 49 4f 4e 29 2e 24 28 54 43 4c 5f 4d  VERSION).$(TCL_M
5d00: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 56 45  INOR_VERSION).VE
5d10: 52 53 49 4f 4e 20 3d 20 24 28 54 43 4c 5f 56 45  RSION = $(TCL_VE
5d20: 52 53 49 4f 4e 29 0a 0a 21 65 6c 73 65 69 66 20  RSION)..!elseif 
5d30: 24 28 44 4f 49 4e 47 5f 54 4b 29 0a 0a 44 4f 54  $(DOING_TK)..DOT
5d40: 56 45 52 53 49 4f 4e 20 3d 20 24 28 54 4b 5f 44  VERSION = $(TK_D
5d50: 4f 54 56 45 52 53 49 4f 4e 29 0a 56 45 52 53 49  OTVERSION).VERSI
5d60: 4f 4e 20 3d 20 24 28 54 4b 5f 56 45 52 53 49 4f  ON = $(TK_VERSIO
5d70: 4e 29 0a 0a 21 65 6c 73 65 20 23 20 44 6f 69 6e  N)..!else # Doin
5d80: 67 20 61 20 6e 6f 6e 2d 54 6b 20 65 78 74 65 6e  g a non-Tk exten
5d90: 73 69 6f 6e 0a 0a 23 20 49 66 20 70 61 72 65 6e  sion..# If paren
5da0: 74 20 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 6e  t makefile has n
5db0: 6f 74 20 64 65 66 69 6e 65 64 20 44 4f 54 56 45  ot defined DOTVE
5dc0: 52 53 49 4f 4e 2c 20 74 72 79 20 74 6f 20 67 65  RSION, try to ge
5dd0: 74 20 69 74 20 66 72 6f 6d 20 54 45 41 0a 23 20  t it from TEA.# 
5de0: 66 69 72 73 74 20 66 72 6f 6d 20 61 20 63 6f 6e  first from a con
5df0: 66 69 67 75 72 65 2e 69 6e 20 66 69 6c 65 2c 20  figure.in file, 
5e00: 61 6e 64 20 74 68 65 6e 20 66 72 6f 6d 20 63 6f  and then from co
5e10: 6e 66 69 67 75 72 65 2e 61 63 0a 21 69 66 6e 64  nfigure.ac.!ifnd
5e20: 65 66 20 44 4f 54 56 45 52 53 49 4f 4e 0a 21 69  ef DOTVERSION.!i
5e30: 66 20 5b 65 63 68 6f 20 44 4f 54 56 45 52 53 49  f [echo DOTVERSI
5e40: 4f 4e 20 3d 20 5c 3e 20 76 65 72 73 69 6f 6e 73  ON = \> versions
5e50: 2e 76 63 5d 20 5c 0a 20 20 20 7c 7c 20 5b 6e 6d  .vc] \.   || [nm
5e60: 61 6b 65 68 6c 70 20 2d 56 20 24 28 52 4f 4f 54  akehlp -V $(ROOT
5e70: 29 5c 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20 5e  )\configure.in ^
5e80: 5b 24 28 50 52 4f 4a 45 43 54 29 5e 5d 20 3e 3e  [$(PROJECT)^] >>
5e90: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 69   versions.vc].!i
5ea0: 66 20 5b 65 63 68 6f 20 44 4f 54 56 45 52 53 49  f [echo DOTVERSI
5eb0: 4f 4e 20 3d 20 5c 3e 20 76 65 72 73 69 6f 6e 73  ON = \> versions
5ec0: 2e 76 63 5d 20 5c 0a 20 20 20 7c 7c 20 5b 6e 6d  .vc] \.   || [nm
5ed0: 61 6b 65 68 6c 70 20 2d 56 20 24 28 52 4f 4f 54  akehlp -V $(ROOT
5ee0: 29 5c 63 6f 6e 66 69 67 75 72 65 2e 61 63 20 5e  )\configure.ac ^
5ef0: 5b 24 28 50 52 4f 4a 45 43 54 29 5e 5d 20 3e 3e  [$(PROJECT)^] >>
5f00: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65   versions.vc].!e
5f10: 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e  rror *** Could n
5f20: 6f 74 20 66 69 67 75 72 65 20 6f 75 74 20 65 78  ot figure out ex
5f30: 74 65 6e 73 69 6f 6e 20 76 65 72 73 69 6f 6e 2e  tension version.
5f40: 20 50 6c 65 61 73 65 20 64 65 66 69 6e 65 20 44   Please define D
5f50: 4f 54 56 45 52 53 49 4f 4e 20 69 6e 20 70 61 72  OTVERSION in par
5f60: 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 62 65 66  ent makefile bef
5f70: 6f 72 65 20 69 6e 63 6c 75 64 69 6e 67 20 72 75  ore including ru
5f80: 6c 65 73 2e 76 63 2e 0a 21 65 6e 64 69 66 0a 21  les.vc..!endif.!
5f90: 65 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 76  endif.!include v
5fa0: 65 72 73 69 6f 6e 73 2e 76 63 0a 21 65 6e 64 69  ersions.vc.!endi
5fb0: 66 20 23 20 44 4f 54 56 45 52 53 49 4f 4e 0a 56  f # DOTVERSION.V
5fc0: 45 52 53 49 4f 4e 20 20 20 20 20 20 20 20 20 3d  ERSION         =
5fd0: 20 24 28 44 4f 54 56 45 52 53 49 4f 4e 3a 2e 3d   $(DOTVERSION:.=
5fe0: 29 0a 0a 21 65 6e 64 69 66 20 23 20 24 28 44 4f  )..!endif # $(DO
5ff0: 49 4e 47 5f 54 43 4c 29 20 2e 2e 2e 20 65 74 63  ING_TCL) ... etc
6000: 2e 0a 0a 23 20 57 69 6e 64 6f 77 73 20 52 43 20  ...# Windows RC 
6010: 66 69 6c 65 73 20 68 61 76 65 20 33 20 76 65 72  files have 3 ver
6020: 73 69 6f 6e 20 63 6f 6d 70 6f 6e 65 6e 74 73 2e  sion components.
6030: 20 45 6e 73 75 72 65 20 74 68 69 73 20 69 72 72   Ensure this irr
6040: 65 73 70 65 63 74 69 76 65 0a 23 20 6f 66 20 68  espective.# of h
6050: 6f 77 20 6d 61 6e 79 20 63 6f 6d 70 6f 6e 65 6e  ow many componen
6060: 74 73 20 74 68 65 20 70 61 63 6b 61 67 65 20 68  ts the package h
6070: 61 73 20 73 70 65 63 69 66 69 65 64 2e 20 42 61  as specified. Ba
6080: 73 69 63 61 6c 6c 79 2c 20 65 6e 73 75 72 65 0a  sically, ensure.
6090: 23 20 6d 69 6e 69 6d 75 6d 20 34 20 63 6f 6d 70  # minimum 4 comp
60a0: 6f 6e 65 6e 74 73 20 62 79 20 61 70 70 65 6e 64  onents by append
60b0: 69 6e 67 20 34 20 30 27 73 20 61 6e 64 20 74 68  ing 4 0's and th
60c0: 65 6e 20 70 69 63 6b 20 6f 75 74 20 74 68 65 20  en pick out the 
60d0: 66 69 72 73 74 20 34 2e 0a 23 20 41 6c 73 6f 20  first 4..# Also 
60e0: 74 61 6b 65 20 63 61 72 65 20 6f 66 20 74 68 65  take care of the
60f0: 20 66 61 63 74 20 74 68 61 74 20 44 4f 54 56 45   fact that DOTVE
6100: 52 53 49 4f 4e 20 6d 61 79 20 68 61 76 65 20 22  RSION may have "
6110: 61 22 20 6f 72 20 22 62 22 20 69 6e 73 74 65 61  a" or "b" instea
6120: 64 0a 23 20 6f 66 20 22 2e 22 20 73 65 70 61 72  d.# of "." separ
6130: 61 74 69 6e 67 20 74 68 65 20 76 65 72 73 69 6f  ating the versio
6140: 6e 20 63 6f 6d 70 6f 6e 65 6e 74 73 2e 0a 44 4f  n components..DO
6150: 54 53 45 50 41 52 41 54 45 44 3d 24 28 44 4f 54  TSEPARATED=$(DOT
6160: 56 45 52 53 49 4f 4e 3a 61 3d 2e 29 0a 44 4f 54  VERSION:a=.).DOT
6170: 53 45 50 41 52 41 54 45 44 3d 24 28 44 4f 54 53  SEPARATED=$(DOTS
6180: 45 50 41 52 41 54 45 44 3a 62 3d 2e 29 0a 21 69  EPARATED:b=.).!i
6190: 66 20 5b 65 63 68 6f 20 52 43 43 4f 4d 4d 41 56  f [echo RCCOMMAV
61a0: 45 52 53 49 4f 4e 20 3d 20 5c 3e 20 76 65 72 73  ERSION = \> vers
61b0: 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 7c 7c 20  ions.vc] \.  || 
61c0: 5b 66 6f 72 20 2f 66 20 22 74 6f 6b 65 6e 73 3d  [for /f "tokens=
61d0: 31 2c 32 2c 33 2c 34 2c 35 2a 20 64 65 6c 69 6d  1,2,3,4,5* delim
61e0: 73 3d 2e 22 20 25 61 20 69 6e 20 28 22 24 28 44  s=." %a in ("$(D
61f0: 4f 54 53 45 50 41 52 41 54 45 44 29 2e 30 2e 30  OTSEPARATED).0.0
6200: 2e 30 2e 30 22 29 20 64 6f 20 65 63 68 6f 20 25  .0.0") do echo %
6210: 61 2c 25 62 2c 25 63 2c 25 64 20 3e 3e 20 76 65  a,%b,%c,%d >> ve
6220: 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 72 72 6f  rsions.vc].!erro
6230: 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20  r *** Could not 
6240: 67 65 6e 65 72 61 74 65 20 52 43 43 4f 4d 4d 41  generate RCCOMMA
6250: 56 45 52 53 49 4f 4e 20 2a 2a 2a 0a 21 65 6e 64  VERSION ***.!end
6260: 69 66 0a 21 69 6e 63 6c 75 64 65 20 76 65 72 73  if.!include vers
6270: 69 6f 6e 73 2e 76 63 0a 0a 23 23 23 23 23 23 23  ions.vc..#######
6280: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
6290: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
62a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
62b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
62c0: 23 0a 23 20 37 2e 20 50 61 72 73 65 20 74 68 65  #.# 7. Parse the
62d0: 20 4f 50 54 53 20 6d 61 63 72 6f 20 74 6f 20 77   OPTS macro to w
62e0: 6f 72 6b 20 6f 75 74 20 74 68 65 20 72 65 71 75  ork out the requ
62f0: 65 73 74 65 64 20 62 75 69 6c 64 20 63 6f 6e 66  ested build conf
6300: 69 67 75 72 61 74 69 6f 6e 2e 0a 23 20 42 61 73  iguration..# Bas
6310: 65 64 20 6f 6e 20 74 68 69 73 2c 20 77 65 20 77  ed on this, we w
6320: 69 6c 6c 20 63 6f 6e 73 74 72 75 63 74 20 74 68  ill construct th
6330: 65 20 61 63 74 75 61 6c 20 73 77 69 74 63 68 65  e actual switche
6340: 73 20 74 6f 20 62 65 20 70 61 73 73 65 64 20 74  s to be passed t
6350: 6f 20 74 68 65 0a 23 20 63 6f 6d 70 69 6c 65 72  o the.# compiler
6360: 20 61 6e 64 20 6c 69 6e 6b 65 72 20 75 73 69 6e   and linker usin
6370: 67 20 74 68 65 20 6d 61 63 72 6f 73 20 64 65 66  g the macros def
6380: 69 6e 65 64 20 69 6e 20 74 68 65 20 70 72 65 76  ined in the prev
6390: 69 6f 75 73 20 73 65 63 74 69 6f 6e 2e 0a 23 20  ious section..# 
63a0: 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61  The following ma
63b0: 63 72 6f 73 20 61 72 65 20 64 65 66 69 6e 65 64  cros are defined
63c0: 20 62 79 20 74 68 69 73 20 73 65 63 74 69 6f 6e   by this section
63d0: 20 62 61 73 65 64 20 6f 6e 20 4f 50 54 53 0a 23   based on OPTS.#
63e0: 20 53 54 41 54 49 43 5f 42 55 49 4c 44 20 2d 20   STATIC_BUILD - 
63f0: 30 20 2d 3e 20 54 63 6c 20 69 73 20 74 6f 20 62  0 -> Tcl is to b
6400: 65 20 62 75 69 6c 74 20 61 73 20 61 20 73 68 61  e built as a sha
6410: 72 65 64 20 6c 69 62 72 61 72 79 0a 23 20 20 20  red library.#   
6420: 20 20 20 20 20 20 20 20 20 20 20 20 20 31 20 2d               1 -
6430: 3e 20 62 75 69 6c 64 20 61 73 20 61 20 73 74 61  > build as a sta
6440: 74 69 63 20 6c 69 62 72 61 72 79 20 61 6e 64 20  tic library and 
6450: 73 68 65 6c 6c 0a 23 20 54 43 4c 5f 54 48 52 45  shell.# TCL_THRE
6460: 41 44 53 20 2d 20 6c 65 67 61 63 79 20 62 75 74  ADS - legacy but
6470: 20 61 6c 77 61 79 73 20 31 20 6f 6e 20 57 69 6e   always 1 on Win
6480: 64 6f 77 73 20 73 69 6e 63 65 20 77 69 6e 73 6f  dows since winso
6490: 63 6b 20 72 65 71 75 69 72 65 73 20 69 74 2e 0a  ck requires it..
64a0: 23 20 44 45 42 55 47 20 2d 20 31 20 2d 3e 20 64  # DEBUG - 1 -> d
64b0: 65 62 75 67 20 62 75 69 6c 64 2c 20 30 20 2d 3e  ebug build, 0 ->
64c0: 20 72 65 6c 65 61 73 65 20 62 75 69 6c 64 73 0a   release builds.
64d0: 23 20 53 59 4d 42 4f 4c 53 20 2d 20 31 20 2d 3e  # SYMBOLS - 1 ->
64e0: 20 67 65 6e 65 72 61 74 65 20 50 44 42 27 73 2c   generate PDB's,
64f0: 20 30 20 2d 3e 20 6e 6f 20 50 44 42 27 73 0a 23   0 -> no PDB's.#
6500: 20 50 52 4f 46 49 4c 45 20 2d 20 31 20 2d 3e 20   PROFILE - 1 -> 
6510: 67 65 6e 65 72 61 74 65 20 70 72 6f 66 69 6c 69  generate profili
6520: 6e 67 20 69 6e 66 6f 2c 20 30 20 2d 3e 20 6e 6f  ng info, 0 -> no
6530: 20 70 72 6f 66 69 6c 69 6e 67 0a 23 20 50 47 4f   profiling.# PGO
6540: 20 20 20 20 20 2d 20 31 20 2d 3e 20 70 72 6f 66       - 1 -> prof
6550: 69 6c 65 20 62 61 73 65 64 20 6f 70 74 69 6d 69  ile based optimi
6560: 7a 61 74 69 6f 6e 2c 20 30 20 2d 3e 20 6e 6f 0a  zation, 0 -> no.
6570: 23 20 4d 53 56 43 52 54 20 20 2d 20 31 20 2d 3e  # MSVCRT  - 1 ->
6580: 20 6c 69 6e 6b 20 74 6f 20 64 79 6e 61 6d 69 63   link to dynamic
6590: 20 43 20 72 75 6e 74 69 6d 65 20 65 76 65 6e 20   C runtime even 
65a0: 77 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 73 74  when building st
65b0: 61 74 69 63 20 54 63 6c 20 62 75 69 6c 64 0a 23  atic Tcl build.#
65c0: 20 20 20 20 20 20 20 20 20 20 20 30 20 2d 3e 20             0 -> 
65d0: 6c 69 6e 6b 20 74 6f 20 73 74 61 74 69 63 20 43  link to static C
65e0: 20 72 75 6e 74 69 6d 65 20 66 6f 72 20 73 74 61   runtime for sta
65f0: 74 69 63 20 54 63 6c 20 62 75 69 6c 64 2e 0a 23  tic Tcl build..#
6600: 20 20 20 20 20 20 20 20 20 20 20 44 6f 65 73 20             Does 
6610: 6e 6f 74 20 69 6d 70 61 63 74 20 73 68 61 72 65  not impact share
6620: 64 20 54 63 6c 20 62 75 69 6c 64 73 20 28 53 54  d Tcl builds (ST
6630: 41 54 49 43 5f 42 55 49 4c 44 20 3d 3d 20 30 29  ATIC_BUILD == 0)
6640: 0a 23 20 20 20 20 20 20 20 20 20 20 20 44 65 66  .#           Def
6650: 61 75 6c 74 3a 20 31 20 66 6f 72 20 54 63 6c 20  ault: 1 for Tcl 
6660: 38 2e 37 20 61 6e 64 20 75 70 2c 20 30 20 6f 74  8.7 and up, 0 ot
6670: 68 65 72 77 69 73 65 2e 0a 23 20 54 43 4c 5f 55  herwise..# TCL_U
6680: 53 45 5f 53 54 41 54 49 43 5f 50 41 43 4b 41 47  SE_STATIC_PACKAG
6690: 45 53 20 2d 20 31 20 2d 3e 20 73 74 61 74 69 63  ES - 1 -> static
66a0: 61 6c 6c 79 20 6c 69 6e 6b 20 74 68 65 20 72 65  ally link the re
66b0: 67 69 73 74 72 79 20 61 6e 64 20 64 64 65 20 65  gistry and dde e
66c0: 78 74 65 6e 73 69 6f 6e 73 0a 23 20 20 20 20 20  xtensions.#     
66d0: 20 20 20 20 20 20 69 6e 20 74 68 65 20 54 63 6c        in the Tcl
66e0: 20 61 6e 64 20 57 69 73 68 20 73 68 65 6c 6c 2e   and Wish shell.
66f0: 20 30 20 2d 3e 20 6b 65 65 70 20 74 68 65 6d 20   0 -> keep them 
6700: 61 73 20 73 68 61 72 65 64 20 6c 69 62 72 61 72  as shared librar
6710: 69 65 73 2e 20 44 6f 65 73 0a 23 20 20 20 20 20  ies. Does.#     
6720: 20 20 20 20 20 20 6e 6f 74 20 69 6d 70 61 63 74        not impact
6730: 20 73 68 61 72 65 64 20 54 63 6c 20 62 75 69 6c   shared Tcl buil
6740: 64 73 2e 20 49 6d 70 6c 69 65 64 20 62 79 20 53  ds. Implied by S
6750: 54 41 54 49 43 5f 42 55 49 4c 44 20 73 69 6e 63  TATIC_BUILD sinc
6760: 65 20 54 63 6c 20 38 2e 37 2e 0a 23 20 55 53 45  e Tcl 8.7..# USE
6770: 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 20 2d 20  _THREAD_ALLOC - 
6780: 31 20 2d 3e 20 55 73 65 20 61 20 73 68 61 72 65  1 -> Use a share
6790: 64 20 67 6c 6f 62 61 6c 20 66 72 65 65 20 70 6f  d global free po
67a0: 6f 6c 20 66 6f 72 20 61 6c 6c 6f 63 61 74 69 6f  ol for allocatio
67b0: 6e 2e 0a 23 20 20 20 20 20 20 20 20 20 20 20 30  n..#           0
67c0: 20 2d 3e 20 55 73 65 20 74 68 65 20 6e 6f 6e 2d   -> Use the non-
67d0: 74 68 72 65 61 64 20 61 6c 6c 6f 63 61 74 6f 72  thread allocator
67e0: 2e 0a 23 20 55 4e 43 48 45 43 4b 45 44 20 2d 20  ..# UNCHECKED - 
67f0: 31 20 2d 3e 20 77 68 65 6e 20 64 6f 69 6e 67 20  1 -> when doing 
6800: 61 20 64 65 62 75 67 20 62 75 69 6c 64 20 77 69  a debug build wi
6810: 74 68 20 73 79 6d 62 6f 6c 73 2c 20 75 73 65 20  th symbols, use 
6820: 74 68 65 20 72 65 6c 65 61 73 65 0a 23 20 20 20  the release.#   
6830: 20 20 20 20 20 20 20 20 43 20 72 75 6e 74 69 6d          C runtim
6840: 65 2c 20 30 20 2d 3e 20 75 73 65 20 74 68 65 20  e, 0 -> use the 
6850: 64 65 62 75 67 20 43 20 72 75 6e 74 69 6d 65 2e  debug C runtime.
6860: 0a 23 20 55 53 45 5f 53 54 55 42 53 20 2d 20 31  .# USE_STUBS - 1
6870: 20 2d 3e 20 63 6f 6d 70 69 6c 65 20 74 6f 20 75   -> compile to u
6880: 73 65 20 73 74 75 62 73 20 69 6e 74 65 72 66 61  se stubs interfa
6890: 63 65 73 2c 20 30 20 2d 3e 20 64 69 72 65 63 74  ces, 0 -> direct
68a0: 20 6c 69 6e 6b 69 6e 67 0a 23 20 43 4f 4e 46 49   linking.# CONFI
68b0: 47 5f 43 48 45 43 4b 20 2d 20 31 20 2d 3e 20 63  G_CHECK - 1 -> c
68c0: 68 65 63 6b 20 63 75 72 72 65 6e 74 20 62 75 69  heck current bui
68d0: 6c 64 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e  ld configuration
68e0: 20 61 67 61 69 6e 73 74 20 54 63 6c 0a 23 20 20   against Tcl.#  
68f0: 20 20 20 20 20 20 20 20 20 63 6f 6e 66 69 67 75           configu
6900: 72 61 74 69 6f 6e 20 28 69 67 6e 6f 72 65 64 20  ration (ignored 
6910: 66 6f 72 20 54 63 6c 20 69 74 73 65 6c 66 29 0a  for Tcl itself).
6920: 23 20 5f 55 53 45 5f 36 34 42 49 54 5f 54 49 4d  # _USE_64BIT_TIM
6930: 45 5f 54 20 2d 20 66 6f 72 63 65 73 20 61 20 62  E_T - forces a b
6940: 75 69 6c 64 20 75 73 69 6e 67 20 36 34 2d 62 69  uild using 64-bi
6950: 74 20 74 69 6d 65 5f 74 20 66 6f 72 20 33 32 2d  t time_t for 32-
6960: 62 69 74 20 62 75 69 6c 64 0a 23 20 20 20 20 20  bit build.#     
6970: 20 20 20 20 20 20 28 43 52 54 20 6c 69 62 72 61        (CRT libra
6980: 72 79 20 73 68 6f 75 6c 64 20 73 75 70 70 6f 72  ry should suppor
6990: 74 20 74 68 69 73 2c 20 6e 6f 74 20 6e 65 65 64  t this, not need
69a0: 65 64 20 66 6f 72 20 54 63 6c 20 39 2e 78 29 0a  ed for Tcl 9.x).
69b0: 23 20 54 43 4c 5f 55 54 46 5f 4d 41 58 3d 33 20  # TCL_UTF_MAX=3 
69c0: 2d 20 66 6f 72 63 65 73 20 61 20 62 75 69 6c 64  - forces a build
69d0: 20 75 73 69 6e 67 20 55 54 46 2d 31 36 20 69 6e   using UTF-16 in
69e0: 74 65 72 6e 61 6c 6c 79 20 28 6e 6f 74 20 72 65  ternally (not re
69f0: 63 6f 6d 6d 65 6e 64 65 64 29 2e 0a 23 20 46 75  commended)..# Fu
6a00: 72 74 68 65 72 2c 20 4c 49 4e 4b 45 52 46 4c 41  rther, LINKERFLA
6a10: 47 53 20 61 72 65 20 6d 6f 64 69 66 69 65 64 20  GS are modified 
6a20: 62 61 73 65 64 20 6f 6e 20 61 62 6f 76 65 2e 0a  based on above..
6a30: 0a 23 20 44 65 66 61 75 6c 74 20 76 61 6c 75 65  .# Default value
6a40: 73 20 66 6f 72 20 61 6c 6c 20 74 68 65 20 61 62  s for all the ab
6a50: 6f 76 65 0a 53 54 41 54 49 43 5f 42 55 49 4c 44  ove.STATIC_BUILD
6a60: 09 3d 20 30 0a 54 43 4c 5f 54 48 52 45 41 44 53  .= 0.TCL_THREADS
6a70: 09 3d 20 31 0a 44 45 42 55 47 09 09 3d 20 30 0a  .= 1.DEBUG..= 0.
6a80: 53 59 4d 42 4f 4c 53 09 09 3d 20 30 0a 50 52 4f  SYMBOLS..= 0.PRO
6a90: 46 49 4c 45 09 09 3d 20 30 0a 50 47 4f 09 09 3d  FILE..= 0.PGO..=
6aa0: 20 30 0a 4d 53 56 43 52 54 09 09 3d 20 31 0a 54   0.MSVCRT..= 1.T
6ab0: 43 4c 5f 55 53 45 5f 53 54 41 54 49 43 5f 50 41  CL_USE_STATIC_PA
6ac0: 43 4b 41 47 45 53 09 3d 20 30 0a 55 53 45 5f 54  CKAGES.= 0.USE_T
6ad0: 48 52 45 41 44 5f 41 4c 4c 4f 43 20 3d 20 31 0a  HREAD_ALLOC = 1.
6ae0: 55 4e 43 48 45 43 4b 45 44 09 3d 20 30 0a 43 4f  UNCHECKED.= 0.CO
6af0: 4e 46 49 47 5f 43 48 45 43 4b 20 20 20 20 3d 20  NFIG_CHECK    = 
6b00: 31 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43  1.!if $(DOING_TC
6b10: 4c 29 0a 55 53 45 5f 53 54 55 42 53 20 20 20 20  L).USE_STUBS    
6b20: 20 20 20 3d 20 30 0a 21 65 6c 73 65 0a 55 53 45     = 0.!else.USE
6b30: 5f 53 54 55 42 53 20 20 20 20 20 20 20 3d 20 31  _STUBS       = 1
6b40: 0a 21 65 6e 64 69 66 0a 0a 23 20 49 66 20 4f 50  .!endif..# If OP
6b50: 54 53 20 69 73 20 6e 6f 74 20 65 6d 70 74 79 20  TS is not empty 
6b60: 41 4e 44 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e  AND does not con
6b70: 74 61 69 6e 20 22 6e 6f 6e 65 22 20 77 68 69 63  tain "none" whic
6b80: 68 20 74 75 72 6e 73 20 6f 66 66 20 61 6c 6c 20  h turns off all 
6b90: 4f 50 54 53 0a 23 20 73 65 74 20 74 68 65 20 61  OPTS.# set the a
6ba0: 62 6f 76 65 20 6d 61 63 72 6f 73 20 62 61 73 65  bove macros base
6bb0: 64 20 6f 6e 20 4f 50 54 53 20 63 6f 6e 74 65 6e  d on OPTS conten
6bc0: 74 0a 21 69 66 20 22 24 28 4f 50 54 53 29 22 20  t.!if "$(OPTS)" 
6bd0: 21 3d 20 22 22 20 26 26 20 21 5b 6e 6d 61 6b 65  != "" && ![nmake
6be0: 68 6c 70 20 2d 66 20 22 24 28 4f 50 54 53 29 22  hlp -f "$(OPTS)"
6bf0: 20 22 6e 6f 6e 65 22 5d 0a 0a 23 20 4f 50 54 53   "none"]..# OPTS
6c00: 20 61 72 65 20 73 70 65 63 69 66 69 65 64 2c 20   are specified, 
6c10: 70 61 72 73 65 20 74 68 65 6d 0a 0a 21 69 66 20  parse them..!if 
6c20: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f  [nmakehlp -f $(O
6c30: 50 54 53 29 20 22 73 74 61 74 69 63 22 5d 0a 21  PTS) "static"].!
6c40: 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e  message *** Doin
6c50: 67 20 73 74 61 74 69 63 0a 53 54 41 54 49 43 5f  g static.STATIC_
6c60: 42 55 49 4c 44 09 3d 20 31 0a 21 65 6e 64 69 66  BUILD.= 1.!endif
6c70: 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  ..!if [nmakehlp 
6c80: 2d 66 20 24 28 4f 50 54 53 29 20 22 6e 6f 73 74  -f $(OPTS) "nost
6c90: 75 62 73 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a  ubs"].!message *
6ca0: 2a 2a 20 4e 6f 74 20 75 73 69 6e 67 20 73 74 75  ** Not using stu
6cb0: 62 73 0a 55 53 45 5f 53 54 55 42 53 09 3d 20 30  bs.USE_STUBS.= 0
6cc0: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d  .!endif..!if [nm
6cd0: 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53  akehlp -f $(OPTS
6ce0: 29 20 22 6e 6f 6d 73 76 63 72 74 22 5d 0a 21 6d  ) "nomsvcrt"].!m
6cf0: 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67  essage *** Doing
6d00: 20 6e 6f 6d 73 76 63 72 74 0a 4d 53 56 43 52 54   nomsvcrt.MSVCRT
6d10: 09 09 3d 20 30 0a 21 65 6c 73 65 0a 21 69 66 20  ..= 0.!else.!if 
6d20: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f  [nmakehlp -f $(O
6d30: 50 54 53 29 20 22 6d 73 76 63 72 74 22 5d 0a 21  PTS) "msvcrt"].!
6d40: 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e  message *** Doin
6d50: 67 20 6d 73 76 63 72 74 0a 21 65 6c 73 65 0a 21  g msvcrt.!else.!
6d60: 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56  if $(TCL_MAJOR_V
6d70: 45 52 53 49 4f 4e 29 20 3d 3d 20 38 20 26 26 20  ERSION) == 8 && 
6d80: 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53  $(TCL_MINOR_VERS
6d90: 49 4f 4e 29 20 3c 20 37 20 26 26 20 24 28 53 54  ION) < 7 && $(ST
6da0: 41 54 49 43 5f 42 55 49 4c 44 29 0a 4d 53 56 43  ATIC_BUILD).MSVC
6db0: 52 54 09 09 3d 20 30 0a 21 65 6e 64 69 66 0a 21  RT..= 0.!endif.!
6dc0: 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20 5b  endif.!endif # [
6dd0: 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50  nmakehlp -f $(OP
6de0: 54 53 29 20 22 6e 6f 6d 73 76 63 72 74 22 5d 0a  TS) "nomsvcrt"].
6df0: 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  .!if [nmakehlp -
6e00: 66 20 24 28 4f 50 54 53 29 20 22 73 74 61 74 69  f $(OPTS) "stati
6e10: 63 70 6b 67 22 5d 20 26 26 20 24 28 53 54 41 54  cpkg"] && $(STAT
6e20: 49 43 5f 42 55 49 4c 44 29 0a 21 6d 65 73 73 61  IC_BUILD).!messa
6e30: 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 73 74 61  ge *** Doing sta
6e40: 74 69 63 70 6b 67 0a 54 43 4c 5f 55 53 45 5f 53  ticpkg.TCL_USE_S
6e50: 54 41 54 49 43 5f 50 41 43 4b 41 47 45 53 09 3d  TATIC_PACKAGES.=
6e60: 20 31 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b   1.!endif..!if [
6e70: 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50  nmakehlp -f $(OP
6e80: 54 53 29 20 22 6e 6f 74 68 72 65 61 64 73 22 5d  TS) "nothreads"]
6e90: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 43 6f  .!message *** Co
6ea0: 6d 70 69 6c 65 20 65 78 70 6c 69 63 69 74 6c 79  mpile explicitly
6eb0: 20 66 6f 72 20 6e 6f 6e 2d 74 68 72 65 61 64 65   for non-threade
6ec0: 64 20 74 63 6c 0a 54 43 4c 5f 54 48 52 45 41 44  d tcl.TCL_THREAD
6ed0: 53 20 3d 20 30 0a 55 53 45 5f 54 48 52 45 41 44  S = 0.USE_THREAD
6ee0: 5f 41 4c 4c 4f 43 3d 20 30 0a 21 65 6e 64 69 66  _ALLOC= 0.!endif
6ef0: 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20  ..!if [nmakehlp 
6f00: 2d 66 20 24 28 4f 50 54 53 29 20 22 74 63 6c 38  -f $(OPTS) "tcl8
6f10: 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20  "].!message *** 
6f20: 42 75 69 6c 64 20 66 6f 72 20 54 63 6c 38 0a 54  Build for Tcl8.T
6f30: 43 4c 5f 42 55 49 4c 44 5f 46 4f 52 20 3d 20 38  CL_BUILD_FOR = 8
6f40: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 54  .!endif..!if $(T
6f50: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e  CL_MAJOR_VERSION
6f60: 29 20 3d 3d 20 38 0a 21 69 66 20 5b 6e 6d 61 6b  ) == 8.!if [nmak
6f70: 65 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20  ehlp -f $(OPTS) 
6f80: 22 74 69 6d 65 36 34 62 69 74 22 5d 0a 21 6d 65  "time64bit"].!me
6f90: 73 73 61 67 65 20 2a 2a 2a 20 46 6f 72 63 65 20  ssage *** Force 
6fa0: 36 34 2d 62 69 74 20 74 69 6d 65 5f 74 0a 5f 55  64-bit time_t._U
6fb0: 53 45 5f 36 34 42 49 54 5f 54 49 4d 45 5f 54 20  SE_64BIT_TIME_T 
6fc0: 3d 20 31 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20  = 1.!endif..!if 
6fd0: 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f  [nmakehlp -f $(O
6fe0: 50 54 53 29 20 22 75 74 66 31 36 22 5d 0a 21 6d  PTS) "utf16"].!m
6ff0: 65 73 73 61 67 65 20 2a 2a 2a 20 46 6f 72 63 65  essage *** Force
7000: 20 55 54 46 2d 31 36 20 69 6e 74 65 72 6e 61 6c   UTF-16 internal
7010: 6c 79 0a 54 43 4c 5f 55 54 46 5f 4d 41 58 20 3d  ly.TCL_UTF_MAX =
7020: 20 33 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66   3.!endif.!endif
7030: 0a 0a 23 20 59 65 73 2c 20 69 74 27 73 20 77 65  ..# Yes, it's we
7040: 69 72 64 20 74 68 61 74 20 74 68 65 20 22 73 79  ird that the "sy
7050: 6d 62 6f 6c 73 22 20 6f 70 74 69 6f 6e 20 63 6f  mbols" option co
7060: 6e 74 72 6f 6c 73 20 44 45 42 55 47 20 61 6e 64  ntrols DEBUG and
7070: 0a 23 20 74 68 65 20 22 70 64 62 73 22 20 6f 70  .# the "pdbs" op
7080: 74 69 6f 6e 20 63 6f 6e 74 72 6f 6c 73 20 53 59  tion controls SY
7090: 4d 42 4f 4c 53 2e 20 54 68 61 74 27 73 20 68 69  MBOLS. That's hi
70a0: 73 74 6f 72 69 63 61 6c 2e 0a 21 69 66 20 5b 6e  storical..!if [n
70b0: 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28 4f 50 54  makehlp -f $(OPT
70c0: 53 29 20 22 73 79 6d 62 6f 6c 73 22 5d 0a 21 6d  S) "symbols"].!m
70d0: 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67  essage *** Doing
70e0: 20 73 79 6d 62 6f 6c 73 0a 44 45 42 55 47 09 09   symbols.DEBUG..
70f0: 3d 20 31 0a 21 65 6c 73 65 0a 44 45 42 55 47 09  = 1.!else.DEBUG.
7100: 09 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66  .= 0.!endif..!if
7110: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24 28   [nmakehlp -f $(
7120: 4f 50 54 53 29 20 22 70 64 62 73 22 5d 0a 21 6d  OPTS) "pdbs"].!m
7130: 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67  essage *** Doing
7140: 20 70 64 62 73 0a 53 59 4d 42 4f 4c 53 09 09 3d   pdbs.SYMBOLS..=
7150: 20 31 0a 21 65 6c 73 65 0a 53 59 4d 42 4f 4c 53   1.!else.SYMBOLS
7160: 09 09 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69  ..= 0.!endif..!i
7170: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24  f [nmakehlp -f $
7180: 28 4f 50 54 53 29 20 22 70 72 6f 66 69 6c 65 22  (OPTS) "profile"
7190: 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44  ].!message *** D
71a0: 6f 69 6e 67 20 70 72 6f 66 69 6c 65 0a 50 52 4f  oing profile.PRO
71b0: 46 49 4c 45 09 09 3d 20 31 0a 21 65 6c 73 65 0a  FILE..= 1.!else.
71c0: 50 52 4f 46 49 4c 45 09 09 3d 20 30 0a 21 65 6e  PROFILE..= 0.!en
71d0: 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68  dif..!if [nmakeh
71e0: 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 70  lp -f $(OPTS) "p
71f0: 67 69 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a  gi"].!message **
7200: 2a 20 44 6f 69 6e 67 20 70 72 6f 66 69 6c 65 20  * Doing profile 
7210: 67 75 69 64 65 64 20 6f 70 74 69 6d 69 7a 61 74  guided optimizat
7220: 69 6f 6e 20 69 6e 73 74 72 75 6d 65 6e 74 61 74  ion instrumentat
7230: 69 6f 6e 0a 50 47 4f 09 09 3d 20 31 0a 21 65 6c  ion.PGO..= 1.!el
7240: 73 65 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  seif [nmakehlp -
7250: 66 20 24 28 4f 50 54 53 29 20 22 70 67 6f 22 5d  f $(OPTS) "pgo"]
7260: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44 6f  .!message *** Do
7270: 69 6e 67 20 70 72 6f 66 69 6c 65 20 67 75 69 64  ing profile guid
7280: 65 64 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 0a  ed optimization.
7290: 50 47 4f 09 09 3d 20 32 0a 21 65 6c 73 65 0a 50  PGO..= 2.!else.P
72a0: 47 4f 09 09 3d 20 30 0a 21 65 6e 64 69 66 0a 0a  GO..= 0.!endif..
72b0: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66  !if [nmakehlp -f
72c0: 20 24 28 4f 50 54 53 29 20 22 6c 6f 69 6d 70 61   $(OPTS) "loimpa
72d0: 63 74 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a  ct"].!message **
72e0: 2a 20 57 61 72 6e 69 6e 67 3a 20 69 67 6e 6f 72  * Warning: ignor
72f0: 69 6e 67 20 6f 70 74 69 6f 6e 20 22 6c 6f 69 6d  ing option "loim
7300: 70 61 63 74 22 20 2d 20 64 65 70 72 65 63 61 74  pact" - deprecat
7310: 65 64 20 6f 6e 20 6d 6f 64 65 72 6e 20 57 69 6e  ed on modern Win
7320: 64 6f 77 73 2e 0a 21 65 6e 64 69 66 0a 0a 23 20  dows..!endif..# 
7330: 54 42 44 20 2d 20 73 68 6f 75 6c 64 20 67 65 74  TBD - should get
7340: 20 72 69 64 20 6f 66 20 74 68 69 73 20 6f 70 74   rid of this opt
7350: 69 6f 6e 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c  ion.!if [nmakehl
7360: 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 74 68  p -f $(OPTS) "th
7370: 72 64 61 6c 6c 6f 63 22 5d 0a 21 6d 65 73 73 61  rdalloc"].!messa
7380: 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 74 68 72  ge *** Doing thr
7390: 64 61 6c 6c 6f 63 0a 55 53 45 5f 54 48 52 45 41  dalloc.USE_THREA
73a0: 44 5f 41 4c 4c 4f 43 20 3d 20 31 0a 21 65 6e 64  D_ALLOC = 1.!end
73b0: 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c  if..!if [nmakehl
73c0: 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22 74 63  p -f $(OPTS) "tc
73d0: 6c 61 6c 6c 6f 63 22 5d 0a 55 53 45 5f 54 48 52  lalloc"].USE_THR
73e0: 45 41 44 5f 41 4c 4c 4f 43 20 3d 20 30 0a 21 65  EAD_ALLOC = 0.!e
73f0: 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65  ndif..!if [nmake
7400: 68 6c 70 20 2d 66 20 24 28 4f 50 54 53 29 20 22  hlp -f $(OPTS) "
7410: 75 6e 63 68 65 63 6b 65 64 22 5d 0a 21 6d 65 73  unchecked"].!mes
7420: 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 75  sage *** Doing u
7430: 6e 63 68 65 63 6b 65 64 0a 55 4e 43 48 45 43 4b  nchecked.UNCHECK
7440: 45 44 20 3d 20 31 0a 21 65 6c 73 65 0a 55 4e 43  ED = 1.!else.UNC
7450: 48 45 43 4b 45 44 20 3d 20 30 0a 21 65 6e 64 69  HECKED = 0.!endi
7460: 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70  f..!if [nmakehlp
7470: 20 2d 66 20 24 28 4f 50 54 53 29 20 22 6e 6f 63   -f $(OPTS) "noc
7480: 6f 6e 66 69 67 63 68 65 63 6b 22 5d 0a 43 4f 4e  onfigcheck"].CON
7490: 46 49 47 5f 43 48 45 43 4b 20 3d 20 31 0a 21 65  FIG_CHECK = 1.!e
74a0: 6c 73 65 0a 43 4f 4e 46 49 47 5f 43 48 45 43 4b  lse.CONFIG_CHECK
74b0: 20 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 65 6e   = 0.!endif..!en
74c0: 64 69 66 20 23 20 22 24 28 4f 50 54 53 29 22 20  dif # "$(OPTS)" 
74d0: 21 3d 20 22 22 20 20 26 26 20 2e 2e 2e 20 70 61  != ""  && ... pa
74e0: 72 73 69 6e 67 20 6f 66 20 4f 50 54 53 0a 0a 23  rsing of OPTS..#
74f0: 20 53 65 74 20 6c 69 6e 6b 65 72 20 66 6c 61 67   Set linker flag
7500: 73 20 62 61 73 65 64 20 6f 6e 20 61 62 6f 76 65  s based on above
7510: 0a 0a 21 69 66 20 24 28 50 47 4f 29 20 3e 20 31  ..!if $(PGO) > 1
7520: 0a 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d  .!if [nmakehlp -
7530: 6c 20 2d 6c 74 63 67 3a 70 67 6f 70 74 69 6d 69  l -ltcg:pgoptimi
7540: 7a 65 20 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54  ze $(LINKER_TEST
7550: 46 4c 41 47 53 29 5d 0a 4c 49 4e 4b 45 52 46 4c  FLAGS)].LINKERFL
7560: 41 47 53 09 3d 20 24 28 4c 49 4e 4b 45 52 46 4c  AGS.= $(LINKERFL
7570: 41 47 53 3a 2d 6c 74 63 67 3d 29 20 2d 6c 74 63  AGS:-ltcg=) -ltc
7580: 67 3a 70 67 6f 70 74 69 6d 69 7a 65 0a 21 65 6c  g:pgoptimize.!el
7590: 73 65 0a 4d 53 47 3d 5e 0a 54 68 69 73 20 63 6f  se.MSG=^.This co
75a0: 6d 70 69 6c 65 72 20 64 6f 65 73 20 6e 6f 74 20  mpiler does not 
75b0: 73 75 70 70 6f 72 74 20 70 72 6f 66 69 6c 65 20  support profile 
75c0: 67 75 69 64 65 64 20 6f 70 74 69 6d 69 7a 61 74  guided optimizat
75d0: 69 6f 6e 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53  ion..!error $(MS
75e0: 47 29 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65 69  G).!endif.!elsei
75f0: 66 20 24 28 50 47 4f 29 20 3e 20 30 0a 21 69 66  f $(PGO) > 0.!if
7600: 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 6c 20 2d 6c   [nmakehlp -l -l
7610: 74 63 67 3a 70 67 69 6e 73 74 72 75 6d 65 6e 74  tcg:pginstrument
7620: 20 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c   $(LINKER_TESTFL
7630: 41 47 53 29 5d 0a 4c 49 4e 4b 45 52 46 4c 41 47  AGS)].LINKERFLAG
7640: 53 09 3d 20 24 28 4c 49 4e 4b 45 52 46 4c 41 47  S.= $(LINKERFLAG
7650: 53 3a 2d 6c 74 63 67 3d 29 20 2d 6c 74 63 67 3a  S:-ltcg=) -ltcg:
7660: 70 67 69 6e 73 74 72 75 6d 65 6e 74 0a 21 65 6c  pginstrument.!el
7670: 73 65 0a 4d 53 47 3d 5e 0a 54 68 69 73 20 63 6f  se.MSG=^.This co
7680: 6d 70 69 6c 65 72 20 64 6f 65 73 20 6e 6f 74 20  mpiler does not 
7690: 73 75 70 70 6f 72 74 20 70 72 6f 66 69 6c 65 20  support profile 
76a0: 67 75 69 64 65 64 20 6f 70 74 69 6d 69 7a 61 74  guided optimizat
76b0: 69 6f 6e 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53  ion..!error $(MS
76c0: 47 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  G).!endif.!endif
76d0: 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ..##############
76e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
76f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7700: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7710: 23 23 0a 23 20 38 2e 20 50 61 72 73 65 20 74 68  ##.# 8. Parse th
7720: 65 20 53 54 41 54 53 20 6d 61 63 72 6f 20 74 6f  e STATS macro to
7730: 20 63 6f 6e 66 69 67 75 72 65 20 63 6f 64 65 20   configure code 
7740: 69 6e 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0a  instrumentation.
7750: 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  # The following 
7760: 6d 61 63 72 6f 73 20 61 72 65 20 73 65 74 20 62  macros are set b
7770: 79 20 74 68 69 73 20 73 65 63 74 69 6f 6e 3a 0a  y this section:.
7780: 23 20 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 20  # TCL_MEM_DEBUG 
7790: 2d 20 31 20 2d 3e 20 65 6e 61 62 6c 65 73 20 6d  - 1 -> enables m
77a0: 65 6d 6f 72 79 20 61 6c 6c 6f 63 61 74 69 6f 6e  emory allocation
77b0: 20 69 6e 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e   instrumentation
77c0: 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .#              
77d0: 20 20 20 30 20 2d 3e 20 64 69 73 61 62 6c 65 73     0 -> disables
77e0: 0a 23 20 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 44  .# TCL_COMPILE_D
77f0: 45 42 55 47 20 2d 20 31 20 2d 3e 20 65 6e 61 62  EBUG - 1 -> enab
7800: 6c 65 73 20 62 79 74 65 20 63 6f 6d 70 69 6c 65  les byte compile
7810: 72 20 6c 6f 67 67 69 6e 67 0a 23 20 20 20 20 20  r logging.#     
7820: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7830: 30 20 2d 3e 20 64 69 73 61 62 6c 65 73 0a 0a 23  0 -> disables..#
7840: 20 44 65 66 61 75 6c 74 20 62 6f 74 68 20 61 72   Default both ar
7850: 65 20 6f 66 66 0a 54 43 4c 5f 4d 45 4d 5f 44 45  e off.TCL_MEM_DE
7860: 42 55 47 09 20 20 20 20 3d 20 30 0a 54 43 4c 5f  BUG.    = 0.TCL_
7870: 43 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 20 20  COMPILE_DEBUG   
7880: 3d 20 30 0a 0a 21 69 66 20 22 24 28 53 54 41 54  = 0..!if "$(STAT
7890: 53 29 22 20 21 3d 20 22 22 20 26 26 20 21 5b 6e  S)" != "" && ![n
78a0: 6d 61 6b 65 68 6c 70 20 2d 66 20 22 24 28 53 54  makehlp -f "$(ST
78b0: 41 54 53 29 22 20 22 6e 6f 6e 65 22 5d 0a 0a 21  ATS)" "none"]..!
78c0: 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20  if [nmakehlp -f 
78d0: 24 28 53 54 41 54 53 29 20 22 6d 65 6d 64 62 67  $(STATS) "memdbg
78e0: 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20  "].!message *** 
78f0: 44 6f 69 6e 67 20 6d 65 6d 64 62 67 0a 54 43 4c  Doing memdbg.TCL
7900: 5f 4d 45 4d 5f 44 45 42 55 47 09 20 20 20 20 3d  _MEM_DEBUG.    =
7910: 20 31 0a 21 65 6c 73 65 0a 54 43 4c 5f 4d 45 4d   1.!else.TCL_MEM
7920: 5f 44 45 42 55 47 09 20 20 20 20 3d 20 30 0a 21  _DEBUG.    = 0.!
7930: 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b  endif..!if [nmak
7940: 65 68 6c 70 20 2d 66 20 24 28 53 54 41 54 53 29  ehlp -f $(STATS)
7950: 20 22 63 6f 6d 70 64 62 67 22 5d 0a 21 6d 65 73   "compdbg"].!mes
7960: 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20 63  sage *** Doing c
7970: 6f 6d 70 64 62 67 0a 54 43 4c 5f 43 4f 4d 50 49  ompdbg.TCL_COMPI
7980: 4c 45 5f 44 45 42 55 47 20 20 20 3d 20 31 0a 21  LE_DEBUG   = 1.!
7990: 65 6c 73 65 0a 54 43 4c 5f 43 4f 4d 50 49 4c 45  else.TCL_COMPILE
79a0: 5f 44 45 42 55 47 20 20 20 3d 20 30 0a 21 65 6e  _DEBUG   = 0.!en
79b0: 64 69 66 0a 0a 21 65 6e 64 69 66 0a 0a 23 23 23  dif..!endif..###
79c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
79d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
79e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
79f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7a00: 23 0a 23 20 39 2e 20 50 61 72 73 65 20 74 68 65  #.# 9. Parse the
7a10: 20 43 48 45 43 4b 53 20 6d 61 63 72 6f 20 74 6f   CHECKS macro to
7a20: 20 63 6f 6e 66 69 67 75 72 65 20 61 64 64 69 74   configure addit
7a30: 69 6f 6e 61 6c 20 63 6f 6d 70 69 6c 65 72 20 63  ional compiler c
7a40: 68 65 63 6b 73 0a 23 20 54 68 65 20 66 6f 6c 6c  hecks.# The foll
7a50: 6f 77 69 6e 67 20 6d 61 63 72 6f 73 20 61 72 65  owing macros are
7a60: 20 73 65 74 20 62 79 20 74 68 69 73 20 73 65 63   set by this sec
7a70: 74 69 6f 6e 3a 0a 23 20 57 41 52 4e 49 4e 47 53  tion:.# WARNINGS
7a80: 20 2d 20 63 6f 6d 70 69 6c 65 72 20 73 77 69 74   - compiler swit
7a90: 63 68 65 73 20 74 68 61 74 20 63 6f 6e 74 72 6f  ches that contro
7aa0: 6c 20 74 68 65 20 77 61 72 6e 69 6e 67 73 20 6c  l the warnings l
7ab0: 65 76 65 6c 0a 23 20 54 43 4c 5f 4e 4f 5f 44 45  evel.# TCL_NO_DE
7ac0: 50 52 45 43 41 54 45 44 20 2d 20 31 20 2d 3e 20  PRECATED - 1 -> 
7ad0: 64 69 73 61 62 6c 65 20 73 75 70 70 6f 72 74 20  disable support 
7ae0: 66 6f 72 20 64 65 70 72 65 63 61 74 65 64 20 66  for deprecated f
7af0: 75 6e 63 74 69 6f 6e 73 0a 23 20 20 20 20 20 20  unctions.#      
7b00: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30                 0
7b10: 20 2d 3e 20 65 6e 61 62 6c 65 20 64 65 70 72 65   -> enable depre
7b20: 63 61 74 65 64 20 66 75 6e 63 74 69 6f 6e 73 0a  cated functions.
7b30: 0a 23 20 44 65 66 61 75 6c 74 73 20 2d 20 50 65  .# Defaults - Pe
7b40: 72 6d 69 74 20 64 65 70 72 65 63 61 74 65 64 20  rmit deprecated 
7b50: 66 75 6e 63 74 69 6f 6e 73 20 61 6e 64 20 77 61  functions and wa
7b60: 72 6e 69 6e 67 20 6c 65 76 65 6c 20 33 0a 54 43  rning level 3.TC
7b70: 4c 5f 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 09  L_NO_DEPRECATED.
7b80: 20 20 20 20 3d 20 30 0a 57 41 52 4e 49 4e 47 53      = 0.WARNINGS
7b90: 09 09 20 20 20 20 3d 20 2d 57 33 0a 0a 21 69 66  ..    = -W3..!if
7ba0: 20 22 24 28 43 48 45 43 4b 53 29 22 20 21 3d 20   "$(CHECKS)" != 
7bb0: 22 22 20 26 26 20 21 5b 6e 6d 61 6b 65 68 6c 70  "" && ![nmakehlp
7bc0: 20 2d 66 20 22 24 28 43 48 45 43 4b 53 29 22 20   -f "$(CHECKS)" 
7bd0: 22 6e 6f 6e 65 22 5d 0a 0a 21 69 66 20 5b 6e 6d  "none"]..!if [nm
7be0: 61 6b 65 68 6c 70 20 2d 66 20 24 28 43 48 45 43  akehlp -f $(CHEC
7bf0: 4b 53 29 20 22 6e 6f 64 65 70 22 5d 0a 21 6d 65  KS) "nodep"].!me
7c00: 73 73 61 67 65 20 2a 2a 2a 20 44 6f 69 6e 67 20  ssage *** Doing 
7c10: 6e 6f 64 65 70 20 63 68 65 63 6b 0a 54 43 4c 5f  nodep check.TCL_
7c20: 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 09 20 20  NO_DEPRECATED.  
7c30: 20 20 3d 20 31 0a 21 65 6e 64 69 66 0a 0a 21 69    = 1.!endif..!i
7c40: 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 66 20 24  f [nmakehlp -f $
7c50: 28 43 48 45 43 4b 53 29 20 22 66 75 6c 6c 77 61  (CHECKS) "fullwa
7c60: 72 6e 22 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a  rn"].!message **
7c70: 2a 20 44 6f 69 6e 67 20 66 75 6c 6c 20 77 61 72  * Doing full war
7c80: 6e 69 6e 67 73 20 63 68 65 63 6b 0a 57 41 52 4e  nings check.WARN
7c90: 49 4e 47 53 09 09 20 20 20 20 3d 20 2d 57 34 0a  INGS..    = -W4.
7ca0: 21 69 66 20 5b 6e 6d 61 6b 65 68 6c 70 20 2d 6c  !if [nmakehlp -l
7cb0: 20 2d 77 61 72 6e 3a 33 20 24 28 4c 49 4e 4b 45   -warn:3 $(LINKE
7cc0: 52 5f 54 45 53 54 46 4c 41 47 53 29 5d 0a 4c 49  R_TESTFLAGS)].LI
7cd0: 4e 4b 45 52 46 4c 41 47 53 09 09 20 20 20 20 3d  NKERFLAGS..    =
7ce0: 20 24 28 4c 49 4e 4b 45 52 46 4c 41 47 53 29 20   $(LINKERFLAGS) 
7cf0: 2d 77 61 72 6e 3a 33 0a 21 65 6e 64 69 66 0a 21  -warn:3.!endif.!
7d00: 65 6e 64 69 66 0a 0a 21 69 66 20 5b 6e 6d 61 6b  endif..!if [nmak
7d10: 65 68 6c 70 20 2d 66 20 24 28 43 48 45 43 4b 53  ehlp -f $(CHECKS
7d20: 29 20 22 36 34 62 69 74 22 5d 20 26 26 20 5b 6e  ) "64bit"] && [n
7d30: 6d 61 6b 65 68 6c 70 20 2d 63 20 2d 57 70 36 34  makehlp -c -Wp64
7d40: 5d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 44  ].!message *** D
7d50: 6f 69 6e 67 20 36 34 62 69 74 20 70 6f 72 74 61  oing 64bit porta
7d60: 62 69 6c 69 74 79 20 77 61 72 6e 69 6e 67 73 0a  bility warnings.
7d70: 57 41 52 4e 49 4e 47 53 09 09 20 20 20 20 3d 20  WARNINGS..    = 
7d80: 24 28 57 41 52 4e 49 4e 47 53 29 20 2d 57 70 36  $(WARNINGS) -Wp6
7d90: 34 0a 21 65 6e 64 69 66 0a 0a 21 65 6e 64 69 66  4.!endif..!endif
7da0: 0a 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23  ...#############
7db0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7dc0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7dd0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7de0: 23 23 23 0a 23 20 31 30 2e 20 43 6f 6e 73 74 72  ###.# 10. Constr
7df0: 75 63 74 20 6f 75 74 70 75 74 20 64 69 72 65 63  uct output direc
7e00: 74 6f 72 79 20 61 6e 64 20 66 69 6c 65 20 70 61  tory and file pa
7e10: 74 68 73 0a 23 20 46 69 67 75 72 65 2d 6f 75 74  ths.# Figure-out
7e20: 20 68 6f 77 20 74 6f 20 6e 61 6d 65 20 6f 75 72   how to name our
7e30: 20 69 6e 74 65 72 6d 65 64 69 61 74 65 20 61 6e   intermediate an
7e40: 64 20 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f  d output directo
7e50: 72 69 65 73 2e 0a 23 20 49 6e 20 6f 72 64 65 72  ries..# In order
7e60: 20 74 6f 20 61 76 6f 69 64 20 69 6e 61 64 76 65   to avoid inadve
7e70: 72 74 65 6e 74 20 6d 69 78 69 6e 67 20 6f 66 20  rtent mixing of 
7e80: 6f 62 6a 65 63 74 20 66 69 6c 65 73 20 62 75 69  object files bui
7e90: 6c 74 20 75 73 69 6e 67 0a 23 20 64 69 66 66 65  lt using.# diffe
7ea0: 72 65 6e 74 20 63 6f 6d 70 69 6c 65 72 73 2c 20  rent compilers, 
7eb0: 62 75 69 6c 64 20 63 6f 6e 66 69 67 75 72 61 74  build configurat
7ec0: 69 6f 6e 73 20 65 74 63 2e 2c 0a 23 0a 23 20 4e  ions etc.,.#.# N
7ed0: 61 6d 69 6e 67 20 63 6f 6e 76 65 6e 74 69 6f 6e  aming convention
7ee0: 20 28 73 75 66 66 69 78 65 73 29 3a 0a 23 20 20   (suffixes):.#  
7ef0: 20 74 20 3d 20 66 75 6c 6c 20 74 68 72 65 61 64   t = full thread
7f00: 20 73 75 70 70 6f 72 74 2e 20 28 4e 6f 74 20 75   support. (Not u
7f10: 73 65 64 20 66 6f 72 20 54 63 6c 20 3e 3d 20 38  sed for Tcl >= 8
7f20: 2e 37 29 0a 23 20 20 20 73 20 3d 20 73 74 61 74  .7).#   s = stat
7f30: 69 63 20 6c 69 62 72 61 72 79 20 28 61 73 20 6f  ic library (as o
7f40: 70 70 6f 73 65 64 20 74 6f 20 61 6e 20 69 6d 70  pposed to an imp
7f50: 6f 72 74 20 6c 69 62 72 61 72 79 29 0a 23 20 20  ort library).#  
7f60: 20 67 20 3d 20 6c 69 6e 6b 65 64 20 74 6f 20 74   g = linked to t
7f70: 68 65 20 64 65 62 75 67 20 65 6e 61 62 6c 65 64  he debug enabled
7f80: 20 43 20 72 75 6e 2d 74 69 6d 65 2e 0a 23 20 20   C run-time..#  
7f90: 20 78 20 3d 20 73 70 65 63 69 61 6c 20 73 74 61   x = special sta
7fa0: 74 69 63 20 62 75 69 6c 64 20 77 68 65 6e 20 69  tic build when i
7fb0: 74 20 6c 69 6e 6b 73 20 74 6f 20 74 68 65 20 64  t links to the d
7fc0: 79 6e 61 6d 69 63 20 43 20 72 75 6e 2d 74 69 6d  ynamic C run-tim
7fd0: 65 2e 0a 23 0a 23 20 54 68 65 20 66 6f 6c 6c 6f  e..#.# The follo
7fe0: 77 69 6e 67 20 6d 61 63 72 6f 73 20 61 72 65 20  wing macros are 
7ff0: 73 65 74 20 69 6e 20 74 68 69 73 20 73 65 63 74  set in this sect
8000: 69 6f 6e 3a 0a 23 20 53 55 46 58 20 2d 20 74 68  ion:.# SUFX - th
8010: 65 20 73 75 66 66 69 78 20 74 6f 20 75 73 65 20  e suffix to use 
8020: 66 6f 72 20 62 69 6e 61 72 69 65 73 20 62 61 73  for binaries bas
8030: 65 64 20 6f 6e 20 61 62 6f 76 65 20 6e 61 6d 69  ed on above nami
8040: 6e 67 20 63 6f 6e 76 65 6e 74 69 6f 6e 0a 23 20  ng convention.# 
8050: 42 55 49 4c 44 44 49 52 54 4f 50 20 2d 20 74 68  BUILDDIRTOP - th
8060: 65 20 74 6f 70 6c 65 76 65 6c 20 64 65 66 61 75  e toplevel defau
8070: 6c 74 20 6f 75 74 70 75 74 20 64 69 72 65 63 74  lt output direct
8080: 6f 72 79 0a 23 20 20 20 20 20 20 69 73 20 6f 66  ory.#      is of
8090: 20 74 68 65 20 66 6f 72 6d 20 7b 52 65 6c 65 61   the form {Relea
80a0: 73 65 2c 44 65 62 75 67 7d 5b 5f 41 4d 44 36 34  se,Debug}[_AMD64
80b0: 5d 5b 5f 43 4f 4d 50 49 4c 45 52 56 45 52 53 49  ][_COMPILERVERSI
80c0: 4f 4e 5d 0a 23 20 54 4d 50 5f 44 49 52 20 2d 20  ON].# TMP_DIR - 
80d0: 64 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 20  directory where 
80e0: 6f 62 6a 65 63 74 20 66 69 6c 65 73 20 61 72 65  object files are
80f0: 20 63 72 65 61 74 65 64 0a 23 20 4f 55 54 5f 44   created.# OUT_D
8100: 49 52 20 2d 20 64 69 72 65 63 74 6f 72 79 20 77  IR - directory w
8110: 68 65 72 65 20 6f 75 74 70 75 74 20 65 78 65 63  here output exec
8120: 75 74 61 62 6c 65 73 20 61 72 65 20 63 72 65 61  utables are crea
8130: 74 65 64 0a 23 20 42 6f 74 68 20 54 4d 50 5f 44  ted.# Both TMP_D
8140: 49 52 20 61 6e 64 20 4f 55 54 5f 44 49 52 20 61  IR and OUT_DIR a
8150: 72 65 20 64 65 66 61 75 6c 74 65 64 20 6f 6e 6c  re defaulted onl
8160: 79 20 69 66 20 6e 6f 74 20 64 65 66 69 6e 65 64  y if not defined
8170: 20 62 79 20 74 68 65 0a 23 20 70 61 72 65 6e 74   by the.# parent
8180: 20 6d 61 6b 65 66 69 6c 65 20 28 6f 72 20 63 6f   makefile (or co
8190: 6d 6d 61 6e 64 20 6c 69 6e 65 29 2e 20 54 68 65  mmand line). The
81a0: 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 73 20   default values 
81b0: 61 72 65 0a 23 20 62 61 73 65 64 20 6f 6e 20 42  are.# based on B
81c0: 55 49 4c 44 44 49 52 54 4f 50 2e 0a 23 20 53 54  UILDDIRTOP..# ST
81d0: 55 42 50 52 45 46 49 58 20 2d 20 6e 61 6d 65 20  UBPREFIX - name 
81e0: 6f 66 20 74 68 65 20 73 74 75 62 73 20 6c 69 62  of the stubs lib
81f0: 72 61 72 79 20 66 6f 72 20 74 68 69 73 20 70 72  rary for this pr
8200: 6f 6a 65 63 74 0a 23 20 50 52 4a 49 4d 50 4c 49  oject.# PRJIMPLI
8210: 42 20 2d 20 6f 75 74 70 75 74 20 70 61 74 68 20  B - output path 
8220: 6f 66 20 74 68 65 20 67 65 6e 65 72 61 74 65 64  of the generated
8230: 20 70 72 6f 6a 65 63 74 20 69 6d 70 6f 72 74 20   project import 
8240: 6c 69 62 72 61 72 79 0a 23 20 50 52 4a 4c 49 42  library.# PRJLIB
8250: 4e 41 4d 45 20 2d 20 6e 61 6d 65 20 6f 66 20 67  NAME - name of g
8260: 65 6e 65 72 61 74 65 64 20 70 72 6f 6a 65 63 74  enerated project
8270: 20 6c 69 62 72 61 72 79 0a 23 20 50 52 4a 4c 49   library.# PRJLI
8280: 42 20 20 20 20 20 2d 20 6f 75 74 70 75 74 20 70  B     - output p
8290: 61 74 68 20 6f 66 20 67 65 6e 65 72 61 74 65 64  ath of generated
82a0: 20 70 72 6f 6a 65 63 74 20 6c 69 62 72 61 72 79   project library
82b0: 0a 23 20 50 52 4a 53 54 55 42 4c 49 42 4e 41 4d  .# PRJSTUBLIBNAM
82c0: 45 20 2d 20 6e 61 6d 65 20 6f 66 20 74 68 65 20  E - name of the 
82d0: 67 65 6e 65 72 61 74 65 64 20 70 72 6f 6a 65 63  generated projec
82e0: 74 20 73 74 75 62 73 20 6c 69 62 72 61 72 79 0a  t stubs library.
82f0: 23 20 50 52 4a 53 54 55 42 4c 49 42 20 2d 20 6f  # PRJSTUBLIB - o
8300: 75 74 70 75 74 20 70 61 74 68 20 6f 66 20 74 68  utput path of th
8310: 65 20 67 65 6e 65 72 61 74 65 64 20 70 72 6f 6a  e generated proj
8320: 65 63 74 20 73 74 75 62 73 20 6c 69 62 72 61 72  ect stubs librar
8330: 79 0a 23 20 52 45 53 46 49 4c 45 20 2d 20 6f 75  y.# RESFILE - ou
8340: 74 70 75 74 20 72 65 73 6f 75 72 63 65 20 66 69  tput resource fi
8350: 6c 65 20 28 6f 6e 6c 79 20 69 66 20 6e 6f 74 20  le (only if not 
8360: 73 74 61 74 69 63 20 62 75 69 6c 64 29 0a 0a 53  static build)..S
8370: 55 46 58 09 20 20 20 20 3d 20 74 73 67 78 0a 0a  UFX.    = tsgx..
8380: 21 69 66 20 24 28 44 45 42 55 47 29 0a 42 55 49  !if $(DEBUG).BUI
8390: 4c 44 44 49 52 54 4f 50 20 3d 20 44 65 62 75 67  LDDIRTOP = Debug
83a0: 0a 21 65 6c 73 65 0a 42 55 49 4c 44 44 49 52 54  .!else.BUILDDIRT
83b0: 4f 50 20 3d 20 52 65 6c 65 61 73 65 0a 21 65 6e  OP = Release.!en
83c0: 64 69 66 0a 0a 21 69 66 20 22 24 28 4d 41 43 48  dif..!if "$(MACH
83d0: 49 4e 45 29 22 20 21 3d 20 22 49 58 38 36 22 0a  INE)" != "IX86".
83e0: 42 55 49 4c 44 44 49 52 54 4f 50 20 3d 24 28 42  BUILDDIRTOP =$(B
83f0: 55 49 4c 44 44 49 52 54 4f 50 29 5f 24 28 4d 41  UILDDIRTOP)_$(MA
8400: 43 48 49 4e 45 29 0a 21 65 6e 64 69 66 0a 21 69  CHINE).!endif.!i
8410: 66 20 24 28 56 43 56 45 52 29 20 3e 20 36 0a 42  f $(VCVER) > 6.B
8420: 55 49 4c 44 44 49 52 54 4f 50 20 3d 24 28 42 55  UILDDIRTOP =$(BU
8430: 49 4c 44 44 49 52 54 4f 50 29 5f 56 43 24 28 56  ILDDIRTOP)_VC$(V
8440: 43 56 45 52 29 0a 21 65 6e 64 69 66 0a 0a 21 69  CVER).!endif..!i
8450: 66 20 21 24 28 44 45 42 55 47 29 20 7c 7c 20 24  f !$(DEBUG) || $
8460: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3e 20  (TCL_VERSION) > 
8470: 38 36 20 7c 7c 20 24 28 44 45 42 55 47 29 20 26  86 || $(DEBUG) &
8480: 26 20 24 28 55 4e 43 48 45 43 4b 45 44 29 0a 53  & $(UNCHECKED).S
8490: 55 46 58 09 20 20 20 20 3d 20 24 28 53 55 46 58  UFX.    = $(SUFX
84a0: 3a 67 3d 29 0a 21 65 6e 64 69 66 0a 0a 54 4d 50  :g=).!endif..TMP
84b0: 5f 44 49 52 46 55 4c 4c 20 3d 20 2e 5c 24 28 42  _DIRFULL = .\$(B
84c0: 55 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 50 52  UILDDIRTOP)\$(PR
84d0: 4f 4a 45 43 54 29 5f 54 68 72 65 61 64 65 64 44  OJECT)_ThreadedD
84e0: 79 6e 61 6d 69 63 53 74 61 74 69 63 58 0a 0a 21  ynamicStaticX..!
84f0: 69 66 20 21 24 28 53 54 41 54 49 43 5f 42 55 49  if !$(STATIC_BUI
8500: 4c 44 29 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20  LD).TMP_DIRFULL 
8510: 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a  = $(TMP_DIRFULL:
8520: 53 74 61 74 69 63 3d 29 0a 53 55 46 58 09 20 20  Static=).SUFX.  
8530: 20 20 3d 20 24 28 53 55 46 58 3a 73 3d 29 0a 45    = $(SUFX:s=).E
8540: 58 54 09 20 20 20 20 3d 20 64 6c 6c 0a 54 4d 50  XT.    = dll.TMP
8550: 5f 44 49 52 46 55 4c 4c 20 3d 20 24 28 54 4d 50  _DIRFULL = $(TMP
8560: 5f 44 49 52 46 55 4c 4c 3a 58 3d 29 0a 53 55 46  _DIRFULL:X=).SUF
8570: 58 09 20 20 20 20 3d 20 24 28 53 55 46 58 3a 78  X.    = $(SUFX:x
8580: 3d 29 0a 21 65 6c 73 65 0a 54 4d 50 5f 44 49 52  =).!else.TMP_DIR
8590: 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52  FULL = $(TMP_DIR
85a0: 46 55 4c 4c 3a 44 79 6e 61 6d 69 63 3d 29 0a 45  FULL:Dynamic=).E
85b0: 58 54 09 20 20 20 20 3d 20 6c 69 62 0a 21 69 66  XT.    = lib.!if
85c0: 20 21 24 28 4d 53 56 43 52 54 29 0a 54 4d 50 5f   !$(MSVCRT).TMP_
85d0: 44 49 52 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f  DIRFULL = $(TMP_
85e0: 44 49 52 46 55 4c 4c 3a 58 3d 29 0a 53 55 46 58  DIRFULL:X=).SUFX
85f0: 09 20 20 20 20 3d 20 24 28 53 55 46 58 3a 78 3d  .    = $(SUFX:x=
8600: 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  ).!endif.!endif.
8610: 0a 21 69 66 20 21 24 28 54 43 4c 5f 54 48 52 45  .!if !$(TCL_THRE
8620: 41 44 53 29 20 7c 7c 20 24 28 54 43 4c 5f 56 45  ADS) || $(TCL_VE
8630: 52 53 49 4f 4e 29 20 3e 20 38 36 0a 54 4d 50 5f  RSION) > 86.TMP_
8640: 44 49 52 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f  DIRFULL = $(TMP_
8650: 44 49 52 46 55 4c 4c 3a 54 68 72 65 61 64 65 64  DIRFULL:Threaded
8660: 3d 29 0a 53 55 46 58 09 20 20 20 20 3d 20 24 28  =).SUFX.    = $(
8670: 53 55 46 58 3a 74 3d 29 0a 21 65 6e 64 69 66 0a  SUFX:t=).!endif.
8680: 0a 21 69 66 6e 64 65 66 20 54 4d 50 5f 44 49 52  .!ifndef TMP_DIR
8690: 0a 54 4d 50 5f 44 49 52 09 20 20 20 20 3d 20 24  .TMP_DIR.    = $
86a0: 28 54 4d 50 5f 44 49 52 46 55 4c 4c 29 0a 21 69  (TMP_DIRFULL).!i
86b0: 66 6e 64 65 66 20 4f 55 54 5f 44 49 52 0a 4f 55  fndef OUT_DIR.OU
86c0: 54 5f 44 49 52 09 20 20 20 20 3d 20 2e 5c 24 28  T_DIR.    = .\$(
86d0: 42 55 49 4c 44 44 49 52 54 4f 50 29 0a 21 65 6e  BUILDDIRTOP).!en
86e0: 64 69 66 0a 21 65 6c 73 65 0a 21 69 66 6e 64 65  dif.!else.!ifnde
86f0: 66 20 4f 55 54 5f 44 49 52 0a 4f 55 54 5f 44 49  f OUT_DIR.OUT_DI
8700: 52 09 20 20 20 20 3d 20 24 28 54 4d 50 5f 44 49  R.    = $(TMP_DI
8710: 52 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  R).!endif.!endif
8720: 0a 0a 23 20 52 65 6c 61 74 69 76 65 20 70 61 74  ..# Relative pat
8730: 68 73 20 2d 3e 20 61 62 73 6f 6c 75 74 65 0a 21  hs -> absolute.!
8740: 69 66 20 5b 65 63 68 6f 20 4f 55 54 5f 44 49 52  if [echo OUT_DIR
8750: 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f   = \> nmakehlp.o
8760: 75 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b 6e 6d 61  ut] \.   || [nma
8770: 6b 65 68 6c 70 20 2d 51 20 22 24 28 4f 55 54 5f  kehlp -Q "$(OUT_
8780: 44 49 52 29 22 20 3e 3e 20 6e 6d 61 6b 65 68 6c  DIR)" >> nmakehl
8790: 70 2e 6f 75 74 5d 0a 21 65 72 72 6f 72 20 2a 2a  p.out].!error **
87a0: 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 75 6c 6c  * Could not full
87b0: 79 20 71 75 61 6c 69 66 79 20 70 61 74 68 20 4f  y qualify path O
87c0: 55 54 5f 44 49 52 3d 24 28 4f 55 54 5f 44 49 52  UT_DIR=$(OUT_DIR
87d0: 29 0a 21 65 6e 64 69 66 0a 21 69 66 20 5b 65 63  ).!endif.!if [ec
87e0: 68 6f 20 54 4d 50 5f 44 49 52 20 3d 20 5c 3e 3e  ho TMP_DIR = \>>
87f0: 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20 5c   nmakehlp.out] \
8800: 0a 20 20 20 7c 7c 20 5b 6e 6d 61 6b 65 68 6c 70  .   || [nmakehlp
8810: 20 2d 51 20 22 24 28 54 4d 50 5f 44 49 52 29 22   -Q "$(TMP_DIR)"
8820: 20 3e 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74   >> nmakehlp.out
8830: 5d 0a 21 65 72 72 6f 72 20 2a 2a 2a 20 43 6f 75  ].!error *** Cou
8840: 6c 64 20 6e 6f 74 20 66 75 6c 6c 79 20 71 75 61  ld not fully qua
8850: 6c 69 66 79 20 70 61 74 68 20 54 4d 50 5f 44 49  lify path TMP_DI
8860: 52 3d 24 28 54 4d 50 5f 44 49 52 29 0a 21 65 6e  R=$(TMP_DIR).!en
8870: 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61  dif.!include nma
8880: 6b 65 68 6c 70 2e 6f 75 74 0a 0a 23 20 54 68 65  kehlp.out..# The
8890: 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 73 74 75   name of the stu
88a0: 62 73 20 6c 69 62 72 61 72 79 20 66 6f 72 20 74  bs library for t
88b0: 68 65 20 70 72 6f 6a 65 63 74 20 62 65 69 6e 67  he project being
88c0: 20 62 75 69 6c 74 0a 53 54 55 42 50 52 45 46 49   built.STUBPREFI
88d0: 58 20 20 20 20 20 20 3d 20 24 28 50 52 4f 4a 45  X      = $(PROJE
88e0: 43 54 29 73 74 75 62 0a 0a 23 0a 23 20 53 65 74  CT)stub..#.# Set
88f0: 20 75 70 20 70 61 74 68 73 20 74 6f 20 76 61 72   up paths to var
8900: 69 6f 75 73 20 54 63 6c 20 65 78 65 63 75 74 61  ious Tcl executa
8910: 62 6c 65 73 20 61 6e 64 20 6c 69 62 72 61 72 69  bles and librari
8920: 65 73 20 6e 65 65 64 65 64 20 62 79 20 65 78 74  es needed by ext
8930: 65 6e 73 69 6f 6e 73 0a 23 0a 0a 23 20 54 49 50  ensions.#..# TIP
8940: 20 34 33 30 2e 20 55 6e 75 73 65 64 20 66 6f 72   430. Unused for
8950: 20 38 2e 36 20 62 75 74 20 6e 6f 20 68 61 72 6d   8.6 but no harm
8960: 20 64 65 66 69 6e 69 6e 67 20 69 74 20 74 6f 20   defining it to 
8970: 61 6c 6c 6f 77 20 61 20 63 6f 6d 6d 6f 6e 20 72  allow a common r
8980: 75 6c 65 73 2e 76 63 0a 54 43 4c 53 43 52 49 50  ules.vc.TCLSCRIP
8990: 54 5a 49 50 4e 41 4d 45 20 3d 20 6c 69 62 74 63  TZIPNAME = libtc
89a0: 6c 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52  l$(TCL_MAJOR_VER
89b0: 53 49 4f 4e 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f  SION).$(TCL_MINO
89c0: 52 5f 56 45 52 53 49 4f 4e 29 24 28 54 43 4c 5f  R_VERSION)$(TCL_
89d0: 50 41 54 43 48 5f 4c 45 54 54 45 52 29 24 28 54  PATCH_LETTER)$(T
89e0: 43 4c 5f 52 45 4c 45 41 53 45 5f 53 45 52 49 41  CL_RELEASE_SERIA
89f0: 4c 29 2e 7a 69 70 0a 54 4b 53 43 52 49 50 54 5a  L).zip.TKSCRIPTZ
8a00: 49 50 4e 41 4d 45 20 3d 20 6c 69 62 74 6b 24 28  IPNAME = libtk$(
8a10: 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e  TK_MAJOR_VERSION
8a20: 29 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52  ).$(TK_MINOR_VER
8a30: 53 49 4f 4e 29 24 28 54 4b 5f 50 41 54 43 48 5f  SION)$(TK_PATCH_
8a40: 4c 45 54 54 45 52 29 24 28 54 4b 5f 52 45 4c 45  LETTER)$(TK_RELE
8a50: 41 53 45 5f 53 45 52 49 41 4c 29 2e 7a 69 70 0a  ASE_SERIAL).zip.
8a60: 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c  .!if $(DOING_TCL
8a70: 29 0a 54 43 4c 53 48 4e 41 4d 45 20 20 20 20 20  ).TCLSHNAME     
8a80: 20 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 73 68    = $(PROJECT)sh
8a90: 24 28 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58  $(VERSION)$(SUFX
8aa0: 29 2e 65 78 65 0a 54 43 4c 53 48 09 09 3d 20 24  ).exe.TCLSH..= $
8ab0: 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 43 4c 53  (OUT_DIR)\$(TCLS
8ac0: 48 4e 41 4d 45 29 0a 54 43 4c 49 4d 50 4c 49 42  HNAME).TCLIMPLIB
8ad0: 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28  .= $(OUT_DIR)\$(
8ae0: 50 52 4f 4a 45 43 54 29 24 28 56 45 52 53 49 4f  PROJECT)$(VERSIO
8af0: 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 0a 54 43  N)$(SUFX).lib.TC
8b00: 4c 4c 49 42 4e 41 4d 45 09 3d 20 24 28 50 52 4f  LLIBNAME.= $(PRO
8b10: 4a 45 43 54 29 24 28 56 45 52 53 49 4f 4e 29 24  JECT)$(VERSION)$
8b20: 28 53 55 46 58 29 2e 24 28 45 58 54 29 0a 54 43  (SUFX).$(EXT).TC
8b30: 4c 4c 49 42 09 09 3d 20 24 28 4f 55 54 5f 44 49  LLIB..= $(OUT_DI
8b40: 52 29 5c 24 28 54 43 4c 4c 49 42 4e 41 4d 45 29  R)\$(TCLLIBNAME)
8b50: 0a 54 43 4c 53 43 52 49 50 54 5a 49 50 20 20 20  .TCLSCRIPTZIP   
8b60: 20 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28   = $(OUT_DIR)\$(
8b70: 54 43 4c 53 43 52 49 50 54 5a 49 50 4e 41 4d 45  TCLSCRIPTZIPNAME
8b80: 29 0a 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a  )..!if $(TCL_MAJ
8b90: 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38  OR_VERSION) == 8
8ba0: 0a 54 43 4c 53 54 55 42 4c 49 42 4e 41 4d 45 09  .TCLSTUBLIBNAME.
8bb0: 3d 20 24 28 53 54 55 42 50 52 45 46 49 58 29 24  = $(STUBPREFIX)$
8bc0: 28 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0a 21 65  (VERSION).lib.!e
8bd0: 6c 73 65 0a 54 43 4c 53 54 55 42 4c 49 42 4e 41  lse.TCLSTUBLIBNA
8be0: 4d 45 09 3d 20 24 28 53 54 55 42 50 52 45 46 49  ME.= $(STUBPREFI
8bf0: 58 29 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 54 43  X).lib.!endif.TC
8c00: 4c 53 54 55 42 4c 49 42 09 3d 20 24 28 4f 55 54  LSTUBLIB.= $(OUT
8c10: 5f 44 49 52 29 5c 24 28 54 43 4c 53 54 55 42 4c  _DIR)\$(TCLSTUBL
8c20: 49 42 4e 41 4d 45 29 0a 54 43 4c 5f 49 4e 43 4c  IBNAME).TCL_INCL
8c30: 55 44 45 53 20 20 20 20 3d 20 2d 49 22 24 28 57  UDES    = -I"$(W
8c40: 49 4e 5f 44 49 52 29 22 20 2d 49 22 24 28 47 45  IN_DIR)" -I"$(GE
8c50: 4e 45 52 49 43 44 49 52 29 22 0a 0a 21 65 6c 73  NERICDIR)"..!els
8c60: 65 20 23 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c  e # !$(DOING_TCL
8c70: 29 0a 0a 21 69 66 20 24 28 54 43 4c 49 4e 53 54  )..!if $(TCLINST
8c80: 41 4c 4c 29 20 23 20 42 75 69 6c 64 69 6e 67 20  ALL) # Building 
8c90: 61 67 61 69 6e 73 74 20 61 6e 20 69 6e 73 74 61  against an insta
8ca0: 6c 6c 65 64 20 54 63 6c 0a 0a 23 20 57 68 65 6e  lled Tcl..# When
8cb0: 20 62 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73   building extens
8cc0: 69 6f 6e 73 2c 20 77 65 20 6e 65 65 64 20 74 6f  ions, we need to
8cd0: 20 6c 6f 63 61 74 65 20 74 63 6c 73 68 2e 20 44   locate tclsh. D
8ce0: 65 70 65 6e 64 69 6e 67 20 6f 6e 20 76 65 72 73  epending on vers
8cf0: 69 6f 6e 0a 23 20 6f 66 20 54 63 6c 20 77 65 20  ion.# of Tcl we 
8d00: 61 72 65 20 62 75 69 6c 64 69 6e 67 20 61 67 61  are building aga
8d10: 69 6e 73 74 2c 20 74 68 69 73 20 6d 61 79 20 6f  inst, this may o
8d20: 72 20 6d 61 79 20 6e 6f 74 20 68 61 76 65 20 61  r may not have a
8d30: 20 22 74 22 20 73 75 66 66 69 78 2e 0a 23 20 54   "t" suffix..# T
8d40: 72 79 20 76 61 72 69 6f 75 73 20 70 6f 73 73 69  ry various possi
8d50: 62 69 6c 69 74 69 65 73 20 69 6e 20 74 75 72 6e  bilities in turn
8d60: 2e 0a 54 43 4c 53 48 09 09 3d 20 24 28 5f 54 43  ..TCLSH..= $(_TC
8d70: 4c 44 49 52 29 5c 62 69 6e 5c 74 63 6c 73 68 24  LDIR)\bin\tclsh$
8d80: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 53  (TCL_VERSION)$(S
8d90: 55 46 58 3a 74 3d 29 2e 65 78 65 0a 21 69 66 20  UFX:t=).exe.!if 
8da0: 21 65 78 69 73 74 28 22 24 28 54 43 4c 53 48 29  !exist("$(TCLSH)
8db0: 22 29 0a 54 43 4c 53 48 20 20 20 20 20 20 20 20  ").TCLSH        
8dc0: 20 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c     = $(_TCLDIR)\
8dd0: 62 69 6e 5c 74 63 6c 73 68 24 28 54 43 4c 5f 56  bin\tclsh$(TCL_V
8de0: 45 52 53 49 4f 4e 29 74 24 28 53 55 46 58 3a 74  ERSION)t$(SUFX:t
8df0: 3d 29 2e 65 78 65 0a 21 65 6e 64 69 66 0a 0a 21  =).exe.!endif..!
8e00: 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56  if $(TCL_MAJOR_V
8e10: 45 52 53 49 4f 4e 29 20 3d 3d 20 38 0a 54 43 4c  ERSION) == 8.TCL
8e20: 53 54 55 42 4c 49 42 09 3d 20 24 28 5f 54 43 4c  STUBLIB.= $(_TCL
8e30: 44 49 52 29 5c 6c 69 62 5c 74 63 6c 73 74 75 62  DIR)\lib\tclstub
8e40: 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 2e 6c  $(TCL_VERSION).l
8e50: 69 62 0a 21 65 6c 73 65 0a 54 43 4c 53 54 55 42  ib.!else.TCLSTUB
8e60: 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29  LIB.= $(_TCLDIR)
8e70: 5c 6c 69 62 5c 74 63 6c 73 74 75 62 2e 6c 69 62  \lib\tclstub.lib
8e80: 0a 21 65 6e 64 69 66 0a 54 43 4c 49 4d 50 4c 49  .!endif.TCLIMPLI
8e90: 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c  B.= $(_TCLDIR)\l
8ea0: 69 62 5c 74 63 6c 24 28 54 43 4c 5f 56 45 52 53  ib\tcl$(TCL_VERS
8eb0: 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e 6c  ION)$(SUFX:t=).l
8ec0: 69 62 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69  ib.# When buildi
8ed0: 6e 67 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 6d  ng extensions, m
8ee0: 61 79 20 62 65 20 6c 69 6e 6b 69 6e 67 20 61 67  ay be linking ag
8ef0: 61 69 6e 73 74 20 54 63 6c 20 74 68 61 74 20 64  ainst Tcl that d
8f00: 6f 65 73 20 6e 6f 74 20 61 64 64 0a 23 20 22 74  oes not add.# "t
8f10: 22 20 73 75 66 66 69 78 20 28 65 2e 67 2e 20 38  " suffix (e.g. 8
8f20: 2e 35 20 6f 72 20 38 2e 37 29 2e 20 49 66 20 6c  .5 or 8.7). If l
8f30: 69 62 20 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65  ib not found che
8f40: 63 6b 20 66 6f 72 20 74 68 61 74 20 70 6f 73 73  ck for that poss
8f50: 69 62 69 6c 69 74 79 2e 0a 21 69 66 20 21 65 78  ibility..!if !ex
8f60: 69 73 74 28 22 24 28 54 43 4c 49 4d 50 4c 49 42  ist("$(TCLIMPLIB
8f70: 29 22 29 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20  )").TCLIMPLIB.= 
8f80: 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74  $(_TCLDIR)\lib\t
8f90: 63 6c 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29  cl$(TCL_VERSION)
8fa0: 74 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a  t$(SUFX:t=).lib.
8fb0: 21 65 6e 64 69 66 0a 54 43 4c 5f 4c 49 42 52 41  !endif.TCL_LIBRA
8fc0: 52 59 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  RY.= $(_TCLDIR)\
8fd0: 6c 69 62 0a 54 43 4c 52 45 47 4c 49 42 09 3d 20  lib.TCLREGLIB.= 
8fe0: 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74  $(_TCLDIR)\lib\t
8ff0: 63 6c 72 65 67 31 33 24 28 53 55 46 58 3a 74 3d  clreg13$(SUFX:t=
9000: 29 2e 6c 69 62 0a 54 43 4c 44 44 45 4c 49 42 09  ).lib.TCLDDELIB.
9010: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62  = $(_TCLDIR)\lib
9020: 5c 74 63 6c 64 64 65 31 34 24 28 53 55 46 58 3a  \tcldde14$(SUFX:
9030: 74 3d 29 2e 6c 69 62 0a 54 43 4c 53 43 52 49 50  t=).lib.TCLSCRIP
9040: 54 5a 49 50 09 3d 20 24 28 5f 54 43 4c 44 49 52  TZIP.= $(_TCLDIR
9050: 29 5c 6c 69 62 5c 24 28 54 43 4c 53 43 52 49 50  )\lib\$(TCLSCRIP
9060: 54 5a 49 50 4e 41 4d 45 29 0a 54 43 4c 54 4f 4f  TZIPNAME).TCLTOO
9070: 4c 53 44 49 52 09 3d 20 5c 6d 75 73 74 5c 68 61  LSDIR.= \must\ha
9080: 76 65 5c 74 63 6c 5c 73 6f 75 72 63 65 73 5c 74  ve\tcl\sources\t
9090: 6f 5c 62 75 69 6c 64 5c 74 68 69 73 5c 74 61 72  o\build\this\tar
90a0: 67 65 74 0a 54 43 4c 5f 49 4e 43 4c 55 44 45 53  get.TCL_INCLUDES
90b0: 20 20 20 20 3d 20 2d 49 22 24 28 5f 54 43 4c 44      = -I"$(_TCLD
90c0: 49 52 29 5c 69 6e 63 6c 75 64 65 22 0a 0a 21 65  IR)\include"..!e
90d0: 6c 73 65 20 23 20 42 75 69 6c 64 69 6e 67 20 61  lse # Building a
90e0: 67 61 69 6e 73 74 20 54 63 6c 20 73 6f 75 72 63  gainst Tcl sourc
90f0: 65 73 0a 0a 54 43 4c 53 48 09 09 3d 20 24 28 5f  es..TCLSH..= $(_
9100: 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  TCLDIR)\win\$(BU
9110: 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 73 68  ILDDIRTOP)\tclsh
9120: 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28  $(TCL_VERSION)$(
9130: 53 55 46 58 3a 74 3d 29 2e 65 78 65 0a 21 69 66  SUFX:t=).exe.!if
9140: 20 21 65 78 69 73 74 28 24 28 54 43 4c 53 48 29   !exist($(TCLSH)
9150: 29 0a 54 43 4c 53 48 09 09 3d 20 24 28 5f 54 43  ).TCLSH..= $(_TC
9160: 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c  LDIR)\win\$(BUIL
9170: 44 44 49 52 54 4f 50 29 5c 74 63 6c 73 68 24 28  DDIRTOP)\tclsh$(
9180: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 74 24 28 53  TCL_VERSION)t$(S
9190: 55 46 58 3a 74 3d 29 2e 65 78 65 0a 21 65 6e 64  UFX:t=).exe.!end
91a0: 69 66 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a  if.!if $(TCL_MAJ
91b0: 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38  OR_VERSION) == 8
91c0: 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d 20 24 28  .TCLSTUBLIB.= $(
91d0: 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42  _TCLDIR)\win\$(B
91e0: 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 73  UILDDIRTOP)\tcls
91f0: 74 75 62 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e  tub$(TCL_VERSION
9200: 29 2e 6c 69 62 0a 21 65 6c 73 65 0a 54 43 4c 53  ).lib.!else.TCLS
9210: 54 55 42 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44  TUBLIB.= $(_TCLD
9220: 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44  IR)\win\$(BUILDD
9230: 49 52 54 4f 50 29 5c 74 63 6c 73 74 75 62 2e 6c  IRTOP)\tclstub.l
9240: 69 62 0a 21 65 6e 64 69 66 0a 54 43 4c 49 4d 50  ib.!endif.TCLIMP
9250: 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29  LIB.= $(_TCLDIR)
9260: 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54  \win\$(BUILDDIRT
9270: 4f 50 29 5c 74 63 6c 24 28 54 43 4c 5f 56 45 52  OP)\tcl$(TCL_VER
9280: 53 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e  SION)$(SUFX:t=).
9290: 6c 69 62 0a 23 20 57 68 65 6e 20 62 75 69 6c 64  lib.# When build
92a0: 69 6e 67 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20  ing extensions, 
92b0: 6d 61 79 20 62 65 20 6c 69 6e 6b 69 6e 67 20 61  may be linking a
92c0: 67 61 69 6e 73 74 20 54 63 6c 20 74 68 61 74 20  gainst Tcl that 
92d0: 64 6f 65 73 20 6e 6f 74 20 61 64 64 0a 23 20 22  does not add.# "
92e0: 74 22 20 73 75 66 66 69 78 20 28 65 2e 67 2e 20  t" suffix (e.g. 
92f0: 38 2e 35 20 6f 72 20 38 2e 37 29 2e 20 49 66 20  8.5 or 8.7). If 
9300: 6c 69 62 20 6e 6f 74 20 66 6f 75 6e 64 20 63 68  lib not found ch
9310: 65 63 6b 20 66 6f 72 20 74 68 61 74 20 70 6f 73  eck for that pos
9320: 73 69 62 69 6c 69 74 79 2e 0a 21 69 66 20 21 65  sibility..!if !e
9330: 78 69 73 74 28 22 24 28 54 43 4c 49 4d 50 4c 49  xist("$(TCLIMPLI
9340: 42 29 22 29 0a 54 43 4c 49 4d 50 4c 49 42 09 3d  B)").TCLIMPLIB.=
9350: 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c   $(_TCLDIR)\win\
9360: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74  $(BUILDDIRTOP)\t
9370: 63 6c 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29  cl$(TCL_VERSION)
9380: 74 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a  t$(SUFX:t=).lib.
9390: 21 65 6e 64 69 66 0a 54 43 4c 5f 4c 49 42 52 41  !endif.TCL_LIBRA
93a0: 52 59 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  RY.= $(_TCLDIR)\
93b0: 6c 69 62 72 61 72 79 0a 54 43 4c 52 45 47 4c 49  library.TCLREGLI
93c0: 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77  B.= $(_TCLDIR)\w
93d0: 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50  in\$(BUILDDIRTOP
93e0: 29 5c 74 63 6c 72 65 67 31 33 24 28 53 55 46 58  )\tclreg13$(SUFX
93f0: 3a 74 3d 29 2e 6c 69 62 0a 54 43 4c 44 44 45 4c  :t=).lib.TCLDDEL
9400: 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  IB.= $(_TCLDIR)\
9410: 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f  win\$(BUILDDIRTO
9420: 50 29 5c 74 63 6c 64 64 65 31 34 24 28 53 55 46  P)\tcldde14$(SUF
9430: 58 3a 74 3d 29 2e 6c 69 62 0a 54 43 4c 53 43 52  X:t=).lib.TCLSCR
9440: 49 50 54 5a 49 50 09 3d 20 24 28 5f 54 43 4c 44  IPTZIP.= $(_TCLD
9450: 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44  IR)\win\$(BUILDD
9460: 49 52 54 4f 50 29 5c 24 28 54 43 4c 53 43 52 49  IRTOP)\$(TCLSCRI
9470: 50 54 5a 49 50 4e 41 4d 45 29 0a 54 43 4c 54 4f  PTZIPNAME).TCLTO
9480: 4f 4c 53 44 49 52 09 3d 20 24 28 5f 54 43 4c 44  OLSDIR.= $(_TCLD
9490: 49 52 29 5c 74 6f 6f 6c 73 0a 54 43 4c 5f 49 4e  IR)\tools.TCL_IN
94a0: 43 4c 55 44 45 53 09 3d 20 2d 49 22 24 28 5f 54  CLUDES.= -I"$(_T
94b0: 43 4c 44 49 52 29 5c 67 65 6e 65 72 69 63 22 20  CLDIR)\generic" 
94c0: 2d 49 22 24 28 5f 54 43 4c 44 49 52 29 5c 77 69  -I"$(_TCLDIR)\wi
94d0: 6e 22 0a 0a 21 65 6e 64 69 66 20 23 20 54 43 4c  n"..!endif # TCL
94e0: 49 4e 53 54 41 4c 4c 0a 0a 21 69 66 20 21 24 28  INSTALL..!if !$(
94f0: 53 54 41 54 49 43 5f 42 55 49 4c 44 29 20 26 26  STATIC_BUILD) &&
9500: 20 22 24 28 54 43 4c 5f 42 55 49 4c 44 5f 46 4f   "$(TCL_BUILD_FO
9510: 52 29 22 20 3d 3d 20 22 38 22 0a 74 63 6c 6c 69  R)" == "8".tclli
9520: 62 73 20 3d 20 22 24 28 54 43 4c 53 54 55 42 4c  bs = "$(TCLSTUBL
9530: 49 42 29 22 0a 21 65 6c 73 65 0a 74 63 6c 6c 69  IB)".!else.tclli
9540: 62 73 20 3d 20 22 24 28 54 43 4c 53 54 55 42 4c  bs = "$(TCLSTUBL
9550: 49 42 29 22 20 22 24 28 54 43 4c 49 4d 50 4c 49  IB)" "$(TCLIMPLI
9560: 42 29 22 0a 21 65 6e 64 69 66 0a 0a 21 65 6e 64  B)".!endif..!end
9570: 69 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 43 4c  if # $(DOING_TCL
9580: 29 0a 0a 23 20 57 65 20 6e 65 65 64 20 61 20 74  )..# We need a t
9590: 63 6c 73 68 20 74 68 61 74 20 77 69 6c 6c 20 72  clsh that will r
95a0: 75 6e 20 6f 6e 20 74 68 65 20 68 6f 73 74 20 6d  un on the host m
95b0: 61 63 68 69 6e 65 20 61 73 20 70 61 72 74 20 6f  achine as part o
95c0: 66 20 74 68 65 20 62 75 69 6c 64 2e 0a 23 20 49  f the build..# I
95d0: 58 38 36 20 72 75 6e 73 20 6f 6e 20 61 6c 6c 20  X86 runs on all 
95e0: 61 72 63 68 69 74 65 63 74 75 72 65 73 2e 0a 21  architectures..!
95f0: 69 66 6e 64 65 66 20 54 43 4c 53 48 5f 4e 41 54  ifndef TCLSH_NAT
9600: 49 56 45 0a 21 69 66 20 22 24 28 4d 41 43 48 49  IVE.!if "$(MACHI
9610: 4e 45 29 22 20 3d 3d 20 22 49 58 38 36 22 20 7c  NE)" == "IX86" |
9620: 7c 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d  | "$(MACHINE)" =
9630: 3d 20 22 24 28 4e 41 54 49 56 45 5f 41 52 43 48  = "$(NATIVE_ARCH
9640: 29 22 0a 54 43 4c 53 48 5f 4e 41 54 49 56 45 09  )".TCLSH_NATIVE.
9650: 3d 20 24 28 54 43 4c 53 48 29 0a 21 65 6c 73 65  = $(TCLSH).!else
9660: 0a 21 65 72 72 6f 72 20 59 6f 75 20 6d 75 73 74  .!error You must
9670: 20 65 78 70 6c 69 63 69 74 6c 79 20 73 65 74 20   explicitly set 
9680: 54 43 4c 53 48 5f 4e 41 54 49 56 45 20 66 6f 72  TCLSH_NATIVE for
9690: 20 63 72 6f 73 73 2d 63 6f 6d 70 69 6c 61 74 69   cross-compilati
96a0: 6f 6e 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66  on.!endif.!endif
96b0: 0a 0a 23 20 44 6f 20 74 68 65 20 73 61 6d 65 20  ..# Do the same 
96c0: 66 6f 72 20 54 6b 20 61 6e 64 20 54 6b 20 65 78  for Tk and Tk ex
96d0: 74 65 6e 73 69 6f 6e 73 20 74 68 61 74 20 72 65  tensions that re
96e0: 71 75 69 72 65 20 74 68 65 20 54 6b 20 6c 69 62  quire the Tk lib
96f0: 72 61 72 69 65 73 0a 21 69 66 20 24 28 44 4f 49  raries.!if $(DOI
9700: 4e 47 5f 54 4b 29 20 7c 7c 20 24 28 4e 45 45 44  NG_TK) || $(NEED
9710: 5f 54 4b 29 0a 57 49 53 48 4e 41 4d 45 50 52 45  _TK).WISHNAMEPRE
9720: 46 49 58 20 3d 20 77 69 73 68 0a 57 49 53 48 4e  FIX = wish.WISHN
9730: 41 4d 45 20 3d 20 24 28 57 49 53 48 4e 41 4d 45  AME = $(WISHNAME
9740: 50 52 45 46 49 58 29 24 28 54 4b 5f 56 45 52 53  PREFIX)$(TK_VERS
9750: 49 4f 4e 29 24 28 53 55 46 58 29 2e 65 78 65 0a  ION)$(SUFX).exe.
9760: 54 4b 4c 49 42 4e 41 4d 45 09 3d 20 74 6b 24 28  TKLIBNAME.= tk$(
9770: 54 4b 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46  TK_VERSION)$(SUF
9780: 58 29 2e 24 28 45 58 54 29 0a 54 4b 49 4d 50 4c  X).$(EXT).TKIMPL
9790: 49 42 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b 5f  IBNAME.= tk$(TK_
97a0: 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e  VERSION)$(SUFX).
97b0: 6c 69 62 0a 54 4b 53 54 55 42 4c 49 42 4e 41 4d  lib.TKSTUBLIBNAM
97c0: 45 09 3d 20 74 6b 73 74 75 62 24 28 54 4b 5f 56  E.= tkstub$(TK_V
97d0: 45 52 53 49 4f 4e 29 2e 6c 69 62 0a 0a 21 69 66  ERSION).lib..!if
97e0: 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0a 57 49 53   $(DOING_TK).WIS
97f0: 48 20 09 09 3d 20 24 28 4f 55 54 5f 44 49 52 29  H ..= $(OUT_DIR)
9800: 5c 24 28 57 49 53 48 4e 41 4d 45 29 0a 54 4b 53  \$(WISHNAME).TKS
9810: 54 55 42 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44  TUBLIB.= $(OUT_D
9820: 49 52 29 5c 24 28 54 4b 53 54 55 42 4c 49 42 4e  IR)\$(TKSTUBLIBN
9830: 41 4d 45 29 0a 54 4b 49 4d 50 4c 49 42 09 3d 20  AME).TKIMPLIB.= 
9840: 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 4b 49  $(OUT_DIR)\$(TKI
9850: 4d 50 4c 49 42 4e 41 4d 45 29 0a 54 4b 4c 49 42  MPLIBNAME).TKLIB
9860: 09 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24  ..= $(OUT_DIR)\$
9870: 28 54 4b 4c 49 42 4e 41 4d 45 29 0a 54 4b 5f 49  (TKLIBNAME).TK_I
9880: 4e 43 4c 55 44 45 53 20 20 20 20 20 3d 20 2d 49  NCLUDES     = -I
9890: 22 24 28 57 49 4e 5f 44 49 52 29 22 20 2d 49 22  "$(WIN_DIR)" -I"
98a0: 24 28 47 45 4e 45 52 49 43 44 49 52 29 22 0a 54  $(GENERICDIR)".T
98b0: 4b 53 43 52 49 50 54 5a 49 50 20 20 20 20 20 3d  KSCRIPTZIP     =
98c0: 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 4b   $(OUT_DIR)\$(TK
98d0: 53 43 52 49 50 54 5a 49 50 4e 41 4d 45 29 0a 0a  SCRIPTZIPNAME)..
98e0: 21 65 6c 73 65 20 23 20 65 66 66 65 63 74 69 76  !else # effectiv
98f0: 65 6c 79 20 4e 45 45 44 5f 54 4b 0a 0a 21 69 66  ely NEED_TK..!if
9900: 20 24 28 54 4b 49 4e 53 54 41 4c 4c 29 20 23 20   $(TKINSTALL) # 
9910: 42 75 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74  Building against
9920: 20 69 6e 73 74 61 6c 6c 65 64 20 54 6b 0a 57 49   installed Tk.WI
9930: 53 48 09 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c  SH..= $(_TKDIR)\
9940: 62 69 6e 5c 24 28 57 49 53 48 4e 41 4d 45 29 0a  bin\$(WISHNAME).
9950: 54 4b 53 54 55 42 4c 49 42 09 3d 20 24 28 5f 54  TKSTUBLIB.= $(_T
9960: 4b 44 49 52 29 5c 6c 69 62 5c 24 28 54 4b 53 54  KDIR)\lib\$(TKST
9970: 55 42 4c 49 42 4e 41 4d 45 29 0a 54 4b 49 4d 50  UBLIBNAME).TKIMP
9980: 4c 49 42 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c  LIB.= $(_TKDIR)\
9990: 6c 69 62 5c 24 28 54 4b 49 4d 50 4c 49 42 4e 41  lib\$(TKIMPLIBNA
99a0: 4d 45 29 0a 23 20 57 68 65 6e 20 62 75 69 6c 64  ME).# When build
99b0: 69 6e 67 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20  ing extensions, 
99c0: 6d 61 79 20 62 65 20 6c 69 6e 6b 69 6e 67 20 61  may be linking a
99d0: 67 61 69 6e 73 74 20 54 6b 20 74 68 61 74 20 64  gainst Tk that d
99e0: 6f 65 73 20 6e 6f 74 20 61 64 64 0a 23 20 22 74  oes not add.# "t
99f0: 22 20 73 75 66 66 69 78 20 28 65 2e 67 2e 20 38  " suffix (e.g. 8
9a00: 2e 35 20 6f 72 20 38 2e 37 29 2e 20 49 66 20 6c  .5 or 8.7). If l
9a10: 69 62 20 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65  ib not found che
9a20: 63 6b 20 66 6f 72 20 74 68 61 74 20 70 6f 73 73  ck for that poss
9a30: 69 62 69 6c 69 74 79 2e 0a 21 69 66 20 21 65 78  ibility..!if !ex
9a40: 69 73 74 28 22 24 28 54 4b 49 4d 50 4c 49 42 29  ist("$(TKIMPLIB)
9a50: 22 29 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 09  ").TKIMPLIBNAME.
9a60: 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f 4e  = tk$(TK_VERSION
9a70: 29 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a  )$(SUFX:t=).lib.
9a80: 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 4b  TKIMPLIB.= $(_TK
9a90: 44 49 52 29 5c 6c 69 62 5c 24 28 54 4b 49 4d 50  DIR)\lib\$(TKIMP
9aa0: 4c 49 42 4e 41 4d 45 29 0a 21 65 6e 64 69 66 0a  LIBNAME).!endif.
9ab0: 54 4b 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 20  TK_INCLUDES     
9ac0: 3d 20 2d 49 22 24 28 5f 54 4b 44 49 52 29 5c 69  = -I"$(_TKDIR)\i
9ad0: 6e 63 6c 75 64 65 22 0a 54 4b 53 43 52 49 50 54  nclude".TKSCRIPT
9ae0: 5a 49 50 20 20 20 20 20 3d 20 24 28 5f 54 4b 44  ZIP     = $(_TKD
9af0: 49 52 29 5c 6c 69 62 5c 24 28 54 4b 53 43 52 49  IR)\lib\$(TKSCRI
9b00: 50 54 5a 49 50 4e 41 4d 45 29 0a 0a 21 65 6c 73  PTZIPNAME)..!els
9b10: 65 20 23 20 42 75 69 6c 64 69 6e 67 20 61 67 61  e # Building aga
9b20: 69 6e 73 74 20 54 6b 20 73 6f 75 72 63 65 73 0a  inst Tk sources.
9b30: 0a 57 49 53 48 09 09 3d 20 24 28 5f 54 4b 44 49  .WISH..= $(_TKDI
9b40: 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49  R)\win\$(BUILDDI
9b50: 52 54 4f 50 29 5c 24 28 57 49 53 48 4e 41 4d 45  RTOP)\$(WISHNAME
9b60: 29 0a 54 4b 53 54 55 42 4c 49 42 09 3d 20 24 28  ).TKSTUBLIB.= $(
9b70: 5f 54 4b 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  _TKDIR)\win\$(BU
9b80: 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 54 4b 53  ILDDIRTOP)\$(TKS
9b90: 54 55 42 4c 49 42 4e 41 4d 45 29 0a 54 4b 49 4d  TUBLIBNAME).TKIM
9ba0: 50 4c 49 42 09 3d 20 24 28 5f 54 4b 44 49 52 29  PLIB.= $(_TKDIR)
9bb0: 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54  \win\$(BUILDDIRT
9bc0: 4f 50 29 5c 24 28 54 4b 49 4d 50 4c 49 42 4e 41  OP)\$(TKIMPLIBNA
9bd0: 4d 45 29 0a 23 20 57 68 65 6e 20 62 75 69 6c 64  ME).# When build
9be0: 69 6e 67 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20  ing extensions, 
9bf0: 6d 61 79 20 62 65 20 6c 69 6e 6b 69 6e 67 20 61  may be linking a
9c00: 67 61 69 6e 73 74 20 54 6b 20 74 68 61 74 20 64  gainst Tk that d
9c10: 6f 65 73 20 6e 6f 74 20 61 64 64 0a 23 20 22 74  oes not add.# "t
9c20: 22 20 73 75 66 66 69 78 20 28 65 2e 67 2e 20 38  " suffix (e.g. 8
9c30: 2e 35 20 6f 72 20 38 2e 37 29 2e 20 49 66 20 6c  .5 or 8.7). If l
9c40: 69 62 20 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65  ib not found che
9c50: 63 6b 20 66 6f 72 20 74 68 61 74 20 70 6f 73 73  ck for that poss
9c60: 69 62 69 6c 69 74 79 2e 0a 21 69 66 20 21 65 78  ibility..!if !ex
9c70: 69 73 74 28 22 24 28 54 4b 49 4d 50 4c 49 42 29  ist("$(TKIMPLIB)
9c80: 22 29 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 09  ").TKIMPLIBNAME.
9c90: 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f 4e  = tk$(TK_VERSION
9ca0: 29 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a  )$(SUFX:t=).lib.
9cb0: 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 4b  TKIMPLIB.= $(_TK
9cc0: 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44  DIR)\win\$(BUILD
9cd0: 44 49 52 54 4f 50 29 5c 24 28 54 4b 49 4d 50 4c  DIRTOP)\$(TKIMPL
9ce0: 49 42 4e 41 4d 45 29 0a 21 65 6e 64 69 66 0a 54  IBNAME).!endif.T
9cf0: 4b 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 20 3d  K_INCLUDES     =
9d00: 20 2d 49 22 24 28 5f 54 4b 44 49 52 29 5c 67 65   -I"$(_TKDIR)\ge
9d10: 6e 65 72 69 63 22 20 2d 49 22 24 28 5f 54 4b 44  neric" -I"$(_TKD
9d20: 49 52 29 5c 77 69 6e 22 20 2d 49 22 24 28 5f 54  IR)\win" -I"$(_T
9d30: 4b 44 49 52 29 5c 78 6c 69 62 22 0a 54 4b 53 43  KDIR)\xlib".TKSC
9d40: 52 49 50 54 5a 49 50 20 20 20 20 20 3d 20 24 28  RIPTZIP     = $(
9d50: 5f 54 4b 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  _TKDIR)\win\$(BU
9d60: 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 54 4b 53  ILDDIRTOP)\$(TKS
9d70: 43 52 49 50 54 5a 49 50 4e 41 4d 45 29 0a 0a 21  CRIPTZIPNAME)..!
9d80: 65 6e 64 69 66 20 23 20 54 4b 49 4e 53 54 41 4c  endif # TKINSTAL
9d90: 4c 0a 0a 74 6b 6c 69 62 73 20 3d 20 22 24 28 54  L..tklibs = "$(T
9da0: 4b 53 54 55 42 4c 49 42 29 22 20 22 24 28 54 4b  KSTUBLIB)" "$(TK
9db0: 49 4d 50 4c 49 42 29 22 0a 0a 21 65 6e 64 69 66  IMPLIB)"..!endif
9dc0: 20 23 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0a 21   # $(DOING_TK).!
9dd0: 65 6e 64 69 66 20 23 20 24 28 44 4f 49 4e 47 5f  endif # $(DOING_
9de0: 54 4b 29 20 7c 7c 20 24 28 4e 45 45 44 5f 54 4b  TK) || $(NEED_TK
9df0: 29 0a 0a 23 20 56 61 72 69 6f 75 73 20 6f 75 74  )..# Various out
9e00: 70 75 74 20 70 61 74 68 73 0a 50 52 4a 49 4d 50  put paths.PRJIMP
9e10: 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 29  LIB.= $(OUT_DIR)
9e20: 5c 24 28 50 52 4f 4a 45 43 54 29 24 28 56 45 52  \$(PROJECT)$(VER
9e30: 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69 62  SION)$(SUFX).lib
9e40: 0a 50 52 4a 4c 49 42 4e 41 4d 45 09 3d 20 24 28  .PRJLIBNAME.= $(
9e50: 50 52 4f 4a 45 43 54 29 24 28 56 45 52 53 49 4f  PROJECT)$(VERSIO
9e60: 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58 54 29  N)$(SUFX).$(EXT)
9e70: 0a 50 52 4a 4c 49 42 09 09 3d 20 24 28 4f 55 54  .PRJLIB..= $(OUT
9e80: 5f 44 49 52 29 5c 24 28 50 52 4a 4c 49 42 4e 41  _DIR)\$(PRJLIBNA
9e90: 4d 45 29 0a 50 52 4a 53 54 55 42 4c 49 42 4e 41  ME).PRJSTUBLIBNA
9ea0: 4d 45 09 3d 20 24 28 53 54 55 42 50 52 45 46 49  ME.= $(STUBPREFI
9eb0: 58 29 24 28 56 45 52 53 49 4f 4e 29 2e 6c 69 62  X)$(VERSION).lib
9ec0: 0a 50 52 4a 53 54 55 42 4c 49 42 09 3d 20 24 28  .PRJSTUBLIB.= $(
9ed0: 4f 55 54 5f 44 49 52 29 5c 24 28 50 52 4a 53 54  OUT_DIR)\$(PRJST
9ee0: 55 42 4c 49 42 4e 41 4d 45 29 0a 0a 23 20 49 66  UBLIBNAME)..# If
9ef0: 20 65 78 74 65 6e 73 69 6f 6e 20 70 61 72 65 6e   extension paren
9f00: 74 20 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 6e  t makefile has n
9f10: 6f 74 20 64 65 66 69 6e 65 64 20 61 20 72 65 73  ot defined a res
9f20: 6f 75 72 63 65 20 64 65 66 69 6e 69 74 69 6f 6e  ource definition
9f30: 20 66 69 6c 65 2c 0a 23 20 77 65 20 77 69 6c 6c   file,.# we will
9f40: 20 67 65 6e 65 72 61 74 65 20 6f 6e 65 20 66 72   generate one fr
9f50: 6f 6d 20 73 74 61 6e 64 61 72 64 20 74 65 6d 70  om standard temp
9f60: 6c 61 74 65 2e 0a 21 69 66 20 21 24 28 44 4f 49  late..!if !$(DOI
9f70: 4e 47 5f 54 43 4c 29 20 26 26 20 21 24 28 44 4f  NG_TCL) && !$(DO
9f80: 49 4e 47 5f 54 4b 29 20 26 26 20 21 24 28 53 54  ING_TK) && !$(ST
9f90: 41 54 49 43 5f 42 55 49 4c 44 29 0a 21 69 66 64  ATIC_BUILD).!ifd
9fa0: 65 66 20 52 43 46 49 4c 45 0a 52 45 53 46 49 4c  ef RCFILE.RESFIL
9fb0: 45 20 3d 20 24 28 54 4d 50 5f 44 49 52 29 5c 24  E = $(TMP_DIR)\$
9fc0: 28 52 43 46 49 4c 45 3a 2e 72 63 3d 2e 72 65 73  (RCFILE:.rc=.res
9fd0: 29 0a 21 65 6c 73 65 0a 52 45 53 46 49 4c 45 20  ).!else.RESFILE 
9fe0: 3d 20 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 50  = $(TMP_DIR)\$(P
9ff0: 52 4f 4a 45 43 54 29 2e 72 65 73 0a 21 65 6e 64  ROJECT).res.!end
a000: 69 66 0a 21 65 6e 64 69 66 0a 0a 23 23 23 23 23  if.!endif..#####
a010: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a020: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a030: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a040: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 23  ##############.#
a050: 20 31 31 2e 20 43 6f 6e 73 74 72 75 63 74 20 74   11. Construct t
a060: 68 65 20 70 61 74 68 73 20 66 6f 72 20 74 68 65  he paths for the
a070: 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 64 69   installation di
a080: 72 65 63 74 6f 72 69 65 73 0a 23 20 54 68 65 20  rectories.# The 
a090: 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73  following macros
a0a0: 20 67 65 74 20 64 65 66 69 6e 65 64 20 69 6e 20   get defined in 
a0b0: 74 68 69 73 20 73 65 63 74 69 6f 6e 3a 0a 23 20  this section:.# 
a0c0: 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20  LIB_INSTALL_DIR 
a0d0: 2d 20 77 68 65 72 65 20 6c 69 62 72 61 72 69 65  - where librarie
a0e0: 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 73 74  s should be inst
a0f0: 61 6c 6c 65 64 0a 23 20 42 49 4e 5f 49 4e 53 54  alled.# BIN_INST
a100: 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72 65 20  ALL_DIR - where 
a110: 74 68 65 20 65 78 65 63 75 74 61 62 6c 65 73 20  the executables 
a120: 73 68 6f 75 6c 64 20 62 65 20 69 6e 73 74 61 6c  should be instal
a130: 6c 65 64 0a 23 20 44 4f 43 5f 49 4e 53 54 41 4c  led.# DOC_INSTAL
a140: 4c 5f 44 49 52 20 2d 20 77 68 65 72 65 20 64 6f  L_DIR - where do
a150: 63 75 6d 65 6e 74 61 74 69 6f 6e 20 73 68 6f 75  cumentation shou
a160: 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a  ld be installed.
a170: 23 20 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c  # SCRIPT_INSTALL
a180: 5f 44 49 52 20 2d 20 77 68 65 72 65 20 73 63 72  _DIR - where scr
a190: 69 70 74 73 20 73 68 6f 75 6c 64 20 62 65 20 69  ipts should be i
a1a0: 6e 73 74 61 6c 6c 65 64 0a 23 20 49 4e 43 4c 55  nstalled.# INCLU
a1b0: 44 45 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d  DE_INSTALL_DIR -
a1c0: 20 77 68 65 72 65 20 43 20 69 6e 63 6c 75 64 65   where C include
a1d0: 20 66 69 6c 65 73 20 73 68 6f 75 6c 64 20 62 65   files should be
a1e0: 20 69 6e 73 74 61 6c 6c 65 64 0a 23 20 44 45 4d   installed.# DEM
a1f0: 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20  O_INSTALL_DIR - 
a200: 77 68 65 72 65 20 64 65 6d 6f 73 20 73 68 6f 75  where demos shou
a210: 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a  ld be installed.
a220: 23 20 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49  # PRJ_INSTALL_DI
a230: 52 20 2d 20 77 68 65 72 65 20 70 61 63 6b 61 67  R - where packag
a240: 65 20 77 69 6c 6c 20 62 65 20 69 6e 73 74 61 6c  e will be instal
a250: 6c 65 64 20 28 6e 6f 74 20 73 65 74 20 66 6f 72  led (not set for
a260: 20 54 63 6c 20 61 6e 64 20 54 6b 29 0a 0a 21 69   Tcl and Tk)..!i
a270: 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 20 7c  f $(DOING_TCL) |
a280: 7c 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0a 4c 49  | $(DOING_TK).LI
a290: 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d  B_INSTALL_DIR..=
a2a0: 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c   $(_INSTALLDIR)\
a2b0: 6c 69 62 0a 42 49 4e 5f 49 4e 53 54 41 4c 4c 5f  lib.BIN_INSTALL_
a2c0: 44 49 52 09 09 3d 20 24 28 5f 49 4e 53 54 41 4c  DIR..= $(_INSTAL
a2d0: 4c 44 49 52 29 5c 62 69 6e 0a 44 4f 43 5f 49 4e  LDIR)\bin.DOC_IN
a2e0: 53 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 5f  STALL_DIR..= $(_
a2f0: 49 4e 53 54 41 4c 4c 44 49 52 29 5c 64 6f 63 0a  INSTALLDIR)\doc.
a300: 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29  !if $(DOING_TCL)
a310: 0a 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f  .SCRIPT_INSTALL_
a320: 44 49 52 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c  DIR.= $(_INSTALL
a330: 44 49 52 29 5c 6c 69 62 5c 24 28 50 52 4f 4a 45  DIR)\lib\$(PROJE
a340: 43 54 29 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56  CT)$(TCL_MAJOR_V
a350: 45 52 53 49 4f 4e 29 2e 24 28 54 43 4c 5f 4d 49  ERSION).$(TCL_MI
a360: 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 4d 4f 44  NOR_VERSION).MOD
a370: 55 4c 45 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09  ULE_INSTALL_DIR.
a380: 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29  = $(_INSTALLDIR)
a390: 5c 6c 69 62 5c 74 63 6c 24 28 54 43 4c 5f 4d 41  \lib\tcl$(TCL_MA
a3a0: 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 21 65 6c  JOR_VERSION).!el
a3b0: 73 65 20 23 20 44 4f 49 4e 47 5f 54 4b 0a 53 43  se # DOING_TK.SC
a3c0: 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  RIPT_INSTALL_DIR
a3d0: 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52  .= $(_INSTALLDIR
a3e0: 29 5c 6c 69 62 5c 24 28 50 52 4f 4a 45 43 54 29  )\lib\$(PROJECT)
a3f0: 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  $(TK_MAJOR_VERSI
a400: 4f 4e 29 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f 56  ON).$(TK_MINOR_V
a410: 45 52 53 49 4f 4e 29 0a 21 65 6e 64 69 66 0a 44  ERSION).!endif.D
a420: 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09  EMO_INSTALL_DIR.
a430: 3d 20 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41  = $(SCRIPT_INSTA
a440: 4c 4c 5f 44 49 52 29 5c 64 65 6d 6f 73 0a 49 4e  LL_DIR)\demos.IN
a450: 43 4c 55 44 45 5f 49 4e 53 54 41 4c 4c 5f 44 49  CLUDE_INSTALL_DI
a460: 52 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49  R.= $(_INSTALLDI
a470: 52 29 5c 69 6e 63 6c 75 64 65 0a 0a 21 65 6c 73  R)\include..!els
a480: 65 20 23 20 65 78 74 65 6e 73 69 6f 6e 20 6f 74  e # extension ot
a490: 68 65 72 20 74 68 61 6e 20 54 6b 0a 0a 50 52 4a  her than Tk..PRJ
a4a0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 20 20 20  _INSTALL_DIR    
a4b0: 20 20 20 20 20 3d 20 24 28 5f 49 4e 53 54 41 4c       = $(_INSTAL
a4c0: 4c 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29  LDIR)\$(PROJECT)
a4d0: 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 0a 21 69  $(DOTVERSION).!i
a4e0: 66 20 24 28 4d 55 4c 54 49 50 4c 41 54 46 4f 52  f $(MULTIPLATFOR
a4f0: 4d 5f 49 4e 53 54 41 4c 4c 29 0a 4c 49 42 5f 49  M_INSTALL).LIB_I
a500: 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28  NSTALL_DIR..= $(
a510: 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29  PRJ_INSTALL_DIR)
a520: 5c 24 28 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e  \$(PLATFORM_IDEN
a530: 54 49 46 59 29 0a 42 49 4e 5f 49 4e 53 54 41 4c  TIFY).BIN_INSTAL
a540: 4c 5f 44 49 52 09 09 3d 20 24 28 50 52 4a 5f 49  L_DIR..= $(PRJ_I
a550: 4e 53 54 41 4c 4c 5f 44 49 52 29 5c 24 28 50 4c  NSTALL_DIR)\$(PL
a560: 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 29  ATFORM_IDENTIFY)
a570: 0a 21 65 6c 73 65 0a 4c 49 42 5f 49 4e 53 54 41  .!else.LIB_INSTA
a580: 4c 4c 5f 44 49 52 09 09 3d 20 24 28 50 52 4a 5f  LL_DIR..= $(PRJ_
a590: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0a 42 49 4e  INSTALL_DIR).BIN
a5a0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d 20  _INSTALL_DIR..= 
a5b0: 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49  $(PRJ_INSTALL_DI
a5c0: 52 29 0a 21 65 6e 64 69 66 0a 44 4f 43 5f 49 4e  R).!endif.DOC_IN
a5d0: 53 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 50  STALL_DIR..= $(P
a5e0: 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0a  RJ_INSTALL_DIR).
a5f0: 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44  SCRIPT_INSTALL_D
a600: 49 52 09 3d 20 24 28 50 52 4a 5f 49 4e 53 54 41  IR.= $(PRJ_INSTA
a610: 4c 4c 5f 44 49 52 29 0a 44 45 4d 4f 5f 49 4e 53  LL_DIR).DEMO_INS
a620: 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 50 52 4a  TALL_DIR.= $(PRJ
a630: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 5c 64 65  _INSTALL_DIR)\de
a640: 6d 6f 73 0a 49 4e 43 4c 55 44 45 5f 49 4e 53 54  mos.INCLUDE_INST
a650: 41 4c 4c 5f 44 49 52 09 3d 20 24 28 5f 49 4e 53  ALL_DIR.= $(_INS
a660: 54 41 4c 4c 44 49 52 29 5c 2e 2e 5c 69 6e 63 6c  TALLDIR)\..\incl
a670: 75 64 65 0a 0a 21 65 6e 64 69 66 0a 0a 23 23 23  ude..!endif..###
a680: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a690: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a6a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a6b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
a6c0: 0a 23 20 31 32 2e 20 53 65 74 20 75 70 20 61 63  .# 12. Set up ac
a6d0: 74 75 61 6c 20 6f 70 74 69 6f 6e 73 20 74 6f 20  tual options to 
a6e0: 62 65 20 70 61 73 73 65 64 20 74 6f 20 74 68 65  be passed to the
a6f0: 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64 20 6c 69   compiler and li
a700: 6e 6b 65 72 0a 23 20 4e 6f 77 20 77 65 20 68 61  nker.# Now we ha
a710: 76 65 20 61 6c 6c 20 74 68 65 20 69 6e 66 6f 72  ve all the infor
a720: 6d 61 74 69 6f 6e 20 77 65 20 6e 65 65 64 2c 20  mation we need, 
a730: 73 65 74 20 75 70 20 74 68 65 20 61 63 74 75 61  set up the actua
a740: 6c 20 66 6c 61 67 73 20 61 6e 64 0a 23 20 6f 70  l flags and.# op
a750: 74 69 6f 6e 73 20 74 68 61 74 20 77 65 20 77 69  tions that we wi
a760: 6c 6c 20 70 61 73 73 20 74 6f 20 74 68 65 20 63  ll pass to the c
a770: 6f 6d 70 69 6c 65 72 20 61 6e 64 20 6c 69 6e 6b  ompiler and link
a780: 65 72 2e 20 54 68 65 20 6d 61 69 6e 0a 23 20 6d  er. The main.# m
a790: 61 6b 65 66 69 6c 65 20 73 68 6f 75 6c 64 20 75  akefile should u
a7a0: 73 65 20 74 68 65 73 65 20 69 6e 20 63 6f 6d 62  se these in comb
a7b0: 69 6e 61 74 69 6f 6e 20 77 69 74 68 20 77 68 61  ination with wha
a7c0: 74 65 76 65 72 20 6f 74 68 65 72 20 66 6c 61 67  tever other flag
a7d0: 73 0a 23 20 61 6e 64 20 73 77 69 74 63 68 65 73  s.# and switches
a7e0: 20 61 72 65 20 73 70 65 63 69 66 69 63 20 74 6f   are specific to
a7f0: 20 69 74 2e 0a 23 20 54 68 65 20 66 6f 6c 6c 6f   it..# The follo
a800: 77 69 6e 67 20 6d 61 63 72 6f 73 20 61 72 65 20  wing macros are 
a810: 64 65 66 69 6e 65 64 2c 20 6e 61 6d 65 73 20 61  defined, names a
a820: 72 65 20 66 6f 72 20 68 69 73 74 6f 72 69 63 61  re for historica
a830: 6c 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 3a  l compatibility:
a840: 0a 23 20 4f 50 54 44 45 46 49 4e 45 53 20 2d 20  .# OPTDEFINES - 
a850: 2f 44 78 78 78 20 43 20 6d 61 63 72 6f 20 66 6c  /Dxxx C macro fl
a860: 61 67 73 20 62 61 73 65 64 20 6f 6e 20 75 73 65  ags based on use
a870: 72 2d 73 70 65 63 69 66 69 65 64 20 4f 50 54 53  r-specified OPTS
a880: 0a 23 20 43 4f 4d 50 49 4c 45 52 46 4c 41 47 53  .# COMPILERFLAGS
a890: 20 2d 20 2f 44 78 78 78 20 43 20 6d 61 63 72 6f   - /Dxxx C macro
a8a0: 20 66 6c 61 67 73 20 69 6e 64 65 70 65 6e 64 65   flags independe
a8b0: 6e 74 20 6f 66 20 61 6e 79 20 63 6f 6e 66 69 67  nt of any config
a8c0: 75 72 61 74 69 6f 6e 20 6f 70 74 74 69 6f 6e 73  uration opttions
a8d0: 0a 23 20 63 72 74 20 2d 20 43 6f 6d 70 69 6c 65  .# crt - Compile
a8e0: 72 20 73 77 69 74 63 68 20 74 68 61 74 20 73 65  r switch that se
a8f0: 6c 65 63 74 73 20 74 68 65 20 61 70 70 72 6f 70  lects the approp
a900: 72 69 61 74 65 20 43 20 72 75 6e 74 69 6d 65 0a  riate C runtime.
a910: 23 20 63 64 65 62 75 67 20 2d 20 43 6f 6d 70 69  # cdebug - Compi
a920: 6c 65 72 20 73 77 69 74 63 68 65 73 20 72 65 6c  ler switches rel
a930: 61 74 65 64 20 74 6f 20 64 65 62 75 67 20 41 4e  ated to debug AN
a940: 44 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 73 0a  D optimizations.
a950: 23 20 63 77 61 72 6e 20 2d 20 43 6f 6d 70 69 6c  # cwarn - Compil
a960: 65 72 20 73 77 69 74 63 68 65 73 20 74 68 61 74  er switches that
a970: 20 73 65 74 20 77 61 72 6e 69 6e 67 20 6c 65 76   set warning lev
a980: 65 6c 73 0a 23 20 63 66 6c 61 67 73 20 2d 20 63  els.# cflags - c
a990: 6f 6d 70 6c 65 74 65 20 63 6f 6d 70 69 6c 65 72  omplete compiler
a9a0: 20 73 77 69 74 63 68 65 73 20 28 73 75 62 73 75   switches (subsu
a9b0: 6d 65 73 20 63 64 65 62 75 67 20 61 6e 64 20 63  mes cdebug and c
a9c0: 77 61 72 6e 29 0a 23 20 6c 64 65 62 75 67 20 2d  warn).# ldebug -
a9d0: 20 4c 69 6e 6b 65 72 20 73 77 69 74 63 68 65 73   Linker switches
a9e0: 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 20 64 65 62   controlling deb
a9f0: 75 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61  ug information a
aa00: 6e 64 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 0a  nd optimization.
aa10: 23 20 6c 66 6c 61 67 73 20 2d 20 63 6f 6d 70 6c  # lflags - compl
aa20: 65 74 65 20 6c 69 6e 6b 65 72 20 73 77 69 74 63  ete linker switc
aa30: 68 65 73 20 28 73 75 62 73 75 6d 65 73 20 6c 64  hes (subsumes ld
aa40: 65 62 75 67 29 20 65 78 63 65 70 74 20 73 75 62  ebug) except sub
aa50: 73 79 73 74 65 6d 20 74 79 70 65 0a 23 20 64 6c  system type.# dl
aa60: 6c 6c 66 6c 61 67 73 20 2d 20 63 6f 6d 70 6c 65  llflags - comple
aa70: 74 65 20 6c 69 6e 6b 65 72 20 73 77 69 74 63 68  te linker switch
aa80: 65 73 20 74 6f 20 62 75 69 6c 64 20 44 4c 4c 73  es to build DLLs
aa90: 20 28 73 75 62 73 75 6d 65 73 20 6c 66 6c 61 67   (subsumes lflag
aaa0: 73 29 0a 23 20 63 6f 6e 6c 66 6c 61 67 73 20 2d  s).# conlflags -
aab0: 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e 6b 65 72   complete linker
aac0: 20 73 77 69 74 63 68 65 73 20 66 6f 72 20 63 6f   switches for co
aad0: 6e 73 6f 6c 65 20 70 72 6f 67 72 61 6d 20 28 73  nsole program (s
aae0: 75 62 73 75 6d 65 73 20 6c 66 6c 61 67 73 29 0a  ubsumes lflags).
aaf0: 23 20 67 75 69 6c 66 6c 61 67 73 20 2d 20 63 6f  # guilflags - co
ab00: 6d 70 6c 65 74 65 20 6c 69 6e 6b 65 72 20 73 77  mplete linker sw
ab10: 69 74 63 68 65 73 20 66 6f 72 20 47 55 49 20 70  itches for GUI p
ab20: 72 6f 67 72 61 6d 20 28 73 75 62 73 75 6d 65 73  rogram (subsumes
ab30: 20 6c 66 6c 61 67 73 29 0a 23 20 62 61 73 65 6c   lflags).# basel
ab40: 69 62 73 20 2d 20 6d 69 6e 69 6d 75 6d 20 57 69  ibs - minimum Wi
ab50: 6e 64 6f 77 73 20 6c 69 62 72 61 72 69 65 73 20  ndows libraries 
ab60: 72 65 71 75 69 72 65 64 2e 20 50 61 72 65 6e 74  required. Parent
ab70: 20 6d 61 6b 65 66 69 6c 65 20 63 61 6e 0a 23 20   makefile can.# 
ab80: 20 20 20 64 65 66 69 6e 65 20 50 52 4a 5f 4c 49     define PRJ_LI
ab90: 42 53 20 62 65 66 6f 72 65 20 69 6e 63 6c 75 64  BS before includ
aba0: 69 6e 67 20 72 75 6c 65 73 2e 72 63 20 69 66 20  ing rules.rc if 
abb0: 61 64 64 69 74 69 6f 6e 61 6c 20 6c 69 62 73 20  additional libs 
abc0: 61 72 65 20 6e 65 65 64 65 64 0a 0a 4f 50 54 44  are needed..OPTD
abd0: 45 46 49 4e 45 53 09 3d 20 2f 44 53 54 44 43 5f  EFINES.= /DSTDC_
abe0: 48 45 41 44 45 52 53 20 2f 44 55 53 45 5f 4e 4d  HEADERS /DUSE_NM
abf0: 41 4b 45 3d 31 0a 21 69 66 20 24 28 56 43 56 45  AKE=1.!if $(VCVE
ac00: 52 53 49 4f 4e 29 20 3e 20 31 36 30 30 0a 4f 50  RSION) > 1600.OP
ac10: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54  TDEFINES.= $(OPT
ac20: 44 45 46 49 4e 45 53 29 20 2f 44 48 41 56 45 5f  DEFINES) /DHAVE_
ac30: 53 54 44 49 4e 54 5f 48 3d 31 0a 21 65 6c 73 65  STDINT_H=1.!else
ac40: 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28  .OPTDEFINES.= $(
ac50: 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 4d 50  OPTDEFINES) /DMP
ac60: 5f 4e 4f 5f 53 54 44 49 4e 54 3d 31 0a 21 65 6e  _NO_STDINT=1.!en
ac70: 64 69 66 0a 21 69 66 20 24 28 56 43 56 45 52 53  dif.!if $(VCVERS
ac80: 49 4f 4e 29 20 3e 3d 20 31 38 30 30 0a 4f 50 54  ION) >= 1800.OPT
ac90: 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44  DEFINES.= $(OPTD
aca0: 45 46 49 4e 45 53 29 20 2f 44 48 41 56 45 5f 49  EFINES) /DHAVE_I
acb0: 4e 54 54 59 50 45 53 5f 48 3d 31 20 2f 44 48 41  NTTYPES_H=1 /DHA
acc0: 56 45 5f 53 54 44 42 4f 4f 4c 5f 48 3d 31 0a 21  VE_STDBOOL_H=1.!
acd0: 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 54 43 4c  endif..!if $(TCL
ace0: 5f 4d 45 4d 5f 44 45 42 55 47 29 0a 4f 50 54 44  _MEM_DEBUG).OPTD
acf0: 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45  EFINES.= $(OPTDE
ad00: 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 4d 45 4d  FINES) /DTCL_MEM
ad10: 5f 44 45 42 55 47 0a 21 65 6e 64 69 66 0a 21 69  _DEBUG.!endif.!i
ad20: 66 20 24 28 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f  f $(TCL_COMPILE_
ad30: 44 45 42 55 47 29 0a 4f 50 54 44 45 46 49 4e 45  DEBUG).OPTDEFINE
ad40: 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53  S.= $(OPTDEFINES
ad50: 29 20 2f 44 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f  ) /DTCL_COMPILE_
ad60: 44 45 42 55 47 20 2f 44 54 43 4c 5f 43 4f 4d 50  DEBUG /DTCL_COMP
ad70: 49 4c 45 5f 53 54 41 54 53 0a 21 65 6e 64 69 66  ILE_STATS.!endif
ad80: 0a 21 69 66 20 24 28 54 43 4c 5f 54 48 52 45 41  .!if $(TCL_THREA
ad90: 44 53 29 20 26 26 20 24 28 54 43 4c 5f 56 45 52  DS) && $(TCL_VER
ada0: 53 49 4f 4e 29 20 3c 20 38 37 0a 4f 50 54 44 45  SION) < 87.OPTDE
adb0: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46  FINES.= $(OPTDEF
adc0: 49 4e 45 53 29 20 2f 44 54 43 4c 5f 54 48 52 45  INES) /DTCL_THRE
add0: 41 44 53 3d 31 0a 21 69 66 20 24 28 55 53 45 5f  ADS=1.!if $(USE_
ade0: 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 20 26 26  THREAD_ALLOC) &&
adf0: 20 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20   $(TCL_VERSION) 
ae00: 3c 20 38 37 0a 4f 50 54 44 45 46 49 4e 45 53 09  < 87.OPTDEFINES.
ae10: 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20  = $(OPTDEFINES) 
ae20: 2f 44 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c  /DUSE_THREAD_ALL
ae30: 4f 43 3d 31 0a 21 65 6e 64 69 66 0a 21 65 6e 64  OC=1.!endif.!end
ae40: 69 66 0a 21 69 66 20 24 28 53 54 41 54 49 43 5f  if.!if $(STATIC_
ae50: 42 55 49 4c 44 29 0a 4f 50 54 44 45 46 49 4e 45  BUILD).OPTDEFINE
ae60: 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53  S.= $(OPTDEFINES
ae70: 29 20 2f 44 53 54 41 54 49 43 5f 42 55 49 4c 44  ) /DSTATIC_BUILD
ae80: 0a 21 65 6c 73 65 69 66 20 24 28 54 43 4c 5f 56  .!elseif $(TCL_V
ae90: 45 52 53 49 4f 4e 29 20 3e 20 38 36 0a 4f 50 54  ERSION) > 86.OPT
aea0: 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44  DEFINES.= $(OPTD
aeb0: 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 57 49  EFINES) /DTCL_WI
aec0: 54 48 5f 45 58 54 45 52 4e 41 4c 5f 54 4f 4d 4d  TH_EXTERNAL_TOMM
aed0: 41 54 48 0a 21 69 66 20 22 24 28 4d 41 43 48 49  ATH.!if "$(MACHI
aee0: 4e 45 29 22 20 3d 3d 20 22 41 4d 44 36 34 22 20  NE)" == "AMD64" 
aef0: 7c 7c 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20  || "$(MACHINE)" 
af00: 3d 3d 20 22 41 52 4d 36 34 22 0a 4f 50 54 44 45  == "ARM64".OPTDE
af10: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46  FINES.= $(OPTDEF
af20: 49 4e 45 53 29 20 2f 44 4d 50 5f 36 34 42 49 54  INES) /DMP_64BIT
af30: 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 21  .!endif.!endif.!
af40: 69 66 20 24 28 54 43 4c 5f 4e 4f 5f 44 45 50 52  if $(TCL_NO_DEPR
af50: 45 43 41 54 45 44 29 0a 4f 50 54 44 45 46 49 4e  ECATED).OPTDEFIN
af60: 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45  ES.= $(OPTDEFINE
af70: 53 29 20 2f 44 54 43 4c 5f 4e 4f 5f 44 45 50 52  S) /DTCL_NO_DEPR
af80: 45 43 41 54 45 44 0a 21 65 6e 64 69 66 0a 0a 21  ECATED.!endif..!
af90: 69 66 20 24 28 55 53 45 5f 53 54 55 42 53 29 0a  if $(USE_STUBS).
afa0: 23 20 4e 6f 74 65 20 77 65 20 64 6f 20 6e 6f 74  # Note we do not
afb0: 20 64 65 66 69 6e 65 20 55 53 45 5f 54 43 4c 5f   define USE_TCL_
afc0: 53 54 55 42 53 20 65 76 65 6e 20 77 68 65 6e 20  STUBS even when 
afd0: 62 75 69 6c 64 69 6e 67 20 74 6b 20 73 69 6e 63  building tk sinc
afe0: 65 20 73 6f 6d 65 0a 23 20 74 65 73 74 20 74 61  e some.# test ta
aff0: 72 67 65 74 73 20 69 6e 20 74 6b 20 64 6f 20 6e  rgets in tk do n
b000: 6f 74 20 75 73 65 20 73 74 75 62 73 0a 21 69 66  ot use stubs.!if
b010: 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0a 55   !$(DOING_TCL).U
b020: 53 45 5f 53 54 55 42 53 5f 44 45 46 53 20 20 3d  SE_STUBS_DEFS  =
b030: 20 2f 44 55 53 45 5f 54 43 4c 5f 53 54 55 42 53   /DUSE_TCL_STUBS
b040: 20 2f 44 55 53 45 5f 54 43 4c 4f 4f 5f 53 54 55   /DUSE_TCLOO_STU
b050: 42 53 0a 21 69 66 20 24 28 4e 45 45 44 5f 54 4b  BS.!if $(NEED_TK
b060: 29 0a 55 53 45 5f 53 54 55 42 53 5f 44 45 46 53  ).USE_STUBS_DEFS
b070: 20 20 3d 20 24 28 55 53 45 5f 53 54 55 42 53 5f    = $(USE_STUBS_
b080: 44 45 46 53 29 20 2f 44 55 53 45 5f 54 4b 5f 53  DEFS) /DUSE_TK_S
b090: 54 55 42 53 0a 21 65 6e 64 69 66 0a 21 65 6e 64  TUBS.!endif.!end
b0a0: 69 66 0a 21 65 6e 64 69 66 20 23 20 55 53 45 5f  if.!endif # USE_
b0b0: 53 54 55 42 53 0a 0a 21 69 66 20 21 24 28 44 45  STUBS..!if !$(DE
b0c0: 42 55 47 29 0a 4f 50 54 44 45 46 49 4e 45 53 09  BUG).OPTDEFINES.
b0d0: 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20  = $(OPTDEFINES) 
b0e0: 2f 44 4e 44 45 42 55 47 0a 21 69 66 20 24 28 4f  /DNDEBUG.!if $(O
b0f0: 50 54 49 4d 49 5a 49 4e 47 29 0a 4f 50 54 44 45  PTIMIZING).OPTDE
b100: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46  FINES.= $(OPTDEF
b110: 49 4e 45 53 29 20 2f 44 54 43 4c 5f 43 46 47 5f  INES) /DTCL_CFG_
b120: 4f 50 54 49 4d 49 5a 45 44 0a 21 65 6e 64 69 66  OPTIMIZED.!endif
b130: 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28 50 52  .!endif.!if $(PR
b140: 4f 46 49 4c 45 29 0a 4f 50 54 44 45 46 49 4e 45  OFILE).OPTDEFINE
b150: 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53  S.= $(OPTDEFINES
b160: 29 20 2f 44 54 43 4c 5f 43 46 47 5f 50 52 4f 46  ) /DTCL_CFG_PROF
b170: 49 4c 45 44 0a 21 65 6e 64 69 66 0a 21 69 66 20  ILED.!endif.!if 
b180: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
b190: 22 41 4d 44 36 34 22 20 7c 7c 20 22 24 28 4d 41  "AMD64" || "$(MA
b1a0: 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 52 4d 36  CHINE)" == "ARM6
b1b0: 34 22 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20  4".OPTDEFINES.= 
b1c0: 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44  $(OPTDEFINES) /D
b1d0: 54 43 4c 5f 43 46 47 5f 44 4f 36 34 42 49 54 0a  TCL_CFG_DO64BIT.
b1e0: 21 65 6e 64 69 66 0a 21 69 66 20 24 28 56 43 56  !endif.!if $(VCV
b1f0: 45 52 53 49 4f 4e 29 20 3c 20 31 33 30 30 0a 4f  ERSION) < 1300.O
b200: 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50  PTDEFINES.= $(OP
b210: 54 44 45 46 49 4e 45 53 29 20 2f 44 4e 4f 5f 53  TDEFINES) /DNO_S
b220: 54 52 54 4f 49 36 34 3d 31 0a 21 65 6e 64 69 66  TRTOI64=1.!endif
b230: 0a 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f  ..!if $(TCL_MAJO
b240: 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 0a  R_VERSION) == 8.
b250: 21 69 66 20 22 24 28 5f 55 53 45 5f 36 34 42 49  !if "$(_USE_64BI
b260: 54 5f 54 49 4d 45 5f 54 29 22 20 3d 3d 20 22 31  T_TIME_T)" == "1
b270: 22 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24  ".OPTDEFINES.= $
b280: 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 5f  (OPTDEFINES) /D_
b290: 55 53 45 5f 36 34 42 49 54 5f 54 49 4d 45 5f 54  USE_64BIT_TIME_T
b2a0: 3d 31 0a 21 65 6e 64 69 66 0a 0a 23 20 5f 41 54  =1.!endif..# _AT
b2b0: 4c 5f 58 50 5f 54 41 52 47 45 54 49 4e 47 20 2d  L_XP_TARGETING -
b2c0: 20 4e 65 77 65 72 20 53 44 4b 27 73 20 6e 65 65   Newer SDK's nee
b2d0: 64 20 74 68 69 73 20 74 6f 20 62 75 69 6c 64 20  d this to build 
b2e0: 66 6f 72 20 58 50 0a 43 4f 4d 50 49 4c 45 52 46  for XP.COMPILERF
b2f0: 4c 41 47 53 20 20 3d 20 2f 44 5f 41 54 4c 5f 58  LAGS  = /D_ATL_X
b300: 50 5f 54 41 52 47 45 54 49 4e 47 0a 21 65 6e 64  P_TARGETING.!end
b310: 69 66 0a 21 69 66 20 22 24 28 54 43 4c 5f 55 54  if.!if "$(TCL_UT
b320: 46 5f 4d 41 58 29 22 20 3d 3d 20 22 33 22 0a 4f  F_MAX)" == "3".O
b330: 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50  PTDEFINES.= $(OP
b340: 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f  TDEFINES) /DTCL_
b350: 55 54 46 5f 4d 41 58 3d 33 0a 21 65 6e 64 69 66  UTF_MAX=3.!endif
b360: 0a 21 69 66 20 22 24 28 54 43 4c 5f 42 55 49 4c  .!if "$(TCL_BUIL
b370: 44 5f 46 4f 52 29 22 20 3d 3d 20 22 38 22 0a 4f  D_FOR)" == "8".O
b380: 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50  PTDEFINES.= $(OP
b390: 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f  TDEFINES) /DTCL_
b3a0: 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 3d 38 0a  MAJOR_VERSION=8.
b3b0: 21 65 6e 64 69 66 0a 0a 23 20 4c 69 6b 65 20 74  !endif..# Like t
b3c0: 68 65 20 54 45 41 20 73 79 73 74 65 6d 20 6f 6e  he TEA system on
b3d0: 6c 79 20 73 65 74 20 74 68 69 73 20 6e 6f 6e 20  ly set this non 
b3e0: 65 6d 70 74 79 20 66 6f 72 20 6e 6f 6e 2d 54 6b  empty for non-Tk
b3f0: 20 65 78 74 65 6e 73 69 6f 6e 73 0a 23 20 4e 6f   extensions.# No
b400: 74 65 3a 20 73 6f 6d 65 20 65 78 74 65 6e 73 69  te: some extensi
b410: 6f 6e 73 20 75 73 65 20 50 41 43 4b 41 47 45 5f  ons use PACKAGE_
b420: 4e 41 4d 45 20 61 6e 64 20 6f 74 68 65 72 73 20  NAME and others 
b430: 75 73 65 20 50 41 43 4b 41 47 45 5f 54 43 4c 4e  use PACKAGE_TCLN
b440: 41 4d 45 0a 23 20 73 6f 20 77 65 20 70 61 73 73  AME.# so we pass
b450: 20 62 6f 74 68 0a 21 69 66 20 21 24 28 44 4f 49   both.!if !$(DOI
b460: 4e 47 5f 54 43 4c 29 20 26 26 20 21 24 28 44 4f  NG_TCL) && !$(DO
b470: 49 4e 47 5f 54 4b 29 0a 50 4b 47 4e 41 4d 45 46  ING_TK).PKGNAMEF
b480: 4c 41 47 53 20 3d 20 2f 44 50 41 43 4b 41 47 45  LAGS = /DPACKAGE
b490: 5f 4e 41 4d 45 3d 22 5c 22 24 28 50 52 4a 5f 50  _NAME="\"$(PRJ_P
b4a0: 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 5c  ACKAGE_TCLNAME)\
b4b0: 22 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20  "" \.           
b4c0: 20 20 20 20 2f 44 50 41 43 4b 41 47 45 5f 54 43      /DPACKAGE_TC
b4d0: 4c 4e 41 4d 45 3d 22 5c 22 24 28 50 52 4a 5f 50  LNAME="\"$(PRJ_P
b4e0: 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 5c  ACKAGE_TCLNAME)\
b4f0: 22 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20  "" \.           
b500: 20 20 20 20 2f 44 50 41 43 4b 41 47 45 5f 56 45      /DPACKAGE_VE
b510: 52 53 49 4f 4e 3d 22 5c 22 24 28 44 4f 54 56 45  RSION="\"$(DOTVE
b520: 52 53 49 4f 4e 29 5c 22 22 20 5c 0a 20 20 20 20  RSION)\"" \.    
b530: 20 20 20 20 20 20 20 20 20 20 20 2f 44 4d 4f 44             /DMOD
b540: 55 4c 45 5f 53 43 4f 50 45 3d 65 78 74 65 72 6e  ULE_SCOPE=extern
b550: 0a 21 65 6e 64 69 66 0a 0a 23 20 63 72 74 20 70  .!endif..# crt p
b560: 69 63 6b 73 20 74 68 65 20 43 20 72 75 6e 20 74  icks the C run t
b570: 69 6d 65 20 62 61 73 65 64 20 6f 6e 20 73 65 6c  ime based on sel
b580: 65 63 74 65 64 20 4f 50 54 53 0a 21 69 66 20 24  ected OPTS.!if $
b590: 28 4d 53 56 43 52 54 29 0a 21 69 66 20 24 28 44  (MSVCRT).!if $(D
b5a0: 45 42 55 47 29 20 26 26 20 21 24 28 55 4e 43 48  EBUG) && !$(UNCH
b5b0: 45 43 4b 45 44 29 0a 63 72 74 20 3d 20 2d 4d 44  ECKED).crt = -MD
b5c0: 64 0a 21 65 6c 73 65 0a 63 72 74 20 3d 20 2d 4d  d.!else.crt = -M
b5d0: 44 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65 0a 21  D.!endif.!else.!
b5e0: 69 66 20 24 28 44 45 42 55 47 29 20 26 26 20 21  if $(DEBUG) && !
b5f0: 24 28 55 4e 43 48 45 43 4b 45 44 29 0a 63 72 74  $(UNCHECKED).crt
b600: 20 3d 20 2d 4d 54 64 0a 21 65 6c 73 65 0a 63 72   = -MTd.!else.cr
b610: 74 20 3d 20 2d 4d 54 0a 21 65 6e 64 69 66 0a 21  t = -MT.!endif.!
b620: 65 6e 64 69 66 0a 0a 23 20 63 64 65 62 75 67 20  endif..# cdebug 
b630: 69 6e 63 6c 75 64 65 73 20 63 6f 6d 70 69 6c 65  includes compile
b640: 72 20 6f 70 74 69 6f 6e 73 20 66 6f 72 20 64 65  r options for de
b650: 62 75 67 67 69 6e 67 20 61 73 20 77 65 6c 6c 20  bugging as well 
b660: 61 73 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 2e  as optimization.
b670: 0a 21 69 66 20 24 28 44 45 42 55 47 29 0a 0a 23  .!if $(DEBUG)..#
b680: 20 49 6e 20 64 65 62 75 67 67 69 6e 67 20 6d 6f   In debugging mo
b690: 64 65 2c 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e  de, optimization
b6a0: 73 20 6e 65 65 64 20 74 6f 20 62 65 20 64 69 73  s need to be dis
b6b0: 61 62 6c 65 64 0a 63 64 65 62 75 67 20 3d 20 2d  abled.cdebug = -
b6c0: 5a 69 20 2d 4f 64 20 24 28 44 45 42 55 47 46 4c  Zi -Od $(DEBUGFL
b6d0: 41 47 53 29 0a 0a 21 65 6c 73 65 0a 0a 63 64 65  AGS)..!else..cde
b6e0: 62 75 67 20 3d 20 24 28 4f 50 54 49 4d 49 5a 41  bug = $(OPTIMIZA
b6f0: 54 49 4f 4e 53 29 0a 21 69 66 20 24 28 53 59 4d  TIONS).!if $(SYM
b700: 42 4f 4c 53 29 0a 63 64 65 62 75 67 20 3d 20 24  BOLS).cdebug = $
b710: 28 63 64 65 62 75 67 29 20 2d 5a 69 0a 21 65 6e  (cdebug) -Zi.!en
b720: 64 69 66 0a 0a 21 65 6e 64 69 66 20 23 20 24 28  dif..!endif # $(
b730: 44 45 42 55 47 29 0a 0a 23 20 63 77 61 72 6e 20  DEBUG)..# cwarn 
b740: 69 6e 63 6c 75 64 65 73 20 64 65 66 61 75 6c 74  includes default
b750: 20 77 61 72 6e 69 6e 67 20 6c 65 76 65 6c 73 2c   warning levels,
b760: 20 61 6c 73 6f 20 43 34 30 39 30 20 28 62 75 67   also C4090 (bug
b770: 67 79 29 20 61 6e 64 20 43 34 31 34 36 20 69 73  gy) and C4146 is
b780: 20 75 73 65 6c 65 73 73 2e 0a 63 77 61 72 6e 20   useless..cwarn 
b790: 3d 20 24 28 57 41 52 4e 49 4e 47 53 29 20 2d 77  = $(WARNINGS) -w
b7a0: 64 34 30 39 30 20 2d 77 64 34 31 34 36 0a 0a 21  d4090 -wd4146..!
b7b0: 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20  if "$(MACHINE)" 
b7c0: 3d 3d 20 22 41 4d 44 36 34 22 20 7c 7c 20 22 24  == "AMD64" || "$
b7d0: 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41  (MACHINE)" == "A
b7e0: 52 4d 36 34 22 0a 23 20 44 69 73 61 62 6c 65 20  RM64".# Disable 
b7f0: 70 6f 69 6e 74 65 72 3c 2d 3e 69 6e 74 20 77 61  pointer<->int wa
b800: 72 6e 69 6e 67 73 20 72 65 6c 61 74 65 64 20 74  rnings related t
b810: 6f 20 63 61 73 74 20 62 65 74 77 65 65 6e 20 64  o cast between d
b820: 69 66 66 65 72 65 6e 74 20 73 69 7a 65 73 0a 23  ifferent sizes.#
b830: 20 54 68 65 72 65 20 61 72 65 20 61 20 67 61 64   There are a gad
b840: 7a 69 6c 6c 69 6f 6e 20 6f 66 20 74 68 65 73 65  zillion of these
b850: 20 64 75 65 20 74 6f 20 75 73 65 20 6f 66 20 43   due to use of C
b860: 6c 69 65 6e 74 44 61 74 61 20 61 6e 64 0a 23 20  lientData and.# 
b870: 63 6c 75 74 74 65 72 20 75 70 20 63 6f 6d 70 69  clutter up compi
b880: 6c 65 72 0a 23 20 6f 75 74 70 75 74 20 69 6e 63  ler.# output inc
b890: 72 65 61 73 69 6e 67 20 63 68 61 6e 63 65 20 6f  reasing chance o
b8a0: 66 20 61 20 72 65 61 6c 20 77 61 72 6e 69 6e 67  f a real warning
b8b0: 20 67 65 74 74 69 6e 67 20 6c 6f 73 74 2e 20 53   getting lost. S
b8c0: 6f 20 64 69 73 61 62 6c 65 20 74 68 65 6d 2e 0a  o disable them..
b8d0: 23 20 45 76 65 6e 74 75 61 6c 6c 79 20 73 6f 6d  # Eventually som
b8e0: 65 20 64 61 79 2c 20 54 63 6c 20 77 69 6c 6c 20  e day, Tcl will 
b8f0: 62 65 20 36 34 2d 62 69 74 20 63 6c 65 61 6e 2e  be 64-bit clean.
b900: 0a 63 77 61 72 6e 20 3d 20 24 28 63 77 61 72 6e  .cwarn = $(cwarn
b910: 29 20 2d 77 64 34 33 31 31 20 2d 77 64 34 33 31  ) -wd4311 -wd431
b920: 32 0a 21 65 6e 64 69 66 0a 0a 23 23 23 20 43 6f  2.!endif..### Co
b930: 6d 6d 6f 6e 20 63 6f 6d 70 69 6c 65 72 20 6f 70  mmon compiler op
b940: 74 69 6f 6e 73 20 74 68 61 74 20 61 72 65 20 61  tions that are a
b950: 72 63 68 69 74 65 63 74 75 72 65 20 73 70 65 63  rchitecture spec
b960: 69 66 69 63 0a 21 69 66 20 22 24 28 4d 41 43 48  ific.!if "$(MACH
b970: 49 4e 45 29 22 20 3d 3d 20 22 41 52 4d 22 0a 63  INE)" == "ARM".c
b980: 61 72 63 68 20 3d 20 2f 44 5f 41 52 4d 5f 57 49  arch = /D_ARM_WI
b990: 4e 41 50 49 5f 50 41 52 54 49 54 49 4f 4e 5f 44  NAPI_PARTITION_D
b9a0: 45 53 4b 54 4f 50 5f 53 44 4b 5f 41 56 41 49 4c  ESKTOP_SDK_AVAIL
b9b0: 41 42 4c 45 0a 21 65 6c 73 65 0a 63 61 72 63 68  ABLE.!else.carch
b9c0: 20 3d 0a 21 65 6e 64 69 66 0a 0a 23 20 63 70 75   =.!endif..# cpu
b9d0: 69 64 20 69 73 20 6f 6e 6c 79 20 61 76 61 69 6c  id is only avail
b9e0: 61 62 6c 65 20 6f 6e 20 69 6e 74 65 6c 20 6d 61  able on intel ma
b9f0: 63 68 69 6e 65 73 0a 21 69 66 20 22 24 28 4d 41  chines.!if "$(MA
ba00: 43 48 49 4e 45 29 22 20 3d 3d 20 22 49 58 38 36  CHINE)" == "IX86
ba10: 22 20 7c 7c 20 22 24 28 4d 41 43 48 49 4e 45 29  " || "$(MACHINE)
ba20: 22 20 3d 3d 20 22 41 4d 44 36 34 22 0a 63 61 72  " == "AMD64".car
ba30: 63 68 20 3d 20 24 28 63 61 72 63 68 29 20 2f 44  ch = $(carch) /D
ba40: 48 41 56 45 5f 43 50 55 49 44 3d 31 0a 21 65 6e  HAVE_CPUID=1.!en
ba50: 64 69 66 0a 0a 21 69 66 20 24 28 44 45 42 55 47  dif..!if $(DEBUG
ba60: 29 0a 23 20 54 75 72 6e 20 77 61 72 6e 69 6e 67  ).# Turn warning
ba70: 73 20 69 6e 74 6f 20 65 72 72 6f 72 73 0a 63 77  s into errors.cw
ba80: 61 72 6e 20 3d 20 24 28 63 77 61 72 6e 29 20 2d  arn = $(cwarn) -
ba90: 57 58 0a 21 65 6e 64 69 66 0a 0a 49 4e 43 4c 55  WX.!endif..INCLU
baa0: 44 45 53 20 3d 20 24 28 54 43 4c 5f 49 4e 43 4c  DES = $(TCL_INCL
bab0: 55 44 45 53 29 20 24 28 54 4b 5f 49 4e 43 4c 55  UDES) $(TK_INCLU
bac0: 44 45 53 29 20 24 28 50 52 4a 5f 49 4e 43 4c 55  DES) $(PRJ_INCLU
bad0: 44 45 53 29 0a 21 69 66 20 21 24 28 44 4f 49 4e  DES).!if !$(DOIN
bae0: 47 5f 54 43 4c 29 20 26 26 20 21 24 28 44 4f 49  G_TCL) && !$(DOI
baf0: 4e 47 5f 54 4b 29 0a 49 4e 43 4c 55 44 45 53 20  NG_TK).INCLUDES 
bb00: 3d 20 24 28 49 4e 43 4c 55 44 45 53 29 20 2d 49  = $(INCLUDES) -I
bb10: 22 24 28 47 45 4e 45 52 49 43 44 49 52 29 22 20  "$(GENERICDIR)" 
bb20: 2d 49 22 24 28 57 49 4e 5f 44 49 52 29 22 20 2d  -I"$(WIN_DIR)" -
bb30: 49 22 24 28 43 4f 4d 50 41 54 44 49 52 29 22 0a  I"$(COMPATDIR)".
bb40: 21 65 6e 64 69 66 0a 0a 23 20 54 68 65 73 65 20  !endif..# These 
bb50: 66 6c 61 67 73 20 61 72 65 20 64 65 66 69 6e 65  flags are define
bb60: 64 20 72 6f 75 67 68 6c 79 20 69 6e 20 74 68 65  d roughly in the
bb70: 20 6f 72 64 65 72 20 6f 66 20 74 68 65 20 70 72   order of the pr
bb80: 65 2d 72 65 66 6f 72 6d 0a 23 20 72 75 6c 65 73  e-reform.# rules
bb90: 2e 76 63 2f 6d 61 6b 65 66 69 6c 65 2e 76 63 20  .vc/makefile.vc 
bba0: 74 6f 20 68 65 6c 70 20 76 69 73 75 61 6c 6c 79  to help visually
bbb0: 20 63 6f 6d 70 61 72 65 20 74 68 61 74 20 74 68   compare that th
bbc0: 65 20 70 72 65 2d 20 61 6e 64 0a 23 20 70 6f 73  e pre- and.# pos
bbd0: 74 2d 72 65 66 6f 72 6d 20 62 75 69 6c 64 20 6c  t-reform build l
bbe0: 6f 67 73 0a 0a 23 20 63 66 6c 61 67 73 20 63 6f  ogs..# cflags co
bbf0: 6e 74 61 69 6e 73 20 67 65 6e 65 72 69 63 20 66  ntains generic f
bc00: 6c 61 67 73 20 75 73 65 64 20 66 6f 72 20 62 75  lags used for bu
bc10: 69 6c 64 69 6e 67 20 70 72 61 63 74 69 63 61 6c  ilding practical
bc20: 6c 79 20 61 6c 6c 20 6f 62 6a 65 63 74 20 66 69  ly all object fi
bc30: 6c 65 73 0a 63 66 6c 61 67 73 20 3d 20 2d 6e 6f  les.cflags = -no
bc40: 6c 6f 67 6f 20 2d 63 20 24 28 43 4f 4d 50 49 4c  logo -c $(COMPIL
bc50: 45 52 46 4c 41 47 53 29 20 24 28 63 61 72 63 68  ERFLAGS) $(carch
bc60: 29 20 24 28 63 77 61 72 6e 29 20 2d 46 70 24 28  ) $(cwarn) -Fp$(
bc70: 54 4d 50 5f 44 49 52 29 5e 5c 20 24 28 63 64 65  TMP_DIR)^\ $(cde
bc80: 62 75 67 29 0a 0a 23 20 61 70 70 63 66 6c 61 67  bug)..# appcflag
bc90: 73 20 63 6f 6e 74 61 69 6e 73 20 24 28 63 66 6c  s contains $(cfl
bca0: 61 67 73 29 20 61 6e 64 20 66 6c 61 67 73 20 66  ags) and flags f
bcb0: 6f 72 20 62 75 69 6c 64 69 6e 67 20 74 68 65 20  or building the 
bcc0: 61 70 70 6c 69 63 61 74 69 6f 6e 0a 23 20 6f 62  application.# ob
bcd0: 6a 65 63 74 20 66 69 6c 65 73 20 28 65 2e 67 2e  ject files (e.g.
bce0: 20 74 63 6c 73 68 2c 20 6f 72 20 77 69 73 68 29   tclsh, or wish)
bcf0: 20 70 6b 67 63 66 6c 61 67 73 20 63 6f 6e 74 61   pkgcflags conta
bd00: 69 6e 73 20 24 28 63 66 6c 61 67 73 29 20 70 6c  ins $(cflags) pl
bd10: 75 73 0a 23 20 66 6c 61 67 73 20 75 73 65 64 20  us.# flags used 
bd20: 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 73 68 61  for building sha
bd30: 72 65 64 20 6f 62 6a 65 63 74 20 66 69 6c 65 73  red object files
bd40: 20 54 68 65 20 74 77 6f 20 64 69 66 66 65 72 20   The two differ 
bd50: 69 6e 20 74 68 65 0a 23 20 42 55 49 4c 44 5f 24  in the.# BUILD_$
bd60: 28 50 52 4f 4a 45 43 54 29 20 6d 61 63 72 6f 20  (PROJECT) macro 
bd70: 77 68 69 63 68 20 73 68 6f 75 6c 64 20 62 65 20  which should be 
bd80: 64 65 66 69 6e 65 64 20 6f 6e 6c 79 20 66 6f 72  defined only for
bd90: 20 74 68 65 20 73 68 61 72 65 64 0a 23 20 6c 69   the shared.# li
bda0: 62 72 61 72 79 20 2a 69 6d 70 6c 65 6d 65 6e 74  brary *implement
bdb0: 61 74 69 6f 6e 2a 20 61 6e 64 20 6e 6f 74 20 66  ation* and not f
bdc0: 6f 72 20 69 74 73 20 63 61 6c 6c 65 72 20 69 6e  or its caller in
bdd0: 74 65 72 66 61 63 65 0a 0a 61 70 70 63 66 6c 61  terface..appcfla
bde0: 67 73 5f 6e 6f 73 74 75 62 73 20 3d 20 24 28 63  gs_nostubs = $(c
bdf0: 66 6c 61 67 73 29 20 24 28 63 72 74 29 20 24 28  flags) $(crt) $(
be00: 49 4e 43 4c 55 44 45 53 29 20 24 28 54 43 4c 5f  INCLUDES) $(TCL_
be10: 44 45 46 49 4e 45 53 29 20 24 28 50 52 4a 5f 44  DEFINES) $(PRJ_D
be20: 45 46 49 4e 45 53 29 20 24 28 4f 50 54 44 45 46  EFINES) $(OPTDEF
be30: 49 4e 45 53 29 0a 61 70 70 63 66 6c 61 67 73 20  INES).appcflags 
be40: 3d 20 24 28 61 70 70 63 66 6c 61 67 73 5f 6e 6f  = $(appcflags_no
be50: 73 74 75 62 73 29 20 24 28 55 53 45 5f 53 54 55  stubs) $(USE_STU
be60: 42 53 5f 44 45 46 53 29 0a 70 6b 67 63 66 6c 61  BS_DEFS).pkgcfla
be70: 67 73 20 3d 20 24 28 61 70 70 63 66 6c 61 67 73  gs = $(appcflags
be80: 29 20 24 28 50 4b 47 4e 41 4d 45 46 4c 41 47 53  ) $(PKGNAMEFLAGS
be90: 29 20 2f 44 42 55 49 4c 44 5f 24 28 50 52 4f 4a  ) /DBUILD_$(PROJ
bea0: 45 43 54 29 0a 70 6b 67 63 66 6c 61 67 73 5f 6e  ECT).pkgcflags_n
beb0: 6f 73 74 75 62 73 20 3d 20 24 28 61 70 70 63 66  ostubs = $(appcf
bec0: 6c 61 67 73 5f 6e 6f 73 74 75 62 73 29 20 24 28  lags_nostubs) $(
bed0: 50 4b 47 4e 41 4d 45 46 4c 41 47 53 29 20 2f 44  PKGNAMEFLAGS) /D
bee0: 42 55 49 4c 44 5f 24 28 50 52 4f 4a 45 43 54 29  BUILD_$(PROJECT)
bef0: 0a 0a 23 20 73 74 75 62 73 63 66 6c 61 67 73 20  ..# stubscflags 
bf00: 63 6f 6e 74 61 69 6e 73 20 24 28 63 66 6c 61 67  contains $(cflag
bf10: 73 29 20 70 6c 75 73 20 66 6c 61 67 73 20 75 73  s) plus flags us
bf20: 65 64 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20  ed for building 
bf30: 61 20 73 74 75 62 73 0a 23 20 6c 69 62 72 61 72  a stubs.# librar
bf40: 79 20 66 6f 72 20 74 68 65 20 70 61 63 6b 61 67  y for the packag
bf50: 65 2e 20 20 4e 6f 74 65 3a 20 2f 44 53 54 41 54  e.  Note: /DSTAT
bf60: 49 43 5f 42 55 49 4c 44 20 69 73 20 64 65 66 69  IC_BUILD is defi
bf70: 6e 65 64 20 69 6e 0a 23 20 24 28 4f 50 54 44 45  ned in.# $(OPTDE
bf80: 46 49 4e 45 53 29 20 6f 6e 6c 79 20 69 66 20 74  FINES) only if t
bf90: 68 65 20 4f 50 54 53 20 63 6f 6e 66 69 67 75 72  he OPTS configur
bfa0: 61 74 69 6f 6e 20 69 6e 64 69 63 61 74 65 73 20  ation indicates 
bfb0: 61 20 73 74 61 74 69 63 0a 23 20 6c 69 62 72 61  a static.# libra
bfc0: 72 79 2e 20 48 6f 77 65 76 65 72 20 74 68 65 20  ry. However the 
bfd0: 73 74 75 62 73 20 6c 69 62 72 61 72 79 20 69 73  stubs library is
bfe0: 20 41 4c 57 41 59 53 20 73 74 61 74 69 63 20 68   ALWAYS static h
bff0: 65 6e 63 65 20 69 6e 63 6c 75 64 65 64 0a 23 20  ence included.# 
c000: 68 65 72 65 20 69 72 72 65 73 70 65 63 74 69 76  here irrespectiv
c010: 65 20 6f 66 20 74 68 65 20 4f 50 54 53 20 73 65  e of the OPTS se
c020: 74 74 69 6e 67 2e 0a 23 0a 23 20 54 42 44 20 2d  tting..#.# TBD -
c030: 20 74 63 6c 76 66 73 20 68 61 73 20 61 20 63 6f   tclvfs has a co
c040: 6d 6d 65 6e 74 20 74 68 61 74 20 73 74 75 62 73  mment that stubs
c050: 20 6c 69 62 73 20 73 68 6f 75 6c 64 20 6e 6f 74   libs should not
c060: 20 62 65 20 63 6f 6d 70 69 6c 65 64 20 77 69 74   be compiled wit
c070: 68 20 2d 47 4c 0a 23 20 77 69 74 68 6f 75 74 20  h -GL.# without 
c080: 73 74 61 74 69 6e 67 20 77 68 79 2e 20 54 63 6c  stating why. Tcl
c090: 20 69 74 73 65 6c 66 20 63 6f 6d 70 69 6c 65 64   itself compiled
c0a0: 20 73 74 75 62 73 20 6c 69 62 73 20 77 69 74 68   stubs libs with
c0b0: 20 74 68 69 73 20 66 6c 61 67 2e 0a 23 20 73 6f   this flag..# so
c0c0: 20 77 65 20 64 6f 20 6e 6f 74 20 72 65 6d 6f 76   we do not remov
c0d0: 65 20 69 74 20 66 72 6f 6d 20 63 66 6c 61 67 73  e it from cflags
c0e0: 2e 20 2d 47 4c 20 6d 61 79 20 70 72 65 76 65 6e  . -GL may preven
c0f0: 74 20 65 78 74 65 6e 73 69 6f 6e 73 0a 23 20 63  t extensions.# c
c100: 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 6f 6e 65  ompiled with one
c110: 20 56 43 20 76 65 72 73 69 6f 6e 20 74 6f 20 66   VC version to f
c120: 61 69 6c 20 74 6f 20 6c 69 6e 6b 20 61 67 61 69  ail to link agai
c130: 6e 73 74 20 73 74 75 62 73 20 6c 69 62 72 61 72  nst stubs librar
c140: 79 0a 23 20 63 6f 6d 70 69 6c 65 64 20 77 69 74  y.# compiled wit
c150: 68 20 61 6e 6f 74 68 65 72 20 56 43 20 76 65 72  h another VC ver
c160: 73 69 6f 6e 2e 20 43 68 65 63 6b 20 66 6f 72 20  sion. Check for 
c170: 74 68 69 73 20 61 6e 64 20 66 69 78 20 61 63 63  this and fix acc
c180: 6f 72 64 69 6e 67 6c 79 2e 0a 73 74 75 62 73 63  ordingly..stubsc
c190: 66 6c 61 67 73 20 3d 20 24 28 63 66 6c 61 67 73  flags = $(cflags
c1a0: 29 20 24 28 50 4b 47 4e 41 4d 45 46 4c 41 47 53  ) $(PKGNAMEFLAGS
c1b0: 29 20 24 28 50 52 4a 5f 44 45 46 49 4e 45 53 29  ) $(PRJ_DEFINES)
c1c0: 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f   $(OPTDEFINES) /
c1d0: 5a 6c 20 2f 47 4c 2d 20 2f 44 53 54 41 54 49 43  Zl /GL- /DSTATIC
c1e0: 5f 42 55 49 4c 44 20 24 28 49 4e 43 4c 55 44 45  _BUILD $(INCLUDE
c1f0: 53 29 20 24 28 55 53 45 5f 53 54 55 42 53 5f 44  S) $(USE_STUBS_D
c200: 45 46 53 29 0a 0a 23 20 4c 69 6e 6b 20 66 6c 61  EFS)..# Link fla
c210: 67 73 0a 0a 21 69 66 20 24 28 44 45 42 55 47 29  gs..!if $(DEBUG)
c220: 0a 6c 64 65 62 75 67 09 3d 20 2d 64 65 62 75 67  .ldebug.= -debug
c230: 20 2d 64 65 62 75 67 74 79 70 65 3a 63 76 0a 21   -debugtype:cv.!
c240: 65 6c 73 65 0a 6c 64 65 62 75 67 09 3d 20 2d 72  else.ldebug.= -r
c250: 65 6c 65 61 73 65 20 2d 6f 70 74 3a 72 65 66 20  elease -opt:ref 
c260: 2d 6f 70 74 3a 69 63 66 2c 33 0a 21 69 66 20 24  -opt:icf,3.!if $
c270: 28 53 59 4d 42 4f 4c 53 29 0a 6c 64 65 62 75 67  (SYMBOLS).ldebug
c280: 09 3d 20 24 28 6c 64 65 62 75 67 29 20 2d 64 65  .= $(ldebug) -de
c290: 62 75 67 20 2d 64 65 62 75 67 74 79 70 65 3a 63  bug -debugtype:c
c2a0: 76 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  v.!endif.!endif.
c2b0: 0a 23 20 4e 6f 74 65 3a 20 50 72 6f 66 69 6c 69  .# Note: Profili
c2c0: 6e 67 20 69 73 20 63 75 72 72 65 6e 74 6c 79 20  ng is currently 
c2d0: 6f 6e 6c 79 20 70 6f 73 73 69 62 6c 65 20 77 69  only possible wi
c2e0: 74 68 20 74 68 65 20 56 69 73 75 61 6c 20 53 74  th the Visual St
c2f0: 75 64 69 6f 20 45 6e 74 65 72 70 72 69 73 65 0a  udio Enterprise.
c300: 21 69 66 20 24 28 50 52 4f 46 49 4c 45 29 0a 6c  !if $(PROFILE).l
c310: 64 65 62 75 67 3d 20 24 28 6c 64 65 62 75 67 29  debug= $(ldebug)
c320: 20 2d 70 72 6f 66 69 6c 65 0a 21 65 6e 64 69 66   -profile.!endif
c330: 0a 0a 23 23 23 20 44 65 63 6c 61 72 61 74 69 6f  ..### Declaratio
c340: 6e 73 20 63 6f 6d 6d 6f 6e 20 74 6f 20 61 6c 6c  ns common to all
c350: 20 6c 69 6e 6b 65 72 20 76 65 72 73 69 6f 6e 73   linker versions
c360: 0a 6c 66 6c 61 67 73 09 3d 20 2d 6e 6f 6c 6f 67  .lflags.= -nolog
c370: 6f 20 2d 6d 61 63 68 69 6e 65 3a 24 28 4d 41 43  o -machine:$(MAC
c380: 48 49 4e 45 29 20 24 28 4c 49 4e 4b 45 52 46 4c  HINE) $(LINKERFL
c390: 41 47 53 29 20 24 28 6c 64 65 62 75 67 29 0a 0a  AGS) $(ldebug)..
c3a0: 21 69 66 20 24 28 4d 53 56 43 52 54 29 20 26 26  !if $(MSVCRT) &&
c3b0: 20 21 28 24 28 44 45 42 55 47 29 20 26 26 20 21   !($(DEBUG) && !
c3c0: 24 28 55 4e 43 48 45 43 4b 45 44 29 29 20 26 26  $(UNCHECKED)) &&
c3d0: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 3d   $(VCVERSION) >=
c3e0: 20 31 39 30 30 0a 6c 66 6c 61 67 73 09 3d 20 24   1900.lflags.= $
c3f0: 28 6c 66 6c 61 67 73 29 20 2d 6e 6f 64 65 66 61  (lflags) -nodefa
c400: 75 6c 74 6c 69 62 3a 6c 69 62 75 63 72 74 2e 6c  ultlib:libucrt.l
c410: 69 62 0a 21 65 6e 64 69 66 0a 0a 64 6c 6c 6c 66  ib.!endif..dlllf
c420: 6c 61 67 73 20 3d 20 24 28 6c 66 6c 61 67 73 29  lags = $(lflags)
c430: 20 2d 64 6c 6c 0a 63 6f 6e 6c 66 6c 61 67 73 20   -dll.conlflags 
c440: 3d 20 24 28 6c 66 6c 61 67 73 29 20 2d 73 75 62  = $(lflags) -sub
c450: 73 79 73 74 65 6d 3a 63 6f 6e 73 6f 6c 65 0a 67  system:console.g
c460: 75 69 6c 66 6c 61 67 73 20 3d 20 24 28 6c 66 6c  uilflags = $(lfl
c470: 61 67 73 29 20 2d 73 75 62 73 79 73 74 65 6d 3a  ags) -subsystem:
c480: 77 69 6e 64 6f 77 73 0a 0a 23 20 4c 69 62 72 61  windows..# Libra
c490: 72 69 65 73 20 74 68 61 74 20 61 72 65 20 72 65  ries that are re
c4a0: 71 75 69 72 65 64 20 66 6f 72 20 65 76 65 72 79  quired for every
c4b0: 20 69 6d 61 67 65 2e 0a 23 20 45 78 74 65 6e 73   image..# Extens
c4c0: 69 6f 6e 73 20 73 68 6f 75 6c 64 20 64 65 66 69  ions should defi
c4d0: 6e 65 20 61 6e 79 20 61 64 64 69 74 69 6f 6e 61  ne any additiona
c4e0: 6c 20 6c 69 62 72 61 72 69 65 73 20 77 69 74 68  l libraries with
c4f0: 20 24 28 50 52 4a 5f 4c 49 42 53 29 0a 77 69 6e   $(PRJ_LIBS).win
c500: 6c 69 62 73 20 20 20 3d 20 6b 65 72 6e 65 6c 33  libs   = kernel3
c510: 32 2e 6c 69 62 20 61 64 76 61 70 69 33 32 2e 6c  2.lib advapi32.l
c520: 69 62 0a 0a 21 69 66 20 24 28 4e 45 45 44 5f 54  ib..!if $(NEED_T
c530: 4b 29 0a 77 69 6e 6c 69 62 73 20 3d 20 24 28 77  K).winlibs = $(w
c540: 69 6e 6c 69 62 73 29 20 67 64 69 33 32 2e 6c 69  inlibs) gdi32.li
c550: 62 20 75 73 65 72 33 32 2e 6c 69 62 20 75 78 74  b user32.lib uxt
c560: 68 65 6d 65 2e 6c 69 62 0a 21 65 6e 64 69 66 0a  heme.lib.!endif.
c570: 0a 23 20 41 76 6f 69 64 20 27 75 6e 72 65 73 6f  .# Avoid 'unreso
c580: 6c 76 65 64 20 65 78 74 65 72 6e 61 6c 20 73 79  lved external sy
c590: 6d 62 6f 6c 20 5f 5f 73 65 63 75 72 69 74 79 5f  mbol __security_
c5a0: 63 6f 6f 6b 69 65 27 20 65 72 72 6f 72 73 2e 0a  cookie' errors..
c5b0: 23 20 63 2e 66 2e 20 68 74 74 70 3a 2f 2f 73 75  # c.f. http://su
c5c0: 70 70 6f 72 74 2e 6d 69 63 72 6f 73 6f 66 74 2e  pport.microsoft.
c5d0: 63 6f 6d 2f 3f 69 64 3d 38 39 34 35 37 33 0a 21  com/?id=894573.!
c5e0: 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20  if "$(MACHINE)" 
c5f0: 3d 3d 20 22 41 4d 44 36 34 22 0a 21 69 66 20 24  == "AMD64".!if $
c600: 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 20 31 33  (VCVERSION) > 13
c610: 39 39 20 26 26 20 24 28 56 43 56 45 52 53 49 4f  99 && $(VCVERSIO
c620: 4e 29 20 3c 20 31 35 30 30 0a 77 69 6e 6c 69 62  N) < 1500.winlib
c630: 73 20 20 20 3d 20 24 28 77 69 6e 6c 69 62 73 29  s   = $(winlibs)
c640: 20 62 75 66 66 65 72 6f 76 65 72 66 6c 6f 77 55   bufferoverflowU
c650: 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 21 65 6e 64  .lib.!endif.!end
c660: 69 66 0a 0a 62 61 73 65 6c 69 62 73 20 3d 20 24  if..baselibs = $
c670: 28 77 69 6e 6c 69 62 73 29 20 24 28 50 52 4a 5f  (winlibs) $(PRJ_
c680: 4c 49 42 53 29 0a 0a 21 69 66 20 24 28 4d 53 56  LIBS)..!if $(MSV
c690: 43 52 54 29 20 26 26 20 21 28 24 28 44 45 42 55  CRT) && !($(DEBU
c6a0: 47 29 20 26 26 20 21 24 28 55 4e 43 48 45 43 4b  G) && !$(UNCHECK
c6b0: 45 44 29 29 20 26 26 20 24 28 56 43 56 45 52 53  ED)) && $(VCVERS
c6c0: 49 4f 4e 29 20 3e 3d 20 31 39 30 30 0a 62 61 73  ION) >= 1900.bas
c6d0: 65 6c 69 62 73 20 20 20 3d 20 24 28 62 61 73 65  elibs   = $(base
c6e0: 6c 69 62 73 29 20 75 63 72 74 2e 6c 69 62 0a 21  libs) ucrt.lib.!
c6f0: 65 6e 64 69 66 0a 0a 23 23 23 23 23 23 23 23 23  endif..#########
c700: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c710: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c720: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
c730: 23 23 23 23 23 23 23 0a 23 20 31 33 2e 20 44 65  #######.# 13. De
c740: 66 69 6e 65 20 73 74 61 6e 64 61 72 64 20 63 6f  fine standard co
c750: 6d 6d 61 6e 64 73 2c 20 63 6f 6d 6d 6f 6e 20 6d  mmands, common m
c760: 61 6b 65 20 74 61 72 67 65 74 73 20 61 6e 64 20  ake targets and 
c770: 69 6d 70 6c 69 63 69 74 20 72 75 6c 65 73 0a 0a  implicit rules..
c780: 43 43 50 4b 47 43 4d 44 20 3d 20 24 28 63 63 33  CCPKGCMD = $(cc3
c790: 32 29 20 24 28 70 6b 67 63 66 6c 61 67 73 29 20  2) $(pkgcflags) 
c7a0: 2d 46 6f 24 28 54 4d 50 5f 44 49 52 29 5e 5c 0a  -Fo$(TMP_DIR)^\.
c7b0: 43 43 41 50 50 43 4d 44 20 3d 20 24 28 63 63 33  CCAPPCMD = $(cc3
c7c0: 32 29 20 24 28 61 70 70 63 66 6c 61 67 73 29 20  2) $(appcflags) 
c7d0: 2d 46 6f 24 28 54 4d 50 5f 44 49 52 29 5e 5c 0a  -Fo$(TMP_DIR)^\.
c7e0: 43 43 53 54 55 42 53 43 4d 44 20 3d 20 24 28 63  CCSTUBSCMD = $(c
c7f0: 63 33 32 29 20 24 28 73 74 75 62 73 63 66 6c 61  c32) $(stubscfla
c800: 67 73 29 20 2d 46 6f 24 28 54 4d 50 5f 44 49 52  gs) -Fo$(TMP_DIR
c810: 29 5e 5c 0a 0a 4c 49 42 43 4d 44 20 3d 20 24 28  )^\..LIBCMD = $(
c820: 6c 69 62 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20 24  lib32) -nologo $
c830: 28 4c 49 4e 4b 45 52 46 4c 41 47 53 29 20 2d 6f  (LINKERFLAGS) -o
c840: 75 74 3a 24 40 0a 44 4c 4c 43 4d 44 20 3d 20 24  ut:$@.DLLCMD = $
c850: 28 6c 69 6e 6b 33 32 29 20 24 28 64 6c 6c 6c 66  (link32) $(dlllf
c860: 6c 61 67 73 29 20 2d 6f 75 74 3a 24 40 20 24 28  lags) -out:$@ $(
c870: 62 61 73 65 6c 69 62 73 29 20 24 28 74 63 6c 6c  baselibs) $(tcll
c880: 69 62 73 29 20 24 28 74 6b 6c 69 62 73 29 0a 0a  ibs) $(tklibs)..
c890: 43 4f 4e 45 58 45 43 4d 44 20 3d 20 24 28 6c 69  CONEXECMD = $(li
c8a0: 6e 6b 33 32 29 20 24 28 63 6f 6e 6c 66 6c 61 67  nk32) $(conlflag
c8b0: 73 29 20 2d 6f 75 74 3a 24 40 20 24 28 62 61 73  s) -out:$@ $(bas
c8c0: 65 6c 69 62 73 29 20 24 28 74 63 6c 6c 69 62 73  elibs) $(tcllibs
c8d0: 29 20 24 28 74 6b 6c 69 62 73 29 0a 47 55 49 45  ) $(tklibs).GUIE
c8e0: 58 45 43 4d 44 20 3d 20 24 28 6c 69 6e 6b 33 32  XECMD = $(link32
c8f0: 29 20 24 28 67 75 69 6c 66 6c 61 67 73 29 20 2d  ) $(guilflags) -
c900: 6f 75 74 3a 24 40 20 24 28 62 61 73 65 6c 69 62  out:$@ $(baselib
c910: 73 29 20 24 28 74 63 6c 6c 69 62 73 29 20 24 28  s) $(tcllibs) $(
c920: 74 6b 6c 69 62 73 29 0a 52 45 53 43 4d 44 20 20  tklibs).RESCMD  
c930: 3d 20 24 28 72 63 33 32 29 20 2d 66 6f 20 24 40  = $(rc32) -fo $@
c940: 20 2d 72 20 2d 69 20 22 24 28 47 45 4e 45 52 49   -r -i "$(GENERI
c950: 43 44 49 52 29 22 20 2d 69 20 22 24 28 54 4d 50  CDIR)" -i "$(TMP
c960: 5f 44 49 52 29 22 20 5c 0a 09 20 20 20 20 24 28  _DIR)" \..    $(
c970: 54 43 4c 5f 49 4e 43 4c 55 44 45 53 29 20 5c 0a  TCL_INCLUDES) \.
c980: 09 20 20 20 20 2f 44 44 45 42 55 47 3d 24 28 44  .    /DDEBUG=$(D
c990: 45 42 55 47 29 20 2d 64 20 55 4e 43 48 45 43 4b  EBUG) -d UNCHECK
c9a0: 45 44 3d 24 28 55 4e 43 48 45 43 4b 45 44 29 20  ED=$(UNCHECKED) 
c9b0: 5c 0a 09 20 20 20 20 2f 44 43 4f 4d 4d 41 56 45  \..    /DCOMMAVE
c9c0: 52 53 49 4f 4e 3d 24 28 52 43 43 4f 4d 4d 41 56  RSION=$(RCCOMMAV
c9d0: 45 52 53 49 4f 4e 29 20 5c 0a 09 20 20 20 20 2f  ERSION) \..    /
c9e0: 44 44 4f 54 56 45 52 53 49 4f 4e 3d 5c 22 24 28  DDOTVERSION=\"$(
c9f0: 44 4f 54 56 45 52 53 49 4f 4e 29 5c 22 20 5c 0a  DOTVERSION)\" \.
ca00: 09 20 20 20 20 2f 44 56 45 52 53 49 4f 4e 3d 5c  .    /DVERSION=\
ca10: 22 24 28 56 45 52 53 49 4f 4e 29 5c 22 20 5c 0a  "$(VERSION)\" \.
ca20: 09 20 20 20 20 2f 44 53 55 46 58 3d 5c 22 24 28  .    /DSUFX=\"$(
ca30: 53 55 46 58 29 5c 22 20 5c 0a 09 20 20 20 20 2f  SUFX)\" \..    /
ca40: 44 50 52 4f 4a 45 43 54 3d 5c 22 24 28 50 52 4f  DPROJECT=\"$(PRO
ca50: 4a 45 43 54 29 5c 22 20 5c 0a 09 20 20 20 20 2f  JECT)\" \..    /
ca60: 44 50 52 4a 4c 49 42 4e 41 4d 45 3d 5c 22 24 28  DPRJLIBNAME=\"$(
ca70: 50 52 4a 4c 49 42 4e 41 4d 45 29 5c 22 0a 0a 21  PRJLIBNAME)\"..!
ca80: 69 66 6e 64 65 66 20 44 45 46 41 55 4c 54 5f 42  ifndef DEFAULT_B
ca90: 55 49 4c 44 5f 54 41 52 47 45 54 0a 44 45 46 41  UILD_TARGET.DEFA
caa0: 55 4c 54 5f 42 55 49 4c 44 5f 54 41 52 47 45 54  ULT_BUILD_TARGET
cab0: 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 0a 21 65   = $(PROJECT).!e
cac0: 6e 64 69 66 0a 0a 64 65 66 61 75 6c 74 2d 74 61  ndif..default-ta
cad0: 72 67 65 74 3a 20 24 28 44 45 46 41 55 4c 54 5f  rget: $(DEFAULT_
cae0: 42 55 49 4c 44 5f 54 41 52 47 45 54 29 0a 0a 21  BUILD_TARGET)..!
caf0: 69 66 20 24 28 4d 55 4c 54 49 50 4c 41 54 46 4f  if $(MULTIPLATFO
cb00: 52 4d 5f 49 4e 53 54 41 4c 4c 29 0a 64 65 66 61  RM_INSTALL).defa
cb10: 75 6c 74 2d 70 6b 67 69 6e 64 65 78 3a 0a 09 40  ult-pkgindex:..@
cb20: 65 63 68 6f 20 70 61 63 6b 61 67 65 20 69 66 6e  echo package ifn
cb30: 65 65 64 65 64 20 24 28 50 52 4a 5f 50 41 43 4b  eeded $(PRJ_PACK
cb40: 41 47 45 5f 54 43 4c 4e 41 4d 45 29 20 24 28 44  AGE_TCLNAME) $(D
cb50: 4f 54 56 45 52 53 49 4f 4e 29 20 5c 0a 09 20 20  OTVERSION) \..  
cb60: 20 20 5b 6c 69 73 74 20 6c 6f 61 64 20 5b 66 69    [list load [fi
cb70: 6c 65 20 6a 6f 69 6e 20 24 24 64 69 72 20 24 28  le join $$dir $(
cb80: 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46  PLATFORM_IDENTIF
cb90: 59 29 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 29  Y) $(PRJLIBNAME)
cba0: 5d 5d 20 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c  ]] > $(OUT_DIR)\
cbb0: 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 21 65 6c  pkgIndex.tcl.!el
cbc0: 73 65 0a 64 65 66 61 75 6c 74 2d 70 6b 67 69 6e  se.default-pkgin
cbd0: 64 65 78 3a 0a 09 40 65 63 68 6f 20 70 61 63 6b  dex:..@echo pack
cbe0: 61 67 65 20 69 66 6e 65 65 64 65 64 20 24 28 50  age ifneeded $(P
cbf0: 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41  RJ_PACKAGE_TCLNA
cc00: 4d 45 29 20 24 28 44 4f 54 56 45 52 53 49 4f 4e  ME) $(DOTVERSION
cc10: 29 20 5c 0a 09 20 20 20 20 5b 6c 69 73 74 20 6c  ) \..    [list l
cc20: 6f 61 64 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 24  oad [file join $
cc30: 24 64 69 72 20 24 28 50 52 4a 4c 49 42 4e 41 4d  $dir $(PRJLIBNAM
cc40: 45 29 5d 5d 20 3e 20 24 28 4f 55 54 5f 44 49 52  E)]] > $(OUT_DIR
cc50: 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 21  )\pkgIndex.tcl.!
cc60: 65 6e 64 69 66 0a 0a 64 65 66 61 75 6c 74 2d 70  endif..default-p
cc70: 6b 67 69 6e 64 65 78 2d 74 65 61 3a 0a 09 40 69  kgindex-tea:..@i
cc80: 66 20 65 78 69 73 74 20 24 28 52 4f 4f 54 29 5c  f exist $(ROOT)\
cc90: 70 6b 67 49 6e 64 65 78 2e 74 63 6c 2e 69 6e 20  pkgIndex.tcl.in 
cca0: 6e 6d 61 6b 65 68 6c 70 20 2d 73 20 3c 3c 20 24  nmakehlp -s << $
ccb0: 28 52 4f 4f 54 29 5c 70 6b 67 49 6e 64 65 78 2e  (ROOT)\pkgIndex.
ccc0: 74 63 6c 2e 69 6e 20 3e 20 24 28 4f 55 54 5f 44  tcl.in > $(OUT_D
ccd0: 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c  IR)\pkgIndex.tcl
cce0: 0a 40 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f  .@PACKAGE_VERSIO
ccf0: 4e 40 20 20 20 20 24 28 44 4f 54 56 45 52 53 49  N@    $(DOTVERSI
cd00: 4f 4e 29 0a 40 50 41 43 4b 41 47 45 5f 4e 41 4d  ON).@PACKAGE_NAM
cd10: 45 40 20 20 20 20 20 20 20 24 28 50 52 4a 5f 50  E@       $(PRJ_P
cd20: 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 0a  ACKAGE_TCLNAME).
cd30: 40 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45  @PACKAGE_TCLNAME
cd40: 40 20 20 20 20 24 28 50 52 4a 5f 50 41 43 4b 41  @    $(PRJ_PACKA
cd50: 47 45 5f 54 43 4c 4e 41 4d 45 29 0a 40 50 4b 47  GE_TCLNAME).@PKG
cd60: 5f 4c 49 42 5f 46 49 4c 45 40 20 20 20 20 20 20  _LIB_FILE@      
cd70: 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 29 0a 3c   $(PRJLIBNAME).<
cd80: 3c 0a 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61  <..default-insta
cd90: 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 69 6e 73 74  ll: default-inst
cda0: 61 6c 6c 2d 62 69 6e 61 72 69 65 73 20 64 65 66  all-binaries def
cdb0: 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 6c 69 62  ault-install-lib
cdc0: 72 61 72 69 65 73 0a 21 69 66 20 24 28 53 59 4d  raries.!if $(SYM
cdd0: 42 4f 4c 53 29 0a 64 65 66 61 75 6c 74 2d 69 6e  BOLS).default-in
cde0: 73 74 61 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 69  stall: default-i
cdf0: 6e 73 74 61 6c 6c 2d 70 64 62 73 0a 21 65 6e 64  nstall-pdbs.!end
ce00: 69 66 0a 0a 23 20 41 67 61 69 6e 20 74 6f 20 64  if..# Again to d
ce10: 65 61 6c 20 77 69 74 68 20 68 69 73 74 6f 72 69  eal with histori
ce20: 63 61 6c 20 62 72 6f 6b 65 6e 6e 65 73 73 2c 20  cal brokenness, 
ce30: 74 68 65 72 65 20 69 73 20 73 6f 6d 65 20 63 6f  there is some co
ce40: 6e 66 75 73 69 6f 6e 0a 23 20 69 6e 20 74 65 72  nfusion.# in ter
ce50: 6d 69 6e 6c 6f 67 79 2e 20 46 6f 72 20 65 78 74  minlogy. For ext
ce60: 65 6e 73 69 6f 6e 73 2c 20 74 68 65 20 22 69 6e  ensions, the "in
ce70: 73 74 61 6c 6c 2d 62 69 6e 61 72 69 65 73 22 20  stall-binaries" 
ce80: 77 61 73 20 75 73 65 64 20 74 6f 0a 23 20 6c 6f  was used to.# lo
ce90: 63 61 74 65 20 74 61 72 67 65 74 20 64 69 72 65  cate target dire
cea0: 63 74 6f 72 79 20 66 6f 72 20 2a 62 69 6e 61 72  ctory for *binar
ceb0: 79 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 69  y shared librari
cec0: 65 73 2a 20 61 6e 64 20 74 68 75 73 0a 23 20 74  es* and thus.# t
ced0: 68 65 20 61 70 70 72 6f 70 72 69 61 74 65 20 6d  he appropriate m
cee0: 61 63 72 6f 20 69 73 20 4c 49 42 5f 49 4e 53 54  acro is LIB_INST
cef0: 41 4c 4c 5f 44 49 52 20 73 69 6e 63 65 20 42 49  ALL_DIR since BI
cf00: 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 69 73  N_INSTALL_DIR is
cf10: 0a 23 20 66 6f 72 20 65 78 65 63 75 74 61 62 6c  .# for executabl
cf20: 65 73 20 28 65 78 65 73 29 2e 20 4f 6e 20 74 68  es (exes). On th
cf30: 65 20 6f 74 68 65 72 20 68 61 6e 64 20 74 68 65  e other hand the
cf40: 20 22 69 6e 73 74 61 6c 6c 2d 6c 69 62 72 61 72   "install-librar
cf50: 69 65 73 22 0a 23 20 74 61 72 67 65 74 20 69 73  ies".# target is
cf60: 20 66 6f 72 20 2a 73 63 72 69 70 74 73 2a 20 61   for *scripts* a
cf70: 6e 64 20 73 68 6f 75 6c 64 20 68 61 76 65 20 62  nd should have b
cf80: 65 65 6e 20 63 61 6c 6c 65 64 20 22 69 6e 73 74  een called "inst
cf90: 61 6c 6c 2d 73 63 72 69 70 74 73 22 2e 0a 64 65  all-scripts"..de
cfa0: 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 62 69  fault-install-bi
cfb0: 6e 61 72 69 65 73 3a 20 24 28 50 52 4a 4c 49 42  naries: $(PRJLIB
cfc0: 29 0a 09 40 65 63 68 6f 20 49 6e 73 74 61 6c 6c  )..@echo Install
cfd0: 69 6e 67 20 62 69 6e 61 72 69 65 73 20 74 6f 20  ing binaries to 
cfe0: 27 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44  '$(LIB_INSTALL_D
cff0: 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20 65 78  IR)'..@if not ex
d000: 69 73 74 20 22 24 28 4c 49 42 5f 49 4e 53 54 41  ist "$(LIB_INSTA
d010: 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72 20 22  LL_DIR)" mkdir "
d020: 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49  $(LIB_INSTALL_DI
d030: 52 29 22 0a 09 40 24 28 43 50 59 29 20 24 28 50  R)"..@$(CPY) $(P
d040: 52 4a 4c 49 42 29 20 22 24 28 4c 49 42 5f 49 4e  RJLIB) "$(LIB_IN
d050: 53 54 41 4c 4c 5f 44 49 52 29 22 20 3e 4e 55 4c  STALL_DIR)" >NUL
d060: 0a 0a 23 20 41 6c 69 61 73 20 66 6f 72 20 64 65  ..# Alias for de
d070: 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 73 63  fault-install-sc
d080: 72 69 70 74 73 0a 64 65 66 61 75 6c 74 2d 69 6e  ripts.default-in
d090: 73 74 61 6c 6c 2d 6c 69 62 72 61 72 69 65 73 3a  stall-libraries:
d0a0: 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c   default-install
d0b0: 2d 73 63 72 69 70 74 73 0a 0a 64 65 66 61 75 6c  -scripts..defaul
d0c0: 74 2d 69 6e 73 74 61 6c 6c 2d 73 63 72 69 70 74  t-install-script
d0d0: 73 3a 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b  s: $(OUT_DIR)\pk
d0e0: 67 49 6e 64 65 78 2e 74 63 6c 0a 09 40 65 63 68  gIndex.tcl..@ech
d0f0: 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 20 6c 69 62  o Installing lib
d100: 72 61 72 69 65 73 20 74 6f 20 27 24 28 53 43 52  raries to '$(SCR
d110: 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29  IPT_INSTALL_DIR)
d120: 27 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 4c  '..@if exist $(L
d130: 49 42 44 49 52 29 20 24 28 43 50 59 29 20 24 28  IBDIR) $(CPY) $(
d140: 4c 49 42 44 49 52 29 5c 2a 2e 74 63 6c 20 22 24  LIBDIR)\*.tcl "$
d150: 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f  (SCRIPT_INSTALL_
d160: 44 49 52 29 22 0a 09 40 65 63 68 6f 20 49 6e 73  DIR)"..@echo Ins
d170: 74 61 6c 6c 69 6e 67 20 70 61 63 6b 61 67 65 20  talling package 
d180: 69 6e 64 65 78 20 69 6e 20 27 24 28 53 43 52 49  index in '$(SCRI
d190: 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27  PT_INSTALL_DIR)'
d1a0: 0a 09 40 24 28 43 50 59 29 20 24 28 4f 55 54 5f  ..@$(CPY) $(OUT_
d1b0: 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63  DIR)\pkgIndex.tc
d1c0: 6c 20 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41  l $(SCRIPT_INSTA
d1d0: 4c 4c 5f 44 49 52 29 0a 0a 64 65 66 61 75 6c 74  LL_DIR)..default
d1e0: 2d 69 6e 73 74 61 6c 6c 2d 73 74 75 62 73 3a 0a  -install-stubs:.
d1f0: 09 40 65 63 68 6f 20 49 6e 73 74 61 6c 6c 69 6e  .@echo Installin
d200: 67 20 73 74 75 62 73 20 6c 69 62 72 61 72 79 20  g stubs library 
d210: 74 6f 20 27 24 28 53 43 52 49 50 54 5f 49 4e 53  to '$(SCRIPT_INS
d220: 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 20  TALL_DIR)'..@if 
d230: 6e 6f 74 20 65 78 69 73 74 20 22 24 28 53 43 52  not exist "$(SCR
d240: 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29  IPT_INSTALL_DIR)
d250: 22 20 6d 6b 64 69 72 20 22 24 28 53 43 52 49 50  " mkdir "$(SCRIP
d260: 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a  T_INSTALL_DIR)".
d270: 09 40 24 28 43 50 59 29 20 24 28 50 52 4a 53 54  .@$(CPY) $(PRJST
d280: 55 42 4c 49 42 29 20 22 24 28 53 43 52 49 50 54  UBLIB) "$(SCRIPT
d290: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 3e  _INSTALL_DIR)" >
d2a0: 4e 55 4c 0a 0a 64 65 66 61 75 6c 74 2d 69 6e 73  NUL..default-ins
d2b0: 74 61 6c 6c 2d 70 64 62 73 3a 0a 09 40 65 63 68  tall-pdbs:..@ech
d2c0: 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 20 50 44 42  o Installing PDB
d2d0: 73 20 74 6f 20 27 24 28 4c 49 42 5f 49 4e 53 54  s to '$(LIB_INST
d2e0: 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 20 6e  ALL_DIR)'..@if n
d2f0: 6f 74 20 65 78 69 73 74 20 22 24 28 4c 49 42 5f  ot exist "$(LIB_
d300: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b  INSTALL_DIR)" mk
d310: 64 69 72 20 22 24 28 4c 49 42 5f 49 4e 53 54 41  dir "$(LIB_INSTA
d320: 4c 4c 5f 44 49 52 29 22 0a 09 40 24 28 43 50 59  LL_DIR)"..@$(CPY
d330: 29 20 22 24 28 4f 55 54 5f 44 49 52 29 5c 2a 2e  ) "$(OUT_DIR)\*.
d340: 70 64 62 22 20 22 24 28 4c 49 42 5f 49 4e 53 54  pdb" "$(LIB_INST
d350: 41 4c 4c 5f 44 49 52 29 5c 22 0a 0a 23 20 22 65  ALL_DIR)\"..# "e
d360: 6d 61 63 73 20 66 6f 6e 74 2d 6c 6f 63 6b 20 68  macs font-lock h
d370: 69 67 68 6c 69 67 68 74 69 6e 67 20 66 69 78 0a  ighlighting fix.
d380: 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c  .default-install
d390: 2d 64 6f 63 73 2d 68 74 6d 6c 3a 0a 09 40 65 63  -docs-html:..@ec
d3a0: 68 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 20 64 6f  ho Installing do
d3b0: 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65  cumentation file
d3c0: 73 20 74 6f 20 27 24 28 44 4f 43 5f 49 4e 53 54  s to '$(DOC_INST
d3d0: 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 20 6e  ALL_DIR)'..@if n
d3e0: 6f 74 20 65 78 69 73 74 20 22 24 28 44 4f 43 5f  ot exist "$(DOC_
d3f0: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b  INSTALL_DIR)" mk
d400: 64 69 72 20 22 24 28 44 4f 43 5f 49 4e 53 54 41  dir "$(DOC_INSTA
d410: 4c 4c 5f 44 49 52 29 22 0a 09 40 69 66 20 65 78  LL_DIR)"..@if ex
d420: 69 73 74 20 24 28 44 4f 43 44 49 52 29 20 66 6f  ist $(DOCDIR) fo
d430: 72 20 25 66 20 69 6e 20 28 22 24 28 44 4f 43 44  r %f in ("$(DOCD
d440: 49 52 29 5c 2a 2e 68 74 6d 6c 22 20 22 24 28 44  IR)\*.html" "$(D
d450: 4f 43 44 49 52 29 5c 2a 2e 63 73 73 22 20 22 24  OCDIR)\*.css" "$
d460: 28 44 4f 43 44 49 52 29 5c 2a 2e 70 6e 67 22 29  (DOCDIR)\*.png")
d470: 20 64 6f 20 40 24 28 43 4f 50 59 29 20 25 66 20   do @$(COPY) %f 
d480: 22 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44  "$(DOC_INSTALL_D
d490: 49 52 29 22 0a 0a 64 65 66 61 75 6c 74 2d 69 6e  IR)"..default-in
d4a0: 73 74 61 6c 6c 2d 64 6f 63 73 2d 6e 3a 0a 09 40  stall-docs-n:..@
d4b0: 65 63 68 6f 20 49 6e 73 74 61 6c 6c 69 6e 67 20  echo Installing 
d4c0: 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 69  documentation fi
d4d0: 6c 65 73 20 74 6f 20 27 24 28 44 4f 43 5f 49 4e  les to '$(DOC_IN
d4e0: 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66  STALL_DIR)'..@if
d4f0: 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28 44 4f   not exist "$(DO
d500: 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20  C_INSTALL_DIR)" 
d510: 6d 6b 64 69 72 20 22 24 28 44 4f 43 5f 49 4e 53  mkdir "$(DOC_INS
d520: 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 69 66 20  TALL_DIR)"..@if 
d530: 65 78 69 73 74 20 24 28 44 4f 43 44 49 52 29 20  exist $(DOCDIR) 
d540: 66 6f 72 20 25 66 20 69 6e 20 28 22 24 28 44 4f  for %f in ("$(DO
d550: 43 44 49 52 29 5c 2a 2e 6e 22 29 20 64 6f 20 40  CDIR)\*.n") do @
d560: 24 28 43 4f 50 59 29 20 25 66 20 22 24 28 44 4f  $(COPY) %f "$(DO
d570: 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a  C_INSTALL_DIR)".
d580: 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c  .default-install
d590: 2d 64 65 6d 6f 73 3a 0a 09 40 65 63 68 6f 20 49  -demos:..@echo I
d5a0: 6e 73 74 61 6c 6c 69 6e 67 20 64 65 6d 6f 73 20  nstalling demos 
d5b0: 74 6f 20 27 24 28 44 45 4d 4f 5f 49 4e 53 54 41  to '$(DEMO_INSTA
d5c0: 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 20 6e 6f  LL_DIR)'..@if no
d5d0: 74 20 65 78 69 73 74 20 22 24 28 44 45 4d 4f 5f  t exist "$(DEMO_
d5e0: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b  INSTALL_DIR)" mk
d5f0: 64 69 72 20 22 24 28 44 45 4d 4f 5f 49 4e 53 54  dir "$(DEMO_INST
d600: 41 4c 4c 5f 44 49 52 29 22 0a 09 40 69 66 20 65  ALL_DIR)"..@if e
d610: 78 69 73 74 20 24 28 44 45 4d 4f 44 49 52 29 20  xist $(DEMODIR) 
d620: 24 28 43 50 59 44 49 52 29 20 22 24 28 44 45 4d  $(CPYDIR) "$(DEM
d630: 4f 44 49 52 29 22 20 22 24 28 44 45 4d 4f 5f 49  ODIR)" "$(DEMO_I
d640: 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a 0a 64 65  NSTALL_DIR)"..de
d650: 66 61 75 6c 74 2d 63 6c 65 61 6e 3a 0a 09 40 65  fault-clean:..@e
d660: 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24 28 54  cho Cleaning $(T
d670: 4d 50 5f 44 49 52 29 5c 2a 20 2e 2e 2e 0a 09 40  MP_DIR)\* .....@
d680: 69 66 20 65 78 69 73 74 20 24 28 54 4d 50 5f 44  if exist $(TMP_D
d690: 49 52 29 5c 6e 75 6c 20 24 28 52 4d 44 49 52 29  IR)\nul $(RMDIR)
d6a0: 20 24 28 54 4d 50 5f 44 49 52 29 0a 09 40 65 63   $(TMP_DIR)..@ec
d6b0: 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24 28 57 49  ho Cleaning $(WI
d6c0: 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e  N_DIR)\nmakehlp.
d6d0: 6f 62 6a 2c 20 6e 6d 61 6b 65 68 6c 70 2e 65 78  obj, nmakehlp.ex
d6e0: 65 20 2e 2e 2e 0a 09 40 69 66 20 65 78 69 73 74  e .....@if exist
d6f0: 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b   $(WIN_DIR)\nmak
d700: 65 68 6c 70 2e 6f 62 6a 20 64 65 6c 20 24 28 57  ehlp.obj del $(W
d710: 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70  IN_DIR)\nmakehlp
d720: 2e 6f 62 6a 0a 09 40 69 66 20 65 78 69 73 74 20  .obj..@if exist 
d730: 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65  $(WIN_DIR)\nmake
d740: 68 6c 70 2e 65 78 65 20 64 65 6c 20 24 28 57 49  hlp.exe del $(WI
d750: 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e  N_DIR)\nmakehlp.
d760: 65 78 65 0a 09 40 69 66 20 65 78 69 73 74 20 24  exe..@if exist $
d770: 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68  (WIN_DIR)\nmakeh
d780: 6c 70 2e 6f 75 74 20 64 65 6c 20 24 28 57 49 4e  lp.out del $(WIN
d790: 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f  _DIR)\nmakehlp.o
d7a0: 75 74 0a 09 40 65 63 68 6f 20 43 6c 65 61 6e 69  ut..@echo Cleani
d7b0: 6e 67 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d  ng $(WIN_DIR)\nm
d7c0: 68 6c 70 2d 6f 75 74 2e 74 78 74 20 2e 2e 2e 0a  hlp-out.txt ....
d7d0: 09 40 69 66 20 65 78 69 73 74 20 24 28 57 49 4e  .@if exist $(WIN
d7e0: 5f 44 49 52 29 5c 6e 6d 68 6c 70 2d 6f 75 74 2e  _DIR)\nmhlp-out.
d7f0: 74 78 74 20 64 65 6c 20 24 28 57 49 4e 5f 44 49  txt del $(WIN_DI
d800: 52 29 5c 6e 6d 68 6c 70 2d 6f 75 74 2e 74 78 74  R)\nmhlp-out.txt
d810: 0a 09 40 65 63 68 6f 20 43 6c 65 61 6e 69 6e 67  ..@echo Cleaning
d820: 20 24 28 57 49 4e 5f 44 49 52 29 5c 5f 6a 75 6e   $(WIN_DIR)\_jun
d830: 6b 2e 70 63 68 20 2e 2e 2e 0a 09 40 69 66 20 65  k.pch .....@if e
d840: 78 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c  xist $(WIN_DIR)\
d850: 5f 6a 75 6e 6b 2e 70 63 68 20 64 65 6c 20 24 28  _junk.pch del $(
d860: 57 49 4e 5f 44 49 52 29 5c 5f 6a 75 6e 6b 2e 70  WIN_DIR)\_junk.p
d870: 63 68 0a 09 40 65 63 68 6f 20 43 6c 65 61 6e 69  ch..@echo Cleani
d880: 6e 67 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65  ng $(WIN_DIR)\ve
d890: 72 63 6c 2e 78 2c 20 76 65 72 63 6c 2e 69 20 2e  rcl.x, vercl.i .
d8a0: 2e 2e 0a 09 40 69 66 20 65 78 69 73 74 20 24 28  ....@if exist $(
d8b0: 57 49 4e 5f 44 49 52 29 5c 76 65 72 63 6c 2e 78  WIN_DIR)\vercl.x
d8c0: 20 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c   del $(WIN_DIR)\
d8d0: 76 65 72 63 6c 2e 78 0a 09 40 69 66 20 65 78 69  vercl.x..@if exi
d8e0: 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65  st $(WIN_DIR)\ve
d8f0: 72 63 6c 2e 69 20 64 65 6c 20 24 28 57 49 4e 5f  rcl.i del $(WIN_
d900: 44 49 52 29 5c 76 65 72 63 6c 2e 69 0a 09 40 65  DIR)\vercl.i..@e
d910: 63 68 6f 20 43 6c 65 61 6e 69 6e 67 20 24 28 57  cho Cleaning $(W
d920: 49 4e 5f 44 49 52 29 5c 76 65 72 73 69 6f 6e 73  IN_DIR)\versions
d930: 2e 76 63 2c 20 76 65 72 73 69 6f 6e 2e 76 63 20  .vc, version.vc 
d940: 2e 2e 2e 0a 09 40 69 66 20 65 78 69 73 74 20 24  .....@if exist $
d950: 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 73 69 6f  (WIN_DIR)\versio
d960: 6e 73 2e 76 63 20 64 65 6c 20 24 28 57 49 4e 5f  ns.vc del $(WIN_
d970: 44 49 52 29 5c 76 65 72 73 69 6f 6e 73 2e 76 63  DIR)\versions.vc
d980: 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 57 49  ..@if exist $(WI
d990: 4e 5f 44 49 52 29 5c 76 65 72 73 69 6f 6e 2e 76  N_DIR)\version.v
d9a0: 63 20 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29  c del $(WIN_DIR)
d9b0: 5c 76 65 72 73 69 6f 6e 2e 76 63 0a 0a 64 65 66  \version.vc..def
d9c0: 61 75 6c 74 2d 68 6f 73 65 3a 20 64 65 66 61 75  ault-hose: defau
d9d0: 6c 74 2d 63 6c 65 61 6e 0a 09 40 65 63 68 6f 20  lt-clean..@echo 
d9e0: 48 6f 73 69 6e 67 20 24 28 4f 55 54 5f 44 49 52  Hosing $(OUT_DIR
d9f0: 29 5c 2a 20 2e 2e 2e 0a 09 40 69 66 20 65 78 69  )\* .....@if exi
da00: 73 74 20 24 28 4f 55 54 5f 44 49 52 29 5c 6e 75  st $(OUT_DIR)\nu
da10: 6c 20 24 28 52 4d 44 49 52 29 20 24 28 4f 55 54  l $(RMDIR) $(OUT
da20: 5f 44 49 52 29 0a 0a 23 20 4f 6e 6c 79 20 66 6f  _DIR)..# Only fo
da30: 72 20 62 61 63 6b 77 61 72 64 20 63 6f 6d 70 61  r backward compa
da40: 74 69 62 69 6c 69 74 79 0a 64 65 66 61 75 6c 74  tibility.default
da50: 2d 64 69 73 74 63 6c 65 61 6e 3a 20 64 65 66 61  -distclean: defa
da60: 75 6c 74 2d 68 6f 73 65 0a 0a 64 65 66 61 75 6c  ult-hose..defaul
da70: 74 2d 73 65 74 75 70 3a 0a 09 40 69 66 20 6e 6f  t-setup:..@if no
da80: 74 20 65 78 69 73 74 20 24 28 4f 55 54 5f 44 49  t exist $(OUT_DI
da90: 52 29 5c 6e 75 6c 20 6d 6b 64 69 72 20 24 28 4f  R)\nul mkdir $(O
daa0: 55 54 5f 44 49 52 29 0a 09 40 69 66 20 6e 6f 74  UT_DIR)..@if not
dab0: 20 65 78 69 73 74 20 24 28 54 4d 50 5f 44 49 52   exist $(TMP_DIR
dac0: 29 5c 6e 75 6c 20 6d 6b 64 69 72 20 24 28 54 4d  )\nul mkdir $(TM
dad0: 50 5f 44 49 52 29 0a 0a 21 69 66 20 22 24 28 54  P_DIR)..!if "$(T
dae0: 45 53 54 50 41 54 29 22 20 21 3d 20 22 22 0a 54  ESTPAT)" != "".T
daf0: 45 53 54 46 4c 41 47 53 20 3d 20 24 28 54 45 53  ESTFLAGS = $(TES
db00: 54 46 4c 41 47 53 29 20 2d 66 69 6c 65 20 24 28  TFLAGS) -file $(
db10: 54 45 53 54 50 41 54 29 0a 21 65 6e 64 69 66 0a  TESTPAT).!endif.
db20: 0a 64 65 66 61 75 6c 74 2d 74 65 73 74 3a 20 64  .default-test: d
db30: 65 66 61 75 6c 74 2d 73 65 74 75 70 20 24 28 50  efault-setup $(P
db40: 52 4f 4a 45 43 54 29 0a 09 40 73 65 74 20 54 43  ROJECT)..@set TC
db50: 4c 4c 49 42 50 41 54 48 3d 24 28 4f 55 54 5f 44  LLIBPATH=$(OUT_D
db60: 49 52 3a 5c 3d 2f 29 0a 09 40 69 66 20 65 78 69  IR:\=/)..@if exi
db70: 73 74 20 24 28 4c 49 42 44 49 52 29 20 66 6f 72  st $(LIBDIR) for
db80: 20 25 66 20 69 6e 20 28 22 24 28 4c 49 42 44 49   %f in ("$(LIBDI
db90: 52 29 5c 2a 2e 74 63 6c 22 29 20 64 6f 20 40 24  R)\*.tcl") do @$
dba0: 28 43 4f 50 59 29 20 25 66 20 22 24 28 4f 55 54  (COPY) %f "$(OUT
dbb0: 5f 44 49 52 29 22 0a 09 63 64 20 22 24 28 54 45  _DIR)"..cd "$(TE
dbc0: 53 54 44 49 52 29 22 20 26 26 20 24 28 44 45 42  STDIR)" && $(DEB
dbd0: 55 47 47 45 52 29 20 24 28 54 43 4c 53 48 29 20  UGGER) $(TCLSH) 
dbe0: 61 6c 6c 2e 74 63 6c 20 24 28 54 45 53 54 46 4c  all.tcl $(TESTFL
dbf0: 41 47 53 29 0a 0a 64 65 66 61 75 6c 74 2d 73 68  AGS)..default-sh
dc00: 65 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 73 65 74  ell: default-set
dc10: 75 70 20 24 28 50 52 4f 4a 45 43 54 29 0a 09 40  up $(PROJECT)..@
dc20: 73 65 74 20 54 43 4c 4c 49 42 50 41 54 48 3d 24  set TCLLIBPATH=$
dc30: 28 4f 55 54 5f 44 49 52 3a 5c 3d 2f 29 0a 09 40  (OUT_DIR:\=/)..@
dc40: 69 66 20 65 78 69 73 74 20 24 28 4c 49 42 44 49  if exist $(LIBDI
dc50: 52 29 20 66 6f 72 20 25 66 20 69 6e 20 28 22 24  R) for %f in ("$
dc60: 28 4c 49 42 44 49 52 29 5c 2a 2e 74 63 6c 22 29  (LIBDIR)\*.tcl")
dc70: 20 64 6f 20 40 24 28 43 4f 50 59 29 20 25 66 20   do @$(COPY) %f 
dc80: 22 24 28 4f 55 54 5f 44 49 52 29 22 0a 09 24 28  "$(OUT_DIR)"..$(
dc90: 44 45 42 55 47 47 45 52 29 20 24 28 54 43 4c 53  DEBUGGER) $(TCLS
dca0: 48 29 0a 0a 23 20 47 65 6e 65 72 61 74 69 6f 6e  H)..# Generation
dcb0: 20 6f 66 20 57 69 6e 64 6f 77 73 20 76 65 72 73   of Windows vers
dcc0: 69 6f 6e 20 72 65 73 6f 75 72 63 65 0a 21 69 66  ion resource.!if
dcd0: 64 65 66 20 52 43 46 49 4c 45 0a 0a 23 20 4e 6f  def RCFILE..# No
dce0: 74 65 3a 20 64 6f 6e 27 74 20 75 73 65 20 24 2a  te: don't use $*
dcf0: 2a 20 69 6e 20 62 65 6c 6f 77 20 72 75 6c 65 20  * in below rule 
dd00: 62 65 63 61 75 73 65 20 74 68 65 72 65 20 6d 61  because there ma
dd10: 79 20 62 65 20 6f 74 68 65 72 20 64 65 70 65 6e  y be other depen
dd20: 64 65 6e 63 69 65 73 0a 23 20 61 6e 64 20 6f 6e  dencies.# and on
dd30: 6c 79 20 74 68 65 20 22 6d 61 69 6e 22 20 72 63  ly the "main" rc
dd40: 20 6d 75 73 74 20 62 65 20 70 61 73 73 65 64 20   must be passed 
dd50: 74 6f 20 74 68 65 20 72 65 73 6f 75 72 63 65 20  to the resource 
dd60: 63 6f 6d 70 69 6c 65 72 0a 24 28 54 4d 50 5f 44  compiler.$(TMP_D
dd70: 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72  IR)\$(PROJECT).r
dd80: 65 73 3a 20 24 28 52 43 44 49 52 29 5c 24 28 50  es: $(RCDIR)\$(P
dd90: 52 4f 4a 45 43 54 29 2e 72 63 0a 09 24 28 52 45  ROJECT).rc..$(RE
dda0: 53 43 4d 44 29 20 24 28 52 43 44 49 52 29 5c 24  SCMD) $(RCDIR)\$
ddb0: 28 50 52 4f 4a 45 43 54 29 2e 72 63 0a 0a 21 65  (PROJECT).rc..!e
ddc0: 6c 73 65 0a 0a 23 20 49 66 20 70 61 72 65 6e 74  lse..# If parent
ddd0: 20 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 6e 6f   makefile has no
dde0: 74 20 64 65 66 69 6e 65 64 20 61 20 72 65 73 6f  t defined a reso
ddf0: 75 72 63 65 20 64 65 66 69 6e 69 74 69 6f 6e 20  urce definition 
de00: 66 69 6c 65 2c 0a 23 20 77 65 20 77 69 6c 6c 20  file,.# we will 
de10: 67 65 6e 65 72 61 74 65 20 6f 6e 65 20 66 72 6f  generate one fro
de20: 6d 20 73 74 61 6e 64 61 72 64 20 74 65 6d 70 6c  m standard templ
de30: 61 74 65 2e 0a 24 28 54 4d 50 5f 44 49 52 29 5c  ate..$(TMP_DIR)\
de40: 24 28 50 52 4f 4a 45 43 54 29 2e 72 65 73 3a 20  $(PROJECT).res: 
de50: 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 50 52 4f  $(TMP_DIR)\$(PRO
de60: 4a 45 43 54 29 2e 72 63 0a 0a 24 28 54 4d 50 5f  JECT).rc..$(TMP_
de70: 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e  DIR)\$(PROJECT).
de80: 72 63 3a 0a 09 40 24 28 43 4f 50 59 29 20 3c 3c  rc:..@$(COPY) <<
de90: 20 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 50 52   $(TMP_DIR)\$(PR
dea0: 4f 4a 45 43 54 29 2e 72 63 0a 23 69 6e 63 6c 75  OJECT).rc.#inclu
deb0: 64 65 20 3c 77 69 6e 76 65 72 2e 68 3e 0a 0a 56  de <winver.h>..V
dec0: 53 5f 56 45 52 53 49 4f 4e 5f 49 4e 46 4f 20 56  S_VERSION_INFO V
ded0: 45 52 53 49 4f 4e 49 4e 46 4f 0a 20 46 49 4c 45  ERSIONINFO. FILE
dee0: 56 45 52 53 49 4f 4e 09 43 4f 4d 4d 41 56 45 52  VERSION.COMMAVER
def0: 53 49 4f 4e 0a 20 50 52 4f 44 55 43 54 56 45 52  SION. PRODUCTVER
df00: 53 49 4f 4e 09 43 4f 4d 4d 41 56 45 52 53 49 4f  SION.COMMAVERSIO
df10: 4e 0a 20 46 49 4c 45 46 4c 41 47 53 4d 41 53 4b  N. FILEFLAGSMASK
df20: 09 30 78 33 66 4c 0a 23 69 66 64 65 66 20 44 45  .0x3fL.#ifdef DE
df30: 42 55 47 0a 20 46 49 4c 45 46 4c 41 47 53 09 56  BUG. FILEFLAGS.V
df40: 53 5f 46 46 5f 44 45 42 55 47 0a 23 65 6c 73 65  S_FF_DEBUG.#else
df50: 0a 20 46 49 4c 45 46 4c 41 47 53 09 30 78 30 4c  . FILEFLAGS.0x0L
df60: 0a 23 65 6e 64 69 66 0a 20 46 49 4c 45 4f 53 09  .#endif. FILEOS.
df70: 09 56 4f 53 5f 4e 54 5f 57 49 4e 44 4f 57 53 33  .VOS_NT_WINDOWS3
df80: 32 0a 20 46 49 4c 45 54 59 50 45 09 56 46 54 5f  2. FILETYPE.VFT_
df90: 44 4c 4c 0a 20 46 49 4c 45 53 55 42 54 59 50 45  DLL. FILESUBTYPE
dfa0: 09 30 78 30 4c 0a 42 45 47 49 4e 0a 20 20 20 20  .0x0L.BEGIN.    
dfb0: 42 4c 4f 43 4b 20 22 53 74 72 69 6e 67 46 69 6c  BLOCK "StringFil
dfc0: 65 49 6e 66 6f 22 0a 20 20 20 20 42 45 47 49 4e  eInfo".    BEGIN
dfd0: 0a 20 20 20 20 20 20 20 20 42 4c 4f 43 4b 20 22  .        BLOCK "
dfe0: 30 34 30 39 30 34 62 30 22 0a 20 20 20 20 20 20  040904b0".      
dff0: 20 20 42 45 47 49 4e 0a 20 20 20 20 20 20 20 20    BEGIN.        
e000: 20 20 20 20 56 41 4c 55 45 20 22 46 69 6c 65 44      VALUE "FileD
e010: 65 73 63 72 69 70 74 69 6f 6e 22 2c 20 20 22 54  escription",  "T
e020: 63 6c 20 65 78 74 65 6e 73 69 6f 6e 20 22 20 50  cl extension " P
e030: 52 4f 4a 45 43 54 0a 20 20 20 20 20 20 20 20 20  ROJECT.         
e040: 20 20 20 56 41 4c 55 45 20 22 4f 72 69 67 69 6e     VALUE "Origin
e050: 61 6c 46 69 6c 65 6e 61 6d 65 22 2c 20 50 52 4a  alFilename", PRJ
e060: 4c 49 42 4e 41 4d 45 0a 20 20 20 20 20 20 20 20  LIBNAME.        
e070: 20 20 20 20 56 41 4c 55 45 20 22 46 69 6c 65 56      VALUE "FileV
e080: 65 72 73 69 6f 6e 22 2c 20 20 20 20 20 20 44 4f  ersion",      DO
e090: 54 56 45 52 53 49 4f 4e 0a 20 20 20 20 20 20 20  TVERSION.       
e0a0: 20 20 20 20 20 56 41 4c 55 45 20 22 50 72 6f 64       VALUE "Prod
e0b0: 75 63 74 4e 61 6d 65 22 2c 20 20 20 20 20 20 22  uctName",      "
e0c0: 50 61 63 6b 61 67 65 20 22 20 50 52 4f 4a 45 43  Package " PROJEC
e0d0: 54 20 22 20 66 6f 72 20 54 63 6c 22 0a 20 20 20  T " for Tcl".   
e0e0: 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 20 22           VALUE "
e0f0: 50 72 6f 64 75 63 74 56 65 72 73 69 6f 6e 22 2c  ProductVersion",
e100: 20 20 20 44 4f 54 56 45 52 53 49 4f 4e 0a 20 20     DOTVERSION.  
e110: 20 20 20 20 20 20 45 4e 44 0a 20 20 20 20 45 4e        END.    EN
e120: 44 0a 20 20 20 20 42 4c 4f 43 4b 20 22 56 61 72  D.    BLOCK "Var
e130: 46 69 6c 65 49 6e 66 6f 22 0a 20 20 20 20 42 45  FileInfo".    BE
e140: 47 49 4e 0a 20 20 20 20 20 20 20 20 56 41 4c 55  GIN.        VALU
e150: 45 20 22 54 72 61 6e 73 6c 61 74 69 6f 6e 22 2c  E "Translation",
e160: 20 30 78 34 30 39 2c 20 31 32 30 30 0a 20 20 20   0x409, 1200.   
e170: 20 45 4e 44 0a 45 4e 44 0a 0a 3c 3c 0a 0a 21 65   END.END..<<..!e
e180: 6e 64 69 66 20 23 20 69 66 64 65 66 20 52 43 46  ndif # ifdef RCF
e190: 49 4c 45 0a 0a 21 69 66 6e 64 65 66 20 44 49 53  ILE..!ifndef DIS
e1a0: 41 42 4c 45 5f 49 4d 50 4c 49 43 49 54 5f 52 55  ABLE_IMPLICIT_RU
e1b0: 4c 45 53 0a 44 49 53 41 42 4c 45 5f 49 4d 50 4c  LES.DISABLE_IMPL
e1c0: 49 43 49 54 5f 52 55 4c 45 53 20 3d 20 30 0a 21  ICIT_RULES = 0.!
e1d0: 65 6e 64 69 66 0a 0a 21 69 66 20 21 24 28 44 49  endif..!if !$(DI
e1e0: 53 41 42 4c 45 5f 49 4d 50 4c 49 43 49 54 5f 52  SABLE_IMPLICIT_R
e1f0: 55 4c 45 53 29 0a 23 20 49 6d 70 6c 69 63 69 74  ULES).# Implicit
e200: 20 72 75 6c 65 20 64 65 66 69 6e 69 74 69 6f 6e   rule definition
e210: 73 20 2d 20 6f 6e 6c 79 20 66 6f 72 20 62 75 69  s - only for bui
e220: 6c 64 69 6e 67 20 6c 69 62 72 61 72 79 20 6f 62  lding library ob
e230: 6a 65 63 74 73 2e 20 46 6f 72 20 73 74 75 62 73  jects. For stubs
e240: 20 61 6e 64 0a 23 20 6d 61 69 6e 20 61 70 70 6c   and.# main appl
e250: 69 63 61 74 69 6f 6e 2c 20 74 68 65 20 6d 61 6b  ication, the mak
e260: 65 66 69 6c 65 20 73 68 6f 75 6c 64 20 64 65 66  efile should def
e270: 69 6e 65 20 65 78 70 6c 69 63 69 74 20 72 75 6c  ine explicit rul
e280: 65 73 2e 0a 0a 7b 24 28 52 4f 4f 54 29 7d 2e 63  es...{$(ROOT)}.c
e290: 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 6f 62 6a  {$(TMP_DIR)}.obj
e2a0: 3a 3a 0a 09 24 28 43 43 50 4b 47 43 4d 44 29 20  ::..$(CCPKGCMD) 
e2b0: 40 3c 3c 0a 24 3c 0a 3c 3c 0a 0a 7b 24 28 57 49  @<<.$<.<<..{$(WI
e2c0: 4e 5f 44 49 52 29 7d 2e 63 7b 24 28 54 4d 50 5f  N_DIR)}.c{$(TMP_
e2d0: 44 49 52 29 7d 2e 6f 62 6a 3a 3a 0a 09 24 28 43  DIR)}.obj::..$(C
e2e0: 43 50 4b 47 43 4d 44 29 20 40 3c 3c 0a 24 3c 0a  CPKGCMD) @<<.$<.
e2f0: 3c 3c 0a 0a 7b 24 28 47 45 4e 45 52 49 43 44 49  <<..{$(GENERICDI
e300: 52 29 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29  R)}.c{$(TMP_DIR)
e310: 7d 2e 6f 62 6a 3a 3a 0a 09 24 28 43 43 50 4b 47  }.obj::..$(CCPKG
e320: 43 4d 44 29 20 40 3c 3c 0a 24 3c 0a 3c 3c 0a 0a  CMD) @<<.$<.<<..
e330: 7b 24 28 43 4f 4d 50 41 54 44 49 52 29 7d 2e 63  {$(COMPATDIR)}.c
e340: 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 6f 62 6a  {$(TMP_DIR)}.obj
e350: 3a 3a 0a 09 24 28 43 43 50 4b 47 43 4d 44 29 20  ::..$(CCPKGCMD) 
e360: 40 3c 3c 0a 24 3c 0a 3c 3c 0a 0a 7b 24 28 52 43  @<<.$<.<<..{$(RC
e370: 44 49 52 29 7d 2e 72 63 7b 24 28 54 4d 50 5f 44  DIR)}.rc{$(TMP_D
e380: 49 52 29 7d 2e 72 65 73 3a 0a 09 24 28 52 45 53  IR)}.res:..$(RES
e390: 43 4d 44 29 20 24 3c 0a 0a 7b 24 28 57 49 4e 5f  CMD) $<..{$(WIN_
e3a0: 44 49 52 29 7d 2e 72 63 7b 24 28 54 4d 50 5f 44  DIR)}.rc{$(TMP_D
e3b0: 49 52 29 7d 2e 72 65 73 3a 0a 09 24 28 52 45 53  IR)}.res:..$(RES
e3c0: 43 4d 44 29 20 24 3c 0a 0a 7b 24 28 54 4d 50 5f  CMD) $<..{$(TMP_
e3d0: 44 49 52 29 7d 2e 72 63 7b 24 28 54 4d 50 5f 44  DIR)}.rc{$(TMP_D
e3e0: 49 52 29 7d 2e 72 65 73 3a 0a 09 24 28 52 45 53  IR)}.res:..$(RES
e3f0: 43 4d 44 29 20 24 3c 0a 0a 2e 53 55 46 46 49 58  CMD) $<...SUFFIX
e400: 45 53 3a 0a 2e 53 55 46 46 49 58 45 53 3a 2e 63  ES:..SUFFIXES:.c
e410: 20 2e 72 63 0a 0a 21 65 6e 64 69 66 0a 0a 23 23   .rc..!endif..##
e420: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e430: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e440: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
e450: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 23  ##############.#
e460: 20 31 34 2e 20 53 61 6e 69 74 79 20 63 68 65 63   14. Sanity chec
e470: 6b 20 73 65 6c 65 63 74 65 64 20 6f 70 74 69 6f  k selected optio
e480: 6e 73 20 61 67 61 69 6e 73 74 20 54 63 6c 20 62  ns against Tcl b
e490: 75 69 6c 64 20 6f 70 74 69 6f 6e 73 0a 23 20 57  uild options.# W
e4a0: 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 61 6e 20  hen building an 
e4b0: 65 78 74 65 6e 73 69 6f 6e 2c 20 63 65 72 74 61  extension, certa
e4c0: 69 6e 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e  in configuration
e4d0: 20 6f 70 74 69 6f 6e 73 20 73 68 6f 75 6c 64 0a   options should.
e4e0: 23 20 6d 61 74 63 68 20 74 68 65 20 6f 6e 65 73  # match the ones
e4f0: 20 75 73 65 64 20 77 68 65 6e 20 54 63 6c 20 77   used when Tcl w
e500: 61 73 20 62 75 69 6c 74 2e 20 48 65 72 65 20 77  as built. Here w
e510: 65 20 63 68 65 63 6b 20 61 6e 64 0a 23 20 77 61  e check and.# wa
e520: 72 6e 20 6f 6e 20 61 20 6d 69 73 6d 61 74 63 68  rn on a mismatch
e530: 2e 0a 21 69 66 20 21 24 28 44 4f 49 4e 47 5f 54  ..!if !$(DOING_T
e540: 43 4c 29 0a 0a 21 69 66 20 24 28 54 43 4c 49 4e  CL)..!if $(TCLIN
e550: 53 54 41 4c 4c 29 20 23 20 42 75 69 6c 64 69 6e  STALL) # Buildin
e560: 67 20 61 67 61 69 6e 73 74 20 61 6e 20 69 6e 73  g against an ins
e570: 74 61 6c 6c 65 64 20 54 63 6c 0a 21 69 66 20 65  talled Tcl.!if e
e580: 78 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29  xist("$(_TCLDIR)
e590: 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 74 63 6c 2e 6e  \lib\nmake\tcl.n
e5a0: 6d 61 6b 65 22 29 0a 54 43 4c 4e 4d 41 4b 45 43  make").TCLNMAKEC
e5b0: 4f 4e 46 49 47 20 3d 20 22 24 28 5f 54 43 4c 44  ONFIG = "$(_TCLD
e5c0: 49 52 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 74 63  IR)\lib\nmake\tc
e5d0: 6c 2e 6e 6d 61 6b 65 22 0a 21 65 6e 64 69 66 0a  l.nmake".!endif.
e5e0: 21 65 6c 73 65 20 23 20 21 24 28 54 43 4c 49 4e  !else # !$(TCLIN
e5f0: 53 54 41 4c 4c 29 20 2d 20 62 75 69 6c 64 69 6e  STALL) - buildin
e600: 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 73 6f  g against Tcl so
e610: 75 72 63 65 0a 21 69 66 20 65 78 69 73 74 28 22  urce.!if exist("
e620: 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24  $(_TCLDIR)\win\$
e630: 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63  (BUILDDIRTOP)\tc
e640: 6c 2e 6e 6d 61 6b 65 22 29 0a 54 43 4c 4e 4d 41  l.nmake").TCLNMA
e650: 4b 45 43 4f 4e 46 49 47 09 3d 20 22 24 28 5f 54  KECONFIG.= "$(_T
e660: 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49  CLDIR)\win\$(BUI
e670: 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 2e 6e 6d  LDDIRTOP)\tcl.nm
e680: 61 6b 65 22 0a 21 65 6e 64 69 66 0a 21 65 6e 64  ake".!endif.!end
e690: 69 66 20 23 20 54 43 4c 49 4e 53 54 41 4c 4c 0a  if # TCLINSTALL.
e6a0: 0a 21 69 66 20 24 28 43 4f 4e 46 49 47 5f 43 48  .!if $(CONFIG_CH
e6b0: 45 43 4b 29 0a 21 69 66 64 65 66 20 54 43 4c 4e  ECK).!ifdef TCLN
e6c0: 4d 41 4b 45 43 4f 4e 46 49 47 0a 21 69 6e 63 6c  MAKECONFIG.!incl
e6d0: 75 64 65 20 24 28 54 43 4c 4e 4d 41 4b 45 43 4f  ude $(TCLNMAKECO
e6e0: 4e 46 49 47 29 0a 0a 21 69 66 20 64 65 66 69 6e  NFIG)..!if defin
e6f0: 65 64 28 43 4f 52 45 5f 4d 41 43 48 49 4e 45 29  ed(CORE_MACHINE)
e700: 20 26 26 20 22 24 28 43 4f 52 45 5f 4d 41 43 48   && "$(CORE_MACH
e710: 49 4e 45 29 22 20 21 3d 20 22 24 28 4d 41 43 48  INE)" != "$(MACH
e720: 49 4e 45 29 22 0a 21 65 72 72 6f 72 20 45 52 52  INE)".!error ERR
e730: 4f 52 3a 20 42 75 69 6c 64 20 74 61 72 67 65 74  OR: Build target
e740: 20 28 24 28 4d 41 43 48 49 4e 45 29 29 20 64 6f   ($(MACHINE)) do
e750: 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 74 68 65  es not match the
e760: 20 54 63 6c 20 6c 69 62 72 61 72 79 20 61 72 63   Tcl library arc
e770: 68 69 74 65 63 74 75 72 65 20 28 24 28 43 4f 52  hitecture ($(COR
e780: 45 5f 4d 41 43 48 49 4e 45 29 29 2e 0a 21 65 6e  E_MACHINE))..!en
e790: 64 69 66 0a 21 69 66 20 24 28 54 43 4c 5f 56 45  dif.!if $(TCL_VE
e7a0: 52 53 49 4f 4e 29 20 3c 20 38 37 20 26 26 20 64  RSION) < 87 && d
e7b0: 65 66 69 6e 65 64 28 43 4f 52 45 5f 55 53 45 5f  efined(CORE_USE_
e7c0: 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 20 26 26  THREAD_ALLOC) &&
e7d0: 20 24 28 43 4f 52 45 5f 55 53 45 5f 54 48 52 45   $(CORE_USE_THRE
e7e0: 41 44 5f 41 4c 4c 4f 43 29 20 21 3d 20 24 28 55  AD_ALLOC) != $(U
e7f0: 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29  SE_THREAD_ALLOC)
e800: 0a 21 6d 65 73 73 61 67 65 20 57 41 52 4e 49 4e  .!message WARNIN
e810: 47 3a 20 56 61 6c 75 65 20 6f 66 20 55 53 45 5f  G: Value of USE_
e820: 54 48 52 45 41 44 5f 41 4c 4c 4f 43 20 28 24 28  THREAD_ALLOC ($(
e830: 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43  USE_THREAD_ALLOC
e840: 29 29 20 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63  )) does not matc
e850: 68 20 69 74 73 20 54 63 6c 20 63 6f 72 65 20 76  h its Tcl core v
e860: 61 6c 75 65 20 28 24 28 43 4f 52 45 5f 55 53 45  alue ($(CORE_USE
e870: 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 29 2e  _THREAD_ALLOC)).
e880: 0a 21 65 6e 64 69 66 0a 21 69 66 20 64 65 66 69  .!endif.!if defi
e890: 6e 65 64 28 43 4f 52 45 5f 44 45 42 55 47 29 20  ned(CORE_DEBUG) 
e8a0: 26 26 20 24 28 43 4f 52 45 5f 44 45 42 55 47 29  && $(CORE_DEBUG)
e8b0: 20 21 3d 20 24 28 44 45 42 55 47 29 0a 21 6d 65   != $(DEBUG).!me
e8c0: 73 73 61 67 65 20 57 41 52 4e 49 4e 47 3a 20 56  ssage WARNING: V
e8d0: 61 6c 75 65 20 6f 66 20 44 45 42 55 47 20 28 24  alue of DEBUG ($
e8e0: 28 44 45 42 55 47 29 29 20 64 6f 65 73 20 6e 6f  (DEBUG)) does no
e8f0: 74 20 6d 61 74 63 68 20 69 74 73 20 54 63 6c 20  t match its Tcl 
e900: 6c 69 62 72 61 72 79 20 63 6f 6e 66 69 67 75 72  library configur
e910: 61 74 69 6f 6e 20 28 24 28 44 45 42 55 47 29 29  ation ($(DEBUG))
e920: 2e 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a  ..!endif.!endif.
e930: 0a 21 65 6e 64 69 66 20 23 20 54 43 4c 4e 4d 41  .!endif # TCLNMA
e940: 4b 45 43 4f 4e 46 49 47 0a 0a 21 65 6e 64 69 66  KECONFIG..!endif
e950: 20 23 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29   # !$(DOING_TCL)
e960: 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ...#------------
e970: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
e980: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
e990: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
e9a0: 20 44 69 73 70 6c 61 79 20 73 74 61 74 73 20 62   Display stats b
e9b0: 65 69 6e 67 20 75 73 65 64 2e 0a 23 2d 2d 2d 2d  eing used..#----
e9c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
e9d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
e9e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
e9f0: 2d 2d 2d 2d 2d 2d 0a 0a 21 69 66 20 21 24 28 44  ------..!if !$(D
ea00: 4f 49 4e 47 5f 54 43 4c 29 0a 21 6d 65 73 73 61  OING_TCL).!messa
ea10: 67 65 20 2a 2a 2a 20 42 75 69 6c 64 69 6e 67 20  ge *** Building 
ea20: 61 67 61 69 6e 73 74 20 54 63 6c 20 61 74 20 27  against Tcl at '
ea30: 24 28 5f 54 43 4c 44 49 52 29 27 0a 21 65 6e 64  $(_TCLDIR)'.!end
ea40: 69 66 0a 21 69 66 20 21 24 28 44 4f 49 4e 47 5f  if.!if !$(DOING_
ea50: 54 4b 29 20 26 26 20 24 28 4e 45 45 44 5f 54 4b  TK) && $(NEED_TK
ea60: 29 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 42  ).!message *** B
ea70: 75 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20  uilding against 
ea80: 54 6b 20 61 74 20 27 24 28 5f 54 4b 44 49 52 29  Tk at '$(_TKDIR)
ea90: 27 0a 21 65 6e 64 69 66 0a 21 6d 65 73 73 61 67  '.!endif.!messag
eaa0: 65 20 2a 2a 2a 20 49 6e 74 65 72 6d 65 64 69 61  e *** Intermedia
eab0: 74 65 20 64 69 72 65 63 74 6f 72 79 20 77 69 6c  te directory wil
eac0: 6c 20 62 65 20 27 24 28 54 4d 50 5f 44 49 52 29  l be '$(TMP_DIR)
ead0: 27 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 4f  '.!message *** O
eae0: 75 74 70 75 74 20 64 69 72 65 63 74 6f 72 79 20  utput directory 
eaf0: 77 69 6c 6c 20 62 65 20 27 24 28 4f 55 54 5f 44  will be '$(OUT_D
eb00: 49 52 29 27 0a 21 6d 65 73 73 61 67 65 20 2a 2a  IR)'.!message **
eb10: 2a 20 49 6e 73 74 61 6c 6c 61 74 69 6f 6e 2c 20  * Installation, 
eb20: 69 66 20 73 65 6c 65 63 74 65 64 2c 20 77 69 6c  if selected, wil
eb30: 6c 20 62 65 20 69 6e 20 27 24 28 5f 49 4e 53 54  l be in '$(_INST
eb40: 41 4c 4c 44 49 52 29 27 0a 21 6d 65 73 73 61 67  ALLDIR)'.!messag
eb50: 65 20 2a 2a 2a 20 53 75 66 66 69 78 20 66 6f 72  e *** Suffix for
eb60: 20 62 69 6e 61 72 69 65 73 20 77 69 6c 6c 20 62   binaries will b
eb70: 65 20 27 24 28 53 55 46 58 29 27 0a 21 6d 65 73  e '$(SUFX)'.!mes
eb80: 73 61 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c 65  sage *** Compile
eb90: 72 20 76 65 72 73 69 6f 6e 20 24 28 56 43 56 45  r version $(VCVE
eba0: 52 29 2e 20 54 61 72 67 65 74 20 24 28 4d 41 43  R). Target $(MAC
ebb0: 48 49 4e 45 29 2c 20 68 6f 73 74 20 24 28 4e 41  HINE), host $(NA
ebc0: 54 49 56 45 5f 41 52 43 48 29 2e 0a 0a 21 65 6e  TIVE_ARCH)...!en
ebd0: 64 69 66 20 23 20 69 66 64 65 66 20 5f 52 55 4c  dif # ifdef _RUL
ebe0: 45 53 5f 56 43 0a                                ES_VC.