Hex Artifact Content

Artifact ab1ceae056fc2e51038a357c6f7ab89363ef3167037950444e6c7e03e4c08ffc:


0000: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 2d  -------------- -
0040: 2a 2d 20 6d 61 6b 65 66 69 6c 65 20 2d 2a 2d 0d  *- makefile -*-.
0050: 0a 23 20 72 75 6c 65 73 2e 76 63 20 2d 2d 0d 0a  .# rules.vc --..
0060: 23 0d 0a 23 20 50 61 72 74 20 6f 66 20 74 68 65  #..# Part of the
0070: 20 6e 6d 61 6b 65 20 62 61 73 65 64 20 62 75 69   nmake based bui
0080: 6c 64 20 73 79 73 74 65 6d 20 66 6f 72 20 54 63  ld system for Tc
0090: 6c 20 61 6e 64 20 69 74 73 20 65 78 74 65 6e 73  l and its extens
00a0: 69 6f 6e 73 2e 0d 0a 23 20 54 68 69 73 20 66 69  ions...# This fi
00b0: 6c 65 20 64 6f 65 73 20 61 6c 6c 20 74 68 65 20  le does all the 
00c0: 68 61 72 64 20 77 6f 72 6b 20 69 6e 20 74 65 72  hard work in ter
00d0: 6d 73 20 6f 66 20 70 61 72 73 69 6e 67 20 62 75  ms of parsing bu
00e0: 69 6c 64 20 6f 70 74 69 6f 6e 73 2c 0d 0a 23 20  ild options,..# 
00f0: 63 6f 6d 70 69 6c 65 72 20 73 77 69 74 63 68 65  compiler switche
0100: 73 2c 20 64 65 66 69 6e 69 6e 67 20 63 6f 6d 6d  s, defining comm
0110: 6f 6e 20 74 61 72 67 65 74 73 20 61 6e 64 20 6d  on targets and m
0120: 61 63 72 6f 73 2e 20 54 68 65 20 54 63 6c 20 6d  acros. The Tcl m
0130: 61 6b 65 66 69 6c 65 0d 0a 23 20 64 69 72 65 63  akefile..# direc
0140: 74 6c 79 20 69 6e 63 6c 75 64 65 73 20 74 68 69  tly includes thi
0150: 73 2e 20 45 78 74 65 6e 73 69 6f 6e 73 20 69 6e  s. Extensions in
0160: 63 6c 75 64 65 20 69 74 20 76 69 61 20 22 72 75  clude it via "ru
0170: 6c 65 73 2d 65 78 74 2e 76 63 22 2e 0d 0a 23 0d  les-ext.vc"...#.
0180: 0a 23 20 53 65 65 20 54 49 50 20 34 37 37 20 28  .# See TIP 477 (
0190: 68 74 74 70 73 3a 2f 2f 63 6f 72 65 2e 74 63 6c  https://core.tcl
01a0: 2d 6c 61 6e 67 2e 6f 72 67 2f 74 69 70 73 2f 64  -lang.org/tips/d
01b0: 6f 63 2f 6d 61 69 6e 2f 74 69 70 2f 34 37 37 2e  oc/main/tip/477.
01c0: 6d 64 29 20 66 6f 72 0d 0a 23 20 64 65 74 61 69  md) for..# detai
01d0: 6c 65 64 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f  led documentatio
01e0: 6e 2e 0d 0a 23 0d 0a 23 20 53 65 65 20 74 68 65  n...#..# See the
01f0: 20 66 69 6c 65 20 22 6c 69 63 65 6e 73 65 2e 74   file "license.t
0200: 65 72 6d 73 22 20 66 6f 72 20 69 6e 66 6f 72 6d  erms" for inform
0210: 61 74 69 6f 6e 20 6f 6e 20 75 73 61 67 65 20 61  ation on usage a
0220: 6e 64 20 72 65 64 69 73 74 72 69 62 75 74 69 6f  nd redistributio
0230: 6e 0d 0a 23 20 6f 66 20 74 68 69 73 20 66 69 6c  n..# of this fil
0240: 65 2c 20 61 6e 64 20 66 6f 72 20 61 20 44 49 53  e, and for a DIS
0250: 43 4c 41 49 4d 45 52 20 4f 46 20 41 4c 4c 20 57  CLAIMER OF ALL W
0260: 41 52 52 41 4e 54 49 45 53 2e 0d 0a 23 0d 0a 23  ARRANTIES...#..#
0270: 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32   Copyright (c) 2
0280: 30 30 31 2d 32 30 30 33 20 44 61 76 69 64 20 47  001-2003 David G
0290: 72 61 76 65 72 65 61 75 78 2e 0d 0a 23 20 43 6f  ravereaux...# Co
02a0: 70 79 72 69 67 68 74 20 28 63 29 20 32 30 30 33  pyright (c) 2003
02b0: 2d 32 30 30 38 20 50 61 74 72 69 63 6b 20 54 68  -2008 Patrick Th
02c0: 6f 79 74 73 0d 0a 23 20 43 6f 70 79 72 69 67 68  oyts..# Copyrigh
02d0: 74 20 28 63 29 20 32 30 31 37 20 20 20 20 20 20  t (c) 2017      
02e0: 41 73 68 6f 6b 20 50 2e 20 4e 61 64 6b 61 72 6e  Ashok P. Nadkarn
02f0: 69 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  i..#------------
0300: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0310: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0320: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0330: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0340: 2d 2d 0d 0a 0d 0a 21 69 66 6e 64 65 66 20 5f 52  --....!ifndef _R
0350: 55 4c 45 53 5f 56 43 0d 0a 5f 52 55 4c 45 53 5f  ULES_VC.._RULES_
0360: 56 43 20 3d 20 31 0d 0a 0d 0a 23 20 57 65 20 6e  VC = 1....# We n
0370: 65 65 64 20 61 20 6e 6d 61 6b 65 68 6c 70 20 74  eed a nmakehlp t
0380: 68 61 74 20 77 69 6c 6c 20 72 75 6e 20 6f 6e 20  hat will run on 
0390: 74 68 65 20 68 6f 73 74 20 6d 61 63 68 69 6e 65  the host machine
03a0: 20 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20   as part of the 
03b0: 62 75 69 6c 64 2e 0d 0a 23 20 69 66 20 54 43 4c  build...# if TCL
03c0: 53 48 5f 4e 41 54 49 56 45 20 69 73 20 73 65 74  SH_NATIVE is set
03d0: 20 66 6f 72 20 63 72 6f 73 73 20 63 6f 6d 70 69   for cross compi
03e0: 6c 61 74 69 6f 6e 2c 20 77 65 27 6c 6c 20 74 72  lation, we'll tr
03f0: 79 20 74 6f 20 66 69 6e 64 20 61 6e 20 61 73 73  y to find an ass
0400: 6f 63 69 61 74 65 64 0d 0a 23 20 6e 6d 61 6b 65  ociated..# nmake
0410: 68 6c 70 2e 65 78 65 20 74 68 61 74 20 72 75 6e  hlp.exe that run
0420: 73 20 6f 6e 20 74 68 65 20 62 75 69 6c 64 20 61  s on the build a
0430: 72 63 68 69 74 65 63 74 75 72 65 2e 0d 0a 21 69  rchitecture...!i
0440: 66 64 65 66 20 54 43 4c 53 48 5f 4e 41 54 49 56  fdef TCLSH_NATIV
0450: 45 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20  E..!message *** 
0460: 55 73 69 6e 67 20 54 43 4c 53 48 5f 4e 41 54 49  Using TCLSH_NATI
0470: 56 45 3d 24 28 54 43 4c 53 48 5f 4e 41 54 49 56  VE=$(TCLSH_NATIV
0480: 45 29 0d 0a 21 69 66 6e 64 65 66 20 4e 4d 41 4b  E)..!ifndef NMAK
0490: 45 48 4c 50 5f 4e 41 54 49 56 45 0d 0a 21 69 66  EHLP_NATIVE..!if
04a0: 20 5b 24 28 54 43 4c 53 48 5f 4e 41 54 49 56 45   [$(TCLSH_NATIVE
04b0: 29 20 66 69 6e 64 5f 6e 6d 61 6b 65 68 6c 70 2e  ) find_nmakehlp.
04c0: 74 63 6c 20 24 28 54 43 4c 53 48 5f 4e 41 54 49  tcl $(TCLSH_NATI
04d0: 56 45 29 20 3e 20 66 69 6e 64 5f 6e 6d 61 6b 65  VE) > find_nmake
04e0: 68 6c 70 2e 6f 75 74 5d 0d 0a 21 65 72 72 6f 72  hlp.out]..!error
04f0: 20 54 43 4c 53 48 5f 4e 41 54 49 56 45 20 69 73   TCLSH_NATIVE is
0500: 20 73 65 74 2c 20 62 75 74 20 75 6e 61 62 6c 65   set, but unable
0510: 20 74 6f 20 66 69 6e 64 20 61 73 73 6f 63 69 61   to find associa
0520: 74 65 64 20 6e 6d 61 6b 65 68 6c 70 2e 65 78 65  ted nmakehlp.exe
0530: 20 6e 65 61 72 62 79 2e 0d 0a 21 65 6c 73 65 0d   nearby...!else.
0540: 0a 21 69 6e 63 6c 75 64 65 20 66 69 6e 64 5f 6e  .!include find_n
0550: 6d 61 6b 65 68 6c 70 2e 6f 75 74 0d 0a 21 65 6e  makehlp.out..!en
0560: 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e  dif..!endif..!en
0570: 64 69 66 0d 0a 0d 0a 21 69 66 6e 64 65 66 20 4e  dif....!ifndef N
0580: 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 0d 0a  MAKEHLP_NATIVE..
0590: 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 3d  NMAKEHLP_NATIVE=
05a0: 6e 6d 61 6b 65 68 6c 70 0d 0a 21 65 6e 64 69 66  nmakehlp..!endif
05b0: 0d 0a 0d 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77  ....# The follow
05c0: 69 6e 67 20 6d 61 63 72 6f 73 20 64 65 66 69 6e  ing macros defin
05d0: 65 20 74 68 65 20 76 65 72 73 69 6f 6e 20 6f 66  e the version of
05e0: 20 74 68 65 20 72 75 6c 65 73 2e 76 63 20 6e 6d   the rules.vc nm
05f0: 61 6b 65 20 62 75 69 6c 64 20 73 79 73 74 65 6d  ake build system
0600: 0d 0a 23 20 46 6f 72 20 6d 6f 64 69 66 69 63 61  ..# For modifica
0610: 74 69 6f 6e 73 20 74 68 61 74 20 61 72 65 20 6e  tions that are n
0620: 6f 74 20 62 61 63 6b 77 61 72 64 2d 63 6f 6d 70  ot backward-comp
0630: 61 74 69 62 6c 65 2c 20 79 6f 75 20 2a 6d 75 73  atible, you *mus
0640: 74 2a 20 63 68 61 6e 67 65 0d 0a 23 20 74 68 65  t* change..# the
0650: 20 6d 61 6a 6f 72 20 76 65 72 73 69 6f 6e 2e 0d   major version..
0660: 0a 52 55 4c 45 53 5f 56 45 52 53 49 4f 4e 5f 4d  .RULES_VERSION_M
0670: 41 4a 4f 52 20 3d 20 31 0d 0a 52 55 4c 45 53 5f  AJOR = 1..RULES_
0680: 56 45 52 53 49 4f 4e 5f 4d 49 4e 4f 52 20 3d 20  VERSION_MINOR = 
0690: 31 39 0d 0a 0d 0a 23 20 54 68 65 20 50 52 4f 4a  19....# The PROJ
06a0: 45 43 54 20 6d 61 63 72 6f 20 6d 75 73 74 20 62  ECT macro must b
06b0: 65 20 64 65 66 69 6e 65 64 20 62 79 20 70 61 72  e defined by par
06c0: 65 6e 74 20 6d 61 6b 65 66 69 6c 65 2e 0d 0a 21  ent makefile...!
06d0: 69 66 20 22 24 28 50 52 4f 4a 45 43 54 29 22 20  if "$(PROJECT)" 
06e0: 3d 3d 20 22 22 0d 0a 21 65 72 72 6f 72 20 2a 2a  == ""..!error **
06f0: 2a 20 45 72 72 6f 72 3a 20 4d 61 63 72 6f 20 50  * Error: Macro P
0700: 52 4f 4a 45 43 54 20 6e 6f 74 20 64 65 66 69 6e  ROJECT not defin
0710: 65 64 21 20 50 6c 65 61 73 65 20 64 65 66 69 6e  ed! Please defin
0720: 65 20 69 74 20 62 65 66 6f 72 65 20 69 6e 63 6c  e it before incl
0730: 75 64 69 6e 67 20 72 75 6c 65 73 2e 76 63 0d 0a  uding rules.vc..
0740: 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 22 24  !endif....!if "$
0750: 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c  (PRJ_PACKAGE_TCL
0760: 4e 41 4d 45 29 22 20 3d 3d 20 22 22 0d 0a 50 52  NAME)" == ""..PR
0770: 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d  J_PACKAGE_TCLNAM
0780: 45 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 0d 0a  E = $(PROJECT)..
0790: 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 41 6c 73 6f  !endif....# Also
07a0: 20 73 70 65 63 69 61 6c 20 63 61 73 65 20 54 63   special case Tc
07b0: 6c 20 61 6e 64 20 54 6b 20 74 6f 20 73 61 76 65  l and Tk to save
07c0: 20 73 6f 6d 65 20 74 79 70 69 6e 67 20 6c 61 74   some typing lat
07d0: 65 72 0d 0a 44 4f 49 4e 47 5f 54 43 4c 20 3d 20  er..DOING_TCL = 
07e0: 30 0d 0a 44 4f 49 4e 47 5f 54 4b 20 20 3d 20 30  0..DOING_TK  = 0
07f0: 0d 0a 21 69 66 20 22 24 28 50 52 4f 4a 45 43 54  ..!if "$(PROJECT
0800: 29 22 20 3d 3d 20 22 74 63 6c 22 0d 0a 44 4f 49  )" == "tcl"..DOI
0810: 4e 47 5f 54 43 4c 20 3d 20 31 0d 0a 21 65 6c 73  NG_TCL = 1..!els
0820: 65 69 66 20 22 24 28 50 52 4f 4a 45 43 54 29 22  eif "$(PROJECT)"
0830: 20 3d 3d 20 22 74 6b 22 0d 0a 44 4f 49 4e 47 5f   == "tk"..DOING_
0840: 54 4b 20 3d 20 31 0d 0a 21 65 6e 64 69 66 0d 0a  TK = 1..!endif..
0850: 0d 0a 21 69 66 6e 64 65 66 20 4e 45 45 44 5f 54  ..!ifndef NEED_T
0860: 4b 0d 0a 23 20 42 61 63 6b 77 61 72 64 73 20 63  K..# Backwards c
0870: 6f 6d 70 61 74 69 62 69 6c 69 74 79 0d 0a 21 69  ompatibility..!i
0880: 66 64 65 66 20 50 52 4f 4a 45 43 54 5f 52 45 51  fdef PROJECT_REQ
0890: 55 49 52 45 53 5f 54 4b 0d 0a 4e 45 45 44 5f 54  UIRES_TK..NEED_T
08a0: 4b 20 3d 20 24 28 50 52 4f 4a 45 43 54 5f 52 45  K = $(PROJECT_RE
08b0: 51 55 49 52 45 53 5f 54 4b 29 0d 0a 21 65 6c 73  QUIRES_TK)..!els
08c0: 65 0d 0a 4e 45 45 44 5f 54 4b 20 3d 20 30 0d 0a  e..NEED_TK = 0..
08d0: 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a  !endif..!endif..
08e0: 0d 0a 21 69 66 6e 64 65 66 20 4e 45 45 44 5f 54  ..!ifndef NEED_T
08f0: 43 4c 5f 53 4f 55 52 43 45 0d 0a 4e 45 45 44 5f  CL_SOURCE..NEED_
0900: 54 43 4c 5f 53 4f 55 52 43 45 20 3d 20 30 0d 0a  TCL_SOURCE = 0..
0910: 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 64 65 66  !endif....!ifdef
0920: 20 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 0d   NEED_TK_SOURCE.
0930: 0a 21 69 66 20 24 28 4e 45 45 44 5f 54 4b 5f 53  .!if $(NEED_TK_S
0940: 4f 55 52 43 45 29 0d 0a 4e 45 45 44 5f 54 4b 20  OURCE)..NEED_TK 
0950: 3d 20 31 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6c  = 1..!endif..!el
0960: 73 65 0d 0a 4e 45 45 44 5f 54 4b 5f 53 4f 55 52  se..NEED_TK_SOUR
0970: 43 45 20 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a  CE = 0..!endif..
0980: 0d 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ..##############
0990: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
09a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
09b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
09c0: 23 23 0d 0a 23 20 4e 6d 61 6b 65 20 69 73 20 61  ##..# Nmake is a
09d0: 20 70 72 65 74 74 79 20 77 65 61 6b 20 65 6e 76   pretty weak env
09e0: 69 72 6f 6e 6d 65 6e 74 20 69 6e 20 73 79 6e 74  ironment in synt
09f0: 61 78 20 61 6e 64 20 63 61 70 61 62 69 6c 69 74  ax and capabilit
0a00: 69 65 73 0d 0a 23 20 73 6f 20 74 68 69 73 20 66  ies..# so this f
0a10: 69 6c 65 20 69 73 20 6e 65 63 65 73 73 61 72 69  ile is necessari
0a20: 6c 79 20 76 65 72 62 6f 73 65 2e 20 49 74 27 73  ly verbose. It's
0a30: 20 62 72 6f 6b 65 6e 20 64 6f 77 6e 20 69 6e 74   broken down int
0a40: 6f 0d 0a 23 20 74 68 65 20 66 6f 6c 6c 6f 77 69  o..# the followi
0a50: 6e 67 20 70 61 72 74 73 2e 0d 0a 23 0d 0a 23 20  ng parts...#..# 
0a60: 30 2e 20 53 61 6e 69 74 79 20 63 68 65 63 6b 20  0. Sanity check 
0a70: 74 68 61 74 20 63 6f 6d 70 69 6c 65 72 20 65 6e  that compiler en
0a80: 76 69 72 6f 6e 6d 65 6e 74 20 69 73 20 73 65 74  vironment is set
0a90: 20 75 70 20 61 6e 64 20 69 6e 69 74 69 61 6c 69   up and initiali
0aa0: 7a 65 0d 0a 23 20 20 20 20 61 6e 79 20 62 75 69  ze..#    any bui
0ab0: 6c 74 2d 69 6e 20 73 65 74 74 69 6e 67 73 20 66  lt-in settings f
0ac0: 72 6f 6d 20 74 68 65 20 70 61 72 65 6e 74 20 6d  rom the parent m
0ad0: 61 6b 65 66 69 6c 65 0d 0a 23 20 31 2e 20 46 69  akefile..# 1. Fi
0ae0: 72 73 74 20 64 65 66 69 6e 65 20 74 68 65 20 65  rst define the e
0af0: 78 74 65 72 6e 61 6c 20 74 6f 6f 6c 73 20 75 73  xternal tools us
0b00: 65 64 20 66 6f 72 20 63 6f 6d 70 69 6c 69 6e 67  ed for compiling
0b10: 2c 20 63 6f 70 79 69 6e 67 20 65 74 63 2e 0d 0a  , copying etc...
0b20: 23 20 20 20 20 61 73 20 74 68 69 73 20 69 73 20  #    as this is 
0b30: 69 6e 64 65 70 65 6e 64 65 6e 74 20 6f 66 20 65  independent of e
0b40: 76 65 72 79 74 68 69 6e 67 20 65 6c 73 65 2e 0d  verything else..
0b50: 0a 23 20 32 2e 20 46 69 67 75 72 65 20 6f 75 74  .# 2. Figure out
0b60: 20 6f 75 72 20 62 75 69 6c 64 20 73 74 72 75 63   our build struc
0b70: 74 75 72 65 20 69 6e 20 74 65 72 6d 73 20 6f 66  ture in terms of
0b80: 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 2c 20   the directory, 
0b90: 77 68 65 74 68 65 72 0d 0a 23 20 20 20 20 77 65  whether..#    we
0ba0: 20 61 72 65 20 62 75 69 6c 64 69 6e 67 20 54 63   are building Tc
0bb0: 6c 20 6f 72 20 61 6e 20 65 78 74 65 6e 73 69 6f  l or an extensio
0bc0: 6e 2c 20 65 74 63 2e 0d 0a 23 20 33 2e 20 44 65  n, etc...# 3. De
0bd0: 74 65 72 6d 69 6e 65 20 74 68 65 20 63 6f 6d 70  termine the comp
0be0: 69 6c 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72 20  iler and linker 
0bf0: 76 65 72 73 69 6f 6e 73 0d 0a 23 20 34 2e 20 42  versions..# 4. B
0c00: 75 69 6c 64 20 74 68 65 20 6e 6d 61 6b 65 68 6c  uild the nmakehl
0c10: 70 20 68 65 6c 70 65 72 20 61 70 70 6c 69 63 61  p helper applica
0c20: 74 69 6f 6e 0d 0a 23 20 35 2e 20 44 65 74 65 72  tion..# 5. Deter
0c30: 6d 69 6e 65 20 74 68 65 20 73 75 70 70 6f 72 74  mine the support
0c40: 65 64 20 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69  ed compiler opti
0c50: 6f 6e 73 20 61 6e 64 20 66 65 61 74 75 72 65 73  ons and features
0c60: 0d 0a 23 20 36 2e 20 45 78 74 72 61 63 74 20 54  ..# 6. Extract T
0c70: 63 6c 2c 20 54 6b 2c 20 61 6e 64 20 70 6f 73 73  cl, Tk, and poss
0c80: 69 62 6c 79 20 65 78 74 65 6e 73 69 6f 6e 73 2c  ibly extensions,
0c90: 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73   version numbers
0ca0: 20 66 72 6f 6d 20 74 68 65 0d 0a 23 20 20 20 20   from the..#    
0cb0: 68 65 61 64 65 72 73 0d 0a 23 20 37 2e 20 50 61  headers..# 7. Pa
0cc0: 72 73 65 20 74 68 65 20 4f 50 54 53 20 6d 61 63  rse the OPTS mac
0cd0: 72 6f 20 76 61 6c 75 65 20 66 6f 72 20 75 73 65  ro value for use
0ce0: 72 2d 73 70 65 63 69 66 69 65 64 20 62 75 69 6c  r-specified buil
0cf0: 64 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0d  d configuration.
0d00: 0a 23 20 38 2e 20 50 61 72 73 65 20 74 68 65 20  .# 8. Parse the 
0d10: 53 54 41 54 53 20 6d 61 63 72 6f 20 76 61 6c 75  STATS macro valu
0d20: 65 20 66 6f 72 20 73 74 61 74 69 73 74 69 63 73  e for statistics
0d30: 20 69 6e 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e   instrumentation
0d40: 0d 0a 23 20 39 2e 20 50 61 72 73 65 20 74 68 65  ..# 9. Parse the
0d50: 20 43 48 45 43 4b 53 20 6d 61 63 72 6f 20 66 6f   CHECKS macro fo
0d60: 72 20 61 64 64 69 74 69 6f 6e 61 6c 20 63 6f 6d  r additional com
0d70: 70 69 6c 61 74 69 6f 6e 20 63 68 65 63 6b 73 0d  pilation checks.
0d80: 0a 23 20 31 30 2e 20 42 61 73 65 64 20 6f 6e 20  .# 10. Based on 
0d90: 74 68 69 73 20 73 65 6c 65 63 74 65 64 20 63 6f  this selected co
0da0: 6e 66 69 67 75 72 61 74 69 6f 6e 2c 20 63 6f 6e  nfiguration, con
0db0: 73 74 72 75 63 74 20 74 68 65 20 6f 75 74 70 75  struct the outpu
0dc0: 74 0d 0a 23 20 20 20 20 20 64 69 72 65 63 74 6f  t..#     directo
0dd0: 72 79 20 61 6e 64 20 66 69 6c 65 20 70 61 74 68  ry and file path
0de0: 73 0d 0a 23 20 31 31 2e 20 43 6f 6e 73 74 72 75  s..# 11. Constru
0df0: 63 74 20 74 68 65 20 70 61 74 68 73 20 77 68 65  ct the paths whe
0e00: 72 65 20 74 68 65 20 70 61 63 6b 61 67 65 20 69  re the package i
0e10: 73 20 74 6f 20 62 65 20 69 6e 73 74 61 6c 6c 65  s to be installe
0e20: 64 0d 0a 23 20 31 32 2e 20 53 65 74 20 75 70 20  d..# 12. Set up 
0e30: 74 68 65 20 61 63 74 75 61 6c 20 6f 70 74 69 6f  the actual optio
0e40: 6e 73 20 70 61 73 73 65 64 20 74 6f 20 63 6f 6d  ns passed to com
0e50: 70 69 6c 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72  piler and linker
0e60: 20 62 61 73 65 64 0d 0a 23 20 20 20 20 20 6f 6e   based..#     on
0e70: 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e   the information
0e80: 20 67 61 74 68 65 72 65 64 20 61 62 6f 76 65 2e   gathered above.
0e90: 0d 0a 23 20 31 33 2e 20 44 65 66 69 6e 65 20 73  ..# 13. Define s
0ea0: 6f 6d 65 20 73 74 61 6e 64 61 72 64 20 62 75 69  ome standard bui
0eb0: 6c 64 20 74 61 72 67 65 74 73 20 61 6e 64 20 69  ld targets and i
0ec0: 6d 70 6c 69 63 69 74 20 72 75 6c 65 73 2e 20 54  mplicit rules. T
0ed0: 68 65 73 65 20 6d 61 79 0d 0a 23 20 20 20 20 20  hese may..#     
0ee0: 62 65 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 64 69  be optionally di
0ef0: 73 61 62 6c 65 64 20 62 79 20 74 68 65 20 70 61  sabled by the pa
0f00: 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 2e 0d 0a  rent makefile...
0f10: 23 20 31 34 2e 20 28 46 6f 72 20 65 78 74 65 6e  # 14. (For exten
0f20: 73 69 6f 6e 73 20 6f 6e 6c 79 2e 29 20 43 6f 6d  sions only.) Com
0f30: 70 61 72 65 20 74 68 65 20 63 6f 6e 66 69 67 75  pare the configu
0f40: 72 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 74 61  ration of the ta
0f50: 72 67 65 74 0d 0a 23 20 20 20 20 20 54 63 6c 20  rget..#     Tcl 
0f60: 61 6e 64 20 74 68 65 20 65 78 74 65 6e 73 69 6f  and the extensio
0f70: 6e 73 20 61 6e 64 20 77 61 72 6e 20 61 67 61 69  ns and warn agai
0f80: 6e 73 74 20 64 69 73 63 72 65 70 61 6e 63 69 65  nst discrepancie
0f90: 73 2e 0d 0a 23 0d 0a 23 20 4f 6e 65 20 66 69 6e  s...#..# One fin
0fa0: 61 6c 20 6e 6f 74 65 20 61 62 6f 75 74 20 74 68  al note about th
0fb0: 65 20 6d 61 63 72 6f 20 6e 61 6d 65 73 20 75 73  e macro names us
0fc0: 65 64 2e 20 54 68 65 79 20 61 72 65 20 61 73 20  ed. They are as 
0fd0: 74 68 65 79 20 61 72 65 0d 0a 23 20 66 6f 72 20  they are..# for 
0fe0: 68 69 73 74 6f 72 69 63 61 6c 20 72 65 61 73 6f  historical reaso
0ff0: 6e 73 2e 20 57 65 20 77 6f 75 6c 64 20 6c 69 6b  ns. We would lik
1000: 65 20 6c 65 67 61 63 79 20 65 78 74 65 6e 73 69  e legacy extensi
1010: 6f 6e 73 20 74 6f 0d 0a 23 20 63 6f 6e 74 69 6e  ons to..# contin
1020: 75 65 20 74 6f 20 77 6f 72 6b 20 77 69 74 68 20  ue to work with 
1030: 74 68 69 73 20 6d 61 6b 65 20 69 6e 63 6c 75 64  this make includ
1040: 65 20 66 69 6c 65 20 73 6f 20 62 65 20 77 61 72  e file so be war
1050: 79 20 6f 66 0d 0a 23 20 63 68 61 6e 67 69 6e 67  y of..# changing
1060: 20 74 68 65 6d 20 66 6f 72 20 63 6f 6e 73 69 73   them for consis
1070: 74 65 6e 63 79 20 6f 72 20 63 6c 61 72 69 74 79  tency or clarity
1080: 2e 0d 0a 0d 0a 23 20 30 2e 20 53 61 6e 69 74 79  .....# 0. Sanity
1090: 20 63 68 65 63 6b 20 63 6f 6d 70 69 6c 65 72 20   check compiler 
10a0: 65 6e 76 69 72 6f 6e 6d 65 6e 74 0d 0a 0d 0a 23  environment....#
10b0: 20 43 68 65 63 6b 20 74 6f 20 73 65 65 20 77 65   Check to see we
10c0: 20 61 72 65 20 63 6f 6e 66 69 67 75 72 65 64 20   are configured 
10d0: 74 6f 20 62 75 69 6c 64 20 77 69 74 68 20 4d 53  to build with MS
10e0: 56 43 20 28 4d 53 44 45 56 44 49 52 2c 20 4d 53  VC (MSDEVDIR, MS
10f0: 56 43 44 49 52 20 6f 72 0d 0a 23 20 56 43 49 4e  VCDIR or..# VCIN
1100: 53 54 41 4c 4c 44 49 52 29 20 6f 72 20 77 69 74  STALLDIR) or wit
1110: 68 20 74 68 65 20 4d 53 20 50 6c 61 74 66 6f 72  h the MS Platfor
1120: 6d 20 53 44 4b 20 28 4d 53 53 44 4b 20 6f 72 20  m SDK (MSSDK or 
1130: 57 69 6e 64 6f 77 73 53 44 4b 44 69 72 29 0d 0a  WindowsSDKDir)..
1140: 0d 0a 21 69 66 20 21 64 65 66 69 6e 65 64 28 4d  ..!if !defined(M
1150: 53 44 45 56 44 49 52 29 20 26 26 20 21 64 65 66  SDEVDIR) && !def
1160: 69 6e 65 64 28 4d 53 56 43 44 49 52 29 20 26 26  ined(MSVCDIR) &&
1170: 20 21 64 65 66 69 6e 65 64 28 56 43 49 4e 53 54   !defined(VCINST
1180: 41 4c 4c 44 49 52 29 20 26 26 20 21 64 65 66 69  ALLDIR) && !defi
1190: 6e 65 64 28 4d 53 53 44 4b 29 20 26 26 20 21 64  ned(MSSDK) && !d
11a0: 65 66 69 6e 65 64 28 57 49 4e 44 4f 57 53 53 44  efined(WINDOWSSD
11b0: 4b 44 49 52 29 0d 0a 4d 53 47 20 3d 20 5e 0d 0a  KDIR)..MSG = ^..
11c0: 56 69 73 75 61 6c 20 43 2b 2b 20 63 6f 6d 70 69  Visual C++ compi
11d0: 6c 65 72 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20  ler environment 
11e0: 6e 6f 74 20 69 6e 69 74 69 61 6c 69 7a 65 64 2e  not initialized.
11f0: 0d 0a 21 65 72 72 6f 72 20 24 28 4d 53 47 29 0d  ..!error $(MSG).
1200: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 57 65 20  .!endif....# We 
1210: 6e 65 65 64 20 74 6f 20 72 75 6e 20 66 72 6f 6d  need to run from
1220: 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 74   the directory t
1230: 68 65 20 70 61 72 65 6e 74 20 6d 61 6b 65 66 69  he parent makefi
1240: 6c 65 20 69 73 20 6c 6f 63 61 74 65 64 20 69 6e  le is located in
1250: 2e 0d 0a 23 20 6e 6d 61 6b 65 20 64 6f 65 73 20  ...# nmake does 
1260: 6e 6f 74 20 74 65 6c 6c 20 75 73 20 77 68 61 74  not tell us what
1270: 20 6d 61 6b 65 66 69 6c 65 20 77 61 73 20 75 73   makefile was us
1280: 65 64 20 74 6f 20 69 6e 76 6f 6b 65 20 69 74 20  ed to invoke it 
1290: 73 6f 20 70 61 72 65 6e 74 0d 0a 23 20 6d 61 6b  so parent..# mak
12a0: 65 66 69 6c 65 20 68 61 73 20 74 6f 20 73 65 74  efile has to set
12b0: 20 74 68 65 20 4d 41 4b 45 46 49 4c 45 56 43 20   the MAKEFILEVC 
12c0: 6d 61 63 72 6f 20 6f 72 20 77 65 20 6a 75 73 74  macro or we just
12d0: 20 6d 61 6b 65 20 61 20 67 75 65 73 73 20 61 6e   make a guess an
12e0: 64 0d 0a 23 20 77 61 72 6e 20 69 66 20 77 65 20  d..# warn if we 
12f0: 74 68 69 6e 6b 20 74 68 61 74 20 69 73 20 6e 6f  think that is no
1300: 74 20 74 68 65 20 63 61 73 65 2e 0d 0a 21 69 66  t the case...!if
1310: 20 22 24 28 4d 41 4b 45 46 49 4c 45 56 43 29 22   "$(MAKEFILEVC)"
1320: 20 3d 3d 20 22 22 0d 0a 0d 0a 21 69 66 20 65 78   == ""....!if ex
1330: 69 73 74 28 22 24 28 50 52 4f 4a 45 43 54 29 2e  ist("$(PROJECT).
1340: 76 63 22 29 0d 0a 4d 41 4b 45 46 49 4c 45 56 43  vc")..MAKEFILEVC
1350: 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 2e 76 63   = $(PROJECT).vc
1360: 0d 0a 21 65 6c 73 65 69 66 20 65 78 69 73 74 28  ..!elseif exist(
1370: 22 6d 61 6b 65 66 69 6c 65 2e 76 63 22 29 0d 0a  "makefile.vc")..
1380: 4d 41 4b 45 46 49 4c 45 56 43 20 3d 20 6d 61 6b  MAKEFILEVC = mak
1390: 65 66 69 6c 65 2e 76 63 0d 0a 21 65 6e 64 69 66  efile.vc..!endif
13a0: 0d 0a 21 65 6e 64 69 66 20 23 20 22 24 28 4d 41  ..!endif # "$(MA
13b0: 4b 45 46 49 4c 45 56 43 29 22 20 3d 3d 20 22 22  KEFILEVC)" == ""
13c0: 0d 0a 0d 0a 21 69 66 20 21 65 78 69 73 74 28 22  ....!if !exist("
13d0: 24 28 4d 41 4b 45 46 49 4c 45 56 43 29 22 29 0d  $(MAKEFILEVC)").
13e0: 0a 4d 53 47 20 3d 20 5e 0d 0a 59 6f 75 20 6d 75  .MSG = ^..You mu
13f0: 73 74 20 72 75 6e 20 6e 6d 61 6b 65 20 66 72 6f  st run nmake fro
1400: 6d 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20  m the directory 
1410: 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 70  containing the p
1420: 72 6f 6a 65 63 74 20 6d 61 6b 65 66 69 6c 65 2e  roject makefile.
1430: 5e 0d 0a 49 66 20 79 6f 75 20 61 72 65 20 64 6f  ^..If you are do
1440: 69 6e 67 20 74 68 61 74 20 61 6e 64 20 67 65 74  ing that and get
1450: 74 69 6e 67 20 74 68 69 73 20 6d 65 73 73 61 67  ting this messag
1460: 65 2c 20 73 65 74 20 74 68 65 20 4d 41 4b 45 46  e, set the MAKEF
1470: 49 4c 45 56 43 5e 0d 0a 6d 61 63 72 6f 20 74 6f  ILEVC^..macro to
1480: 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65   the name of the
1490: 20 70 72 6f 6a 65 63 74 20 6d 61 6b 65 66 69 6c   project makefil
14a0: 65 2e 0d 0a 21 6d 65 73 73 61 67 65 20 57 41 52  e...!message WAR
14b0: 4e 49 4e 47 3a 20 24 28 4d 53 47 29 0d 0a 21 65  NING: $(MSG)..!e
14c0: 6e 64 69 66 0d 0a 0d 0a 0d 0a 23 23 23 23 23 23  ndif......######
14d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
14e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
14f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
1500: 23 23 23 23 23 23 23 23 23 23 0d 0a 23 20 31 2e  ##########..# 1.
1510: 20 44 65 66 69 6e 65 20 65 78 74 65 72 6e 61 6c   Define external
1520: 20 70 72 6f 67 72 61 6d 73 20 62 65 69 6e 67 20   programs being 
1530: 75 73 65 64 0d 0a 0d 0a 23 2d 2d 2d 2d 2d 2d 2d  used....#-------
1540: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1550: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1560: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1570: 2d 2d 2d 0d 0a 23 20 53 65 74 20 74 68 65 20 70  ---..# Set the p
1580: 72 6f 70 65 72 20 63 6f 70 79 20 6d 65 74 68 6f  roper copy metho
1590: 64 20 74 6f 20 61 76 6f 69 64 20 6f 76 65 72 77  d to avoid overw
15a0: 72 69 74 65 20 71 75 65 73 74 69 6f 6e 73 0d 0a  rite questions..
15b0: 23 20 74 6f 20 74 68 65 20 75 73 65 72 20 77 68  # to the user wh
15c0: 65 6e 20 63 6f 70 79 69 6e 67 20 66 69 6c 65 73  en copying files
15d0: 20 61 6e 64 20 73 65 6c 65 63 74 69 6e 67 20 74   and selecting t
15e0: 68 65 20 72 69 67 68 74 0d 0a 23 20 22 64 65 6c  he right..# "del
15f0: 65 74 65 20 61 6c 6c 22 20 6d 65 74 68 6f 64 2e  ete all" method.
1600: 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
1610: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1620: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1630: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 23  -------------..#
1640: 20 54 63 6c 20 42 75 67 20 62 65 34 30 62 37 33   Tcl Bug be40b73
1650: 36 3a 20 75 73 65 20 72 64 2f 6d 64 20 69 6e 73  6: use rd/md ins
1660: 74 65 61 64 20 72 6d 64 69 72 2f 6d 6b 64 69 72  tead rmdir/mkdir
1670: 2e 0d 0a 23 20 4f 74 68 65 72 77 69 73 65 2c 20  ...# Otherwise, 
1680: 61 6e 20 65 76 65 6e 74 75 61 6c 20 63 79 67 77  an eventual cygw
1690: 69 6e 20 76 65 72 73 69 6f 6e 20 77 69 74 68 20  in version with 
16a0: 64 69 66 66 65 72 65 6e 74 0d 0a 23 20 70 61 72  different..# par
16b0: 61 6d 65 74 65 72 73 20 6d 61 79 20 62 65 20 75  ameters may be u
16c0: 73 65 64 2e 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  sed...#---------
16d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1700: 2d 0d 0a 0d 0a 52 4d 44 49 52 09 3d 20 72 64 20  -....RMDIR.= rd 
1710: 2f 53 20 2f 51 0d 0a 43 50 59 09 3d 20 78 63 6f  /S /Q..CPY.= xco
1720: 70 79 20 2f 69 20 2f 79 20 3e 4e 55 4c 0d 0a 43  py /i /y >NUL..C
1730: 50 59 44 49 52 20 20 3d 20 78 63 6f 70 79 20 2f  PYDIR  = xcopy /
1740: 65 20 2f 69 20 2f 79 20 3e 4e 55 4c 0d 0a 43 4f  e /i /y >NUL..CO
1750: 50 59 09 3d 20 63 6f 70 79 20 2f 79 20 3e 4e 55  PY.= copy /y >NU
1760: 4c 0d 0a 4d 4b 44 49 52 20 20 20 3d 20 6d 64 0d  L..MKDIR   = md.
1770: 0a 45 43 48 4f 20 20 20 20 3d 20 69 66 20 22 24  .ECHO    = if "$
1780: 28 56 45 52 42 4f 53 45 29 22 20 3d 3d 20 22 31  (VERBOSE)" == "1
1790: 22 20 65 63 68 6f 0d 0a 0d 0a 23 23 23 23 23 23  " echo....######
17a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
17b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
17c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
17d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
17e0: 0d 0a 23 20 32 2e 20 46 69 67 75 72 65 20 6f 75  ..# 2. Figure ou
17f0: 74 20 6f 75 72 20 62 75 69 6c 64 20 65 6e 76 69  t our build envi
1800: 72 6f 6e 6d 65 6e 74 20 69 6e 20 74 65 72 6d 73  ronment in terms
1810: 20 6f 66 20 77 68 61 74 20 77 65 27 72 65 20 62   of what we're b
1820: 75 69 6c 64 69 6e 67 2e 0d 0a 23 0d 0a 23 20 28  uilding...#..# (
1830: 61 29 20 54 63 6c 20 69 74 73 65 6c 66 0d 0a 23  a) Tcl itself..#
1840: 20 28 62 29 20 54 6b 0d 0a 23 20 28 63 29 20 61   (b) Tk..# (c) a
1850: 20 54 63 6c 20 65 78 74 65 6e 73 69 6f 6e 20 75   Tcl extension u
1860: 73 69 6e 67 20 6c 69 62 72 61 72 69 65 73 2f 69  sing libraries/i
1870: 6e 63 6c 75 64 65 73 20 66 72 6f 6d 20 61 6e 20  ncludes from an 
1880: 2a 69 6e 73 74 61 6c 6c 65 64 2a 20 54 63 6c 0d  *installed* Tcl.
1890: 0a 23 20 28 64 29 20 61 20 54 63 6c 20 65 78 74  .# (d) a Tcl ext
18a0: 65 6e 73 69 6f 6e 20 75 73 69 6e 67 20 6c 69 62  ension using lib
18b0: 72 61 72 69 65 73 2f 69 6e 63 6c 75 64 65 73 20  raries/includes 
18c0: 66 72 6f 6d 20 54 63 6c 20 73 6f 75 72 63 65 20  from Tcl source 
18d0: 64 69 72 65 63 74 6f 72 79 0d 0a 23 0d 0a 23 20  directory..#..# 
18e0: 54 68 69 73 20 6c 61 73 74 20 69 73 20 6e 65 65  This last is nee
18f0: 64 65 64 20 62 65 63 61 75 73 65 20 73 6f 6d 65  ded because some
1900: 20 65 78 74 65 6e 73 69 6f 6e 73 20 73 74 69 6c   extensions stil
1910: 6c 20 6e 65 65 64 0d 0a 23 20 73 6f 6d 65 20 54  l need..# some T
1920: 63 6c 20 69 6e 74 65 72 66 61 63 65 73 20 74 68  cl interfaces th
1930: 61 74 20 61 72 65 20 6e 6f 74 20 70 75 62 6c 69  at are not publi
1940: 63 6c 79 20 65 78 70 6f 73 65 64 2e 0d 0a 23 0d  cly exposed...#.
1950: 0a 23 20 54 68 65 20 66 72 61 67 6d 65 6e 74 20  .# The fragment 
1960: 77 69 6c 6c 20 73 65 74 20 74 68 65 20 66 6f 6c  will set the fol
1970: 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 3a 0d 0a  lowing macros:..
1980: 23 20 52 4f 4f 54 20 2d 20 72 6f 6f 74 20 6f 66  # ROOT - root of
1990: 20 74 68 69 73 20 6d 6f 64 75 6c 65 20 73 6f 75   this module sou
19a0: 72 63 65 73 0d 0a 23 20 43 4f 4d 50 41 54 44 49  rces..# COMPATDI
19b0: 52 20 2d 20 73 6f 75 72 63 65 20 64 69 72 65 63  R - source direc
19c0: 74 6f 72 79 20 74 68 61 74 20 68 6f 6c 64 73 20  tory that holds 
19d0: 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 73 6f  compatibility so
19e0: 75 72 63 65 73 0d 0a 23 20 44 4f 43 44 49 52 20  urces..# DOCDIR 
19f0: 2d 20 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f  - source directo
1a00: 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 64 6f  ry containing do
1a10: 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65  cumentation file
1a20: 73 0d 0a 23 20 47 45 4e 45 52 49 43 44 49 52 20  s..# GENERICDIR 
1a30: 2d 20 70 6c 61 74 66 6f 72 6d 2d 69 6e 64 65 70  - platform-indep
1a40: 65 6e 64 65 6e 74 20 73 6f 75 72 63 65 20 64 69  endent source di
1a50: 72 65 63 74 6f 72 79 0d 0a 23 20 57 49 4e 5f 44  rectory..# WIN_D
1a60: 49 52 20 2d 20 57 69 6e 64 6f 77 73 2d 73 70 65  IR - Windows-spe
1a70: 63 69 66 69 63 20 73 6f 75 72 63 65 20 64 69 72  cific source dir
1a80: 65 63 74 6f 72 79 0d 0a 23 20 54 45 53 54 44 49  ectory..# TESTDI
1a90: 52 20 2d 20 64 69 72 65 63 74 6f 72 79 20 63 6f  R - directory co
1aa0: 6e 74 61 69 6e 69 6e 67 20 74 65 73 74 20 66 69  ntaining test fi
1ab0: 6c 65 73 0d 0a 23 20 54 4f 4f 4c 53 44 49 52 20  les..# TOOLSDIR 
1ac0: 2d 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74  - directory cont
1ad0: 61 69 6e 69 6e 67 20 62 75 69 6c 64 20 74 6f 6f  aining build too
1ae0: 6c 73 0d 0a 23 20 5f 54 43 4c 44 49 52 20 2d 20  ls..# _TCLDIR - 
1af0: 72 6f 6f 74 20 6f 66 20 74 68 65 20 54 63 6c 20  root of the Tcl 
1b00: 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 4f 52 20  installation OR 
1b10: 74 68 65 20 54 63 6c 20 73 6f 75 72 63 65 73 2e  the Tcl sources.
1b20: 20 4e 6f 74 20 73 65 74 0d 0a 23 20 20 20 20 77   Not set..#    w
1b30: 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 54 63 6c  hen building Tcl
1b40: 20 69 74 73 65 6c 66 2e 0d 0a 23 20 5f 49 4e 53   itself...# _INS
1b50: 54 41 4c 4c 44 49 52 20 2d 20 6e 61 74 69 76 65  TALLDIR - native
1b60: 20 66 6f 72 6d 20 6f 66 20 74 68 65 20 69 6e 73   form of the ins
1b70: 74 61 6c 6c 61 74 69 6f 6e 20 70 61 74 68 2e 20  tallation path. 
1b80: 46 6f 72 20 54 63 6c 0d 0a 23 20 20 20 20 74 68  For Tcl..#    th
1b90: 69 73 20 77 69 6c 6c 20 62 65 20 74 68 65 20 72  is will be the r
1ba0: 6f 6f 74 20 6f 66 20 74 68 65 20 54 63 6c 20 69  oot of the Tcl i
1bb0: 6e 73 74 61 6c 6c 61 74 69 6f 6e 2e 20 46 6f 72  nstallation. For
1bc0: 20 65 78 74 65 6e 73 69 6f 6e 73 0d 0a 23 20 20   extensions..#  
1bd0: 20 20 74 68 69 73 20 77 69 6c 6c 20 62 65 20 74    this will be t
1be0: 68 65 20 6c 69 62 20 64 69 72 65 63 74 6f 72 79  he lib directory
1bf0: 20 75 6e 64 65 72 20 74 68 65 20 72 6f 6f 74 2e   under the root.
1c00: 0d 0a 23 20 54 43 4c 49 4e 53 54 41 4c 4c 20 20  ..# TCLINSTALL  
1c10: 2d 20 73 65 74 20 74 6f 20 31 20 69 66 20 5f 54  - set to 1 if _T
1c20: 43 4c 44 49 52 20 72 65 66 65 72 73 20 74 6f 0d  CLDIR refers to.
1c30: 0a 23 20 20 20 20 68 65 61 64 65 72 73 20 61 6e  .#    headers an
1c40: 64 20 6c 69 62 72 61 72 69 65 73 20 66 72 6f 6d  d libraries from
1c50: 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63   an installed Tc
1c60: 6c 2c 20 61 6e 64 20 30 20 69 66 20 62 75 69 6c  l, and 0 if buil
1c70: 74 20 61 67 61 69 6e 73 74 0d 0a 23 20 20 20 20  t against..#    
1c80: 54 63 6c 20 73 6f 75 72 63 65 73 2e 20 4e 6f 74  Tcl sources. Not
1c90: 20 73 65 74 20 77 68 65 6e 20 62 75 69 6c 64 69   set when buildi
1ca0: 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 2e 20 59  ng Tcl itself. Y
1cb0: 65 73 2c 20 6e 6f 74 20 76 65 72 79 20 77 65 6c  es, not very wel
1cc0: 6c 0d 0a 23 20 20 20 20 6e 61 6d 65 64 2e 0d 0a  l..#    named...
1cd0: 23 20 5f 54 43 4c 5f 48 20 2d 20 6e 61 74 69 76  # _TCL_H - nativ
1ce0: 65 20 70 61 74 68 20 74 6f 20 74 68 65 20 74 63  e path to the tc
1cf0: 6c 2e 68 20 66 69 6c 65 0d 0a 23 0d 0a 23 20 49  l.h file..#..# I
1d00: 66 20 54 6b 20 69 73 20 69 6e 76 6f 6c 76 65 64  f Tk is involved
1d10: 2c 20 61 6c 73 6f 20 73 65 74 73 20 74 68 65 20  , also sets the 
1d20: 66 6f 6c 6c 6f 77 69 6e 67 0d 0a 23 20 5f 54 4b  following..# _TK
1d30: 44 49 52 20 2d 20 6e 61 74 69 76 65 20 66 6f 72  DIR - native for
1d40: 6d 20 54 6b 20 69 6e 73 74 61 6c 6c 61 74 69 6f  m Tk installatio
1d50: 6e 20 4f 52 20 54 6b 20 73 6f 75 72 63 65 2e 20  n OR Tk source. 
1d60: 4e 6f 74 20 73 65 74 20 69 66 20 62 75 69 6c 64  Not set if build
1d70: 69 6e 67 0d 0a 23 20 20 20 20 54 6b 20 69 74 73  ing..#    Tk its
1d80: 65 6c 66 2e 0d 0a 23 20 54 4b 49 4e 53 54 41 4c  elf...# TKINSTAL
1d90: 4c 20 2d 20 73 65 74 20 31 20 69 66 20 5f 54 4b  L - set 1 if _TK
1da0: 44 49 52 20 72 65 66 65 72 73 20 74 6f 20 69 6e  DIR refers to in
1db0: 73 74 61 6c 6c 65 64 20 54 6b 20 61 6e 64 20 30  stalled Tk and 0
1dc0: 20 69 66 20 54 6b 20 73 6f 75 72 63 65 73 0d 0a   if Tk sources..
1dd0: 23 20 5f 54 4b 5f 48 20 2d 20 6e 61 74 69 76 65  # _TK_H - native
1de0: 20 70 61 74 68 20 74 6f 20 74 68 65 20 74 6b 2e   path to the tk.
1df0: 68 20 66 69 6c 65 0d 0a 0d 0a 23 20 52 6f 6f 74  h file....# Root
1e00: 20 64 69 72 65 63 74 6f 72 79 20 66 6f 72 20 73   directory for s
1e10: 6f 75 72 63 65 73 20 61 6e 64 20 61 73 73 75 6d  ources and assum
1e20: 65 64 20 73 75 62 64 69 72 65 63 74 6f 72 69 65  ed subdirectorie
1e30: 73 0d 0a 52 4f 4f 54 20 3d 20 24 28 4d 41 4b 45  s..ROOT = $(MAKE
1e40: 44 49 52 29 5c 2e 2e 0d 0a 23 20 54 68 65 20 66  DIR)\....# The f
1e50: 6f 6c 6c 6f 77 69 6e 67 20 70 61 74 68 73 20 43  ollowing paths C
1e60: 41 4e 4e 4f 54 20 68 61 76 65 20 73 70 61 63 65  ANNOT have space
1e70: 73 20 69 6e 20 74 68 65 6d 20 61 73 20 74 68 65  s in them as the
1e80: 79 20 61 70 70 65 61 72 20 6f 6e 20 74 68 65 0d  y appear on the.
1e90: 0a 23 20 6c 65 66 74 20 73 69 64 65 20 6f 66 20  .# left side of 
1ea0: 69 6d 70 6c 69 63 69 74 20 72 75 6c 65 73 2e 0d  implicit rules..
1eb0: 0a 21 69 66 6e 64 65 66 20 43 4f 4d 50 41 54 44  .!ifndef COMPATD
1ec0: 49 52 0d 0a 43 4f 4d 50 41 54 44 49 52 09 3d 20  IR..COMPATDIR.= 
1ed0: 24 28 52 4f 4f 54 29 5c 63 6f 6d 70 61 74 0d 0a  $(ROOT)\compat..
1ee0: 21 65 6e 64 69 66 0d 0a 21 69 66 6e 64 65 66 20  !endif..!ifndef 
1ef0: 44 4f 43 44 49 52 0d 0a 44 4f 43 44 49 52 09 09  DOCDIR..DOCDIR..
1f00: 3d 20 24 28 52 4f 4f 54 29 5c 64 6f 63 0d 0a 21  = $(ROOT)\doc..!
1f10: 65 6e 64 69 66 0d 0a 21 69 66 6e 64 65 66 20 47  endif..!ifndef G
1f20: 45 4e 45 52 49 43 44 49 52 0d 0a 47 45 4e 45 52  ENERICDIR..GENER
1f30: 49 43 44 49 52 09 3d 20 24 28 52 4f 4f 54 29 5c  ICDIR.= $(ROOT)\
1f40: 67 65 6e 65 72 69 63 0d 0a 21 65 6e 64 69 66 0d  generic..!endif.
1f50: 0a 21 69 66 6e 64 65 66 20 54 4f 4f 4c 53 44 49  .!ifndef TOOLSDI
1f60: 52 0d 0a 54 4f 4f 4c 53 44 49 52 09 3d 20 24 28  R..TOOLSDIR.= $(
1f70: 52 4f 4f 54 29 5c 74 6f 6f 6c 73 0d 0a 21 65 6e  ROOT)\tools..!en
1f80: 64 69 66 0d 0a 21 69 66 6e 64 65 66 20 54 45 53  dif..!ifndef TES
1f90: 54 44 49 52 0d 0a 54 45 53 54 44 49 52 09 3d 20  TDIR..TESTDIR.= 
1fa0: 24 28 52 4f 4f 54 29 5c 74 65 73 74 73 0d 0a 21  $(ROOT)\tests..!
1fb0: 65 6e 64 69 66 0d 0a 21 69 66 6e 64 65 66 20 4c  endif..!ifndef L
1fc0: 49 42 44 49 52 0d 0a 21 69 66 20 65 78 69 73 74  IBDIR..!if exist
1fd0: 28 22 24 28 52 4f 4f 54 29 5c 6c 69 62 72 61 72  ("$(ROOT)\librar
1fe0: 79 22 29 0d 0a 4c 49 42 44 49 52 20 20 20 20 20  y")..LIBDIR     
1ff0: 20 20 20 20 20 3d 20 24 28 52 4f 4f 54 29 5c 6c       = $(ROOT)\l
2000: 69 62 72 61 72 79 0d 0a 21 65 6c 73 65 0d 0a 4c  ibrary..!else..L
2010: 49 42 44 49 52 20 20 20 20 20 20 20 20 20 20 3d  IBDIR          =
2020: 20 24 28 52 4f 4f 54 29 5c 6c 69 62 0d 0a 21 65   $(ROOT)\lib..!e
2030: 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 21 69  ndif..!endif..!i
2040: 66 6e 64 65 66 20 44 45 4d 4f 44 49 52 0d 0a 21  fndef DEMODIR..!
2050: 69 66 20 65 78 69 73 74 28 22 24 28 4c 49 42 44  if exist("$(LIBD
2060: 49 52 29 5c 64 65 6d 6f 73 22 29 0d 0a 44 45 4d  IR)\demos")..DEM
2070: 4f 44 49 52 09 09 3d 20 24 28 4c 49 42 44 49 52  ODIR..= $(LIBDIR
2080: 29 5c 64 65 6d 6f 73 0d 0a 21 65 6c 73 65 0d 0a  )\demos..!else..
2090: 44 45 4d 4f 44 49 52 09 09 3d 20 24 28 52 4f 4f  DEMODIR..= $(ROO
20a0: 54 29 5c 64 65 6d 6f 73 0d 0a 21 65 6e 64 69 66  T)\demos..!endif
20b0: 0d 0a 21 65 6e 64 69 66 20 23 20 69 66 6e 64 65  ..!endif # ifnde
20c0: 66 20 44 45 4d 4f 44 49 52 0d 0a 23 20 44 6f 20  f DEMODIR..# Do 
20d0: 4e 4f 54 20 75 73 65 20 57 49 4e 44 49 52 20 62  NOT use WINDIR b
20e0: 65 63 61 75 73 65 20 69 74 20 69 73 20 57 69 6e  ecause it is Win
20f0: 64 6f 77 73 20 69 6e 74 65 72 6e 61 6c 20 65 6e  dows internal en
2100: 76 69 72 6f 6e 6d 65 6e 74 0d 0a 23 20 76 61 72  vironment..# var
2110: 69 61 62 6c 65 20 74 6f 20 70 6f 69 6e 74 20 74  iable to point t
2120: 6f 20 63 3a 5c 77 69 6e 64 6f 77 73 21 0d 0a 57  o c:\windows!..W
2130: 49 4e 5f 44 49 52 09 09 3d 20 24 28 52 4f 4f 54  IN_DIR..= $(ROOT
2140: 29 5c 77 69 6e 0d 0a 0d 0a 21 69 66 6e 64 65 66  )\win....!ifndef
2150: 20 52 43 44 49 52 0d 0a 21 69 66 20 65 78 69 73   RCDIR..!if exis
2160: 74 28 22 24 28 57 49 4e 5f 44 49 52 29 5c 72 63  t("$(WIN_DIR)\rc
2170: 22 29 0d 0a 52 43 44 49 52 20 20 20 20 20 20 20  ")..RCDIR       
2180: 20 20 20 20 3d 20 24 28 57 49 4e 5f 44 49 52 29      = $(WIN_DIR)
2190: 5c 72 63 0d 0a 21 65 6c 73 65 0d 0a 52 43 44 49  \rc..!else..RCDI
21a0: 52 20 20 20 20 20 20 20 20 20 20 20 3d 20 24 28  R           = $(
21b0: 57 49 4e 5f 44 49 52 29 0d 0a 21 65 6e 64 69 66  WIN_DIR)..!endif
21c0: 0d 0a 21 65 6e 64 69 66 0d 0a 52 43 44 49 52 20  ..!endif..RCDIR 
21d0: 3d 20 24 28 52 43 44 49 52 3a 2f 3d 5c 29 0d 0a  = $(RCDIR:/=\)..
21e0: 0d 0a 23 20 54 68 65 20 74 61 72 67 65 74 20 64  ..# The target d
21f0: 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 20 74  irectory where t
2200: 68 65 20 62 75 69 6c 74 20 70 61 63 6b 61 67 65  he built package
2210: 73 20 61 6e 64 20 62 69 6e 61 72 69 65 73 20 77  s and binaries w
2220: 69 6c 6c 20 62 65 20 69 6e 73 74 61 6c 6c 65 64  ill be installed
2230: 2e 0d 0a 23 20 49 4e 53 54 41 4c 4c 44 49 52 20  ...# INSTALLDIR 
2240: 69 73 20 74 68 65 20 28 6f 70 74 69 6f 6e 61 6c  is the (optional
2250: 29 20 70 61 74 68 20 73 70 65 63 69 66 69 65 64  ) path specified
2260: 20 62 79 20 74 68 65 20 75 73 65 72 2e 0d 0a 23   by the user...#
2270: 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 69 73 20   _INSTALLDIR is 
2280: 49 4e 53 54 41 4c 4c 44 49 52 20 75 73 69 6e 67  INSTALLDIR using
2290: 20 74 68 65 20 62 61 63 6b 73 6c 61 73 68 20 73   the backslash s
22a0: 65 70 61 72 61 74 6f 72 20 73 79 6e 74 61 78 0d  eparator syntax.
22b0: 0a 21 69 66 64 65 66 20 49 4e 53 54 41 4c 4c 44  .!ifdef INSTALLD
22c0: 49 52 0d 0a 23 23 23 20 46 69 78 20 74 68 65 20  IR..### Fix the 
22d0: 70 61 74 68 20 73 65 70 61 72 61 74 6f 72 73 2e  path separators.
22e0: 0d 0a 5f 49 4e 53 54 41 4c 4c 44 49 52 09 3d 20  .._INSTALLDIR.= 
22f0: 24 28 49 4e 53 54 41 4c 4c 44 49 52 3a 2f 3d 5c  $(INSTALLDIR:/=\
2300: 29 0d 0a 21 65 6c 73 65 0d 0a 23 23 23 20 41 73  )..!else..### As
2310: 73 75 6d 65 20 74 68 65 20 6e 6f 72 6d 61 6c 20  sume the normal 
2320: 64 65 66 61 75 6c 74 2e 0d 0a 5f 49 4e 53 54 41  default..._INSTA
2330: 4c 4c 44 49 52 09 3d 20 24 28 48 4f 4d 45 44 52  LLDIR.= $(HOMEDR
2340: 49 56 45 29 5c 54 63 6c 0d 0a 21 65 6e 64 69 66  IVE)\Tcl..!endif
2350: 0d 0a 0d 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f  ....!if $(DOING_
2360: 54 43 4c 29 0d 0a 0d 0a 23 20 42 45 47 49 4e 20  TCL)....# BEGIN 
2370: 43 61 73 65 20 32 28 61 29 20 2d 20 42 75 69 6c  Case 2(a) - Buil
2380: 64 69 6e 67 20 54 63 6c 20 69 74 73 65 6c 66 0d  ding Tcl itself.
2390: 0a 0d 0a 23 20 4f 6e 6c 79 20 6e 65 65 64 20 74  ...# Only need t
23a0: 6f 20 64 65 66 69 6e 65 20 5f 54 43 4c 5f 48 0d  o define _TCL_H.
23b0: 0a 5f 54 43 4c 5f 48 20 3d 20 2e 2e 5c 67 65 6e  ._TCL_H = ..\gen
23c0: 65 72 69 63 5c 74 63 6c 2e 68 0d 0a 0d 0a 23 20  eric\tcl.h....# 
23d0: 45 4e 44 20 43 61 73 65 20 32 28 61 29 20 2d 20  END Case 2(a) - 
23e0: 42 75 69 6c 64 69 6e 67 20 54 63 6c 20 69 74 73  Building Tcl its
23f0: 65 6c 66 0d 0a 0d 0a 21 65 6c 73 65 69 66 20 24  elf....!elseif $
2400: 28 44 4f 49 4e 47 5f 54 4b 29 0d 0a 0d 0a 23 20  (DOING_TK)....# 
2410: 42 45 47 49 4e 20 43 61 73 65 20 32 28 62 29 20  BEGIN Case 2(b) 
2420: 2d 20 42 75 69 6c 64 69 6e 67 20 54 6b 0d 0a 0d  - Building Tk...
2430: 0a 54 43 4c 49 4e 53 54 41 4c 4c 20 3d 20 30 20  .TCLINSTALL = 0 
2440: 23 20 54 6b 20 61 6c 77 61 79 73 20 62 75 69 6c  # Tk always buil
2450: 64 73 20 61 67 61 69 6e 73 74 20 54 63 6c 20 73  ds against Tcl s
2460: 6f 75 72 63 65 2c 20 6e 6f 74 20 61 6e 20 69 6e  ource, not an in
2470: 73 74 61 6c 6c 65 64 20 54 63 6c 0d 0a 21 69 66  stalled Tcl..!if
2480: 20 22 24 28 54 43 4c 44 49 52 29 22 20 3d 3d 20   "$(TCLDIR)" == 
2490: 22 22 0d 0a 21 69 66 20 5b 65 63 68 6f 20 54 43  ""..!if [echo TC
24a0: 4c 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68  LDIR = \> nmakeh
24b0: 6c 70 2e 6f 75 74 5d 20 5c 0d 0a 20 20 20 7c 7c  lp.out] \..   ||
24c0: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54   [$(NMAKEHLP_NAT
24d0: 49 56 45 29 20 2d 4c 20 67 65 6e 65 72 69 63 5c  IVE) -L generic\
24e0: 74 63 6c 2e 68 20 3e 3e 20 6e 6d 61 6b 65 68 6c  tcl.h >> nmakehl
24f0: 70 2e 6f 75 74 5d 0d 0a 21 65 72 72 6f 72 20 2a  p.out]..!error *
2500: 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 6c 6f 63  ** Could not loc
2510: 61 74 65 20 54 63 6c 20 73 6f 75 72 63 65 20 64  ate Tcl source d
2520: 69 72 65 63 74 6f 72 79 2e 0d 0a 21 65 6e 64 69  irectory...!endi
2530: 66 0d 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 6b  f..!include nmak
2540: 65 68 6c 70 2e 6f 75 74 0d 0a 21 65 6e 64 69 66  ehlp.out..!endif
2550: 20 23 20 54 43 4c 44 49 52 20 3d 3d 20 22 22 0d   # TCLDIR == "".
2560: 0a 0d 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 54  ..._TCLDIR.= $(T
2570: 43 4c 44 49 52 3a 2f 3d 5c 29 0d 0a 5f 54 43 4c  CLDIR:/=\).._TCL
2580: 5f 48 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29  _H  = $(_TCLDIR)
2590: 5c 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 0d 0a  \generic\tcl.h..
25a0: 21 69 66 20 21 65 78 69 73 74 28 22 24 28 5f 54  !if !exist("$(_T
25b0: 43 4c 5f 48 29 22 29 0d 0a 21 65 72 72 6f 72 20  CL_H)")..!error 
25c0: 43 6f 75 6c 64 20 6e 6f 74 20 6c 6f 63 61 74 65  Could not locate
25d0: 20 74 63 6c 2e 68 2e 20 50 6c 65 61 73 65 20 73   tcl.h. Please s
25e0: 65 74 20 74 68 65 20 54 43 4c 44 49 52 20 6d 61  et the TCLDIR ma
25f0: 63 72 6f 20 74 6f 20 70 6f 69 6e 74 20 74 6f 20  cro to point to 
2600: 74 68 65 20 54 63 6c 20 2a 73 6f 75 72 63 65 2a  the Tcl *source*
2610: 20 64 69 72 65 63 74 6f 72 79 2e 0d 0a 21 65 6e   directory...!en
2620: 64 69 66 0d 0a 0d 0a 5f 54 4b 5f 48 20 3d 20 2e  dif...._TK_H = .
2630: 2e 5c 67 65 6e 65 72 69 63 5c 74 6b 2e 68 0d 0a  .\generic\tk.h..
2640: 0d 0a 23 20 45 4e 44 20 43 61 73 65 20 32 28 62  ..# END Case 2(b
2650: 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 54 6b 0d  ) - Building Tk.
2660: 0a 0d 0a 21 65 6c 73 65 0d 0a 0d 0a 23 20 42 45  ...!else....# BE
2670: 47 49 4e 20 43 61 73 65 20 32 28 63 29 20 6f 72  GIN Case 2(c) or
2680: 20 28 64 29 20 2d 20 42 75 69 6c 64 69 6e 67 20   (d) - Building 
2690: 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20 6f 74 68  an extension oth
26a0: 65 72 20 74 68 61 6e 20 54 6b 0d 0a 0d 0a 23 20  er than Tk....# 
26b0: 49 66 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20  If command line 
26c0: 68 61 73 20 73 70 65 63 69 66 69 65 64 20 54 63  has specified Tc
26d0: 6c 20 6c 6f 63 61 74 69 6f 6e 20 74 68 72 6f 75  l location throu
26e0: 67 68 20 54 43 4c 44 49 52 2c 20 75 73 65 20 69  gh TCLDIR, use i
26f0: 74 0d 0a 23 20 65 6c 73 65 20 64 65 66 61 75 6c  t..# else defaul
2700: 74 20 74 6f 20 74 68 65 20 49 4e 53 54 41 4c 4c  t to the INSTALL
2710: 44 49 52 20 73 65 74 74 69 6e 67 0d 0a 21 69 66  DIR setting..!if
2720: 20 22 24 28 54 43 4c 44 49 52 29 22 20 21 3d 20   "$(TCLDIR)" != 
2730: 22 22 0d 0a 0d 0a 5f 54 43 4c 44 49 52 09 3d 20  ""...._TCLDIR.= 
2740: 24 28 54 43 4c 44 49 52 3a 2f 3d 5c 29 0d 0a 21  $(TCLDIR:/=\)..!
2750: 69 66 20 65 78 69 73 74 28 22 24 28 5f 54 43 4c  if exist("$(_TCL
2760: 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c  DIR)\include\tcl
2770: 2e 68 22 29 20 23 20 43 61 73 65 20 32 28 63 29  .h") # Case 2(c)
2780: 20 77 69 74 68 20 54 43 4c 44 49 52 20 64 65 66   with TCLDIR def
2790: 69 6e 65 64 0d 0a 54 43 4c 49 4e 53 54 41 4c 4c  ined..TCLINSTALL
27a0: 09 3d 20 31 0d 0a 5f 54 43 4c 5f 48 20 20 20 20  .= 1.._TCL_H    
27b0: 20 20 20 20 20 20 3d 20 24 28 5f 54 43 4c 44 49        = $(_TCLDI
27c0: 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68  R)\include\tcl.h
27d0: 0d 0a 21 65 6c 73 65 69 66 20 65 78 69 73 74 28  ..!elseif exist(
27e0: 22 24 28 5f 54 43 4c 44 49 52 29 5c 67 65 6e 65  "$(_TCLDIR)\gene
27f0: 72 69 63 5c 74 63 6c 2e 68 22 29 20 23 20 43 61  ric\tcl.h") # Ca
2800: 73 65 20 32 28 64 29 20 77 69 74 68 20 54 43 4c  se 2(d) with TCL
2810: 44 49 52 20 64 65 66 69 6e 65 64 0d 0a 54 43 4c  DIR defined..TCL
2820: 49 4e 53 54 41 4c 4c 09 3d 20 30 0d 0a 5f 54 43  INSTALL.= 0.._TC
2830: 4c 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24  L_H          = $
2840: 28 5f 54 43 4c 44 49 52 29 5c 67 65 6e 65 72 69  (_TCLDIR)\generi
2850: 63 5c 74 63 6c 2e 68 0d 0a 21 65 6e 64 69 66 0d  c\tcl.h..!endif.
2860: 0a 0d 0a 21 65 6c 73 65 20 20 23 20 20 23 20 43  ...!else  #  # C
2870: 61 73 65 20 32 28 63 29 20 66 6f 72 20 65 78 74  ase 2(c) for ext
2880: 65 6e 73 69 6f 6e 73 20 77 69 74 68 20 54 43 4c  ensions with TCL
2890: 44 49 52 20 75 6e 64 65 66 69 6e 65 64 0d 0a 0d  DIR undefined...
28a0: 0a 23 20 4e 65 65 64 20 74 6f 20 6c 6f 63 61 74  .# Need to locat
28b0: 65 20 54 63 6c 20 64 65 70 65 6e 64 69 6e 67 20  e Tcl depending 
28c0: 6f 6e 20 77 68 65 74 68 65 72 20 69 74 20 6e 65  on whether it ne
28d0: 65 64 73 20 54 63 6c 20 73 6f 75 72 63 65 20 6f  eds Tcl source o
28e0: 72 20 6e 6f 74 2e 0d 0a 23 20 49 66 20 77 65 20  r not...# If we 
28f0: 64 6f 6e 27 74 2c 20 63 68 65 63 6b 20 74 68 65  don't, check the
2900: 20 49 4e 53 54 41 4c 4c 44 49 52 20 66 6f 72 20   INSTALLDIR for 
2910: 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c  an installed Tcl
2920: 20 66 69 72 73 74 0d 0a 0d 0a 21 69 66 20 65 78   first....!if ex
2930: 69 73 74 28 22 24 28 5f 49 4e 53 54 41 4c 4c 44  ist("$(_INSTALLD
2940: 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c 2e  IR)\include\tcl.
2950: 68 22 29 20 26 26 20 21 24 28 4e 45 45 44 5f 54  h") && !$(NEED_T
2960: 43 4c 5f 53 4f 55 52 43 45 29 0d 0a 0d 0a 54 43  CL_SOURCE)....TC
2970: 4c 49 4e 53 54 41 4c 4c 09 3d 20 31 0d 0a 54 43  LINSTALL.= 1..TC
2980: 4c 44 49 52 20 20 20 20 20 20 20 20 20 20 3d 20  LDIR          = 
2990: 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 2e  $(_INSTALLDIR)\.
29a0: 2e 0d 0a 23 20 4e 4f 54 45 3a 20 77 65 20 77 69  ...# NOTE: we wi
29b0: 6c 6c 20 62 65 20 72 65 73 65 74 74 69 6e 67 20  ll be resetting 
29c0: 5f 49 4e 53 54 41 4c 4c 44 49 52 20 74 6f 20 5f  _INSTALLDIR to _
29d0: 49 4e 53 54 41 4c 4c 44 49 52 2f 6c 69 62 20 66  INSTALLDIR/lib f
29e0: 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 0d 0a 23  or extensions..#
29f0: 20 6c 61 74 65 72 20 73 6f 20 74 68 65 20 5c 2e   later so the \.
2a00: 2e 20 61 63 63 6f 75 6e 74 73 20 66 6f 72 20 74  . accounts for t
2a10: 68 65 20 2f 6c 69 62 0d 0a 5f 54 43 4c 44 49 52  he /lib.._TCLDIR
2a20: 09 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49  ..= $(_INSTALLDI
2a30: 52 29 5c 2e 2e 0d 0a 5f 54 43 4c 5f 48 20 20 20  R)\...._TCL_H   
2a40: 20 20 20 20 20 20 20 3d 20 24 28 5f 54 43 4c 44         = $(_TCLD
2a50: 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c 2e  IR)\include\tcl.
2a60: 68 0d 0a 0d 0a 21 65 6c 73 65 20 23 20 65 78 69  h....!else # exi
2a70: 73 74 28 2e 2e 2e 29 20 26 26 20 21 24 28 4e 45  st(...) && !$(NE
2a80: 45 44 5f 54 43 4c 5f 53 4f 55 52 43 45 29 0d 0a  ED_TCL_SOURCE)..
2a90: 0d 0a 21 69 66 20 5b 65 63 68 6f 20 5f 54 43 4c  ..!if [echo _TCL
2aa0: 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c  DIR = \> nmakehl
2ab0: 70 2e 6f 75 74 5d 20 5c 0d 0a 20 20 20 7c 7c 20  p.out] \..   || 
2ac0: 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49  [$(NMAKEHLP_NATI
2ad0: 56 45 29 20 2d 4c 20 67 65 6e 65 72 69 63 5c 74  VE) -L generic\t
2ae0: 63 6c 2e 68 20 3e 3e 20 6e 6d 61 6b 65 68 6c 70  cl.h >> nmakehlp
2af0: 2e 6f 75 74 5d 0d 0a 21 65 72 72 6f 72 20 2a 2a  .out]..!error **
2b00: 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 6c 6f 63 61  * Could not loca
2b10: 74 65 20 54 63 6c 20 73 6f 75 72 63 65 20 64 69  te Tcl source di
2b20: 72 65 63 74 6f 72 79 2e 0d 0a 21 65 6e 64 69 66  rectory...!endif
2b30: 0d 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 6b 65  ..!include nmake
2b40: 68 6c 70 2e 6f 75 74 0d 0a 54 43 4c 49 4e 53 54  hlp.out..TCLINST
2b50: 41 4c 4c 20 20 20 20 20 20 3d 20 30 0d 0a 54 43  ALL      = 0..TC
2b60: 4c 44 49 52 20 20 20 20 20 20 20 20 20 3d 20 24  LDIR         = $
2b70: 28 5f 54 43 4c 44 49 52 29 0d 0a 5f 54 43 4c 5f  (_TCLDIR).._TCL_
2b80: 48 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f  H          = $(_
2b90: 54 43 4c 44 49 52 29 5c 67 65 6e 65 72 69 63 5c  TCLDIR)\generic\
2ba0: 74 63 6c 2e 68 0d 0a 0d 0a 21 65 6e 64 69 66 20  tcl.h....!endif 
2bb0: 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 26 26 20  # exist(...) && 
2bc0: 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 4f 55 52  !$(NEED_TCL_SOUR
2bd0: 43 45 29 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 20  CE)....!endif # 
2be0: 54 43 4c 44 49 52 0d 0a 0d 0a 21 69 66 6e 64 65  TCLDIR....!ifnde
2bf0: 66 20 5f 54 43 4c 5f 48 0d 0a 4d 53 47 20 3d 5e  f _TCL_H..MSG =^
2c00: 0d 0a 46 61 69 6c 65 64 20 74 6f 20 66 69 6e 64  ..Failed to find
2c10: 20 74 63 6c 2e 68 2e 20 54 68 65 20 54 43 4c 44   tcl.h. The TCLD
2c20: 49 52 20 6d 61 63 72 6f 20 69 73 20 73 65 74 20  IR macro is set 
2c30: 69 6e 63 6f 72 72 65 63 74 6c 79 20 6f 72 20 69  incorrectly or i
2c40: 73 20 6e 6f 74 20 73 65 74 20 61 6e 64 20 64 65  s not set and de
2c50: 66 61 75 6c 74 20 70 61 74 68 20 64 6f 65 73 20  fault path does 
2c60: 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 74 63 6c 2e  not contain tcl.
2c70: 68 2e 0d 0a 21 65 72 72 6f 72 20 24 28 4d 53 47  h...!error $(MSG
2c80: 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 4e  )..!endif....# N
2c90: 6f 77 20 64 6f 20 74 68 65 20 73 61 6d 65 20 74  ow do the same t
2ca0: 6f 20 6c 6f 63 61 74 65 20 54 6b 20 68 65 61 64  o locate Tk head
2cb0: 65 72 73 20 61 6e 64 20 6c 69 62 73 20 69 66 20  ers and libs if 
2cc0: 70 72 6f 6a 65 63 74 20 72 65 71 75 69 72 65 73  project requires
2cd0: 20 54 6b 0d 0a 21 69 66 20 24 28 4e 45 45 44 5f   Tk..!if $(NEED_
2ce0: 54 4b 29 0d 0a 0d 0a 21 69 66 20 22 24 28 54 4b  TK)....!if "$(TK
2cf0: 44 49 52 29 22 20 21 3d 20 22 22 0d 0a 0d 0a 5f  DIR)" != ""...._
2d00: 54 4b 44 49 52 20 3d 20 24 28 54 4b 44 49 52 3a  TKDIR = $(TKDIR:
2d10: 2f 3d 5c 29 0d 0a 21 69 66 20 65 78 69 73 74 28  /=\)..!if exist(
2d20: 22 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75  "$(_TKDIR)\inclu
2d30: 64 65 5c 74 6b 2e 68 22 29 0d 0a 54 4b 49 4e 53  de\tk.h")..TKINS
2d40: 54 41 4c 4c 20 20 20 20 20 20 3d 20 31 0d 0a 5f  TALL      = 1.._
2d50: 54 4b 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20  TK_H          = 
2d60: 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75 64  $(_TKDIR)\includ
2d70: 65 5c 74 6b 2e 68 0d 0a 21 65 6c 73 65 69 66 20  e\tk.h..!elseif 
2d80: 65 78 69 73 74 28 22 24 28 5f 54 4b 44 49 52 29  exist("$(_TKDIR)
2d90: 5c 67 65 6e 65 72 69 63 5c 74 6b 2e 68 22 29 0d  \generic\tk.h").
2da0: 0a 54 4b 49 4e 53 54 41 4c 4c 20 20 20 20 20 20  .TKINSTALL      
2db0: 3d 20 30 0d 0a 5f 54 4b 5f 48 20 20 20 20 20 20  = 0.._TK_H      
2dc0: 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 52 29 5c      = $(_TKDIR)\
2dd0: 67 65 6e 65 72 69 63 5c 74 6b 2e 68 0d 0a 21 65  generic\tk.h..!e
2de0: 6e 64 69 66 0d 0a 0d 0a 21 65 6c 73 65 20 23 20  ndif....!else # 
2df0: 54 4b 44 49 52 20 6e 6f 74 20 64 65 66 69 6e 65  TKDIR not define
2e00: 64 0d 0a 0d 0a 23 20 4e 65 65 64 20 74 6f 20 6c  d....# Need to l
2e10: 6f 63 61 74 65 20 54 63 6c 20 64 65 70 65 6e 64  ocate Tcl depend
2e20: 69 6e 67 20 6f 6e 20 77 68 65 74 68 65 72 20 69  ing on whether i
2e30: 74 20 6e 65 65 64 73 20 54 63 6c 20 73 6f 75 72  t needs Tcl sour
2e40: 63 65 20 6f 72 20 6e 6f 74 2e 0d 0a 23 20 49 66  ce or not...# If
2e50: 20 77 65 20 64 6f 6e 27 74 2c 20 63 68 65 63 6b   we don't, check
2e60: 20 74 68 65 20 49 4e 53 54 41 4c 4c 44 49 52 20   the INSTALLDIR 
2e70: 66 6f 72 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64  for an installed
2e80: 20 54 63 6c 20 66 69 72 73 74 0d 0a 0d 0a 21 69   Tcl first....!i
2e90: 66 20 65 78 69 73 74 28 22 24 28 5f 49 4e 53 54  f exist("$(_INST
2ea0: 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c  ALLDIR)\include\
2eb0: 74 6b 2e 68 22 29 20 26 26 20 21 24 28 4e 45 45  tk.h") && !$(NEE
2ec0: 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0d 0a 0d 0a  D_TK_SOURCE)....
2ed0: 54 4b 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d  TKINSTALL      =
2ee0: 20 31 0d 0a 23 20 4e 4f 54 45 3a 20 77 65 20 77   1..# NOTE: we w
2ef0: 69 6c 6c 20 62 65 20 72 65 73 65 74 74 69 6e 67  ill be resetting
2f00: 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 74 6f 20   _INSTALLDIR to 
2f10: 5f 49 4e 53 54 41 4c 4c 44 49 52 2f 6c 69 62 20  _INSTALLDIR/lib 
2f20: 66 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 0d 0a  for extensions..
2f30: 23 20 6c 61 74 65 72 20 73 6f 20 74 68 65 20 5c  # later so the \
2f40: 2e 2e 20 61 63 63 6f 75 6e 74 73 20 66 6f 72 20  .. accounts for 
2f50: 74 68 65 20 2f 6c 69 62 0d 0a 5f 54 4b 44 49 52  the /lib.._TKDIR
2f60: 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 49 4e           = $(_IN
2f70: 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0d 0a 5f 54  STALLDIR)\...._T
2f80: 4b 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24  K_H          = $
2f90: 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75 64 65  (_TKDIR)\include
2fa0: 5c 74 6b 2e 68 0d 0a 54 4b 44 49 52 20 20 20 20  \tk.h..TKDIR    
2fb0: 20 20 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 52        = $(_TKDIR
2fc0: 29 0d 0a 0d 0a 21 65 6c 73 65 20 23 20 65 78 69  )....!else # exi
2fd0: 73 74 28 22 24 28 5f 49 4e 53 54 41 4c 4c 44 49  st("$(_INSTALLDI
2fe0: 52 29 5c 69 6e 63 6c 75 64 65 5c 74 6b 2e 68 22  R)\include\tk.h"
2ff0: 29 20 26 26 20 21 24 28 4e 45 45 44 5f 54 4b 5f  ) && !$(NEED_TK_
3000: 53 4f 55 52 43 45 29 0d 0a 0d 0a 21 69 66 20 5b  SOURCE)....!if [
3010: 65 63 68 6f 20 5f 54 4b 44 49 52 20 3d 20 5c 3e  echo _TKDIR = \>
3020: 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20 5c   nmakehlp.out] \
3030: 0d 0a 20 20 20 7c 7c 20 5b 24 28 4e 4d 41 4b 45  ..   || [$(NMAKE
3040: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 4c 20 67  HLP_NATIVE) -L g
3050: 65 6e 65 72 69 63 5c 74 6b 2e 68 20 3e 3e 20 6e  eneric\tk.h >> n
3060: 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0d 0a 21 65  makehlp.out]..!e
3070: 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e  rror *** Could n
3080: 6f 74 20 6c 6f 63 61 74 65 20 54 6b 20 73 6f 75  ot locate Tk sou
3090: 72 63 65 20 64 69 72 65 63 74 6f 72 79 2e 0d 0a  rce directory...
30a0: 21 65 6e 64 69 66 0d 0a 21 69 6e 63 6c 75 64 65  !endif..!include
30b0: 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0d 0a 54   nmakehlp.out..T
30c0: 4b 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20  KINSTALL      = 
30d0: 30 0d 0a 54 4b 44 49 52 20 20 20 20 20 20 20 20  0..TKDIR        
30e0: 20 20 3d 20 24 28 5f 54 4b 44 49 52 29 0d 0a 5f    = $(_TKDIR).._
30f0: 54 4b 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20  TK_H          = 
3100: 24 28 5f 54 4b 44 49 52 29 5c 67 65 6e 65 72 69  $(_TKDIR)\generi
3110: 63 5c 74 6b 2e 68 0d 0a 0d 0a 21 65 6e 64 69 66  c\tk.h....!endif
3120: 20 23 20 65 78 69 73 74 28 22 24 28 5f 49 4e 53   # exist("$(_INS
3130: 54 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65  TALLDIR)\include
3140: 5c 74 6b 2e 68 22 29 20 26 26 20 21 24 28 4e 45  \tk.h") && !$(NE
3150: 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0d 0a 0d  ED_TK_SOURCE)...
3160: 0a 21 65 6e 64 69 66 20 23 20 54 4b 44 49 52 0d  .!endif # TKDIR.
3170: 0a 0d 0a 21 69 66 6e 64 65 66 20 5f 54 4b 5f 48  ...!ifndef _TK_H
3180: 0d 0a 4d 53 47 20 3d 5e 0d 0a 46 61 69 6c 65 64  ..MSG =^..Failed
3190: 20 74 6f 20 66 69 6e 64 20 74 6b 2e 68 2e 20 54   to find tk.h. T
31a0: 68 65 20 54 4b 44 49 52 20 6d 61 63 72 6f 20 69  he TKDIR macro i
31b0: 73 20 73 65 74 20 69 6e 63 6f 72 72 65 63 74 6c  s set incorrectl
31c0: 79 20 6f 72 20 69 73 20 6e 6f 74 20 73 65 74 20  y or is not set 
31d0: 61 6e 64 20 64 65 66 61 75 6c 74 20 70 61 74 68  and default path
31e0: 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69   does not contai
31f0: 6e 20 74 6b 2e 68 2e 0d 0a 21 65 72 72 6f 72 20  n tk.h...!error 
3200: 24 28 4d 53 47 29 0d 0a 21 65 6e 64 69 66 0d 0a  $(MSG)..!endif..
3210: 0d 0a 21 65 6e 64 69 66 20 23 20 4e 45 45 44 5f  ..!endif # NEED_
3220: 54 4b 0d 0a 0d 0a 21 69 66 20 24 28 4e 45 45 44  TK....!if $(NEED
3230: 5f 54 43 4c 5f 53 4f 55 52 43 45 29 20 26 26 20  _TCL_SOURCE) && 
3240: 24 28 54 43 4c 49 4e 53 54 41 4c 4c 29 0d 0a 4d  $(TCLINSTALL)..M
3250: 53 47 20 3d 20 5e 0d 0a 2a 2a 2a 20 57 61 72 6e  SG = ^..*** Warn
3260: 69 6e 67 3a 20 54 68 69 73 20 65 78 74 65 6e 73  ing: This extens
3270: 69 6f 6e 20 72 65 71 75 69 72 65 73 20 74 68 65  ion requires the
3280: 20 73 6f 75 72 63 65 20 64 69 73 74 72 69 62 75   source distribu
3290: 74 69 6f 6e 20 6f 66 20 54 63 6c 2e 5e 0d 0a 2a  tion of Tcl.^..*
32a0: 2a 2a 20 50 6c 65 61 73 65 20 73 65 74 20 74 68  ** Please set th
32b0: 65 20 54 43 4c 44 49 52 20 6d 61 63 72 6f 20 74  e TCLDIR macro t
32c0: 6f 20 70 6f 69 6e 74 20 74 6f 20 74 68 65 20 54  o point to the T
32d0: 63 6c 20 73 6f 75 72 63 65 73 2e 0d 0a 21 65 72  cl sources...!er
32e0: 72 6f 72 20 24 28 4d 53 47 29 0d 0a 21 65 6e 64  ror $(MSG)..!end
32f0: 69 66 0d 0a 0d 0a 21 69 66 20 24 28 4e 45 45 44  if....!if $(NEED
3300: 5f 54 4b 5f 53 4f 55 52 43 45 29 0d 0a 21 69 66  _TK_SOURCE)..!if
3310: 20 24 28 54 4b 49 4e 53 54 41 4c 4c 29 0d 0a 4d   $(TKINSTALL)..M
3320: 53 47 20 3d 20 5e 0d 0a 2a 2a 2a 20 57 61 72 6e  SG = ^..*** Warn
3330: 69 6e 67 3a 20 54 68 69 73 20 65 78 74 65 6e 73  ing: This extens
3340: 69 6f 6e 20 72 65 71 75 69 72 65 73 20 74 68 65  ion requires the
3350: 20 73 6f 75 72 63 65 20 64 69 73 74 72 69 62 75   source distribu
3360: 74 69 6f 6e 20 6f 66 20 54 6b 2e 5e 0d 0a 2a 2a  tion of Tk.^..**
3370: 2a 20 50 6c 65 61 73 65 20 73 65 74 20 74 68 65  * Please set the
3380: 20 54 4b 44 49 52 20 6d 61 63 72 6f 20 74 6f 20   TKDIR macro to 
3390: 70 6f 69 6e 74 20 74 6f 20 74 68 65 20 54 6b 20  point to the Tk 
33a0: 73 6f 75 72 63 65 73 2e 0d 0a 21 65 72 72 6f 72  sources...!error
33b0: 20 24 28 4d 53 47 29 0d 0a 21 65 6e 64 69 66 0d   $(MSG)..!endif.
33c0: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 0d 0a 23 20 49  .!endif......# I
33d0: 66 20 49 4e 53 54 41 4c 4c 44 49 52 20 73 65 74  f INSTALLDIR set
33e0: 20 74 6f 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61   to Tcl installa
33f0: 74 69 6f 6e 20 72 6f 6f 74 20 64 69 72 20 74 68  tion root dir th
3400: 65 6e 20 72 65 73 65 74 20 74 6f 20 74 68 65 0d  en reset to the.
3410: 0a 23 20 6c 69 62 20 64 69 72 20 66 6f 72 20 69  .# lib dir for i
3420: 6e 73 74 61 6c 6c 69 6e 67 20 65 78 74 65 6e 73  nstalling extens
3430: 69 6f 6e 73 0d 0a 21 69 66 20 65 78 69 73 74 28  ions..!if exist(
3440: 22 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c  "$(_INSTALLDIR)\
3450: 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 22 29 0d  include\tcl.h").
3460: 0a 5f 49 4e 53 54 41 4c 4c 44 49 52 3d 24 28 5f  ._INSTALLDIR=$(_
3470: 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 0d  INSTALLDIR)\lib.
3480: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 45 4e 44  .!endif....# END
3490: 20 43 61 73 65 20 32 28 63 29 20 6f 72 20 28 64   Case 2(c) or (d
34a0: 29 20 2d 20 42 75 69 6c 64 69 6e 67 20 61 6e 20  ) - Building an 
34b0: 65 78 74 65 6e 73 69 6f 6e 0d 0a 21 65 6e 64 69  extension..!endi
34c0: 66 20 23 20 69 66 20 24 28 44 4f 49 4e 47 5f 54  f # if $(DOING_T
34d0: 43 4c 29 0d 0a 0d 0a 23 23 23 23 23 23 23 23 23  CL)....#########
34e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
34f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3500: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
3510: 23 23 23 23 23 23 23 0d 0a 23 20 33 2e 20 44 65  #######..# 3. De
3520: 74 65 72 6d 69 6e 65 20 63 6f 6d 70 69 6c 65 72  termine compiler
3530: 20 76 65 72 73 69 6f 6e 20 61 6e 64 20 61 72 63   version and arc
3540: 68 69 74 65 63 74 75 72 65 0d 0a 23 20 49 6e 20  hitecture..# In 
3550: 74 68 69 73 20 73 65 63 74 69 6f 6e 2c 20 77 65  this section, we
3560: 20 66 69 67 75 72 65 20 6f 75 74 20 74 68 65 20   figure out the 
3570: 63 6f 6d 70 69 6c 65 72 20 76 65 72 73 69 6f 6e  compiler version
3580: 20 61 6e 64 20 74 68 65 0d 0a 23 20 61 72 63 68   and the..# arch
3590: 69 74 65 63 74 75 72 65 20 66 6f 72 20 77 68 69  itecture for whi
35a0: 63 68 20 77 65 20 61 72 65 20 62 75 69 6c 64 69  ch we are buildi
35b0: 6e 67 2e 20 54 68 69 73 20 73 65 74 73 20 74 68  ng. This sets th
35c0: 65 0d 0a 23 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d  e..# following m
35d0: 61 63 72 6f 73 3a 0d 0a 23 20 56 43 56 45 52 53  acros:..# VCVERS
35e0: 49 4f 4e 20 2d 20 74 68 65 20 69 6e 74 65 72 6e  ION - the intern
35f0: 61 6c 20 63 6f 6d 70 69 6c 65 72 20 76 65 72 73  al compiler vers
3600: 69 6f 6e 20 61 73 20 31 32 30 30 2c 20 31 34 30  ion as 1200, 140
3610: 30 2c 20 31 39 31 30 20 65 74 63 2e 0d 0a 23 20  0, 1910 etc...# 
3620: 20 20 20 20 54 68 69 73 20 69 73 20 61 6c 73 6f      This is also
3630: 20 70 72 69 6e 74 65 64 20 62 79 20 74 68 65 20   printed by the 
3640: 63 6f 6d 70 69 6c 65 72 20 69 6e 20 64 6f 74 74  compiler in dott
3650: 65 64 20 66 6f 72 6d 20 31 39 2e 31 30 20 65 74  ed form 19.10 et
3660: 63 2e 0d 0a 23 20 56 43 56 45 52 20 2d 20 74 68  c...# VCVER - th
3670: 65 20 22 6d 61 72 6b 65 74 69 6e 67 20 76 65 72  e "marketing ver
3680: 73 69 6f 6e 22 2c 20 66 6f 72 20 65 78 61 6d 70  sion", for examp
3690: 6c 65 20 56 69 73 75 61 6c 20 43 2b 2b 20 36 20  le Visual C++ 6 
36a0: 66 6f 72 20 69 6e 74 65 72 6e 61 6c 0d 0a 23 20  for internal..# 
36b0: 20 20 20 20 63 6f 6d 70 69 6c 65 72 20 76 65 72      compiler ver
36c0: 73 69 6f 6e 20 31 32 30 30 2e 20 54 68 69 73 20  sion 1200. This 
36d0: 69 73 20 6b 65 70 74 20 6f 6e 6c 79 20 66 6f 72  is kept only for
36e0: 20 6c 65 67 61 63 79 20 72 65 61 73 6f 6e 73 20   legacy reasons 
36f0: 61 73 20 69 74 0d 0a 23 20 20 20 20 20 64 6f 65  as it..#     doe
3700: 73 20 6e 6f 74 20 6d 61 6b 65 20 73 65 6e 73 65  s not make sense
3710: 20 66 6f 72 20 72 65 63 65 6e 74 20 4d 69 63 72   for recent Micr
3720: 6f 73 6f 66 74 20 63 6f 6d 70 69 6c 65 72 73 2e  osoft compilers.
3730: 20 4f 6e 6c 79 20 75 73 65 64 20 66 6f 72 0d 0a   Only used for..
3740: 23 20 20 20 20 20 6f 75 74 70 75 74 20 64 69 72  #     output dir
3750: 65 63 74 6f 72 79 20 6e 61 6d 65 73 2e 0d 0a 23  ectory names...#
3760: 20 41 52 43 48 20 2d 20 73 65 74 20 74 6f 20 49   ARCH - set to I
3770: 58 38 36 2c 20 41 52 4d 36 34 20 6f 72 20 41 4d  X86, ARM64 or AM
3780: 44 36 34 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e  D64 depending on
3790: 20 33 32 2d 20 6f 72 20 36 34 2d 62 69 74 20 74   32- or 64-bit t
37a0: 61 72 67 65 74 0d 0a 23 20 4e 41 54 49 56 45 5f  arget..# NATIVE_
37b0: 41 52 43 48 20 2d 20 73 65 74 20 74 6f 20 49 58  ARCH - set to IX
37c0: 38 36 2c 20 41 52 4d 36 34 20 6f 72 20 41 4d 44  86, ARM64 or AMD
37d0: 36 34 20 66 6f 72 20 74 68 65 20 68 6f 73 74 20  64 for the host 
37e0: 6d 61 63 68 69 6e 65 0d 0a 23 20 4d 41 43 48 49  machine..# MACHI
37f0: 4e 45 20 2d 20 73 61 6d 65 20 61 73 20 24 28 41  NE - same as $(A
3800: 52 43 48 29 20 2d 20 6c 65 67 61 63 79 0d 0a 23  RCH) - legacy..#
3810: 20 5f 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45 4d   _VC_MANIFEST_EM
3820: 42 45 44 5f 7b 44 4c 4c 2c 45 58 45 7d 20 2d 20  BED_{DLL,EXE} - 
3830: 63 6f 6d 6d 61 6e 64 73 20 66 6f 72 20 65 6d 62  commands for emb
3840: 65 64 64 69 6e 67 20 61 20 6d 61 6e 69 66 65 73  edding a manifes
3850: 74 20 69 66 20 6e 65 65 64 65 64 0d 0a 0d 0a 63  t if needed....c
3860: 63 33 32 09 09 3d 20 24 28 43 43 29 20 20 20 23  c32..= $(CC)   #
3870: 20 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c   built-in defaul
3880: 74 2e 0d 0a 6c 69 6e 6b 33 32 09 09 3d 20 6c 69  t...link32..= li
3890: 6e 6b 0d 0a 6c 69 62 33 32 09 09 3d 20 6c 69 62  nk..lib32..= lib
38a0: 0d 0a 72 63 33 32 09 09 3d 20 24 28 52 43 29 20  ..rc32..= $(RC) 
38b0: 20 20 23 20 62 75 69 6c 74 2d 69 6e 20 64 65 66    # built-in def
38c0: 61 75 6c 74 2e 0d 0a 0d 0a 23 2d 2d 2d 2d 2d 2d  ault.....#------
38d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
38e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
38f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3900: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 23 20 46 69  ----------..# Fi
3910: 67 75 72 65 20 6f 75 74 20 74 68 65 20 63 6f 6d  gure out the com
3920: 70 69 6c 65 72 20 61 72 63 68 69 74 65 63 74 75  piler architectu
3930: 72 65 20 61 6e 64 20 76 65 72 73 69 6f 6e 20 62  re and version b
3940: 79 20 77 72 69 74 69 6e 67 0d 0a 23 20 74 68 65  y writing..# the
3950: 20 43 20 6d 61 63 72 6f 73 20 74 6f 20 61 20 66   C macros to a f
3960: 69 6c 65 2c 20 70 72 65 70 72 6f 63 65 73 73 69  ile, preprocessi
3970: 6e 67 20 74 68 65 6d 20 77 69 74 68 20 74 68 65  ng them with the
3980: 20 43 0d 0a 23 20 70 72 65 70 72 6f 63 65 73 73   C..# preprocess
3990: 6f 72 20 61 6e 64 20 72 65 61 64 69 6e 67 20 62  or and reading b
39a0: 61 63 6b 20 74 68 65 20 63 72 65 61 74 65 64 20  ack the created 
39b0: 66 69 6c 65 0d 0a 0d 0a 5f 48 41 53 48 3d 5e 23  file...._HASH=^#
39c0: 0d 0a 5f 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45  .._VC_MANIFEST_E
39d0: 4d 42 45 44 5f 45 58 45 3d 0d 0a 5f 56 43 5f 4d  MBED_EXE=.._VC_M
39e0: 41 4e 49 46 45 53 54 5f 45 4d 42 45 44 5f 44 4c  ANIFEST_EMBED_DL
39f0: 4c 3d 0d 0a 56 43 56 45 52 3d 30 0d 0a 21 69 66  L=..VCVER=0..!if
3a00: 20 21 5b 65 63 68 6f 20 56 43 56 45 52 53 49 4f   ![echo VCVERSIO
3a10: 4e 3d 5f 4d 53 43 5f 56 45 52 20 3e 20 76 65 72  N=_MSC_VER > ver
3a20: 63 6c 2e 78 5d 20 5c 0d 0a 20 20 20 20 26 26 20  cl.x] \..    && 
3a30: 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29 69  ![echo $(_HASH)i
3a40: 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 49 58 38  f defined(_M_IX8
3a50: 36 29 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 5c  6) >> vercl.x] \
3a60: 0d 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20  ..    && ![echo 
3a70: 41 52 43 48 3d 49 58 38 36 20 3e 3e 20 76 65 72  ARCH=IX86 >> ver
3a80: 63 6c 2e 78 5d 20 5c 0d 0a 20 20 20 20 26 26 20  cl.x] \..    && 
3a90: 21 5b 65 63 68 6f 20 24 28 5f 48 41 53 48 29 65  ![echo $(_HASH)e
3aa0: 6c 69 66 20 64 65 66 69 6e 65 64 28 5f 4d 5f 41  lif defined(_M_A
3ab0: 4d 44 36 34 29 20 3e 3e 20 76 65 72 63 6c 2e 78  MD64) >> vercl.x
3ac0: 5d 20 5c 0d 0a 20 20 20 20 26 26 20 21 5b 65 63  ] \..    && ![ec
3ad0: 68 6f 20 41 52 43 48 3d 41 4d 44 36 34 20 3e 3e  ho ARCH=AMD64 >>
3ae0: 20 76 65 72 63 6c 2e 78 5d 20 5c 0d 0a 20 20 20   vercl.x] \..   
3af0: 20 26 26 20 21 5b 65 63 68 6f 20 24 28 5f 48 41   && ![echo $(_HA
3b00: 53 48 29 65 6c 69 66 20 64 65 66 69 6e 65 64 28  SH)elif defined(
3b10: 5f 4d 5f 41 52 4d 36 34 29 20 3e 3e 20 76 65 72  _M_ARM64) >> ver
3b20: 63 6c 2e 78 5d 20 5c 0d 0a 20 20 20 20 26 26 20  cl.x] \..    && 
3b30: 21 5b 65 63 68 6f 20 41 52 43 48 3d 41 52 4d 36  ![echo ARCH=ARM6
3b40: 34 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 5c 0d  4 >> vercl.x] \.
3b50: 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20 24  .    && ![echo $
3b60: 28 5f 48 41 53 48 29 65 6e 64 69 66 20 3e 3e 20  (_HASH)endif >> 
3b70: 76 65 72 63 6c 2e 78 5d 20 5c 0d 0a 20 20 20 20  vercl.x] \..    
3b80: 26 26 20 21 5b 24 28 63 63 33 32 29 20 2d 6e 6f  && ![$(cc32) -no
3b90: 6c 6f 67 6f 20 2d 54 43 20 2d 50 20 76 65 72 63  logo -TC -P verc
3ba0: 6c 2e 78 20 32 3e 4e 55 4c 5d 0d 0a 21 69 6e 63  l.x 2>NUL]..!inc
3bb0: 6c 75 64 65 20 76 65 72 63 6c 2e 69 0d 0a 21 69  lude vercl.i..!i
3bc0: 66 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3c  f $(VCVERSION) <
3bd0: 20 31 39 30 30 0d 0a 21 69 66 20 21 5b 65 63 68   1900..!if ![ech
3be0: 6f 20 56 43 56 45 52 3d 20 5e 5c 3e 20 76 65 72  o VCVER= ^\> ver
3bf0: 63 6c 2e 76 63 5d 20 5c 0d 0a 20 20 20 20 26 26  cl.vc] \..    &&
3c00: 20 21 5b 73 65 74 20 2f 61 20 24 28 56 43 56 45   ![set /a $(VCVE
3c10: 52 53 49 4f 4e 29 20 2f 20 31 30 30 20 2d 20 36  RSION) / 100 - 6
3c20: 20 3e 3e 20 76 65 72 63 6c 2e 76 63 5d 0d 0a 21   >> vercl.vc]..!
3c30: 69 6e 63 6c 75 64 65 20 76 65 72 63 6c 2e 76 63  include vercl.vc
3c40: 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6c 73 65 0d  ..!endif..!else.
3c50: 0a 23 20 54 68 65 20 73 69 6d 70 6c 65 20 63 61  .# The simple ca
3c60: 6c 63 75 6c 61 74 69 6f 6e 20 61 62 6f 76 65 20  lculation above 
3c70: 64 6f 65 73 20 6e 6f 74 20 61 70 70 6c 79 20 74  does not apply t
3c80: 6f 20 6e 65 77 20 56 69 73 75 61 6c 20 53 74 75  o new Visual Stu
3c90: 64 69 6f 20 72 65 6c 65 61 73 65 73 0d 0a 23 20  dio releases..# 
3ca0: 4b 65 65 70 20 74 68 65 20 63 6f 6d 70 69 6c 65  Keep the compile
3cb0: 72 20 76 65 72 73 69 6f 6e 20 69 6e 20 69 74 73  r version in its
3cc0: 20 6e 61 74 69 76 65 20 66 6f 72 6d 2e 0d 0a 56   native form...V
3cd0: 43 56 45 52 20 3d 20 24 28 56 43 56 45 52 53 49  CVER = $(VCVERSI
3ce0: 4f 4e 29 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e  ON)..!endif..!en
3cf0: 64 69 66 0d 0a 0d 0a 21 69 66 20 21 5b 64 65 6c  dif....!if ![del
3d00: 20 32 3e 4e 55 4c 20 2f 71 2f 66 20 76 65 72 63   2>NUL /q/f verc
3d10: 6c 2e 78 20 76 65 72 63 6c 2e 69 20 76 65 72 63  l.x vercl.i verc
3d20: 6c 2e 76 63 5d 0d 0a 21 65 6e 64 69 66 0d 0a 0d  l.vc]..!endif...
3d30: 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
3d40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3d50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3d60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3d70: 2d 2d 0d 0a 23 20 54 68 65 20 4d 41 43 48 49 4e  --..# The MACHIN
3d80: 45 20 6d 61 63 72 6f 20 69 73 20 75 73 65 64 20  E macro is used 
3d90: 62 79 20 6c 65 67 61 63 79 20 6d 61 6b 65 66 69  by legacy makefi
3da0: 6c 65 73 20 73 6f 20 73 65 74 20 69 74 20 61 73  les so set it as
3db0: 20 77 65 6c 6c 0d 0a 21 69 66 64 65 66 20 4d 41   well..!ifdef MA
3dc0: 43 48 49 4e 45 0d 0a 21 69 66 20 22 24 28 4d 41  CHINE..!if "$(MA
3dd0: 43 48 49 4e 45 29 22 20 3d 3d 20 22 78 38 36 22  CHINE)" == "x86"
3de0: 0d 0a 21 75 6e 64 65 66 20 4d 41 43 48 49 4e 45  ..!undef MACHINE
3df0: 0d 0a 4d 41 43 48 49 4e 45 20 3d 20 49 58 38 36  ..MACHINE = IX86
3e00: 0d 0a 21 65 6c 73 65 69 66 20 22 24 28 4d 41 43  ..!elseif "$(MAC
3e10: 48 49 4e 45 29 22 20 3d 3d 20 22 61 72 6d 36 34  HINE)" == "arm64
3e20: 22 0d 0a 21 75 6e 64 65 66 20 4d 41 43 48 49 4e  "..!undef MACHIN
3e30: 45 0d 0a 4d 41 43 48 49 4e 45 20 3d 20 41 52 4d  E..MACHINE = ARM
3e40: 36 34 0d 0a 21 65 6c 73 65 69 66 20 22 24 28 4d  64..!elseif "$(M
3e50: 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 78 36 34  ACHINE)" == "x64
3e60: 22 0d 0a 21 75 6e 64 65 66 20 4d 41 43 48 49 4e  "..!undef MACHIN
3e70: 45 0d 0a 4d 41 43 48 49 4e 45 20 3d 20 41 4d 44  E..MACHINE = AMD
3e80: 36 34 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20  64..!endif..!if 
3e90: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 21 3d 20  "$(MACHINE)" != 
3ea0: 22 24 28 41 52 43 48 29 22 0d 0a 21 65 72 72 6f  "$(ARCH)"..!erro
3eb0: 72 20 53 70 65 63 69 66 69 65 64 20 4d 41 43 48  r Specified MACH
3ec0: 49 4e 45 20 6d 61 63 72 6f 20 24 28 4d 41 43 48  INE macro $(MACH
3ed0: 49 4e 45 29 20 64 6f 65 73 20 6e 6f 74 20 6d 61  INE) does not ma
3ee0: 74 63 68 20 64 65 74 65 63 74 65 64 20 74 61 72  tch detected tar
3ef0: 67 65 74 20 61 72 63 68 69 74 65 63 74 75 72 65  get architecture
3f00: 20 24 28 41 52 43 48 29 2e 0d 0a 21 65 6e 64 69   $(ARCH)...!endi
3f10: 66 0d 0a 21 65 6c 73 65 0d 0a 4d 41 43 48 49 4e  f..!else..MACHIN
3f20: 45 3d 24 28 41 52 43 48 29 0d 0a 21 65 6e 64 69  E=$(ARCH)..!endi
3f30: 66 0d 0a 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  f....#----------
3f40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3f50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3f60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3f70: 2d 2d 2d 2d 2d 0d 0a 23 20 54 68 65 20 50 4c 41  -----..# The PLA
3f80: 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 20 6d  TFORM_IDENTIFY m
3f90: 61 63 72 6f 20 6d 61 74 63 68 65 73 20 74 68 65  acro matches the
3fa0: 20 76 61 6c 75 65 73 20 72 65 74 75 72 6e 65 64   values returned
3fb0: 20 62 79 0d 0a 23 20 74 68 65 20 54 63 6c 20 70   by..# the Tcl p
3fc0: 6c 61 74 66 6f 72 6d 3a 3a 69 64 65 6e 74 69 66  latform::identif
3fd0: 79 20 63 6f 6d 6d 61 6e 64 0d 0a 21 69 66 20 22  y command..!if "
3fe0: 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22  $(MACHINE)" == "
3ff0: 41 4d 44 36 34 22 0d 0a 50 4c 41 54 46 4f 52 4d  AMD64"..PLATFORM
4000: 5f 49 44 45 4e 54 49 46 59 20 3d 20 77 69 6e 33  _IDENTIFY = win3
4010: 32 2d 78 38 36 5f 36 34 0d 0a 21 65 6c 73 65 69  2-x86_64..!elsei
4020: 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d  f "$(MACHINE)" =
4030: 3d 20 22 41 52 4d 36 34 22 0d 0a 50 4c 41 54 46  = "ARM64"..PLATF
4040: 4f 52 4d 5f 49 44 45 4e 54 49 46 59 20 3d 20 77  ORM_IDENTIFY = w
4050: 69 6e 33 32 2d 61 72 6d 0d 0a 21 65 6c 73 65 0d  in32-arm..!else.
4060: 0a 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49  .PLATFORM_IDENTI
4070: 46 59 20 3d 20 77 69 6e 33 32 2d 69 78 38 36 0d  FY = win32-ix86.
4080: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 54 68 65  .!endif....# The
4090: 20 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d 20 6d   MULTIPLATFORM m
40a0: 61 63 72 6f 20 63 6f 6e 74 72 6f 6c 73 20 77 68  acro controls wh
40b0: 65 74 68 65 72 20 62 69 6e 61 72 79 20 65 78 74  ether binary ext
40c0: 65 6e 73 69 6f 6e 73 20 61 72 65 20 69 6e 73 74  ensions are inst
40d0: 61 6c 6c 65 64 0d 0a 23 20 69 6e 20 70 6c 61 74  alled..# in plat
40e0: 66 6f 72 6d 2d 73 70 65 63 69 66 69 63 20 64 69  form-specific di
40f0: 72 65 63 74 6f 72 69 65 73 2e 20 49 6e 74 65 6e  rectories. Inten
4100: 64 65 64 20 74 6f 20 62 65 20 73 65 74 2f 75 73  ded to be set/us
4110: 65 64 20 62 79 20 65 78 74 65 6e 73 69 6f 6e 73  ed by extensions
4120: 2e 0d 0a 21 69 66 6e 64 65 66 20 4d 55 4c 54 49  ...!ifndef MULTI
4130: 50 4c 41 54 46 4f 52 4d 5f 49 4e 53 54 41 4c 4c  PLATFORM_INSTALL
4140: 0d 0a 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d 5f  ..MULTIPLATFORM_
4150: 49 4e 53 54 41 4c 4c 20 3d 20 30 0d 0a 21 65 6e  INSTALL = 0..!en
4160: 64 69 66 0d 0a 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  dif....#--------
4170: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4180: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4190: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
41a0: 2d 2d 2d 2d 0d 0a 23 20 46 69 67 75 72 65 20 6f  ----..# Figure o
41b0: 75 74 20 74 68 65 20 2a 68 6f 73 74 2a 20 61 72  ut the *host* ar
41c0: 63 68 69 74 65 63 74 75 72 65 20 62 79 20 72 65  chitecture by re
41d0: 61 64 69 6e 67 20 74 68 65 20 72 65 67 69 73 74  ading the regist
41e0: 72 79 0d 0a 0d 0a 21 69 66 20 21 5b 72 65 67 20  ry....!if ![reg 
41f0: 71 75 65 72 79 20 48 4b 4c 4d 5c 48 61 72 64 77  query HKLM\Hardw
4200: 61 72 65 5c 44 65 73 63 72 69 70 74 69 6f 6e 5c  are\Description\
4210: 53 79 73 74 65 6d 5c 43 65 6e 74 72 61 6c 50 72  System\CentralPr
4220: 6f 63 65 73 73 6f 72 5c 30 20 2f 76 20 49 64 65  ocessor\0 /v Ide
4230: 6e 74 69 66 69 65 72 20 7c 20 66 69 6e 64 73 74  ntifier | findst
4240: 72 20 2f 69 20 78 38 36 5d 0d 0a 4e 41 54 49 56  r /i x86]..NATIV
4250: 45 5f 41 52 43 48 3d 49 58 38 36 0d 0a 21 65 6c  E_ARCH=IX86..!el
4260: 73 65 69 66 20 21 5b 72 65 67 20 71 75 65 72 79  seif ![reg query
4270: 20 48 4b 4c 4d 5c 48 61 72 64 77 61 72 65 5c 44   HKLM\Hardware\D
4280: 65 73 63 72 69 70 74 69 6f 6e 5c 53 79 73 74 65  escription\Syste
4290: 6d 5c 43 65 6e 74 72 61 6c 50 72 6f 63 65 73 73  m\CentralProcess
42a0: 6f 72 5c 30 20 2f 76 20 49 64 65 6e 74 69 66 69  or\0 /v Identifi
42b0: 65 72 20 7c 20 66 69 6e 64 73 74 72 20 2f 69 20  er | findstr /i 
42c0: 41 52 4d 20 7c 20 66 69 6e 64 73 74 72 20 2f 69  ARM | findstr /i
42d0: 20 36 34 2d 62 69 74 5d 0d 0a 4e 41 54 49 56 45   64-bit]..NATIVE
42e0: 5f 41 52 43 48 3d 41 52 4d 36 34 0d 0a 21 65 6c  _ARCH=ARM64..!el
42f0: 73 65 0d 0a 4e 41 54 49 56 45 5f 41 52 43 48 3d  se..NATIVE_ARCH=
4300: 41 4d 44 36 34 0d 0a 21 65 6e 64 69 66 0d 0a 0d  AMD64..!endif...
4310: 0a 23 20 53 69 6e 63 65 20 4d 53 56 43 38 20 77  .# Since MSVC8 w
4320: 65 20 6d 75 73 74 20 64 65 61 6c 20 77 69 74 68  e must deal with
4330: 20 6d 61 6e 69 66 65 73 74 20 72 65 73 6f 75 72   manifest resour
4340: 63 65 73 2e 0d 0a 21 69 66 20 24 28 56 43 56 45  ces...!if $(VCVE
4350: 52 53 49 4f 4e 29 20 3e 3d 20 31 34 30 30 0d 0a  RSION) >= 1400..
4360: 5f 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42  _VC_MANIFEST_EMB
4370: 45 44 5f 45 58 45 3d 69 66 20 65 78 69 73 74 20  ED_EXE=if exist 
4380: 24 40 2e 6d 61 6e 69 66 65 73 74 20 6d 74 20 2d  [email protected] mt -
4390: 6e 6f 6c 6f 67 6f 20 2d 6d 61 6e 69 66 65 73 74  nologo -manifest
43a0: 20 24 40 2e 6d 61 6e 69 66 65 73 74 20 2d 6f 75   [email protected] -ou
43b0: 74 70 75 74 72 65 73 6f 75 72 63 65 3a 24 40 3b  tputresource:$@;
43c0: 31 0d 0a 5f 56 43 5f 4d 41 4e 49 46 45 53 54 5f  1.._VC_MANIFEST_
43d0: 45 4d 42 45 44 5f 44 4c 4c 3d 69 66 20 65 78 69  EMBED_DLL=if exi
43e0: 73 74 20 24 40 2e 6d 61 6e 69 66 65 73 74 20 6d  st [email protected] m
43f0: 74 20 2d 6e 6f 6c 6f 67 6f 20 2d 6d 61 6e 69 66  t -nologo -manif
4400: 65 73 74 20 24 40 2e 6d 61 6e 69 66 65 73 74 20  est [email protected] 
4410: 2d 6f 75 74 70 75 74 72 65 73 6f 75 72 63 65 3a  -outputresource:
4420: 24 40 3b 32 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a  $@;2..!endif....
4430: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4440: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4450: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4460: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4470: 0d 0a 23 20 34 2e 20 42 75 69 6c 64 20 74 68 65  ..# 4. Build the
4480: 20 6e 6d 61 6b 65 68 6c 70 20 70 72 6f 67 72 61   nmakehlp progra
4490: 6d 0d 0a 23 20 54 68 69 73 20 69 73 20 61 20 68  m..# This is a h
44a0: 65 6c 70 65 72 20 61 70 70 20 77 65 20 6e 65 65  elper app we nee
44b0: 64 20 74 6f 20 6f 76 65 72 63 6f 6d 65 20 6e 6d  d to overcome nm
44c0: 61 6b 65 27 73 20 6c 69 6d 69 74 69 6e 67 0d 0a  ake's limiting..
44d0: 23 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e 20 57  # environment. W
44e0: 65 20 77 69 6c 6c 20 63 61 6c 6c 20 6f 75 74 20  e will call out 
44f0: 74 6f 20 69 74 20 74 6f 20 67 65 74 20 76 61 72  to it to get var
4500: 69 6f 75 73 20 62 69 74 73 20 6f 66 0d 0a 23 20  ious bits of..# 
4510: 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75  information abou
4520: 74 20 73 75 70 70 6f 72 74 65 64 20 63 6f 6d 70  t supported comp
4530: 69 6c 65 72 20 6f 70 74 69 6f 6e 73 20 65 74 63  iler options etc
4540: 2e 0d 0a 23 0d 0a 23 20 54 63 6c 20 69 74 73 65  ...#..# Tcl itse
4550: 6c 66 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 75  lf will always u
4560: 73 65 20 74 68 65 20 6e 6d 61 6b 65 68 6c 70 2e  se the nmakehlp.
4570: 63 20 70 72 6f 67 72 61 6d 20 77 68 69 63 68 20  c program which 
4580: 69 73 0d 0a 23 20 69 6e 20 69 74 73 20 6f 77 6e  is..# in its own
4590: 20 73 6f 75 72 63 65 2e 20 49 74 20 77 69 6c 6c   source. It will
45a0: 20 62 65 20 6b 65 70 74 20 75 70 64 61 74 65 64   be kept updated
45b0: 20 74 68 65 72 65 2e 0d 0a 23 0d 0a 23 20 45 78   there...#..# Ex
45c0: 74 65 6e 73 69 6f 6e 73 20 62 75 69 6c 74 20 61  tensions built a
45d0: 67 61 69 6e 73 74 20 61 6e 20 69 6e 73 74 61 6c  gainst an instal
45e0: 6c 65 64 20 54 63 6c 20 77 69 6c 6c 20 75 73 65  led Tcl will use
45f0: 20 74 68 65 20 69 6e 73 74 61 6c 6c 65 64 0d 0a   the installed..
4600: 23 20 63 6f 70 79 20 6f 66 20 54 63 6c 27 73 20  # copy of Tcl's 
4610: 6e 6d 61 6b 65 68 6c 70 2e 63 20 69 66 20 74 68  nmakehlp.c if th
4620: 65 72 65 20 69 73 20 6f 6e 65 20 61 6e 64 20 74  ere is one and t
4630: 68 65 69 72 20 6f 77 6e 20 76 65 72 73 69 6f 6e  heir own version
4640: 0d 0a 23 20 6f 74 68 65 72 77 69 73 65 2e 20 49  ..# otherwise. I
4650: 6e 20 74 68 65 20 6c 61 74 74 65 72 20 63 61 73  n the latter cas
4660: 65 2c 20 74 68 65 79 20 77 6f 75 6c 64 20 61 6c  e, they would al
4670: 73 6f 20 62 65 20 75 73 69 6e 67 20 74 68 65 69  so be using thei
4680: 72 20 6f 77 6e 0d 0a 23 20 72 75 6c 65 73 2e 76  r own..# rules.v
4690: 63 2e 20 4e 6f 74 65 20 74 68 61 74 20 6f 6c 64  c. Note that old
46a0: 65 72 20 76 65 72 73 69 6f 6e 73 20 6f 66 20 54  er versions of T
46b0: 63 6c 20 64 6f 20 6e 6f 74 20 69 6e 73 74 61 6c  cl do not instal
46c0: 6c 20 6e 6d 61 6b 65 68 6c 70 2e 63 0d 0a 23 20  l nmakehlp.c..# 
46d0: 6f 72 20 72 75 6c 65 73 2e 76 63 2e 0d 0a 23 0d  or rules.vc...#.
46e0: 0a 23 20 45 78 74 65 6e 73 69 6f 6e 73 20 62 75  .# Extensions bu
46f0: 69 6c 74 20 61 67 61 69 6e 73 74 20 54 63 6c 20  ilt against Tcl 
4700: 73 6f 75 72 63 65 73 20 77 69 6c 6c 20 75 73 65  sources will use
4710: 20 74 68 65 20 6f 6e 65 20 66 72 6f 6d 20 74 68   the one from th
4720: 65 20 54 63 6c 20 73 6f 75 72 63 65 2e 0d 0a 23  e Tcl source...#
4730: 0d 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e  ..# When buildin
4740: 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20 75  g an extension u
4750: 73 69 6e 67 20 61 20 73 75 66 66 69 63 69 65 6e  sing a sufficien
4760: 74 6c 79 20 6e 65 77 20 76 65 72 73 69 6f 6e 20  tly new version 
4770: 6f 66 20 54 63 6c 2c 0d 0a 23 20 72 75 6c 65 73  of Tcl,..# rules
4780: 2d 65 78 74 2e 76 63 20 77 69 6c 6c 20 64 65 66  -ext.vc will def
4790: 69 6e 65 20 4e 4d 41 4b 45 48 4c 50 43 20 61 70  ine NMAKEHLPC ap
47a0: 70 72 6f 70 72 69 61 74 65 6c 79 20 74 6f 20 70  propriately to p
47b0: 6f 69 6e 74 20 74 6f 20 74 68 65 0d 0a 23 20 63  oint to the..# c
47c0: 6f 70 79 20 6f 66 20 6e 6d 61 6b 65 68 6c 70 2e  opy of nmakehlp.
47d0: 63 20 74 6f 20 62 65 20 75 73 65 64 2e 0d 0a 0d  c to be used....
47e0: 0a 21 69 66 6e 64 65 66 20 4e 4d 41 4b 45 48 4c  .!ifndef NMAKEHL
47f0: 50 43 0d 0a 23 20 44 65 66 61 75 6c 74 20 74 6f  PC..# Default to
4800: 20 74 68 65 20 6f 6e 65 20 69 6e 20 74 68 65 20   the one in the 
4810: 63 75 72 72 65 6e 74 20 64 69 72 65 63 74 6f 72  current director
4820: 79 20 28 74 68 65 20 65 78 74 65 6e 73 69 6f 6e  y (the extension
4830: 27 73 20 6f 77 6e 20 6e 6d 61 6b 65 68 6c 70 2e  's own nmakehlp.
4840: 63 29 0d 0a 4e 4d 41 4b 45 48 4c 50 43 20 3d 20  c)..NMAKEHLPC = 
4850: 6e 6d 61 6b 65 68 6c 70 2e 63 0d 0a 0d 0a 21 69  nmakehlp.c....!i
4860: 66 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d  f !$(DOING_TCL).
4870: 0a 21 69 66 20 24 28 54 43 4c 49 4e 53 54 41 4c  .!if $(TCLINSTAL
4880: 4c 29 0d 0a 21 69 66 20 65 78 69 73 74 28 22 24  L)..!if exist("$
4890: 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d  (_TCLDIR)\lib\nm
48a0: 61 6b 65 5c 6e 6d 61 6b 65 68 6c 70 2e 63 22 29  ake\nmakehlp.c")
48b0: 0d 0a 4e 4d 41 4b 45 48 4c 50 43 20 3d 20 24 28  ..NMAKEHLPC = $(
48c0: 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d 61  _TCLDIR)\lib\nma
48d0: 6b 65 5c 6e 6d 61 6b 65 68 6c 70 2e 63 0d 0a 21  ke\nmakehlp.c..!
48e0: 65 6e 64 69 66 0d 0a 21 65 6c 73 65 20 23 20 21  endif..!else # !
48f0: 24 28 54 43 4c 49 4e 53 54 41 4c 4c 29 0d 0a 21  $(TCLINSTALL)..!
4900: 69 66 20 65 78 69 73 74 28 22 24 28 5f 54 43 4c  if exist("$(_TCL
4910: 44 49 52 29 5c 77 69 6e 5c 6e 6d 61 6b 65 68 6c  DIR)\win\nmakehl
4920: 70 2e 63 22 29 0d 0a 4e 4d 41 4b 45 48 4c 50 43  p.c")..NMAKEHLPC
4930: 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69   = $(_TCLDIR)\wi
4940: 6e 5c 6e 6d 61 6b 65 68 6c 70 2e 63 0d 0a 21 65  n\nmakehlp.c..!e
4950: 6e 64 69 66 0d 0a 21 65 6e 64 69 66 20 23 20 24  ndif..!endif # $
4960: 28 54 43 4c 49 4e 53 54 41 4c 4c 29 0d 0a 21 65  (TCLINSTALL)..!e
4970: 6e 64 69 66 20 23 20 21 24 28 44 4f 49 4e 47 5f  ndif # !$(DOING_
4980: 54 43 4c 29 0d 0a 0d 0a 21 65 6e 64 69 66 20 23  TCL)....!endif #
4990: 20 4e 4d 41 4b 45 48 4c 50 43 0d 0a 0d 0a 23 20   NMAKEHLPC....# 
49a0: 57 65 20 61 6c 77 61 79 73 20 62 75 69 6c 64 20  We always build 
49b0: 6e 6d 61 6b 65 68 6c 70 20 65 76 65 6e 20 69 66  nmakehlp even if
49c0: 20 69 74 20 65 78 69 73 74 73 20 73 69 6e 63 65   it exists since
49d0: 20 77 65 20 64 6f 20 6e 6f 74 20 6b 6e 6f 77 0d   we do not know.
49e0: 0a 23 20 77 68 61 74 20 73 6f 75 72 63 65 20 69  .# what source i
49f0: 74 20 77 61 73 20 62 75 69 6c 74 20 66 72 6f 6d  t was built from
4a00: 2e 0d 0a 21 69 66 20 5b 24 28 63 63 33 32 29 20  ...!if [$(cc32) 
4a10: 2d 6e 6f 6c 6f 67 6f 20 2d 44 4e 44 45 42 55 47  -nologo -DNDEBUG
4a20: 20 22 24 28 4e 4d 41 4b 45 48 4c 50 43 29 22 20   "$(NMAKEHLPC)" 
4a30: 2d 6c 69 6e 6b 20 2d 73 75 62 73 79 73 74 65 6d  -link -subsystem
4a40: 3a 63 6f 6e 73 6f 6c 65 20 3e 20 6e 75 6c 5d 0d  :console > nul].
4a50: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 23 23 23 23  .!endif....#####
4a60: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4a70: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4a80: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
4a90: 23 23 23 23 23 23 23 23 23 23 23 0d 0a 23 20 35  ###########..# 5
4aa0: 2e 20 54 65 73 74 20 66 6f 72 20 63 6f 6d 70 69  . Test for compi
4ab0: 6c 65 72 20 66 65 61 74 75 72 65 73 0d 0a 23 20  ler features..# 
4ac0: 56 69 73 75 61 6c 20 43 2b 2b 20 63 6f 6d 70 69  Visual C++ compi
4ad0: 6c 65 72 20 6f 70 74 69 6f 6e 73 20 68 61 76 65  ler options have
4ae0: 20 63 68 61 6e 67 65 64 20 6f 76 65 72 20 74 68   changed over th
4af0: 65 20 79 65 61 72 73 2e 20 43 68 65 63 6b 0d 0a  e years. Check..
4b00: 23 20 77 68 69 63 68 20 6f 70 74 69 6f 6e 73 20  # which options 
4b10: 61 72 65 20 73 75 70 70 6f 72 74 65 64 20 62 79  are supported by
4b20: 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 69 6e   the compiler in
4b30: 20 75 73 65 2e 0d 0a 23 0d 0a 23 20 54 68 65 20   use...#..# The 
4b40: 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73  following macros
4b50: 20 61 72 65 20 73 65 74 3a 0d 0a 23 20 4f 50 54   are set:..# OPT
4b60: 49 4d 49 5a 41 54 49 4f 4e 53 20 2d 20 74 68 65  IMIZATIONS - the
4b70: 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73 20   compiler flags 
4b80: 74 6f 20 62 65 20 75 73 65 64 20 66 6f 72 20 6f  to be used for o
4b90: 70 74 69 6d 69 7a 65 64 20 62 75 69 6c 64 73 0d  ptimized builds.
4ba0: 0a 23 20 44 45 42 55 47 46 4c 41 47 53 20 2d 20  .# DEBUGFLAGS - 
4bb0: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61  the compiler fla
4bc0: 67 73 20 74 6f 20 62 65 20 75 73 65 64 20 66 6f  gs to be used fo
4bd0: 72 20 64 65 62 75 67 20 62 75 69 6c 64 73 0d 0a  r debug builds..
4be0: 23 20 4c 49 4e 4b 45 52 46 4c 41 47 53 20 2d 20  # LINKERFLAGS - 
4bf0: 46 6c 61 67 73 20 70 61 73 73 65 64 20 74 6f 20  Flags passed to 
4c00: 74 68 65 20 6c 69 6e 6b 65 72 0d 0a 23 0d 0a 23  the linker..#..#
4c10: 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 73 65   Note that these
4c20: 20 61 72 65 20 74 68 65 20 63 6f 6d 70 69 6c 65   are the compile
4c30: 72 20 73 65 74 74 69 6e 67 73 20 2a 61 76 61 69  r settings *avai
4c40: 6c 61 62 6c 65 2a 2c 20 6e 6f 74 20 74 68 6f 73  lable*, not thos
4c50: 65 0d 0a 23 20 74 68 61 74 20 77 69 6c 6c 20 62  e..# that will b
4c60: 65 20 2a 75 73 65 64 2a 2e 20 54 68 65 20 6c 61  e *used*. The la
4c70: 74 74 65 72 20 64 65 70 65 6e 64 73 20 6f 6e 20  tter depends on 
4c80: 74 68 65 20 4f 50 54 53 20 6d 61 63 72 6f 20 73  the OPTS macro s
4c90: 65 74 74 69 6e 67 73 0d 0a 23 20 77 68 69 63 68  ettings..# which
4ca0: 20 77 65 20 68 61 76 65 20 6e 6f 74 20 79 65 74   we have not yet
4cb0: 20 70 61 72 73 65 64 2e 0d 0a 23 0d 0a 23 20 41   parsed...#..# A
4cc0: 6c 73 6f 20 6e 6f 74 65 20 74 68 61 74 20 73 6f  lso note that so
4cd0: 6d 65 20 6f 66 20 74 68 65 20 66 6c 61 67 73 20  me of the flags 
4ce0: 69 6e 20 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53  in OPTIMIZATIONS
4cf0: 20 61 72 65 20 6e 6f 74 20 72 65 61 6c 6c 79 0d   are not really.
4d00: 0a 23 20 72 65 6c 61 74 65 64 20 74 6f 20 6f 70  .# related to op
4d10: 74 69 6d 69 7a 61 74 69 6f 6e 2e 20 54 68 65 79  timization. They
4d20: 20 61 72 65 20 70 6c 61 63 65 64 20 74 68 65 72   are placed ther
4d30: 65 20 6f 6e 6c 79 20 66 6f 72 20 6c 65 67 61 63  e only for legac
4d40: 79 20 72 65 61 73 6f 6e 73 0d 0a 23 20 61 73 20  y reasons..# as 
4d50: 73 6f 6d 65 20 65 78 74 65 6e 73 69 6f 6e 73 20  some extensions 
4d60: 65 78 70 65 63 74 20 74 68 65 6d 20 74 6f 20 62  expect them to b
4d70: 65 20 69 6e 63 6c 75 64 65 64 20 69 6e 20 74 68  e included in th
4d80: 61 74 20 6d 61 63 72 6f 2e 0d 0a 0d 0a 23 20 2d  at macro.....# -
4d90: 4f 70 20 69 6d 70 72 6f 76 65 73 20 66 6c 6f 61  Op improves floa
4da0: 74 20 63 6f 6e 73 69 73 74 65 6e 63 79 2e 20 4e  t consistency. N
4db0: 6f 74 65 20 6f 6e 6c 79 20 6e 65 65 64 65 64 20  ote only needed 
4dc0: 66 6f 72 20 6f 6c 64 65 72 20 63 6f 6d 70 69 6c  for older compil
4dd0: 65 72 73 0d 0a 23 20 4e 65 77 65 72 20 63 6f 6d  ers..# Newer com
4de0: 70 69 6c 65 72 73 20 64 6f 20 6e 6f 74 20 6e 65  pilers do not ne
4df0: 65 64 20 6f 72 20 73 75 70 70 6f 72 74 20 74 68  ed or support th
4e00: 69 73 20 6f 70 74 69 6f 6e 2e 0d 0a 21 69 66 20  is option...!if 
4e10: 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49  [$(NMAKEHLP_NATI
4e20: 56 45 29 20 2d 63 20 2d 4f 70 5d 0d 0a 46 50 4f  VE) -c -Op]..FPO
4e30: 50 54 53 20 20 3d 20 2d 4f 70 0d 0a 21 65 6e 64  PTS  = -Op..!end
4e40: 69 66 0d 0a 0d 0a 23 20 53 74 72 69 63 74 20 66  if....# Strict f
4e50: 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74 20 73 65  loating point se
4e60: 6d 61 6e 74 69 63 73 20 2d 20 70 72 65 73 65 6e  mantics - presen
4e70: 74 20 69 6e 20 6e 65 77 65 72 20 63 6f 6d 70 69  t in newer compi
4e80: 6c 65 72 73 20 69 6e 20 6c 69 65 75 20 6f 66 20  lers in lieu of 
4e90: 2d 4f 70 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b  -Op..!if [$(NMAK
4ea0: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 63 20  EHLP_NATIVE) -c 
4eb0: 2d 66 70 3a 73 74 72 69 63 74 5d 0d 0a 46 50 4f  -fp:strict]..FPO
4ec0: 50 54 53 20 20 3d 20 24 28 46 50 4f 50 54 53 29  PTS  = $(FPOPTS)
4ed0: 20 2d 66 70 3a 73 74 72 69 63 74 0d 0a 21 65 6e   -fp:strict..!en
4ee0: 64 69 66 0d 0a 0d 0a 21 69 66 20 22 24 28 4d 41  dif....!if "$(MA
4ef0: 43 48 49 4e 45 29 22 20 3d 3d 20 22 49 58 38 36  CHINE)" == "IX86
4f00: 22 0d 0a 23 23 23 20 74 65 73 74 20 66 6f 72 20  "..### test for 
4f10: 70 65 6e 74 69 75 6d 20 65 72 72 61 74 61 0d 0a  pentium errata..
4f20: 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f  !if [$(NMAKEHLP_
4f30: 4e 41 54 49 56 45 29 20 2d 63 20 2d 51 49 30 66  NATIVE) -c -QI0f
4f40: 5d 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20  ]..!message *** 
4f50: 43 6f 6d 70 69 6c 65 72 20 68 61 73 20 27 50 65  Compiler has 'Pe
4f60: 6e 74 69 75 6d 20 30 78 30 66 20 66 69 78 27 0d  ntium 0x0f fix'.
4f70: 0a 46 50 4f 50 54 53 20 20 3d 20 24 28 46 50 4f  .FPOPTS  = $(FPO
4f80: 50 54 53 29 20 2d 51 49 30 66 0d 0a 21 65 6c 73  PTS) -QI0f..!els
4f90: 65 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20  e..!message *** 
4fa0: 43 6f 6d 70 69 6c 65 72 20 64 6f 65 73 20 6e 6f  Compiler does no
4fb0: 74 20 68 61 76 65 20 27 50 65 6e 74 69 75 6d 20  t have 'Pentium 
4fc0: 30 78 30 66 20 66 69 78 27 0d 0a 21 65 6e 64 69  0x0f fix'..!endi
4fd0: 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 23 23  f..!endif....###
4fe0: 20 74 65 73 74 20 66 6f 72 20 6f 70 74 69 6d 69   test for optimi
4ff0: 7a 61 74 69 6f 6e 73 0d 0a 23 20 2f 4f 32 20 6f  zations..# /O2 o
5000: 70 74 69 6d 69 7a 61 74 69 6f 6e 20 69 6e 63 6c  ptimization incl
5010: 75 64 65 73 20 2f 4f 67 20 2f 4f 69 20 2f 4f 74  udes /Og /Oi /Ot
5020: 20 2f 4f 79 20 2f 4f 62 32 20 2f 47 73 20 2f 47   /Oy /Ob2 /Gs /G
5030: 46 20 2f 47 79 20 61 73 20 70 65 72 0d 0a 23 20  F /Gy as per..# 
5040: 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 20 4e  documentation. N
5050: 6f 74 65 20 77 65 20 64 6f 20 4e 4f 54 20 77 61  ote we do NOT wa
5060: 6e 74 20 2f 47 73 20 61 73 20 74 68 61 74 20 69  nt /Gs as that i
5070: 6e 73 65 72 74 73 20 61 20 5f 63 68 6b 73 74 6b  nserts a _chkstk
5080: 0d 0a 23 20 73 74 61 63 6b 20 70 72 6f 62 65 20  ..# stack probe 
5090: 61 74 20 2a 65 76 65 72 79 2a 20 66 75 6e 63 74  at *every* funct
50a0: 69 6f 6e 20 65 6e 74 72 79 2c 20 6e 6f 74 20 6a  ion entry, not j
50b0: 75 73 74 20 74 68 6f 73 65 20 77 69 74 68 20 6d  ust those with m
50c0: 6f 72 65 20 74 68 61 6e 0d 0a 23 20 61 20 70 61  ore than..# a pa
50d0: 67 65 20 6f 66 20 73 74 61 63 6b 20 61 6c 6c 6f  ge of stack allo
50e0: 63 61 74 69 6f 6e 20 72 65 73 75 6c 74 69 6e 67  cation resulting
50f0: 20 69 6e 20 61 20 70 65 72 66 6f 72 6d 61 6e 63   in a performanc
5100: 65 20 68 69 74 2e 20 20 48 6f 77 65 76 65 72 2c  e hit.  However,
5110: 0d 0a 23 20 2f 4f 32 20 64 6f 63 75 6d 65 6e 74  ..# /O2 document
5120: 61 74 69 6f 6e 20 69 73 20 6d 69 73 6c 65 61 64  ation is mislead
5130: 69 6e 67 20 61 73 20 69 74 73 20 73 74 61 63 6b  ing as its stack
5140: 20 70 72 6f 62 65 73 20 61 72 65 20 73 69 6d 70   probes are simp
5150: 6c 79 20 74 68 65 0d 0a 23 20 64 65 66 61 75 6c  ly the..# defaul
5160: 74 20 70 61 67 65 20 73 69 7a 65 20 6c 6f 63 61  t page size loca
5170: 6c 73 20 61 6c 6c 6f 63 61 74 69 6f 6e 20 70 72  ls allocation pr
5180: 6f 62 65 73 20 61 6e 64 20 6e 6f 74 20 77 68 61  obes and not wha
5190: 74 20 69 73 20 69 6d 70 6c 69 65 64 0d 0a 23 20  t is implied..# 
51a0: 62 79 20 61 6e 20 65 78 70 6c 69 63 69 74 20 2f  by an explicit /
51b0: 47 73 20 6f 70 74 69 6f 6e 2e 0d 0a 0d 0a 4f 50  Gs option.....OP
51c0: 54 49 4d 49 5a 41 54 49 4f 4e 53 20 3d 20 24 28  TIMIZATIONS = $(
51d0: 46 50 4f 50 54 53 29 0d 0a 0d 0a 21 69 66 20 5b  FPOPTS)....!if [
51e0: 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56  $(NMAKEHLP_NATIV
51f0: 45 29 20 2d 63 20 2d 4f 32 5d 0d 0a 4f 50 54 49  E) -c -O2]..OPTI
5200: 4d 49 5a 49 4e 47 20 3d 20 31 0d 0a 4f 50 54 49  MIZING = 1..OPTI
5210: 4d 49 5a 41 54 49 4f 4e 53 20 20 20 3d 20 24 28  MIZATIONS   = $(
5220: 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 29 20 2d  OPTIMIZATIONS) -
5230: 4f 32 0d 0a 21 65 6c 73 65 0d 0a 23 20 4c 65 67  O2..!else..# Leg
5240: 61 63 79 2c 20 72 65 61 6c 6c 79 2e 20 41 6c 6c  acy, really. All
5250: 20 6d 6f 64 65 72 6e 20 63 6f 6d 70 69 6c 65 72   modern compiler
5260: 73 20 73 75 70 70 6f 72 74 20 74 68 69 73 0d 0a  s support this..
5270: 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 43 6f 6d  !message *** Com
5280: 70 69 6c 65 72 20 64 6f 65 73 20 6e 6f 74 20 68  piler does not h
5290: 61 76 65 20 27 4f 70 74 69 6d 69 7a 61 74 69 6f  ave 'Optimizatio
52a0: 6e 73 27 0d 0a 4f 50 54 49 4d 49 5a 49 4e 47 20  ns'..OPTIMIZING 
52b0: 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23  = 0..!endif....#
52c0: 20 43 68 65 63 6b 73 20 66 6f 72 20 62 75 66 66   Checks for buff
52d0: 65 72 20 6f 76 65 72 66 6c 6f 77 73 20 69 6e 20  er overflows in 
52e0: 6c 6f 63 61 6c 20 61 72 72 61 79 73 0d 0a 21 69  local arrays..!i
52f0: 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41  f [$(NMAKEHLP_NA
5300: 54 49 56 45 29 20 2d 63 20 2d 47 53 5d 0d 0a 4f  TIVE) -c -GS]..O
5310: 50 54 49 4d 49 5a 41 54 49 4f 4e 53 20 20 3d 20  PTIMIZATIONS  = 
5320: 24 28 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 29  $(OPTIMIZATIONS)
5330: 20 2d 47 53 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a   -GS..!endif....
5340: 23 20 4c 69 6e 6b 20 74 69 6d 65 20 6f 70 74 69  # Link time opti
5350: 6d 69 7a 61 74 69 6f 6e 2e 20 4e 6f 74 65 20 74  mization. Note t
5360: 68 61 74 20 74 68 69 73 20 6f 70 74 69 6f 6e 20  hat this option 
5370: 28 70 6f 74 65 6e 74 69 61 6c 6c 79 29 20 6d 61  (potentially) ma
5380: 6b 65 73 0d 0a 23 20 67 65 6e 65 72 61 74 65 64  kes..# generated
5390: 20 6c 69 62 72 61 72 69 65 73 20 6f 6e 6c 79 20   libraries only 
53a0: 75 73 61 62 6c 65 20 62 79 20 74 68 65 20 73 70  usable by the sp
53b0: 65 63 69 66 69 63 20 56 43 2b 2b 20 76 65 72 73  ecific VC++ vers
53c0: 69 6f 6e 20 74 68 61 74 0d 0a 23 20 63 72 65 61  ion that..# crea
53d0: 74 65 64 20 69 74 2e 20 52 65 71 75 69 72 65 73  ted it. Requires
53e0: 20 2f 4c 54 43 47 20 6c 69 6e 6b 65 72 20 6f 70   /LTCG linker op
53f0: 74 69 6f 6e 0d 0a 21 69 66 20 5b 24 28 4e 4d 41  tion..!if [$(NMA
5400: 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 63  KEHLP_NATIVE) -c
5410: 20 2d 47 4c 5d 0d 0a 4f 50 54 49 4d 49 5a 41 54   -GL]..OPTIMIZAT
5420: 49 4f 4e 53 20 20 3d 20 24 28 4f 50 54 49 4d 49  IONS  = $(OPTIMI
5430: 5a 41 54 49 4f 4e 53 29 20 2d 47 4c 0d 0a 43 43  ZATIONS) -GL..CC
5440: 5f 47 4c 5f 4f 50 54 5f 45 4e 41 42 4c 45 44 20  _GL_OPT_ENABLED 
5450: 3d 20 31 0d 0a 21 65 6c 73 65 0d 0a 23 20 49 6e  = 1..!else..# In
5460: 20 6e 65 77 65 72 20 63 6f 6d 70 69 6c 65 72 73   newer compilers
5470: 20 2d 47 4c 20 61 6e 64 20 2d 59 58 20 61 72 65   -GL and -YX are
5480: 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 2e 0d 0a   incompatible...
5490: 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f  !if [$(NMAKEHLP_
54a0: 4e 41 54 49 56 45 29 20 2d 63 20 2d 59 58 5d 0d  NATIVE) -c -YX].
54b0: 0a 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 20 20  .OPTIMIZATIONS  
54c0: 3d 20 24 28 4f 50 54 49 4d 49 5a 41 54 49 4f 4e  = $(OPTIMIZATION
54d0: 53 29 20 2d 59 58 0d 0a 21 65 6e 64 69 66 0d 0a  S) -YX..!endif..
54e0: 21 65 6e 64 69 66 20 23 20 5b 24 28 4e 4d 41 4b  !endif # [$(NMAK
54f0: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 63 20  EHLP_NATIVE) -c 
5500: 2d 47 4c 5d 0d 0a 0d 0a 44 45 42 55 47 46 4c 41  -GL]....DEBUGFLA
5510: 47 53 20 20 20 20 20 3d 20 24 28 46 50 4f 50 54  GS     = $(FPOPT
5520: 53 29 0d 0a 0d 0a 23 20 52 75 6e 20 74 69 6d 65  S)....# Run time
5530: 20 65 72 72 6f 72 20 63 68 65 63 6b 73 2e 20 4e   error checks. N
5540: 6f 74 20 61 76 61 69 6c 61 62 6c 65 20 6f 72 20  ot available or 
5550: 76 61 6c 69 64 20 69 6e 20 61 20 72 65 6c 65 61  valid in a relea
5560: 73 65 2c 20 6e 6f 6e 2d 64 65 62 75 67 20 62 75  se, non-debug bu
5570: 69 6c 64 0d 0a 23 20 52 54 43 20 69 73 20 66 6f  ild..# RTC is fo
5580: 72 20 6d 6f 64 65 72 6e 20 63 6f 6d 70 69 6c 65  r modern compile
5590: 72 73 2c 20 2d 47 5a 20 69 73 20 6c 65 67 61 63  rs, -GZ is legac
55a0: 79 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48  y..!if [$(NMAKEH
55b0: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 63 20 2d 52  LP_NATIVE) -c -R
55c0: 54 43 31 5d 0d 0a 44 45 42 55 47 46 4c 41 47 53  TC1]..DEBUGFLAGS
55d0: 20 20 20 20 20 3d 20 24 28 44 45 42 55 47 46 4c       = $(DEBUGFL
55e0: 41 47 53 29 20 2d 52 54 43 31 0d 0a 21 65 6c 73  AGS) -RTC1..!els
55f0: 65 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f  eif [$(NMAKEHLP_
5600: 4e 41 54 49 56 45 29 20 2d 63 20 2d 47 5a 5d 0d  NATIVE) -c -GZ].
5610: 0a 44 45 42 55 47 46 4c 41 47 53 20 20 20 20 20  .DEBUGFLAGS     
5620: 3d 20 24 28 44 45 42 55 47 46 4c 41 47 53 29 20  = $(DEBUGFLAGS) 
5630: 2d 47 5a 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23  -GZ..!endif....#
5640: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5650: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5660: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5670: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5680: 0d 0a 23 20 4c 69 6e 6b 65 72 20 66 6c 61 67 73  ..# Linker flags
5690: 0d 0a 0d 0a 23 20 4c 49 4e 4b 45 52 5f 54 45 53  ....# LINKER_TES
56a0: 54 46 4c 41 47 53 20 61 72 65 20 66 6f 72 20 69  TFLAGS are for i
56b0: 6e 74 65 72 6e 61 6c 20 75 73 65 20 77 68 65 6e  nternal use when
56c0: 20 77 65 20 63 61 6c 6c 20 6e 6d 61 6b 65 68 6c   we call nmakehl
56d0: 70 20 74 6f 20 74 65 73 74 0d 0a 23 20 69 66 20  p to test..# if 
56e0: 74 68 65 20 6c 69 6e 6b 65 72 20 73 75 70 70 6f  the linker suppo
56f0: 72 74 73 20 61 20 73 70 65 63 69 66 69 63 20 6f  rts a specific o
5700: 70 74 69 6f 6e 2e 20 57 69 74 68 6f 75 74 20 74  ption. Without t
5710: 68 65 73 65 20 66 6c 61 67 73 20 6c 69 6e 6b 20  hese flags link 
5720: 77 69 6c 6c 0d 0a 23 20 72 65 74 75 72 6e 20 22  will..# return "
5730: 4c 4e 4b 31 35 36 31 3a 20 65 6e 74 72 79 20 70  LNK1561: entry p
5740: 6f 69 6e 74 20 6d 75 73 74 20 62 65 20 64 65 66  oint must be def
5750: 69 6e 65 64 22 20 65 72 72 6f 72 20 63 6f 6d 70  ined" error comp
5760: 69 6c 69 6e 67 20 66 72 6f 6d 20 56 53 2d 49 44  iling from VS-ID
5770: 45 3a 0d 0a 23 20 54 68 65 79 20 61 72 65 20 6e  E:..# They are n
5780: 6f 74 20 70 61 73 73 65 64 20 74 68 72 6f 75 67  ot passed throug
5790: 68 20 74 6f 20 74 68 65 20 61 63 74 75 61 6c 20  h to the actual 
57a0: 61 70 70 6c 69 63 61 74 69 6f 6e 20 2f 20 65 78  application / ex
57b0: 74 65 6e 73 69 6f 6e 0d 0a 23 20 6c 69 6e 6b 20  tension..# link 
57c0: 72 75 6c 65 73 2e 0d 0a 21 69 66 6e 64 65 66 20  rules...!ifndef 
57d0: 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41 47 53  LINKER_TESTFLAGS
57e0: 0d 0a 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41  ..LINKER_TESTFLA
57f0: 47 53 20 3d 20 2f 44 4c 4c 20 2f 4e 4f 45 4e 54  GS = /DLL /NOENT
5800: 52 59 20 2f 4f 55 54 3a 6e 6d 61 6b 65 68 6c 70  RY /OUT:nmakehlp
5810: 2e 6f 75 74 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a  .out..!endif....
5820: 4c 49 4e 4b 45 52 46 4c 41 47 53 20 20 20 20 20  LINKERFLAGS     
5830: 3d 0d 0a 0d 0a 23 20 49 66 20 63 6f 6d 70 69 6c  =....# If compil
5840: 65 72 20 68 61 73 20 65 6e 61 62 6c 65 64 20 6c  er has enabled l
5850: 69 6e 6b 20 74 69 6d 65 20 6f 70 74 69 6d 69 7a  ink time optimiz
5860: 61 74 69 6f 6e 2c 20 6c 69 6e 6b 65 72 20 6d 75  ation, linker mu
5870: 73 74 20 74 6f 6f 20 77 69 74 68 20 2d 6c 74 63  st too with -ltc
5880: 67 0d 0a 21 69 66 64 65 66 20 43 43 5f 47 4c 5f  g..!ifdef CC_GL_
5890: 4f 50 54 5f 45 4e 41 42 4c 45 44 0d 0a 21 69 66  OPT_ENABLED..!if
58a0: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54   [$(NMAKEHLP_NAT
58b0: 49 56 45 29 20 2d 6c 20 2d 6c 74 63 67 20 24 28  IVE) -l -ltcg $(
58c0: 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41 47 53  LINKER_TESTFLAGS
58d0: 29 5d 0d 0a 4c 49 4e 4b 45 52 46 4c 41 47 53 20  )]..LINKERFLAGS 
58e0: 20 20 20 20 3d 20 24 28 4c 49 4e 4b 45 52 46 4c      = $(LINKERFL
58f0: 41 47 53 29 20 2d 6c 74 63 67 0d 0a 21 65 6e 64  AGS) -ltcg..!end
5900: 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 0d 0a  if..!endif......
5910: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5920: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5930: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5940: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
5950: 0d 0a 23 20 36 2e 20 45 78 74 72 61 63 74 20 76  ..# 6. Extract v
5960: 61 72 69 6f 75 73 20 76 65 72 73 69 6f 6e 20 6e  arious version n
5970: 75 6d 62 65 72 73 20 66 72 6f 6d 20 68 65 61 64  umbers from head
5980: 65 72 73 0d 0a 23 20 46 6f 72 20 54 63 6c 20 61  ers..# For Tcl a
5990: 6e 64 20 54 6b 2c 20 76 65 72 73 69 6f 6e 20 6e  nd Tk, version n
59a0: 75 6d 62 65 72 73 20 61 72 65 20 65 78 74 72 61  umbers are extra
59b0: 63 74 65 64 20 66 72 6f 6d 20 74 63 6c 2e 68 20  cted from tcl.h 
59c0: 61 6e 64 20 74 6b 2e 68 0d 0a 23 20 72 65 73 70  and tk.h..# resp
59d0: 65 63 74 69 76 65 6c 79 2e 20 46 6f 72 20 65 78  ectively. For ex
59e0: 74 65 6e 73 69 6f 6e 73 2c 20 76 65 72 73 69 6f  tensions, versio
59f0: 6e 73 20 61 72 65 20 65 78 74 72 61 63 74 65 64  ns are extracted
5a00: 20 66 72 6f 6d 20 74 68 65 0d 0a 23 20 63 6f 6e   from the..# con
5a10: 66 69 67 75 72 65 2e 69 6e 20 6f 72 20 63 6f 6e  figure.in or con
5a20: 66 69 67 75 72 65 2e 61 63 20 66 72 6f 6d 20 74  figure.ac from t
5a30: 68 65 20 54 45 41 20 63 6f 6e 66 69 67 75 72 61  he TEA configura
5a40: 74 69 6f 6e 20 69 66 20 69 74 0d 0a 23 20 65 78  tion if it..# ex
5a50: 69 73 74 73 2c 20 61 6e 64 20 75 6e 73 65 74 20  ists, and unset 
5a60: 6f 74 68 65 72 77 69 73 65 2e 0d 0a 23 20 53 65  otherwise...# Se
5a70: 74 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  ts the following
5a80: 20 6d 61 63 72 6f 73 3a 0d 0a 23 20 54 43 4c 5f   macros:..# TCL_
5a90: 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 0d 0a 23  MAJOR_VERSION..#
5aa0: 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49   TCL_MINOR_VERSI
5ab0: 4f 4e 0d 0a 23 20 54 43 4c 5f 52 45 4c 45 41 53  ON..# TCL_RELEAS
5ac0: 45 5f 53 45 52 49 41 4c 0d 0a 23 20 54 43 4c 5f  E_SERIAL..# TCL_
5ad0: 50 41 54 43 48 5f 4c 45 56 45 4c 0d 0a 23 20 54  PATCH_LEVEL..# T
5ae0: 43 4c 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 0d  CL_PATCH_LETTER.
5af0: 0a 23 20 54 43 4c 5f 56 45 52 53 49 4f 4e 0d 0a  .# TCL_VERSION..
5b00: 23 20 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  # TK_MAJOR_VERSI
5b10: 4f 4e 0d 0a 23 20 54 4b 5f 4d 49 4e 4f 52 5f 56  ON..# TK_MINOR_V
5b20: 45 52 53 49 4f 4e 0d 0a 23 20 54 4b 5f 52 45 4c  ERSION..# TK_REL
5b30: 45 41 53 45 5f 53 45 52 49 41 4c 0d 0a 23 20 54  EASE_SERIAL..# T
5b40: 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 0d 0a 23  K_PATCH_LEVEL..#
5b50: 20 54 4b 5f 50 41 54 43 48 5f 4c 45 54 54 45 52   TK_PATCH_LETTER
5b60: 0d 0a 23 20 54 4b 5f 56 45 52 53 49 4f 4e 0d 0a  ..# TK_VERSION..
5b70: 23 20 44 4f 54 56 45 52 53 49 4f 4e 20 2d 20 73  # DOTVERSION - s
5b80: 65 74 20 61 73 20 28 66 6f 72 20 65 78 61 6d 70  et as (for examp
5b90: 6c 65 29 20 32 2e 35 0d 0a 23 20 56 45 52 53 49  le) 2.5..# VERSI
5ba0: 4f 4e 20 2d 20 73 65 74 20 61 73 20 28 66 6f 72  ON - set as (for
5bb0: 20 65 78 61 6d 70 6c 65 20 32 35 29 0d 0a 23 2d   example 25)..#-
5bc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5bd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5be0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5bf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 0d  -------------...
5c00: 0a 21 69 66 20 5b 65 63 68 6f 20 52 45 4d 20 3d  .!if [echo REM =
5c10: 20 54 68 69 73 20 66 69 6c 65 20 69 73 20 67 65   This file is ge
5c20: 6e 65 72 61 74 65 64 20 66 72 6f 6d 20 72 75 6c  nerated from rul
5c30: 65 73 2e 76 63 20 3e 20 76 65 72 73 69 6f 6e 73  es.vc > versions
5c40: 2e 76 63 5d 0d 0a 21 65 6e 64 69 66 0d 0a 21 69  .vc]..!endif..!i
5c50: 66 20 5b 65 63 68 6f 20 54 43 4c 5f 4d 41 4a 4f  f [echo TCL_MAJO
5c60: 52 5f 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20  R_VERSION = \>> 
5c70: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d 0a  versions.vc] \..
5c80: 20 20 20 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c     && [$(NMAKEHL
5c90: 50 5f 4e 41 54 49 56 45 29 20 2d 56 20 22 24 28  P_NATIVE) -V "$(
5ca0: 5f 54 43 4c 5f 48 29 22 20 22 64 65 66 69 6e 65  _TCL_H)" "define
5cb0: 20 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49   TCL_MAJOR_VERSI
5cc0: 4f 4e 22 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e  ON" >> versions.
5cd0: 76 63 5d 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66  vc]..!endif..!if
5ce0: 20 5b 65 63 68 6f 20 54 43 4c 5f 4d 49 4e 4f 52   [echo TCL_MINOR
5cf0: 5f 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76  _VERSION = \>> v
5d00: 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d 0a 20  ersions.vc] \.. 
5d10: 20 20 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50    && [$(NMAKEHLP
5d20: 5f 4e 41 54 49 56 45 29 20 2d 56 20 22 24 28 5f  _NATIVE) -V "$(_
5d30: 54 43 4c 5f 48 29 22 20 22 64 65 66 69 6e 65 20  TCL_H)" "define 
5d40: 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f  TCL_MINOR_VERSIO
5d50: 4e 22 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  N" >> versions.v
5d60: 63 5d 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20  c]..!endif..!if 
5d70: 5b 65 63 68 6f 20 54 43 4c 5f 52 45 4c 45 41 53  [echo TCL_RELEAS
5d80: 45 5f 53 45 52 49 41 4c 20 3d 20 5c 3e 3e 20 76  E_SERIAL = \>> v
5d90: 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d 0a 20  ersions.vc] \.. 
5da0: 20 20 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50    && [$(NMAKEHLP
5db0: 5f 4e 41 54 49 56 45 29 20 2d 56 20 22 24 28 5f  _NATIVE) -V "$(_
5dc0: 54 43 4c 5f 48 29 22 20 54 43 4c 5f 52 45 4c 45  TCL_H)" TCL_RELE
5dd0: 41 53 45 5f 53 45 52 49 41 4c 20 3e 3e 20 76 65  ASE_SERIAL >> ve
5de0: 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21 65 6e 64  rsions.vc]..!end
5df0: 69 66 0d 0a 21 69 66 20 5b 65 63 68 6f 20 54 43  if..!if [echo TC
5e00: 4c 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20 3d 20  L_PATCH_LEVEL = 
5e10: 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d  \>> versions.vc]
5e20: 20 5c 0d 0a 20 20 20 26 26 20 5b 24 28 4e 4d 41   \..   && [$(NMA
5e30: 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 56  KEHLP_NATIVE) -V
5e40: 20 22 24 28 5f 54 43 4c 5f 48 29 22 20 54 43 4c   "$(_TCL_H)" TCL
5e50: 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20 3e 3e 20  _PATCH_LEVEL >> 
5e60: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21 65  versions.vc]..!e
5e70: 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 64 65 66 69  ndif....!if defi
5e80: 6e 65 64 28 5f 54 4b 5f 48 29 0d 0a 21 69 66 20  ned(_TK_H)..!if 
5e90: 5b 65 63 68 6f 20 54 4b 5f 4d 41 4a 4f 52 5f 56  [echo TK_MAJOR_V
5ea0: 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76 65 72  ERSION = \>> ver
5eb0: 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d 0a 20 20 20  sions.vc] \..   
5ec0: 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e  && [$(NMAKEHLP_N
5ed0: 41 54 49 56 45 29 20 2d 56 20 24 28 5f 54 4b 5f  ATIVE) -V $(_TK_
5ee0: 48 29 20 22 64 65 66 69 6e 65 20 54 4b 5f 4d 41  H) "define TK_MA
5ef0: 4a 4f 52 5f 56 45 52 53 49 4f 4e 22 20 3e 3e 20  JOR_VERSION" >> 
5f00: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21 65  versions.vc]..!e
5f10: 6e 64 69 66 0d 0a 21 69 66 20 5b 65 63 68 6f 20  ndif..!if [echo 
5f20: 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e  TK_MINOR_VERSION
5f30: 20 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e   = \>> versions.
5f40: 76 63 5d 20 5c 0d 0a 20 20 20 26 26 20 5b 24 28  vc] \..   && [$(
5f50: 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29  NMAKEHLP_NATIVE)
5f60: 20 2d 56 20 24 28 5f 54 4b 5f 48 29 20 54 4b 5f   -V $(_TK_H) TK_
5f70: 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 20 3e 3e  MINOR_VERSION >>
5f80: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21   versions.vc]..!
5f90: 65 6e 64 69 66 0d 0a 21 69 66 20 5b 65 63 68 6f  endif..!if [echo
5fa0: 20 54 4b 5f 52 45 4c 45 41 53 45 5f 53 45 52 49   TK_RELEASE_SERI
5fb0: 41 4c 20 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e  AL = \>> version
5fc0: 73 2e 76 63 5d 20 5c 0d 0a 20 20 20 26 26 20 5b  s.vc] \..   && [
5fd0: 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56  $(NMAKEHLP_NATIV
5fe0: 45 29 20 2d 56 20 22 24 28 5f 54 4b 5f 48 29 22  E) -V "$(_TK_H)"
5ff0: 20 54 4b 5f 52 45 4c 45 41 53 45 5f 53 45 52 49   TK_RELEASE_SERI
6000: 41 4c 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76  AL >> versions.v
6010: 63 5d 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20  c]..!endif..!if 
6020: 5b 65 63 68 6f 20 54 4b 5f 50 41 54 43 48 5f 4c  [echo TK_PATCH_L
6030: 45 56 45 4c 20 3d 20 5c 3e 3e 20 76 65 72 73 69  EVEL = \>> versi
6040: 6f 6e 73 2e 76 63 5d 20 5c 0d 0a 20 20 20 26 26  ons.vc] \..   &&
6050: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54   [$(NMAKEHLP_NAT
6060: 49 56 45 29 20 2d 56 20 24 28 5f 54 4b 5f 48 29  IVE) -V $(_TK_H)
6070: 20 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20   TK_PATCH_LEVEL 
6080: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0d  >> versions.vc].
6090: 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 20  .!endif..!endif 
60a0: 23 20 5f 54 4b 5f 48 0d 0a 0d 0a 21 69 6e 63 6c  # _TK_H....!incl
60b0: 75 64 65 20 76 65 72 73 69 6f 6e 73 2e 76 63 0d  ude versions.vc.
60c0: 0a 0d 0a 54 43 4c 5f 56 45 52 53 49 4f 4e 09 3d  ...TCL_VERSION.=
60d0: 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52   $(TCL_MAJOR_VER
60e0: 53 49 4f 4e 29 24 28 54 43 4c 5f 4d 49 4e 4f 52  SION)$(TCL_MINOR
60f0: 5f 56 45 52 53 49 4f 4e 29 0d 0a 54 43 4c 5f 44  _VERSION)..TCL_D
6100: 4f 54 56 45 52 53 49 4f 4e 09 3d 20 24 28 54 43  OTVERSION.= $(TC
6110: 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29  L_MAJOR_VERSION)
6120: 2e 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52  .$(TCL_MINOR_VER
6130: 53 49 4f 4e 29 0d 0a 21 69 66 20 5b 24 28 4e 4d  SION)..!if [$(NM
6140: 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d  AKEHLP_NATIVE) -
6150: 66 20 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45  f $(TCL_PATCH_LE
6160: 56 45 4c 29 20 22 61 22 5d 0d 0a 54 43 4c 5f 50  VEL) "a"]..TCL_P
6170: 41 54 43 48 5f 4c 45 54 54 45 52 20 3d 20 61 0d  ATCH_LETTER = a.
6180: 0a 21 65 6c 73 65 69 66 20 5b 24 28 4e 4d 41 4b  .!elseif [$(NMAK
6190: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20  EHLP_NATIVE) -f 
61a0: 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45 56 45  $(TCL_PATCH_LEVE
61b0: 4c 29 20 22 62 22 5d 0d 0a 54 43 4c 5f 50 41 54  L) "b"]..TCL_PAT
61c0: 43 48 5f 4c 45 54 54 45 52 20 3d 20 62 0d 0a 21  CH_LETTER = b..!
61d0: 65 6c 73 65 0d 0a 54 43 4c 5f 50 41 54 43 48 5f  else..TCL_PATCH_
61e0: 4c 45 54 54 45 52 20 3d 20 2e 0d 0a 21 65 6e 64  LETTER = ...!end
61f0: 69 66 0d 0a 0d 0a 21 69 66 20 64 65 66 69 6e 65  if....!if define
6200: 64 28 5f 54 4b 5f 48 29 0d 0a 0d 0a 54 4b 5f 56  d(_TK_H)....TK_V
6210: 45 52 53 49 4f 4e 09 3d 20 24 28 54 4b 5f 4d 41  ERSION.= $(TK_MA
6220: 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 24 28 54 4b  JOR_VERSION)$(TK
6230: 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0d  _MINOR_VERSION).
6240: 0a 54 4b 5f 44 4f 54 56 45 52 53 49 4f 4e 09 3d  .TK_DOTVERSION.=
6250: 20 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53   $(TK_MAJOR_VERS
6260: 49 4f 4e 29 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f  ION).$(TK_MINOR_
6270: 56 45 52 53 49 4f 4e 29 0d 0a 21 69 66 20 5b 24  VERSION)..!if [$
6280: 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45  (NMAKEHLP_NATIVE
6290: 29 20 2d 66 20 24 28 54 4b 5f 50 41 54 43 48 5f  ) -f $(TK_PATCH_
62a0: 4c 45 56 45 4c 29 20 22 61 22 5d 0d 0a 54 4b 5f  LEVEL) "a"]..TK_
62b0: 50 41 54 43 48 5f 4c 45 54 54 45 52 20 3d 20 61  PATCH_LETTER = a
62c0: 0d 0a 21 65 6c 73 65 69 66 20 5b 24 28 4e 4d 41  ..!elseif [$(NMA
62d0: 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66  KEHLP_NATIVE) -f
62e0: 20 24 28 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45   $(TK_PATCH_LEVE
62f0: 4c 29 20 22 62 22 5d 0d 0a 54 4b 5f 50 41 54 43  L) "b"]..TK_PATC
6300: 48 5f 4c 45 54 54 45 52 20 3d 20 62 0d 0a 21 65  H_LETTER = b..!e
6310: 6c 73 65 0d 0a 54 4b 5f 50 41 54 43 48 5f 4c 45  lse..TK_PATCH_LE
6320: 54 54 45 52 20 3d 20 2e 0d 0a 21 65 6e 64 69 66  TTER = ...!endif
6330: 0d 0a 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20  ....!endif....# 
6340: 53 65 74 20 44 4f 54 56 45 52 53 49 4f 4e 20 61  Set DOTVERSION a
6350: 6e 64 20 56 45 52 53 49 4f 4e 0d 0a 21 69 66 20  nd VERSION..!if 
6360: 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a 0d 0a  $(DOING_TCL)....
6370: 44 4f 54 56 45 52 53 49 4f 4e 20 3d 20 24 28 54  DOTVERSION = $(T
6380: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e  CL_MAJOR_VERSION
6390: 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45  ).$(TCL_MINOR_VE
63a0: 52 53 49 4f 4e 29 0d 0a 56 45 52 53 49 4f 4e 20  RSION)..VERSION 
63b0: 3d 20 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29  = $(TCL_VERSION)
63c0: 0d 0a 0d 0a 21 65 6c 73 65 69 66 20 24 28 44 4f  ....!elseif $(DO
63d0: 49 4e 47 5f 54 4b 29 0d 0a 0d 0a 44 4f 54 56 45  ING_TK)....DOTVE
63e0: 52 53 49 4f 4e 20 3d 20 24 28 54 4b 5f 44 4f 54  RSION = $(TK_DOT
63f0: 56 45 52 53 49 4f 4e 29 0d 0a 56 45 52 53 49 4f  VERSION)..VERSIO
6400: 4e 20 3d 20 24 28 54 4b 5f 56 45 52 53 49 4f 4e  N = $(TK_VERSION
6410: 29 0d 0a 0d 0a 21 65 6c 73 65 20 23 20 44 6f 69  )....!else # Doi
6420: 6e 67 20 61 20 6e 6f 6e 2d 54 6b 20 65 78 74 65  ng a non-Tk exte
6430: 6e 73 69 6f 6e 0d 0a 0d 0a 23 20 49 66 20 70 61  nsion....# If pa
6440: 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 68 61  rent makefile ha
6450: 73 20 6e 6f 74 20 64 65 66 69 6e 65 64 20 44 4f  s not defined DO
6460: 54 56 45 52 53 49 4f 4e 2c 20 74 72 79 20 74 6f  TVERSION, try to
6470: 20 67 65 74 20 69 74 20 66 72 6f 6d 20 54 45 41   get it from TEA
6480: 0d 0a 23 20 66 69 72 73 74 20 66 72 6f 6d 20 61  ..# first from a
6490: 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20 66 69   configure.in fi
64a0: 6c 65 2c 20 61 6e 64 20 74 68 65 6e 20 66 72 6f  le, and then fro
64b0: 6d 20 63 6f 6e 66 69 67 75 72 65 2e 61 63 0d 0a  m configure.ac..
64c0: 21 69 66 6e 64 65 66 20 44 4f 54 56 45 52 53 49  !ifndef DOTVERSI
64d0: 4f 4e 0d 0a 21 69 66 20 5b 65 63 68 6f 20 44 4f  ON..!if [echo DO
64e0: 54 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 20 76 65  TVERSION = \> ve
64f0: 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0d 0a 20 20  rsions.vc] \..  
6500: 20 7c 7c 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f   || [$(NMAKEHLP_
6510: 4e 41 54 49 56 45 29 20 2d 56 20 24 28 52 4f 4f  NATIVE) -V $(ROO
6520: 54 29 5c 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20  T)\configure.in 
6530: 5e 5b 24 28 50 52 4f 4a 45 43 54 29 5e 5d 20 3e  ^[$(PROJECT)^] >
6540: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a  > versions.vc]..
6550: 21 69 66 20 5b 65 63 68 6f 20 44 4f 54 56 45 52  !if [echo DOTVER
6560: 53 49 4f 4e 20 3d 20 5c 3e 20 76 65 72 73 69 6f  SION = \> versio
6570: 6e 73 2e 76 63 5d 20 5c 0d 0a 20 20 20 7c 7c 20  ns.vc] \..   || 
6580: 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49  [$(NMAKEHLP_NATI
6590: 56 45 29 20 2d 56 20 24 28 52 4f 4f 54 29 5c 63  VE) -V $(ROOT)\c
65a0: 6f 6e 66 69 67 75 72 65 2e 61 63 20 5e 5b 24 28  onfigure.ac ^[$(
65b0: 50 52 4f 4a 45 43 54 29 5e 5d 20 3e 3e 20 76 65  PROJECT)^] >> ve
65c0: 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21 65 72 72  rsions.vc]..!err
65d0: 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74  or *** Could not
65e0: 20 66 69 67 75 72 65 20 6f 75 74 20 65 78 74 65   figure out exte
65f0: 6e 73 69 6f 6e 20 76 65 72 73 69 6f 6e 2e 20 50  nsion version. P
6600: 6c 65 61 73 65 20 64 65 66 69 6e 65 20 44 4f 54  lease define DOT
6610: 56 45 52 53 49 4f 4e 20 69 6e 20 70 61 72 65 6e  VERSION in paren
6620: 74 20 6d 61 6b 65 66 69 6c 65 20 62 65 66 6f 72  t makefile befor
6630: 65 20 69 6e 63 6c 75 64 69 6e 67 20 72 75 6c 65  e including rule
6640: 73 2e 76 63 2e 0d 0a 21 65 6e 64 69 66 0d 0a 21  s.vc...!endif..!
6650: 65 6e 64 69 66 0d 0a 21 69 6e 63 6c 75 64 65 20  endif..!include 
6660: 76 65 72 73 69 6f 6e 73 2e 76 63 0d 0a 21 65 6e  versions.vc..!en
6670: 64 69 66 20 23 20 44 4f 54 56 45 52 53 49 4f 4e  dif # DOTVERSION
6680: 0d 0a 56 45 52 53 49 4f 4e 20 20 20 20 20 20 20  ..VERSION       
6690: 20 20 3d 20 24 28 44 4f 54 56 45 52 53 49 4f 4e    = $(DOTVERSION
66a0: 3a 2e 3d 29 0d 0a 0d 0a 21 65 6e 64 69 66 20 23  :.=)....!endif #
66b0: 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 20 2e 2e   $(DOING_TCL) ..
66c0: 2e 20 65 74 63 2e 0d 0a 0d 0a 23 20 57 69 6e 64  . etc.....# Wind
66d0: 6f 77 73 20 52 43 20 66 69 6c 65 73 20 68 61 76  ows RC files hav
66e0: 65 20 33 20 76 65 72 73 69 6f 6e 20 63 6f 6d 70  e 3 version comp
66f0: 6f 6e 65 6e 74 73 2e 20 45 6e 73 75 72 65 20 74  onents. Ensure t
6700: 68 69 73 20 69 72 72 65 73 70 65 63 74 69 76 65  his irrespective
6710: 0d 0a 23 20 6f 66 20 68 6f 77 20 6d 61 6e 79 20  ..# of how many 
6720: 63 6f 6d 70 6f 6e 65 6e 74 73 20 74 68 65 20 70  components the p
6730: 61 63 6b 61 67 65 20 68 61 73 20 73 70 65 63 69  ackage has speci
6740: 66 69 65 64 2e 20 42 61 73 69 63 61 6c 6c 79 2c  fied. Basically,
6750: 20 65 6e 73 75 72 65 0d 0a 23 20 6d 69 6e 69 6d   ensure..# minim
6760: 75 6d 20 34 20 63 6f 6d 70 6f 6e 65 6e 74 73 20  um 4 components 
6770: 62 79 20 61 70 70 65 6e 64 69 6e 67 20 34 20 30  by appending 4 0
6780: 27 73 20 61 6e 64 20 74 68 65 6e 20 70 69 63 6b  's and then pick
6790: 20 6f 75 74 20 74 68 65 20 66 69 72 73 74 20 34   out the first 4
67a0: 2e 0d 0a 23 20 41 6c 73 6f 20 74 61 6b 65 20 63  ...# Also take c
67b0: 61 72 65 20 6f 66 20 74 68 65 20 66 61 63 74 20  are of the fact 
67c0: 74 68 61 74 20 44 4f 54 56 45 52 53 49 4f 4e 20  that DOTVERSION 
67d0: 6d 61 79 20 68 61 76 65 20 22 61 22 20 6f 72 20  may have "a" or 
67e0: 22 62 22 20 69 6e 73 74 65 61 64 0d 0a 23 20 6f  "b" instead..# o
67f0: 66 20 22 2e 22 20 73 65 70 61 72 61 74 69 6e 67  f "." separating
6800: 20 74 68 65 20 76 65 72 73 69 6f 6e 20 63 6f 6d   the version com
6810: 70 6f 6e 65 6e 74 73 2e 0d 0a 44 4f 54 53 45 50  ponents...DOTSEP
6820: 41 52 41 54 45 44 3d 24 28 44 4f 54 56 45 52 53  ARATED=$(DOTVERS
6830: 49 4f 4e 3a 61 3d 2e 29 0d 0a 44 4f 54 53 45 50  ION:a=.)..DOTSEP
6840: 41 52 41 54 45 44 3d 24 28 44 4f 54 53 45 50 41  ARATED=$(DOTSEPA
6850: 52 41 54 45 44 3a 62 3d 2e 29 0d 0a 21 69 66 20  RATED:b=.)..!if 
6860: 5b 65 63 68 6f 20 52 43 43 4f 4d 4d 41 56 45 52  [echo RCCOMMAVER
6870: 53 49 4f 4e 20 3d 20 5c 3e 20 76 65 72 73 69 6f  SION = \> versio
6880: 6e 73 2e 76 63 5d 20 5c 0d 0a 20 20 7c 7c 20 5b  ns.vc] \..  || [
6890: 66 6f 72 20 2f 66 20 22 74 6f 6b 65 6e 73 3d 31  for /f "tokens=1
68a0: 2c 32 2c 33 2c 34 2c 35 2a 20 64 65 6c 69 6d 73  ,2,3,4,5* delims
68b0: 3d 2e 22 20 25 61 20 69 6e 20 28 22 24 28 44 4f  =." %a in ("$(DO
68c0: 54 53 45 50 41 52 41 54 45 44 29 2e 30 2e 30 2e  TSEPARATED).0.0.
68d0: 30 2e 30 22 29 20 64 6f 20 40 65 63 68 6f 20 25  0.0") do @echo %
68e0: 61 2c 25 62 2c 25 63 2c 25 64 20 3e 3e 20 76 65  a,%b,%c,%d >> ve
68f0: 72 73 69 6f 6e 73 2e 76 63 5d 0d 0a 21 65 72 72  rsions.vc]..!err
6900: 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74  or *** Could not
6910: 20 67 65 6e 65 72 61 74 65 20 52 43 43 4f 4d 4d   generate RCCOMM
6920: 41 56 45 52 53 49 4f 4e 20 2a 2a 2a 0d 0a 21 65  AVERSION ***..!e
6930: 6e 64 69 66 0d 0a 21 69 6e 63 6c 75 64 65 20 76  ndif..!include v
6940: 65 72 73 69 6f 6e 73 2e 76 63 0d 0a 0d 0a 23 23  ersions.vc....##
6950: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
6960: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
6970: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
6980: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
6990: 23 23 23 23 23 23 0d 0a 23 20 37 2e 20 50 61 72  ######..# 7. Par
69a0: 73 65 20 74 68 65 20 4f 50 54 53 20 6d 61 63 72  se the OPTS macr
69b0: 6f 20 74 6f 20 77 6f 72 6b 20 6f 75 74 20 74 68  o to work out th
69c0: 65 20 72 65 71 75 65 73 74 65 64 20 62 75 69 6c  e requested buil
69d0: 64 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 2e  d configuration.
69e0: 0d 0a 23 20 42 61 73 65 64 20 6f 6e 20 74 68 69  ..# Based on thi
69f0: 73 2c 20 77 65 20 77 69 6c 6c 20 63 6f 6e 73 74  s, we will const
6a00: 72 75 63 74 20 74 68 65 20 61 63 74 75 61 6c 20  ruct the actual 
6a10: 73 77 69 74 63 68 65 73 20 74 6f 20 62 65 20 70  switches to be p
6a20: 61 73 73 65 64 20 74 6f 20 74 68 65 0d 0a 23 20  assed to the..# 
6a30: 63 6f 6d 70 69 6c 65 72 20 61 6e 64 20 6c 69 6e  compiler and lin
6a40: 6b 65 72 20 75 73 69 6e 67 20 74 68 65 20 6d 61  ker using the ma
6a50: 63 72 6f 73 20 64 65 66 69 6e 65 64 20 69 6e 20  cros defined in 
6a60: 74 68 65 20 70 72 65 76 69 6f 75 73 20 73 65 63  the previous sec
6a70: 74 69 6f 6e 2e 0d 0a 23 20 54 68 65 20 66 6f 6c  tion...# The fol
6a80: 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 20 61 72  lowing macros ar
6a90: 65 20 64 65 66 69 6e 65 64 20 62 79 20 74 68 69  e defined by thi
6aa0: 73 20 73 65 63 74 69 6f 6e 20 62 61 73 65 64 20  s section based 
6ab0: 6f 6e 20 4f 50 54 53 0d 0a 23 20 53 54 41 54 49  on OPTS..# STATI
6ac0: 43 5f 42 55 49 4c 44 20 2d 20 30 20 2d 3e 20 54  C_BUILD - 0 -> T
6ad0: 63 6c 20 69 73 20 74 6f 20 62 65 20 62 75 69 6c  cl is to be buil
6ae0: 74 20 61 73 20 61 20 73 68 61 72 65 64 20 6c 69  t as a shared li
6af0: 62 72 61 72 79 0d 0a 23 20 20 20 20 20 20 20 20  brary..#        
6b00: 20 20 20 20 20 20 20 20 31 20 2d 3e 20 62 75 69          1 -> bui
6b10: 6c 64 20 61 73 20 61 20 73 74 61 74 69 63 20 6c  ld as a static l
6b20: 69 62 72 61 72 79 20 61 6e 64 20 73 68 65 6c 6c  ibrary and shell
6b30: 0d 0a 23 20 54 43 4c 5f 54 48 52 45 41 44 53 20  ..# TCL_THREADS 
6b40: 2d 20 6c 65 67 61 63 79 20 62 75 74 20 61 6c 77  - legacy but alw
6b50: 61 79 73 20 31 20 6f 6e 20 57 69 6e 64 6f 77 73  ays 1 on Windows
6b60: 20 73 69 6e 63 65 20 77 69 6e 73 6f 63 6b 20 72   since winsock r
6b70: 65 71 75 69 72 65 73 20 69 74 2e 0d 0a 23 20 44  equires it...# D
6b80: 45 42 55 47 20 2d 20 31 20 2d 3e 20 64 65 62 75  EBUG - 1 -> debu
6b90: 67 20 62 75 69 6c 64 2c 20 30 20 2d 3e 20 72 65  g build, 0 -> re
6ba0: 6c 65 61 73 65 20 62 75 69 6c 64 73 0d 0a 23 20  lease builds..# 
6bb0: 53 59 4d 42 4f 4c 53 20 2d 20 31 20 2d 3e 20 67  SYMBOLS - 1 -> g
6bc0: 65 6e 65 72 61 74 65 20 50 44 42 27 73 2c 20 30  enerate PDB's, 0
6bd0: 20 2d 3e 20 6e 6f 20 50 44 42 27 73 0d 0a 23 20   -> no PDB's..# 
6be0: 50 52 4f 46 49 4c 45 20 2d 20 31 20 2d 3e 20 67  PROFILE - 1 -> g
6bf0: 65 6e 65 72 61 74 65 20 70 72 6f 66 69 6c 69 6e  enerate profilin
6c00: 67 20 69 6e 66 6f 2c 20 30 20 2d 3e 20 6e 6f 20  g info, 0 -> no 
6c10: 70 72 6f 66 69 6c 69 6e 67 0d 0a 23 20 50 47 4f  profiling..# PGO
6c20: 20 20 20 20 20 2d 20 31 20 2d 3e 20 70 72 6f 66       - 1 -> prof
6c30: 69 6c 65 20 62 61 73 65 64 20 6f 70 74 69 6d 69  ile based optimi
6c40: 7a 61 74 69 6f 6e 2c 20 30 20 2d 3e 20 6e 6f 0d  zation, 0 -> no.
6c50: 0a 23 20 4d 53 56 43 52 54 20 20 2d 20 31 20 2d  .# MSVCRT  - 1 -
6c60: 3e 20 6c 69 6e 6b 20 74 6f 20 64 79 6e 61 6d 69  > link to dynami
6c70: 63 20 43 20 72 75 6e 74 69 6d 65 20 65 76 65 6e  c C runtime even
6c80: 20 77 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 73   when building s
6c90: 74 61 74 69 63 20 54 63 6c 20 62 75 69 6c 64 0d  tatic Tcl build.
6ca0: 0a 23 20 20 20 20 20 20 20 20 20 20 20 30 20 2d  .#           0 -
6cb0: 3e 20 6c 69 6e 6b 20 74 6f 20 73 74 61 74 69 63  > link to static
6cc0: 20 43 20 72 75 6e 74 69 6d 65 20 66 6f 72 20 73   C runtime for s
6cd0: 74 61 74 69 63 20 54 63 6c 20 62 75 69 6c 64 2e  tatic Tcl build.
6ce0: 0d 0a 23 20 20 20 20 20 20 20 20 20 20 20 44 6f  ..#           Do
6cf0: 65 73 20 6e 6f 74 20 69 6d 70 61 63 74 20 73 68  es not impact sh
6d00: 61 72 65 64 20 54 63 6c 20 62 75 69 6c 64 73 20  ared Tcl builds 
6d10: 28 53 54 41 54 49 43 5f 42 55 49 4c 44 20 3d 3d  (STATIC_BUILD ==
6d20: 20 30 29 0d 0a 23 20 20 20 20 20 20 20 20 20 20   0)..#          
6d30: 20 44 65 66 61 75 6c 74 3a 20 31 20 66 6f 72 20   Default: 1 for 
6d40: 54 63 6c 20 39 2e 30 20 61 6e 64 20 75 70 2c 20  Tcl 9.0 and up, 
6d50: 30 20 6f 74 68 65 72 77 69 73 65 2e 0d 0a 23 20  0 otherwise...# 
6d60: 54 43 4c 5f 55 53 45 5f 53 54 41 54 49 43 5f 50  TCL_USE_STATIC_P
6d70: 41 43 4b 41 47 45 53 20 2d 20 31 20 2d 3e 20 73  ACKAGES - 1 -> s
6d80: 74 61 74 69 63 61 6c 6c 79 20 6c 69 6e 6b 20 74  tatically link t
6d90: 68 65 20 72 65 67 69 73 74 72 79 20 61 6e 64 20  he registry and 
6da0: 64 64 65 20 65 78 74 65 6e 73 69 6f 6e 73 0d 0a  dde extensions..
6db0: 23 20 20 20 20 20 20 20 20 20 20 20 69 6e 20 74  #           in t
6dc0: 68 65 20 54 63 6c 20 61 6e 64 20 57 69 73 68 20  he Tcl and Wish 
6dd0: 73 68 65 6c 6c 2e 20 30 20 2d 3e 20 6b 65 65 70  shell. 0 -> keep
6de0: 20 74 68 65 6d 20 61 73 20 73 68 61 72 65 64 20   them as shared 
6df0: 6c 69 62 72 61 72 69 65 73 2e 20 44 6f 65 73 0d  libraries. Does.
6e00: 0a 23 20 20 20 20 20 20 20 20 20 20 20 6e 6f 74  .#           not
6e10: 20 69 6d 70 61 63 74 20 73 68 61 72 65 64 20 54   impact shared T
6e20: 63 6c 20 62 75 69 6c 64 73 2e 20 49 6d 70 6c 69  cl builds. Impli
6e30: 65 64 20 62 79 20 53 54 41 54 49 43 5f 42 55 49  ed by STATIC_BUI
6e40: 4c 44 20 73 69 6e 63 65 20 54 63 6c 20 39 2e 30  LD since Tcl 9.0
6e50: 2e 0d 0a 23 20 55 53 45 5f 54 48 52 45 41 44 5f  ...# USE_THREAD_
6e60: 41 4c 4c 4f 43 20 2d 20 31 20 2d 3e 20 55 73 65  ALLOC - 1 -> Use
6e70: 20 61 20 73 68 61 72 65 64 20 67 6c 6f 62 61 6c   a shared global
6e80: 20 66 72 65 65 20 70 6f 6f 6c 20 66 6f 72 20 61   free pool for a
6e90: 6c 6c 6f 63 61 74 69 6f 6e 2e 0d 0a 23 20 20 20  llocation...#   
6ea0: 20 20 20 20 20 20 20 20 30 20 2d 3e 20 55 73 65          0 -> Use
6eb0: 20 74 68 65 20 6e 6f 6e 2d 74 68 72 65 61 64 20   the non-thread 
6ec0: 61 6c 6c 6f 63 61 74 6f 72 2e 0d 0a 23 20 55 4e  allocator...# UN
6ed0: 43 48 45 43 4b 45 44 20 2d 20 31 20 2d 3e 20 77  CHECKED - 1 -> w
6ee0: 68 65 6e 20 64 6f 69 6e 67 20 61 20 64 65 62 75  hen doing a debu
6ef0: 67 20 62 75 69 6c 64 20 77 69 74 68 20 73 79 6d  g build with sym
6f00: 62 6f 6c 73 2c 20 75 73 65 20 74 68 65 20 72 65  bols, use the re
6f10: 6c 65 61 73 65 0d 0a 23 20 20 20 20 20 20 20 20  lease..#        
6f20: 20 20 20 43 20 72 75 6e 74 69 6d 65 2c 20 30 20     C runtime, 0 
6f30: 2d 3e 20 75 73 65 20 74 68 65 20 64 65 62 75 67  -> use the debug
6f40: 20 43 20 72 75 6e 74 69 6d 65 2e 0d 0a 23 20 55   C runtime...# U
6f50: 53 45 5f 53 54 55 42 53 20 2d 20 31 20 2d 3e 20  SE_STUBS - 1 -> 
6f60: 63 6f 6d 70 69 6c 65 20 74 6f 20 75 73 65 20 73  compile to use s
6f70: 74 75 62 73 20 69 6e 74 65 72 66 61 63 65 73 2c  tubs interfaces,
6f80: 20 30 20 2d 3e 20 64 69 72 65 63 74 20 6c 69 6e   0 -> direct lin
6f90: 6b 69 6e 67 0d 0a 23 20 43 4f 4e 46 49 47 5f 43  king..# CONFIG_C
6fa0: 48 45 43 4b 20 2d 20 31 20 2d 3e 20 63 68 65 63  HECK - 1 -> chec
6fb0: 6b 20 63 75 72 72 65 6e 74 20 62 75 69 6c 64 20  k current build 
6fc0: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 61 67  configuration ag
6fd0: 61 69 6e 73 74 20 54 63 6c 0d 0a 23 20 20 20 20  ainst Tcl..#    
6fe0: 20 20 20 20 20 20 20 63 6f 6e 66 69 67 75 72 61         configura
6ff0: 74 69 6f 6e 20 28 69 67 6e 6f 72 65 64 20 66 6f  tion (ignored fo
7000: 72 20 54 63 6c 20 69 74 73 65 6c 66 29 0d 0a 23  r Tcl itself)..#
7010: 20 5f 55 53 45 5f 36 34 42 49 54 5f 54 49 4d 45   _USE_64BIT_TIME
7020: 5f 54 20 2d 20 66 6f 72 63 65 73 20 61 20 62 75  _T - forces a bu
7030: 69 6c 64 20 75 73 69 6e 67 20 36 34 2d 62 69 74  ild using 64-bit
7040: 20 74 69 6d 65 5f 74 20 66 6f 72 20 33 32 2d 62   time_t for 32-b
7050: 69 74 20 62 75 69 6c 64 0d 0a 23 20 20 20 20 20  it build..#     
7060: 20 20 20 20 20 20 28 43 52 54 20 6c 69 62 72 61        (CRT libra
7070: 72 79 20 73 68 6f 75 6c 64 20 73 75 70 70 6f 72  ry should suppor
7080: 74 20 74 68 69 73 2c 20 6e 6f 74 20 6e 65 65 64  t this, not need
7090: 65 64 20 66 6f 72 20 54 63 6c 20 39 2e 78 29 0d  ed for Tcl 9.x).
70a0: 0a 23 20 46 75 72 74 68 65 72 2c 20 4c 49 4e 4b  .# Further, LINK
70b0: 45 52 46 4c 41 47 53 20 61 72 65 20 6d 6f 64 69  ERFLAGS are modi
70c0: 66 69 65 64 20 62 61 73 65 64 20 6f 6e 20 61 62  fied based on ab
70d0: 6f 76 65 2e 0d 0a 0d 0a 23 20 44 65 66 61 75 6c  ove.....# Defaul
70e0: 74 20 76 61 6c 75 65 73 20 66 6f 72 20 61 6c 6c  t values for all
70f0: 20 74 68 65 20 61 62 6f 76 65 0d 0a 53 54 41 54   the above..STAT
7100: 49 43 5f 42 55 49 4c 44 09 3d 20 30 0d 0a 54 43  IC_BUILD.= 0..TC
7110: 4c 5f 54 48 52 45 41 44 53 09 3d 20 31 0d 0a 44  L_THREADS.= 1..D
7120: 45 42 55 47 09 09 3d 20 30 0d 0a 53 59 4d 42 4f  EBUG..= 0..SYMBO
7130: 4c 53 09 09 3d 20 30 0d 0a 50 52 4f 46 49 4c 45  LS..= 0..PROFILE
7140: 09 09 3d 20 30 0d 0a 50 47 4f 09 09 3d 20 30 0d  ..= 0..PGO..= 0.
7150: 0a 4d 53 56 43 52 54 09 09 3d 20 31 0d 0a 54 43  .MSVCRT..= 1..TC
7160: 4c 5f 55 53 45 5f 53 54 41 54 49 43 5f 50 41 43  L_USE_STATIC_PAC
7170: 4b 41 47 45 53 09 3d 20 30 0d 0a 55 53 45 5f 54  KAGES.= 0..USE_T
7180: 48 52 45 41 44 5f 41 4c 4c 4f 43 20 3d 20 31 0d  HREAD_ALLOC = 1.
7190: 0a 55 4e 43 48 45 43 4b 45 44 09 3d 20 30 0d 0a  .UNCHECKED.= 0..
71a0: 43 4f 4e 46 49 47 5f 43 48 45 43 4b 20 20 20 20  CONFIG_CHECK    
71b0: 3d 20 31 0d 0a 21 69 66 20 24 28 44 4f 49 4e 47  = 1..!if $(DOING
71c0: 5f 54 43 4c 29 0d 0a 55 53 45 5f 53 54 55 42 53  _TCL)..USE_STUBS
71d0: 20 20 20 20 20 20 20 3d 20 30 0d 0a 21 65 6c 73         = 0..!els
71e0: 65 0d 0a 55 53 45 5f 53 54 55 42 53 20 20 20 20  e..USE_STUBS    
71f0: 20 20 20 3d 20 31 0d 0a 21 65 6e 64 69 66 0d 0a     = 1..!endif..
7200: 56 45 52 42 4f 53 45 09 09 3d 20 30 0d 0a 0d 0a  VERBOSE..= 0....
7210: 23 20 49 66 20 4f 50 54 53 20 69 73 20 6e 6f 74  # If OPTS is not
7220: 20 65 6d 70 74 79 20 41 4e 44 20 64 6f 65 73 20   empty AND does 
7230: 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 22 6e 6f 6e  not contain "non
7240: 65 22 20 77 68 69 63 68 20 74 75 72 6e 73 20 6f  e" which turns o
7250: 66 66 20 61 6c 6c 20 4f 50 54 53 0d 0a 23 20 73  ff all OPTS..# s
7260: 65 74 20 74 68 65 20 61 62 6f 76 65 20 6d 61 63  et the above mac
7270: 72 6f 73 20 62 61 73 65 64 20 6f 6e 20 4f 50 54  ros based on OPT
7280: 53 20 63 6f 6e 74 65 6e 74 0d 0a 21 69 66 20 22  S content..!if "
7290: 24 28 4f 50 54 53 29 22 20 21 3d 20 22 22 20 26  $(OPTS)" != "" &
72a0: 26 20 21 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e  & ![$(NMAKEHLP_N
72b0: 41 54 49 56 45 29 20 2d 66 20 22 24 28 4f 50 54  ATIVE) -f "$(OPT
72c0: 53 29 22 20 22 6e 6f 6e 65 22 5d 0d 0a 0d 0a 23  S)" "none"]....#
72d0: 20 4f 50 54 53 20 61 72 65 20 73 70 65 63 69 66   OPTS are specif
72e0: 69 65 64 2c 20 70 61 72 73 65 20 74 68 65 6d 0d  ied, parse them.
72f0: 0a 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48  ...!if [$(NMAKEH
7300: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28  LP_NATIVE) -f $(
7310: 4f 50 54 53 29 20 22 73 74 61 74 69 63 22 5d 0d  OPTS) "static"].
7320: 0a 53 54 41 54 49 43 5f 42 55 49 4c 44 09 3d 20  .STATIC_BUILD.= 
7330: 31 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66  1..!endif....!if
7340: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54   [$(NMAKEHLP_NAT
7350: 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20  IVE) -f $(OPTS) 
7360: 22 6e 6f 73 74 75 62 73 22 5d 0d 0a 55 53 45 5f  "nostubs"]..USE_
7370: 53 54 55 42 53 09 3d 20 30 0d 0a 21 65 6e 64 69  STUBS.= 0..!endi
7380: 66 0d 0a 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b  f....!if [$(NMAK
7390: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20  EHLP_NATIVE) -f 
73a0: 24 28 4f 50 54 53 29 20 22 6e 6f 6d 73 76 63 72  $(OPTS) "nomsvcr
73b0: 74 22 5d 0d 0a 4d 53 56 43 52 54 09 09 3d 20 30  t"]..MSVCRT..= 0
73c0: 0d 0a 21 65 6c 73 65 0d 0a 21 69 66 20 5b 24 28  ..!else..!if [$(
73d0: 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29  NMAKEHLP_NATIVE)
73e0: 20 2d 66 20 24 28 4f 50 54 53 29 20 22 6d 73 76   -f $(OPTS) "msv
73f0: 63 72 74 22 5d 0d 0a 21 65 6c 73 65 0d 0a 21 69  crt"]..!else..!i
7400: 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45  f $(TCL_MAJOR_VE
7410: 52 53 49 4f 4e 29 20 3d 3d 20 38 20 26 26 20 24  RSION) == 8 && $
7420: 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49  (TCL_MINOR_VERSI
7430: 4f 4e 29 20 3c 20 37 20 26 26 20 24 28 53 54 41  ON) < 7 && $(STA
7440: 54 49 43 5f 42 55 49 4c 44 29 0d 0a 4d 53 56 43  TIC_BUILD)..MSVC
7450: 52 54 09 09 3d 20 30 0d 0a 21 65 6e 64 69 66 0d  RT..= 0..!endif.
7460: 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 20  .!endif..!endif 
7470: 23 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41  # [$(NMAKEHLP_NA
7480: 54 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29  TIVE) -f $(OPTS)
7490: 20 22 6e 6f 6d 73 76 63 72 74 22 5d 0d 0a 0d 0a   "nomsvcrt"]....
74a0: 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f  !if [$(NMAKEHLP_
74b0: 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f 50 54  NATIVE) -f $(OPT
74c0: 53 29 20 22 73 74 61 74 69 63 70 6b 67 22 5d 20  S) "staticpkg"] 
74d0: 26 26 20 24 28 53 54 41 54 49 43 5f 42 55 49 4c  && $(STATIC_BUIL
74e0: 44 29 0d 0a 54 43 4c 5f 55 53 45 5f 53 54 41 54  D)..TCL_USE_STAT
74f0: 49 43 5f 50 41 43 4b 41 47 45 53 09 3d 20 31 0d  IC_PACKAGES.= 1.
7500: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 5b  .!endif....!if [
7510: 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56  $(NMAKEHLP_NATIV
7520: 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 22 6e  E) -f $(OPTS) "n
7530: 6f 74 68 72 65 61 64 73 22 5d 0d 0a 54 43 4c 5f  othreads"]..TCL_
7540: 54 48 52 45 41 44 53 20 3d 20 30 0d 0a 55 53 45  THREADS = 0..USE
7550: 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 3d 20 30  _THREAD_ALLOC= 0
7560: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20  ..!endif....!if 
7570: 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49  [$(NMAKEHLP_NATI
7580: 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 22  VE) -f $(OPTS) "
7590: 74 63 6c 38 22 5d 0d 0a 54 43 4c 5f 42 55 49 4c  tcl8"]..TCL_BUIL
75a0: 44 5f 46 4f 52 20 3d 20 38 0d 0a 21 65 6e 64 69  D_FOR = 8..!endi
75b0: 66 0d 0a 0d 0a 21 69 66 20 24 28 54 43 4c 5f 4d  f....!if $(TCL_M
75c0: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d  AJOR_VERSION) ==
75d0: 20 38 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45   8..!if [$(NMAKE
75e0: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24  HLP_NATIVE) -f $
75f0: 28 4f 50 54 53 29 20 22 74 69 6d 65 36 34 62 69  (OPTS) "time64bi
7600: 74 22 5d 0d 0a 5f 55 53 45 5f 36 34 42 49 54 5f  t"].._USE_64BIT_
7610: 54 49 4d 45 5f 54 20 3d 20 31 0d 0a 21 65 6e 64  TIME_T = 1..!end
7620: 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20  if..!endif....# 
7630: 59 65 73 2c 20 69 74 27 73 20 77 65 69 72 64 20  Yes, it's weird 
7640: 74 68 61 74 20 74 68 65 20 22 73 79 6d 62 6f 6c  that the "symbol
7650: 73 22 20 6f 70 74 69 6f 6e 20 63 6f 6e 74 72 6f  s" option contro
7660: 6c 73 20 44 45 42 55 47 20 61 6e 64 0d 0a 23 20  ls DEBUG and..# 
7670: 74 68 65 20 22 70 64 62 73 22 20 6f 70 74 69 6f  the "pdbs" optio
7680: 6e 20 63 6f 6e 74 72 6f 6c 73 20 53 59 4d 42 4f  n controls SYMBO
7690: 4c 53 2e 20 54 68 61 74 27 73 20 68 69 73 74 6f  LS. That's histo
76a0: 72 69 63 61 6c 2e 0d 0a 21 69 66 20 5b 24 28 4e  rical...!if [$(N
76b0: 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20  MAKEHLP_NATIVE) 
76c0: 2d 66 20 24 28 4f 50 54 53 29 20 22 73 79 6d 62  -f $(OPTS) "symb
76d0: 6f 6c 73 22 5d 0d 0a 44 45 42 55 47 09 09 3d 20  ols"]..DEBUG..= 
76e0: 31 0d 0a 21 65 6c 73 65 0d 0a 44 45 42 55 47 09  1..!else..DEBUG.
76f0: 09 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a  .= 0..!endif....
7700: 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f  !if [$(NMAKEHLP_
7710: 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f 50 54  NATIVE) -f $(OPT
7720: 53 29 20 22 70 64 62 73 22 5d 0d 0a 53 59 4d 42  S) "pdbs"]..SYMB
7730: 4f 4c 53 09 09 3d 20 31 0d 0a 21 65 6c 73 65 0d  OLS..= 1..!else.
7740: 0a 53 59 4d 42 4f 4c 53 09 09 3d 20 30 0d 0a 21  .SYMBOLS..= 0..!
7750: 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 5b 24 28  endif....!if [$(
7760: 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29  NMAKEHLP_NATIVE)
7770: 20 2d 66 20 24 28 4f 50 54 53 29 20 22 70 72 6f   -f $(OPTS) "pro
7780: 66 69 6c 65 22 5d 0d 0a 50 52 4f 46 49 4c 45 09  file"]..PROFILE.
7790: 09 3d 20 31 0d 0a 21 65 6c 73 65 0d 0a 50 52 4f  .= 1..!else..PRO
77a0: 46 49 4c 45 09 09 3d 20 30 0d 0a 21 65 6e 64 69  FILE..= 0..!endi
77b0: 66 0d 0a 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b  f....!if [$(NMAK
77c0: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20  EHLP_NATIVE) -f 
77d0: 24 28 4f 50 54 53 29 20 22 70 67 69 22 5d 0d 0a  $(OPTS) "pgi"]..
77e0: 50 47 4f 09 09 3d 20 31 0d 0a 21 65 6c 73 65 69  PGO..= 1..!elsei
77f0: 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41  f [$(NMAKEHLP_NA
7800: 54 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29  TIVE) -f $(OPTS)
7810: 20 22 70 67 6f 22 5d 0d 0a 50 47 4f 09 09 3d 20   "pgo"]..PGO..= 
7820: 32 0d 0a 21 65 6c 73 65 0d 0a 50 47 4f 09 09 3d  2..!else..PGO..=
7830: 20 30 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69   0..!endif....!i
7840: 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41  f [$(NMAKEHLP_NA
7850: 54 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29  TIVE) -f $(OPTS)
7860: 20 22 6c 6f 69 6d 70 61 63 74 22 5d 0d 0a 21 6d   "loimpact"]..!m
7870: 65 73 73 61 67 65 20 2a 2a 2a 20 57 61 72 6e 69  essage *** Warni
7880: 6e 67 3a 20 69 67 6e 6f 72 69 6e 67 20 6f 70 74  ng: ignoring opt
7890: 69 6f 6e 20 22 6c 6f 69 6d 70 61 63 74 22 20 2d  ion "loimpact" -
78a0: 20 64 65 70 72 65 63 61 74 65 64 20 6f 6e 20 6d   deprecated on m
78b0: 6f 64 65 72 6e 20 57 69 6e 64 6f 77 73 2e 0d 0a  odern Windows...
78c0: 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 54 42 44 20  !endif....# TBD 
78d0: 2d 20 73 68 6f 75 6c 64 20 67 65 74 20 72 69 64  - should get rid
78e0: 20 6f 66 20 74 68 69 73 20 6f 70 74 69 6f 6e 0d   of this option.
78f0: 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50  .!if [$(NMAKEHLP
7900: 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f 50  _NATIVE) -f $(OP
7910: 54 53 29 20 22 74 68 72 64 61 6c 6c 6f 63 22 5d  TS) "thrdalloc"]
7920: 0d 0a 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c  ..USE_THREAD_ALL
7930: 4f 43 20 3d 20 31 0d 0a 21 65 6e 64 69 66 0d 0a  OC = 1..!endif..
7940: 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c  ..!if [$(NMAKEHL
7950: 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f  P_NATIVE) -f $(O
7960: 50 54 53 29 20 22 74 63 6c 61 6c 6c 6f 63 22 5d  PTS) "tclalloc"]
7970: 0d 0a 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c  ..USE_THREAD_ALL
7980: 4f 43 20 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a  OC = 0..!endif..
7990: 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c  ..!if [$(NMAKEHL
79a0: 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f  P_NATIVE) -f $(O
79b0: 50 54 53 29 20 22 75 6e 63 68 65 63 6b 65 64 22  PTS) "unchecked"
79c0: 5d 0d 0a 55 4e 43 48 45 43 4b 45 44 20 3d 20 31  ]..UNCHECKED = 1
79d0: 0d 0a 21 65 6c 73 65 0d 0a 55 4e 43 48 45 43 4b  ..!else..UNCHECK
79e0: 45 44 20 3d 20 30 0d 0a 21 65 6e 64 69 66 0d 0a  ED = 0..!endif..
79f0: 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c  ..!if [$(NMAKEHL
7a00: 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f  P_NATIVE) -f $(O
7a10: 50 54 53 29 20 22 6e 6f 63 6f 6e 66 69 67 63 68  PTS) "noconfigch
7a20: 65 63 6b 22 5d 0d 0a 43 4f 4e 46 49 47 5f 43 48  eck"]..CONFIG_CH
7a30: 45 43 4b 20 3d 20 31 0d 0a 21 65 6c 73 65 0d 0a  ECK = 1..!else..
7a40: 43 4f 4e 46 49 47 5f 43 48 45 43 4b 20 3d 20 30  CONFIG_CHECK = 0
7a50: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20  ..!endif....!if 
7a60: 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49  [$(NMAKEHLP_NATI
7a70: 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 22  VE) -f $(OPTS) "
7a80: 76 65 72 62 6f 73 65 22 5d 0d 0a 56 45 52 42 4f  verbose"]..VERBO
7a90: 53 45 09 09 3d 20 31 0d 0a 21 65 6c 73 65 0d 0a  SE..= 1..!else..
7aa0: 56 45 52 42 4f 53 45 09 09 3d 20 30 0d 0a 21 65  VERBOSE..= 0..!e
7ab0: 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 24 28 56 45  ndif....!if $(VE
7ac0: 52 42 4f 53 45 29 0d 0a 21 6d 65 73 73 61 67 65  RBOSE)..!message
7ad0: 20 2a 2a 2a 20 4f 50 54 53 3d 24 28 4f 50 54 53   *** OPTS=$(OPTS
7ae0: 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 65 6e  )..!endif....!en
7af0: 64 69 66 20 23 20 22 24 28 4f 50 54 53 29 22 20  dif # "$(OPTS)" 
7b00: 21 3d 20 22 22 20 20 26 26 20 2e 2e 2e 20 70 61  != ""  && ... pa
7b10: 72 73 69 6e 67 20 6f 66 20 4f 50 54 53 0d 0a 0d  rsing of OPTS...
7b20: 0a 23 20 53 65 74 20 6c 69 6e 6b 65 72 20 66 6c  .# Set linker fl
7b30: 61 67 73 20 62 61 73 65 64 20 6f 6e 20 61 62 6f  ags based on abo
7b40: 76 65 0d 0a 0d 0a 21 69 66 20 24 28 50 47 4f 29  ve....!if $(PGO)
7b50: 20 3e 20 31 0d 0a 21 69 66 20 5b 24 28 4e 4d 41   > 1..!if [$(NMA
7b60: 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 6c  KEHLP_NATIVE) -l
7b70: 20 2d 6c 74 63 67 3a 70 67 6f 70 74 69 6d 69 7a   -ltcg:pgoptimiz
7b80: 65 20 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46  e $(LINKER_TESTF
7b90: 4c 41 47 53 29 5d 0d 0a 4c 49 4e 4b 45 52 46 4c  LAGS)]..LINKERFL
7ba0: 41 47 53 09 3d 20 24 28 4c 49 4e 4b 45 52 46 4c  AGS.= $(LINKERFL
7bb0: 41 47 53 3a 2d 6c 74 63 67 3d 29 20 2d 6c 74 63  AGS:-ltcg=) -ltc
7bc0: 67 3a 70 67 6f 70 74 69 6d 69 7a 65 0d 0a 21 65  g:pgoptimize..!e
7bd0: 6c 73 65 0d 0a 4d 53 47 3d 5e 0d 0a 54 68 69 73  lse..MSG=^..This
7be0: 20 63 6f 6d 70 69 6c 65 72 20 64 6f 65 73 20 6e   compiler does n
7bf0: 6f 74 20 73 75 70 70 6f 72 74 20 70 72 6f 66 69  ot support profi
7c00: 6c 65 20 67 75 69 64 65 64 20 6f 70 74 69 6d 69  le guided optimi
7c10: 7a 61 74 69 6f 6e 2e 0d 0a 21 65 72 72 6f 72 20  zation...!error 
7c20: 24 28 4d 53 47 29 0d 0a 21 65 6e 64 69 66 0d 0a  $(MSG)..!endif..
7c30: 21 65 6c 73 65 69 66 20 24 28 50 47 4f 29 20 3e  !elseif $(PGO) >
7c40: 20 30 0d 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45   0..!if [$(NMAKE
7c50: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 6c 20 2d  HLP_NATIVE) -l -
7c60: 6c 74 63 67 3a 70 67 69 6e 73 74 72 75 6d 65 6e  ltcg:pginstrumen
7c70: 74 20 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46  t $(LINKER_TESTF
7c80: 4c 41 47 53 29 5d 0d 0a 4c 49 4e 4b 45 52 46 4c  LAGS)]..LINKERFL
7c90: 41 47 53 09 3d 20 24 28 4c 49 4e 4b 45 52 46 4c  AGS.= $(LINKERFL
7ca0: 41 47 53 3a 2d 6c 74 63 67 3d 29 20 2d 6c 74 63  AGS:-ltcg=) -ltc
7cb0: 67 3a 70 67 69 6e 73 74 72 75 6d 65 6e 74 0d 0a  g:pginstrument..
7cc0: 21 65 6c 73 65 0d 0a 4d 53 47 3d 5e 0d 0a 54 68  !else..MSG=^..Th
7cd0: 69 73 20 63 6f 6d 70 69 6c 65 72 20 64 6f 65 73  is compiler does
7ce0: 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 70 72 6f   not support pro
7cf0: 66 69 6c 65 20 67 75 69 64 65 64 20 6f 70 74 69  file guided opti
7d00: 6d 69 7a 61 74 69 6f 6e 2e 0d 0a 21 65 72 72 6f  mization...!erro
7d10: 72 20 24 28 4d 53 47 29 0d 0a 21 65 6e 64 69 66  r $(MSG)..!endif
7d20: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 23 23 23  ..!endif....####
7d30: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7d40: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7d50: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
7d60: 23 23 23 23 23 23 23 23 23 23 23 23 0d 0a 23 20  ############..# 
7d70: 38 2e 20 50 61 72 73 65 20 74 68 65 20 53 54 41  8. Parse the STA
7d80: 54 53 20 6d 61 63 72 6f 20 74 6f 20 63 6f 6e 66  TS macro to conf
7d90: 69 67 75 72 65 20 63 6f 64 65 20 69 6e 73 74 72  igure code instr
7da0: 75 6d 65 6e 74 61 74 69 6f 6e 0d 0a 23 20 54 68  umentation..# Th
7db0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72  e following macr
7dc0: 6f 73 20 61 72 65 20 73 65 74 20 62 79 20 74 68  os are set by th
7dd0: 69 73 20 73 65 63 74 69 6f 6e 3a 0d 0a 23 20 54  is section:..# T
7de0: 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 20 2d 20 31  CL_MEM_DEBUG - 1
7df0: 20 2d 3e 20 65 6e 61 62 6c 65 73 20 6d 65 6d 6f   -> enables memo
7e00: 72 79 20 61 6c 6c 6f 63 61 74 69 6f 6e 20 69 6e  ry allocation in
7e10: 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0d 0a 23  strumentation..#
7e20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7e30: 20 30 20 2d 3e 20 64 69 73 61 62 6c 65 73 0d 0a   0 -> disables..
7e40: 23 20 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 44 45  # TCL_COMPILE_DE
7e50: 42 55 47 20 2d 20 31 20 2d 3e 20 65 6e 61 62 6c  BUG - 1 -> enabl
7e60: 65 73 20 62 79 74 65 20 63 6f 6d 70 69 6c 65 72  es byte compiler
7e70: 20 6c 6f 67 67 69 6e 67 0d 0a 23 20 20 20 20 20   logging..#     
7e80: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7e90: 30 20 2d 3e 20 64 69 73 61 62 6c 65 73 0d 0a 0d  0 -> disables...
7ea0: 0a 23 20 44 65 66 61 75 6c 74 20 62 6f 74 68 20  .# Default both 
7eb0: 61 72 65 20 6f 66 66 0d 0a 54 43 4c 5f 4d 45 4d  are off..TCL_MEM
7ec0: 5f 44 45 42 55 47 09 20 20 20 20 3d 20 30 0d 0a  _DEBUG.    = 0..
7ed0: 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 44 45 42 55  TCL_COMPILE_DEBU
7ee0: 47 20 20 20 3d 20 30 0d 0a 0d 0a 21 69 66 20 22  G   = 0....!if "
7ef0: 24 28 53 54 41 54 53 29 22 20 21 3d 20 22 22 20  $(STATS)" != "" 
7f00: 26 26 20 21 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f  && ![$(NMAKEHLP_
7f10: 4e 41 54 49 56 45 29 20 2d 66 20 22 24 28 53 54  NATIVE) -f "$(ST
7f20: 41 54 53 29 22 20 22 6e 6f 6e 65 22 5d 0d 0a 0d  ATS)" "none"]...
7f30: 0a 21 69 66 20 24 28 56 45 52 42 4f 53 45 29 0d  .!if $(VERBOSE).
7f40: 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 53 54  .!message *** ST
7f50: 41 54 53 3d 24 28 53 54 41 54 53 29 0d 0a 21 65  ATS=$(STATS)..!e
7f60: 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 5b 24 28 4e  ndif....!if [$(N
7f70: 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20  MAKEHLP_NATIVE) 
7f80: 2d 66 20 24 28 53 54 41 54 53 29 20 22 6d 65 6d  -f $(STATS) "mem
7f90: 64 62 67 22 5d 0d 0a 54 43 4c 5f 4d 45 4d 5f 44  dbg"]..TCL_MEM_D
7fa0: 45 42 55 47 09 20 20 20 20 3d 20 31 0d 0a 21 65  EBUG.    = 1..!e
7fb0: 6c 73 65 0d 0a 54 43 4c 5f 4d 45 4d 5f 44 45 42  lse..TCL_MEM_DEB
7fc0: 55 47 09 20 20 20 20 3d 20 30 0d 0a 21 65 6e 64  UG.    = 0..!end
7fd0: 69 66 0d 0a 0d 0a 21 69 66 20 5b 24 28 4e 4d 41  if....!if [$(NMA
7fe0: 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66  KEHLP_NATIVE) -f
7ff0: 20 24 28 53 54 41 54 53 29 20 22 63 6f 6d 70 64   $(STATS) "compd
8000: 62 67 22 5d 0d 0a 54 43 4c 5f 43 4f 4d 50 49 4c  bg"]..TCL_COMPIL
8010: 45 5f 44 45 42 55 47 20 20 20 3d 20 31 0d 0a 21  E_DEBUG   = 1..!
8020: 65 6c 73 65 0d 0a 54 43 4c 5f 43 4f 4d 50 49 4c  else..TCL_COMPIL
8030: 45 5f 44 45 42 55 47 20 20 20 3d 20 30 0d 0a 21  E_DEBUG   = 0..!
8040: 65 6e 64 69 66 0d 0a 0d 0a 21 65 6e 64 69 66 0d  endif....!endif.
8050: 0a 0d 0a 23 23 23 23 23 23 23 23 23 23 23 23 23  ...#############
8060: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
8070: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
8080: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
8090: 23 23 23 23 23 23 23 0d 0a 23 20 39 2e 20 50 61  #######..# 9. Pa
80a0: 72 73 65 20 74 68 65 20 43 48 45 43 4b 53 20 6d  rse the CHECKS m
80b0: 61 63 72 6f 20 74 6f 20 63 6f 6e 66 69 67 75 72  acro to configur
80c0: 65 20 61 64 64 69 74 69 6f 6e 61 6c 20 63 6f 6d  e additional com
80d0: 70 69 6c 65 72 20 63 68 65 63 6b 73 0d 0a 23 20  piler checks..# 
80e0: 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61  The following ma
80f0: 63 72 6f 73 20 61 72 65 20 73 65 74 20 62 79 20  cros are set by 
8100: 74 68 69 73 20 73 65 63 74 69 6f 6e 3a 0d 0a 23  this section:..#
8110: 20 57 41 52 4e 49 4e 47 53 20 2d 20 63 6f 6d 70   WARNINGS - comp
8120: 69 6c 65 72 20 73 77 69 74 63 68 65 73 20 74 68  iler switches th
8130: 61 74 20 63 6f 6e 74 72 6f 6c 20 74 68 65 20 77  at control the w
8140: 61 72 6e 69 6e 67 73 20 6c 65 76 65 6c 0d 0a 23  arnings level..#
8150: 20 54 43 4c 5f 4e 4f 5f 44 45 50 52 45 43 41 54   TCL_NO_DEPRECAT
8160: 45 44 20 2d 20 31 20 2d 3e 20 64 69 73 61 62 6c  ED - 1 -> disabl
8170: 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 64 65  e support for de
8180: 70 72 65 63 61 74 65 64 20 66 75 6e 63 74 69 6f  precated functio
8190: 6e 73 0d 0a 23 20 20 20 20 20 20 20 20 20 20 20  ns..#           
81a0: 20 20 20 20 20 20 20 20 20 20 30 20 2d 3e 20 65            0 -> e
81b0: 6e 61 62 6c 65 20 64 65 70 72 65 63 61 74 65 64  nable deprecated
81c0: 20 66 75 6e 63 74 69 6f 6e 73 0d 0a 0d 0a 23 20   functions....# 
81d0: 44 65 66 61 75 6c 74 73 20 2d 20 50 65 72 6d 69  Defaults - Permi
81e0: 74 20 64 65 70 72 65 63 61 74 65 64 20 66 75 6e  t deprecated fun
81f0: 63 74 69 6f 6e 73 20 61 6e 64 20 77 61 72 6e 69  ctions and warni
8200: 6e 67 20 6c 65 76 65 6c 20 33 0d 0a 54 43 4c 5f  ng level 3..TCL_
8210: 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 09 20 20  NO_DEPRECATED.  
8220: 20 20 3d 20 30 0d 0a 57 41 52 4e 49 4e 47 53 09    = 0..WARNINGS.
8230: 09 20 20 20 20 3d 20 2d 57 33 0d 0a 0d 0a 21 69  .    = -W3....!i
8240: 66 20 22 24 28 43 48 45 43 4b 53 29 22 20 21 3d  f "$(CHECKS)" !=
8250: 20 22 22 20 26 26 20 21 5b 24 28 4e 4d 41 4b 45   "" && ![$(NMAKE
8260: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 22  HLP_NATIVE) -f "
8270: 24 28 43 48 45 43 4b 53 29 22 20 22 6e 6f 6e 65  $(CHECKS)" "none
8280: 22 5d 0d 0a 0d 0a 21 69 66 20 5b 24 28 4e 4d 41  "]....!if [$(NMA
8290: 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66  KEHLP_NATIVE) -f
82a0: 20 24 28 43 48 45 43 4b 53 29 20 22 6e 6f 64 65   $(CHECKS) "node
82b0: 70 22 5d 0d 0a 54 43 4c 5f 4e 4f 5f 44 45 50 52  p"]..TCL_NO_DEPR
82c0: 45 43 41 54 45 44 09 20 20 20 20 3d 20 31 0d 0a  ECATED.    = 1..
82d0: 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 5b 24  !endif....!if [$
82e0: 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45  (NMAKEHLP_NATIVE
82f0: 29 20 2d 66 20 24 28 43 48 45 43 4b 53 29 20 22  ) -f $(CHECKS) "
8300: 66 75 6c 6c 77 61 72 6e 22 5d 0d 0a 57 41 52 4e  fullwarn"]..WARN
8310: 49 4e 47 53 09 09 20 20 20 20 3d 20 2d 57 34 0d  INGS..    = -W4.
8320: 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50  .!if [$(NMAKEHLP
8330: 5f 4e 41 54 49 56 45 29 20 2d 6c 20 2d 77 61 72  _NATIVE) -l -war
8340: 6e 3a 33 20 24 28 4c 49 4e 4b 45 52 5f 54 45 53  n:3 $(LINKER_TES
8350: 54 46 4c 41 47 53 29 5d 0d 0a 4c 49 4e 4b 45 52  TFLAGS)]..LINKER
8360: 46 4c 41 47 53 09 09 20 20 20 20 3d 20 24 28 4c  FLAGS..    = $(L
8370: 49 4e 4b 45 52 46 4c 41 47 53 29 20 2d 77 61 72  INKERFLAGS) -war
8380: 6e 3a 33 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e  n:3..!endif..!en
8390: 64 69 66 0d 0a 0d 0a 21 69 66 20 5b 24 28 4e 4d  dif....!if [$(NM
83a0: 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d  AKEHLP_NATIVE) -
83b0: 66 20 24 28 43 48 45 43 4b 53 29 20 22 36 34 62  f $(CHECKS) "64b
83c0: 69 74 22 5d 20 26 26 20 5b 24 28 4e 4d 41 4b 45  it"] && [$(NMAKE
83d0: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 63 20 2d  HLP_NATIVE) -c -
83e0: 57 70 36 34 5d 0d 0a 57 41 52 4e 49 4e 47 53 09  Wp64]..WARNINGS.
83f0: 09 20 20 20 20 3d 20 24 28 57 41 52 4e 49 4e 47  .    = $(WARNING
8400: 53 29 20 2d 57 70 36 34 0d 0a 21 65 6e 64 69 66  S) -Wp64..!endif
8410: 0d 0a 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 0d 0a  ....!endif......
8420: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
8430: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
8440: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
8450: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
8460: 0d 0a 23 20 31 30 2e 20 43 6f 6e 73 74 72 75 63  ..# 10. Construc
8470: 74 20 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f  t output directo
8480: 72 79 20 61 6e 64 20 66 69 6c 65 20 70 61 74 68  ry and file path
8490: 73 0d 0a 23 20 46 69 67 75 72 65 2d 6f 75 74 20  s..# Figure-out 
84a0: 68 6f 77 20 74 6f 20 6e 61 6d 65 20 6f 75 72 20  how to name our 
84b0: 69 6e 74 65 72 6d 65 64 69 61 74 65 20 61 6e 64  intermediate and
84c0: 20 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f 72   output director
84d0: 69 65 73 2e 0d 0a 23 20 49 6e 20 6f 72 64 65 72  ies...# In order
84e0: 20 74 6f 20 61 76 6f 69 64 20 69 6e 61 64 76 65   to avoid inadve
84f0: 72 74 65 6e 74 20 6d 69 78 69 6e 67 20 6f 66 20  rtent mixing of 
8500: 6f 62 6a 65 63 74 20 66 69 6c 65 73 20 62 75 69  object files bui
8510: 6c 74 20 75 73 69 6e 67 0d 0a 23 20 64 69 66 66  lt using..# diff
8520: 65 72 65 6e 74 20 63 6f 6d 70 69 6c 65 72 73 2c  erent compilers,
8530: 20 62 75 69 6c 64 20 63 6f 6e 66 69 67 75 72 61   build configura
8540: 74 69 6f 6e 73 20 65 74 63 2e 2c 0d 0a 23 0d 0a  tions etc.,..#..
8550: 23 20 4e 61 6d 69 6e 67 20 63 6f 6e 76 65 6e 74  # Naming convent
8560: 69 6f 6e 20 28 73 75 66 66 69 78 65 73 29 3a 0d  ion (suffixes):.
8570: 0a 23 20 20 20 74 20 3d 20 66 75 6c 6c 20 74 68  .#   t = full th
8580: 72 65 61 64 20 73 75 70 70 6f 72 74 2e 20 28 4e  read support. (N
8590: 6f 74 20 75 73 65 64 20 66 6f 72 20 54 63 6c 20  ot used for Tcl 
85a0: 3e 3d 20 39 2e 30 29 0d 0a 23 20 20 20 73 20 3d  >= 9.0)..#   s =
85b0: 20 73 74 61 74 69 63 20 6c 69 62 72 61 72 79 20   static library 
85c0: 28 61 73 20 6f 70 70 6f 73 65 64 20 74 6f 20 61  (as opposed to a
85d0: 6e 20 69 6d 70 6f 72 74 20 6c 69 62 72 61 72 79  n import library
85e0: 29 0d 0a 23 20 20 20 67 20 3d 20 6c 69 6e 6b 65  )..#   g = linke
85f0: 64 20 74 6f 20 74 68 65 20 64 65 62 75 67 20 65  d to the debug e
8600: 6e 61 62 6c 65 64 20 43 20 72 75 6e 2d 74 69 6d  nabled C run-tim
8610: 65 2e 0d 0a 23 20 20 20 78 20 3d 20 73 70 65 63  e...#   x = spec
8620: 69 61 6c 20 73 74 61 74 69 63 20 62 75 69 6c 64  ial static build
8630: 20 77 68 65 6e 20 69 74 20 6c 69 6e 6b 73 20 74   when it links t
8640: 6f 20 74 68 65 20 64 79 6e 61 6d 69 63 20 43 20  o the dynamic C 
8650: 72 75 6e 2d 74 69 6d 65 2e 0d 0a 23 0d 0a 23 20  run-time...#..# 
8660: 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61  The following ma
8670: 63 72 6f 73 20 61 72 65 20 73 65 74 20 69 6e 20  cros are set in 
8680: 74 68 69 73 20 73 65 63 74 69 6f 6e 3a 0d 0a 23  this section:..#
8690: 20 53 55 46 58 20 2d 20 74 68 65 20 73 75 66 66   SUFX - the suff
86a0: 69 78 20 74 6f 20 75 73 65 20 66 6f 72 20 62 69  ix to use for bi
86b0: 6e 61 72 69 65 73 20 62 61 73 65 64 20 6f 6e 20  naries based on 
86c0: 61 62 6f 76 65 20 6e 61 6d 69 6e 67 20 63 6f 6e  above naming con
86d0: 76 65 6e 74 69 6f 6e 0d 0a 23 20 42 55 49 4c 44  vention..# BUILD
86e0: 44 49 52 54 4f 50 20 2d 20 74 68 65 20 74 6f 70  DIRTOP - the top
86f0: 6c 65 76 65 6c 20 64 65 66 61 75 6c 74 20 6f 75  level default ou
8700: 74 70 75 74 20 64 69 72 65 63 74 6f 72 79 0d 0a  tput directory..
8710: 23 20 20 20 20 20 20 69 73 20 6f 66 20 74 68 65  #      is of the
8720: 20 66 6f 72 6d 20 7b 52 65 6c 65 61 73 65 2c 44   form {Release,D
8730: 65 62 75 67 7d 5b 5f 41 4d 44 36 34 5d 5b 5f 43  ebug}[_AMD64][_C
8740: 4f 4d 50 49 4c 45 52 56 45 52 53 49 4f 4e 5d 0d  OMPILERVERSION].
8750: 0a 23 20 20 20 20 20 20 75 6e 6c 65 73 73 20 6f  .#      unless o
8760: 76 65 72 72 69 64 64 65 6e 20 62 79 20 64 65 66  verridden by def
8770: 69 6e 69 6e 67 20 4f 55 54 5f 44 49 52 20 6f 6e  ining OUT_DIR on
8780: 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e   the command lin
8790: 65 2e 0d 0a 23 20 54 4d 50 5f 44 49 52 20 2d 20  e...# TMP_DIR - 
87a0: 64 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 20  directory where 
87b0: 6f 62 6a 65 63 74 20 66 69 6c 65 73 20 61 72 65  object files are
87c0: 20 63 72 65 61 74 65 64 0d 0a 23 20 4f 55 54 5f   created..# OUT_
87d0: 44 49 52 20 2d 20 64 69 72 65 63 74 6f 72 79 20  DIR - directory 
87e0: 77 68 65 72 65 20 6f 75 74 70 75 74 20 65 78 65  where output exe
87f0: 63 75 74 61 62 6c 65 73 20 61 72 65 20 63 72 65  cutables are cre
8800: 61 74 65 64 0d 0a 23 20 42 6f 74 68 20 54 4d 50  ated..# Both TMP
8810: 5f 44 49 52 20 61 6e 64 20 4f 55 54 5f 44 49 52  _DIR and OUT_DIR
8820: 20 61 72 65 20 64 65 66 61 75 6c 74 65 64 20 6f   are defaulted o
8830: 6e 6c 79 20 69 66 20 6e 6f 74 20 64 65 66 69 6e  nly if not defin
8840: 65 64 20 62 79 20 74 68 65 0d 0a 23 20 70 61 72  ed by the..# par
8850: 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 28 6f 72  ent makefile (or
8860: 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 29 2e 20   command line). 
8870: 54 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c 75  The default valu
8880: 65 73 20 61 72 65 0d 0a 23 20 62 61 73 65 64 20  es are..# based 
8890: 6f 6e 20 42 55 49 4c 44 44 49 52 54 4f 50 2e 0d  on BUILDDIRTOP..
88a0: 0a 23 20 53 54 55 42 50 52 45 46 49 58 20 2d 20  .# STUBPREFIX - 
88b0: 6e 61 6d 65 20 6f 66 20 74 68 65 20 73 74 75 62  name of the stub
88c0: 73 20 6c 69 62 72 61 72 79 20 66 6f 72 20 74 68  s library for th
88d0: 69 73 20 70 72 6f 6a 65 63 74 0d 0a 23 20 50 52  is project..# PR
88e0: 4a 49 4d 50 4c 49 42 20 2d 20 6f 75 74 70 75 74  JIMPLIB - output
88f0: 20 70 61 74 68 20 6f 66 20 74 68 65 20 67 65 6e   path of the gen
8900: 65 72 61 74 65 64 20 70 72 6f 6a 65 63 74 20 69  erated project i
8910: 6d 70 6f 72 74 20 6c 69 62 72 61 72 79 0d 0a 23  mport library..#
8920: 20 50 52 4a 4c 49 42 4e 41 4d 45 20 2d 20 6e 61   PRJLIBNAME - na
8930: 6d 65 20 6f 66 20 67 65 6e 65 72 61 74 65 64 20  me of generated 
8940: 70 72 6f 6a 65 63 74 20 6c 69 62 72 61 72 79 0d  project library.
8950: 0a 23 20 50 52 4a 4c 49 42 20 20 20 20 20 2d 20  .# PRJLIB     - 
8960: 6f 75 74 70 75 74 20 70 61 74 68 20 6f 66 20 67  output path of g
8970: 65 6e 65 72 61 74 65 64 20 70 72 6f 6a 65 63 74  enerated project
8980: 20 6c 69 62 72 61 72 79 0d 0a 23 20 50 52 4a 53   library..# PRJS
8990: 54 55 42 4c 49 42 4e 41 4d 45 20 2d 20 6e 61 6d  TUBLIBNAME - nam
89a0: 65 20 6f 66 20 74 68 65 20 67 65 6e 65 72 61 74  e of the generat
89b0: 65 64 20 70 72 6f 6a 65 63 74 20 73 74 75 62 73  ed project stubs
89c0: 20 6c 69 62 72 61 72 79 0d 0a 23 20 50 52 4a 53   library..# PRJS
89d0: 54 55 42 4c 49 42 20 2d 20 6f 75 74 70 75 74 20  TUBLIB - output 
89e0: 70 61 74 68 20 6f 66 20 74 68 65 20 67 65 6e 65  path of the gene
89f0: 72 61 74 65 64 20 70 72 6f 6a 65 63 74 20 73 74  rated project st
8a00: 75 62 73 20 6c 69 62 72 61 72 79 0d 0a 23 20 52  ubs library..# R
8a10: 45 53 46 49 4c 45 20 2d 20 6f 75 74 70 75 74 20  ESFILE - output 
8a20: 72 65 73 6f 75 72 63 65 20 66 69 6c 65 20 28 6f  resource file (o
8a30: 6e 6c 79 20 69 66 20 6e 6f 74 20 73 74 61 74 69  nly if not stati
8a40: 63 20 62 75 69 6c 64 29 0d 0a 0d 0a 53 55 46 58  c build)....SUFX
8a50: 09 20 20 20 20 3d 20 74 73 67 78 0d 0a 0d 0a 23  .    = tsgx....#
8a60: 20 49 66 20 4f 55 54 5f 44 49 52 20 69 73 20 64   If OUT_DIR is d
8a70: 65 66 69 6e 65 64 20 28 76 69 61 20 63 6f 6d 6d  efined (via comm
8a80: 61 6e 64 20 6c 69 6e 65 20 6f 72 20 65 6e 76 69  and line or envi
8a90: 72 6f 6e 6d 65 6e 74 29 20 6d 61 6b 65 20 74 68  ronment) make th
8aa0: 61 74 0d 0a 23 20 64 65 66 69 6e 65 20 42 55 49  at..# define BUI
8ab0: 4c 44 44 49 52 54 4f 50 20 61 73 20 69 74 73 20  LDDIRTOP as its 
8ac0: 74 61 69 6c 2e 20 4f 74 68 65 72 77 69 73 65 2c  tail. Otherwise,
8ad0: 20 64 65 66 61 75 6c 74 20 69 74 20 61 73 20 62   default it as b
8ae0: 65 6c 6f 77 20 61 6e 64 0d 0a 23 20 64 65 66 69  elow and..# defi
8af0: 6e 65 20 4f 55 54 5f 44 49 52 20 62 61 73 65 64  ne OUT_DIR based
8b00: 20 6f 6e 20 42 55 49 4c 44 44 49 52 54 4f 50 2e   on BUILDDIRTOP.
8b10: 0d 0a 21 69 66 64 65 66 20 4f 55 54 5f 44 49 52  ..!ifdef OUT_DIR
8b20: 0d 0a 23 20 52 65 6c 61 74 69 76 65 20 70 61 74  ..# Relative pat
8b30: 68 73 20 2d 3e 20 61 62 73 6f 6c 75 74 65 0d 0a  hs -> absolute..
8b40: 21 69 66 20 5b 65 63 68 6f 20 4f 55 54 5f 44 49  !if [echo OUT_DI
8b50: 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c 70 2e  R = \> nmakehlp.
8b60: 6f 75 74 5d 20 5c 0d 0a 20 20 20 7c 7c 20 5b 24  out] \..   || [$
8b70: 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45  (NMAKEHLP_NATIVE
8b80: 29 20 2d 51 20 22 24 28 4f 55 54 5f 44 49 52 29  ) -Q "$(OUT_DIR)
8b90: 22 20 3e 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75  " >> nmakehlp.ou
8ba0: 74 5d 0d 0a 21 65 72 72 6f 72 20 2a 2a 2a 20 43  t]..!error *** C
8bb0: 6f 75 6c 64 20 6e 6f 74 20 66 75 6c 6c 79 20 71  ould not fully q
8bc0: 75 61 6c 69 66 79 20 70 61 74 68 20 4f 55 54 5f  ualify path OUT_
8bd0: 44 49 52 3d 24 28 4f 55 54 5f 44 49 52 29 0d 0a  DIR=$(OUT_DIR)..
8be0: 21 65 6e 64 69 66 0d 0a 23 20 54 68 65 20 75 6e  !endif..# The un
8bf0: 64 65 66 20 69 73 20 6e 65 65 64 65 64 20 77 68  def is needed wh
8c00: 65 6e 20 4f 55 54 5f 44 49 52 20 69 73 20 70 61  en OUT_DIR is pa
8c10: 73 73 65 64 20 6f 6e 20 74 68 65 20 63 6f 6d 6d  ssed on the comm
8c20: 61 6e 64 20 6c 69 6e 65 0d 0a 23 20 6f 74 68 65  and line..# othe
8c30: 72 77 69 73 65 20 74 68 65 20 64 65 66 69 6e 69  rwise the defini
8c40: 74 69 6f 6e 20 69 6e 20 74 68 65 20 69 6e 63 6c  tion in the incl
8c50: 75 64 65 20 77 69 6c 6c 20 6e 6f 74 20 74 61 6b  ude will not tak
8c60: 65 20 65 66 66 65 63 74 0d 0a 21 75 6e 64 65 66  e effect..!undef
8c70: 20 4f 55 54 5f 44 49 52 0d 0a 21 69 6e 63 6c 75   OUT_DIR..!inclu
8c80: 64 65 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0d  de nmakehlp.out.
8c90: 0a 21 69 66 20 5b 65 63 68 6f 20 42 55 49 4c 44  .!if [echo BUILD
8ca0: 44 49 52 54 4f 50 20 3d 20 5c 3e 20 6e 6d 61 6b  DIRTOP = \> nmak
8cb0: 65 68 6c 70 2e 6f 75 74 5d 20 5c 0d 0a 20 20 20  ehlp.out] \..   
8cc0: 7c 7c 20 5b 66 6f 72 20 25 41 20 69 6e 20 28 22  || [for %A in ("
8cd0: 24 28 4f 55 54 5f 44 49 52 29 22 29 20 64 6f 20  $(OUT_DIR)") do 
8ce0: 65 63 68 6f 20 25 7e 6e 78 41 20 5c 3e 3e 20 6e  echo %~nxA \>> n
8cf0: 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0d 0a 21 65  makehlp.out]..!e
8d00: 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e  rror *** Could n
8d10: 6f 74 20 67 65 74 20 74 61 69 6c 20 6f 66 20 70  ot get tail of p
8d20: 61 74 68 20 4f 55 54 5f 44 49 52 3d 24 28 4f 55  ath OUT_DIR=$(OU
8d30: 54 5f 44 49 52 29 0d 0a 21 65 6e 64 69 66 0d 0a  T_DIR)..!endif..
8d40: 21 69 6e 63 6c 75 64 65 20 6e 6d 61 6b 65 68 6c  !include nmakehl
8d50: 70 2e 6f 75 74 0d 0a 0d 0a 21 65 6c 73 65 0d 0a  p.out....!else..
8d60: 0d 0a 21 69 66 20 24 28 44 45 42 55 47 29 0d 0a  ..!if $(DEBUG)..
8d70: 42 55 49 4c 44 44 49 52 54 4f 50 20 3d 20 44 65  BUILDDIRTOP = De
8d80: 62 75 67 0d 0a 21 65 6c 73 65 0d 0a 42 55 49 4c  bug..!else..BUIL
8d90: 44 44 49 52 54 4f 50 20 3d 20 52 65 6c 65 61 73  DDIRTOP = Releas
8da0: 65 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 0d 0a 21  e..!endif......!
8db0: 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20  if "$(MACHINE)" 
8dc0: 21 3d 20 22 49 58 38 36 22 0d 0a 42 55 49 4c 44  != "IX86"..BUILD
8dd0: 44 49 52 54 4f 50 20 3d 24 28 42 55 49 4c 44 44  DIRTOP =$(BUILDD
8de0: 49 52 54 4f 50 29 5f 24 28 4d 41 43 48 49 4e 45  IRTOP)_$(MACHINE
8df0: 29 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 24  )..!endif..!if $
8e00: 28 56 43 56 45 52 29 20 3e 20 36 0d 0a 42 55 49  (VCVER) > 6..BUI
8e10: 4c 44 44 49 52 54 4f 50 20 3d 24 28 42 55 49 4c  LDDIRTOP =$(BUIL
8e20: 44 44 49 52 54 4f 50 29 5f 56 43 24 28 56 43 56  DDIRTOP)_VC$(VCV
8e30: 45 52 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21  ER)..!endif....!
8e40: 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20 21 24 28  endif....!if !$(
8e50: 44 45 42 55 47 29 20 7c 7c 20 24 28 54 43 4c 5f  DEBUG) || $(TCL_
8e60: 56 45 52 53 49 4f 4e 29 20 3e 20 38 36 20 7c 7c  VERSION) > 86 ||
8e70: 20 24 28 44 45 42 55 47 29 20 26 26 20 24 28 55   $(DEBUG) && $(U
8e80: 4e 43 48 45 43 4b 45 44 29 0d 0a 53 55 46 58 09  NCHECKED)..SUFX.
8e90: 20 20 20 20 3d 20 24 28 53 55 46 58 3a 67 3d 29      = $(SUFX:g=)
8ea0: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 54 4d 50 5f  ..!endif....TMP_
8eb0: 44 49 52 46 55 4c 4c 20 3d 20 2e 5c 24 28 42 55  DIRFULL = .\$(BU
8ec0: 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 50 52 4f  ILDDIRTOP)\$(PRO
8ed0: 4a 45 43 54 29 5f 54 68 72 65 61 64 65 64 44 79  JECT)_ThreadedDy
8ee0: 6e 61 6d 69 63 53 74 61 74 69 63 58 0d 0a 0d 0a  namicStaticX....
8ef0: 21 69 66 20 21 24 28 53 54 41 54 49 43 5f 42 55  !if !$(STATIC_BU
8f00: 49 4c 44 29 0d 0a 54 4d 50 5f 44 49 52 46 55 4c  ILD)..TMP_DIRFUL
8f10: 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 4c  L = $(TMP_DIRFUL
8f20: 4c 3a 53 74 61 74 69 63 3d 29 0d 0a 53 55 46 58  L:Static=)..SUFX
8f30: 09 20 20 20 20 3d 20 24 28 53 55 46 58 3a 73 3d  .    = $(SUFX:s=
8f40: 29 0d 0a 45 58 54 09 20 20 20 20 3d 20 64 6c 6c  )..EXT.    = dll
8f50: 0d 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d 20  ..TMP_DIRFULL = 
8f60: 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 58 3d  $(TMP_DIRFULL:X=
8f70: 29 0d 0a 53 55 46 58 09 20 20 20 20 3d 20 24 28  )..SUFX.    = $(
8f80: 53 55 46 58 3a 78 3d 29 0d 0a 21 65 6c 73 65 0d  SUFX:x=)..!else.
8f90: 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d 20 24  .TMP_DIRFULL = $
8fa0: 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 44 79 6e  (TMP_DIRFULL:Dyn
8fb0: 61 6d 69 63 3d 29 0d 0a 45 58 54 09 20 20 20 20  amic=)..EXT.    
8fc0: 3d 20 6c 69 62 0d 0a 21 69 66 20 24 28 4d 53 56  = lib..!if $(MSV
8fd0: 43 52 54 29 20 26 26 20 24 28 54 43 4c 5f 56 45  CRT) && $(TCL_VE
8fe0: 52 53 49 4f 4e 29 20 3e 20 38 36 20 7c 7c 20 21  RSION) > 86 || !
8ff0: 24 28 4d 53 56 43 52 54 29 20 26 26 20 24 28 54  $(MSVCRT) && $(T
9000: 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3c 20 38 37  CL_VERSION) < 87
9010: 0d 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d 20  ..TMP_DIRFULL = 
9020: 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 58 3d  $(TMP_DIRFULL:X=
9030: 29 0d 0a 53 55 46 58 09 20 20 20 20 3d 20 24 28  )..SUFX.    = $(
9040: 53 55 46 58 3a 78 3d 29 0d 0a 21 65 6e 64 69 66  SUFX:x=)..!endif
9050: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20  ..!endif....!if 
9060: 21 24 28 54 43 4c 5f 54 48 52 45 41 44 53 29 20  !$(TCL_THREADS) 
9070: 7c 7c 20 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e  || $(TCL_VERSION
9080: 29 20 3e 20 38 36 0d 0a 54 4d 50 5f 44 49 52 46  ) > 86..TMP_DIRF
9090: 55 4c 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52 46  ULL = $(TMP_DIRF
90a0: 55 4c 4c 3a 54 68 72 65 61 64 65 64 3d 29 0d 0a  ULL:Threaded=)..
90b0: 53 55 46 58 09 20 20 20 20 3d 20 24 28 53 55 46  SUFX.    = $(SUF
90c0: 58 3a 74 3d 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d  X:t=)..!endif...
90d0: 0a 21 69 66 6e 64 65 66 20 54 4d 50 5f 44 49 52  .!ifndef TMP_DIR
90e0: 0d 0a 54 4d 50 5f 44 49 52 09 20 20 20 20 3d 20  ..TMP_DIR.    = 
90f0: 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 29 0d 0a  $(TMP_DIRFULL)..
9100: 21 69 66 6e 64 65 66 20 4f 55 54 5f 44 49 52 0d  !ifndef OUT_DIR.
9110: 0a 4f 55 54 5f 44 49 52 09 20 20 20 20 3d 20 2e  .OUT_DIR.    = .
9120: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 0d  \$(BUILDDIRTOP).
9130: 0a 21 65 6e 64 69 66 0d 0a 21 65 6c 73 65 0d 0a  .!endif..!else..
9140: 21 69 66 6e 64 65 66 20 4f 55 54 5f 44 49 52 0d  !ifndef OUT_DIR.
9150: 0a 4f 55 54 5f 44 49 52 09 20 20 20 20 3d 20 24  .OUT_DIR.    = $
9160: 28 54 4d 50 5f 44 49 52 29 0d 0a 21 65 6e 64 69  (TMP_DIR)..!endi
9170: 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 52  f..!endif....# R
9180: 65 6c 61 74 69 76 65 20 70 61 74 68 73 20 2d 3e  elative paths ->
9190: 20 61 62 73 6f 6c 75 74 65 0d 0a 21 69 66 20 5b   absolute..!if [
91a0: 65 63 68 6f 20 4f 55 54 5f 44 49 52 20 3d 20 5c  echo OUT_DIR = \
91b0: 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20  > nmakehlp.out] 
91c0: 5c 0d 0a 20 20 20 7c 7c 20 5b 24 28 4e 4d 41 4b  \..   || [$(NMAK
91d0: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 51 20  EHLP_NATIVE) -Q 
91e0: 22 24 28 4f 55 54 5f 44 49 52 29 22 20 3e 3e 20  "$(OUT_DIR)" >> 
91f0: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0d 0a 21  nmakehlp.out]..!
9200: 65 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20  error *** Could 
9210: 6e 6f 74 20 66 75 6c 6c 79 20 71 75 61 6c 69 66  not fully qualif
9220: 79 20 70 61 74 68 20 4f 55 54 5f 44 49 52 3d 24  y path OUT_DIR=$
9230: 28 4f 55 54 5f 44 49 52 29 0d 0a 21 65 6e 64 69  (OUT_DIR)..!endi
9240: 66 0d 0a 21 69 66 20 5b 65 63 68 6f 20 54 4d 50  f..!if [echo TMP
9250: 5f 44 49 52 20 3d 20 5c 3e 3e 20 6e 6d 61 6b 65  _DIR = \>> nmake
9260: 68 6c 70 2e 6f 75 74 5d 20 5c 0d 0a 20 20 20 7c  hlp.out] \..   |
9270: 7c 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41  | [$(NMAKEHLP_NA
9280: 54 49 56 45 29 20 2d 51 20 22 24 28 54 4d 50 5f  TIVE) -Q "$(TMP_
9290: 44 49 52 29 22 20 3e 3e 20 6e 6d 61 6b 65 68 6c  DIR)" >> nmakehl
92a0: 70 2e 6f 75 74 5d 0d 0a 21 65 72 72 6f 72 20 2a  p.out]..!error *
92b0: 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 75 6c  ** Could not ful
92c0: 6c 79 20 71 75 61 6c 69 66 79 20 70 61 74 68 20  ly qualify path 
92d0: 54 4d 50 5f 44 49 52 3d 24 28 54 4d 50 5f 44 49  TMP_DIR=$(TMP_DI
92e0: 52 29 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 6e 63  R)..!endif..!inc
92f0: 6c 75 64 65 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75  lude nmakehlp.ou
9300: 74 0d 0a 0d 0a 23 20 54 68 65 20 6e 61 6d 65 20  t....# The name 
9310: 6f 66 20 74 68 65 20 73 74 75 62 73 20 6c 69 62  of the stubs lib
9320: 72 61 72 79 20 66 6f 72 20 74 68 65 20 70 72 6f  rary for the pro
9330: 6a 65 63 74 20 62 65 69 6e 67 20 62 75 69 6c 74  ject being built
9340: 0d 0a 53 54 55 42 50 52 45 46 49 58 20 20 20 20  ..STUBPREFIX    
9350: 20 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 73 74    = $(PROJECT)st
9360: 75 62 0d 0a 0d 0a 23 0d 0a 23 20 53 65 74 20 75  ub....#..# Set u
9370: 70 20 70 61 74 68 73 20 74 6f 20 76 61 72 69 6f  p paths to vario
9380: 75 73 20 54 63 6c 20 65 78 65 63 75 74 61 62 6c  us Tcl executabl
9390: 65 73 20 61 6e 64 20 6c 69 62 72 61 72 69 65 73  es and libraries
93a0: 20 6e 65 65 64 65 64 20 62 79 20 65 78 74 65 6e   needed by exten
93b0: 73 69 6f 6e 73 0d 0a 23 0d 0a 0d 0a 23 20 54 49  sions..#....# TI
93c0: 50 20 34 33 30 2e 20 55 6e 75 73 65 64 20 66 6f  P 430. Unused fo
93d0: 72 20 38 2e 36 20 62 75 74 20 6e 6f 20 68 61 72  r 8.6 but no har
93e0: 6d 20 64 65 66 69 6e 69 6e 67 20 69 74 20 74 6f  m defining it to
93f0: 20 61 6c 6c 6f 77 20 61 20 63 6f 6d 6d 6f 6e 20   allow a common 
9400: 72 75 6c 65 73 2e 76 63 0d 0a 54 43 4c 5f 5a 49  rules.vc..TCL_ZI
9410: 50 5f 46 49 4c 45 20 3d 20 6c 69 62 74 63 6c 24  P_FILE = libtcl$
9420: 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  (TCL_MAJOR_VERSI
9430: 4f 4e 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f  ON).$(TCL_MINOR_
9440: 56 45 52 53 49 4f 4e 29 24 28 54 43 4c 5f 50 41  VERSION)$(TCL_PA
9450: 54 43 48 5f 4c 45 54 54 45 52 29 24 28 54 43 4c  TCH_LETTER)$(TCL
9460: 5f 52 45 4c 45 41 53 45 5f 53 45 52 49 41 4c 29  _RELEASE_SERIAL)
9470: 2e 7a 69 70 0d 0a 54 4b 5f 5a 49 50 5f 46 49 4c  .zip..TK_ZIP_FIL
9480: 45 20 3d 20 6c 69 62 74 6b 24 28 54 4b 5f 4d 41  E = libtk$(TK_MA
9490: 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28 54  JOR_VERSION).$(T
94a0: 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29  K_MINOR_VERSION)
94b0: 24 28 54 4b 5f 50 41 54 43 48 5f 4c 45 54 54 45  $(TK_PATCH_LETTE
94c0: 52 29 24 28 54 4b 5f 52 45 4c 45 41 53 45 5f 53  R)$(TK_RELEASE_S
94d0: 45 52 49 41 4c 29 2e 7a 69 70 0d 0a 0d 0a 21 69  ERIAL).zip....!i
94e0: 66 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a  f $(DOING_TCL)..
94f0: 54 43 4c 53 48 4e 41 4d 45 20 20 20 20 20 20 20  TCLSHNAME       
9500: 3d 20 24 28 50 52 4f 4a 45 43 54 29 73 68 24 28  = $(PROJECT)sh$(
9510: 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e  VERSION)$(SUFX).
9520: 65 78 65 0d 0a 54 43 4c 53 48 09 09 3d 20 24 28  exe..TCLSH..= $(
9530: 4f 55 54 5f 44 49 52 29 5c 24 28 54 43 4c 53 48  OUT_DIR)\$(TCLSH
9540: 4e 41 4d 45 29 0d 0a 54 43 4c 49 4d 50 4c 49 42  NAME)..TCLIMPLIB
9550: 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28  .= $(OUT_DIR)\$(
9560: 50 52 4f 4a 45 43 54 29 24 28 56 45 52 53 49 4f  PROJECT)$(VERSIO
9570: 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 0d 0a 54  N)$(SUFX).lib..T
9580: 43 4c 4c 49 42 4e 41 4d 45 09 3d 20 24 28 50 52  CLLIBNAME.= $(PR
9590: 4f 4a 45 43 54 29 24 28 56 45 52 53 49 4f 4e 29  OJECT)$(VERSION)
95a0: 24 28 53 55 46 58 29 2e 24 28 45 58 54 29 0d 0a  $(SUFX).$(EXT)..
95b0: 54 43 4c 4c 49 42 09 09 3d 20 24 28 4f 55 54 5f  TCLLIB..= $(OUT_
95c0: 44 49 52 29 5c 24 28 54 43 4c 4c 49 42 4e 41 4d  DIR)\$(TCLLIBNAM
95d0: 45 29 0d 0a 54 43 4c 53 43 52 49 50 54 5a 49 50  E)..TCLSCRIPTZIP
95e0: 20 20 20 20 3d 20 24 28 4f 55 54 5f 44 49 52 29      = $(OUT_DIR)
95f0: 5c 24 28 54 43 4c 5f 5a 49 50 5f 46 49 4c 45 29  \$(TCL_ZIP_FILE)
9600: 0d 0a 0d 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41  ....!if $(TCL_MA
9610: 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20  JOR_VERSION) == 
9620: 38 0d 0a 54 43 4c 53 54 55 42 4c 49 42 4e 41 4d  8..TCLSTUBLIBNAM
9630: 45 09 3d 20 24 28 53 54 55 42 50 52 45 46 49 58  E.= $(STUBPREFIX
9640: 29 24 28 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0d  )$(VERSION).lib.
9650: 0a 21 65 6c 73 65 0d 0a 54 43 4c 53 54 55 42 4c  .!else..TCLSTUBL
9660: 49 42 4e 41 4d 45 09 3d 20 24 28 53 54 55 42 50  IBNAME.= $(STUBP
9670: 52 45 46 49 58 29 2e 6c 69 62 0d 0a 21 65 6e 64  REFIX).lib..!end
9680: 69 66 0d 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d  if..TCLSTUBLIB.=
9690: 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 43   $(OUT_DIR)\$(TC
96a0: 4c 53 54 55 42 4c 49 42 4e 41 4d 45 29 0d 0a 54  LSTUBLIBNAME)..T
96b0: 43 4c 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 3d  CL_INCLUDES    =
96c0: 20 2d 49 22 24 28 57 49 4e 5f 44 49 52 29 22 20   -I"$(WIN_DIR)" 
96d0: 2d 49 22 24 28 47 45 4e 45 52 49 43 44 49 52 29  -I"$(GENERICDIR)
96e0: 22 0d 0a 0d 0a 21 65 6c 73 65 20 23 20 21 24 28  "....!else # !$(
96f0: 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a 0d 0a 21 69  DOING_TCL)....!i
9700: 66 20 24 28 54 43 4c 49 4e 53 54 41 4c 4c 29 20  f $(TCLINSTALL) 
9710: 23 20 42 75 69 6c 64 69 6e 67 20 61 67 61 69 6e  # Building again
9720: 73 74 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20  st an installed 
9730: 54 63 6c 0d 0a 0d 0a 23 20 57 68 65 6e 20 62 75  Tcl....# When bu
9740: 69 6c 64 69 6e 67 20 65 78 74 65 6e 73 69 6f 6e  ilding extension
9750: 73 2c 20 77 65 20 6e 65 65 64 20 74 6f 20 6c 6f  s, we need to lo
9760: 63 61 74 65 20 74 63 6c 73 68 2e 20 44 65 70 65  cate tclsh. Depe
9770: 6e 64 69 6e 67 20 6f 6e 20 76 65 72 73 69 6f 6e  nding on version
9780: 0d 0a 23 20 6f 66 20 54 63 6c 20 77 65 20 61 72  ..# of Tcl we ar
9790: 65 20 62 75 69 6c 64 69 6e 67 20 61 67 61 69 6e  e building again
97a0: 73 74 2c 20 74 68 69 73 20 6d 61 79 20 6f 72 20  st, this may or 
97b0: 6d 61 79 20 6e 6f 74 20 68 61 76 65 20 61 20 22  may not have a "
97c0: 74 22 20 73 75 66 66 69 78 2e 0d 0a 23 20 54 72  t" suffix...# Tr
97d0: 79 20 76 61 72 69 6f 75 73 20 70 6f 73 73 69 62  y various possib
97e0: 69 6c 69 74 69 65 73 20 69 6e 20 74 75 72 6e 2e  ilities in turn.
97f0: 0d 0a 54 43 4c 53 48 09 09 3d 20 24 28 5f 54 43  ..TCLSH..= $(_TC
9800: 4c 44 49 52 29 5c 62 69 6e 5c 74 63 6c 73 68 24  LDIR)\bin\tclsh$
9810: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 53  (TCL_VERSION)$(S
9820: 55 46 58 3a 74 3d 29 2e 65 78 65 0d 0a 21 69 66  UFX:t=).exe..!if
9830: 20 21 65 78 69 73 74 28 22 24 28 54 43 4c 53 48   !exist("$(TCLSH
9840: 29 22 29 0d 0a 54 43 4c 53 48 20 20 20 20 20 20  )")..TCLSH      
9850: 20 20 20 20 20 3d 20 24 28 5f 54 43 4c 44 49 52       = $(_TCLDIR
9860: 29 5c 62 69 6e 5c 74 63 6c 73 68 24 28 54 43 4c  )\bin\tclsh$(TCL
9870: 5f 56 45 52 53 49 4f 4e 29 74 24 28 53 55 46 58  _VERSION)t$(SUFX
9880: 3a 74 3d 29 2e 65 78 65 0d 0a 21 65 6e 64 69 66  :t=).exe..!endif
9890: 0d 0a 0d 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41  ....!if $(TCL_MA
98a0: 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20  JOR_VERSION) == 
98b0: 38 0d 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d 20  8..TCLSTUBLIB.= 
98c0: 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74  $(_TCLDIR)\lib\t
98d0: 63 6c 73 74 75 62 24 28 54 43 4c 5f 56 45 52 53  clstub$(TCL_VERS
98e0: 49 4f 4e 29 2e 6c 69 62 0d 0a 21 65 6c 73 65 0d  ION).lib..!else.
98f0: 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d 20 24 28  .TCLSTUBLIB.= $(
9900: 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c  _TCLDIR)\lib\tcl
9910: 73 74 75 62 2e 6c 69 62 0d 0a 21 65 6e 64 69 66  stub.lib..!endif
9920: 0d 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20 24 28  ..TCLIMPLIB.= $(
9930: 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c  _TCLDIR)\lib\tcl
9940: 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28  $(TCL_VERSION)$(
9950: 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0d 0a 23 20  SUFX:t=).lib..# 
9960: 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 65 78  When building ex
9970: 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 79 20 62 65  tensions, may be
9980: 20 6c 69 6e 6b 69 6e 67 20 61 67 61 69 6e 73 74   linking against
9990: 20 54 63 6c 20 74 68 61 74 20 64 6f 65 73 20 6e   Tcl that does n
99a0: 6f 74 20 61 64 64 0d 0a 23 20 22 74 22 20 73 75  ot add..# "t" su
99b0: 66 66 69 78 20 28 65 2e 67 2e 20 38 2e 36 29 2e  ffix (e.g. 8.6).
99c0: 20 49 66 20 6c 69 62 20 6e 6f 74 20 66 6f 75 6e   If lib not foun
99d0: 64 20 63 68 65 63 6b 20 66 6f 72 20 74 68 61 74  d check for that
99e0: 20 70 6f 73 73 69 62 69 6c 69 74 79 2e 0d 0a 21   possibility...!
99f0: 69 66 20 21 65 78 69 73 74 28 22 24 28 54 43 4c  if !exist("$(TCL
9a00: 49 4d 50 4c 49 42 29 22 29 0d 0a 54 43 4c 49 4d  IMPLIB)")..TCLIM
9a10: 50 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52  PLIB.= $(_TCLDIR
9a20: 29 5c 6c 69 62 5c 74 63 6c 24 28 54 43 4c 5f 56  )\lib\tcl$(TCL_V
9a30: 45 52 53 49 4f 4e 29 74 24 28 53 55 46 58 3a 74  ERSION)t$(SUFX:t
9a40: 3d 29 2e 6c 69 62 0d 0a 21 65 6e 64 69 66 0d 0a  =).lib..!endif..
9a50: 54 43 4c 5f 4c 49 42 52 41 52 59 09 3d 20 24 28  TCL_LIBRARY.= $(
9a60: 5f 54 43 4c 44 49 52 29 5c 6c 69 62 0d 0a 54 43  _TCLDIR)\lib..TC
9a70: 4c 52 45 47 4c 49 42 09 3d 20 24 28 5f 54 43 4c  LREGLIB.= $(_TCL
9a80: 44 49 52 29 5c 6c 69 62 5c 74 63 6c 72 65 67 31  DIR)\lib\tclreg1
9a90: 33 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0d  3$(SUFX:t=).lib.
9aa0: 0a 54 43 4c 44 44 45 4c 49 42 09 3d 20 24 28 5f  .TCLDDELIB.= $(_
9ab0: 54 43 4c 44 49 52 29 5c 6c 69 62 5c 74 63 6c 64  TCLDIR)\lib\tcld
9ac0: 64 65 31 34 24 28 53 55 46 58 3a 74 3d 29 2e 6c  de14$(SUFX:t=).l
9ad0: 69 62 0d 0a 54 43 4c 53 43 52 49 50 54 5a 49 50  ib..TCLSCRIPTZIP
9ae0: 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69  .= $(_TCLDIR)\li
9af0: 62 5c 24 28 54 43 4c 5f 5a 49 50 5f 46 49 4c 45  b\$(TCL_ZIP_FILE
9b00: 29 0d 0a 54 43 4c 54 4f 4f 4c 53 44 49 52 09 3d  )..TCLTOOLSDIR.=
9b10: 20 5c 6d 75 73 74 5c 68 61 76 65 5c 74 63 6c 5c   \must\have\tcl\
9b20: 73 6f 75 72 63 65 73 5c 74 6f 5c 62 75 69 6c 64  sources\to\build
9b30: 5c 74 68 69 73 5c 74 61 72 67 65 74 0d 0a 54 43  \this\target..TC
9b40: 4c 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 3d 20  L_INCLUDES    = 
9b50: 2d 49 22 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e  -I"$(_TCLDIR)\in
9b60: 63 6c 75 64 65 22 0d 0a 0d 0a 21 65 6c 73 65 20  clude"....!else 
9b70: 23 20 42 75 69 6c 64 69 6e 67 20 61 67 61 69 6e  # Building again
9b80: 73 74 20 54 63 6c 20 73 6f 75 72 63 65 73 0d 0a  st Tcl sources..
9b90: 0d 0a 54 43 4c 53 48 09 09 3d 20 24 28 5f 54 43  ..TCLSH..= $(_TC
9ba0: 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c  LDIR)\win\$(BUIL
9bb0: 44 44 49 52 54 4f 50 29 5c 74 63 6c 73 68 24 28  DDIRTOP)\tclsh$(
9bc0: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 53 55  TCL_VERSION)$(SU
9bd0: 46 58 3a 74 3d 29 2e 65 78 65 0d 0a 21 69 66 20  FX:t=).exe..!if 
9be0: 21 65 78 69 73 74 28 24 28 54 43 4c 53 48 29 29  !exist($(TCLSH))
9bf0: 0d 0a 54 43 4c 53 48 09 09 3d 20 24 28 5f 54 43  ..TCLSH..= $(_TC
9c00: 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c  LDIR)\win\$(BUIL
9c10: 44 44 49 52 54 4f 50 29 5c 74 63 6c 73 68 24 28  DDIRTOP)\tclsh$(
9c20: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 74 24 28 53  TCL_VERSION)t$(S
9c30: 55 46 58 3a 74 3d 29 2e 65 78 65 0d 0a 21 65 6e  UFX:t=).exe..!en
9c40: 64 69 66 0d 0a 21 69 66 20 24 28 54 43 4c 5f 4d  dif..!if $(TCL_M
9c50: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d  AJOR_VERSION) ==
9c60: 20 38 0d 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d   8..TCLSTUBLIB.=
9c70: 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c   $(_TCLDIR)\win\
9c80: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74  $(BUILDDIRTOP)\t
9c90: 63 6c 73 74 75 62 24 28 54 43 4c 5f 56 45 52 53  clstub$(TCL_VERS
9ca0: 49 4f 4e 29 2e 6c 69 62 0d 0a 21 65 6c 73 65 0d  ION).lib..!else.
9cb0: 0a 54 43 4c 53 54 55 42 4c 49 42 09 3d 20 24 28  .TCLSTUBLIB.= $(
9cc0: 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42  _TCLDIR)\win\$(B
9cd0: 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 73  UILDDIRTOP)\tcls
9ce0: 74 75 62 2e 6c 69 62 0d 0a 21 65 6e 64 69 66 0d  tub.lib..!endif.
9cf0: 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20 24 28 5f  .TCLIMPLIB.= $(_
9d00: 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  TCLDIR)\win\$(BU
9d10: 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 24 28  ILDDIRTOP)\tcl$(
9d20: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 53 55  TCL_VERSION)$(SU
9d30: 46 58 3a 74 3d 29 2e 6c 69 62 0d 0a 23 20 57 68  FX:t=).lib..# Wh
9d40: 65 6e 20 62 75 69 6c 64 69 6e 67 20 65 78 74 65  en building exte
9d50: 6e 73 69 6f 6e 73 2c 20 6d 61 79 20 62 65 20 6c  nsions, may be l
9d60: 69 6e 6b 69 6e 67 20 61 67 61 69 6e 73 74 20 54  inking against T
9d70: 63 6c 20 74 68 61 74 20 64 6f 65 73 20 6e 6f 74  cl that does not
9d80: 20 61 64 64 0d 0a 23 20 22 74 22 20 73 75 66 66   add..# "t" suff
9d90: 69 78 20 28 65 2e 67 2e 20 38 2e 36 29 2e 20 49  ix (e.g. 8.6). I
9da0: 66 20 6c 69 62 20 6e 6f 74 20 66 6f 75 6e 64 20  f lib not found 
9db0: 63 68 65 63 6b 20 66 6f 72 20 74 68 61 74 20 70  check for that p
9dc0: 6f 73 73 69 62 69 6c 69 74 79 2e 0d 0a 21 69 66  ossibility...!if
9dd0: 20 21 65 78 69 73 74 28 22 24 28 54 43 4c 49 4d   !exist("$(TCLIM
9de0: 50 4c 49 42 29 22 29 0d 0a 54 43 4c 49 4d 50 4c  PLIB)")..TCLIMPL
9df0: 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c  IB.= $(_TCLDIR)\
9e00: 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f  win\$(BUILDDIRTO
9e10: 50 29 5c 74 63 6c 24 28 54 43 4c 5f 56 45 52 53  P)\tcl$(TCL_VERS
9e20: 49 4f 4e 29 74 24 28 53 55 46 58 3a 74 3d 29 2e  ION)t$(SUFX:t=).
9e30: 6c 69 62 0d 0a 21 65 6e 64 69 66 0d 0a 54 43 4c  lib..!endif..TCL
9e40: 5f 4c 49 42 52 41 52 59 09 3d 20 24 28 5f 54 43  _LIBRARY.= $(_TC
9e50: 4c 44 49 52 29 5c 6c 69 62 72 61 72 79 0d 0a 54  LDIR)\library..T
9e60: 43 4c 52 45 47 4c 49 42 09 3d 20 24 28 5f 54 43  CLREGLIB.= $(_TC
9e70: 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c  LDIR)\win\$(BUIL
9e80: 44 44 49 52 54 4f 50 29 5c 74 63 6c 72 65 67 31  DDIRTOP)\tclreg1
9e90: 33 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0d  3$(SUFX:t=).lib.
9ea0: 0a 54 43 4c 44 44 45 4c 49 42 09 3d 20 24 28 5f  .TCLDDELIB.= $(_
9eb0: 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55  TCLDIR)\win\$(BU
9ec0: 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 64 64  ILDDIRTOP)\tcldd
9ed0: 65 31 34 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69  e14$(SUFX:t=).li
9ee0: 62 0d 0a 54 43 4c 53 43 52 49 50 54 5a 49 50 09  b..TCLSCRIPTZIP.
9ef0: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e  = $(_TCLDIR)\win
9f00: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c  \$(BUILDDIRTOP)\
9f10: 24 28 54 43 4c 5f 5a 49 50 5f 46 49 4c 45 29 0d  $(TCL_ZIP_FILE).
9f20: 0a 54 43 4c 54 4f 4f 4c 53 44 49 52 09 3d 20 24  .TCLTOOLSDIR.= $
9f30: 28 5f 54 43 4c 44 49 52 29 5c 74 6f 6f 6c 73 0d  (_TCLDIR)\tools.
9f40: 0a 54 43 4c 5f 49 4e 43 4c 55 44 45 53 09 3d 20  .TCL_INCLUDES.= 
9f50: 2d 49 22 24 28 5f 54 43 4c 44 49 52 29 5c 67 65  -I"$(_TCLDIR)\ge
9f60: 6e 65 72 69 63 22 20 2d 49 22 24 28 5f 54 43 4c  neric" -I"$(_TCL
9f70: 44 49 52 29 5c 77 69 6e 22 0d 0a 0d 0a 21 65 6e  DIR)\win"....!en
9f80: 64 69 66 20 23 20 54 43 4c 49 4e 53 54 41 4c 4c  dif # TCLINSTALL
9f90: 0d 0a 0d 0a 21 69 66 20 21 24 28 53 54 41 54 49  ....!if !$(STATI
9fa0: 43 5f 42 55 49 4c 44 29 20 26 26 20 22 24 28 54  C_BUILD) && "$(T
9fb0: 43 4c 5f 42 55 49 4c 44 5f 46 4f 52 29 22 20 3d  CL_BUILD_FOR)" =
9fc0: 3d 20 22 38 22 0d 0a 74 63 6c 6c 69 62 73 20 3d  = "8"..tcllibs =
9fd0: 20 22 24 28 54 43 4c 53 54 55 42 4c 49 42 29 22   "$(TCLSTUBLIB)"
9fe0: 0d 0a 21 65 6c 73 65 0d 0a 74 63 6c 6c 69 62 73  ..!else..tcllibs
9ff0: 20 3d 20 22 24 28 54 43 4c 53 54 55 42 4c 49 42   = "$(TCLSTUBLIB
a000: 29 22 20 22 24 28 54 43 4c 49 4d 50 4c 49 42 29  )" "$(TCLIMPLIB)
a010: 22 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 65 6e  "..!endif....!en
a020: 64 69 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 43  dif # $(DOING_TC
a030: 4c 29 0d 0a 0d 0a 23 20 57 65 20 6e 65 65 64 20  L)....# We need 
a040: 61 20 74 63 6c 73 68 20 74 68 61 74 20 77 69 6c  a tclsh that wil
a050: 6c 20 72 75 6e 20 6f 6e 20 74 68 65 20 68 6f 73  l run on the hos
a060: 74 20 6d 61 63 68 69 6e 65 20 61 73 20 70 61 72  t machine as par
a070: 74 20 6f 66 20 74 68 65 20 62 75 69 6c 64 2e 0d  t of the build..
a080: 0a 23 20 49 58 38 36 20 72 75 6e 73 20 6f 6e 20  .# IX86 runs on 
a090: 61 6c 6c 20 61 72 63 68 69 74 65 63 74 75 72 65  all architecture
a0a0: 73 2e 0d 0a 21 69 66 6e 64 65 66 20 54 43 4c 53  s...!ifndef TCLS
a0b0: 48 5f 4e 41 54 49 56 45 0d 0a 21 69 66 20 22 24  H_NATIVE..!if "$
a0c0: 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 49  (MACHINE)" == "I
a0d0: 58 38 36 22 20 7c 7c 20 22 24 28 4d 41 43 48 49  X86" || "$(MACHI
a0e0: 4e 45 29 22 20 3d 3d 20 22 24 28 4e 41 54 49 56  NE)" == "$(NATIV
a0f0: 45 5f 41 52 43 48 29 22 0d 0a 54 43 4c 53 48 5f  E_ARCH)"..TCLSH_
a100: 4e 41 54 49 56 45 09 3d 20 24 28 54 43 4c 53 48  NATIVE.= $(TCLSH
a110: 29 0d 0a 21 65 6c 73 65 0d 0a 21 65 72 72 6f 72  )..!else..!error
a120: 20 59 6f 75 20 6d 75 73 74 20 65 78 70 6c 69 63   You must explic
a130: 69 74 6c 79 20 73 65 74 20 54 43 4c 53 48 5f 4e  itly set TCLSH_N
a140: 41 54 49 56 45 20 66 6f 72 20 63 72 6f 73 73 2d  ATIVE for cross-
a150: 63 6f 6d 70 69 6c 61 74 69 6f 6e 0d 0a 21 65 6e  compilation..!en
a160: 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23  dif..!endif....#
a170: 20 44 6f 20 74 68 65 20 73 61 6d 65 20 66 6f 72   Do the same for
a180: 20 54 6b 20 61 6e 64 20 54 6b 20 65 78 74 65 6e   Tk and Tk exten
a190: 73 69 6f 6e 73 20 74 68 61 74 20 72 65 71 75 69  sions that requi
a1a0: 72 65 20 74 68 65 20 54 6b 20 6c 69 62 72 61 72  re the Tk librar
a1b0: 69 65 73 0d 0a 21 69 66 20 24 28 44 4f 49 4e 47  ies..!if $(DOING
a1c0: 5f 54 4b 29 20 7c 7c 20 24 28 4e 45 45 44 5f 54  _TK) || $(NEED_T
a1d0: 4b 29 0d 0a 57 49 53 48 4e 41 4d 45 50 52 45 46  K)..WISHNAMEPREF
a1e0: 49 58 20 3d 20 77 69 73 68 0d 0a 57 49 53 48 4e  IX = wish..WISHN
a1f0: 41 4d 45 20 3d 20 24 28 57 49 53 48 4e 41 4d 45  AME = $(WISHNAME
a200: 50 52 45 46 49 58 29 24 28 54 4b 5f 56 45 52 53  PREFIX)$(TK_VERS
a210: 49 4f 4e 29 24 28 53 55 46 58 29 2e 65 78 65 0d  ION)$(SUFX).exe.
a220: 0a 54 4b 4c 49 42 4e 41 4d 45 38 09 3d 20 74 6b  .TKLIBNAME8.= tk
a230: 24 28 54 4b 5f 56 45 52 53 49 4f 4e 29 24 28 53  $(TK_VERSION)$(S
a240: 55 46 58 29 2e 24 28 45 58 54 29 0d 0a 54 4b 4c  UFX).$(EXT)..TKL
a250: 49 42 4e 41 4d 45 39 09 3d 20 74 63 6c 39 74 6b  IBNAME9.= tcl9tk
a260: 24 28 54 4b 5f 56 45 52 53 49 4f 4e 29 24 28 53  $(TK_VERSION)$(S
a270: 55 46 58 29 2e 24 28 45 58 54 29 0d 0a 21 69 66  UFX).$(EXT)..!if
a280: 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52   $(TCL_MAJOR_VER
a290: 53 49 4f 4e 29 20 3d 3d 20 38 20 7c 7c 20 22 24  SION) == 8 || "$
a2a0: 28 54 43 4c 5f 42 55 49 4c 44 5f 46 4f 52 29 22  (TCL_BUILD_FOR)"
a2b0: 20 3d 3d 20 22 38 22 0d 0a 54 4b 4c 49 42 4e 41   == "8"..TKLIBNA
a2c0: 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53  ME.= tk$(TK_VERS
a2d0: 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58  ION)$(SUFX).$(EX
a2e0: 54 29 0d 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d 45  T)..TKIMPLIBNAME
a2f0: 09 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f  .= tk$(TK_VERSIO
a300: 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 0d 0a 21  N)$(SUFX).lib..!
a310: 65 6c 73 65 0d 0a 54 4b 4c 49 42 4e 41 4d 45 09  else..TKLIBNAME.
a320: 3d 20 74 63 6c 39 74 6b 24 28 54 4b 5f 56 45 52  = tcl9tk$(TK_VER
a330: 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 28 45  SION)$(SUFX).$(E
a340: 58 54 29 0d 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d  XT)..TKIMPLIBNAM
a350: 45 09 3d 20 74 63 6c 39 74 6b 24 28 54 4b 5f 56  E.= tcl9tk$(TK_V
a360: 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c  ERSION)$(SUFX).l
a370: 69 62 0d 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20  ib..!endif..!if 
a380: 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49  $(TK_MAJOR_VERSI
a390: 4f 4e 29 20 3d 3d 20 38 0d 0a 54 4b 53 54 55 42  ON) == 8..TKSTUB
a3a0: 4c 49 42 4e 41 4d 45 09 3d 20 74 6b 73 74 75 62  LIBNAME.= tkstub
a3b0: 24 28 54 4b 5f 56 45 52 53 49 4f 4e 29 2e 6c 69  $(TK_VERSION).li
a3c0: 62 0d 0a 21 65 6c 73 65 0d 0a 54 4b 53 54 55 42  b..!else..TKSTUB
a3d0: 4c 49 42 4e 41 4d 45 09 3d 20 74 6b 73 74 75 62  LIBNAME.= tkstub
a3e0: 2e 6c 69 62 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a  .lib..!endif....
a3f0: 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0d  !if $(DOING_TK).
a400: 0a 57 49 53 48 09 09 3d 20 24 28 4f 55 54 5f 44  .WISH..= $(OUT_D
a410: 49 52 29 5c 24 28 57 49 53 48 4e 41 4d 45 29 0d  IR)\$(WISHNAME).
a420: 0a 54 4b 53 54 55 42 4c 49 42 09 3d 20 24 28 4f  .TKSTUBLIB.= $(O
a430: 55 54 5f 44 49 52 29 5c 24 28 54 4b 53 54 55 42  UT_DIR)\$(TKSTUB
a440: 4c 49 42 4e 41 4d 45 29 0d 0a 54 4b 49 4d 50 4c  LIBNAME)..TKIMPL
a450: 49 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c  IB.= $(OUT_DIR)\
a460: 24 28 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0d  $(TKIMPLIBNAME).
a470: 0a 54 4b 4c 49 42 09 09 3d 20 24 28 4f 55 54 5f  .TKLIB..= $(OUT_
a480: 44 49 52 29 5c 24 28 54 4b 4c 49 42 4e 41 4d 45  DIR)\$(TKLIBNAME
a490: 29 0d 0a 54 4b 5f 49 4e 43 4c 55 44 45 53 20 20  )..TK_INCLUDES  
a4a0: 20 20 20 3d 20 2d 49 22 24 28 57 49 4e 5f 44 49     = -I"$(WIN_DI
a4b0: 52 29 22 20 2d 49 22 24 28 47 45 4e 45 52 49 43  R)" -I"$(GENERIC
a4c0: 44 49 52 29 22 0d 0a 54 4b 53 43 52 49 50 54 5a  DIR)"..TKSCRIPTZ
a4d0: 49 50 20 20 20 20 20 3d 20 24 28 4f 55 54 5f 44  IP     = $(OUT_D
a4e0: 49 52 29 5c 24 28 54 4b 5f 5a 49 50 5f 46 49 4c  IR)\$(TK_ZIP_FIL
a4f0: 45 29 0d 0a 0d 0a 21 65 6c 73 65 20 23 20 65 66  E)....!else # ef
a500: 66 65 63 74 69 76 65 6c 79 20 4e 45 45 44 5f 54  fectively NEED_T
a510: 4b 0d 0a 0d 0a 21 69 66 20 24 28 54 4b 49 4e 53  K....!if $(TKINS
a520: 54 41 4c 4c 29 20 23 20 42 75 69 6c 64 69 6e 67  TALL) # Building
a530: 20 61 67 61 69 6e 73 74 20 69 6e 73 74 61 6c 6c   against install
a540: 65 64 20 54 6b 0d 0a 57 49 53 48 09 09 3d 20 24  ed Tk..WISH..= $
a550: 28 5f 54 4b 44 49 52 29 5c 62 69 6e 5c 24 28 57  (_TKDIR)\bin\$(W
a560: 49 53 48 4e 41 4d 45 29 0d 0a 54 4b 53 54 55 42  ISHNAME)..TKSTUB
a570: 4c 49 42 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c  LIB.= $(_TKDIR)\
a580: 6c 69 62 5c 24 28 54 4b 53 54 55 42 4c 49 42 4e  lib\$(TKSTUBLIBN
a590: 41 4d 45 29 0d 0a 54 4b 49 4d 50 4c 49 42 09 3d  AME)..TKIMPLIB.=
a5a0: 20 24 28 5f 54 4b 44 49 52 29 5c 6c 69 62 5c 24   $(_TKDIR)\lib\$
a5b0: 28 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0d 0a  (TKIMPLIBNAME)..
a5c0: 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20  # When building 
a5d0: 65 78 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 79 20  extensions, may 
a5e0: 62 65 20 6c 69 6e 6b 69 6e 67 20 61 67 61 69 6e  be linking again
a5f0: 73 74 20 54 6b 20 74 68 61 74 20 64 6f 65 73 20  st Tk that does 
a600: 6e 6f 74 20 61 64 64 0d 0a 23 20 22 74 22 20 73  not add..# "t" s
a610: 75 66 66 69 78 20 28 65 2e 67 2e 20 38 2e 36 29  uffix (e.g. 8.6)
a620: 2e 20 49 66 20 6c 69 62 20 6e 6f 74 20 66 6f 75  . If lib not fou
a630: 6e 64 20 63 68 65 63 6b 20 66 6f 72 20 74 68 61  nd check for tha
a640: 74 20 70 6f 73 73 69 62 69 6c 69 74 79 2e 0d 0a  t possibility...
a650: 21 69 66 20 21 65 78 69 73 74 28 22 24 28 54 4b  !if !exist("$(TK
a660: 49 4d 50 4c 49 42 29 22 29 0d 0a 54 4b 49 4d 50  IMPLIB)")..TKIMP
a670: 4c 49 42 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b  LIBNAME.= tk$(TK
a680: 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 3a  _VERSION)$(SUFX:
a690: 74 3d 29 2e 6c 69 62 0d 0a 54 4b 49 4d 50 4c 49  t=).lib..TKIMPLI
a6a0: 42 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c 6c 69  B.= $(_TKDIR)\li
a6b0: 62 5c 24 28 54 4b 49 4d 50 4c 49 42 4e 41 4d 45  b\$(TKIMPLIBNAME
a6c0: 29 0d 0a 21 65 6e 64 69 66 0d 0a 54 4b 5f 49 4e  )..!endif..TK_IN
a6d0: 43 4c 55 44 45 53 20 20 20 20 20 3d 20 2d 49 22  CLUDES     = -I"
a6e0: 24 28 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75 64  $(_TKDIR)\includ
a6f0: 65 22 0d 0a 54 4b 53 43 52 49 50 54 5a 49 50 20  e"..TKSCRIPTZIP 
a700: 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 52 29 5c      = $(_TKDIR)\
a710: 6c 69 62 5c 24 28 54 4b 5f 5a 49 50 5f 46 49 4c  lib\$(TK_ZIP_FIL
a720: 45 29 0d 0a 0d 0a 21 65 6c 73 65 20 23 20 42 75  E)....!else # Bu
a730: 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54  ilding against T
a740: 6b 20 73 6f 75 72 63 65 73 0d 0a 0d 0a 57 49 53  k sources....WIS
a750: 48 09 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77  H..= $(_TKDIR)\w
a760: 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50  in\$(BUILDDIRTOP
a770: 29 5c 24 28 57 49 53 48 4e 41 4d 45 29 0d 0a 54  )\$(WISHNAME)..T
a780: 4b 53 54 55 42 4c 49 42 09 3d 20 24 28 5f 54 4b  KSTUBLIB.= $(_TK
a790: 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44  DIR)\win\$(BUILD
a7a0: 44 49 52 54 4f 50 29 5c 24 28 54 4b 53 54 55 42  DIRTOP)\$(TKSTUB
a7b0: 4c 49 42 4e 41 4d 45 29 0d 0a 54 4b 49 4d 50 4c  LIBNAME)..TKIMPL
a7c0: 49 42 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77  IB.= $(_TKDIR)\w
a7d0: 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50  in\$(BUILDDIRTOP
a7e0: 29 5c 24 28 54 4b 49 4d 50 4c 49 42 4e 41 4d 45  )\$(TKIMPLIBNAME
a7f0: 29 0d 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69  )..# When buildi
a800: 6e 67 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 6d  ng extensions, m
a810: 61 79 20 62 65 20 6c 69 6e 6b 69 6e 67 20 61 67  ay be linking ag
a820: 61 69 6e 73 74 20 54 6b 20 74 68 61 74 20 64 6f  ainst Tk that do
a830: 65 73 20 6e 6f 74 20 61 64 64 0d 0a 23 20 22 74  es not add..# "t
a840: 22 20 73 75 66 66 69 78 20 28 65 2e 67 2e 20 38  " suffix (e.g. 8
a850: 2e 36 29 2e 20 49 66 20 6c 69 62 20 6e 6f 74 20  .6). If lib not 
a860: 66 6f 75 6e 64 20 63 68 65 63 6b 20 66 6f 72 20  found check for 
a870: 74 68 61 74 20 70 6f 73 73 69 62 69 6c 69 74 79  that possibility
a880: 2e 0d 0a 21 69 66 20 21 65 78 69 73 74 28 22 24  ...!if !exist("$
a890: 28 54 4b 49 4d 50 4c 49 42 29 22 29 0d 0a 54 4b  (TKIMPLIB)")..TK
a8a0: 49 4d 50 4c 49 42 4e 41 4d 45 09 3d 20 74 6b 24  IMPLIBNAME.= tk$
a8b0: 28 54 4b 5f 56 45 52 53 49 4f 4e 29 24 28 53 55  (TK_VERSION)$(SU
a8c0: 46 58 3a 74 3d 29 2e 6c 69 62 0d 0a 54 4b 49 4d  FX:t=).lib..TKIM
a8d0: 50 4c 49 42 09 3d 20 24 28 5f 54 4b 44 49 52 29  PLIB.= $(_TKDIR)
a8e0: 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54  \win\$(BUILDDIRT
a8f0: 4f 50 29 5c 24 28 54 4b 49 4d 50 4c 49 42 4e 41  OP)\$(TKIMPLIBNA
a900: 4d 45 29 0d 0a 21 65 6e 64 69 66 0d 0a 54 4b 5f  ME)..!endif..TK_
a910: 49 4e 43 4c 55 44 45 53 20 20 20 20 20 3d 20 2d  INCLUDES     = -
a920: 49 22 24 28 5f 54 4b 44 49 52 29 5c 67 65 6e 65  I"$(_TKDIR)\gene
a930: 72 69 63 22 20 2d 49 22 24 28 5f 54 4b 44 49 52  ric" -I"$(_TKDIR
a940: 29 5c 77 69 6e 22 20 2d 49 22 24 28 5f 54 4b 44  )\win" -I"$(_TKD
a950: 49 52 29 5c 78 6c 69 62 22 0d 0a 54 4b 53 43 52  IR)\xlib"..TKSCR
a960: 49 50 54 5a 49 50 20 20 20 20 20 3d 20 24 28 5f  IPTZIP     = $(_
a970: 54 4b 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49  TKDIR)\win\$(BUI
a980: 4c 44 44 49 52 54 4f 50 29 5c 24 28 54 4b 5f 5a  LDDIRTOP)\$(TK_Z
a990: 49 50 5f 46 49 4c 45 29 0d 0a 0d 0a 21 65 6e 64  IP_FILE)....!end
a9a0: 69 66 20 23 20 54 4b 49 4e 53 54 41 4c 4c 0d 0a  if # TKINSTALL..
a9b0: 0d 0a 74 6b 6c 69 62 73 20 3d 20 22 24 28 54 4b  ..tklibs = "$(TK
a9c0: 53 54 55 42 4c 49 42 29 22 20 22 24 28 54 4b 49  STUBLIB)" "$(TKI
a9d0: 4d 50 4c 49 42 29 22 0d 0a 0d 0a 21 65 6e 64 69  MPLIB)"....!endi
a9e0: 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0d  f # $(DOING_TK).
a9f0: 0a 21 65 6e 64 69 66 20 23 20 24 28 44 4f 49 4e  .!endif # $(DOIN
aa00: 47 5f 54 4b 29 20 7c 7c 20 24 28 4e 45 45 44 5f  G_TK) || $(NEED_
aa10: 54 4b 29 0d 0a 0d 0a 23 20 56 61 72 69 6f 75 73  TK)....# Various
aa20: 20 6f 75 74 70 75 74 20 70 61 74 68 73 0d 0a 50   output paths..P
aa30: 52 4a 49 4d 50 4c 49 42 09 3d 20 24 28 4f 55 54  RJIMPLIB.= $(OUT
aa40: 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29  _DIR)\$(PROJECT)
aa50: 24 28 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58  $(VERSION)$(SUFX
aa60: 29 2e 6c 69 62 0d 0a 23 20 45 76 65 6e 20 77 68  ).lib..# Even wh
aa70: 65 6e 20 62 75 69 6c 64 69 6e 67 20 61 67 61 69  en building agai
aa80: 6e 73 74 20 54 63 6c 20 39 2c 20 50 52 4a 4c 49  nst Tcl 9, PRJLI
aa90: 42 4e 41 4d 45 38 20 6d 75 73 74 20 68 61 76 65  BNAME8 must have
aaa0: 20 22 74 22 0d 0a 50 52 4a 4c 49 42 4e 41 4d 45   "t"..PRJLIBNAME
aab0: 38 09 3d 20 24 28 50 52 4f 4a 45 43 54 29 24 28  8.= $(PROJECT)$(
aac0: 56 45 52 53 49 4f 4e 29 74 24 28 53 55 46 58 3a  VERSION)t$(SUFX:
aad0: 74 3d 29 2e 24 28 45 58 54 29 0d 0a 23 20 45 76  t=).$(EXT)..# Ev
aae0: 65 6e 20 77 68 65 6e 20 62 75 69 6c 64 69 6e 67  en when building
aaf0: 20 61 67 61 69 6e 73 74 20 54 63 6c 20 38 2c 20   against Tcl 8, 
ab00: 50 52 4a 4c 49 42 4e 41 4d 45 39 20 6d 75 73 74  PRJLIBNAME9 must
ab10: 20 6e 6f 74 20 68 61 76 65 20 22 74 22 0d 0a 50   not have "t"..P
ab20: 52 4a 4c 49 42 4e 41 4d 45 39 09 3d 20 74 63 6c  RJLIBNAME9.= tcl
ab30: 39 24 28 50 52 4f 4a 45 43 54 29 24 28 56 45 52  9$(PROJECT)$(VER
ab40: 53 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e  SION)$(SUFX:t=).
ab50: 24 28 45 58 54 29 0d 0a 21 69 66 20 24 28 54 43  $(EXT)..!if $(TC
ab60: 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29  L_MAJOR_VERSION)
ab70: 20 3d 3d 20 38 20 7c 7c 20 22 24 28 54 43 4c 5f   == 8 || "$(TCL_
ab80: 42 55 49 4c 44 5f 46 4f 52 29 22 20 3d 3d 20 22  BUILD_FOR)" == "
ab90: 38 22 0d 0a 50 52 4a 4c 49 42 4e 41 4d 45 09 3d  8"..PRJLIBNAME.=
aba0: 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 38 29 0d   $(PRJLIBNAME8).
abb0: 0a 21 65 6c 73 65 0d 0a 50 52 4a 4c 49 42 4e 41  .!else..PRJLIBNA
abc0: 4d 45 09 3d 20 24 28 50 52 4a 4c 49 42 4e 41 4d  ME.= $(PRJLIBNAM
abd0: 45 39 29 0d 0a 21 65 6e 64 69 66 0d 0a 50 52 4a  E9)..!endif..PRJ
abe0: 4c 49 42 09 09 3d 20 24 28 4f 55 54 5f 44 49 52  LIB..= $(OUT_DIR
abf0: 29 5c 24 28 50 52 4a 4c 49 42 4e 41 4d 45 29 0d  )\$(PRJLIBNAME).
ac00: 0a 0d 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a  ...!if $(TCL_MAJ
ac10: 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38  OR_VERSION) == 8
ac20: 0d 0a 50 52 4a 53 54 55 42 4c 49 42 4e 41 4d 45  ..PRJSTUBLIBNAME
ac30: 09 3d 20 24 28 53 54 55 42 50 52 45 46 49 58 29  .= $(STUBPREFIX)
ac40: 24 28 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0d 0a  $(VERSION).lib..
ac50: 21 65 6c 73 65 0d 0a 50 52 4a 53 54 55 42 4c 49  !else..PRJSTUBLI
ac60: 42 4e 41 4d 45 09 3d 20 24 28 53 54 55 42 50 52  BNAME.= $(STUBPR
ac70: 45 46 49 58 29 2e 6c 69 62 0d 0a 21 65 6e 64 69  EFIX).lib..!endi
ac80: 66 0d 0a 50 52 4a 53 54 55 42 4c 49 42 09 3d 20  f..PRJSTUBLIB.= 
ac90: 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 50 52 4a  $(OUT_DIR)\$(PRJ
aca0: 53 54 55 42 4c 49 42 4e 41 4d 45 29 0d 0a 0d 0a  STUBLIBNAME)....
acb0: 23 20 49 66 20 65 78 74 65 6e 73 69 6f 6e 20 70  # If extension p
acc0: 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 68  arent makefile h
acd0: 61 73 20 6e 6f 74 20 64 65 66 69 6e 65 64 20 61  as not defined a
ace0: 20 72 65 73 6f 75 72 63 65 20 64 65 66 69 6e 69   resource defini
acf0: 74 69 6f 6e 20 66 69 6c 65 2c 0d 0a 23 20 77 65  tion file,..# we
ad00: 20 77 69 6c 6c 20 67 65 6e 65 72 61 74 65 20 6f   will generate o
ad10: 6e 65 20 66 72 6f 6d 20 73 74 61 6e 64 61 72 64  ne from standard
ad20: 20 74 65 6d 70 6c 61 74 65 2e 0d 0a 21 69 66 20   template...!if 
ad30: 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 20 26 26  !$(DOING_TCL) &&
ad40: 20 21 24 28 44 4f 49 4e 47 5f 54 4b 29 20 26 26   !$(DOING_TK) &&
ad50: 20 21 24 28 53 54 41 54 49 43 5f 42 55 49 4c 44   !$(STATIC_BUILD
ad60: 29 0d 0a 21 69 66 64 65 66 20 52 43 46 49 4c 45  )..!ifdef RCFILE
ad70: 0d 0a 52 45 53 46 49 4c 45 20 3d 20 24 28 54 4d  ..RESFILE = $(TM
ad80: 50 5f 44 49 52 29 5c 24 28 52 43 46 49 4c 45 3a  P_DIR)\$(RCFILE:
ad90: 2e 72 63 3d 2e 72 65 73 29 0d 0a 21 65 6c 73 65  .rc=.res)..!else
ada0: 0d 0a 52 45 53 46 49 4c 45 20 3d 20 24 28 54 4d  ..RESFILE = $(TM
adb0: 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 54  P_DIR)\$(PROJECT
adc0: 29 2e 72 65 73 0d 0a 21 65 6e 64 69 66 0d 0a 21  ).res..!endif..!
add0: 65 6e 64 69 66 0d 0a 0d 0a 23 23 23 23 23 23 23  endif....#######
ade0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
adf0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
ae00: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
ae10: 23 23 23 23 23 23 23 23 23 23 23 23 0d 0a 23 20  ############..# 
ae20: 31 31 2e 20 43 6f 6e 73 74 72 75 63 74 20 74 68  11. Construct th
ae30: 65 20 70 61 74 68 73 20 66 6f 72 20 74 68 65 20  e paths for the 
ae40: 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 64 69 72  installation dir
ae50: 65 63 74 6f 72 69 65 73 0d 0a 23 20 54 68 65 20  ectories..# The 
ae60: 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73  following macros
ae70: 20 67 65 74 20 64 65 66 69 6e 65 64 20 69 6e 20   get defined in 
ae80: 74 68 69 73 20 73 65 63 74 69 6f 6e 3a 0d 0a 23  this section:..#
ae90: 20 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52   LIB_INSTALL_DIR
aea0: 20 2d 20 77 68 65 72 65 20 6c 69 62 72 61 72 69   - where librari
aeb0: 65 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 73  es should be ins
aec0: 74 61 6c 6c 65 64 0d 0a 23 20 42 49 4e 5f 49 4e  talled..# BIN_IN
aed0: 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72  STALL_DIR - wher
aee0: 65 20 74 68 65 20 65 78 65 63 75 74 61 62 6c 65  e the executable
aef0: 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 73 74  s should be inst
af00: 61 6c 6c 65 64 0d 0a 23 20 44 4f 43 5f 49 4e 53  alled..# DOC_INS
af10: 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72 65  TALL_DIR - where
af20: 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 73   documentation s
af30: 68 6f 75 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c  hould be install
af40: 65 64 0d 0a 23 20 53 43 52 49 50 54 5f 49 4e 53  ed..# SCRIPT_INS
af50: 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72 65  TALL_DIR - where
af60: 20 73 63 72 69 70 74 73 20 73 68 6f 75 6c 64 20   scripts should 
af70: 62 65 20 69 6e 73 74 61 6c 6c 65 64 0d 0a 23 20  be installed..# 
af80: 49 4e 43 4c 55 44 45 5f 49 4e 53 54 41 4c 4c 5f  INCLUDE_INSTALL_
af90: 44 49 52 20 2d 20 77 68 65 72 65 20 43 20 69 6e  DIR - where C in
afa0: 63 6c 75 64 65 20 66 69 6c 65 73 20 73 68 6f 75  clude files shou
afb0: 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 0d  ld be installed.
afc0: 0a 23 20 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f  .# DEMO_INSTALL_
afd0: 44 49 52 20 2d 20 77 68 65 72 65 20 64 65 6d 6f  DIR - where demo
afe0: 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 73 74  s should be inst
aff0: 61 6c 6c 65 64 0d 0a 23 20 50 52 4a 5f 49 4e 53  alled..# PRJ_INS
b000: 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 72 65  TALL_DIR - where
b010: 20 70 61 63 6b 61 67 65 20 77 69 6c 6c 20 62 65   package will be
b020: 20 69 6e 73 74 61 6c 6c 65 64 20 28 6e 6f 74 20   installed (not 
b030: 73 65 74 20 66 6f 72 20 54 63 6c 20 61 6e 64 20  set for Tcl and 
b040: 54 6b 29 0d 0a 0d 0a 21 69 66 20 24 28 44 4f 49  Tk)....!if $(DOI
b050: 4e 47 5f 54 43 4c 29 20 7c 7c 20 24 28 44 4f 49  NG_TCL) || $(DOI
b060: 4e 47 5f 54 4b 29 0d 0a 4c 49 42 5f 49 4e 53 54  NG_TK)..LIB_INST
b070: 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 5f 49 4e  ALL_DIR..= $(_IN
b080: 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 0d 0a 42  STALLDIR)\lib..B
b090: 49 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09  IN_INSTALL_DIR..
b0a0: 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29  = $(_INSTALLDIR)
b0b0: 5c 62 69 6e 0d 0a 44 4f 43 5f 49 4e 53 54 41 4c  \bin..DOC_INSTAL
b0c0: 4c 5f 44 49 52 09 09 3d 20 24 28 5f 49 4e 53 54  L_DIR..= $(_INST
b0d0: 41 4c 4c 44 49 52 29 5c 64 6f 63 0d 0a 21 69 66  ALLDIR)\doc..!if
b0e0: 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a 53   $(DOING_TCL)..S
b0f0: 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49  CRIPT_INSTALL_DI
b100: 52 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49  R.= $(_INSTALLDI
b110: 52 29 5c 6c 69 62 5c 24 28 50 52 4f 4a 45 43 54  R)\lib\$(PROJECT
b120: 29 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52  )$(TCL_MAJOR_VER
b130: 53 49 4f 4e 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f  SION).$(TCL_MINO
b140: 52 5f 56 45 52 53 49 4f 4e 29 0d 0a 4d 4f 44 55  R_VERSION)..MODU
b150: 4c 45 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d  LE_INSTALL_DIR.=
b160: 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c   $(_INSTALLDIR)\
b170: 6c 69 62 5c 74 63 6c 24 28 54 43 4c 5f 4d 41 4a  lib\tcl$(TCL_MAJ
b180: 4f 52 5f 56 45 52 53 49 4f 4e 29 0d 0a 21 65 6c  OR_VERSION)..!el
b190: 73 65 20 23 20 44 4f 49 4e 47 5f 54 4b 0d 0a 53  se # DOING_TK..S
b1a0: 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49  CRIPT_INSTALL_DI
b1b0: 52 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49  R.= $(_INSTALLDI
b1c0: 52 29 5c 6c 69 62 5c 24 28 50 52 4f 4a 45 43 54  R)\lib\$(PROJECT
b1d0: 29 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53  )$(TK_MAJOR_VERS
b1e0: 49 4f 4e 29 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f  ION).$(TK_MINOR_
b1f0: 56 45 52 53 49 4f 4e 29 0d 0a 21 65 6e 64 69 66  VERSION)..!endif
b200: 0d 0a 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44  ..DEMO_INSTALL_D
b210: 49 52 09 3d 20 24 28 53 43 52 49 50 54 5f 49 4e  IR.= $(SCRIPT_IN
b220: 53 54 41 4c 4c 5f 44 49 52 29 5c 64 65 6d 6f 73  STALL_DIR)\demos
b230: 0d 0a 49 4e 43 4c 55 44 45 5f 49 4e 53 54 41 4c  ..INCLUDE_INSTAL
b240: 4c 5f 44 49 52 09 3d 20 24 28 5f 49 4e 53 54 41  L_DIR.= $(_INSTA
b250: 4c 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 0d 0a  LLDIR)\include..
b260: 0d 0a 21 65 6c 73 65 20 23 20 65 78 74 65 6e 73  ..!else # extens
b270: 69 6f 6e 20 6f 74 68 65 72 20 74 68 61 6e 20 54  ion other than T
b280: 6b 0d 0a 0d 0a 50 52 4a 5f 49 4e 53 54 41 4c 4c  k....PRJ_INSTALL
b290: 5f 44 49 52 20 20 20 20 20 20 20 20 20 3d 20 24  _DIR         = $
b2a0: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 24 28  (_INSTALLDIR)\$(
b2b0: 50 52 4f 4a 45 43 54 29 24 28 44 4f 54 56 45 52  PROJECT)$(DOTVER
b2c0: 53 49 4f 4e 29 0d 0a 21 69 66 20 24 28 4d 55 4c  SION)..!if $(MUL
b2d0: 54 49 50 4c 41 54 46 4f 52 4d 5f 49 4e 53 54 41  TIPLATFORM_INSTA
b2e0: 4c 4c 29 0d 0a 42 49 4e 5f 49 4e 53 54 41 4c 4c  LL)..BIN_INSTALL
b2f0: 5f 44 49 52 09 09 3d 20 24 28 50 52 4a 5f 49 4e  _DIR..= $(PRJ_IN
b300: 53 54 41 4c 4c 5f 44 49 52 29 5c 24 28 50 4c 41  STALL_DIR)\$(PLA
b310: 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 29 0d  TFORM_IDENTIFY).
b320: 0a 21 65 6c 73 65 0d 0a 42 49 4e 5f 49 4e 53 54  .!else..BIN_INST
b330: 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 50 52 4a  ALL_DIR..= $(PRJ
b340: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0d 0a 21  _INSTALL_DIR)..!
b350: 65 6e 64 69 66 0d 0a 21 69 66 20 24 28 53 54 41  endif..!if $(STA
b360: 54 49 43 5f 42 55 49 4c 44 29 0d 0a 23 20 46 6f  TIC_BUILD)..# Fo
b370: 72 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 5f 49  r extensions, _I
b380: 4e 53 54 41 4c 4c 44 49 52 20 69 73 20 6c 6f 63  NSTALLDIR is loc
b390: 61 74 69 6f 6e 20 6f 66 20 54 63 6c 27 73 20 73  ation of Tcl's s
b3a0: 74 61 74 69 63 20 6c 69 62 73 0d 0a 4c 49 42 5f  tatic libs..LIB_
b3b0: 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24  INSTALL_DIR..= $
b3c0: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 0d 0a 21  (_INSTALLDIR)..!
b3d0: 65 6c 73 65 0d 0a 4c 49 42 5f 49 4e 53 54 41 4c  else..LIB_INSTAL
b3e0: 4c 5f 44 49 52 09 09 3d 20 24 28 42 49 4e 5f 49  L_DIR..= $(BIN_I
b3f0: 4e 53 54 41 4c 4c 5f 44 49 52 29 0d 0a 21 65 6e  NSTALL_DIR)..!en
b400: 64 69 66 0d 0a 44 4f 43 5f 49 4e 53 54 41 4c 4c  dif..DOC_INSTALL
b410: 5f 44 49 52 09 09 3d 20 24 28 50 52 4a 5f 49 4e  _DIR..= $(PRJ_IN
b420: 53 54 41 4c 4c 5f 44 49 52 29 0d 0a 53 43 52 49  STALL_DIR)..SCRI
b430: 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d  PT_INSTALL_DIR.=
b440: 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44   $(PRJ_INSTALL_D
b450: 49 52 29 0d 0a 44 45 4d 4f 5f 49 4e 53 54 41 4c  IR)..DEMO_INSTAL
b460: 4c 5f 44 49 52 09 3d 20 24 28 50 52 4a 5f 49 4e  L_DIR.= $(PRJ_IN
b470: 53 54 41 4c 4c 5f 44 49 52 29 5c 64 65 6d 6f 73  STALL_DIR)\demos
b480: 0d 0a 49 4e 43 4c 55 44 45 5f 49 4e 53 54 41 4c  ..INCLUDE_INSTAL
b490: 4c 5f 44 49 52 09 3d 20 24 28 5f 49 4e 53 54 41  L_DIR.= $(_INSTA
b4a0: 4c 4c 44 49 52 29 5c 2e 2e 5c 69 6e 63 6c 75 64  LLDIR)\..\includ
b4b0: 65 0d 0a 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23  e....!endif....#
b4c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
b4d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
b4e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
b4f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
b500: 23 23 0d 0a 23 20 31 32 2e 20 53 65 74 20 75 70  ##..# 12. Set up
b510: 20 61 63 74 75 61 6c 20 6f 70 74 69 6f 6e 73 20   actual options 
b520: 74 6f 20 62 65 20 70 61 73 73 65 64 20 74 6f 20  to be passed to 
b530: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64  the compiler and
b540: 20 6c 69 6e 6b 65 72 0d 0a 23 20 4e 6f 77 20 77   linker..# Now w
b550: 65 20 68 61 76 65 20 61 6c 6c 20 74 68 65 20 69  e have all the i
b560: 6e 66 6f 72 6d 61 74 69 6f 6e 20 77 65 20 6e 65  nformation we ne
b570: 65 64 2c 20 73 65 74 20 75 70 20 74 68 65 20 61  ed, set up the a
b580: 63 74 75 61 6c 20 66 6c 61 67 73 20 61 6e 64 0d  ctual flags and.
b590: 0a 23 20 6f 70 74 69 6f 6e 73 20 74 68 61 74 20  .# options that 
b5a0: 77 65 20 77 69 6c 6c 20 70 61 73 73 20 74 6f 20  we will pass to 
b5b0: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64  the compiler and
b5c0: 20 6c 69 6e 6b 65 72 2e 20 54 68 65 20 6d 61 69   linker. The mai
b5d0: 6e 0d 0a 23 20 6d 61 6b 65 66 69 6c 65 20 73 68  n..# makefile sh
b5e0: 6f 75 6c 64 20 75 73 65 20 74 68 65 73 65 20 69  ould use these i
b5f0: 6e 20 63 6f 6d 62 69 6e 61 74 69 6f 6e 20 77 69  n combination wi
b600: 74 68 20 77 68 61 74 65 76 65 72 20 6f 74 68 65  th whatever othe
b610: 72 20 66 6c 61 67 73 0d 0a 23 20 61 6e 64 20 73  r flags..# and s
b620: 77 69 74 63 68 65 73 20 61 72 65 20 73 70 65 63  witches are spec
b630: 69 66 69 63 20 74 6f 20 69 74 2e 0d 0a 23 20 54  ific to it...# T
b640: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63  he following mac
b650: 72 6f 73 20 61 72 65 20 64 65 66 69 6e 65 64 2c  ros are defined,
b660: 20 6e 61 6d 65 73 20 61 72 65 20 66 6f 72 20 68   names are for h
b670: 69 73 74 6f 72 69 63 61 6c 20 63 6f 6d 70 61 74  istorical compat
b680: 69 62 69 6c 69 74 79 3a 0d 0a 23 20 4f 50 54 44  ibility:..# OPTD
b690: 45 46 49 4e 45 53 20 2d 20 2f 44 78 78 78 20 43  EFINES - /Dxxx C
b6a0: 20 6d 61 63 72 6f 20 66 6c 61 67 73 20 62 61 73   macro flags bas
b6b0: 65 64 20 6f 6e 20 75 73 65 72 2d 73 70 65 63 69  ed on user-speci
b6c0: 66 69 65 64 20 4f 50 54 53 0d 0a 23 20 43 4f 4d  fied OPTS..# COM
b6d0: 50 49 4c 45 52 46 4c 41 47 53 20 2d 20 2f 44 78  PILERFLAGS - /Dx
b6e0: 78 78 20 43 20 6d 61 63 72 6f 20 66 6c 61 67 73  xx C macro flags
b6f0: 20 69 6e 64 65 70 65 6e 64 65 6e 74 20 6f 66 20   independent of 
b700: 61 6e 79 20 63 6f 6e 66 69 67 75 72 61 74 69 6f  any configuratio
b710: 6e 20 6f 70 74 69 6f 6e 73 0d 0a 23 20 63 72 74  n options..# crt
b720: 20 2d 20 43 6f 6d 70 69 6c 65 72 20 73 77 69 74   - Compiler swit
b730: 63 68 20 74 68 61 74 20 73 65 6c 65 63 74 73 20  ch that selects 
b740: 74 68 65 20 61 70 70 72 6f 70 72 69 61 74 65 20  the appropriate 
b750: 43 20 72 75 6e 74 69 6d 65 0d 0a 23 20 63 64 65  C runtime..# cde
b760: 62 75 67 20 2d 20 43 6f 6d 70 69 6c 65 72 20 73  bug - Compiler s
b770: 77 69 74 63 68 65 73 20 72 65 6c 61 74 65 64 20  witches related 
b780: 74 6f 20 64 65 62 75 67 20 41 4e 44 20 6f 70 74  to debug AND opt
b790: 69 6d 69 7a 61 74 69 6f 6e 73 0d 0a 23 20 63 77  imizations..# cw
b7a0: 61 72 6e 20 2d 20 43 6f 6d 70 69 6c 65 72 20 73  arn - Compiler s
b7b0: 77 69 74 63 68 65 73 20 74 68 61 74 20 73 65 74  witches that set
b7c0: 20 77 61 72 6e 69 6e 67 20 6c 65 76 65 6c 73 0d   warning levels.
b7d0: 0a 23 20 63 66 6c 61 67 73 20 2d 20 63 6f 6d 70  .# cflags - comp
b7e0: 6c 65 74 65 20 63 6f 6d 70 69 6c 65 72 20 73 77  lete compiler sw
b7f0: 69 74 63 68 65 73 20 28 73 75 62 73 75 6d 65 73  itches (subsumes
b800: 20 63 64 65 62 75 67 20 61 6e 64 20 63 77 61 72   cdebug and cwar
b810: 6e 29 0d 0a 23 20 6c 64 65 62 75 67 20 2d 20 4c  n)..# ldebug - L
b820: 69 6e 6b 65 72 20 73 77 69 74 63 68 65 73 20 63  inker switches c
b830: 6f 6e 74 72 6f 6c 6c 69 6e 67 20 64 65 62 75 67  ontrolling debug
b840: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 6e 64   information and
b850: 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 0d 0a 23   optimization..#
b860: 20 6c 66 6c 61 67 73 20 2d 20 63 6f 6d 70 6c 65   lflags - comple
b870: 74 65 20 6c 69 6e 6b 65 72 20 73 77 69 74 63 68  te linker switch
b880: 65 73 20 28 73 75 62 73 75 6d 65 73 20 6c 64 65  es (subsumes lde
b890: 62 75 67 29 20 65 78 63 65 70 74 20 73 75 62 73  bug) except subs
b8a0: 79 73 74 65 6d 20 74 79 70 65 0d 0a 23 20 64 6c  ystem type..# dl
b8b0: 6c 6c 66 6c 61 67 73 20 2d 20 63 6f 6d 70 6c 65  llflags - comple
b8c0: 74 65 20 6c 69 6e 6b 65 72 20 73 77 69 74 63 68  te linker switch
b8d0: 65 73 20 74 6f 20 62 75 69 6c 64 20 44 4c 4c 73  es to build DLLs
b8e0: 20 28 73 75 62 73 75 6d 65 73 20 6c 66 6c 61 67   (subsumes lflag
b8f0: 73 29 0d 0a 23 20 63 6f 6e 6c 66 6c 61 67 73 20  s)..# conlflags 
b900: 2d 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e 6b 65  - complete linke
b910: 72 20 73 77 69 74 63 68 65 73 20 66 6f 72 20 63  r switches for c
b920: 6f 6e 73 6f 6c 65 20 70 72 6f 67 72 61 6d 20 28  onsole program (
b930: 73 75 62 73 75 6d 65 73 20 6c 66 6c 61 67 73 29  subsumes lflags)
b940: 0d 0a 23 20 67 75 69 6c 66 6c 61 67 73 20 2d 20  ..# guilflags - 
b950: 63 6f 6d 70 6c 65 74 65 20 6c 69 6e 6b 65 72 20  complete linker 
b960: 73 77 69 74 63 68 65 73 20 66 6f 72 20 47 55 49  switches for GUI
b970: 20 70 72 6f 67 72 61 6d 20 28 73 75 62 73 75 6d   program (subsum
b980: 65 73 20 6c 66 6c 61 67 73 29 0d 0a 23 20 62 61  es lflags)..# ba
b990: 73 65 6c 69 62 73 20 2d 20 6d 69 6e 69 6d 75 6d  selibs - minimum
b9a0: 20 57 69 6e 64 6f 77 73 20 6c 69 62 72 61 72 69   Windows librari
b9b0: 65 73 20 72 65 71 75 69 72 65 64 2e 20 50 61 72  es required. Par
b9c0: 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 63 61 6e  ent makefile can
b9d0: 0d 0a 23 20 20 20 20 64 65 66 69 6e 65 20 50 52  ..#    define PR
b9e0: 4a 5f 4c 49 42 53 20 62 65 66 6f 72 65 20 69 6e  J_LIBS before in
b9f0: 63 6c 75 64 69 6e 67 20 72 75 6c 65 73 2e 72 63  cluding rules.rc
ba00: 20 69 66 20 61 64 64 69 74 69 6f 6e 61 6c 20 6c   if additional l
ba10: 69 62 73 20 61 72 65 20 6e 65 65 64 65 64 0d 0a  ibs are needed..
ba20: 0d 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 2f  ..OPTDEFINES.= /
ba30: 44 53 54 44 43 5f 48 45 41 44 45 52 53 20 2f 44  DSTDC_HEADERS /D
ba40: 55 53 45 5f 4e 4d 41 4b 45 3d 31 0d 0a 21 69 66  USE_NMAKE=1..!if
ba50: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3e 20   $(VCVERSION) > 
ba60: 31 36 30 30 0d 0a 4f 50 54 44 45 46 49 4e 45 53  1600..OPTDEFINES
ba70: 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29  .= $(OPTDEFINES)
ba80: 20 2f 44 48 41 56 45 5f 53 54 44 49 4e 54 5f 48   /DHAVE_STDINT_H
ba90: 3d 31 0d 0a 21 65 6c 73 65 0d 0a 4f 50 54 44 45  =1..!else..OPTDE
baa0: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46  FINES.= $(OPTDEF
bab0: 49 4e 45 53 29 20 2f 44 4d 50 5f 4e 4f 5f 53 54  INES) /DMP_NO_ST
bac0: 44 49 4e 54 3d 31 0d 0a 21 65 6e 64 69 66 0d 0a  DINT=1..!endif..
bad0: 21 69 66 20 24 28 56 43 56 45 52 53 49 4f 4e 29  !if $(VCVERSION)
bae0: 20 3e 3d 20 31 38 30 30 0d 0a 4f 50 54 44 45 46   >= 1800..OPTDEF
baf0: 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49  INES.= $(OPTDEFI
bb00: 4e 45 53 29 20 2f 44 48 41 56 45 5f 49 4e 54 54  NES) /DHAVE_INTT
bb10: 59 50 45 53 5f 48 3d 31 20 2f 44 48 41 56 45 5f  YPES_H=1 /DHAVE_
bb20: 53 54 44 42 4f 4f 4c 5f 48 3d 31 0d 0a 21 65 6e  STDBOOL_H=1..!en
bb30: 64 69 66 0d 0a 0d 0a 21 69 66 20 24 28 54 43 4c  dif....!if $(TCL
bb40: 5f 4d 45 4d 5f 44 45 42 55 47 29 0d 0a 4f 50 54  _MEM_DEBUG)..OPT
bb50: 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44  DEFINES.= $(OPTD
bb60: 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 4d 45  EFINES) /DTCL_ME
bb70: 4d 5f 44 45 42 55 47 0d 0a 21 65 6e 64 69 66 0d  M_DEBUG..!endif.
bb80: 0a 21 69 66 20 24 28 54 43 4c 5f 43 4f 4d 50 49  .!if $(TCL_COMPI
bb90: 4c 45 5f 44 45 42 55 47 29 0d 0a 4f 50 54 44 45  LE_DEBUG)..OPTDE
bba0: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46  FINES.= $(OPTDEF
bbb0: 49 4e 45 53 29 20 2f 44 54 43 4c 5f 43 4f 4d 50  INES) /DTCL_COMP
bbc0: 49 4c 45 5f 44 45 42 55 47 20 2f 44 54 43 4c 5f  ILE_DEBUG /DTCL_
bbd0: 43 4f 4d 50 49 4c 45 5f 53 54 41 54 53 0d 0a 21  COMPILE_STATS..!
bbe0: 65 6e 64 69 66 0d 0a 21 69 66 20 24 28 54 43 4c  endif..!if $(TCL
bbf0: 5f 54 48 52 45 41 44 53 29 20 26 26 20 24 28 54  _THREADS) && $(T
bc00: 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3c 20 38 37  CL_VERSION) < 87
bc10: 0d 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24  ..OPTDEFINES.= $
bc20: 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54  (OPTDEFINES) /DT
bc30: 43 4c 5f 54 48 52 45 41 44 53 3d 31 0d 0a 21 69  CL_THREADS=1..!i
bc40: 66 20 24 28 55 53 45 5f 54 48 52 45 41 44 5f 41  f $(USE_THREAD_A
bc50: 4c 4c 4f 43 29 20 26 26 20 24 28 54 43 4c 5f 56  LLOC) && $(TCL_V
bc60: 45 52 53 49 4f 4e 29 20 3c 20 38 37 0d 0a 4f 50  ERSION) < 87..OP
bc70: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54  TDEFINES.= $(OPT
bc80: 44 45 46 49 4e 45 53 29 20 2f 44 55 53 45 5f 54  DEFINES) /DUSE_T
bc90: 48 52 45 41 44 5f 41 4c 4c 4f 43 3d 31 0d 0a 21  HREAD_ALLOC=1..!
bca0: 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d 0a 21  endif..!endif..!
bcb0: 69 66 20 24 28 53 54 41 54 49 43 5f 42 55 49 4c  if $(STATIC_BUIL
bcc0: 44 29 0d 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d  D)..OPTDEFINES.=
bcd0: 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f   $(OPTDEFINES) /
bce0: 44 53 54 41 54 49 43 5f 42 55 49 4c 44 0d 0a 21  DSTATIC_BUILD..!
bcf0: 65 6c 73 65 69 66 20 24 28 54 43 4c 5f 56 45 52  elseif $(TCL_VER
bd00: 53 49 4f 4e 29 20 3e 20 38 36 0d 0a 4f 50 54 44  SION) > 86..OPTD
bd10: 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45  EFINES.= $(OPTDE
bd20: 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 57 49 54  FINES) /DTCL_WIT
bd30: 48 5f 45 58 54 45 52 4e 41 4c 5f 54 4f 4d 4d 41  H_EXTERNAL_TOMMA
bd40: 54 48 0d 0a 21 69 66 20 22 24 28 4d 41 43 48 49  TH..!if "$(MACHI
bd50: 4e 45 29 22 20 3d 3d 20 22 41 4d 44 36 34 22 20  NE)" == "AMD64" 
bd60: 7c 7c 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20  || "$(MACHINE)" 
bd70: 3d 3d 20 22 41 52 4d 36 34 22 0d 0a 4f 50 54 44  == "ARM64"..OPTD
bd80: 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45  EFINES.= $(OPTDE
bd90: 46 49 4e 45 53 29 20 2f 44 4d 50 5f 36 34 42 49  FINES) /DMP_64BI
bda0: 54 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69  T..!endif..!endi
bdb0: 66 0d 0a 21 69 66 20 24 28 54 43 4c 5f 4e 4f 5f  f..!if $(TCL_NO_
bdc0: 44 45 50 52 45 43 41 54 45 44 29 0d 0a 4f 50 54  DEPRECATED)..OPT
bdd0: 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44  DEFINES.= $(OPTD
bde0: 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 4e 4f  EFINES) /DTCL_NO
bdf0: 5f 44 45 50 52 45 43 41 54 45 44 0d 0a 21 65 6e  _DEPRECATED..!en
be00: 64 69 66 0d 0a 0d 0a 21 69 66 20 24 28 55 53 45  dif....!if $(USE
be10: 5f 53 54 55 42 53 29 0d 0a 23 20 4e 6f 74 65 20  _STUBS)..# Note 
be20: 77 65 20 64 6f 20 6e 6f 74 20 64 65 66 69 6e 65  we do not define
be30: 20 55 53 45 5f 54 43 4c 5f 53 54 55 42 53 20 65   USE_TCL_STUBS e
be40: 76 65 6e 20 77 68 65 6e 20 62 75 69 6c 64 69 6e  ven when buildin
be50: 67 20 74 6b 20 73 69 6e 63 65 20 73 6f 6d 65 0d  g tk since some.
be60: 0a 23 20 74 65 73 74 20 74 61 72 67 65 74 73 20  .# test targets 
be70: 69 6e 20 74 6b 20 64 6f 20 6e 6f 74 20 75 73 65  in tk do not use
be80: 20 73 74 75 62 73 0d 0a 21 69 66 20 21 24 28 44   stubs..!if !$(D
be90: 4f 49 4e 47 5f 54 43 4c 29 0d 0a 55 53 45 5f 53  OING_TCL)..USE_S
bea0: 54 55 42 53 5f 44 45 46 53 20 20 3d 20 2f 44 55  TUBS_DEFS  = /DU
beb0: 53 45 5f 54 43 4c 5f 53 54 55 42 53 20 2f 44 55  SE_TCL_STUBS /DU
bec0: 53 45 5f 54 43 4c 4f 4f 5f 53 54 55 42 53 0d 0a  SE_TCLOO_STUBS..
bed0: 21 69 66 20 24 28 4e 45 45 44 5f 54 4b 29 0d 0a  !if $(NEED_TK)..
bee0: 55 53 45 5f 53 54 55 42 53 5f 44 45 46 53 20 20  USE_STUBS_DEFS  
bef0: 3d 20 24 28 55 53 45 5f 53 54 55 42 53 5f 44 45  = $(USE_STUBS_DE
bf00: 46 53 29 20 2f 44 55 53 45 5f 54 4b 5f 53 54 55  FS) /DUSE_TK_STU
bf10: 42 53 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64  BS..!endif..!end
bf20: 69 66 0d 0a 21 65 6e 64 69 66 20 23 20 55 53 45  if..!endif # USE
bf30: 5f 53 54 55 42 53 0d 0a 0d 0a 21 69 66 20 21 24  _STUBS....!if !$
bf40: 28 44 45 42 55 47 29 0d 0a 4f 50 54 44 45 46 49  (DEBUG)..OPTDEFI
bf50: 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e  NES.= $(OPTDEFIN
bf60: 45 53 29 20 2f 44 4e 44 45 42 55 47 0d 0a 21 69  ES) /DNDEBUG..!i
bf70: 66 20 24 28 4f 50 54 49 4d 49 5a 49 4e 47 29 0d  f $(OPTIMIZING).
bf80: 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28  .OPTDEFINES.= $(
bf90: 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43  OPTDEFINES) /DTC
bfa0: 4c 5f 43 46 47 5f 4f 50 54 49 4d 49 5a 45 44 0d  L_CFG_OPTIMIZED.
bfb0: 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66 0d  .!endif..!endif.
bfc0: 0a 21 69 66 20 24 28 50 52 4f 46 49 4c 45 29 0d  .!if $(PROFILE).
bfd0: 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28  .OPTDEFINES.= $(
bfe0: 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43  OPTDEFINES) /DTC
bff0: 4c 5f 43 46 47 5f 50 52 4f 46 49 4c 45 44 0d 0a  L_CFG_PROFILED..
c000: 21 65 6e 64 69 66 0d 0a 21 69 66 20 22 24 28 4d  !endif..!if "$(M
c010: 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 4d 44  ACHINE)" == "AMD
c020: 36 34 22 20 7c 7c 20 22 24 28 4d 41 43 48 49 4e  64" || "$(MACHIN
c030: 45 29 22 20 3d 3d 20 22 41 52 4d 36 34 22 0d 0a  E)" == "ARM64"..
c040: 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f  OPTDEFINES.= $(O
c050: 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c  PTDEFINES) /DTCL
c060: 5f 43 46 47 5f 44 4f 36 34 42 49 54 0d 0a 21 65  _CFG_DO64BIT..!e
c070: 6e 64 69 66 0d 0a 21 69 66 20 24 28 56 43 56 45  ndif..!if $(VCVE
c080: 52 53 49 4f 4e 29 20 3c 20 31 33 30 30 0d 0a 4f  RSION) < 1300..O
c090: 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50  PTDEFINES.= $(OP
c0a0: 54 44 45 46 49 4e 45 53 29 20 2f 44 4e 4f 5f 53  TDEFINES) /DNO_S
c0b0: 54 52 54 4f 49 36 34 3d 31 0d 0a 21 65 6e 64 69  TRTOI64=1..!endi
c0c0: 66 0d 0a 0d 0a 21 69 66 20 24 28 54 43 4c 5f 4d  f....!if $(TCL_M
c0d0: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d  AJOR_VERSION) ==
c0e0: 20 38 0d 0a 21 69 66 20 22 24 28 5f 55 53 45 5f   8..!if "$(_USE_
c0f0: 36 34 42 49 54 5f 54 49 4d 45 5f 54 29 22 20 3d  64BIT_TIME_T)" =
c100: 3d 20 22 31 22 0d 0a 4f 50 54 44 45 46 49 4e 45  = "1"..OPTDEFINE
c110: 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53  S.= $(OPTDEFINES
c120: 29 20 2f 44 5f 55 53 45 5f 36 34 42 49 54 5f 54  ) /D_USE_64BIT_T
c130: 49 4d 45 5f 54 3d 31 0d 0a 21 65 6e 64 69 66 0d  IME_T=1..!endif.
c140: 0a 21 65 6e 64 69 66 0d 0a 21 69 66 20 22 24 28  .!endif..!if "$(
c150: 54 43 4c 5f 42 55 49 4c 44 5f 46 4f 52 29 22 20  TCL_BUILD_FOR)" 
c160: 3d 3d 20 22 38 22 0d 0a 4f 50 54 44 45 46 49 4e  == "8"..OPTDEFIN
c170: 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45  ES.= $(OPTDEFINE
c180: 53 29 20 2f 44 54 43 4c 5f 4d 41 4a 4f 52 5f 56  S) /DTCL_MAJOR_V
c190: 45 52 53 49 4f 4e 3d 38 20 2f 44 54 4b 5f 4d 41  ERSION=8 /DTK_MA
c1a0: 4a 4f 52 5f 56 45 52 53 49 4f 4e 3d 38 0d 0a 21  JOR_VERSION=8..!
c1b0: 65 6e 64 69 66 0d 0a 0d 0a 23 20 4c 69 6b 65 20  endif....# Like 
c1c0: 74 68 65 20 54 45 41 20 73 79 73 74 65 6d 20 6f  the TEA system o
c1d0: 6e 6c 79 20 73 65 74 20 74 68 69 73 20 6e 6f 6e  nly set this non
c1e0: 20 65 6d 70 74 79 20 66 6f 72 20 6e 6f 6e 2d 54   empty for non-T
c1f0: 6b 20 65 78 74 65 6e 73 69 6f 6e 73 0d 0a 23 20  k extensions..# 
c200: 4e 6f 74 65 3a 20 73 6f 6d 65 20 65 78 74 65 6e  Note: some exten
c210: 73 69 6f 6e 73 20 75 73 65 20 50 41 43 4b 41 47  sions use PACKAG
c220: 45 5f 4e 41 4d 45 20 61 6e 64 20 6f 74 68 65 72  E_NAME and other
c230: 73 20 75 73 65 20 50 41 43 4b 41 47 45 5f 54 43  s use PACKAGE_TC
c240: 4c 4e 41 4d 45 0d 0a 23 20 73 6f 20 77 65 20 70  LNAME..# so we p
c250: 61 73 73 20 62 6f 74 68 0d 0a 21 69 66 20 21 24  ass both..!if !$
c260: 28 44 4f 49 4e 47 5f 54 43 4c 29 20 26 26 20 21  (DOING_TCL) && !
c270: 24 28 44 4f 49 4e 47 5f 54 4b 29 0d 0a 50 4b 47  $(DOING_TK)..PKG
c280: 4e 41 4d 45 46 4c 41 47 53 20 3d 20 2f 44 50 41  NAMEFLAGS = /DPA
c290: 43 4b 41 47 45 5f 4e 41 4d 45 3d 22 5c 22 24 28  CKAGE_NAME="\"$(
c2a0: 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e  PRJ_PACKAGE_TCLN
c2b0: 41 4d 45 29 5c 22 22 20 5c 0d 0a 09 2f 44 50 41  AME)\"" \.../DPA
c2c0: 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 3d 22 5c  CKAGE_TCLNAME="\
c2d0: 22 24 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54  "$(PRJ_PACKAGE_T
c2e0: 43 4c 4e 41 4d 45 29 5c 22 22 20 5c 0d 0a 09 2f  CLNAME)\"" \.../
c2f0: 44 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e  DPACKAGE_VERSION
c300: 3d 22 5c 22 24 28 44 4f 54 56 45 52 53 49 4f 4e  ="\"$(DOTVERSION
c310: 29 5c 22 22 20 5c 0d 0a 09 2f 44 4d 4f 44 55 4c  )\"" \.../DMODUL
c320: 45 5f 53 43 4f 50 45 3d 65 78 74 65 72 6e 0d 0a  E_SCOPE=extern..
c330: 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 63 72 74 20  !endif....# crt 
c340: 70 69 63 6b 73 20 74 68 65 20 43 20 72 75 6e 20  picks the C run 
c350: 74 69 6d 65 20 62 61 73 65 64 20 6f 6e 20 73 65  time based on se
c360: 6c 65 63 74 65 64 20 4f 50 54 53 0d 0a 21 69 66  lected OPTS..!if
c370: 20 24 28 4d 53 56 43 52 54 29 0d 0a 21 69 66 20   $(MSVCRT)..!if 
c380: 24 28 44 45 42 55 47 29 20 26 26 20 21 24 28 55  $(DEBUG) && !$(U
c390: 4e 43 48 45 43 4b 45 44 29 0d 0a 63 72 74 20 3d  NCHECKED)..crt =
c3a0: 20 2d 4d 44 64 0d 0a 21 65 6c 73 65 0d 0a 63 72   -MDd..!else..cr
c3b0: 74 20 3d 20 2d 4d 44 0d 0a 21 65 6e 64 69 66 0d  t = -MD..!endif.
c3c0: 0a 21 65 6c 73 65 0d 0a 21 69 66 20 24 28 44 45  .!else..!if $(DE
c3d0: 42 55 47 29 20 26 26 20 21 24 28 55 4e 43 48 45  BUG) && !$(UNCHE
c3e0: 43 4b 45 44 29 0d 0a 63 72 74 20 3d 20 2d 4d 54  CKED)..crt = -MT
c3f0: 64 0d 0a 21 65 6c 73 65 0d 0a 63 72 74 20 3d 20  d..!else..crt = 
c400: 2d 4d 54 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e  -MT..!endif..!en
c410: 64 69 66 0d 0a 0d 0a 23 20 63 64 65 62 75 67 20  dif....# cdebug 
c420: 69 6e 63 6c 75 64 65 73 20 63 6f 6d 70 69 6c 65  includes compile
c430: 72 20 6f 70 74 69 6f 6e 73 20 66 6f 72 20 64 65  r options for de
c440: 62 75 67 67 69 6e 67 20 61 73 20 77 65 6c 6c 20  bugging as well 
c450: 61 73 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 2e  as optimization.
c460: 0d 0a 21 69 66 20 24 28 44 45 42 55 47 29 0d 0a  ..!if $(DEBUG)..
c470: 0d 0a 23 20 49 6e 20 64 65 62 75 67 67 69 6e 67  ..# In debugging
c480: 20 6d 6f 64 65 2c 20 6f 70 74 69 6d 69 7a 61 74   mode, optimizat
c490: 69 6f 6e 73 20 6e 65 65 64 20 74 6f 20 62 65 20  ions need to be 
c4a0: 64 69 73 61 62 6c 65 64 0d 0a 63 64 65 62 75 67  disabled..cdebug
c4b0: 20 3d 20 2d 5a 69 20 2d 4f 64 20 24 28 44 45 42   = -Zi -Od $(DEB
c4c0: 55 47 46 4c 41 47 53 29 0d 0a 0d 0a 21 65 6c 73  UGFLAGS)....!els
c4d0: 65 0d 0a 0d 0a 63 64 65 62 75 67 20 3d 20 24 28  e....cdebug = $(
c4e0: 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 29 0d 0a  OPTIMIZATIONS)..
c4f0: 21 69 66 20 24 28 53 59 4d 42 4f 4c 53 29 0d 0a  !if $(SYMBOLS)..
c500: 63 64 65 62 75 67 20 3d 20 24 28 63 64 65 62 75  cdebug = $(cdebu
c510: 67 29 20 2d 5a 69 0d 0a 21 65 6e 64 69 66 0d 0a  g) -Zi..!endif..
c520: 0d 0a 21 65 6e 64 69 66 20 23 20 24 28 44 45 42  ..!endif # $(DEB
c530: 55 47 29 0d 0a 0d 0a 23 20 63 77 61 72 6e 20 69  UG)....# cwarn i
c540: 6e 63 6c 75 64 65 73 20 64 65 66 61 75 6c 74 20  ncludes default 
c550: 77 61 72 6e 69 6e 67 20 6c 65 76 65 6c 73 2c 20  warning levels, 
c560: 61 6c 73 6f 20 43 34 30 39 30 20 28 62 75 67 67  also C4090 (bugg
c570: 79 29 20 61 6e 64 20 43 34 31 34 36 20 69 73 20  y) and C4146 is 
c580: 75 73 65 6c 65 73 73 2e 0d 0a 63 77 61 72 6e 20  useless...cwarn 
c590: 3d 20 24 28 57 41 52 4e 49 4e 47 53 29 20 2d 77  = $(WARNINGS) -w
c5a0: 64 34 30 39 30 20 2d 77 64 34 31 34 36 0d 0a 0d  d4090 -wd4146...
c5b0: 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29  .!if "$(MACHINE)
c5c0: 22 20 3d 3d 20 22 41 4d 44 36 34 22 20 7c 7c 20  " == "AMD64" || 
c5d0: 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20  "$(MACHINE)" == 
c5e0: 22 41 52 4d 36 34 22 0d 0a 23 20 44 69 73 61 62  "ARM64"..# Disab
c5f0: 6c 65 20 70 6f 69 6e 74 65 72 3c 2d 3e 69 6e 74  le pointer<->int
c600: 20 77 61 72 6e 69 6e 67 73 20 72 65 6c 61 74 65   warnings relate
c610: 64 20 74 6f 20 63 61 73 74 20 62 65 74 77 65 65  d to cast betwee
c620: 6e 20 64 69 66 66 65 72 65 6e 74 20 73 69 7a 65  n different size
c630: 73 0d 0a 23 20 54 68 65 72 65 20 61 72 65 20 61  s..# There are a
c640: 20 67 61 64 7a 69 6c 6c 69 6f 6e 20 6f 66 20 74   gadzillion of t
c650: 68 65 73 65 20 64 75 65 20 74 6f 20 75 73 65 20  hese due to use 
c660: 6f 66 20 43 6c 69 65 6e 74 44 61 74 61 20 61 6e  of ClientData an
c670: 64 0d 0a 23 20 63 6c 75 74 74 65 72 20 75 70 20  d..# clutter up 
c680: 63 6f 6d 70 69 6c 65 72 0d 0a 23 20 6f 75 74 70  compiler..# outp
c690: 75 74 20 69 6e 63 72 65 61 73 69 6e 67 20 63 68  ut increasing ch
c6a0: 61 6e 63 65 20 6f 66 20 61 20 72 65 61 6c 20 77  ance of a real w
c6b0: 61 72 6e 69 6e 67 20 67 65 74 74 69 6e 67 20 6c  arning getting l
c6c0: 6f 73 74 2e 20 53 6f 20 64 69 73 61 62 6c 65 20  ost. So disable 
c6d0: 74 68 65 6d 2e 0d 0a 23 20 45 76 65 6e 74 75 61  them...# Eventua
c6e0: 6c 6c 79 20 73 6f 6d 65 20 64 61 79 2c 20 54 63  lly some day, Tc
c6f0: 6c 20 77 69 6c 6c 20 62 65 20 36 34 2d 62 69 74  l will be 64-bit
c700: 20 63 6c 65 61 6e 2e 0d 0a 63 77 61 72 6e 20 3d   clean...cwarn =
c710: 20 24 28 63 77 61 72 6e 29 20 2d 77 64 34 33 31   $(cwarn) -wd431
c720: 31 20 2d 77 64 34 33 31 32 0d 0a 21 65 6e 64 69  1 -wd4312..!endi
c730: 66 0d 0a 0d 0a 23 23 23 20 43 6f 6d 6d 6f 6e 20  f....### Common 
c740: 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e 73  compiler options
c750: 20 74 68 61 74 20 61 72 65 20 61 72 63 68 69 74   that are archit
c760: 65 63 74 75 72 65 20 73 70 65 63 69 66 69 63 0d  ecture specific.
c770: 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29  .!if "$(MACHINE)
c780: 22 20 3d 3d 20 22 41 52 4d 22 0d 0a 63 61 72 63  " == "ARM"..carc
c790: 68 20 3d 20 2f 44 5f 41 52 4d 5f 57 49 4e 41 50  h = /D_ARM_WINAP
c7a0: 49 5f 50 41 52 54 49 54 49 4f 4e 5f 44 45 53 4b  I_PARTITION_DESK
c7b0: 54 4f 50 5f 53 44 4b 5f 41 56 41 49 4c 41 42 4c  TOP_SDK_AVAILABL
c7c0: 45 0d 0a 21 65 6c 73 65 0d 0a 63 61 72 63 68 20  E..!else..carch 
c7d0: 3d 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 63  =..!endif....# c
c7e0: 70 75 69 64 20 69 73 20 6f 6e 6c 79 20 61 76 61  puid is only ava
c7f0: 69 6c 61 62 6c 65 20 6f 6e 20 69 6e 74 65 6c 20  ilable on intel 
c800: 6d 61 63 68 69 6e 65 73 0d 0a 21 69 66 20 22 24  machines..!if "$
c810: 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 49  (MACHINE)" == "I
c820: 58 38 36 22 20 7c 7c 20 22 24 28 4d 41 43 48 49  X86" || "$(MACHI
c830: 4e 45 29 22 20 3d 3d 20 22 41 4d 44 36 34 22 0d  NE)" == "AMD64".
c840: 0a 63 61 72 63 68 20 3d 20 24 28 63 61 72 63 68  .carch = $(carch
c850: 29 20 2f 44 48 41 56 45 5f 43 50 55 49 44 3d 31  ) /DHAVE_CPUID=1
c860: 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21 69 66 20  ..!endif....!if 
c870: 24 28 44 45 42 55 47 29 0d 0a 23 20 54 75 72 6e  $(DEBUG)..# Turn
c880: 20 77 61 72 6e 69 6e 67 73 20 69 6e 74 6f 20 65   warnings into e
c890: 72 72 6f 72 73 0d 0a 63 77 61 72 6e 20 3d 20 24  rrors..cwarn = $
c8a0: 28 63 77 61 72 6e 29 20 2d 57 58 0d 0a 21 65 6e  (cwarn) -WX..!en
c8b0: 64 69 66 0d 0a 0d 0a 49 4e 43 4c 55 44 45 53 20  dif....INCLUDES 
c8c0: 3d 20 24 28 54 43 4c 5f 49 4e 43 4c 55 44 45 53  = $(TCL_INCLUDES
c8d0: 29 20 24 28 54 4b 5f 49 4e 43 4c 55 44 45 53 29  ) $(TK_INCLUDES)
c8e0: 20 24 28 50 52 4a 5f 49 4e 43 4c 55 44 45 53 29   $(PRJ_INCLUDES)
c8f0: 0d 0a 21 69 66 20 21 24 28 44 4f 49 4e 47 5f 54  ..!if !$(DOING_T
c900: 43 4c 29 20 26 26 20 21 24 28 44 4f 49 4e 47 5f  CL) && !$(DOING_
c910: 54 4b 29 0d 0a 49 4e 43 4c 55 44 45 53 20 3d 20  TK)..INCLUDES = 
c920: 24 28 49 4e 43 4c 55 44 45 53 29 20 2d 49 22 24  $(INCLUDES) -I"$
c930: 28 47 45 4e 45 52 49 43 44 49 52 29 22 20 2d 49  (GENERICDIR)" -I
c940: 22 24 28 57 49 4e 5f 44 49 52 29 22 20 2d 49 22  "$(WIN_DIR)" -I"
c950: 24 28 43 4f 4d 50 41 54 44 49 52 29 22 0d 0a 21  $(COMPATDIR)"..!
c960: 65 6e 64 69 66 0d 0a 0d 0a 23 20 54 68 65 73 65  endif....# These
c970: 20 66 6c 61 67 73 20 61 72 65 20 64 65 66 69 6e   flags are defin
c980: 65 64 20 72 6f 75 67 68 6c 79 20 69 6e 20 74 68  ed roughly in th
c990: 65 20 6f 72 64 65 72 20 6f 66 20 74 68 65 20 70  e order of the p
c9a0: 72 65 2d 72 65 66 6f 72 6d 0d 0a 23 20 72 75 6c  re-reform..# rul
c9b0: 65 73 2e 76 63 2f 6d 61 6b 65 66 69 6c 65 2e 76  es.vc/makefile.v
c9c0: 63 20 74 6f 20 68 65 6c 70 20 76 69 73 75 61 6c  c to help visual
c9d0: 6c 79 20 63 6f 6d 70 61 72 65 20 74 68 61 74 20  ly compare that 
c9e0: 74 68 65 20 70 72 65 2d 20 61 6e 64 0d 0a 23 20  the pre- and..# 
c9f0: 70 6f 73 74 2d 72 65 66 6f 72 6d 20 62 75 69 6c  post-reform buil
ca00: 64 20 6c 6f 67 73 0d 0a 0d 0a 23 20 63 66 6c 61  d logs....# cfla
ca10: 67 73 20 63 6f 6e 74 61 69 6e 73 20 67 65 6e 65  gs contains gene
ca20: 72 69 63 20 66 6c 61 67 73 20 75 73 65 64 20 66  ric flags used f
ca30: 6f 72 20 62 75 69 6c 64 69 6e 67 20 70 72 61 63  or building prac
ca40: 74 69 63 61 6c 6c 79 20 61 6c 6c 20 6f 62 6a 65  tically all obje
ca50: 63 74 20 66 69 6c 65 73 0d 0a 63 66 6c 61 67 73  ct files..cflags
ca60: 20 3d 20 2d 6e 6f 6c 6f 67 6f 20 2d 63 20 24 28   = -nologo -c $(
ca70: 43 4f 4d 50 49 4c 45 52 46 4c 41 47 53 29 20 24  COMPILERFLAGS) $
ca80: 28 63 61 72 63 68 29 20 24 28 63 77 61 72 6e 29  (carch) $(cwarn)
ca90: 20 2d 46 70 24 28 54 4d 50 5f 44 49 52 29 5e 5c   -Fp$(TMP_DIR)^\
caa0: 20 24 28 63 64 65 62 75 67 29 0d 0a 0d 0a 21 69   $(cdebug)....!i
cab0: 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45  f $(TCL_MAJOR_VE
cac0: 52 53 49 4f 4e 29 20 3d 3d 20 38 20 26 26 20 24  RSION) == 8 && $
cad0: 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49  (TCL_MINOR_VERSI
cae0: 4f 4e 29 20 3c 20 37 0d 0a 63 66 6c 61 67 73 20  ON) < 7..cflags 
caf0: 3d 20 24 28 63 66 6c 61 67 73 29 20 2d 44 54 63  = $(cflags) -DTc
cb00: 6c 5f 53 69 7a 65 3d 69 6e 74 0d 0a 21 65 6e 64  l_Size=int..!end
cb10: 69 66 0d 0a 0d 0a 23 20 61 70 70 63 66 6c 61 67  if....# appcflag
cb20: 73 20 63 6f 6e 74 61 69 6e 73 20 24 28 63 66 6c  s contains $(cfl
cb30: 61 67 73 29 20 61 6e 64 20 66 6c 61 67 73 20 66  ags) and flags f
cb40: 6f 72 20 62 75 69 6c 64 69 6e 67 20 74 68 65 20  or building the 
cb50: 61 70 70 6c 69 63 61 74 69 6f 6e 0d 0a 23 20 6f  application..# o
cb60: 62 6a 65 63 74 20 66 69 6c 65 73 20 28 65 2e 67  bject files (e.g
cb70: 2e 20 74 63 6c 73 68 2c 20 6f 72 20 77 69 73 68  . tclsh, or wish
cb80: 29 20 70 6b 67 63 66 6c 61 67 73 20 63 6f 6e 74  ) pkgcflags cont
cb90: 61 69 6e 73 20 24 28 63 66 6c 61 67 73 29 20 70  ains $(cflags) p
cba0: 6c 75 73 0d 0a 23 20 66 6c 61 67 73 20 75 73 65  lus..# flags use
cbb0: 64 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 73  d for building s
cbc0: 68 61 72 65 64 20 6f 62 6a 65 63 74 20 66 69 6c  hared object fil
cbd0: 65 73 20 54 68 65 20 74 77 6f 20 64 69 66 66 65  es The two diffe
cbe0: 72 20 69 6e 20 74 68 65 0d 0a 23 20 42 55 49 4c  r in the..# BUIL
cbf0: 44 5f 24 28 50 52 4f 4a 45 43 54 29 20 6d 61 63  D_$(PROJECT) mac
cc00: 72 6f 20 77 68 69 63 68 20 73 68 6f 75 6c 64 20  ro which should 
cc10: 62 65 20 64 65 66 69 6e 65 64 20 6f 6e 6c 79 20  be defined only 
cc20: 66 6f 72 20 74 68 65 20 73 68 61 72 65 64 0d 0a  for the shared..
cc30: 23 20 6c 69 62 72 61 72 79 20 2a 69 6d 70 6c 65  # library *imple
cc40: 6d 65 6e 74 61 74 69 6f 6e 2a 20 61 6e 64 20 6e  mentation* and n
cc50: 6f 74 20 66 6f 72 20 69 74 73 20 63 61 6c 6c 65  ot for its calle
cc60: 72 20 69 6e 74 65 72 66 61 63 65 0d 0a 0d 0a 61  r interface....a
cc70: 70 70 63 66 6c 61 67 73 5f 6e 6f 73 74 75 62 73  ppcflags_nostubs
cc80: 20 3d 20 24 28 63 66 6c 61 67 73 29 20 24 28 63   = $(cflags) $(c
cc90: 72 74 29 20 24 28 49 4e 43 4c 55 44 45 53 29 20  rt) $(INCLUDES) 
cca0: 24 28 54 43 4c 5f 44 45 46 49 4e 45 53 29 20 24  $(TCL_DEFINES) $
ccb0: 28 50 52 4a 5f 44 45 46 49 4e 45 53 29 20 24 28  (PRJ_DEFINES) $(
ccc0: 4f 50 54 44 45 46 49 4e 45 53 29 0d 0a 61 70 70  OPTDEFINES)..app
ccd0: 63 66 6c 61 67 73 20 3d 20 24 28 61 70 70 63 66  cflags = $(appcf
cce0: 6c 61 67 73 5f 6e 6f 73 74 75 62 73 29 20 24 28  lags_nostubs) $(
ccf0: 55 53 45 5f 53 54 55 42 53 5f 44 45 46 53 29 0d  USE_STUBS_DEFS).
cd00: 0a 70 6b 67 63 66 6c 61 67 73 20 3d 20 24 28 61  .pkgcflags = $(a
cd10: 70 70 63 66 6c 61 67 73 29 20 24 28 50 4b 47 4e  ppcflags) $(PKGN
cd20: 41 4d 45 46 4c 41 47 53 29 20 2f 44 42 55 49 4c  AMEFLAGS) /DBUIL
cd30: 44 5f 24 28 50 52 4f 4a 45 43 54 29 0d 0a 70 6b  D_$(PROJECT)..pk
cd40: 67 63 66 6c 61 67 73 5f 6e 6f 73 74 75 62 73 20  gcflags_nostubs 
cd50: 3d 20 24 28 61 70 70 63 66 6c 61 67 73 5f 6e 6f  = $(appcflags_no
cd60: 73 74 75 62 73 29 20 24 28 50 4b 47 4e 41 4d 45  stubs) $(PKGNAME
cd70: 46 4c 41 47 53 29 20 2f 44 42 55 49 4c 44 5f 24  FLAGS) /DBUILD_$
cd80: 28 50 52 4f 4a 45 43 54 29 0d 0a 0d 0a 23 20 73  (PROJECT)....# s
cd90: 74 75 62 73 63 66 6c 61 67 73 20 63 6f 6e 74 61  tubscflags conta
cda0: 69 6e 73 20 24 28 63 66 6c 61 67 73 29 20 70 6c  ins $(cflags) pl
cdb0: 75 73 20 66 6c 61 67 73 20 75 73 65 64 20 66 6f  us flags used fo
cdc0: 72 20 62 75 69 6c 64 69 6e 67 20 61 20 73 74 75  r building a stu
cdd0: 62 73 0d 0a 23 20 6c 69 62 72 61 72 79 20 66 6f  bs..# library fo
cde0: 72 20 74 68 65 20 70 61 63 6b 61 67 65 2e 20 20  r the package.  
cdf0: 4e 6f 74 65 3a 20 2f 44 53 54 41 54 49 43 5f 42  Note: /DSTATIC_B
ce00: 55 49 4c 44 20 69 73 20 64 65 66 69 6e 65 64 20  UILD is defined 
ce10: 69 6e 0d 0a 23 20 24 28 4f 50 54 44 45 46 49 4e  in..# $(OPTDEFIN
ce20: 45 53 29 20 6f 6e 6c 79 20 69 66 20 74 68 65 20  ES) only if the 
ce30: 4f 50 54 53 20 63 6f 6e 66 69 67 75 72 61 74 69  OPTS configurati
ce40: 6f 6e 20 69 6e 64 69 63 61 74 65 73 20 61 20 73  on indicates a s
ce50: 74 61 74 69 63 0d 0a 23 20 6c 69 62 72 61 72 79  tatic..# library
ce60: 2e 20 48 6f 77 65 76 65 72 20 74 68 65 20 73 74  . However the st
ce70: 75 62 73 20 6c 69 62 72 61 72 79 20 69 73 20 41  ubs library is A
ce80: 4c 57 41 59 53 20 73 74 61 74 69 63 20 68 65 6e  LWAYS static hen
ce90: 63 65 20 69 6e 63 6c 75 64 65 64 0d 0a 23 20 68  ce included..# h
cea0: 65 72 65 20 69 72 72 65 73 70 65 63 74 69 76 65  ere irrespective
ceb0: 20 6f 66 20 74 68 65 20 4f 50 54 53 20 73 65 74   of the OPTS set
cec0: 74 69 6e 67 2e 0d 0a 23 0d 0a 23 20 54 42 44 20  ting...#..# TBD 
ced0: 2d 20 74 63 6c 76 66 73 20 68 61 73 20 61 20 63  - tclvfs has a c
cee0: 6f 6d 6d 65 6e 74 20 74 68 61 74 20 73 74 75 62  omment that stub
cef0: 73 20 6c 69 62 73 20 73 68 6f 75 6c 64 20 6e 6f  s libs should no
cf00: 74 20 62 65 20 63 6f 6d 70 69 6c 65 64 20 77 69  t be compiled wi
cf10: 74 68 20 2d 47 4c 0d 0a 23 20 77 69 74 68 6f 75  th -GL..# withou
cf20: 74 20 73 74 61 74 69 6e 67 20 77 68 79 2e 20 54  t stating why. T
cf30: 63 6c 20 69 74 73 65 6c 66 20 63 6f 6d 70 69 6c  cl itself compil
cf40: 65 64 20 73 74 75 62 73 20 6c 69 62 73 20 77 69  ed stubs libs wi
cf50: 74 68 20 74 68 69 73 20 66 6c 61 67 2e 0d 0a 23  th this flag...#
cf60: 20 73 6f 20 77 65 20 64 6f 20 6e 6f 74 20 72 65   so we do not re
cf70: 6d 6f 76 65 20 69 74 20 66 72 6f 6d 20 63 66 6c  move it from cfl
cf80: 61 67 73 2e 20 2d 47 4c 20 6d 61 79 20 70 72 65  ags. -GL may pre
cf90: 76 65 6e 74 20 65 78 74 65 6e 73 69 6f 6e 73 0d  vent extensions.
cfa0: 0a 23 20 63 6f 6d 70 69 6c 65 64 20 77 69 74 68  .# compiled with
cfb0: 20 6f 6e 65 20 56 43 20 76 65 72 73 69 6f 6e 20   one VC version 
cfc0: 74 6f 20 66 61 69 6c 20 74 6f 20 6c 69 6e 6b 20  to fail to link 
cfd0: 61 67 61 69 6e 73 74 20 73 74 75 62 73 20 6c 69  against stubs li
cfe0: 62 72 61 72 79 0d 0a 23 20 63 6f 6d 70 69 6c 65  brary..# compile
cff0: 64 20 77 69 74 68 20 61 6e 6f 74 68 65 72 20 56  d with another V
d000: 43 20 76 65 72 73 69 6f 6e 2e 20 43 68 65 63 6b  C version. Check
d010: 20 66 6f 72 20 74 68 69 73 20 61 6e 64 20 66 69   for this and fi
d020: 78 20 61 63 63 6f 72 64 69 6e 67 6c 79 2e 0d 0a  x accordingly...
d030: 73 74 75 62 73 63 66 6c 61 67 73 20 3d 20 24 28  stubscflags = $(
d040: 63 66 6c 61 67 73 29 20 24 28 50 4b 47 4e 41 4d  cflags) $(PKGNAM
d050: 45 46 4c 41 47 53 29 20 24 28 50 52 4a 5f 44 45  EFLAGS) $(PRJ_DE
d060: 46 49 4e 45 53 29 20 24 28 4f 50 54 44 45 46 49  FINES) $(OPTDEFI
d070: 4e 45 53 29 20 2f 5a 6c 20 2f 47 4c 2d 20 2f 44  NES) /Zl /GL- /D
d080: 53 54 41 54 49 43 5f 42 55 49 4c 44 20 24 28 49  STATIC_BUILD $(I
d090: 4e 43 4c 55 44 45 53 29 20 24 28 55 53 45 5f 53  NCLUDES) $(USE_S
d0a0: 54 55 42 53 5f 44 45 46 53 29 0d 0a 0d 0a 23 20  TUBS_DEFS)....# 
d0b0: 4c 69 6e 6b 20 66 6c 61 67 73 0d 0a 0d 0a 21 69  Link flags....!i
d0c0: 66 20 24 28 44 45 42 55 47 29 0d 0a 6c 64 65 62  f $(DEBUG)..ldeb
d0d0: 75 67 09 3d 20 2d 64 65 62 75 67 20 2d 64 65 62  ug.= -debug -deb
d0e0: 75 67 74 79 70 65 3a 63 76 0d 0a 21 65 6c 73 65  ugtype:cv..!else
d0f0: 0d 0a 6c 64 65 62 75 67 09 3d 20 2d 72 65 6c 65  ..ldebug.= -rele
d100: 61 73 65 20 2d 6f 70 74 3a 72 65 66 20 2d 6f 70  ase -opt:ref -op
d110: 74 3a 69 63 66 2c 33 0d 0a 21 69 66 20 24 28 53  t:icf,3..!if $(S
d120: 59 4d 42 4f 4c 53 29 0d 0a 6c 64 65 62 75 67 09  YMBOLS)..ldebug.
d130: 3d 20 24 28 6c 64 65 62 75 67 29 20 2d 64 65 62  = $(ldebug) -deb
d140: 75 67 20 2d 64 65 62 75 67 74 79 70 65 3a 63 76  ug -debugtype:cv
d150: 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66  ..!endif..!endif
d160: 0d 0a 0d 0a 23 20 4e 6f 74 65 3a 20 50 72 6f 66  ....# Note: Prof
d170: 69 6c 69 6e 67 20 69 73 20 63 75 72 72 65 6e 74  iling is current
d180: 6c 79 20 6f 6e 6c 79 20 70 6f 73 73 69 62 6c 65  ly only possible
d190: 20 77 69 74 68 20 74 68 65 20 56 69 73 75 61 6c   with the Visual
d1a0: 20 53 74 75 64 69 6f 20 45 6e 74 65 72 70 72 69   Studio Enterpri
d1b0: 73 65 0d 0a 21 69 66 20 24 28 50 52 4f 46 49 4c  se..!if $(PROFIL
d1c0: 45 29 0d 0a 6c 64 65 62 75 67 3d 20 24 28 6c 64  E)..ldebug= $(ld
d1d0: 65 62 75 67 29 20 2d 70 72 6f 66 69 6c 65 0d 0a  ebug) -profile..
d1e0: 21 65 6e 64 69 66 0d 0a 0d 0a 23 23 23 20 44 65  !endif....### De
d1f0: 63 6c 61 72 61 74 69 6f 6e 73 20 63 6f 6d 6d 6f  clarations commo
d200: 6e 20 74 6f 20 61 6c 6c 20 6c 69 6e 6b 65 72 20  n to all linker 
d210: 76 65 72 73 69 6f 6e 73 0d 0a 6c 66 6c 61 67 73  versions..lflags
d220: 09 3d 20 2d 6e 6f 6c 6f 67 6f 20 2d 6d 61 63 68  .= -nologo -mach
d230: 69 6e 65 3a 24 28 4d 41 43 48 49 4e 45 29 20 24  ine:$(MACHINE) $
d240: 28 4c 49 4e 4b 45 52 46 4c 41 47 53 29 20 24 28  (LINKERFLAGS) $(
d250: 6c 64 65 62 75 67 29 0d 0a 0d 0a 21 69 66 20 24  ldebug)....!if $
d260: 28 4d 53 56 43 52 54 29 20 26 26 20 21 28 24 28  (MSVCRT) && !($(
d270: 44 45 42 55 47 29 20 26 26 20 21 24 28 55 4e 43  DEBUG) && !$(UNC
d280: 48 45 43 4b 45 44 29 29 20 26 26 20 24 28 56 43  HECKED)) && $(VC
d290: 56 45 52 53 49 4f 4e 29 20 3e 3d 20 31 39 30 30  VERSION) >= 1900
d2a0: 0d 0a 6c 66 6c 61 67 73 09 3d 20 24 28 6c 66 6c  ..lflags.= $(lfl
d2b0: 61 67 73 29 20 2d 6e 6f 64 65 66 61 75 6c 74 6c  ags) -nodefaultl
d2c0: 69 62 3a 75 63 72 74 2e 6c 69 62 0d 0a 21 65 6e  ib:ucrt.lib..!en
d2d0: 64 69 66 0d 0a 0d 0a 64 6c 6c 6c 66 6c 61 67 73  dif....dlllflags
d2e0: 20 3d 20 24 28 6c 66 6c 61 67 73 29 20 2d 64 6c   = $(lflags) -dl
d2f0: 6c 0d 0a 63 6f 6e 6c 66 6c 61 67 73 20 3d 20 24  l..conlflags = $
d300: 28 6c 66 6c 61 67 73 29 20 2d 73 75 62 73 79 73  (lflags) -subsys
d310: 74 65 6d 3a 63 6f 6e 73 6f 6c 65 0d 0a 67 75 69  tem:console..gui
d320: 6c 66 6c 61 67 73 20 3d 20 24 28 6c 66 6c 61 67  lflags = $(lflag
d330: 73 29 20 2d 73 75 62 73 79 73 74 65 6d 3a 77 69  s) -subsystem:wi
d340: 6e 64 6f 77 73 0d 0a 0d 0a 23 20 4c 69 62 72 61  ndows....# Libra
d350: 72 69 65 73 20 74 68 61 74 20 61 72 65 20 72 65  ries that are re
d360: 71 75 69 72 65 64 20 66 6f 72 20 65 76 65 72 79  quired for every
d370: 20 69 6d 61 67 65 2e 0d 0a 23 20 45 78 74 65 6e   image...# Exten
d380: 73 69 6f 6e 73 20 73 68 6f 75 6c 64 20 64 65 66  sions should def
d390: 69 6e 65 20 61 6e 79 20 61 64 64 69 74 69 6f 6e  ine any addition
d3a0: 61 6c 20 6c 69 62 72 61 72 69 65 73 20 77 69 74  al libraries wit
d3b0: 68 20 24 28 50 52 4a 5f 4c 49 42 53 29 0d 0a 77  h $(PRJ_LIBS)..w
d3c0: 69 6e 6c 69 62 73 20 20 20 3d 20 6b 65 72 6e 65  inlibs   = kerne
d3d0: 6c 33 32 2e 6c 69 62 20 61 64 76 61 70 69 33 32  l32.lib advapi32
d3e0: 2e 6c 69 62 0d 0a 0d 0a 21 69 66 20 24 28 4e 45  .lib....!if $(NE
d3f0: 45 44 5f 54 4b 29 0d 0a 77 69 6e 6c 69 62 73 20  ED_TK)..winlibs 
d400: 3d 20 24 28 77 69 6e 6c 69 62 73 29 20 67 64 69  = $(winlibs) gdi
d410: 33 32 2e 6c 69 62 20 75 73 65 72 33 32 2e 6c 69  32.lib user32.li
d420: 62 20 75 78 74 68 65 6d 65 2e 6c 69 62 0d 0a 21  b uxtheme.lib..!
d430: 65 6e 64 69 66 0d 0a 0d 0a 23 20 41 76 6f 69 64  endif....# Avoid
d440: 20 27 75 6e 72 65 73 6f 6c 76 65 64 20 65 78 74   'unresolved ext
d450: 65 72 6e 61 6c 20 73 79 6d 62 6f 6c 20 5f 5f 73  ernal symbol __s
d460: 65 63 75 72 69 74 79 5f 63 6f 6f 6b 69 65 27 20  ecurity_cookie' 
d470: 65 72 72 6f 72 73 2e 0d 0a 23 20 63 2e 66 2e 20  errors...# c.f. 
d480: 68 74 74 70 3a 2f 2f 73 75 70 70 6f 72 74 2e 6d  http://support.m
d490: 69 63 72 6f 73 6f 66 74 2e 63 6f 6d 2f 3f 69 64  icrosoft.com/?id
d4a0: 3d 38 39 34 35 37 33 0d 0a 21 69 66 20 22 24 28  =894573..!if "$(
d4b0: 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 4d  MACHINE)" == "AM
d4c0: 44 36 34 22 0d 0a 21 69 66 20 24 28 56 43 56 45  D64"..!if $(VCVE
d4d0: 52 53 49 4f 4e 29 20 3e 20 31 33 39 39 20 26 26  RSION) > 1399 &&
d4e0: 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3c 20   $(VCVERSION) < 
d4f0: 31 35 30 30 0d 0a 77 69 6e 6c 69 62 73 20 20 20  1500..winlibs   
d500: 3d 20 24 28 77 69 6e 6c 69 62 73 29 20 62 75 66  = $(winlibs) buf
d510: 66 65 72 6f 76 65 72 66 6c 6f 77 55 2e 6c 69 62  feroverflowU.lib
d520: 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64 69 66  ..!endif..!endif
d530: 0d 0a 0d 0a 62 61 73 65 6c 69 62 73 20 3d 20 24  ....baselibs = $
d540: 28 77 69 6e 6c 69 62 73 29 20 24 28 50 52 4a 5f  (winlibs) $(PRJ_
d550: 4c 49 42 53 29 0d 0a 0d 0a 21 69 66 20 24 28 4d  LIBS)....!if $(M
d560: 53 56 43 52 54 29 20 26 26 20 21 28 24 28 44 45  SVCRT) && !($(DE
d570: 42 55 47 29 20 26 26 20 21 24 28 55 4e 43 48 45  BUG) && !$(UNCHE
d580: 43 4b 45 44 29 29 20 26 26 20 24 28 56 43 56 45  CKED)) && $(VCVE
d590: 52 53 49 4f 4e 29 20 3e 3d 20 31 39 30 30 0d 0a  RSION) >= 1900..
d5a0: 62 61 73 65 6c 69 62 73 20 20 20 3d 20 24 28 62  baselibs   = $(b
d5b0: 61 73 65 6c 69 62 73 29 20 75 63 72 74 2e 6c 69  aselibs) ucrt.li
d5c0: 62 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 23 23  b..!endif....###
d5d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
d5e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
d5f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
d600: 23 23 23 23 23 23 23 23 23 23 23 23 23 0d 0a 23  #############..#
d610: 20 31 33 2e 20 44 65 66 69 6e 65 20 73 74 61 6e   13. Define stan
d620: 64 61 72 64 20 63 6f 6d 6d 61 6e 64 73 2c 20 63  dard commands, c
d630: 6f 6d 6d 6f 6e 20 6d 61 6b 65 20 74 61 72 67 65  ommon make targe
d640: 74 73 20 61 6e 64 20 69 6d 70 6c 69 63 69 74 20  ts and implicit 
d650: 72 75 6c 65 73 0d 0a 0d 0a 43 43 50 4b 47 43 4d  rules....CCPKGCM
d660: 44 20 3d 20 24 28 63 63 33 32 29 20 24 28 70 6b  D = $(cc32) $(pk
d670: 67 63 66 6c 61 67 73 29 20 2d 46 6f 24 28 54 4d  gcflags) -Fo$(TM
d680: 50 5f 44 49 52 29 5e 5c 0d 0a 43 43 41 50 50 43  P_DIR)^\..CCAPPC
d690: 4d 44 20 3d 20 24 28 63 63 33 32 29 20 24 28 61  MD = $(cc32) $(a
d6a0: 70 70 63 66 6c 61 67 73 29 20 2d 46 6f 24 28 54  ppcflags) -Fo$(T
d6b0: 4d 50 5f 44 49 52 29 5e 5c 0d 0a 43 43 53 54 55  MP_DIR)^\..CCSTU
d6c0: 42 53 43 4d 44 20 3d 20 24 28 63 63 33 32 29 20  BSCMD = $(cc32) 
d6d0: 24 28 73 74 75 62 73 63 66 6c 61 67 73 29 20 2d  $(stubscflags) -
d6e0: 46 6f 24 28 54 4d 50 5f 44 49 52 29 5e 5c 0d 0a  Fo$(TMP_DIR)^\..
d6f0: 0d 0a 4c 49 42 43 4d 44 20 3d 20 24 28 6c 69 62  ..LIBCMD = $(lib
d700: 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20 24 28 4c 49  32) -nologo $(LI
d710: 4e 4b 45 52 46 4c 41 47 53 29 20 2d 6f 75 74 3a  NKERFLAGS) -out:
d720: 24 40 0d 0a 44 4c 4c 43 4d 44 20 3d 20 24 28 6c  [email protected] = $(l
d730: 69 6e 6b 33 32 29 20 24 28 64 6c 6c 6c 66 6c 61  ink32) $(dlllfla
d740: 67 73 29 20 2d 6f 75 74 3a 24 40 20 24 28 62 61  gs) -out:$@ $(ba
d750: 73 65 6c 69 62 73 29 20 24 28 74 63 6c 6c 69 62  selibs) $(tcllib
d760: 73 29 20 24 28 74 6b 6c 69 62 73 29 0d 0a 0d 0a  s) $(tklibs)....
d770: 43 4f 4e 45 58 45 43 4d 44 20 3d 20 24 28 6c 69  CONEXECMD = $(li
d780: 6e 6b 33 32 29 20 24 28 63 6f 6e 6c 66 6c 61 67  nk32) $(conlflag
d790: 73 29 20 2d 6f 75 74 3a 24 40 20 24 28 62 61 73  s) -out:$@ $(bas
d7a0: 65 6c 69 62 73 29 20 24 28 74 63 6c 6c 69 62 73  elibs) $(tcllibs
d7b0: 29 20 24 28 74 6b 6c 69 62 73 29 0d 0a 47 55 49  ) $(tklibs)..GUI
d7c0: 45 58 45 43 4d 44 20 3d 20 24 28 6c 69 6e 6b 33  EXECMD = $(link3
d7d0: 32 29 20 24 28 67 75 69 6c 66 6c 61 67 73 29 20  2) $(guilflags) 
d7e0: 2d 6f 75 74 3a 24 40 20 24 28 62 61 73 65 6c 69  -out:$@ $(baseli
d7f0: 62 73 29 20 24 28 74 63 6c 6c 69 62 73 29 20 24  bs) $(tcllibs) $
d800: 28 74 6b 6c 69 62 73 29 0d 0a 52 45 53 43 4d 44  (tklibs)..RESCMD
d810: 20 20 3d 20 24 28 72 63 33 32 29 20 2d 66 6f 20    = $(rc32) -fo 
d820: 24 40 20 2d 72 20 2d 69 20 22 24 28 47 45 4e 45  $@ -r -i "$(GENE
d830: 52 49 43 44 49 52 29 22 20 2d 69 20 22 24 28 54  RICDIR)" -i "$(T
d840: 4d 50 5f 44 49 52 29 22 20 5c 0d 0a 09 20 20 20  MP_DIR)" \...   
d850: 20 24 28 54 43 4c 5f 49 4e 43 4c 55 44 45 53 29   $(TCL_INCLUDES)
d860: 20 2f 44 53 54 41 54 49 43 5f 42 55 49 4c 44 3d   /DSTATIC_BUILD=
d870: 24 28 53 54 41 54 49 43 5f 42 55 49 4c 44 29 20  $(STATIC_BUILD) 
d880: 5c 0d 0a 09 20 20 20 20 2f 44 44 45 42 55 47 3d  \...    /DDEBUG=
d890: 24 28 44 45 42 55 47 29 20 2d 64 20 55 4e 43 48  $(DEBUG) -d UNCH
d8a0: 45 43 4b 45 44 3d 24 28 55 4e 43 48 45 43 4b 45  ECKED=$(UNCHECKE
d8b0: 44 29 20 5c 0d 0a 09 20 20 20 20 2f 44 43 4f 4d  D) \...    /DCOM
d8c0: 4d 41 56 45 52 53 49 4f 4e 3d 24 28 52 43 43 4f  MAVERSION=$(RCCO
d8d0: 4d 4d 41 56 45 52 53 49 4f 4e 29 20 5c 0d 0a 09  MMAVERSION) \...
d8e0: 20 20 20 20 2f 44 44 4f 54 56 45 52 53 49 4f 4e      /DDOTVERSION
d8f0: 3d 5c 22 24 28 44 4f 54 56 45 52 53 49 4f 4e 29  =\"$(DOTVERSION)
d900: 5c 22 20 5c 0d 0a 09 20 20 20 20 2f 44 56 45 52  \" \...    /DVER
d910: 53 49 4f 4e 3d 5c 22 24 28 56 45 52 53 49 4f 4e  SION=\"$(VERSION
d920: 29 5c 22 20 5c 0d 0a 09 20 20 20 20 2f 44 53 55  )\" \...    /DSU
d930: 46 58 3d 5c 22 24 28 53 55 46 58 29 5c 22 20 5c  FX=\"$(SUFX)\" \
d940: 0d 0a 09 20 20 20 20 2f 44 50 52 4f 4a 45 43 54  ...    /DPROJECT
d950: 3d 5c 22 24 28 50 52 4f 4a 45 43 54 29 5c 22 20  =\"$(PROJECT)\" 
d960: 5c 0d 0a 09 20 20 20 20 2f 44 50 52 4a 4c 49 42  \...    /DPRJLIB
d970: 4e 41 4d 45 3d 5c 22 24 28 50 52 4a 4c 49 42 4e  NAME=\"$(PRJLIBN
d980: 41 4d 45 29 5c 22 0d 0a 0d 0a 21 69 66 6e 64 65  AME)\"....!ifnde
d990: 66 20 44 45 46 41 55 4c 54 5f 42 55 49 4c 44 5f  f DEFAULT_BUILD_
d9a0: 54 41 52 47 45 54 0d 0a 44 45 46 41 55 4c 54 5f  TARGET..DEFAULT_
d9b0: 42 55 49 4c 44 5f 54 41 52 47 45 54 20 3d 20 24  BUILD_TARGET = $
d9c0: 28 50 52 4f 4a 45 43 54 29 0d 0a 21 65 6e 64 69  (PROJECT)..!endi
d9d0: 66 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 74 61 72  f....default-tar
d9e0: 67 65 74 3a 20 24 28 44 45 46 41 55 4c 54 5f 42  get: $(DEFAULT_B
d9f0: 55 49 4c 44 5f 54 41 52 47 45 54 29 0d 0a 0d 0a  UILD_TARGET)....
da00: 21 69 66 20 24 28 4d 55 4c 54 49 50 4c 41 54 46  !if $(MULTIPLATF
da10: 4f 52 4d 5f 49 4e 53 54 41 4c 4c 29 0d 0a 64 65  ORM_INSTALL)..de
da20: 66 61 75 6c 74 2d 70 6b 67 69 6e 64 65 78 3a 0d  fault-pkgindex:.
da30: 0a 09 40 65 63 68 6f 20 69 66 20 7b 5b 70 61 63  ..@echo if {[pac
da40: 6b 61 67 65 20 76 73 61 74 69 73 66 69 65 73 20  kage vsatisfies 
da50: 5b 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65  [package provide
da60: 20 54 63 6c 5d 20 39 2e 30 5d 7d 20 7b 20 3e 20   Tcl] 9.0]} { > 
da70: 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e  $(OUT_DIR)\pkgIn
da80: 64 65 78 2e 74 63 6c 0d 0a 09 40 65 63 68 6f 20  dex.tcl...@echo 
da90: 70 61 63 6b 61 67 65 20 69 66 6e 65 65 64 65 64  package ifneeded
daa0: 20 24 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54   $(PRJ_PACKAGE_T
dab0: 43 4c 4e 41 4d 45 29 20 24 28 44 4f 54 56 45 52  CLNAME) $(DOTVER
dac0: 53 49 4f 4e 29 20 5c 0d 0a 09 20 20 20 20 5b 6c  SION) \...    [l
dad0: 69 73 74 20 6c 6f 61 64 20 5b 66 69 6c 65 20 6a  ist load [file j
dae0: 6f 69 6e 20 24 24 64 69 72 20 24 28 50 4c 41 54  oin $$dir $(PLAT
daf0: 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 29 20 24  FORM_IDENTIFY) $
db00: 28 50 52 4a 4c 49 42 4e 41 4d 45 39 29 5d 5d 20  (PRJLIBNAME9)]] 
db10: 3e 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b  >> $(OUT_DIR)\pk
db20: 67 49 6e 64 65 78 2e 74 63 6c 0d 0a 09 40 65 63  gIndex.tcl...@ec
db30: 68 6f 20 7d 20 65 6c 73 65 20 7b 20 3e 3e 20 24  ho } else { >> $
db40: 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64  (OUT_DIR)\pkgInd
db50: 65 78 2e 74 63 6c 0d 0a 09 40 65 63 68 6f 20 70  ex.tcl...@echo p
db60: 61 63 6b 61 67 65 20 69 66 6e 65 65 64 65 64 20  ackage ifneeded 
db70: 24 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43  $(PRJ_PACKAGE_TC
db80: 4c 4e 41 4d 45 29 20 24 28 44 4f 54 56 45 52 53  LNAME) $(DOTVERS
db90: 49 4f 4e 29 20 5c 0d 0a 09 20 20 20 20 5b 6c 69  ION) \...    [li
dba0: 73 74 20 6c 6f 61 64 20 5b 66 69 6c 65 20 6a 6f  st load [file jo
dbb0: 69 6e 20 24 24 64 69 72 20 24 28 50 4c 41 54 46  in $$dir $(PLATF
dbc0: 4f 52 4d 5f 49 44 45 4e 54 49 46 59 29 20 24 28  ORM_IDENTIFY) $(
dbd0: 50 52 4a 4c 49 42 4e 41 4d 45 38 29 5d 5d 20 3e  PRJLIBNAME8)]] >
dbe0: 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67  > $(OUT_DIR)\pkg
dbf0: 49 6e 64 65 78 2e 74 63 6c 0d 0a 09 40 65 63 68  Index.tcl...@ech
dc00: 6f 20 7d 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52  o } >> $(OUT_DIR
dc10: 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0d 0a  )\pkgIndex.tcl..
dc20: 21 65 6c 73 65 0d 0a 64 65 66 61 75 6c 74 2d 70  !else..default-p
dc30: 6b 67 69 6e 64 65 78 3a 0d 0a 09 40 65 63 68 6f  kgindex:...@echo
dc40: 20 69 66 20 7b 5b 70 61 63 6b 61 67 65 20 76 73   if {[package vs
dc50: 61 74 69 73 66 69 65 73 20 5b 70 61 63 6b 61 67  atisfies [packag
dc60: 65 20 70 72 6f 76 69 64 65 20 54 63 6c 5d 20 39  e provide Tcl] 9
dc70: 2e 30 5d 7d 20 7b 20 3e 20 24 28 4f 55 54 5f 44  .0]} { > $(OUT_D
dc80: 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c  IR)\pkgIndex.tcl
dc90: 0d 0a 09 40 65 63 68 6f 20 70 61 63 6b 61 67 65  ...@echo package
dca0: 20 69 66 6e 65 65 64 65 64 20 24 28 50 52 4a 5f   ifneeded $(PRJ_
dcb0: 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29  PACKAGE_TCLNAME)
dcc0: 20 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 20 5c   $(DOTVERSION) \
dcd0: 0d 0a 09 20 20 20 20 5b 6c 69 73 74 20 6c 6f 61  ...    [list loa
dce0: 64 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 24 64  d [file join $$d
dcf0: 69 72 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 39  ir $(PRJLIBNAME9
dd00: 29 5d 5d 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52  )]] >> $(OUT_DIR
dd10: 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0d 0a  )\pkgIndex.tcl..
dd20: 09 40 65 63 68 6f 20 7d 20 65 6c 73 65 20 7b 20  .@echo } else { 
dd30: 3e 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b  >> $(OUT_DIR)\pk
dd40: 67 49 6e 64 65 78 2e 74 63 6c 0d 0a 09 40 65 63  gIndex.tcl...@ec
dd50: 68 6f 20 70 61 63 6b 61 67 65 20 69 66 6e 65 65  ho package ifnee
dd60: 64 65 64 20 24 28 50 52 4a 5f 50 41 43 4b 41 47  ded $(PRJ_PACKAG
dd70: 45 5f 54 43 4c 4e 41 4d 45 29 20 24 28 44 4f 54  E_TCLNAME) $(DOT
dd80: 56 45 52 53 49 4f 4e 29 20 5c 0d 0a 09 20 20 20  VERSION) \...   
dd90: 20 5b 6c 69 73 74 20 6c 6f 61 64 20 5b 66 69 6c   [list load [fil
dda0: 65 20 6a 6f 69 6e 20 24 24 64 69 72 20 24 28 50  e join $$dir $(P
ddb0: 52 4a 4c 49 42 4e 41 4d 45 38 29 5d 5d 20 3e 3e  RJLIBNAME8)]] >>
ddc0: 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49   $(OUT_DIR)\pkgI
ddd0: 6e 64 65 78 2e 74 63 6c 0d 0a 09 40 65 63 68 6f  ndex.tcl...@echo
dde0: 20 7d 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52 29   } >> $(OUT_DIR)
ddf0: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0d 0a 21  \pkgIndex.tcl..!
de00: 65 6e 64 69 66 0d 0a 0d 0a 64 65 66 61 75 6c 74  endif....default
de10: 2d 70 6b 67 69 6e 64 65 78 2d 74 65 61 3a 0d 0a  -pkgindex-tea:..
de20: 09 40 69 66 20 65 78 69 73 74 20 24 28 52 4f 4f  .@if exist $(ROO
de30: 54 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 2e  T)\pkgIndex.tcl.
de40: 69 6e 20 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41  in $(NMAKEHLP_NA
de50: 54 49 56 45 29 20 2d 73 20 3c 3c 20 24 28 52 4f  TIVE) -s << $(RO
de60: 4f 54 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c  OT)\pkgIndex.tcl
de70: 2e 69 6e 20 3e 20 24 28 4f 55 54 5f 44 49 52 29  .in > $(OUT_DIR)
de80: 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0d 0a 40  \pkgIndex.tcl..@
de90: 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e 40  PACKAGE_VERSION@
dea0: 20 20 20 20 24 28 44 4f 54 56 45 52 53 49 4f 4e      $(DOTVERSION
deb0: 29 0d 0a 40 50 41 43 4b 41 47 45 5f 4e 41 4d 45  )..@PACKAGE_NAME
dec0: 40 20 20 20 20 20 20 20 24 28 50 52 4a 5f 50 41  @       $(PRJ_PA
ded0: 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 0d 0a  CKAGE_TCLNAME)..
dee0: 40 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45  @PACKAGE_TCLNAME
def0: 40 20 20 20 20 24 28 50 52 4a 5f 50 41 43 4b 41  @    $(PRJ_PACKA
df00: 47 45 5f 54 43 4c 4e 41 4d 45 29 0d 0a 40 50 4b  GE_TCLNAME)..@PK
df10: 47 5f 4c 49 42 5f 46 49 4c 45 40 20 20 20 20 20  G_LIB_FILE@     
df20: 20 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 29 0d    $(PRJLIBNAME).
df30: 0a 40 50 4b 47 5f 4c 49 42 5f 46 49 4c 45 38 40  .@PKG_LIB_FILE8@
df40: 20 20 20 20 20 20 24 28 50 52 4a 4c 49 42 4e 41        $(PRJLIBNA
df50: 4d 45 38 29 0d 0a 40 50 4b 47 5f 4c 49 42 5f 46  ME8)..@PKG_LIB_F
df60: 49 4c 45 39 40 20 20 20 20 20 20 24 28 50 52 4a  ILE9@      $(PRJ
df70: 4c 49 42 4e 41 4d 45 39 29 0d 0a 3c 3c 0d 0a 0d  LIBNAME9)..<<...
df80: 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c  .default-install
df90: 3a 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c  : default-instal
dfa0: 6c 2d 62 69 6e 61 72 69 65 73 20 64 65 66 61 75  l-binaries defau
dfb0: 6c 74 2d 69 6e 73 74 61 6c 6c 2d 6c 69 62 72 61  lt-install-libra
dfc0: 72 69 65 73 0d 0a 21 69 66 20 24 28 53 59 4d 42  ries..!if $(SYMB
dfd0: 4f 4c 53 29 0d 0a 64 65 66 61 75 6c 74 2d 69 6e  OLS)..default-in
dfe0: 73 74 61 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 69  stall: default-i
dff0: 6e 73 74 61 6c 6c 2d 70 64 62 73 0d 0a 21 65 6e  nstall-pdbs..!en
e000: 64 69 66 0d 0a 0d 0a 23 20 41 67 61 69 6e 20 74  dif....# Again t
e010: 6f 20 64 65 61 6c 20 77 69 74 68 20 68 69 73 74  o deal with hist
e020: 6f 72 69 63 61 6c 20 62 72 6f 6b 65 6e 6e 65 73  orical brokennes
e030: 73 2c 20 74 68 65 72 65 20 69 73 20 73 6f 6d 65  s, there is some
e040: 20 63 6f 6e 66 75 73 69 6f 6e 0d 0a 23 20 69 6e   confusion..# in
e050: 20 74 65 72 6d 69 6e 6c 6f 67 79 2e 20 46 6f 72   terminlogy. For
e060: 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 74 68 65   extensions, the
e070: 20 22 69 6e 73 74 61 6c 6c 2d 62 69 6e 61 72 69   "install-binari
e080: 65 73 22 20 77 61 73 20 75 73 65 64 20 74 6f 0d  es" was used to.
e090: 0a 23 20 6c 6f 63 61 74 65 20 74 61 72 67 65 74  .# locate target
e0a0: 20 64 69 72 65 63 74 6f 72 79 20 66 6f 72 20 2a   directory for *
e0b0: 62 69 6e 61 72 79 20 73 68 61 72 65 64 20 6c 69  binary shared li
e0c0: 62 72 61 72 69 65 73 2a 20 61 6e 64 20 74 68 75  braries* and thu
e0d0: 73 0d 0a 23 20 74 68 65 20 61 70 70 72 6f 70 72  s..# the appropr
e0e0: 69 61 74 65 20 6d 61 63 72 6f 20 69 73 20 4c 49  iate macro is LI
e0f0: 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 73 69  B_INSTALL_DIR si
e100: 6e 63 65 20 42 49 4e 5f 49 4e 53 54 41 4c 4c 5f  nce BIN_INSTALL_
e110: 44 49 52 20 69 73 0d 0a 23 20 66 6f 72 20 65 78  DIR is..# for ex
e120: 65 63 75 74 61 62 6c 65 73 20 28 65 78 65 73 29  ecutables (exes)
e130: 2e 20 4f 6e 20 74 68 65 20 6f 74 68 65 72 20 68  . On the other h
e140: 61 6e 64 20 74 68 65 20 22 69 6e 73 74 61 6c 6c  and the "install
e150: 2d 6c 69 62 72 61 72 69 65 73 22 0d 0a 23 20 74  -libraries"..# t
e160: 61 72 67 65 74 20 69 73 20 66 6f 72 20 2a 73 63  arget is for *sc
e170: 72 69 70 74 73 2a 20 61 6e 64 20 73 68 6f 75 6c  ripts* and shoul
e180: 64 20 68 61 76 65 20 62 65 65 6e 20 63 61 6c 6c  d have been call
e190: 65 64 20 22 69 6e 73 74 61 6c 6c 2d 73 63 72 69  ed "install-scri
e1a0: 70 74 73 22 2e 0d 0a 64 65 66 61 75 6c 74 2d 69  pts"...default-i
e1b0: 6e 73 74 61 6c 6c 2d 62 69 6e 61 72 69 65 73 3a  nstall-binaries:
e1c0: 20 24 28 50 52 4a 4c 49 42 29 0d 0a 09 40 24 28   $(PRJLIB)...@$(
e1d0: 45 43 48 4f 29 20 49 6e 73 74 61 6c 6c 69 6e 67  ECHO) Installing
e1e0: 20 24 28 50 52 4a 4c 49 42 29 20 74 6f 20 27 24   $(PRJLIB) to '$
e1f0: 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  (LIB_INSTALL_DIR
e200: 29 27 0d 0a 09 40 69 66 20 6e 6f 74 20 65 78 69  )'...@if not exi
e210: 73 74 20 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c  st "$(LIB_INSTAL
e220: 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72 20 22 24  L_DIR)" mkdir "$
e230: 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52  (LIB_INSTALL_DIR
e240: 29 22 0d 0a 09 40 24 28 43 50 59 29 20 24 28 50  )"...@$(CPY) $(P
e250: 52 4a 4c 49 42 29 20 22 24 28 4c 49 42 5f 49 4e  RJLIB) "$(LIB_IN
e260: 53 54 41 4c 4c 5f 44 49 52 29 22 20 3e 4e 55 4c  STALL_DIR)" >NUL
e270: 0d 0a 0d 0a 23 20 41 6c 69 61 73 20 66 6f 72 20  ....# Alias for 
e280: 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d  default-install-
e290: 73 63 72 69 70 74 73 0d 0a 64 65 66 61 75 6c 74  scripts..default
e2a0: 2d 69 6e 73 74 61 6c 6c 2d 6c 69 62 72 61 72 69  -install-librari
e2b0: 65 73 3a 20 64 65 66 61 75 6c 74 2d 69 6e 73 74  es: default-inst
e2c0: 61 6c 6c 2d 73 63 72 69 70 74 73 0d 0a 0d 0a 64  all-scripts....d
e2d0: 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 73  efault-install-s
e2e0: 63 72 69 70 74 73 3a 20 24 28 4f 55 54 5f 44 49  cripts: $(OUT_DI
e2f0: 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0d  R)\pkgIndex.tcl.
e300: 0a 09 40 24 28 45 43 48 4f 29 20 49 6e 73 74 61  ..@$(ECHO) Insta
e310: 6c 6c 69 6e 67 20 24 28 50 52 4f 4a 45 43 54 29  lling $(PROJECT)
e320: 20 73 63 72 69 70 74 73 20 74 6f 20 27 24 28 53   scripts to '$(S
e330: 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49  CRIPT_INSTALL_DI
e340: 52 29 27 0d 0a 09 40 69 66 20 6e 6f 74 20 65 78  R)'...@if not ex
e350: 69 73 74 20 22 24 28 53 43 52 49 50 54 5f 49 4e  ist "$(SCRIPT_IN
e360: 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69  STALL_DIR)" mkdi
e370: 72 20 22 24 28 53 43 52 49 50 54 5f 49 4e 53 54  r "$(SCRIPT_INST
e380: 41 4c 4c 5f 44 49 52 29 22 0d 0a 09 40 69 66 20  ALL_DIR)"...@if 
e390: 65 78 69 73 74 20 24 28 4c 49 42 44 49 52 29 20  exist $(LIBDIR) 
e3a0: 24 28 43 50 59 29 20 24 28 4c 49 42 44 49 52 29  $(CPY) $(LIBDIR)
e3b0: 5c 2a 2e 74 63 6c 20 22 24 28 53 43 52 49 50 54  \*.tcl "$(SCRIPT
e3c0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0d 0a  _INSTALL_DIR)"..
e3d0: 09 40 24 28 43 50 59 29 20 24 28 4f 55 54 5f 44  .@$(CPY) $(OUT_D
e3e0: 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c  IR)\pkgIndex.tcl
e3f0: 20 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c   $(SCRIPT_INSTAL
e400: 4c 5f 44 49 52 29 0d 0a 0d 0a 64 65 66 61 75 6c  L_DIR)....defaul
e410: 74 2d 69 6e 73 74 61 6c 6c 2d 73 74 75 62 73 3a  t-install-stubs:
e420: 0d 0a 09 40 24 28 45 43 48 4f 29 20 49 6e 73 74  ...@$(ECHO) Inst
e430: 61 6c 6c 69 6e 67 20 73 74 75 62 73 20 6c 69 62  alling stubs lib
e440: 72 61 72 79 20 74 6f 20 27 24 28 53 43 52 49 50  rary to '$(SCRIP
e450: 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0d  T_INSTALL_DIR)'.
e460: 0a 09 40 69 66 20 6e 6f 74 20 65 78 69 73 74 20  ..@if not exist 
e470: 22 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c  "$(SCRIPT_INSTAL
e480: 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72 20 22 24  L_DIR)" mkdir "$
e490: 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f  (SCRIPT_INSTALL_
e4a0: 44 49 52 29 22 0d 0a 09 40 24 28 43 50 59 29 20  DIR)"...@$(CPY) 
e4b0: 24 28 50 52 4a 53 54 55 42 4c 49 42 29 20 22 24  $(PRJSTUBLIB) "$
e4c0: 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f  (SCRIPT_INSTALL_
e4d0: 44 49 52 29 22 20 3e 4e 55 4c 0d 0a 0d 0a 64 65  DIR)" >NUL....de
e4e0: 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 70 64  fault-install-pd
e4f0: 62 73 3a 0d 0a 21 69 66 20 21 24 28 53 54 41 54  bs:..!if !$(STAT
e500: 49 43 5f 42 55 49 4c 44 29 0d 0a 09 40 24 28 45  IC_BUILD)...@$(E
e510: 43 48 4f 29 20 49 6e 73 74 61 6c 6c 69 6e 67 20  CHO) Installing 
e520: 50 44 42 73 20 74 6f 20 27 24 28 4c 49 42 5f 49  PDBs to '$(LIB_I
e530: 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0d 0a 09 40  NSTALL_DIR)'...@
e540: 69 66 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28  if not exist "$(
e550: 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29  LIB_INSTALL_DIR)
e560: 22 20 6d 6b 64 69 72 20 22 24 28 4c 49 42 5f 49  " mkdir "$(LIB_I
e570: 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0d 0a 09 40  NSTALL_DIR)"...@
e580: 24 28 43 50 59 29 20 22 24 28 4f 55 54 5f 44 49  $(CPY) "$(OUT_DI
e590: 52 29 5c 2a 2e 70 64 62 22 20 22 24 28 4c 49 42  R)\*.pdb" "$(LIB
e5a0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 5c 22 0d  _INSTALL_DIR)\".
e5b0: 0a 21 65 6e 64 69 66 0d 0a 0d 0a 23 20 22 65 6d  .!endif....# "em
e5c0: 61 63 73 20 66 6f 6e 74 2d 6c 6f 63 6b 20 68 69  acs font-lock hi
e5d0: 67 68 6c 69 67 68 74 69 6e 67 20 66 69 78 0d 0a  ghlighting fix..
e5e0: 0d 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c  ..default-instal
e5f0: 6c 2d 64 6f 63 73 2d 68 74 6d 6c 3a 0d 0a 09 40  l-docs-html:...@
e600: 24 28 45 43 48 4f 29 20 49 6e 73 74 61 6c 6c 69  $(ECHO) Installi
e610: 6e 67 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e  ng documentation
e620: 20 66 69 6c 65 73 20 74 6f 20 27 24 28 44 4f 43   files to '$(DOC
e630: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0d 0a  _INSTALL_DIR)'..
e640: 09 40 69 66 20 6e 6f 74 20 65 78 69 73 74 20 22  .@if not exist "
e650: 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49  $(DOC_INSTALL_DI
e660: 52 29 22 20 6d 6b 64 69 72 20 22 24 28 44 4f 43  R)" mkdir "$(DOC
e670: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0d 0a  _INSTALL_DIR)"..
e680: 09 40 69 66 20 65 78 69 73 74 20 24 28 44 4f 43  .@if exist $(DOC
e690: 44 49 52 29 20 66 6f 72 20 25 66 20 69 6e 20 28  DIR) for %f in (
e6a0: 22 24 28 44 4f 43 44 49 52 29 5c 2a 2e 68 74 6d  "$(DOCDIR)\*.htm
e6b0: 6c 22 20 22 24 28 44 4f 43 44 49 52 29 5c 2a 2e  l" "$(DOCDIR)\*.
e6c0: 63 73 73 22 20 22 24 28 44 4f 43 44 49 52 29 5c  css" "$(DOCDIR)\
e6d0: 2a 2e 70 6e 67 22 29 20 64 6f 20 40 24 28 43 4f  *.png") do @$(CO
e6e0: 50 59 29 20 25 66 20 22 24 28 44 4f 43 5f 49 4e  PY) %f "$(DOC_IN
e6f0: 53 54 41 4c 4c 5f 44 49 52 29 22 0d 0a 0d 0a 64  STALL_DIR)"....d
e700: 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 64  efault-install-d
e710: 6f 63 73 2d 6e 3a 0d 0a 09 40 24 28 45 43 48 4f  ocs-n:...@$(ECHO
e720: 29 20 49 6e 73 74 61 6c 6c 69 6e 67 20 64 6f 63  ) Installing doc
e730: 75 6d 65 6e 74 61 74 69 6f 6e 20 66 69 6c 65 73  umentation files
e740: 20 74 6f 20 27 24 28 44 4f 43 5f 49 4e 53 54 41   to '$(DOC_INSTA
e750: 4c 4c 5f 44 49 52 29 27 0d 0a 09 40 69 66 20 6e  LL_DIR)'...@if n
e760: 6f 74 20 65 78 69 73 74 20 22 24 28 44 4f 43 5f  ot exist "$(DOC_
e770: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b  INSTALL_DIR)" mk
e780: 64 69 72 20 22 24 28 44 4f 43 5f 49 4e 53 54 41  dir "$(DOC_INSTA
e790: 4c 4c 5f 44 49 52 29 22 0d 0a 09 40 69 66 20 65  LL_DIR)"...@if e
e7a0: 78 69 73 74 20 24 28 44 4f 43 44 49 52 29 20 66  xist $(DOCDIR) f
e7b0: 6f 72 20 25 66 20 69 6e 20 28 22 24 28 44 4f 43  or %f in ("$(DOC
e7c0: 44 49 52 29 5c 2a 2e 6e 22 29 20 64 6f 20 40 24  DIR)\*.n") do @$
e7d0: 28 43 4f 50 59 29 20 25 66 20 22 24 28 44 4f 43  (COPY) %f "$(DOC
e7e0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0d 0a  _INSTALL_DIR)"..
e7f0: 0d 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c  ..default-instal
e800: 6c 2d 64 65 6d 6f 73 3a 0d 0a 09 40 24 28 45 43  l-demos:...@$(EC
e810: 48 4f 29 20 49 6e 73 74 61 6c 6c 69 6e 67 20 64  HO) Installing d
e820: 65 6d 6f 73 20 74 6f 20 27 24 28 44 45 4d 4f 5f  emos to '$(DEMO_
e830: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0d 0a 09  INSTALL_DIR)'...
e840: 40 69 66 20 6e 6f 74 20 65 78 69 73 74 20 22 24  @if not exist "$
e850: 28 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49  (DEMO_INSTALL_DI
e860: 52 29 22 20 6d 6b 64 69 72 20 22 24 28 44 45 4d  R)" mkdir "$(DEM
e870: 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0d  O_INSTALL_DIR)".
e880: 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 44 45  ..@if exist $(DE
e890: 4d 4f 44 49 52 29 20 24 28 43 50 59 44 49 52 29  MODIR) $(CPYDIR)
e8a0: 20 22 24 28 44 45 4d 4f 44 49 52 29 22 20 22 24   "$(DEMODIR)" "$
e8b0: 28 44 45 4d 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49  (DEMO_INSTALL_DI
e8c0: 52 29 22 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 63  R)"....default-c
e8d0: 6c 65 61 6e 3a 0d 0a 09 40 24 28 45 43 48 4f 29  lean:...@$(ECHO)
e8e0: 20 43 6c 65 61 6e 69 6e 67 20 24 28 54 4d 50 5f   Cleaning $(TMP_
e8f0: 44 49 52 29 5c 2a 20 2e 2e 2e 0d 0a 09 40 69 66  DIR)\* ......@if
e900: 20 65 78 69 73 74 20 24 28 54 4d 50 5f 44 49 52   exist $(TMP_DIR
e910: 29 5c 6e 75 6c 20 24 28 52 4d 44 49 52 29 20 24  )\nul $(RMDIR) $
e920: 28 54 4d 50 5f 44 49 52 29 0d 0a 09 40 24 28 45  (TMP_DIR)...@$(E
e930: 43 48 4f 29 20 43 6c 65 61 6e 69 6e 67 20 24 28  CHO) Cleaning $(
e940: 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65 68 6c  WIN_DIR)\nmakehl
e950: 70 2e 6f 62 6a 2c 20 6e 6d 61 6b 65 68 6c 70 2e  p.obj, nmakehlp.
e960: 65 78 65 20 2e 2e 2e 0d 0a 09 40 69 66 20 65 78  exe ......@if ex
e970: 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e  ist $(WIN_DIR)\n
e980: 6d 61 6b 65 68 6c 70 2e 6f 62 6a 20 64 65 6c 20  makehlp.obj del 
e990: 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65  $(WIN_DIR)\nmake
e9a0: 68 6c 70 2e 6f 62 6a 0d 0a 09 40 69 66 20 65 78  hlp.obj...@if ex
e9b0: 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e  ist $(WIN_DIR)\n
e9c0: 6d 61 6b 65 68 6c 70 2e 65 78 65 20 64 65 6c 20  makehlp.exe del 
e9d0: 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65  $(WIN_DIR)\nmake
e9e0: 68 6c 70 2e 65 78 65 0d 0a 09 40 69 66 20 65 78  hlp.exe...@if ex
e9f0: 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e  ist $(WIN_DIR)\n
ea00: 6d 61 6b 65 68 6c 70 2e 6f 75 74 20 64 65 6c 20  makehlp.out del 
ea10: 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 61 6b 65  $(WIN_DIR)\nmake
ea20: 68 6c 70 2e 6f 75 74 0d 0a 09 40 24 28 45 43 48  hlp.out...@$(ECH
ea30: 4f 29 20 43 6c 65 61 6e 69 6e 67 20 24 28 57 49  O) Cleaning $(WI
ea40: 4e 5f 44 49 52 29 5c 6e 6d 68 6c 70 2d 6f 75 74  N_DIR)\nmhlp-out
ea50: 2e 74 78 74 20 2e 2e 2e 0d 0a 09 40 69 66 20 65  .txt ......@if e
ea60: 78 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c  xist $(WIN_DIR)\
ea70: 6e 6d 68 6c 70 2d 6f 75 74 2e 74 78 74 20 64 65  nmhlp-out.txt de
ea80: 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d 68  l $(WIN_DIR)\nmh
ea90: 6c 70 2d 6f 75 74 2e 74 78 74 0d 0a 09 40 24 28  lp-out.txt...@$(
eaa0: 45 43 48 4f 29 20 43 6c 65 61 6e 69 6e 67 20 24  ECHO) Cleaning $
eab0: 28 57 49 4e 5f 44 49 52 29 5c 5f 6a 75 6e 6b 2e  (WIN_DIR)\_junk.
eac0: 70 63 68 20 2e 2e 2e 0d 0a 09 40 69 66 20 65 78  pch ......@if ex
ead0: 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 5f  ist $(WIN_DIR)\_
eae0: 6a 75 6e 6b 2e 70 63 68 20 64 65 6c 20 24 28 57  junk.pch del $(W
eaf0: 49 4e 5f 44 49 52 29 5c 5f 6a 75 6e 6b 2e 70 63  IN_DIR)\_junk.pc
eb00: 68 0d 0a 09 40 24 28 45 43 48 4f 29 20 43 6c 65  h...@$(ECHO) Cle
eb10: 61 6e 69 6e 67 20 24 28 57 49 4e 5f 44 49 52 29  aning $(WIN_DIR)
eb20: 5c 76 65 72 63 6c 2e 78 2c 20 76 65 72 63 6c 2e  \vercl.x, vercl.
eb30: 69 20 2e 2e 2e 0d 0a 09 40 69 66 20 65 78 69 73  i ......@if exis
eb40: 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 72  t $(WIN_DIR)\ver
eb50: 63 6c 2e 78 20 64 65 6c 20 24 28 57 49 4e 5f 44  cl.x del $(WIN_D
eb60: 49 52 29 5c 76 65 72 63 6c 2e 78 0d 0a 09 40 69  IR)\vercl.x...@i
eb70: 66 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44 49  f exist $(WIN_DI
eb80: 52 29 5c 76 65 72 63 6c 2e 69 20 64 65 6c 20 24  R)\vercl.i del $
eb90: 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 63 6c 2e  (WIN_DIR)\vercl.
eba0: 69 0d 0a 09 40 24 28 45 43 48 4f 29 20 43 6c 65  i...@$(ECHO) Cle
ebb0: 61 6e 69 6e 67 20 24 28 57 49 4e 5f 44 49 52 29  aning $(WIN_DIR)
ebc0: 5c 76 65 72 73 69 6f 6e 73 2e 76 63 2c 20 76 65  \versions.vc, ve
ebd0: 72 73 69 6f 6e 2e 76 63 20 2e 2e 2e 0d 0a 09 40  rsion.vc ......@
ebe0: 69 66 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44  if exist $(WIN_D
ebf0: 49 52 29 5c 76 65 72 73 69 6f 6e 73 2e 76 63 20  IR)\versions.vc 
ec00: 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c 76  del $(WIN_DIR)\v
ec10: 65 72 73 69 6f 6e 73 2e 76 63 0d 0a 09 40 69 66  ersions.vc...@if
ec20: 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44 49 52   exist $(WIN_DIR
ec30: 29 5c 76 65 72 73 69 6f 6e 2e 76 63 20 64 65 6c  )\version.vc del
ec40: 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 73   $(WIN_DIR)\vers
ec50: 69 6f 6e 2e 76 63 0d 0a 0d 0a 64 65 66 61 75 6c  ion.vc....defaul
ec60: 74 2d 68 6f 73 65 3a 20 64 65 66 61 75 6c 74 2d  t-hose: default-
ec70: 63 6c 65 61 6e 0d 0a 09 40 65 63 68 6f 20 48 6f  clean...@echo Ho
ec80: 73 69 6e 67 20 24 28 4f 55 54 5f 44 49 52 29 5c  sing $(OUT_DIR)\
ec90: 2a 20 2e 2e 2e 0d 0a 09 40 69 66 20 65 78 69 73  * ......@if exis
eca0: 74 20 24 28 4f 55 54 5f 44 49 52 29 5c 6e 75 6c  t $(OUT_DIR)\nul
ecb0: 20 24 28 52 4d 44 49 52 29 20 24 28 4f 55 54 5f   $(RMDIR) $(OUT_
ecc0: 44 49 52 29 0d 0a 0d 0a 23 20 4f 6e 6c 79 20 66  DIR)....# Only f
ecd0: 6f 72 20 62 61 63 6b 77 61 72 64 20 63 6f 6d 70  or backward comp
ece0: 61 74 69 62 69 6c 69 74 79 0d 0a 64 65 66 61 75  atibility..defau
ecf0: 6c 74 2d 64 69 73 74 63 6c 65 61 6e 3a 20 64 65  lt-distclean: de
ed00: 66 61 75 6c 74 2d 68 6f 73 65 0d 0a 0d 0a 64 65  fault-hose....de
ed10: 66 61 75 6c 74 2d 73 65 74 75 70 3a 0d 0a 09 40  fault-setup:...@
ed20: 69 66 20 6e 6f 74 20 65 78 69 73 74 20 24 28 4f  if not exist $(O
ed30: 55 54 5f 44 49 52 29 5c 6e 75 6c 20 6d 6b 64 69  UT_DIR)\nul mkdi
ed40: 72 20 24 28 4f 55 54 5f 44 49 52 29 0d 0a 09 40  r $(OUT_DIR)...@
ed50: 69 66 20 6e 6f 74 20 65 78 69 73 74 20 24 28 54  if not exist $(T
ed60: 4d 50 5f 44 49 52 29 5c 6e 75 6c 20 6d 6b 64 69  MP_DIR)\nul mkdi
ed70: 72 20 24 28 54 4d 50 5f 44 49 52 29 0d 0a 0d 0a  r $(TMP_DIR)....
ed80: 21 69 66 20 22 24 28 54 45 53 54 50 41 54 29 22  !if "$(TESTPAT)"
ed90: 20 21 3d 20 22 22 0d 0a 54 45 53 54 46 4c 41 47   != ""..TESTFLAG
eda0: 53 20 3d 20 24 28 54 45 53 54 46 4c 41 47 53 29  S = $(TESTFLAGS)
edb0: 20 2d 66 69 6c 65 20 24 28 54 45 53 54 50 41 54   -file $(TESTPAT
edc0: 29 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 64 65 66  )..!endif....def
edd0: 61 75 6c 74 2d 74 65 73 74 3a 20 64 65 66 61 75  ault-test: defau
ede0: 6c 74 2d 73 65 74 75 70 20 24 28 50 52 4f 4a 45  lt-setup $(PROJE
edf0: 43 54 29 0d 0a 09 40 73 65 74 20 54 43 4c 4c 49  CT)...@set TCLLI
ee00: 42 50 41 54 48 3d 24 28 4f 55 54 5f 44 49 52 3a  BPATH=$(OUT_DIR:
ee10: 5c 3d 2f 29 0d 0a 09 40 69 66 20 65 78 69 73 74  \=/)...@if exist
ee20: 20 24 28 4c 49 42 44 49 52 29 20 66 6f 72 20 25   $(LIBDIR) for %
ee30: 66 20 69 6e 20 28 22 24 28 4c 49 42 44 49 52 29  f in ("$(LIBDIR)
ee40: 5c 2a 2e 74 63 6c 22 29 20 64 6f 20 40 24 28 43  \*.tcl") do @$(C
ee50: 4f 50 59 29 20 25 66 20 22 24 28 4f 55 54 5f 44  OPY) %f "$(OUT_D
ee60: 49 52 29 22 0d 0a 09 63 64 20 22 24 28 54 45 53  IR)"...cd "$(TES
ee70: 54 44 49 52 29 22 20 26 26 20 24 28 44 45 42 55  TDIR)" && $(DEBU
ee80: 47 47 45 52 29 20 24 28 54 43 4c 53 48 29 20 61  GGER) $(TCLSH) a
ee90: 6c 6c 2e 74 63 6c 20 24 28 54 45 53 54 46 4c 41  ll.tcl $(TESTFLA
eea0: 47 53 29 0d 0a 0d 0a 64 65 66 61 75 6c 74 2d 73  GS)....default-s
eeb0: 68 65 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 73 65  hell: default-se
eec0: 74 75 70 20 24 28 50 52 4f 4a 45 43 54 29 0d 0a  tup $(PROJECT)..
eed0: 09 40 73 65 74 20 54 43 4c 4c 49 42 50 41 54 48  .@set TCLLIBPATH
eee0: 3d 24 28 4f 55 54 5f 44 49 52 3a 5c 3d 2f 29 0d  =$(OUT_DIR:\=/).
eef0: 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 4c 49  ..@if exist $(LI
ef00: 42 44 49 52 29 20 66 6f 72 20 25 66 20 69 6e 20  BDIR) for %f in 
ef10: 28 22 24 28 4c 49 42 44 49 52 29 5c 2a 2e 74 63  ("$(LIBDIR)\*.tc
ef20: 6c 22 29 20 64 6f 20 40 24 28 43 4f 50 59 29 20  l") do @$(COPY) 
ef30: 25 66 20 22 24 28 4f 55 54 5f 44 49 52 29 22 0d  %f "$(OUT_DIR)".
ef40: 0a 09 24 28 44 45 42 55 47 47 45 52 29 20 24 28  ..$(DEBUGGER) $(
ef50: 54 43 4c 53 48 29 0d 0a 0d 0a 23 20 47 65 6e 65  TCLSH)....# Gene
ef60: 72 61 74 69 6f 6e 20 6f 66 20 57 69 6e 64 6f 77  ration of Window
ef70: 73 20 76 65 72 73 69 6f 6e 20 72 65 73 6f 75 72  s version resour
ef80: 63 65 0d 0a 21 69 66 64 65 66 20 52 43 46 49 4c  ce..!ifdef RCFIL
ef90: 45 0d 0a 0d 0a 23 20 4e 6f 74 65 3a 20 64 6f 6e  E....# Note: don
efa0: 27 74 20 75 73 65 20 24 2a 2a 20 69 6e 20 62 65  't use $** in be
efb0: 6c 6f 77 20 72 75 6c 65 20 62 65 63 61 75 73 65  low rule because
efc0: 20 74 68 65 72 65 20 6d 61 79 20 62 65 20 6f 74   there may be ot
efd0: 68 65 72 20 64 65 70 65 6e 64 65 6e 63 69 65 73  her dependencies
efe0: 0d 0a 23 20 61 6e 64 20 6f 6e 6c 79 20 74 68 65  ..# and only the
eff0: 20 22 6d 61 69 6e 22 20 72 63 20 6d 75 73 74 20   "main" rc must 
f000: 62 65 20 70 61 73 73 65 64 20 74 6f 20 74 68 65  be passed to the
f010: 20 72 65 73 6f 75 72 63 65 20 63 6f 6d 70 69 6c   resource compil
f020: 65 72 0d 0a 24 28 54 4d 50 5f 44 49 52 29 5c 24  er..$(TMP_DIR)\$
f030: 28 50 52 4f 4a 45 43 54 29 2e 72 65 73 3a 20 24  (PROJECT).res: $
f040: 28 52 43 44 49 52 29 5c 24 28 50 52 4f 4a 45 43  (RCDIR)\$(PROJEC
f050: 54 29 2e 72 63 0d 0a 09 24 28 52 45 53 43 4d 44  T).rc...$(RESCMD
f060: 29 20 24 28 52 43 44 49 52 29 5c 24 28 50 52 4f  ) $(RCDIR)\$(PRO
f070: 4a 45 43 54 29 2e 72 63 0d 0a 0d 0a 21 65 6c 73  JECT).rc....!els
f080: 65 0d 0a 0d 0a 23 20 49 66 20 70 61 72 65 6e 74  e....# If parent
f090: 20 6d 61 6b 65 66 69 6c 65 20 68 61 73 20 6e 6f   makefile has no
f0a0: 74 20 64 65 66 69 6e 65 64 20 61 20 72 65 73 6f  t defined a reso
f0b0: 75 72 63 65 20 64 65 66 69 6e 69 74 69 6f 6e 20  urce definition 
f0c0: 66 69 6c 65 2c 0d 0a 23 20 77 65 20 77 69 6c 6c  file,..# we will
f0d0: 20 67 65 6e 65 72 61 74 65 20 6f 6e 65 20 66 72   generate one fr
f0e0: 6f 6d 20 73 74 61 6e 64 61 72 64 20 74 65 6d 70  om standard temp
f0f0: 6c 61 74 65 2e 0d 0a 24 28 54 4d 50 5f 44 49 52  late...$(TMP_DIR
f100: 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 65 73  )\$(PROJECT).res
f110: 3a 20 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 50  : $(TMP_DIR)\$(P
f120: 52 4f 4a 45 43 54 29 2e 72 63 0d 0a 0d 0a 24 28  ROJECT).rc....$(
f130: 54 4d 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45  TMP_DIR)\$(PROJE
f140: 43 54 29 2e 72 63 3a 0d 0a 09 40 24 28 43 4f 50  CT).rc:...@$(COP
f150: 59 29 20 3c 3c 20 24 28 54 4d 50 5f 44 49 52 29  Y) << $(TMP_DIR)
f160: 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 63 0d 0a  \$(PROJECT).rc..
f170: 23 69 6e 63 6c 75 64 65 20 3c 77 69 6e 76 65 72  #include <winver
f180: 2e 68 3e 0d 0a 0d 0a 56 53 5f 56 45 52 53 49 4f  .h>....VS_VERSIO
f190: 4e 5f 49 4e 46 4f 20 56 45 52 53 49 4f 4e 49 4e  N_INFO VERSIONIN
f1a0: 46 4f 0d 0a 20 46 49 4c 45 56 45 52 53 49 4f 4e  FO.. FILEVERSION
f1b0: 09 43 4f 4d 4d 41 56 45 52 53 49 4f 4e 0d 0a 20  .COMMAVERSION.. 
f1c0: 50 52 4f 44 55 43 54 56 45 52 53 49 4f 4e 09 43  PRODUCTVERSION.C
f1d0: 4f 4d 4d 41 56 45 52 53 49 4f 4e 0d 0a 20 46 49  OMMAVERSION.. FI
f1e0: 4c 45 46 4c 41 47 53 4d 41 53 4b 09 30 78 33 66  LEFLAGSMASK.0x3f
f1f0: 4c 0d 0a 23 69 66 64 65 66 20 44 45 42 55 47 0d  L..#ifdef DEBUG.
f200: 0a 20 46 49 4c 45 46 4c 41 47 53 09 56 53 5f 46  . FILEFLAGS.VS_F
f210: 46 5f 44 45 42 55 47 0d 0a 23 65 6c 73 65 0d 0a  F_DEBUG..#else..
f220: 20 46 49 4c 45 46 4c 41 47 53 09 30 78 30 4c 0d   FILEFLAGS.0x0L.
f230: 0a 23 65 6e 64 69 66 0d 0a 20 46 49 4c 45 4f 53  .#endif.. FILEOS
f240: 09 09 56 4f 53 5f 4e 54 5f 57 49 4e 44 4f 57 53  ..VOS_NT_WINDOWS
f250: 33 32 0d 0a 20 46 49 4c 45 54 59 50 45 09 56 46  32.. FILETYPE.VF
f260: 54 5f 44 4c 4c 0d 0a 20 46 49 4c 45 53 55 42 54  T_DLL.. FILESUBT
f270: 59 50 45 09 30 78 30 4c 0d 0a 42 45 47 49 4e 0d  YPE.0x0L..BEGIN.
f280: 0a 20 20 20 20 42 4c 4f 43 4b 20 22 53 74 72 69  .    BLOCK "Stri
f290: 6e 67 46 69 6c 65 49 6e 66 6f 22 0d 0a 20 20 20  ngFileInfo"..   
f2a0: 20 42 45 47 49 4e 0d 0a 09 42 4c 4f 43 4b 20 22   BEGIN...BLOCK "
f2b0: 30 34 30 39 30 34 62 30 22 0d 0a 09 42 45 47 49  040904b0"...BEGI
f2c0: 4e 0d 0a 09 20 20 20 20 56 41 4c 55 45 20 22 46  N...    VALUE "F
f2d0: 69 6c 65 44 65 73 63 72 69 70 74 69 6f 6e 22 2c  ileDescription",
f2e0: 20 20 22 54 63 6c 20 65 78 74 65 6e 73 69 6f 6e    "Tcl extension
f2f0: 20 22 20 50 52 4f 4a 45 43 54 0d 0a 09 20 20 20   " PROJECT...   
f300: 20 56 41 4c 55 45 20 22 4f 72 69 67 69 6e 61 6c   VALUE "Original
f310: 46 69 6c 65 6e 61 6d 65 22 2c 20 50 52 4a 4c 49  Filename", PRJLI
f320: 42 4e 41 4d 45 0d 0a 09 20 20 20 20 56 41 4c 55  BNAME...    VALU
f330: 45 20 22 46 69 6c 65 56 65 72 73 69 6f 6e 22 2c  E "FileVersion",
f340: 20 20 20 20 20 20 44 4f 54 56 45 52 53 49 4f 4e        DOTVERSION
f350: 0d 0a 09 20 20 20 20 56 41 4c 55 45 20 22 50 72  ...    VALUE "Pr
f360: 6f 64 75 63 74 4e 61 6d 65 22 2c 20 20 20 20 20  oductName",     
f370: 20 22 50 61 63 6b 61 67 65 20 22 20 50 52 4f 4a   "Package " PROJ
f380: 45 43 54 20 22 20 66 6f 72 20 54 63 6c 22 0d 0a  ECT " for Tcl"..
f390: 09 20 20 20 20 56 41 4c 55 45 20 22 50 72 6f 64  .    VALUE "Prod
f3a0: 75 63 74 56 65 72 73 69 6f 6e 22 2c 20 20 20 44  uctVersion",   D
f3b0: 4f 54 56 45 52 53 49 4f 4e 0d 0a 09 45 4e 44 0d  OTVERSION...END.
f3c0: 0a 20 20 20 20 45 4e 44 0d 0a 20 20 20 20 42 4c  .    END..    BL
f3d0: 4f 43 4b 20 22 56 61 72 46 69 6c 65 49 6e 66 6f  OCK "VarFileInfo
f3e0: 22 0d 0a 20 20 20 20 42 45 47 49 4e 0d 0a 09 56  "..    BEGIN...V
f3f0: 41 4c 55 45 20 22 54 72 61 6e 73 6c 61 74 69 6f  ALUE "Translatio
f400: 6e 22 2c 20 30 78 34 30 39 2c 20 31 32 30 30 0d  n", 0x409, 1200.
f410: 0a 20 20 20 20 45 4e 44 0d 0a 45 4e 44 0d 0a 0d  .    END..END...
f420: 0a 3c 3c 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 20  .<<....!endif # 
f430: 69 66 64 65 66 20 52 43 46 49 4c 45 0d 0a 0d 0a  ifdef RCFILE....
f440: 21 69 66 6e 64 65 66 20 44 49 53 41 42 4c 45 5f  !ifndef DISABLE_
f450: 49 4d 50 4c 49 43 49 54 5f 52 55 4c 45 53 0d 0a  IMPLICIT_RULES..
f460: 44 49 53 41 42 4c 45 5f 49 4d 50 4c 49 43 49 54  DISABLE_IMPLICIT
f470: 5f 52 55 4c 45 53 20 3d 20 30 0d 0a 21 65 6e 64  _RULES = 0..!end
f480: 69 66 0d 0a 0d 0a 21 69 66 20 21 24 28 44 49 53  if....!if !$(DIS
f490: 41 42 4c 45 5f 49 4d 50 4c 49 43 49 54 5f 52 55  ABLE_IMPLICIT_RU
f4a0: 4c 45 53 29 0d 0a 23 20 49 6d 70 6c 69 63 69 74  LES)..# Implicit
f4b0: 20 72 75 6c 65 20 64 65 66 69 6e 69 74 69 6f 6e   rule definition
f4c0: 73 20 2d 20 6f 6e 6c 79 20 66 6f 72 20 62 75 69  s - only for bui
f4d0: 6c 64 69 6e 67 20 6c 69 62 72 61 72 79 20 6f 62  lding library ob
f4e0: 6a 65 63 74 73 2e 20 46 6f 72 20 73 74 75 62 73  jects. For stubs
f4f0: 20 61 6e 64 0d 0a 23 20 6d 61 69 6e 20 61 70 70   and..# main app
f500: 6c 69 63 61 74 69 6f 6e 2c 20 74 68 65 20 6d 61  lication, the ma
f510: 6b 65 66 69 6c 65 20 73 68 6f 75 6c 64 20 64 65  kefile should de
f520: 66 69 6e 65 20 65 78 70 6c 69 63 69 74 20 72 75  fine explicit ru
f530: 6c 65 73 2e 0d 0a 0d 0a 7b 24 28 52 4f 4f 54 29  les.....{$(ROOT)
f540: 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e  }.c{$(TMP_DIR)}.
f550: 6f 62 6a 3a 3a 0d 0a 09 24 28 43 43 50 4b 47 43  obj::...$(CCPKGC
f560: 4d 44 29 20 40 3c 3c 0d 0a 24 3c 0d 0a 3c 3c 0d  MD) @<<..$<..<<.
f570: 0a 0d 0a 7b 24 28 57 49 4e 5f 44 49 52 29 7d 2e  ...{$(WIN_DIR)}.
f580: 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 6f 62  c{$(TMP_DIR)}.ob
f590: 6a 3a 3a 0d 0a 09 24 28 43 43 50 4b 47 43 4d 44  j::...$(CCPKGCMD
f5a0: 29 20 40 3c 3c 0d 0a 24 3c 0d 0a 3c 3c 0d 0a 0d  ) @<<..$<..<<...
f5b0: 0a 7b 24 28 47 45 4e 45 52 49 43 44 49 52 29 7d  .{$(GENERICDIR)}
f5c0: 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 6f  .c{$(TMP_DIR)}.o
f5d0: 62 6a 3a 3a 0d 0a 09 24 28 43 43 50 4b 47 43 4d  bj::...$(CCPKGCM
f5e0: 44 29 20 40 3c 3c 0d 0a 24 3c 0d 0a 3c 3c 0d 0a  D) @<<..$<..<<..
f5f0: 0d 0a 7b 24 28 43 4f 4d 50 41 54 44 49 52 29 7d  ..{$(COMPATDIR)}
f600: 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 6f  .c{$(TMP_DIR)}.o
f610: 62 6a 3a 3a 0d 0a 09 24 28 43 43 50 4b 47 43 4d  bj::...$(CCPKGCM
f620: 44 29 20 40 3c 3c 0d 0a 24 3c 0d 0a 3c 3c 0d 0a  D) @<<..$<..<<..
f630: 0d 0a 7b 24 28 52 43 44 49 52 29 7d 2e 72 63 7b  ..{$(RCDIR)}.rc{
f640: 24 28 54 4d 50 5f 44 49 52 29 7d 2e 72 65 73 3a  $(TMP_DIR)}.res:
f650: 0d 0a 09 24 28 52 45 53 43 4d 44 29 20 24 3c 0d  ...$(RESCMD) $<.
f660: 0a 0d 0a 7b 24 28 57 49 4e 5f 44 49 52 29 7d 2e  ...{$(WIN_DIR)}.
f670: 72 63 7b 24 28 54 4d 50 5f 44 49 52 29 7d 2e 72  rc{$(TMP_DIR)}.r
f680: 65 73 3a 0d 0a 09 24 28 52 45 53 43 4d 44 29 20  es:...$(RESCMD) 
f690: 24 3c 0d 0a 0d 0a 7b 24 28 54 4d 50 5f 44 49 52  $<....{$(TMP_DIR
f6a0: 29 7d 2e 72 63 7b 24 28 54 4d 50 5f 44 49 52 29  )}.rc{$(TMP_DIR)
f6b0: 7d 2e 72 65 73 3a 0d 0a 09 24 28 52 45 53 43 4d  }.res:...$(RESCM
f6c0: 44 29 20 24 3c 0d 0a 0d 0a 2e 53 55 46 46 49 58  D) $<.....SUFFIX
f6d0: 45 53 3a 0d 0a 2e 53 55 46 46 49 58 45 53 3a 2e  ES:...SUFFIXES:.
f6e0: 63 20 2e 72 63 0d 0a 0d 0a 21 65 6e 64 69 66 0d  c .rc....!endif.
f6f0: 0a 0d 0a 23 23 23 23 23 23 23 23 23 23 23 23 23  ...#############
f700: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
f710: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
f720: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23  ################
f730: 23 23 23 0d 0a 23 20 31 34 2e 20 53 61 6e 69 74  ###..# 14. Sanit
f740: 79 20 63 68 65 63 6b 20 73 65 6c 65 63 74 65 64  y check selected
f750: 20 6f 70 74 69 6f 6e 73 20 61 67 61 69 6e 73 74   options against
f760: 20 54 63 6c 20 62 75 69 6c 64 20 6f 70 74 69 6f   Tcl build optio
f770: 6e 73 0d 0a 23 20 57 68 65 6e 20 62 75 69 6c 64  ns..# When build
f780: 69 6e 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e  ing an extension
f790: 2c 20 63 65 72 74 61 69 6e 20 63 6f 6e 66 69 67  , certain config
f7a0: 75 72 61 74 69 6f 6e 20 6f 70 74 69 6f 6e 73 20  uration options 
f7b0: 73 68 6f 75 6c 64 0d 0a 23 20 6d 61 74 63 68 20  should..# match 
f7c0: 74 68 65 20 6f 6e 65 73 20 75 73 65 64 20 77 68  the ones used wh
f7d0: 65 6e 20 54 63 6c 20 77 61 73 20 62 75 69 6c 74  en Tcl was built
f7e0: 2e 20 48 65 72 65 20 77 65 20 63 68 65 63 6b 20  . Here we check 
f7f0: 61 6e 64 0d 0a 23 20 77 61 72 6e 20 6f 6e 20 61  and..# warn on a
f800: 20 6d 69 73 6d 61 74 63 68 2e 0d 0a 21 69 66 20   mismatch...!if 
f810: 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0d 0a 0d  !$(DOING_TCL)...
f820: 0a 21 69 66 20 24 28 54 43 4c 49 4e 53 54 41 4c  .!if $(TCLINSTAL
f830: 4c 29 20 23 20 42 75 69 6c 64 69 6e 67 20 61 67  L) # Building ag
f840: 61 69 6e 73 74 20 61 6e 20 69 6e 73 74 61 6c 6c  ainst an install
f850: 65 64 20 54 63 6c 0d 0a 21 69 66 20 65 78 69 73  ed Tcl..!if exis
f860: 74 28 22 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69  t("$(_TCLDIR)\li
f870: 62 5c 6e 6d 61 6b 65 5c 74 63 6c 2e 6e 6d 61 6b  b\nmake\tcl.nmak
f880: 65 22 29 0d 0a 54 43 4c 4e 4d 41 4b 45 43 4f 4e  e")..TCLNMAKECON
f890: 46 49 47 20 3d 20 22 24 28 5f 54 43 4c 44 49 52  FIG = "$(_TCLDIR
f8a0: 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c 74 63 6c 2e  )\lib\nmake\tcl.
f8b0: 6e 6d 61 6b 65 22 0d 0a 21 65 6e 64 69 66 0d 0a  nmake"..!endif..
f8c0: 21 65 6c 73 65 20 23 20 21 24 28 54 43 4c 49 4e  !else # !$(TCLIN
f8d0: 53 54 41 4c 4c 29 20 2d 20 62 75 69 6c 64 69 6e  STALL) - buildin
f8e0: 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 73 6f  g against Tcl so
f8f0: 75 72 63 65 0d 0a 21 69 66 20 65 78 69 73 74 28  urce..!if exist(
f900: 22 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c  "$(_TCLDIR)\win\
f910: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74  $(BUILDDIRTOP)\t
f920: 63 6c 2e 6e 6d 61 6b 65 22 29 0d 0a 54 43 4c 4e  cl.nmake")..TCLN
f930: 4d 41 4b 45 43 4f 4e 46 49 47 09 3d 20 22 24 28  MAKECONFIG.= "$(
f940: 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42  _TCLDIR)\win\$(B
f950: 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 2e  UILDDIRTOP)\tcl.
f960: 6e 6d 61 6b 65 22 0d 0a 21 65 6e 64 69 66 0d 0a  nmake"..!endif..
f970: 21 65 6e 64 69 66 20 23 20 54 43 4c 49 4e 53 54  !endif # TCLINST
f980: 41 4c 4c 0d 0a 0d 0a 21 69 66 20 24 28 43 4f 4e  ALL....!if $(CON
f990: 46 49 47 5f 43 48 45 43 4b 29 0d 0a 21 69 66 64  FIG_CHECK)..!ifd
f9a0: 65 66 20 54 43 4c 4e 4d 41 4b 45 43 4f 4e 46 49  ef TCLNMAKECONFI
f9b0: 47 0d 0a 21 69 6e 63 6c 75 64 65 20 24 28 54 43  G..!include $(TC
f9c0: 4c 4e 4d 41 4b 45 43 4f 4e 46 49 47 29 0d 0a 0d  LNMAKECONFIG)...
f9d0: 0a 21 69 66 20 64 65 66 69 6e 65 64 28 43 4f 52  .!if defined(COR
f9e0: 45 5f 4d 41 43 48 49 4e 45 29 20 26 26 20 22 24  E_MACHINE) && "$
f9f0: 28 43 4f 52 45 5f 4d 41 43 48 49 4e 45 29 22 20  (CORE_MACHINE)" 
fa00: 21 3d 20 22 24 28 4d 41 43 48 49 4e 45 29 22 0d  != "$(MACHINE)".
fa10: 0a 21 65 72 72 6f 72 20 45 52 52 4f 52 3a 20 42  .!error ERROR: B
fa20: 75 69 6c 64 20 74 61 72 67 65 74 20 28 24 28 4d  uild target ($(M
fa30: 41 43 48 49 4e 45 29 29 20 64 6f 65 73 20 6e 6f  ACHINE)) does no
fa40: 74 20 6d 61 74 63 68 20 74 68 65 20 54 63 6c 20  t match the Tcl 
fa50: 6c 69 62 72 61 72 79 20 61 72 63 68 69 74 65 63  library architec
fa60: 74 75 72 65 20 28 24 28 43 4f 52 45 5f 4d 41 43  ture ($(CORE_MAC
fa70: 48 49 4e 45 29 29 2e 0d 0a 21 65 6e 64 69 66 0d  HINE))...!endif.
fa80: 0a 21 69 66 20 24 28 54 43 4c 5f 56 45 52 53 49  .!if $(TCL_VERSI
fa90: 4f 4e 29 20 3c 20 38 37 20 26 26 20 64 65 66 69  ON) < 87 && defi
faa0: 6e 65 64 28 43 4f 52 45 5f 55 53 45 5f 54 48 52  ned(CORE_USE_THR
fab0: 45 41 44 5f 41 4c 4c 4f 43 29 20 26 26 20 24 28  EAD_ALLOC) && $(
fac0: 43 4f 52 45 5f 55 53 45 5f 54 48 52 45 41 44 5f  CORE_USE_THREAD_
fad0: 41 4c 4c 4f 43 29 20 21 3d 20 24 28 55 53 45 5f  ALLOC) != $(USE_
fae0: 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 0d 0a 21  THREAD_ALLOC)..!
faf0: 6d 65 73 73 61 67 65 20 57 41 52 4e 49 4e 47 3a  message WARNING:
fb00: 20 56 61 6c 75 65 20 6f 66 20 55 53 45 5f 54 48   Value of USE_TH
fb10: 52 45 41 44 5f 41 4c 4c 4f 43 20 28 24 28 55 53  READ_ALLOC ($(US
fb20: 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 29  E_THREAD_ALLOC))
fb30: 20 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20   does not match 
fb40: 69 74 73 20 54 63 6c 20 63 6f 72 65 20 76 61 6c  its Tcl core val
fb50: 75 65 20 28 24 28 43 4f 52 45 5f 55 53 45 5f 54  ue ($(CORE_USE_T
fb60: 48 52 45 41 44 5f 41 4c 4c 4f 43 29 29 2e 0d 0a  HREAD_ALLOC))...
fb70: 21 65 6e 64 69 66 0d 0a 21 69 66 20 64 65 66 69  !endif..!if defi
fb80: 6e 65 64 28 43 4f 52 45 5f 44 45 42 55 47 29 20  ned(CORE_DEBUG) 
fb90: 26 26 20 24 28 43 4f 52 45 5f 44 45 42 55 47 29  && $(CORE_DEBUG)
fba0: 20 21 3d 20 24 28 44 45 42 55 47 29 0d 0a 21 6d   != $(DEBUG)..!m
fbb0: 65 73 73 61 67 65 20 57 41 52 4e 49 4e 47 3a 20  essage WARNING: 
fbc0: 56 61 6c 75 65 20 6f 66 20 44 45 42 55 47 20 28  Value of DEBUG (
fbd0: 24 28 44 45 42 55 47 29 29 20 64 6f 65 73 20 6e  $(DEBUG)) does n
fbe0: 6f 74 20 6d 61 74 63 68 20 69 74 73 20 54 63 6c  ot match its Tcl
fbf0: 20 6c 69 62 72 61 72 79 20 63 6f 6e 66 69 67 75   library configu
fc00: 72 61 74 69 6f 6e 20 28 24 28 44 45 42 55 47 29  ration ($(DEBUG)
fc10: 29 2e 0d 0a 21 65 6e 64 69 66 0d 0a 21 65 6e 64  )...!endif..!end
fc20: 69 66 0d 0a 0d 0a 21 65 6e 64 69 66 20 23 20 54  if....!endif # T
fc30: 43 4c 4e 4d 41 4b 45 43 4f 4e 46 49 47 0d 0a 0d  CLNMAKECONFIG...
fc40: 0a 21 65 6e 64 69 66 20 23 20 21 24 28 44 4f 49  .!endif # !$(DOI
fc50: 4e 47 5f 54 43 4c 29 0d 0a 0d 0a 0d 0a 23 2d 2d  NG_TCL)......#--
fc60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
fc70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
fc80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
fc90: 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 23 20 44 69 73 70  --------..# Disp
fca0: 6c 61 79 20 73 74 61 74 73 20 62 65 69 6e 67 20  lay stats being 
fcb0: 75 73 65 64 2e 0d 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  used...#--------
fcc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
fcd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
fce0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
fcf0: 2d 2d 0d 0a 0d 0a 21 69 66 20 24 28 56 45 52 42  --....!if $(VERB
fd00: 4f 53 45 29 0d 0a 21 69 66 20 21 24 28 44 4f 49  OSE)..!if !$(DOI
fd10: 4e 47 5f 54 43 4c 29 0d 0a 21 6d 65 73 73 61 67  NG_TCL)..!messag
fd20: 65 20 2a 2a 2a 20 42 75 69 6c 64 69 6e 67 20 61  e *** Building a
fd30: 67 61 69 6e 73 74 20 54 63 6c 20 61 74 20 27 24  gainst Tcl at '$
fd40: 28 5f 54 43 4c 44 49 52 29 27 0d 0a 21 65 6e 64  (_TCLDIR)'..!end
fd50: 69 66 0d 0a 21 69 66 20 21 24 28 44 4f 49 4e 47  if..!if !$(DOING
fd60: 5f 54 4b 29 20 26 26 20 24 28 4e 45 45 44 5f 54  _TK) && $(NEED_T
fd70: 4b 29 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  K)..!message ***
fd80: 20 42 75 69 6c 64 69 6e 67 20 61 67 61 69 6e 73   Building agains
fd90: 74 20 54 6b 20 61 74 20 27 24 28 5f 54 4b 44 49  t Tk at '$(_TKDI
fda0: 52 29 27 0d 0a 21 65 6e 64 69 66 0d 0a 21 6d 65  R)'..!endif..!me
fdb0: 73 73 61 67 65 20 2a 2a 2a 20 49 6e 74 65 72 6d  ssage *** Interm
fdc0: 65 64 69 61 74 65 20 64 69 72 65 63 74 6f 72 79  ediate directory
fdd0: 20 77 69 6c 6c 20 62 65 20 27 24 28 54 4d 50 5f   will be '$(TMP_
fde0: 44 49 52 29 27 0d 0a 21 6d 65 73 73 61 67 65 20  DIR)'..!message 
fdf0: 2a 2a 2a 20 4f 75 74 70 75 74 20 64 69 72 65 63  *** Output direc
fe00: 74 6f 72 79 20 77 69 6c 6c 20 62 65 20 27 24 28  tory will be '$(
fe10: 4f 55 54 5f 44 49 52 29 27 0d 0a 21 6d 65 73 73  OUT_DIR)'..!mess
fe20: 61 67 65 20 2a 2a 2a 20 49 6e 73 74 61 6c 6c 61  age *** Installa
fe30: 74 69 6f 6e 2c 20 69 66 20 73 65 6c 65 63 74 65  tion, if selecte
fe40: 64 2c 20 77 69 6c 6c 20 62 65 20 69 6e 20 27 24  d, will be in '$
fe50: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 27 0d 0a  (_INSTALLDIR)'..
fe60: 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 53 75 66  !message *** Suf
fe70: 66 69 78 20 66 6f 72 20 62 69 6e 61 72 69 65 73  fix for binaries
fe80: 20 77 69 6c 6c 20 62 65 20 27 24 28 53 55 46 58   will be '$(SUFX
fe90: 29 27 0d 0a 21 6d 65 73 73 61 67 65 20 2a 2a 2a  )'..!message ***
fea0: 20 43 6f 6d 70 69 6c 65 72 20 76 65 72 73 69 6f   Compiler versio
feb0: 6e 20 24 28 56 43 56 45 52 29 2e 20 54 61 72 67  n $(VCVER). Targ
fec0: 65 74 20 24 28 4d 41 43 48 49 4e 45 29 2c 20 68  et $(MACHINE), h
fed0: 6f 73 74 20 24 28 4e 41 54 49 56 45 5f 41 52 43  ost $(NATIVE_ARC
fee0: 48 29 2e 0d 0a 21 65 6e 64 69 66 0d 0a 0d 0a 21  H)...!endif....!
fef0: 65 6e 64 69 66 20 23 20 69 66 64 65 66 20 5f 52  endif # ifdef _R
ff00: 55 4c 45 53 5f 56 43 0d 0a                       ULES_VC..