0000: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d #---------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 2d -------------- -
0040: 2a 2d 20 6d 61 6b 65 66 69 6c 65 20 2d 2a 2d 0a *- makefile -*-.
0050: 23 20 72 75 6c 65 73 2e 76 63 20 2d 2d 0a 23 0a # rules.vc --.#.
0060: 23 20 50 61 72 74 20 6f 66 20 74 68 65 20 6e 6d # Part of the nm
0070: 61 6b 65 20 62 61 73 65 64 20 62 75 69 6c 64 20 ake based build
0080: 73 79 73 74 65 6d 20 66 6f 72 20 54 63 6c 20 61 system for Tcl a
0090: 6e 64 20 69 74 73 20 65 78 74 65 6e 73 69 6f 6e nd its extension
00a0: 73 2e 0a 23 20 54 68 69 73 20 66 69 6c 65 20 64 s..# This file d
00b0: 6f 65 73 20 61 6c 6c 20 74 68 65 20 68 61 72 64 oes all the hard
00c0: 20 77 6f 72 6b 20 69 6e 20 74 65 72 6d 73 20 6f work in terms o
00d0: 66 20 70 61 72 73 69 6e 67 20 62 75 69 6c 64 20 f parsing build
00e0: 6f 70 74 69 6f 6e 73 2c 0a 23 20 63 6f 6d 70 69 options,.# compi
00f0: 6c 65 72 20 73 77 69 74 63 68 65 73 2c 20 64 65 ler switches, de
0100: 66 69 6e 69 6e 67 20 63 6f 6d 6d 6f 6e 20 74 61 fining common ta
0110: 72 67 65 74 73 20 61 6e 64 20 6d 61 63 72 6f 73 rgets and macros
0120: 2e 20 54 68 65 20 54 63 6c 20 6d 61 6b 65 66 69 . The Tcl makefi
0130: 6c 65 0a 23 20 64 69 72 65 63 74 6c 79 20 69 6e le.# directly in
0140: 63 6c 75 64 65 73 20 74 68 69 73 2e 20 45 78 74 cludes this. Ext
0150: 65 6e 73 69 6f 6e 73 20 69 6e 63 6c 75 64 65 20 ensions include
0160: 69 74 20 76 69 61 20 22 72 75 6c 65 73 2d 65 78 it via "rules-ex
0170: 74 2e 76 63 22 2e 0a 23 0a 23 20 53 65 65 20 54 t.vc"..#.# See T
0180: 49 50 20 34 37 37 20 28 68 74 74 70 73 3a 2f 2f IP 477 (https://
0190: 63 6f 72 65 2e 74 63 6c 2d 6c 61 6e 67 2e 6f 72 core.tcl-lang.or
01a0: 67 2f 74 69 70 73 2f 64 6f 63 2f 6d 61 69 6e 2f g/tips/doc/main/
01b0: 74 69 70 2f 34 37 37 2e 6d 64 29 20 66 6f 72 0a tip/477.md) for.
01c0: 23 20 64 65 74 61 69 6c 65 64 20 64 6f 63 75 6d # detailed docum
01d0: 65 6e 74 61 74 69 6f 6e 2e 0a 23 0a 23 20 53 65 entation..#.# Se
01e0: 65 20 74 68 65 20 66 69 6c 65 20 22 6c 69 63 65 e the file "lice
01f0: 6e 73 65 2e 74 65 72 6d 73 22 20 66 6f 72 20 69 nse.terms" for i
0200: 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 75 73 nformation on us
0210: 61 67 65 20 61 6e 64 20 72 65 64 69 73 74 72 69 age and redistri
0220: 62 75 74 69 6f 6e 0a 23 20 6f 66 20 74 68 69 73 bution.# of this
0230: 20 66 69 6c 65 2c 20 61 6e 64 20 66 6f 72 20 61 file, and for a
0240: 20 44 49 53 43 4c 41 49 4d 45 52 20 4f 46 20 41 DISCLAIMER OF A
0250: 4c 4c 20 57 41 52 52 41 4e 54 49 45 53 2e 0a 23 LL WARRANTIES..#
0260: 0a 23 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 .# Copyright (c)
0270: 20 32 30 30 31 2d 32 30 30 33 20 44 61 76 69 64 2001-2003 David
0280: 20 47 72 61 76 65 72 65 61 75 78 2e 0a 23 20 43 Gravereaux..# C
0290: 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 30 opyright (c) 200
02a0: 33 2d 32 30 30 38 20 50 61 74 72 69 63 6b 20 54 3-2008 Patrick T
02b0: 68 6f 79 74 73 0a 23 20 43 6f 70 79 72 69 67 68 hoyts.# Copyrigh
02c0: 74 20 28 63 29 20 32 30 31 37 20 20 20 20 20 20 t (c) 2017
02d0: 41 73 68 6f 6b 20 50 2e 20 4e 61 64 6b 61 72 6e Ashok P. Nadkarn
02e0: 69 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d i.#-------------
02f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0300: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0310: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0320: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0330: 2d 0a 0a 21 69 66 6e 64 65 66 20 5f 52 55 4c 45 -..!ifndef _RULE
0340: 53 5f 56 43 0a 5f 52 55 4c 45 53 5f 56 43 20 3d S_VC._RULES_VC =
0350: 20 31 0a 0a 23 20 57 65 20 6e 65 65 64 20 61 20 1..# We need a
0360: 6e 6d 61 6b 65 68 6c 70 20 74 68 61 74 20 77 69 nmakehlp that wi
0370: 6c 6c 20 72 75 6e 20 6f 6e 20 74 68 65 20 68 6f ll run on the ho
0380: 73 74 20 6d 61 63 68 69 6e 65 20 61 73 20 70 61 st machine as pa
0390: 72 74 20 6f 66 20 74 68 65 20 62 75 69 6c 64 2e rt of the build.
03a0: 0a 23 20 69 66 20 54 43 4c 53 48 5f 4e 41 54 49 .# if TCLSH_NATI
03b0: 56 45 20 69 73 20 73 65 74 20 66 6f 72 20 63 72 VE is set for cr
03c0: 6f 73 73 20 63 6f 6d 70 69 6c 61 74 69 6f 6e 2c oss compilation,
03d0: 20 77 65 27 6c 6c 20 74 72 79 20 74 6f 20 66 69 we'll try to fi
03e0: 6e 64 20 61 6e 20 61 73 73 6f 63 69 61 74 65 64 nd an associated
03f0: 0a 23 20 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 20 .# nmakehlp.exe
0400: 74 68 61 74 20 72 75 6e 73 20 6f 6e 20 74 68 65 that runs on the
0410: 20 62 75 69 6c 64 20 61 72 63 68 69 74 65 63 74 build architect
0420: 75 72 65 2e 0a 21 69 66 64 65 66 20 54 43 4c 53 ure..!ifdef TCLS
0430: 48 5f 4e 41 54 49 56 45 0a 21 6d 65 73 73 61 67 H_NATIVE.!messag
0440: 65 20 2a 2a 2a 20 55 73 69 6e 67 20 54 43 4c 53 e *** Using TCLS
0450: 48 5f 4e 41 54 49 56 45 3d 24 28 54 43 4c 53 48 H_NATIVE=$(TCLSH
0460: 5f 4e 41 54 49 56 45 29 0a 21 69 66 6e 64 65 66 _NATIVE).!ifndef
0470: 20 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 NMAKEHLP_NATIVE
0480: 0a 21 69 66 20 5b 24 28 54 43 4c 53 48 5f 4e 41 .!if [$(TCLSH_NA
0490: 54 49 56 45 29 20 66 69 6e 64 5f 6e 6d 61 6b 65 TIVE) find_nmake
04a0: 68 6c 70 2e 74 63 6c 20 24 28 54 43 4c 53 48 5f hlp.tcl $(TCLSH_
04b0: 4e 41 54 49 56 45 29 20 3e 20 66 69 6e 64 5f 6e NATIVE) > find_n
04c0: 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 makehlp.out].!er
04d0: 72 6f 72 20 54 43 4c 53 48 5f 4e 41 54 49 56 45 ror TCLSH_NATIVE
04e0: 20 69 73 20 73 65 74 2c 20 62 75 74 20 75 6e 61 is set, but una
04f0: 62 6c 65 20 74 6f 20 66 69 6e 64 20 61 73 73 6f ble to find asso
0500: 63 69 61 74 65 64 20 6e 6d 61 6b 65 68 6c 70 2e ciated nmakehlp.
0510: 65 78 65 20 6e 65 61 72 62 79 2e 0a 21 65 6c 73 exe nearby..!els
0520: 65 0a 21 69 6e 63 6c 75 64 65 20 66 69 6e 64 5f e.!include find_
0530: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0a 21 65 6e nmakehlp.out.!en
0540: 64 69 66 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 dif.!endif.!endi
0550: 66 0a 0a 21 69 66 6e 64 65 66 20 4e 4d 41 4b 45 f..!ifndef NMAKE
0560: 48 4c 50 5f 4e 41 54 49 56 45 0a 4e 4d 41 4b 45 HLP_NATIVE.NMAKE
0570: 48 4c 50 5f 4e 41 54 49 56 45 3d 6e 6d 61 6b 65 HLP_NATIVE=nmake
0580: 68 6c 70 0a 21 65 6e 64 69 66 0a 0a 23 20 54 68 hlp.!endif..# Th
0590: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 e following macr
05a0: 6f 73 20 64 65 66 69 6e 65 20 74 68 65 20 76 65 os define the ve
05b0: 72 73 69 6f 6e 20 6f 66 20 74 68 65 20 72 75 6c rsion of the rul
05c0: 65 73 2e 76 63 20 6e 6d 61 6b 65 20 62 75 69 6c es.vc nmake buil
05d0: 64 20 73 79 73 74 65 6d 0a 23 20 46 6f 72 20 6d d system.# For m
05e0: 6f 64 69 66 69 63 61 74 69 6f 6e 73 20 74 68 61 odifications tha
05f0: 74 20 61 72 65 20 6e 6f 74 20 62 61 63 6b 77 61 t are not backwa
0600: 72 64 2d 63 6f 6d 70 61 74 69 62 6c 65 2c 20 79 rd-compatible, y
0610: 6f 75 20 2a 6d 75 73 74 2a 20 63 68 61 6e 67 65 ou *must* change
0620: 0a 23 20 74 68 65 20 6d 61 6a 6f 72 20 76 65 72 .# the major ver
0630: 73 69 6f 6e 2e 0a 52 55 4c 45 53 5f 56 45 52 53 sion..RULES_VERS
0640: 49 4f 4e 5f 4d 41 4a 4f 52 20 3d 20 31 0a 52 55 ION_MAJOR = 1.RU
0650: 4c 45 53 5f 56 45 52 53 49 4f 4e 5f 4d 49 4e 4f LES_VERSION_MINO
0660: 52 20 3d 20 31 39 0a 0a 23 20 54 68 65 20 50 52 R = 19..# The PR
0670: 4f 4a 45 43 54 20 6d 61 63 72 6f 20 6d 75 73 74 OJECT macro must
0680: 20 62 65 20 64 65 66 69 6e 65 64 20 62 79 20 70 be defined by p
0690: 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 2e 0a arent makefile..
06a0: 21 69 66 20 22 24 28 50 52 4f 4a 45 43 54 29 22 !if "$(PROJECT)"
06b0: 20 3d 3d 20 22 22 0a 21 65 72 72 6f 72 20 2a 2a == "".!error **
06c0: 2a 20 45 72 72 6f 72 3a 20 4d 61 63 72 6f 20 50 * Error: Macro P
06d0: 52 4f 4a 45 43 54 20 6e 6f 74 20 64 65 66 69 6e ROJECT not defin
06e0: 65 64 21 20 50 6c 65 61 73 65 20 64 65 66 69 6e ed! Please defin
06f0: 65 20 69 74 20 62 65 66 6f 72 65 20 69 6e 63 6c e it before incl
0700: 75 64 69 6e 67 20 72 75 6c 65 73 2e 76 63 0a 21 uding rules.vc.!
0710: 65 6e 64 69 66 0a 0a 21 69 66 20 22 24 28 50 52 endif..!if "$(PR
0720: 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d J_PACKAGE_TCLNAM
0730: 45 29 22 20 3d 3d 20 22 22 0a 50 52 4a 5f 50 41 E)" == "".PRJ_PA
0740: 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 20 3d 20 CKAGE_TCLNAME =
0750: 24 28 50 52 4f 4a 45 43 54 29 0a 21 65 6e 64 69 $(PROJECT).!endi
0760: 66 0a 0a 23 20 41 6c 73 6f 20 73 70 65 63 69 61 f..# Also specia
0770: 6c 20 63 61 73 65 20 54 63 6c 20 61 6e 64 20 54 l case Tcl and T
0780: 6b 20 74 6f 20 73 61 76 65 20 73 6f 6d 65 20 74 k to save some t
0790: 79 70 69 6e 67 20 6c 61 74 65 72 0a 44 4f 49 4e yping later.DOIN
07a0: 47 5f 54 43 4c 20 3d 20 30 0a 44 4f 49 4e 47 5f G_TCL = 0.DOING_
07b0: 54 4b 20 20 3d 20 30 0a 21 69 66 20 22 24 28 50 TK = 0.!if "$(P
07c0: 52 4f 4a 45 43 54 29 22 20 3d 3d 20 22 74 63 6c ROJECT)" == "tcl
07d0: 22 0a 44 4f 49 4e 47 5f 54 43 4c 20 3d 20 31 0a ".DOING_TCL = 1.
07e0: 21 65 6c 73 65 69 66 20 22 24 28 50 52 4f 4a 45 !elseif "$(PROJE
07f0: 43 54 29 22 20 3d 3d 20 22 74 6b 22 0a 44 4f 49 CT)" == "tk".DOI
0800: 4e 47 5f 54 4b 20 3d 20 31 0a 21 65 6e 64 69 66 NG_TK = 1.!endif
0810: 0a 0a 21 69 66 6e 64 65 66 20 4e 45 45 44 5f 54 ..!ifndef NEED_T
0820: 4b 0a 23 20 42 61 63 6b 77 61 72 64 73 20 63 6f K.# Backwards co
0830: 6d 70 61 74 69 62 69 6c 69 74 79 0a 21 69 66 64 mpatibility.!ifd
0840: 65 66 20 50 52 4f 4a 45 43 54 5f 52 45 51 55 49 ef PROJECT_REQUI
0850: 52 45 53 5f 54 4b 0a 4e 45 45 44 5f 54 4b 20 3d RES_TK.NEED_TK =
0860: 20 24 28 50 52 4f 4a 45 43 54 5f 52 45 51 55 49 $(PROJECT_REQUI
0870: 52 45 53 5f 54 4b 29 0a 21 65 6c 73 65 0a 4e 45 RES_TK).!else.NE
0880: 45 44 5f 54 4b 20 3d 20 30 0a 21 65 6e 64 69 66 ED_TK = 0.!endif
0890: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 6e 64 65 66 .!endif..!ifndef
08a0: 20 4e 45 45 44 5f 54 43 4c 5f 53 4f 55 52 43 45 NEED_TCL_SOURCE
08b0: 0a 4e 45 45 44 5f 54 43 4c 5f 53 4f 55 52 43 45 .NEED_TCL_SOURCE
08c0: 20 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 = 0.!endif..!if
08d0: 64 65 66 20 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 def NEED_TK_SOUR
08e0: 43 45 0a 21 69 66 20 24 28 4e 45 45 44 5f 54 4b CE.!if $(NEED_TK
08f0: 5f 53 4f 55 52 43 45 29 0a 4e 45 45 44 5f 54 4b _SOURCE).NEED_TK
0900: 20 3d 20 31 0a 21 65 6e 64 69 66 0a 21 65 6c 73 = 1.!endif.!els
0910: 65 0a 4e 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 e.NEED_TK_SOURCE
0920: 20 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 23 23 23 = 0.!endif..###
0930: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0940: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0950: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0960: 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 #############.#
0970: 4e 6d 61 6b 65 20 69 73 20 61 20 70 72 65 74 74 Nmake is a prett
0980: 79 20 77 65 61 6b 20 65 6e 76 69 72 6f 6e 6d 65 y weak environme
0990: 6e 74 20 69 6e 20 73 79 6e 74 61 78 20 61 6e 64 nt in syntax and
09a0: 20 63 61 70 61 62 69 6c 69 74 69 65 73 0a 23 20 capabilities.#
09b0: 73 6f 20 74 68 69 73 20 66 69 6c 65 20 69 73 20 so this file is
09c0: 6e 65 63 65 73 73 61 72 69 6c 79 20 76 65 72 62 necessarily verb
09d0: 6f 73 65 2e 20 49 74 27 73 20 62 72 6f 6b 65 6e ose. It's broken
09e0: 20 64 6f 77 6e 20 69 6e 74 6f 0a 23 20 74 68 65 down into.# the
09f0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 70 61 72 74 73 following parts
0a00: 2e 0a 23 0a 23 20 30 2e 20 53 61 6e 69 74 79 20 ..#.# 0. Sanity
0a10: 63 68 65 63 6b 20 74 68 61 74 20 63 6f 6d 70 69 check that compi
0a20: 6c 65 72 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 ler environment
0a30: 69 73 20 73 65 74 20 75 70 20 61 6e 64 20 69 6e is set up and in
0a40: 69 74 69 61 6c 69 7a 65 0a 23 20 20 20 20 61 6e itialize.# an
0a50: 79 20 62 75 69 6c 74 2d 69 6e 20 73 65 74 74 69 y built-in setti
0a60: 6e 67 73 20 66 72 6f 6d 20 74 68 65 20 70 61 72 ngs from the par
0a70: 65 6e 74 20 6d 61 6b 65 66 69 6c 65 0a 23 20 31 ent makefile.# 1
0a80: 2e 20 46 69 72 73 74 20 64 65 66 69 6e 65 20 74 . First define t
0a90: 68 65 20 65 78 74 65 72 6e 61 6c 20 74 6f 6f 6c he external tool
0aa0: 73 20 75 73 65 64 20 66 6f 72 20 63 6f 6d 70 69 s used for compi
0ab0: 6c 69 6e 67 2c 20 63 6f 70 79 69 6e 67 20 65 74 ling, copying et
0ac0: 63 2e 0a 23 20 20 20 20 61 73 20 74 68 69 73 20 c..# as this
0ad0: 69 73 20 69 6e 64 65 70 65 6e 64 65 6e 74 20 6f is independent o
0ae0: 66 20 65 76 65 72 79 74 68 69 6e 67 20 65 6c 73 f everything els
0af0: 65 2e 0a 23 20 32 2e 20 46 69 67 75 72 65 20 6f e..# 2. Figure o
0b00: 75 74 20 6f 75 72 20 62 75 69 6c 64 20 73 74 72 ut our build str
0b10: 75 63 74 75 72 65 20 69 6e 20 74 65 72 6d 73 20 ucture in terms
0b20: 6f 66 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 of the directory
0b30: 2c 20 77 68 65 74 68 65 72 0a 23 20 20 20 20 77 , whether.# w
0b40: 65 20 61 72 65 20 62 75 69 6c 64 69 6e 67 20 54 e are building T
0b50: 63 6c 20 6f 72 20 61 6e 20 65 78 74 65 6e 73 69 cl or an extensi
0b60: 6f 6e 2c 20 65 74 63 2e 0a 23 20 33 2e 20 44 65 on, etc..# 3. De
0b70: 74 65 72 6d 69 6e 65 20 74 68 65 20 63 6f 6d 70 termine the comp
0b80: 69 6c 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72 20 iler and linker
0b90: 76 65 72 73 69 6f 6e 73 0a 23 20 34 2e 20 42 75 versions.# 4. Bu
0ba0: 69 6c 64 20 74 68 65 20 6e 6d 61 6b 65 68 6c 70 ild the nmakehlp
0bb0: 20 68 65 6c 70 65 72 20 61 70 70 6c 69 63 61 74 helper applicat
0bc0: 69 6f 6e 0a 23 20 35 2e 20 44 65 74 65 72 6d 69 ion.# 5. Determi
0bd0: 6e 65 20 74 68 65 20 73 75 70 70 6f 72 74 65 64 ne the supported
0be0: 20 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e compiler option
0bf0: 73 20 61 6e 64 20 66 65 61 74 75 72 65 73 0a 23 s and features.#
0c00: 20 36 2e 20 45 78 74 72 61 63 74 20 54 63 6c 2c 6. Extract Tcl,
0c10: 20 54 6b 2c 20 61 6e 64 20 70 6f 73 73 69 62 6c Tk, and possibl
0c20: 79 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 76 65 y extensions, ve
0c30: 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20 66 72 rsion numbers fr
0c40: 6f 6d 20 74 68 65 0a 23 20 20 20 20 68 65 61 64 om the.# head
0c50: 65 72 73 0a 23 20 37 2e 20 50 61 72 73 65 20 74 ers.# 7. Parse t
0c60: 68 65 20 4f 50 54 53 20 6d 61 63 72 6f 20 76 61 he OPTS macro va
0c70: 6c 75 65 20 66 6f 72 20 75 73 65 72 2d 73 70 65 lue for user-spe
0c80: 63 69 66 69 65 64 20 62 75 69 6c 64 20 63 6f 6e cified build con
0c90: 66 69 67 75 72 61 74 69 6f 6e 0a 23 20 38 2e 20 figuration.# 8.
0ca0: 50 61 72 73 65 20 74 68 65 20 53 54 41 54 53 20 Parse the STATS
0cb0: 6d 61 63 72 6f 20 76 61 6c 75 65 20 66 6f 72 20 macro value for
0cc0: 73 74 61 74 69 73 74 69 63 73 20 69 6e 73 74 72 statistics instr
0cd0: 75 6d 65 6e 74 61 74 69 6f 6e 0a 23 20 39 2e 20 umentation.# 9.
0ce0: 50 61 72 73 65 20 74 68 65 20 43 48 45 43 4b 53 Parse the CHECKS
0cf0: 20 6d 61 63 72 6f 20 66 6f 72 20 61 64 64 69 74 macro for addit
0d00: 69 6f 6e 61 6c 20 63 6f 6d 70 69 6c 61 74 69 6f ional compilatio
0d10: 6e 20 63 68 65 63 6b 73 0a 23 20 31 30 2e 20 42 n checks.# 10. B
0d20: 61 73 65 64 20 6f 6e 20 74 68 69 73 20 73 65 6c ased on this sel
0d30: 65 63 74 65 64 20 63 6f 6e 66 69 67 75 72 61 74 ected configurat
0d40: 69 6f 6e 2c 20 63 6f 6e 73 74 72 75 63 74 20 74 ion, construct t
0d50: 68 65 20 6f 75 74 70 75 74 0a 23 20 20 20 20 20 he output.#
0d60: 64 69 72 65 63 74 6f 72 79 20 61 6e 64 20 66 69 directory and fi
0d70: 6c 65 20 70 61 74 68 73 0a 23 20 31 31 2e 20 43 le paths.# 11. C
0d80: 6f 6e 73 74 72 75 63 74 20 74 68 65 20 70 61 74 onstruct the pat
0d90: 68 73 20 77 68 65 72 65 20 74 68 65 20 70 61 63 hs where the pac
0da0: 6b 61 67 65 20 69 73 20 74 6f 20 62 65 20 69 6e kage is to be in
0db0: 73 74 61 6c 6c 65 64 0a 23 20 31 32 2e 20 53 65 stalled.# 12. Se
0dc0: 74 20 75 70 20 74 68 65 20 61 63 74 75 61 6c 20 t up the actual
0dd0: 6f 70 74 69 6f 6e 73 20 70 61 73 73 65 64 20 74 options passed t
0de0: 6f 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64 20 6c o compiler and l
0df0: 69 6e 6b 65 72 20 62 61 73 65 64 0a 23 20 20 20 inker based.#
0e00: 20 20 6f 6e 20 74 68 65 20 69 6e 66 6f 72 6d 61 on the informa
0e10: 74 69 6f 6e 20 67 61 74 68 65 72 65 64 20 61 62 tion gathered ab
0e20: 6f 76 65 2e 0a 23 20 31 33 2e 20 44 65 66 69 6e ove..# 13. Defin
0e30: 65 20 73 6f 6d 65 20 73 74 61 6e 64 61 72 64 20 e some standard
0e40: 62 75 69 6c 64 20 74 61 72 67 65 74 73 20 61 6e build targets an
0e50: 64 20 69 6d 70 6c 69 63 69 74 20 72 75 6c 65 73 d implicit rules
0e60: 2e 20 54 68 65 73 65 20 6d 61 79 0a 23 20 20 20 . These may.#
0e70: 20 20 62 65 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 be optionally
0e80: 64 69 73 61 62 6c 65 64 20 62 79 20 74 68 65 20 disabled by the
0e90: 70 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 2e parent makefile.
0ea0: 0a 23 20 31 34 2e 20 28 46 6f 72 20 65 78 74 65 .# 14. (For exte
0eb0: 6e 73 69 6f 6e 73 20 6f 6e 6c 79 2e 29 20 43 6f nsions only.) Co
0ec0: 6d 70 61 72 65 20 74 68 65 20 63 6f 6e 66 69 67 mpare the config
0ed0: 75 72 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 74 uration of the t
0ee0: 61 72 67 65 74 0a 23 20 20 20 20 20 54 63 6c 20 arget.# Tcl
0ef0: 61 6e 64 20 74 68 65 20 65 78 74 65 6e 73 69 6f and the extensio
0f00: 6e 73 20 61 6e 64 20 77 61 72 6e 20 61 67 61 69 ns and warn agai
0f10: 6e 73 74 20 64 69 73 63 72 65 70 61 6e 63 69 65 nst discrepancie
0f20: 73 2e 0a 23 0a 23 20 4f 6e 65 20 66 69 6e 61 6c s..#.# One final
0f30: 20 6e 6f 74 65 20 61 62 6f 75 74 20 74 68 65 20 note about the
0f40: 6d 61 63 72 6f 20 6e 61 6d 65 73 20 75 73 65 64 macro names used
0f50: 2e 20 54 68 65 79 20 61 72 65 20 61 73 20 74 68 . They are as th
0f60: 65 79 20 61 72 65 0a 23 20 66 6f 72 20 68 69 73 ey are.# for his
0f70: 74 6f 72 69 63 61 6c 20 72 65 61 73 6f 6e 73 2e torical reasons.
0f80: 20 57 65 20 77 6f 75 6c 64 20 6c 69 6b 65 20 6c We would like l
0f90: 65 67 61 63 79 20 65 78 74 65 6e 73 69 6f 6e 73 egacy extensions
0fa0: 20 74 6f 0a 23 20 63 6f 6e 74 69 6e 75 65 20 74 to.# continue t
0fb0: 6f 20 77 6f 72 6b 20 77 69 74 68 20 74 68 69 73 o work with this
0fc0: 20 6d 61 6b 65 20 69 6e 63 6c 75 64 65 20 66 69 make include fi
0fd0: 6c 65 20 73 6f 20 62 65 20 77 61 72 79 20 6f 66 le so be wary of
0fe0: 0a 23 20 63 68 61 6e 67 69 6e 67 20 74 68 65 6d .# changing them
0ff0: 20 66 6f 72 20 63 6f 6e 73 69 73 74 65 6e 63 79 for consistency
1000: 20 6f 72 20 63 6c 61 72 69 74 79 2e 0a 0a 23 20 or clarity...#
1010: 30 2e 20 53 61 6e 69 74 79 20 63 68 65 63 6b 20 0. Sanity check
1020: 63 6f 6d 70 69 6c 65 72 20 65 6e 76 69 72 6f 6e compiler environ
1030: 6d 65 6e 74 0a 0a 23 20 43 68 65 63 6b 20 74 6f ment..# Check to
1040: 20 73 65 65 20 77 65 20 61 72 65 20 63 6f 6e 66 see we are conf
1050: 69 67 75 72 65 64 20 74 6f 20 62 75 69 6c 64 20 igured to build
1060: 77 69 74 68 20 4d 53 56 43 20 28 4d 53 44 45 56 with MSVC (MSDEV
1070: 44 49 52 2c 20 4d 53 56 43 44 49 52 20 6f 72 0a DIR, MSVCDIR or.
1080: 23 20 56 43 49 4e 53 54 41 4c 4c 44 49 52 29 20 # VCINSTALLDIR)
1090: 6f 72 20 77 69 74 68 20 74 68 65 20 4d 53 20 50 or with the MS P
10a0: 6c 61 74 66 6f 72 6d 20 53 44 4b 20 28 4d 53 53 latform SDK (MSS
10b0: 44 4b 20 6f 72 20 57 69 6e 64 6f 77 73 53 44 4b DK or WindowsSDK
10c0: 44 69 72 29 0a 0a 21 69 66 20 21 64 65 66 69 6e Dir)..!if !defin
10d0: 65 64 28 4d 53 44 45 56 44 49 52 29 20 26 26 20 ed(MSDEVDIR) &&
10e0: 21 64 65 66 69 6e 65 64 28 4d 53 56 43 44 49 52 !defined(MSVCDIR
10f0: 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 56 43 ) && !defined(VC
1100: 49 4e 53 54 41 4c 4c 44 49 52 29 20 26 26 20 21 INSTALLDIR) && !
1110: 64 65 66 69 6e 65 64 28 4d 53 53 44 4b 29 20 26 defined(MSSDK) &
1120: 26 20 21 64 65 66 69 6e 65 64 28 57 49 4e 44 4f & !defined(WINDO
1130: 57 53 53 44 4b 44 49 52 29 0a 4d 53 47 20 3d 20 WSSDKDIR).MSG =
1140: 5e 0a 56 69 73 75 61 6c 20 43 2b 2b 20 63 6f 6d ^.Visual C++ com
1150: 70 69 6c 65 72 20 65 6e 76 69 72 6f 6e 6d 65 6e piler environmen
1160: 74 20 6e 6f 74 20 69 6e 69 74 69 61 6c 69 7a 65 t not initialize
1170: 64 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53 47 29 d..!error $(MSG)
1180: 0a 21 65 6e 64 69 66 0a 0a 23 20 57 65 20 6e 65 .!endif..# We ne
1190: 65 64 20 74 6f 20 72 75 6e 20 66 72 6f 6d 20 74 ed to run from t
11a0: 68 65 20 64 69 72 65 63 74 6f 72 79 20 74 68 65 he directory the
11b0: 20 70 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 parent makefile
11c0: 20 69 73 20 6c 6f 63 61 74 65 64 20 69 6e 2e 0a is located in..
11d0: 23 20 6e 6d 61 6b 65 20 64 6f 65 73 20 6e 6f 74 # nmake does not
11e0: 20 74 65 6c 6c 20 75 73 20 77 68 61 74 20 6d 61 tell us what ma
11f0: 6b 65 66 69 6c 65 20 77 61 73 20 75 73 65 64 20 kefile was used
1200: 74 6f 20 69 6e 76 6f 6b 65 20 69 74 20 73 6f 20 to invoke it so
1210: 70 61 72 65 6e 74 0a 23 20 6d 61 6b 65 66 69 6c parent.# makefil
1220: 65 20 68 61 73 20 74 6f 20 73 65 74 20 74 68 65 e has to set the
1230: 20 4d 41 4b 45 46 49 4c 45 56 43 20 6d 61 63 72 MAKEFILEVC macr
1240: 6f 20 6f 72 20 77 65 20 6a 75 73 74 20 6d 61 6b o or we just mak
1250: 65 20 61 20 67 75 65 73 73 20 61 6e 64 0a 23 20 e a guess and.#
1260: 77 61 72 6e 20 69 66 20 77 65 20 74 68 69 6e 6b warn if we think
1270: 20 74 68 61 74 20 69 73 20 6e 6f 74 20 74 68 65 that is not the
1280: 20 63 61 73 65 2e 0a 21 69 66 20 22 24 28 4d 41 case..!if "$(MA
1290: 4b 45 46 49 4c 45 56 43 29 22 20 3d 3d 20 22 22 KEFILEVC)" == ""
12a0: 0a 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 50 ..!if exist("$(P
12b0: 52 4f 4a 45 43 54 29 2e 76 63 22 29 0a 4d 41 4b ROJECT).vc").MAK
12c0: 45 46 49 4c 45 56 43 20 3d 20 24 28 50 52 4f 4a EFILEVC = $(PROJ
12d0: 45 43 54 29 2e 76 63 0a 21 65 6c 73 65 69 66 20 ECT).vc.!elseif
12e0: 65 78 69 73 74 28 22 6d 61 6b 65 66 69 6c 65 2e exist("makefile.
12f0: 76 63 22 29 0a 4d 41 4b 45 46 49 4c 45 56 43 20 vc").MAKEFILEVC
1300: 3d 20 6d 61 6b 65 66 69 6c 65 2e 76 63 0a 21 65 = makefile.vc.!e
1310: 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20 22 24 ndif.!endif # "$
1320: 28 4d 41 4b 45 46 49 4c 45 56 43 29 22 20 3d 3d (MAKEFILEVC)" ==
1330: 20 22 22 0a 0a 21 69 66 20 21 65 78 69 73 74 28 ""..!if !exist(
1340: 22 24 28 4d 41 4b 45 46 49 4c 45 56 43 29 22 29 "$(MAKEFILEVC)")
1350: 0a 4d 53 47 20 3d 20 5e 0a 59 6f 75 20 6d 75 73 .MSG = ^.You mus
1360: 74 20 72 75 6e 20 6e 6d 61 6b 65 20 66 72 6f 6d t run nmake from
1370: 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 63 the directory c
1380: 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 70 72 ontaining the pr
1390: 6f 6a 65 63 74 20 6d 61 6b 65 66 69 6c 65 2e 5e oject makefile.^
13a0: 0a 49 66 20 79 6f 75 20 61 72 65 20 64 6f 69 6e .If you are doin
13b0: 67 20 74 68 61 74 20 61 6e 64 20 67 65 74 74 69 g that and getti
13c0: 6e 67 20 74 68 69 73 20 6d 65 73 73 61 67 65 2c ng this message,
13d0: 20 73 65 74 20 74 68 65 20 4d 41 4b 45 46 49 4c set the MAKEFIL
13e0: 45 56 43 5e 0a 6d 61 63 72 6f 20 74 6f 20 74 68 EVC^.macro to th
13f0: 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 70 72 e name of the pr
1400: 6f 6a 65 63 74 20 6d 61 6b 65 66 69 6c 65 2e 0a oject makefile..
1410: 21 6d 65 73 73 61 67 65 20 57 41 52 4e 49 4e 47 !message WARNING
1420: 3a 20 24 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a : $(MSG).!endif.
1430: 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ..##############
1440: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1450: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1460: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1470: 23 23 0a 23 20 31 2e 20 44 65 66 69 6e 65 20 65 ##.# 1. Define e
1480: 78 74 65 72 6e 61 6c 20 70 72 6f 67 72 61 6d 73 xternal programs
1490: 20 62 65 69 6e 67 20 75 73 65 64 0a 0a 23 2d 2d being used..#--
14a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
14b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
14c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
14d0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 65 74 20 74 --------.# Set t
14e0: 68 65 20 70 72 6f 70 65 72 20 63 6f 70 79 20 6d he proper copy m
14f0: 65 74 68 6f 64 20 74 6f 20 61 76 6f 69 64 20 6f ethod to avoid o
1500: 76 65 72 77 72 69 74 65 20 71 75 65 73 74 69 6f verwrite questio
1510: 6e 73 0a 23 20 74 6f 20 74 68 65 20 75 73 65 72 ns.# to the user
1520: 20 77 68 65 6e 20 63 6f 70 79 69 6e 67 20 66 69 when copying fi
1530: 6c 65 73 20 61 6e 64 20 73 65 6c 65 63 74 69 6e les and selectin
1540: 67 20 74 68 65 20 72 69 67 68 74 0a 23 20 22 64 g the right.# "d
1550: 65 6c 65 74 65 20 61 6c 6c 22 20 6d 65 74 68 6f elete all" metho
1560: 64 2e 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d d..#------------
1570: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
1580: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
1590: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 --------------.#
15a0: 20 54 63 6c 20 42 75 67 20 62 65 34 30 62 37 33 Tcl Bug be40b73
15b0: 36 3a 20 75 73 65 20 72 64 2f 6d 64 20 69 6e 73 6: use rd/md ins
15c0: 74 65 61 64 20 72 6d 64 69 72 2f 6d 6b 64 69 72 tead rmdir/mkdir
15d0: 2e 0a 23 20 4f 74 68 65 72 77 69 73 65 2c 20 61 ..# Otherwise, a
15e0: 6e 20 65 76 65 6e 74 75 61 6c 20 63 79 67 77 69 n eventual cygwi
15f0: 6e 20 76 65 72 73 69 6f 6e 20 77 69 74 68 20 64 n version with d
1600: 69 66 66 65 72 65 6e 74 0a 23 20 70 61 72 61 6d ifferent.# param
1610: 65 74 65 72 73 20 6d 61 79 20 62 65 20 75 73 65 eters may be use
1620: 64 2e 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d d..#------------
1630: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
1640: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
1650: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a --------------..
1660: 52 4d 44 49 52 09 3d 20 72 64 20 2f 53 20 2f 51 RMDIR.= rd /S /Q
1670: 0a 43 50 59 09 3d 20 78 63 6f 70 79 20 2f 69 20 .CPY.= xcopy /i
1680: 2f 79 20 3e 4e 55 4c 0a 43 50 59 44 49 52 20 20 /y >NUL.CPYDIR
1690: 3d 20 78 63 6f 70 79 20 2f 65 20 2f 69 20 2f 79 = xcopy /e /i /y
16a0: 20 3e 4e 55 4c 0a 43 4f 50 59 09 3d 20 63 6f 70 >NUL.COPY.= cop
16b0: 79 20 2f 79 20 3e 4e 55 4c 0a 4d 4b 44 49 52 20 y /y >NUL.MKDIR
16c0: 20 20 3d 20 6d 64 0a 45 43 48 4f 20 20 20 20 3d = md.ECHO =
16d0: 20 69 66 20 22 24 28 56 45 52 42 4f 53 45 29 22 if "$(VERBOSE)"
16e0: 20 3d 3d 20 22 31 22 20 65 63 68 6f 0a 0a 23 23 == "1" echo..##
16f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1700: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1710: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1720: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
1730: 23 23 23 23 0a 23 20 32 2e 20 46 69 67 75 72 65 ####.# 2. Figure
1740: 20 6f 75 74 20 6f 75 72 20 62 75 69 6c 64 20 65 out our build e
1750: 6e 76 69 72 6f 6e 6d 65 6e 74 20 69 6e 20 74 65 nvironment in te
1760: 72 6d 73 20 6f 66 20 77 68 61 74 20 77 65 27 72 rms of what we'r
1770: 65 20 62 75 69 6c 64 69 6e 67 2e 0a 23 0a 23 20 e building..#.#
1780: 28 61 29 20 54 63 6c 20 69 74 73 65 6c 66 0a 23 (a) Tcl itself.#
1790: 20 28 62 29 20 54 6b 0a 23 20 28 63 29 20 61 20 (b) Tk.# (c) a
17a0: 54 63 6c 20 65 78 74 65 6e 73 69 6f 6e 20 75 73 Tcl extension us
17b0: 69 6e 67 20 6c 69 62 72 61 72 69 65 73 2f 69 6e ing libraries/in
17c0: 63 6c 75 64 65 73 20 66 72 6f 6d 20 61 6e 20 2a cludes from an *
17d0: 69 6e 73 74 61 6c 6c 65 64 2a 20 54 63 6c 0a 23 installed* Tcl.#
17e0: 20 28 64 29 20 61 20 54 63 6c 20 65 78 74 65 6e (d) a Tcl exten
17f0: 73 69 6f 6e 20 75 73 69 6e 67 20 6c 69 62 72 61 sion using libra
1800: 72 69 65 73 2f 69 6e 63 6c 75 64 65 73 20 66 72 ries/includes fr
1810: 6f 6d 20 54 63 6c 20 73 6f 75 72 63 65 20 64 69 om Tcl source di
1820: 72 65 63 74 6f 72 79 0a 23 0a 23 20 54 68 69 73 rectory.#.# This
1830: 20 6c 61 73 74 20 69 73 20 6e 65 65 64 65 64 20 last is needed
1840: 62 65 63 61 75 73 65 20 73 6f 6d 65 20 65 78 74 because some ext
1850: 65 6e 73 69 6f 6e 73 20 73 74 69 6c 6c 20 6e 65 ensions still ne
1860: 65 64 0a 23 20 73 6f 6d 65 20 54 63 6c 20 69 6e ed.# some Tcl in
1870: 74 65 72 66 61 63 65 73 20 74 68 61 74 20 61 72 terfaces that ar
1880: 65 20 6e 6f 74 20 70 75 62 6c 69 63 6c 79 20 65 e not publicly e
1890: 78 70 6f 73 65 64 2e 0a 23 0a 23 20 54 68 65 20 xposed..#.# The
18a0: 66 72 61 67 6d 65 6e 74 20 77 69 6c 6c 20 73 65 fragment will se
18b0: 74 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 t the following
18c0: 6d 61 63 72 6f 73 3a 0a 23 20 52 4f 4f 54 20 2d macros:.# ROOT -
18d0: 20 72 6f 6f 74 20 6f 66 20 74 68 69 73 20 6d 6f root of this mo
18e0: 64 75 6c 65 20 73 6f 75 72 63 65 73 0a 23 20 43 dule sources.# C
18f0: 4f 4d 50 41 54 44 49 52 20 2d 20 73 6f 75 72 63 OMPATDIR - sourc
1900: 65 20 64 69 72 65 63 74 6f 72 79 20 74 68 61 74 e directory that
1910: 20 68 6f 6c 64 73 20 63 6f 6d 70 61 74 69 62 69 holds compatibi
1920: 6c 69 74 79 20 73 6f 75 72 63 65 73 0a 23 20 44 lity sources.# D
1930: 4f 43 44 49 52 20 2d 20 73 6f 75 72 63 65 20 64 OCDIR - source d
1940: 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e irectory contain
1950: 69 6e 67 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f ing documentatio
1960: 6e 20 66 69 6c 65 73 0a 23 20 47 45 4e 45 52 49 n files.# GENERI
1970: 43 44 49 52 20 2d 20 70 6c 61 74 66 6f 72 6d 2d CDIR - platform-
1980: 69 6e 64 65 70 65 6e 64 65 6e 74 20 73 6f 75 72 independent sour
1990: 63 65 20 64 69 72 65 63 74 6f 72 79 0a 23 20 57 ce directory.# W
19a0: 49 4e 5f 44 49 52 20 2d 20 57 69 6e 64 6f 77 73 IN_DIR - Windows
19b0: 2d 73 70 65 63 69 66 69 63 20 73 6f 75 72 63 65 -specific source
19c0: 20 64 69 72 65 63 74 6f 72 79 0a 23 20 54 45 53 directory.# TES
19d0: 54 44 49 52 20 2d 20 64 69 72 65 63 74 6f 72 79 TDIR - directory
19e0: 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 65 73 74 containing test
19f0: 20 66 69 6c 65 73 0a 23 20 54 4f 4f 4c 53 44 49 files.# TOOLSDI
1a00: 52 20 2d 20 64 69 72 65 63 74 6f 72 79 20 63 6f R - directory co
1a10: 6e 74 61 69 6e 69 6e 67 20 62 75 69 6c 64 20 74 ntaining build t
1a20: 6f 6f 6c 73 0a 23 20 5f 54 43 4c 44 49 52 20 2d ools.# _TCLDIR -
1a30: 20 72 6f 6f 74 20 6f 66 20 74 68 65 20 54 63 6c root of the Tcl
1a40: 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 4f 52 installation OR
1a50: 20 74 68 65 20 54 63 6c 20 73 6f 75 72 63 65 73 the Tcl sources
1a60: 2e 20 4e 6f 74 20 73 65 74 0a 23 20 20 20 20 77 . Not set.# w
1a70: 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 54 63 6c hen building Tcl
1a80: 20 69 74 73 65 6c 66 2e 0a 23 20 5f 49 4e 53 54 itself..# _INST
1a90: 41 4c 4c 44 49 52 20 2d 20 6e 61 74 69 76 65 20 ALLDIR - native
1aa0: 66 6f 72 6d 20 6f 66 20 74 68 65 20 69 6e 73 74 form of the inst
1ab0: 61 6c 6c 61 74 69 6f 6e 20 70 61 74 68 2e 20 46 allation path. F
1ac0: 6f 72 20 54 63 6c 0a 23 20 20 20 20 74 68 69 73 or Tcl.# this
1ad0: 20 77 69 6c 6c 20 62 65 20 74 68 65 20 72 6f 6f will be the roo
1ae0: 74 20 6f 66 20 74 68 65 20 54 63 6c 20 69 6e 73 t of the Tcl ins
1af0: 74 61 6c 6c 61 74 69 6f 6e 2e 20 46 6f 72 20 65 tallation. For e
1b00: 78 74 65 6e 73 69 6f 6e 73 0a 23 20 20 20 20 74 xtensions.# t
1b10: 68 69 73 20 77 69 6c 6c 20 62 65 20 74 68 65 20 his will be the
1b20: 6c 69 62 20 64 69 72 65 63 74 6f 72 79 20 75 6e lib directory un
1b30: 64 65 72 20 74 68 65 20 72 6f 6f 74 2e 0a 23 20 der the root..#
1b40: 54 43 4c 49 4e 53 54 41 4c 4c 20 20 2d 20 73 65 TCLINSTALL - se
1b50: 74 20 74 6f 20 31 20 69 66 20 5f 54 43 4c 44 49 t to 1 if _TCLDI
1b60: 52 20 72 65 66 65 72 73 20 74 6f 0a 23 20 20 20 R refers to.#
1b70: 20 68 65 61 64 65 72 73 20 61 6e 64 20 6c 69 62 headers and lib
1b80: 72 61 72 69 65 73 20 66 72 6f 6d 20 61 6e 20 69 raries from an i
1b90: 6e 73 74 61 6c 6c 65 64 20 54 63 6c 2c 20 61 6e nstalled Tcl, an
1ba0: 64 20 30 20 69 66 20 62 75 69 6c 74 20 61 67 61 d 0 if built aga
1bb0: 69 6e 73 74 0a 23 20 20 20 20 54 63 6c 20 73 6f inst.# Tcl so
1bc0: 75 72 63 65 73 2e 20 4e 6f 74 20 73 65 74 20 77 urces. Not set w
1bd0: 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 54 63 6c hen building Tcl
1be0: 20 69 74 73 65 6c 66 2e 20 59 65 73 2c 20 6e 6f itself. Yes, no
1bf0: 74 20 76 65 72 79 20 77 65 6c 6c 0a 23 20 20 20 t very well.#
1c00: 20 6e 61 6d 65 64 2e 0a 23 20 5f 54 43 4c 5f 48 named..# _TCL_H
1c10: 20 2d 20 6e 61 74 69 76 65 20 70 61 74 68 20 74 - native path t
1c20: 6f 20 74 68 65 20 74 63 6c 2e 68 20 66 69 6c 65 o the tcl.h file
1c30: 0a 23 0a 23 20 49 66 20 54 6b 20 69 73 20 69 6e .#.# If Tk is in
1c40: 76 6f 6c 76 65 64 2c 20 61 6c 73 6f 20 73 65 74 volved, also set
1c50: 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 0a s the following.
1c60: 23 20 5f 54 4b 44 49 52 20 2d 20 6e 61 74 69 76 # _TKDIR - nativ
1c70: 65 20 66 6f 72 6d 20 54 6b 20 69 6e 73 74 61 6c e form Tk instal
1c80: 6c 61 74 69 6f 6e 20 4f 52 20 54 6b 20 73 6f 75 lation OR Tk sou
1c90: 72 63 65 2e 20 4e 6f 74 20 73 65 74 20 69 66 20 rce. Not set if
1ca0: 62 75 69 6c 64 69 6e 67 0a 23 20 20 20 20 54 6b building.# Tk
1cb0: 20 69 74 73 65 6c 66 2e 0a 23 20 54 4b 49 4e 53 itself..# TKINS
1cc0: 54 41 4c 4c 20 2d 20 73 65 74 20 31 20 69 66 20 TALL - set 1 if
1cd0: 5f 54 4b 44 49 52 20 72 65 66 65 72 73 20 74 6f _TKDIR refers to
1ce0: 20 69 6e 73 74 61 6c 6c 65 64 20 54 6b 20 61 6e installed Tk an
1cf0: 64 20 30 20 69 66 20 54 6b 20 73 6f 75 72 63 65 d 0 if Tk source
1d00: 73 0a 23 20 5f 54 4b 5f 48 20 2d 20 6e 61 74 69 s.# _TK_H - nati
1d10: 76 65 20 70 61 74 68 20 74 6f 20 74 68 65 20 74 ve path to the t
1d20: 6b 2e 68 20 66 69 6c 65 0a 0a 23 20 52 6f 6f 74 k.h file..# Root
1d30: 20 64 69 72 65 63 74 6f 72 79 20 66 6f 72 20 73 directory for s
1d40: 6f 75 72 63 65 73 20 61 6e 64 20 61 73 73 75 6d ources and assum
1d50: 65 64 20 73 75 62 64 69 72 65 63 74 6f 72 69 65 ed subdirectorie
1d60: 73 0a 52 4f 4f 54 20 3d 20 24 28 4d 41 4b 45 44 s.ROOT = $(MAKED
1d70: 49 52 29 5c 2e 2e 0a 23 20 54 68 65 20 66 6f 6c IR)\...# The fol
1d80: 6c 6f 77 69 6e 67 20 70 61 74 68 73 20 43 41 4e lowing paths CAN
1d90: 4e 4f 54 20 68 61 76 65 20 73 70 61 63 65 73 20 NOT have spaces
1da0: 69 6e 20 74 68 65 6d 20 61 73 20 74 68 65 79 20 in them as they
1db0: 61 70 70 65 61 72 20 6f 6e 20 74 68 65 0a 23 20 appear on the.#
1dc0: 6c 65 66 74 20 73 69 64 65 20 6f 66 20 69 6d 70 left side of imp
1dd0: 6c 69 63 69 74 20 72 75 6c 65 73 2e 0a 21 69 66 licit rules..!if
1de0: 6e 64 65 66 20 43 4f 4d 50 41 54 44 49 52 0a 43 ndef COMPATDIR.C
1df0: 4f 4d 50 41 54 44 49 52 09 3d 20 24 28 52 4f 4f OMPATDIR.= $(ROO
1e00: 54 29 5c 63 6f 6d 70 61 74 0a 21 65 6e 64 69 66 T)\compat.!endif
1e10: 0a 21 69 66 6e 64 65 66 20 44 4f 43 44 49 52 0a .!ifndef DOCDIR.
1e20: 44 4f 43 44 49 52 09 09 3d 20 24 28 52 4f 4f 54 DOCDIR..= $(ROOT
1e30: 29 5c 64 6f 63 0a 21 65 6e 64 69 66 0a 21 69 66 )\doc.!endif.!if
1e40: 6e 64 65 66 20 47 45 4e 45 52 49 43 44 49 52 0a ndef GENERICDIR.
1e50: 47 45 4e 45 52 49 43 44 49 52 09 3d 20 24 28 52 GENERICDIR.= $(R
1e60: 4f 4f 54 29 5c 67 65 6e 65 72 69 63 0a 21 65 6e OOT)\generic.!en
1e70: 64 69 66 0a 21 69 66 6e 64 65 66 20 54 4f 4f 4c dif.!ifndef TOOL
1e80: 53 44 49 52 0a 54 4f 4f 4c 53 44 49 52 09 3d 20 SDIR.TOOLSDIR.=
1e90: 24 28 52 4f 4f 54 29 5c 74 6f 6f 6c 73 0a 21 65 $(ROOT)\tools.!e
1ea0: 6e 64 69 66 0a 21 69 66 6e 64 65 66 20 54 45 53 ndif.!ifndef TES
1eb0: 54 44 49 52 0a 54 45 53 54 44 49 52 09 3d 20 24 TDIR.TESTDIR.= $
1ec0: 28 52 4f 4f 54 29 5c 74 65 73 74 73 0a 21 65 6e (ROOT)\tests.!en
1ed0: 64 69 66 0a 21 69 66 6e 64 65 66 20 4c 49 42 44 dif.!ifndef LIBD
1ee0: 49 52 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 IR.!if exist("$(
1ef0: 52 4f 4f 54 29 5c 6c 69 62 72 61 72 79 22 29 0a ROOT)\library").
1f00: 4c 49 42 44 49 52 20 20 20 20 20 20 20 20 20 20 LIBDIR
1f10: 3d 20 24 28 52 4f 4f 54 29 5c 6c 69 62 72 61 72 = $(ROOT)\librar
1f20: 79 0a 21 65 6c 73 65 0a 4c 49 42 44 49 52 20 20 y.!else.LIBDIR
1f30: 20 20 20 20 20 20 20 20 3d 20 24 28 52 4f 4f 54 = $(ROOT
1f40: 29 5c 6c 69 62 0a 21 65 6e 64 69 66 0a 21 65 6e )\lib.!endif.!en
1f50: 64 69 66 0a 21 69 66 6e 64 65 66 20 44 45 4d 4f dif.!ifndef DEMO
1f60: 44 49 52 0a 21 69 66 20 65 78 69 73 74 28 22 24 DIR.!if exist("$
1f70: 28 4c 49 42 44 49 52 29 5c 64 65 6d 6f 73 22 29 (LIBDIR)\demos")
1f80: 0a 44 45 4d 4f 44 49 52 09 09 3d 20 24 28 4c 49 .DEMODIR..= $(LI
1f90: 42 44 49 52 29 5c 64 65 6d 6f 73 0a 21 65 6c 73 BDIR)\demos.!els
1fa0: 65 0a 44 45 4d 4f 44 49 52 09 09 3d 20 24 28 52 e.DEMODIR..= $(R
1fb0: 4f 4f 54 29 5c 64 65 6d 6f 73 0a 21 65 6e 64 69 OOT)\demos.!endi
1fc0: 66 0a 21 65 6e 64 69 66 20 23 20 69 66 6e 64 65 f.!endif # ifnde
1fd0: 66 20 44 45 4d 4f 44 49 52 0a 23 20 44 6f 20 4e f DEMODIR.# Do N
1fe0: 4f 54 20 75 73 65 20 57 49 4e 44 49 52 20 62 65 OT use WINDIR be
1ff0: 63 61 75 73 65 20 69 74 20 69 73 20 57 69 6e 64 cause it is Wind
2000: 6f 77 73 20 69 6e 74 65 72 6e 61 6c 20 65 6e 76 ows internal env
2010: 69 72 6f 6e 6d 65 6e 74 0a 23 20 76 61 72 69 61 ironment.# varia
2020: 62 6c 65 20 74 6f 20 70 6f 69 6e 74 20 74 6f 20 ble to point to
2030: 63 3a 5c 77 69 6e 64 6f 77 73 21 0a 57 49 4e 5f c:\windows!.WIN_
2040: 44 49 52 09 09 3d 20 24 28 52 4f 4f 54 29 5c 77 DIR..= $(ROOT)\w
2050: 69 6e 0a 0a 21 69 66 6e 64 65 66 20 52 43 44 49 in..!ifndef RCDI
2060: 52 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 57 R.!if exist("$(W
2070: 49 4e 5f 44 49 52 29 5c 72 63 22 29 0a 52 43 44 IN_DIR)\rc").RCD
2080: 49 52 20 20 20 20 20 20 20 20 20 20 20 3d 20 24 IR = $
2090: 28 57 49 4e 5f 44 49 52 29 5c 72 63 0a 21 65 6c (WIN_DIR)\rc.!el
20a0: 73 65 0a 52 43 44 49 52 20 20 20 20 20 20 20 20 se.RCDIR
20b0: 20 20 20 3d 20 24 28 57 49 4e 5f 44 49 52 29 0a = $(WIN_DIR).
20c0: 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 52 43 !endif.!endif.RC
20d0: 44 49 52 20 3d 20 24 28 52 43 44 49 52 3a 2f 3d DIR = $(RCDIR:/=
20e0: 5c 29 0a 0a 23 20 54 68 65 20 74 61 72 67 65 74 \)..# The target
20f0: 20 64 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 directory where
2100: 20 74 68 65 20 62 75 69 6c 74 20 70 61 63 6b 61 the built packa
2110: 67 65 73 20 61 6e 64 20 62 69 6e 61 72 69 65 73 ges and binaries
2120: 20 77 69 6c 6c 20 62 65 20 69 6e 73 74 61 6c 6c will be install
2130: 65 64 2e 0a 23 20 49 4e 53 54 41 4c 4c 44 49 52 ed..# INSTALLDIR
2140: 20 69 73 20 74 68 65 20 28 6f 70 74 69 6f 6e 61 is the (optiona
2150: 6c 29 20 70 61 74 68 20 73 70 65 63 69 66 69 65 l) path specifie
2160: 64 20 62 79 20 74 68 65 20 75 73 65 72 2e 0a 23 d by the user..#
2170: 20 5f 49 4e 53 54 41 4c 4c 44 49 52 20 69 73 20 _INSTALLDIR is
2180: 49 4e 53 54 41 4c 4c 44 49 52 20 75 73 69 6e 67 INSTALLDIR using
2190: 20 74 68 65 20 62 61 63 6b 73 6c 61 73 68 20 73 the backslash s
21a0: 65 70 61 72 61 74 6f 72 20 73 79 6e 74 61 78 0a eparator syntax.
21b0: 21 69 66 64 65 66 20 49 4e 53 54 41 4c 4c 44 49 !ifdef INSTALLDI
21c0: 52 0a 23 23 23 20 46 69 78 20 74 68 65 20 70 61 R.### Fix the pa
21d0: 74 68 20 73 65 70 61 72 61 74 6f 72 73 2e 0a 5f th separators.._
21e0: 49 4e 53 54 41 4c 4c 44 49 52 09 3d 20 24 28 49 INSTALLDIR.= $(I
21f0: 4e 53 54 41 4c 4c 44 49 52 3a 2f 3d 5c 29 0a 21 NSTALLDIR:/=\).!
2200: 65 6c 73 65 0a 23 23 23 20 41 73 73 75 6d 65 20 else.### Assume
2210: 74 68 65 20 6e 6f 72 6d 61 6c 20 64 65 66 61 75 the normal defau
2220: 6c 74 2e 0a 5f 49 4e 53 54 41 4c 4c 44 49 52 09 lt.._INSTALLDIR.
2230: 3d 20 24 28 48 4f 4d 45 44 52 49 56 45 29 5c 54 = $(HOMEDRIVE)\T
2240: 63 6c 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 cl.!endif..!if $
2250: 28 44 4f 49 4e 47 5f 54 43 4c 29 0a 0a 23 20 42 (DOING_TCL)..# B
2260: 45 47 49 4e 20 43 61 73 65 20 32 28 61 29 20 2d EGIN Case 2(a) -
2270: 20 42 75 69 6c 64 69 6e 67 20 54 63 6c 20 69 74 Building Tcl it
2280: 73 65 6c 66 0a 0a 23 20 4f 6e 6c 79 20 6e 65 65 self..# Only nee
2290: 64 20 74 6f 20 64 65 66 69 6e 65 20 5f 54 43 4c d to define _TCL
22a0: 5f 48 0a 5f 54 43 4c 5f 48 20 3d 20 2e 2e 5c 67 _H._TCL_H = ..\g
22b0: 65 6e 65 72 69 63 5c 74 63 6c 2e 68 0a 0a 23 20 eneric\tcl.h..#
22c0: 45 4e 44 20 43 61 73 65 20 32 28 61 29 20 2d 20 END Case 2(a) -
22d0: 42 75 69 6c 64 69 6e 67 20 54 63 6c 20 69 74 73 Building Tcl its
22e0: 65 6c 66 0a 0a 21 65 6c 73 65 69 66 20 24 28 44 elf..!elseif $(D
22f0: 4f 49 4e 47 5f 54 4b 29 0a 0a 23 20 42 45 47 49 OING_TK)..# BEGI
2300: 4e 20 43 61 73 65 20 32 28 62 29 20 2d 20 42 75 N Case 2(b) - Bu
2310: 69 6c 64 69 6e 67 20 54 6b 0a 0a 54 43 4c 49 4e ilding Tk..TCLIN
2320: 53 54 41 4c 4c 20 3d 20 30 20 23 20 54 6b 20 61 STALL = 0 # Tk a
2330: 6c 77 61 79 73 20 62 75 69 6c 64 73 20 61 67 61 lways builds aga
2340: 69 6e 73 74 20 54 63 6c 20 73 6f 75 72 63 65 2c inst Tcl source,
2350: 20 6e 6f 74 20 61 6e 20 69 6e 73 74 61 6c 6c 65 not an installe
2360: 64 20 54 63 6c 0a 21 69 66 20 22 24 28 54 43 4c d Tcl.!if "$(TCL
2370: 44 49 52 29 22 20 3d 3d 20 22 22 0a 21 69 66 20 DIR)" == "".!if
2380: 5b 65 63 68 6f 20 54 43 4c 44 49 52 20 3d 20 5c [echo TCLDIR = \
2390: 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20 > nmakehlp.out]
23a0: 5c 0a 20 20 20 7c 7c 20 5b 24 28 4e 4d 41 4b 45 \. || [$(NMAKE
23b0: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 4c 20 67 HLP_NATIVE) -L g
23c0: 65 6e 65 72 69 63 5c 74 63 6c 2e 68 20 3e 3e 20 eneric\tcl.h >>
23d0: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 nmakehlp.out].!e
23e0: 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e rror *** Could n
23f0: 6f 74 20 6c 6f 63 61 74 65 20 54 63 6c 20 73 6f ot locate Tcl so
2400: 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 2e 0a urce directory..
2410: 21 65 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 !endif.!include
2420: 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0a 21 65 6e nmakehlp.out.!en
2430: 64 69 66 20 23 20 54 43 4c 44 49 52 20 3d 3d 20 dif # TCLDIR ==
2440: 22 22 0a 0a 5f 54 43 4c 44 49 52 09 3d 20 24 28 "".._TCLDIR.= $(
2450: 54 43 4c 44 49 52 3a 2f 3d 5c 29 0a 5f 54 43 4c TCLDIR:/=\)._TCL
2460: 5f 48 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 _H = $(_TCLDIR)
2470: 5c 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 0a 21 \generic\tcl.h.!
2480: 69 66 20 21 65 78 69 73 74 28 22 24 28 5f 54 43 if !exist("$(_TC
2490: 4c 5f 48 29 22 29 0a 21 65 72 72 6f 72 20 43 6f L_H)").!error Co
24a0: 75 6c 64 20 6e 6f 74 20 6c 6f 63 61 74 65 20 74 uld not locate t
24b0: 63 6c 2e 68 2e 20 50 6c 65 61 73 65 20 73 65 74 cl.h. Please set
24c0: 20 74 68 65 20 54 43 4c 44 49 52 20 6d 61 63 72 the TCLDIR macr
24d0: 6f 20 74 6f 20 70 6f 69 6e 74 20 74 6f 20 74 68 o to point to th
24e0: 65 20 54 63 6c 20 2a 73 6f 75 72 63 65 2a 20 64 e Tcl *source* d
24f0: 69 72 65 63 74 6f 72 79 2e 0a 21 65 6e 64 69 66 irectory..!endif
2500: 0a 0a 5f 54 4b 5f 48 20 3d 20 2e 2e 5c 67 65 6e .._TK_H = ..\gen
2510: 65 72 69 63 5c 74 6b 2e 68 0a 0a 23 20 45 4e 44 eric\tk.h..# END
2520: 20 43 61 73 65 20 32 28 62 29 20 2d 20 42 75 69 Case 2(b) - Bui
2530: 6c 64 69 6e 67 20 54 6b 0a 0a 21 65 6c 73 65 0a lding Tk..!else.
2540: 0a 23 20 42 45 47 49 4e 20 43 61 73 65 20 32 28 .# BEGIN Case 2(
2550: 63 29 20 6f 72 20 28 64 29 20 2d 20 42 75 69 6c c) or (d) - Buil
2560: 64 69 6e 67 20 61 6e 20 65 78 74 65 6e 73 69 6f ding an extensio
2570: 6e 20 6f 74 68 65 72 20 74 68 61 6e 20 54 6b 0a n other than Tk.
2580: 0a 23 20 49 66 20 63 6f 6d 6d 61 6e 64 20 6c 69 .# If command li
2590: 6e 65 20 68 61 73 20 73 70 65 63 69 66 69 65 64 ne has specified
25a0: 20 54 63 6c 20 6c 6f 63 61 74 69 6f 6e 20 74 68 Tcl location th
25b0: 72 6f 75 67 68 20 54 43 4c 44 49 52 2c 20 75 73 rough TCLDIR, us
25c0: 65 20 69 74 0a 23 20 65 6c 73 65 20 64 65 66 61 e it.# else defa
25d0: 75 6c 74 20 74 6f 20 74 68 65 20 49 4e 53 54 41 ult to the INSTA
25e0: 4c 4c 44 49 52 20 73 65 74 74 69 6e 67 0a 21 69 LLDIR setting.!i
25f0: 66 20 22 24 28 54 43 4c 44 49 52 29 22 20 21 3d f "$(TCLDIR)" !=
2600: 20 22 22 0a 0a 5f 54 43 4c 44 49 52 09 3d 20 24 "".._TCLDIR.= $
2610: 28 54 43 4c 44 49 52 3a 2f 3d 5c 29 0a 21 69 66 (TCLDIR:/=\).!if
2620: 20 65 78 69 73 74 28 22 24 28 5f 54 43 4c 44 49 exist("$(_TCLDI
2630: 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 R)\include\tcl.h
2640: 22 29 20 23 20 43 61 73 65 20 32 28 63 29 20 77 ") # Case 2(c) w
2650: 69 74 68 20 54 43 4c 44 49 52 20 64 65 66 69 6e ith TCLDIR defin
2660: 65 64 0a 54 43 4c 49 4e 53 54 41 4c 4c 09 3d 20 ed.TCLINSTALL.=
2670: 31 0a 5f 54 43 4c 5f 48 20 20 20 20 20 20 20 20 1._TCL_H
2680: 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 = $(_TCLDIR)\i
2690: 6e 63 6c 75 64 65 5c 74 63 6c 2e 68 0a 21 65 6c nclude\tcl.h.!el
26a0: 73 65 69 66 20 65 78 69 73 74 28 22 24 28 5f 54 seif exist("$(_T
26b0: 43 4c 44 49 52 29 5c 67 65 6e 65 72 69 63 5c 74 CLDIR)\generic\t
26c0: 63 6c 2e 68 22 29 20 23 20 43 61 73 65 20 32 28 cl.h") # Case 2(
26d0: 64 29 20 77 69 74 68 20 54 43 4c 44 49 52 20 64 d) with TCLDIR d
26e0: 65 66 69 6e 65 64 0a 54 43 4c 49 4e 53 54 41 4c efined.TCLINSTAL
26f0: 4c 09 3d 20 30 0a 5f 54 43 4c 5f 48 20 20 20 20 L.= 0._TCL_H
2700: 20 20 20 20 20 20 3d 20 24 28 5f 54 43 4c 44 49 = $(_TCLDI
2710: 52 29 5c 67 65 6e 65 72 69 63 5c 74 63 6c 2e 68 R)\generic\tcl.h
2720: 0a 21 65 6e 64 69 66 0a 0a 21 65 6c 73 65 20 20 .!endif..!else
2730: 23 20 20 23 20 43 61 73 65 20 32 28 63 29 20 66 # # Case 2(c) f
2740: 6f 72 20 65 78 74 65 6e 73 69 6f 6e 73 20 77 69 or extensions wi
2750: 74 68 20 54 43 4c 44 49 52 20 75 6e 64 65 66 69 th TCLDIR undefi
2760: 6e 65 64 0a 0a 23 20 4e 65 65 64 20 74 6f 20 6c ned..# Need to l
2770: 6f 63 61 74 65 20 54 63 6c 20 64 65 70 65 6e 64 ocate Tcl depend
2780: 69 6e 67 20 6f 6e 20 77 68 65 74 68 65 72 20 69 ing on whether i
2790: 74 20 6e 65 65 64 73 20 54 63 6c 20 73 6f 75 72 t needs Tcl sour
27a0: 63 65 20 6f 72 20 6e 6f 74 2e 0a 23 20 49 66 20 ce or not..# If
27b0: 77 65 20 64 6f 6e 27 74 2c 20 63 68 65 63 6b 20 we don't, check
27c0: 74 68 65 20 49 4e 53 54 41 4c 4c 44 49 52 20 66 the INSTALLDIR f
27d0: 6f 72 20 61 6e 20 69 6e 73 74 61 6c 6c 65 64 20 or an installed
27e0: 54 63 6c 20 66 69 72 73 74 0a 0a 21 69 66 20 65 Tcl first..!if e
27f0: 78 69 73 74 28 22 24 28 5f 49 4e 53 54 41 4c 4c xist("$(_INSTALL
2800: 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 63 6c DIR)\include\tcl
2810: 2e 68 22 29 20 26 26 20 21 24 28 4e 45 45 44 5f .h") && !$(NEED_
2820: 54 43 4c 5f 53 4f 55 52 43 45 29 0a 0a 54 43 4c TCL_SOURCE)..TCL
2830: 49 4e 53 54 41 4c 4c 09 3d 20 31 0a 54 43 4c 44 INSTALL.= 1.TCLD
2840: 49 52 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 IR = $(
2850: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 0a _INSTALLDIR)\...
2860: 23 20 4e 4f 54 45 3a 20 77 65 20 77 69 6c 6c 20 # NOTE: we will
2870: 62 65 20 72 65 73 65 74 74 69 6e 67 20 5f 49 4e be resetting _IN
2880: 53 54 41 4c 4c 44 49 52 20 74 6f 20 5f 49 4e 53 STALLDIR to _INS
2890: 54 41 4c 4c 44 49 52 2f 6c 69 62 20 66 6f 72 20 TALLDIR/lib for
28a0: 65 78 74 65 6e 73 69 6f 6e 73 0a 23 20 6c 61 74 extensions.# lat
28b0: 65 72 20 73 6f 20 74 68 65 20 5c 2e 2e 20 61 63 er so the \.. ac
28c0: 63 6f 75 6e 74 73 20 66 6f 72 20 74 68 65 20 2f counts for the /
28d0: 6c 69 62 0a 5f 54 43 4c 44 49 52 09 09 3d 20 24 lib._TCLDIR..= $
28e0: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e (_INSTALLDIR)\..
28f0: 0a 5f 54 43 4c 5f 48 20 20 20 20 20 20 20 20 20 ._TCL_H
2900: 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 69 6e = $(_TCLDIR)\in
2910: 63 6c 75 64 65 5c 74 63 6c 2e 68 0a 0a 21 65 6c clude\tcl.h..!el
2920: 73 65 20 23 20 65 78 69 73 74 28 2e 2e 2e 29 20 se # exist(...)
2930: 26 26 20 21 24 28 4e 45 45 44 5f 54 43 4c 5f 53 && !$(NEED_TCL_S
2940: 4f 55 52 43 45 29 0a 0a 21 69 66 20 5b 65 63 68 OURCE)..!if [ech
2950: 6f 20 5f 54 43 4c 44 49 52 20 3d 20 5c 3e 20 6e o _TCLDIR = \> n
2960: 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20 5c 0a 20 makehlp.out] \.
2970: 20 20 7c 7c 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 || [$(NMAKEHLP
2980: 5f 4e 41 54 49 56 45 29 20 2d 4c 20 67 65 6e 65 _NATIVE) -L gene
2990: 72 69 63 5c 74 63 6c 2e 68 20 3e 3e 20 6e 6d 61 ric\tcl.h >> nma
29a0: 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 72 6f kehlp.out].!erro
29b0: 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 r *** Could not
29c0: 6c 6f 63 61 74 65 20 54 63 6c 20 73 6f 75 72 63 locate Tcl sourc
29d0: 65 20 64 69 72 65 63 74 6f 72 79 2e 0a 21 65 6e e directory..!en
29e0: 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 dif.!include nma
29f0: 6b 65 68 6c 70 2e 6f 75 74 0a 54 43 4c 49 4e 53 kehlp.out.TCLINS
2a00: 54 41 4c 4c 20 20 20 20 20 20 3d 20 30 0a 54 43 TALL = 0.TC
2a10: 4c 44 49 52 20 20 20 20 20 20 20 20 20 3d 20 24 LDIR = $
2a20: 28 5f 54 43 4c 44 49 52 29 0a 5f 54 43 4c 5f 48 (_TCLDIR)._TCL_H
2a30: 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54 = $(_T
2a40: 43 4c 44 49 52 29 5c 67 65 6e 65 72 69 63 5c 74 CLDIR)\generic\t
2a50: 63 6c 2e 68 0a 0a 21 65 6e 64 69 66 20 23 20 65 cl.h..!endif # e
2a60: 78 69 73 74 28 2e 2e 2e 29 20 26 26 20 21 24 28 xist(...) && !$(
2a70: 4e 45 45 44 5f 54 43 4c 5f 53 4f 55 52 43 45 29 NEED_TCL_SOURCE)
2a80: 0a 0a 21 65 6e 64 69 66 20 23 20 54 43 4c 44 49 ..!endif # TCLDI
2a90: 52 0a 0a 21 69 66 6e 64 65 66 20 5f 54 43 4c 5f R..!ifndef _TCL_
2aa0: 48 0a 4d 53 47 20 3d 5e 0a 46 61 69 6c 65 64 20 H.MSG =^.Failed
2ab0: 74 6f 20 66 69 6e 64 20 74 63 6c 2e 68 2e 20 54 to find tcl.h. T
2ac0: 68 65 20 54 43 4c 44 49 52 20 6d 61 63 72 6f 20 he TCLDIR macro
2ad0: 69 73 20 73 65 74 20 69 6e 63 6f 72 72 65 63 74 is set incorrect
2ae0: 6c 79 20 6f 72 20 69 73 20 6e 6f 74 20 73 65 74 ly or is not set
2af0: 20 61 6e 64 20 64 65 66 61 75 6c 74 20 70 61 74 and default pat
2b00: 68 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 h does not conta
2b10: 69 6e 20 74 63 6c 2e 68 2e 0a 21 65 72 72 6f 72 in tcl.h..!error
2b20: 20 24 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a 0a $(MSG).!endif..
2b30: 23 20 4e 6f 77 20 64 6f 20 74 68 65 20 73 61 6d # Now do the sam
2b40: 65 20 74 6f 20 6c 6f 63 61 74 65 20 54 6b 20 68 e to locate Tk h
2b50: 65 61 64 65 72 73 20 61 6e 64 20 6c 69 62 73 20 eaders and libs
2b60: 69 66 20 70 72 6f 6a 65 63 74 20 72 65 71 75 69 if project requi
2b70: 72 65 73 20 54 6b 0a 21 69 66 20 24 28 4e 45 45 res Tk.!if $(NEE
2b80: 44 5f 54 4b 29 0a 0a 21 69 66 20 22 24 28 54 4b D_TK)..!if "$(TK
2b90: 44 49 52 29 22 20 21 3d 20 22 22 0a 0a 5f 54 4b DIR)" != "".._TK
2ba0: 44 49 52 20 3d 20 24 28 54 4b 44 49 52 3a 2f 3d DIR = $(TKDIR:/=
2bb0: 5c 29 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 \).!if exist("$(
2bc0: 5f 54 4b 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c _TKDIR)\include\
2bd0: 74 6b 2e 68 22 29 0a 54 4b 49 4e 53 54 41 4c 4c tk.h").TKINSTALL
2be0: 20 20 20 20 20 20 3d 20 31 0a 5f 54 4b 5f 48 20 = 1._TK_H
2bf0: 20 20 20 20 20 20 20 20 20 3d 20 24 28 5f 54 4b = $(_TK
2c00: 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 6b 2e DIR)\include\tk.
2c10: 68 0a 21 65 6c 73 65 69 66 20 65 78 69 73 74 28 h.!elseif exist(
2c20: 22 24 28 5f 54 4b 44 49 52 29 5c 67 65 6e 65 72 "$(_TKDIR)\gener
2c30: 69 63 5c 74 6b 2e 68 22 29 0a 54 4b 49 4e 53 54 ic\tk.h").TKINST
2c40: 41 4c 4c 20 20 20 20 20 20 3d 20 30 0a 5f 54 4b ALL = 0._TK
2c50: 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 _H = $(
2c60: 5f 54 4b 44 49 52 29 5c 67 65 6e 65 72 69 63 5c _TKDIR)\generic\
2c70: 74 6b 2e 68 0a 21 65 6e 64 69 66 0a 0a 21 65 6c tk.h.!endif..!el
2c80: 73 65 20 23 20 54 4b 44 49 52 20 6e 6f 74 20 64 se # TKDIR not d
2c90: 65 66 69 6e 65 64 0a 0a 23 20 4e 65 65 64 20 74 efined..# Need t
2ca0: 6f 20 6c 6f 63 61 74 65 20 54 63 6c 20 64 65 70 o locate Tcl dep
2cb0: 65 6e 64 69 6e 67 20 6f 6e 20 77 68 65 74 68 65 ending on whethe
2cc0: 72 20 69 74 20 6e 65 65 64 73 20 54 63 6c 20 73 r it needs Tcl s
2cd0: 6f 75 72 63 65 20 6f 72 20 6e 6f 74 2e 0a 23 20 ource or not..#
2ce0: 49 66 20 77 65 20 64 6f 6e 27 74 2c 20 63 68 65 If we don't, che
2cf0: 63 6b 20 74 68 65 20 49 4e 53 54 41 4c 4c 44 49 ck the INSTALLDI
2d00: 52 20 66 6f 72 20 61 6e 20 69 6e 73 74 61 6c 6c R for an install
2d10: 65 64 20 54 63 6c 20 66 69 72 73 74 0a 0a 21 69 ed Tcl first..!i
2d20: 66 20 65 78 69 73 74 28 22 24 28 5f 49 4e 53 54 f exist("$(_INST
2d30: 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c ALLDIR)\include\
2d40: 74 6b 2e 68 22 29 20 26 26 20 21 24 28 4e 45 45 tk.h") && !$(NEE
2d50: 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0a 0a 54 4b D_TK_SOURCE)..TK
2d60: 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 31 INSTALL = 1
2d70: 0a 23 20 4e 4f 54 45 3a 20 77 65 20 77 69 6c 6c .# NOTE: we will
2d80: 20 62 65 20 72 65 73 65 74 74 69 6e 67 20 5f 49 be resetting _I
2d90: 4e 53 54 41 4c 4c 44 49 52 20 74 6f 20 5f 49 4e NSTALLDIR to _IN
2da0: 53 54 41 4c 4c 44 49 52 2f 6c 69 62 20 66 6f 72 STALLDIR/lib for
2db0: 20 65 78 74 65 6e 73 69 6f 6e 73 0a 23 20 6c 61 extensions.# la
2dc0: 74 65 72 20 73 6f 20 74 68 65 20 5c 2e 2e 20 61 ter so the \.. a
2dd0: 63 63 6f 75 6e 74 73 20 66 6f 72 20 74 68 65 20 ccounts for the
2de0: 2f 6c 69 62 0a 5f 54 4b 44 49 52 20 20 20 20 20 /lib._TKDIR
2df0: 20 20 20 20 3d 20 24 28 5f 49 4e 53 54 41 4c 4c = $(_INSTALL
2e00: 44 49 52 29 5c 2e 2e 0a 5f 54 4b 5f 48 20 20 20 DIR)\..._TK_H
2e10: 20 20 20 20 20 20 20 3d 20 24 28 5f 54 4b 44 49 = $(_TKDI
2e20: 52 29 5c 69 6e 63 6c 75 64 65 5c 74 6b 2e 68 0a R)\include\tk.h.
2e30: 54 4b 44 49 52 20 20 20 20 20 20 20 20 20 20 3d TKDIR =
2e40: 20 24 28 5f 54 4b 44 49 52 29 0a 0a 21 65 6c 73 $(_TKDIR)..!els
2e50: 65 20 23 20 65 78 69 73 74 28 22 24 28 5f 49 4e e # exist("$(_IN
2e60: 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63 6c 75 64 STALLDIR)\includ
2e70: 65 5c 74 6b 2e 68 22 29 20 26 26 20 21 24 28 4e e\tk.h") && !$(N
2e80: 45 45 44 5f 54 4b 5f 53 4f 55 52 43 45 29 0a 0a EED_TK_SOURCE)..
2e90: 21 69 66 20 5b 65 63 68 6f 20 5f 54 4b 44 49 52 !if [echo _TKDIR
2ea0: 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f = \> nmakehlp.o
2eb0: 75 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b 24 28 4e ut] \. || [$(N
2ec0: 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 MAKEHLP_NATIVE)
2ed0: 2d 4c 20 67 65 6e 65 72 69 63 5c 74 6b 2e 68 20 -L generic\tk.h
2ee0: 3e 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d >> nmakehlp.out]
2ef0: 0a 21 65 72 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c .!error *** Coul
2f00: 64 20 6e 6f 74 20 6c 6f 63 61 74 65 20 54 6b 20 d not locate Tk
2f10: 73 6f 75 72 63 65 20 64 69 72 65 63 74 6f 72 79 source directory
2f20: 2e 0a 21 65 6e 64 69 66 0a 21 69 6e 63 6c 75 64 ..!endif.!includ
2f30: 65 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 0a 54 e nmakehlp.out.T
2f40: 4b 49 4e 53 54 41 4c 4c 20 20 20 20 20 20 3d 20 KINSTALL =
2f50: 30 0a 54 4b 44 49 52 20 20 20 20 20 20 20 20 20 0.TKDIR
2f60: 20 3d 20 24 28 5f 54 4b 44 49 52 29 0a 5f 54 4b = $(_TKDIR)._TK
2f70: 5f 48 20 20 20 20 20 20 20 20 20 20 3d 20 24 28 _H = $(
2f80: 5f 54 4b 44 49 52 29 5c 67 65 6e 65 72 69 63 5c _TKDIR)\generic\
2f90: 74 6b 2e 68 0a 0a 21 65 6e 64 69 66 20 23 20 65 tk.h..!endif # e
2fa0: 78 69 73 74 28 22 24 28 5f 49 4e 53 54 41 4c 4c xist("$(_INSTALL
2fb0: 44 49 52 29 5c 69 6e 63 6c 75 64 65 5c 74 6b 2e DIR)\include\tk.
2fc0: 68 22 29 20 26 26 20 21 24 28 4e 45 45 44 5f 54 h") && !$(NEED_T
2fd0: 4b 5f 53 4f 55 52 43 45 29 0a 0a 21 65 6e 64 69 K_SOURCE)..!endi
2fe0: 66 20 23 20 54 4b 44 49 52 0a 0a 21 69 66 6e 64 f # TKDIR..!ifnd
2ff0: 65 66 20 5f 54 4b 5f 48 0a 4d 53 47 20 3d 5e 0a ef _TK_H.MSG =^.
3000: 46 61 69 6c 65 64 20 74 6f 20 66 69 6e 64 20 74 Failed to find t
3010: 6b 2e 68 2e 20 54 68 65 20 54 4b 44 49 52 20 6d k.h. The TKDIR m
3020: 61 63 72 6f 20 69 73 20 73 65 74 20 69 6e 63 6f acro is set inco
3030: 72 72 65 63 74 6c 79 20 6f 72 20 69 73 20 6e 6f rrectly or is no
3040: 74 20 73 65 74 20 61 6e 64 20 64 65 66 61 75 6c t set and defaul
3050: 74 20 70 61 74 68 20 64 6f 65 73 20 6e 6f 74 20 t path does not
3060: 63 6f 6e 74 61 69 6e 20 74 6b 2e 68 2e 0a 21 65 contain tk.h..!e
3070: 72 72 6f 72 20 24 28 4d 53 47 29 0a 21 65 6e 64 rror $(MSG).!end
3080: 69 66 0a 0a 21 65 6e 64 69 66 20 23 20 4e 45 45 if..!endif # NEE
3090: 44 5f 54 4b 0a 0a 21 69 66 20 24 28 4e 45 45 44 D_TK..!if $(NEED
30a0: 5f 54 43 4c 5f 53 4f 55 52 43 45 29 20 26 26 20 _TCL_SOURCE) &&
30b0: 24 28 54 43 4c 49 4e 53 54 41 4c 4c 29 0a 4d 53 $(TCLINSTALL).MS
30c0: 47 20 3d 20 5e 0a 2a 2a 2a 20 57 61 72 6e 69 6e G = ^.*** Warnin
30d0: 67 3a 20 54 68 69 73 20 65 78 74 65 6e 73 69 6f g: This extensio
30e0: 6e 20 72 65 71 75 69 72 65 73 20 74 68 65 20 73 n requires the s
30f0: 6f 75 72 63 65 20 64 69 73 74 72 69 62 75 74 69 ource distributi
3100: 6f 6e 20 6f 66 20 54 63 6c 2e 5e 0a 2a 2a 2a 20 on of Tcl.^.***
3110: 50 6c 65 61 73 65 20 73 65 74 20 74 68 65 20 54 Please set the T
3120: 43 4c 44 49 52 20 6d 61 63 72 6f 20 74 6f 20 70 CLDIR macro to p
3130: 6f 69 6e 74 20 74 6f 20 74 68 65 20 54 63 6c 20 oint to the Tcl
3140: 73 6f 75 72 63 65 73 2e 0a 21 65 72 72 6f 72 20 sources..!error
3150: 24 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a 0a 21 $(MSG).!endif..!
3160: 69 66 20 24 28 4e 45 45 44 5f 54 4b 5f 53 4f 55 if $(NEED_TK_SOU
3170: 52 43 45 29 0a 21 69 66 20 24 28 54 4b 49 4e 53 RCE).!if $(TKINS
3180: 54 41 4c 4c 29 0a 4d 53 47 20 3d 20 5e 0a 2a 2a TALL).MSG = ^.**
3190: 2a 20 57 61 72 6e 69 6e 67 3a 20 54 68 69 73 20 * Warning: This
31a0: 65 78 74 65 6e 73 69 6f 6e 20 72 65 71 75 69 72 extension requir
31b0: 65 73 20 74 68 65 20 73 6f 75 72 63 65 20 64 69 es the source di
31c0: 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 20 54 6b stribution of Tk
31d0: 2e 5e 0a 2a 2a 2a 20 50 6c 65 61 73 65 20 73 65 .^.*** Please se
31e0: 74 20 74 68 65 20 54 4b 44 49 52 20 6d 61 63 72 t the TKDIR macr
31f0: 6f 20 74 6f 20 70 6f 69 6e 74 20 74 6f 20 74 68 o to point to th
3200: 65 20 54 6b 20 73 6f 75 72 63 65 73 2e 0a 21 65 e Tk sources..!e
3210: 72 72 6f 72 20 24 28 4d 53 47 29 0a 21 65 6e 64 rror $(MSG).!end
3220: 69 66 0a 21 65 6e 64 69 66 0a 0a 0a 23 20 49 66 if.!endif...# If
3230: 20 49 4e 53 54 41 4c 4c 44 49 52 20 73 65 74 20 INSTALLDIR set
3240: 74 6f 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61 74 to Tcl installat
3250: 69 6f 6e 20 72 6f 6f 74 20 64 69 72 20 74 68 65 ion root dir the
3260: 6e 20 72 65 73 65 74 20 74 6f 20 74 68 65 0a 23 n reset to the.#
3270: 20 6c 69 62 20 64 69 72 20 66 6f 72 20 69 6e 73 lib dir for ins
3280: 74 61 6c 6c 69 6e 67 20 65 78 74 65 6e 73 69 6f talling extensio
3290: 6e 73 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 ns.!if exist("$(
32a0: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 69 6e 63 _INSTALLDIR)\inc
32b0: 6c 75 64 65 5c 74 63 6c 2e 68 22 29 0a 5f 49 4e lude\tcl.h")._IN
32c0: 53 54 41 4c 4c 44 49 52 3d 24 28 5f 49 4e 53 54 STALLDIR=$(_INST
32d0: 41 4c 4c 44 49 52 29 5c 6c 69 62 0a 21 65 6e 64 ALLDIR)\lib.!end
32e0: 69 66 0a 0a 23 20 45 4e 44 20 43 61 73 65 20 32 if..# END Case 2
32f0: 28 63 29 20 6f 72 20 28 64 29 20 2d 20 42 75 69 (c) or (d) - Bui
3300: 6c 64 69 6e 67 20 61 6e 20 65 78 74 65 6e 73 69 lding an extensi
3310: 6f 6e 0a 21 65 6e 64 69 66 20 23 20 69 66 20 24 on.!endif # if $
3320: 28 44 4f 49 4e 47 5f 54 43 4c 29 0a 0a 23 23 23 (DOING_TCL)..###
3330: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3340: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3350: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
3360: 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 #############.#
3370: 33 2e 20 44 65 74 65 72 6d 69 6e 65 20 63 6f 6d 3. Determine com
3380: 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 61 6e piler version an
3390: 64 20 61 72 63 68 69 74 65 63 74 75 72 65 0a 23 d architecture.#
33a0: 20 49 6e 20 74 68 69 73 20 73 65 63 74 69 6f 6e In this section
33b0: 2c 20 77 65 20 66 69 67 75 72 65 20 6f 75 74 20 , we figure out
33c0: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 76 65 72 the compiler ver
33d0: 73 69 6f 6e 20 61 6e 64 20 74 68 65 0a 23 20 61 sion and the.# a
33e0: 72 63 68 69 74 65 63 74 75 72 65 20 66 6f 72 20 rchitecture for
33f0: 77 68 69 63 68 20 77 65 20 61 72 65 20 62 75 69 which we are bui
3400: 6c 64 69 6e 67 2e 20 54 68 69 73 20 73 65 74 73 lding. This sets
3410: 20 74 68 65 0a 23 20 66 6f 6c 6c 6f 77 69 6e 67 the.# following
3420: 20 6d 61 63 72 6f 73 3a 0a 23 20 56 43 56 45 52 macros:.# VCVER
3430: 53 49 4f 4e 20 2d 20 74 68 65 20 69 6e 74 65 72 SION - the inter
3440: 6e 61 6c 20 63 6f 6d 70 69 6c 65 72 20 76 65 72 nal compiler ver
3450: 73 69 6f 6e 20 61 73 20 31 32 30 30 2c 20 31 34 sion as 1200, 14
3460: 30 30 2c 20 31 39 31 30 20 65 74 63 2e 0a 23 20 00, 1910 etc..#
3470: 20 20 20 20 54 68 69 73 20 69 73 20 61 6c 73 6f This is also
3480: 20 70 72 69 6e 74 65 64 20 62 79 20 74 68 65 20 printed by the
3490: 63 6f 6d 70 69 6c 65 72 20 69 6e 20 64 6f 74 74 compiler in dott
34a0: 65 64 20 66 6f 72 6d 20 31 39 2e 31 30 20 65 74 ed form 19.10 et
34b0: 63 2e 0a 23 20 56 43 56 45 52 20 2d 20 74 68 65 c..# VCVER - the
34c0: 20 22 6d 61 72 6b 65 74 69 6e 67 20 76 65 72 73 "marketing vers
34d0: 69 6f 6e 22 2c 20 66 6f 72 20 65 78 61 6d 70 6c ion", for exampl
34e0: 65 20 56 69 73 75 61 6c 20 43 2b 2b 20 36 20 66 e Visual C++ 6 f
34f0: 6f 72 20 69 6e 74 65 72 6e 61 6c 0a 23 20 20 20 or internal.#
3500: 20 20 63 6f 6d 70 69 6c 65 72 20 76 65 72 73 69 compiler versi
3510: 6f 6e 20 31 32 30 30 2e 20 54 68 69 73 20 69 73 on 1200. This is
3520: 20 6b 65 70 74 20 6f 6e 6c 79 20 66 6f 72 20 6c kept only for l
3530: 65 67 61 63 79 20 72 65 61 73 6f 6e 73 20 61 73 egacy reasons as
3540: 20 69 74 0a 23 20 20 20 20 20 64 6f 65 73 20 6e it.# does n
3550: 6f 74 20 6d 61 6b 65 20 73 65 6e 73 65 20 66 6f ot make sense fo
3560: 72 20 72 65 63 65 6e 74 20 4d 69 63 72 6f 73 6f r recent Microso
3570: 66 74 20 63 6f 6d 70 69 6c 65 72 73 2e 20 4f 6e ft compilers. On
3580: 6c 79 20 75 73 65 64 20 66 6f 72 0a 23 20 20 20 ly used for.#
3590: 20 20 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f output directo
35a0: 72 79 20 6e 61 6d 65 73 2e 0a 23 20 41 52 43 48 ry names..# ARCH
35b0: 20 2d 20 73 65 74 20 74 6f 20 49 58 38 36 2c 20 - set to IX86,
35c0: 41 52 4d 36 34 20 6f 72 20 41 4d 44 36 34 20 64 ARM64 or AMD64 d
35d0: 65 70 65 6e 64 69 6e 67 20 6f 6e 20 33 32 2d 20 epending on 32-
35e0: 6f 72 20 36 34 2d 62 69 74 20 74 61 72 67 65 74 or 64-bit target
35f0: 0a 23 20 4e 41 54 49 56 45 5f 41 52 43 48 20 2d .# NATIVE_ARCH -
3600: 20 73 65 74 20 74 6f 20 49 58 38 36 2c 20 41 52 set to IX86, AR
3610: 4d 36 34 20 6f 72 20 41 4d 44 36 34 20 66 6f 72 M64 or AMD64 for
3620: 20 74 68 65 20 68 6f 73 74 20 6d 61 63 68 69 6e the host machin
3630: 65 0a 23 20 4d 41 43 48 49 4e 45 20 2d 20 73 61 e.# MACHINE - sa
3640: 6d 65 20 61 73 20 24 28 41 52 43 48 29 20 2d 20 me as $(ARCH) -
3650: 6c 65 67 61 63 79 0a 23 20 5f 56 43 5f 4d 41 4e legacy.# _VC_MAN
3660: 49 46 45 53 54 5f 45 4d 42 45 44 5f 7b 44 4c 4c IFEST_EMBED_{DLL
3670: 2c 45 58 45 7d 20 2d 20 63 6f 6d 6d 61 6e 64 73 ,EXE} - commands
3680: 20 66 6f 72 20 65 6d 62 65 64 64 69 6e 67 20 61 for embedding a
3690: 20 6d 61 6e 69 66 65 73 74 20 69 66 20 6e 65 65 manifest if nee
36a0: 64 65 64 0a 0a 63 63 33 32 09 09 3d 20 24 28 43 ded..cc32..= $(C
36b0: 43 29 20 20 20 23 20 62 75 69 6c 74 2d 69 6e 20 C) # built-in
36c0: 64 65 66 61 75 6c 74 2e 0a 6c 69 6e 6b 33 32 09 default..link32.
36d0: 09 3d 20 6c 69 6e 6b 0a 6c 69 62 33 32 09 09 3d .= link.lib32..=
36e0: 20 6c 69 62 0a 72 63 33 32 09 09 3d 20 24 28 52 lib.rc32..= $(R
36f0: 43 29 20 20 20 23 20 62 75 69 6c 74 2d 69 6e 20 C) # built-in
3700: 64 65 66 61 75 6c 74 2e 0a 0a 23 2d 2d 2d 2d 2d default...#-----
3710: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3720: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3730: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3740: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 46 69 -----------.# Fi
3750: 67 75 72 65 20 6f 75 74 20 74 68 65 20 63 6f 6d gure out the com
3760: 70 69 6c 65 72 20 61 72 63 68 69 74 65 63 74 75 piler architectu
3770: 72 65 20 61 6e 64 20 76 65 72 73 69 6f 6e 20 62 re and version b
3780: 79 20 77 72 69 74 69 6e 67 0a 23 20 74 68 65 20 y writing.# the
3790: 43 20 6d 61 63 72 6f 73 20 74 6f 20 61 20 66 69 C macros to a fi
37a0: 6c 65 2c 20 70 72 65 70 72 6f 63 65 73 73 69 6e le, preprocessin
37b0: 67 20 74 68 65 6d 20 77 69 74 68 20 74 68 65 20 g them with the
37c0: 43 0a 23 20 70 72 65 70 72 6f 63 65 73 73 6f 72 C.# preprocessor
37d0: 20 61 6e 64 20 72 65 61 64 69 6e 67 20 62 61 63 and reading bac
37e0: 6b 20 74 68 65 20 63 72 65 61 74 65 64 20 66 69 k the created fi
37f0: 6c 65 0a 0a 5f 48 41 53 48 3d 5e 23 0a 5f 56 43 le.._HASH=^#._VC
3800: 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 44 5f _MANIFEST_EMBED_
3810: 45 58 45 3d 0a 5f 56 43 5f 4d 41 4e 49 46 45 53 EXE=._VC_MANIFES
3820: 54 5f 45 4d 42 45 44 5f 44 4c 4c 3d 0a 56 43 56 T_EMBED_DLL=.VCV
3830: 45 52 3d 30 0a 21 69 66 20 21 5b 65 63 68 6f 20 ER=0.!if ![echo
3840: 56 43 56 45 52 53 49 4f 4e 3d 5f 4d 53 43 5f 56 VCVERSION=_MSC_V
3850: 45 52 20 3e 20 76 65 72 63 6c 2e 78 5d 20 5c 0a ER > vercl.x] \.
3860: 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20 24 28 && ![echo $(
3870: 5f 48 41 53 48 29 69 66 20 64 65 66 69 6e 65 64 _HASH)if defined
3880: 28 5f 4d 5f 49 58 38 36 29 20 3e 3e 20 76 65 72 (_M_IX86) >> ver
3890: 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20 21 cl.x] \. && !
38a0: 5b 65 63 68 6f 20 41 52 43 48 3d 49 58 38 36 20 [echo ARCH=IX86
38b0: 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 5c 0a 20 20 >> vercl.x] \.
38c0: 20 20 26 26 20 21 5b 65 63 68 6f 20 24 28 5f 48 && ![echo $(_H
38d0: 41 53 48 29 65 6c 69 66 20 64 65 66 69 6e 65 64 ASH)elif defined
38e0: 28 5f 4d 5f 41 4d 44 36 34 29 20 3e 3e 20 76 65 (_M_AMD64) >> ve
38f0: 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 26 20 rcl.x] \. &&
3900: 21 5b 65 63 68 6f 20 41 52 43 48 3d 41 4d 44 36 ![echo ARCH=AMD6
3910: 34 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 5c 0a 4 >> vercl.x] \.
3920: 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20 24 28 && ![echo $(
3930: 5f 48 41 53 48 29 65 6c 69 66 20 64 65 66 69 6e _HASH)elif defin
3940: 65 64 28 5f 4d 5f 41 52 4d 36 34 29 20 3e 3e 20 ed(_M_ARM64) >>
3950: 76 65 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 26 vercl.x] \. &
3960: 26 20 21 5b 65 63 68 6f 20 41 52 43 48 3d 41 52 & ![echo ARCH=AR
3970: 4d 36 34 20 3e 3e 20 76 65 72 63 6c 2e 78 5d 20 M64 >> vercl.x]
3980: 5c 0a 20 20 20 20 26 26 20 21 5b 65 63 68 6f 20 \. && ![echo
3990: 24 28 5f 48 41 53 48 29 65 6e 64 69 66 20 3e 3e $(_HASH)endif >>
39a0: 20 76 65 72 63 6c 2e 78 5d 20 5c 0a 20 20 20 20 vercl.x] \.
39b0: 26 26 20 21 5b 24 28 63 63 33 32 29 20 2d 6e 6f && ![$(cc32) -no
39c0: 6c 6f 67 6f 20 2d 54 43 20 2d 50 20 76 65 72 63 logo -TC -P verc
39d0: 6c 2e 78 20 32 3e 4e 55 4c 5d 0a 21 69 6e 63 6c l.x 2>NUL].!incl
39e0: 75 64 65 20 76 65 72 63 6c 2e 69 0a 21 69 66 20 ude vercl.i.!if
39f0: 24 28 56 43 56 45 52 53 49 4f 4e 29 20 3c 20 31 $(VCVERSION) < 1
3a00: 39 30 30 0a 21 69 66 20 21 5b 65 63 68 6f 20 56 900.!if ![echo V
3a10: 43 56 45 52 3d 20 5e 5c 3e 20 76 65 72 63 6c 2e CVER= ^\> vercl.
3a20: 76 63 5d 20 5c 0a 20 20 20 20 26 26 20 21 5b 73 vc] \. && ![s
3a30: 65 74 20 2f 61 20 24 28 56 43 56 45 52 53 49 4f et /a $(VCVERSIO
3a40: 4e 29 20 2f 20 31 30 30 20 2d 20 36 20 3e 3e 20 N) / 100 - 6 >>
3a50: 76 65 72 63 6c 2e 76 63 5d 0a 21 69 6e 63 6c 75 vercl.vc].!inclu
3a60: 64 65 20 76 65 72 63 6c 2e 76 63 0a 21 65 6e 64 de vercl.vc.!end
3a70: 69 66 0a 21 65 6c 73 65 0a 23 20 54 68 65 20 73 if.!else.# The s
3a80: 69 6d 70 6c 65 20 63 61 6c 63 75 6c 61 74 69 6f imple calculatio
3a90: 6e 20 61 62 6f 76 65 20 64 6f 65 73 20 6e 6f 74 n above does not
3aa0: 20 61 70 70 6c 79 20 74 6f 20 6e 65 77 20 56 69 apply to new Vi
3ab0: 73 75 61 6c 20 53 74 75 64 69 6f 20 72 65 6c 65 sual Studio rele
3ac0: 61 73 65 73 0a 23 20 4b 65 65 70 20 74 68 65 20 ases.# Keep the
3ad0: 63 6f 6d 70 69 6c 65 72 20 76 65 72 73 69 6f 6e compiler version
3ae0: 20 69 6e 20 69 74 73 20 6e 61 74 69 76 65 20 66 in its native f
3af0: 6f 72 6d 2e 0a 56 43 56 45 52 20 3d 20 24 28 56 orm..VCVER = $(V
3b00: 43 56 45 52 53 49 4f 4e 29 0a 21 65 6e 64 69 66 CVERSION).!endif
3b10: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 21 5b 64 .!endif..!if ![d
3b20: 65 6c 20 32 3e 4e 55 4c 20 2f 71 2f 66 20 76 65 el 2>NUL /q/f ve
3b30: 72 63 6c 2e 78 20 76 65 72 63 6c 2e 69 20 76 65 rcl.x vercl.i ve
3b40: 72 63 6c 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 0a rcl.vc].!endif..
3b50: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d #---------------
3b60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3b70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3b80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3b90: 2d 0a 23 20 54 68 65 20 4d 41 43 48 49 4e 45 20 -.# The MACHINE
3ba0: 6d 61 63 72 6f 20 69 73 20 75 73 65 64 20 62 79 macro is used by
3bb0: 20 6c 65 67 61 63 79 20 6d 61 6b 65 66 69 6c 65 legacy makefile
3bc0: 73 20 73 6f 20 73 65 74 20 69 74 20 61 73 20 77 s so set it as w
3bd0: 65 6c 6c 0a 21 69 66 64 65 66 20 4d 41 43 48 49 ell.!ifdef MACHI
3be0: 4e 45 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e NE.!if "$(MACHIN
3bf0: 45 29 22 20 3d 3d 20 22 78 38 36 22 0a 21 75 6e E)" == "x86".!un
3c00: 64 65 66 20 4d 41 43 48 49 4e 45 0a 4d 41 43 48 def MACHINE.MACH
3c10: 49 4e 45 20 3d 20 49 58 38 36 0a 21 65 6c 73 65 INE = IX86.!else
3c20: 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 if "$(MACHINE)"
3c30: 3d 3d 20 22 61 72 6d 36 34 22 0a 21 75 6e 64 65 == "arm64".!unde
3c40: 66 20 4d 41 43 48 49 4e 45 0a 4d 41 43 48 49 4e f MACHINE.MACHIN
3c50: 45 20 3d 20 41 52 4d 36 34 0a 21 65 6c 73 65 69 E = ARM64.!elsei
3c60: 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d f "$(MACHINE)" =
3c70: 3d 20 22 78 36 34 22 0a 21 75 6e 64 65 66 20 4d = "x64".!undef M
3c80: 41 43 48 49 4e 45 0a 4d 41 43 48 49 4e 45 20 3d ACHINE.MACHINE =
3c90: 20 41 4d 44 36 34 0a 21 65 6e 64 69 66 0a 21 69 AMD64.!endif.!i
3ca0: 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 21 f "$(MACHINE)" !
3cb0: 3d 20 22 24 28 41 52 43 48 29 22 0a 21 65 72 72 = "$(ARCH)".!err
3cc0: 6f 72 20 53 70 65 63 69 66 69 65 64 20 4d 41 43 or Specified MAC
3cd0: 48 49 4e 45 20 6d 61 63 72 6f 20 24 28 4d 41 43 HINE macro $(MAC
3ce0: 48 49 4e 45 29 20 64 6f 65 73 20 6e 6f 74 20 6d HINE) does not m
3cf0: 61 74 63 68 20 64 65 74 65 63 74 65 64 20 74 61 atch detected ta
3d00: 72 67 65 74 20 61 72 63 68 69 74 65 63 74 75 72 rget architectur
3d10: 65 20 24 28 41 52 43 48 29 2e 0a 21 65 6e 64 69 e $(ARCH)..!endi
3d20: 66 0a 21 65 6c 73 65 0a 4d 41 43 48 49 4e 45 3d f.!else.MACHINE=
3d30: 24 28 41 52 43 48 29 0a 21 65 6e 64 69 66 0a 0a $(ARCH).!endif..
3d40: 23 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 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3d80: 0a 23 20 54 68 65 20 50 4c 41 54 46 4f 52 4d 5f .# The PLATFORM_
3d90: 49 44 45 4e 54 49 46 59 20 6d 61 63 72 6f 20 6d IDENTIFY macro m
3da0: 61 74 63 68 65 73 20 74 68 65 20 76 61 6c 75 65 atches the value
3db0: 73 20 72 65 74 75 72 6e 65 64 20 62 79 0a 23 20 s returned by.#
3dc0: 74 68 65 20 54 63 6c 20 70 6c 61 74 66 6f 72 6d the Tcl platform
3dd0: 3a 3a 69 64 65 6e 74 69 66 79 20 63 6f 6d 6d 61 ::identify comma
3de0: 6e 64 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e nd.!if "$(MACHIN
3df0: 45 29 22 20 3d 3d 20 22 41 4d 44 36 34 22 0a 50 E)" == "AMD64".P
3e00: 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 59 LATFORM_IDENTIFY
3e10: 20 3d 20 77 69 6e 33 32 2d 78 38 36 5f 36 34 0a = win32-x86_64.
3e20: 21 65 6c 73 65 69 66 20 22 24 28 4d 41 43 48 49 !elseif "$(MACHI
3e30: 4e 45 29 22 20 3d 3d 20 22 41 52 4d 36 34 22 0a NE)" == "ARM64".
3e40: 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 PLATFORM_IDENTIF
3e50: 59 20 3d 20 77 69 6e 33 32 2d 61 72 6d 0a 21 65 Y = win32-arm.!e
3e60: 6c 73 65 0a 50 4c 41 54 46 4f 52 4d 5f 49 44 45 lse.PLATFORM_IDE
3e70: 4e 54 49 46 59 20 3d 20 77 69 6e 33 32 2d 69 78 NTIFY = win32-ix
3e80: 38 36 0a 21 65 6e 64 69 66 0a 0a 23 20 54 68 65 86.!endif..# The
3e90: 20 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d 20 6d MULTIPLATFORM m
3ea0: 61 63 72 6f 20 63 6f 6e 74 72 6f 6c 73 20 77 68 acro controls wh
3eb0: 65 74 68 65 72 20 62 69 6e 61 72 79 20 65 78 74 ether binary ext
3ec0: 65 6e 73 69 6f 6e 73 20 61 72 65 20 69 6e 73 74 ensions are inst
3ed0: 61 6c 6c 65 64 0a 23 20 69 6e 20 70 6c 61 74 66 alled.# in platf
3ee0: 6f 72 6d 2d 73 70 65 63 69 66 69 63 20 64 69 72 orm-specific dir
3ef0: 65 63 74 6f 72 69 65 73 2e 20 49 6e 74 65 6e 64 ectories. Intend
3f00: 65 64 20 74 6f 20 62 65 20 73 65 74 2f 75 73 65 ed to be set/use
3f10: 64 20 62 79 20 65 78 74 65 6e 73 69 6f 6e 73 2e d by extensions.
3f20: 0a 21 69 66 6e 64 65 66 20 4d 55 4c 54 49 50 4c .!ifndef MULTIPL
3f30: 41 54 46 4f 52 4d 5f 49 4e 53 54 41 4c 4c 0a 4d ATFORM_INSTALL.M
3f40: 55 4c 54 49 50 4c 41 54 46 4f 52 4d 5f 49 4e 53 ULTIPLATFORM_INS
3f50: 54 41 4c 4c 20 3d 20 30 0a 21 65 6e 64 69 66 0a TALL = 0.!endif.
3f60: 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d .#--------------
3f70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3f80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3f90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 --------------.#
3fa0: 20 46 69 67 75 72 65 20 6f 75 74 20 74 68 65 20 Figure out the
3fb0: 2a 68 6f 73 74 2a 20 61 72 63 68 69 74 65 63 74 *host* architect
3fc0: 75 72 65 20 62 79 20 72 65 61 64 69 6e 67 20 74 ure by reading t
3fd0: 68 65 20 72 65 67 69 73 74 72 79 0a 0a 21 69 66 he registry..!if
3fe0: 20 21 5b 72 65 67 20 71 75 65 72 79 20 48 4b 4c ![reg query HKL
3ff0: 4d 5c 48 61 72 64 77 61 72 65 5c 44 65 73 63 72 M\Hardware\Descr
4000: 69 70 74 69 6f 6e 5c 53 79 73 74 65 6d 5c 43 65 iption\System\Ce
4010: 6e 74 72 61 6c 50 72 6f 63 65 73 73 6f 72 5c 30 ntralProcessor\0
4020: 20 2f 76 20 49 64 65 6e 74 69 66 69 65 72 20 7c /v Identifier |
4030: 20 66 69 6e 64 73 74 72 20 2f 69 20 78 38 36 5d findstr /i x86]
4040: 0a 4e 41 54 49 56 45 5f 41 52 43 48 3d 49 58 38 .NATIVE_ARCH=IX8
4050: 36 0a 21 65 6c 73 65 69 66 20 21 5b 72 65 67 20 6.!elseif ![reg
4060: 71 75 65 72 79 20 48 4b 4c 4d 5c 48 61 72 64 77 query HKLM\Hardw
4070: 61 72 65 5c 44 65 73 63 72 69 70 74 69 6f 6e 5c are\Description\
4080: 53 79 73 74 65 6d 5c 43 65 6e 74 72 61 6c 50 72 System\CentralPr
4090: 6f 63 65 73 73 6f 72 5c 30 20 2f 76 20 49 64 65 ocessor\0 /v Ide
40a0: 6e 74 69 66 69 65 72 20 7c 20 66 69 6e 64 73 74 ntifier | findst
40b0: 72 20 2f 69 20 41 52 4d 20 7c 20 66 69 6e 64 73 r /i ARM | finds
40c0: 74 72 20 2f 69 20 36 34 2d 62 69 74 5d 0a 4e 41 tr /i 64-bit].NA
40d0: 54 49 56 45 5f 41 52 43 48 3d 41 52 4d 36 34 0a TIVE_ARCH=ARM64.
40e0: 21 65 6c 73 65 0a 4e 41 54 49 56 45 5f 41 52 43 !else.NATIVE_ARC
40f0: 48 3d 41 4d 44 36 34 0a 21 65 6e 64 69 66 0a 0a H=AMD64.!endif..
4100: 23 20 53 69 6e 63 65 20 4d 53 56 43 38 20 77 65 # Since MSVC8 we
4110: 20 6d 75 73 74 20 64 65 61 6c 20 77 69 74 68 20 must deal with
4120: 6d 61 6e 69 66 65 73 74 20 72 65 73 6f 75 72 63 manifest resourc
4130: 65 73 2e 0a 21 69 66 20 24 28 56 43 56 45 52 53 es..!if $(VCVERS
4140: 49 4f 4e 29 20 3e 3d 20 31 34 30 30 0a 5f 56 43 ION) >= 1400._VC
4150: 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 44 5f _MANIFEST_EMBED_
4160: 45 58 45 3d 69 66 20 65 78 69 73 74 20 24 40 2e EXE=if exist $@.
4170: 6d 61 6e 69 66 65 73 74 20 6d 74 20 2d 6e 6f 6c manifest mt -nol
4180: 6f 67 6f 20 2d 6d 61 6e 69 66 65 73 74 20 24 40 ogo -manifest $@
4190: 2e 6d 61 6e 69 66 65 73 74 20 2d 6f 75 74 70 75 .manifest -outpu
41a0: 74 72 65 73 6f 75 72 63 65 3a 24 40 3b 31 0a 5f tresource:$@;1._
41b0: 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 VC_MANIFEST_EMBE
41c0: 44 5f 44 4c 4c 3d 69 66 20 65 78 69 73 74 20 24 D_DLL=if exist $
41d0: 40 2e 6d 61 6e 69 66 65 73 74 20 6d 74 20 2d 6e @.manifest mt -n
41e0: 6f 6c 6f 67 6f 20 2d 6d 61 6e 69 66 65 73 74 20 ologo -manifest
41f0: 24 40 2e 6d 61 6e 69 66 65 73 74 20 2d 6f 75 74 [email protected] -out
4200: 70 75 74 72 65 73 6f 75 72 63 65 3a 24 40 3b 32 putresource:$@;2
4210: 0a 21 65 6e 64 69 66 0a 0a 23 23 23 23 23 23 23 .!endif..#######
4220: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
4230: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
4240: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
4250: 23 23 23 23 23 23 23 23 23 0a 23 20 34 2e 20 42 #########.# 4. B
4260: 75 69 6c 64 20 74 68 65 20 6e 6d 61 6b 65 68 6c uild the nmakehl
4270: 70 20 70 72 6f 67 72 61 6d 0a 23 20 54 68 69 73 p program.# This
4280: 20 69 73 20 61 20 68 65 6c 70 65 72 20 61 70 70 is a helper app
4290: 20 77 65 20 6e 65 65 64 20 74 6f 20 6f 76 65 72 we need to over
42a0: 63 6f 6d 65 20 6e 6d 61 6b 65 27 73 20 6c 69 6d come nmake's lim
42b0: 69 74 69 6e 67 0a 23 20 65 6e 76 69 72 6f 6e 6d iting.# environm
42c0: 65 6e 74 2e 20 57 65 20 77 69 6c 6c 20 63 61 6c ent. We will cal
42d0: 6c 20 6f 75 74 20 74 6f 20 69 74 20 74 6f 20 67 l out to it to g
42e0: 65 74 20 76 61 72 69 6f 75 73 20 62 69 74 73 20 et various bits
42f0: 6f 66 0a 23 20 69 6e 66 6f 72 6d 61 74 69 6f 6e of.# information
4300: 20 61 62 6f 75 74 20 73 75 70 70 6f 72 74 65 64 about supported
4310: 20 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69 6f 6e compiler option
4320: 73 20 65 74 63 2e 0a 23 0a 23 20 54 63 6c 20 69 s etc..#.# Tcl i
4330: 74 73 65 6c 66 20 77 69 6c 6c 20 61 6c 77 61 79 tself will alway
4340: 73 20 75 73 65 20 74 68 65 20 6e 6d 61 6b 65 68 s use the nmakeh
4350: 6c 70 2e 63 20 70 72 6f 67 72 61 6d 20 77 68 69 lp.c program whi
4360: 63 68 20 69 73 0a 23 20 69 6e 20 69 74 73 20 6f ch is.# in its o
4370: 77 6e 20 73 6f 75 72 63 65 2e 20 49 74 20 77 69 wn source. It wi
4380: 6c 6c 20 62 65 20 6b 65 70 74 20 75 70 64 61 74 ll be kept updat
4390: 65 64 20 74 68 65 72 65 2e 0a 23 0a 23 20 45 78 ed there..#.# Ex
43a0: 74 65 6e 73 69 6f 6e 73 20 62 75 69 6c 74 20 61 tensions built a
43b0: 67 61 69 6e 73 74 20 61 6e 20 69 6e 73 74 61 6c gainst an instal
43c0: 6c 65 64 20 54 63 6c 20 77 69 6c 6c 20 75 73 65 led Tcl will use
43d0: 20 74 68 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23 the installed.#
43e0: 20 63 6f 70 79 20 6f 66 20 54 63 6c 27 73 20 6e copy of Tcl's n
43f0: 6d 61 6b 65 68 6c 70 2e 63 20 69 66 20 74 68 65 makehlp.c if the
4400: 72 65 20 69 73 20 6f 6e 65 20 61 6e 64 20 74 68 re is one and th
4410: 65 69 72 20 6f 77 6e 20 76 65 72 73 69 6f 6e 0a eir own version.
4420: 23 20 6f 74 68 65 72 77 69 73 65 2e 20 49 6e 20 # otherwise. In
4430: 74 68 65 20 6c 61 74 74 65 72 20 63 61 73 65 2c the latter case,
4440: 20 74 68 65 79 20 77 6f 75 6c 64 20 61 6c 73 6f they would also
4450: 20 62 65 20 75 73 69 6e 67 20 74 68 65 69 72 20 be using their
4460: 6f 77 6e 0a 23 20 72 75 6c 65 73 2e 76 63 2e 20 own.# rules.vc.
4470: 4e 6f 74 65 20 74 68 61 74 20 6f 6c 64 65 72 20 Note that older
4480: 76 65 72 73 69 6f 6e 73 20 6f 66 20 54 63 6c 20 versions of Tcl
4490: 64 6f 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 20 6e do not install n
44a0: 6d 61 6b 65 68 6c 70 2e 63 0a 23 20 6f 72 20 72 makehlp.c.# or r
44b0: 75 6c 65 73 2e 76 63 2e 0a 23 0a 23 20 45 78 74 ules.vc..#.# Ext
44c0: 65 6e 73 69 6f 6e 73 20 62 75 69 6c 74 20 61 67 ensions built ag
44d0: 61 69 6e 73 74 20 54 63 6c 20 73 6f 75 72 63 65 ainst Tcl source
44e0: 73 20 77 69 6c 6c 20 75 73 65 20 74 68 65 20 6f s will use the o
44f0: 6e 65 20 66 72 6f 6d 20 74 68 65 20 54 63 6c 20 ne from the Tcl
4500: 73 6f 75 72 63 65 2e 0a 23 0a 23 20 57 68 65 6e source..#.# When
4510: 20 62 75 69 6c 64 69 6e 67 20 61 6e 20 65 78 74 building an ext
4520: 65 6e 73 69 6f 6e 20 75 73 69 6e 67 20 61 20 73 ension using a s
4530: 75 66 66 69 63 69 65 6e 74 6c 79 20 6e 65 77 20 ufficiently new
4540: 76 65 72 73 69 6f 6e 20 6f 66 20 54 63 6c 2c 0a version of Tcl,.
4550: 23 20 72 75 6c 65 73 2d 65 78 74 2e 76 63 20 77 # rules-ext.vc w
4560: 69 6c 6c 20 64 65 66 69 6e 65 20 4e 4d 41 4b 45 ill define NMAKE
4570: 48 4c 50 43 20 61 70 70 72 6f 70 72 69 61 74 65 HLPC appropriate
4580: 6c 79 20 74 6f 20 70 6f 69 6e 74 20 74 6f 20 74 ly to point to t
4590: 68 65 0a 23 20 63 6f 70 79 20 6f 66 20 6e 6d 61 he.# copy of nma
45a0: 6b 65 68 6c 70 2e 63 20 74 6f 20 62 65 20 75 73 kehlp.c to be us
45b0: 65 64 2e 0a 0a 21 69 66 6e 64 65 66 20 4e 4d 41 ed...!ifndef NMA
45c0: 4b 45 48 4c 50 43 0a 23 20 44 65 66 61 75 6c 74 KEHLPC.# Default
45d0: 20 74 6f 20 74 68 65 20 6f 6e 65 20 69 6e 20 74 to the one in t
45e0: 68 65 20 63 75 72 72 65 6e 74 20 64 69 72 65 63 he current direc
45f0: 74 6f 72 79 20 28 74 68 65 20 65 78 74 65 6e 73 tory (the extens
4600: 69 6f 6e 27 73 20 6f 77 6e 20 6e 6d 61 6b 65 68 ion's own nmakeh
4610: 6c 70 2e 63 29 0a 4e 4d 41 4b 45 48 4c 50 43 20 lp.c).NMAKEHLPC
4620: 3d 20 6e 6d 61 6b 65 68 6c 70 2e 63 0a 0a 21 69 = nmakehlp.c..!i
4630: 66 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0a f !$(DOING_TCL).
4640: 21 69 66 20 24 28 54 43 4c 49 4e 53 54 41 4c 4c !if $(TCLINSTALL
4650: 29 0a 21 69 66 20 65 78 69 73 74 28 22 24 28 5f ).!if exist("$(_
4660: 54 43 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d 61 6b TCLDIR)\lib\nmak
4670: 65 5c 6e 6d 61 6b 65 68 6c 70 2e 63 22 29 0a 4e e\nmakehlp.c").N
4680: 4d 41 4b 45 48 4c 50 43 20 3d 20 24 28 5f 54 43 MAKEHLPC = $(_TC
4690: 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c LDIR)\lib\nmake\
46a0: 6e 6d 61 6b 65 68 6c 70 2e 63 0a 21 65 6e 64 69 nmakehlp.c.!endi
46b0: 66 0a 21 65 6c 73 65 20 23 20 21 24 28 54 43 4c f.!else # !$(TCL
46c0: 49 4e 53 54 41 4c 4c 29 0a 21 69 66 20 65 78 69 INSTALL).!if exi
46d0: 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29 5c 77 st("$(_TCLDIR)\w
46e0: 69 6e 5c 6e 6d 61 6b 65 68 6c 70 2e 63 22 29 0a in\nmakehlp.c").
46f0: 4e 4d 41 4b 45 48 4c 50 43 20 3d 20 24 28 5f 54 NMAKEHLPC = $(_T
4700: 43 4c 44 49 52 29 5c 77 69 6e 5c 6e 6d 61 6b 65 CLDIR)\win\nmake
4710: 68 6c 70 2e 63 0a 21 65 6e 64 69 66 0a 21 65 6e hlp.c.!endif.!en
4720: 64 69 66 20 23 20 24 28 54 43 4c 49 4e 53 54 41 dif # $(TCLINSTA
4730: 4c 4c 29 0a 21 65 6e 64 69 66 20 23 20 21 24 28 LL).!endif # !$(
4740: 44 4f 49 4e 47 5f 54 43 4c 29 0a 0a 21 65 6e 64 DOING_TCL)..!end
4750: 69 66 20 23 20 4e 4d 41 4b 45 48 4c 50 43 0a 0a if # NMAKEHLPC..
4760: 23 20 57 65 20 61 6c 77 61 79 73 20 62 75 69 6c # We always buil
4770: 64 20 6e 6d 61 6b 65 68 6c 70 20 65 76 65 6e 20 d nmakehlp even
4780: 69 66 20 69 74 20 65 78 69 73 74 73 20 73 69 6e if it exists sin
4790: 63 65 20 77 65 20 64 6f 20 6e 6f 74 20 6b 6e 6f ce we do not kno
47a0: 77 0a 23 20 77 68 61 74 20 73 6f 75 72 63 65 20 w.# what source
47b0: 69 74 20 77 61 73 20 62 75 69 6c 74 20 66 72 6f it was built fro
47c0: 6d 2e 0a 21 69 66 20 5b 24 28 63 63 33 32 29 20 m..!if [$(cc32)
47d0: 2d 6e 6f 6c 6f 67 6f 20 2d 44 4e 44 45 42 55 47 -nologo -DNDEBUG
47e0: 20 22 24 28 4e 4d 41 4b 45 48 4c 50 43 29 22 20 "$(NMAKEHLPC)"
47f0: 2d 6c 69 6e 6b 20 2d 73 75 62 73 79 73 74 65 6d -link -subsystem
4800: 3a 63 6f 6e 73 6f 6c 65 20 3e 20 6e 75 6c 5d 0a :console > nul].
4810: 21 65 6e 64 69 66 0a 0a 23 23 23 23 23 23 23 23 !endif..########
4820: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
4830: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
4840: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
4850: 23 23 23 23 23 23 23 23 0a 23 20 35 2e 20 54 65 ########.# 5. Te
4860: 73 74 20 66 6f 72 20 63 6f 6d 70 69 6c 65 72 20 st for compiler
4870: 66 65 61 74 75 72 65 73 0a 23 20 56 69 73 75 61 features.# Visua
4880: 6c 20 43 2b 2b 20 63 6f 6d 70 69 6c 65 72 20 6f l C++ compiler o
4890: 70 74 69 6f 6e 73 20 68 61 76 65 20 63 68 61 6e ptions have chan
48a0: 67 65 64 20 6f 76 65 72 20 74 68 65 20 79 65 61 ged over the yea
48b0: 72 73 2e 20 43 68 65 63 6b 0a 23 20 77 68 69 63 rs. Check.# whic
48c0: 68 20 6f 70 74 69 6f 6e 73 20 61 72 65 20 73 75 h options are su
48d0: 70 70 6f 72 74 65 64 20 62 79 20 74 68 65 20 63 pported by the c
48e0: 6f 6d 70 69 6c 65 72 20 69 6e 20 75 73 65 2e 0a ompiler in use..
48f0: 23 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e #.# The followin
4900: 67 20 6d 61 63 72 6f 73 20 61 72 65 20 73 65 74 g macros are set
4910: 3a 0a 23 20 4f 50 54 49 4d 49 5a 41 54 49 4f 4e :.# OPTIMIZATION
4920: 53 20 2d 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 S - the compiler
4930: 20 66 6c 61 67 73 20 74 6f 20 62 65 20 75 73 65 flags to be use
4940: 64 20 66 6f 72 20 6f 70 74 69 6d 69 7a 65 64 20 d for optimized
4950: 62 75 69 6c 64 73 0a 23 20 44 45 42 55 47 46 4c builds.# DEBUGFL
4960: 41 47 53 20 2d 20 74 68 65 20 63 6f 6d 70 69 6c AGS - the compil
4970: 65 72 20 66 6c 61 67 73 20 74 6f 20 62 65 20 75 er flags to be u
4980: 73 65 64 20 66 6f 72 20 64 65 62 75 67 20 62 75 sed for debug bu
4990: 69 6c 64 73 0a 23 20 4c 49 4e 4b 45 52 46 4c 41 ilds.# LINKERFLA
49a0: 47 53 20 2d 20 46 6c 61 67 73 20 70 61 73 73 65 GS - Flags passe
49b0: 64 20 74 6f 20 74 68 65 20 6c 69 6e 6b 65 72 0a d to the linker.
49c0: 23 0a 23 20 4e 6f 74 65 20 74 68 61 74 20 74 68 #.# Note that th
49d0: 65 73 65 20 61 72 65 20 74 68 65 20 63 6f 6d 70 ese are the comp
49e0: 69 6c 65 72 20 73 65 74 74 69 6e 67 73 20 2a 61 iler settings *a
49f0: 76 61 69 6c 61 62 6c 65 2a 2c 20 6e 6f 74 20 74 vailable*, not t
4a00: 68 6f 73 65 0a 23 20 74 68 61 74 20 77 69 6c 6c hose.# that will
4a10: 20 62 65 20 2a 75 73 65 64 2a 2e 20 54 68 65 20 be *used*. The
4a20: 6c 61 74 74 65 72 20 64 65 70 65 6e 64 73 20 6f latter depends o
4a30: 6e 20 74 68 65 20 4f 50 54 53 20 6d 61 63 72 6f n the OPTS macro
4a40: 20 73 65 74 74 69 6e 67 73 0a 23 20 77 68 69 63 settings.# whic
4a50: 68 20 77 65 20 68 61 76 65 20 6e 6f 74 20 79 65 h we have not ye
4a60: 74 20 70 61 72 73 65 64 2e 0a 23 0a 23 20 41 6c t parsed..#.# Al
4a70: 73 6f 20 6e 6f 74 65 20 74 68 61 74 20 73 6f 6d so note that som
4a80: 65 20 6f 66 20 74 68 65 20 66 6c 61 67 73 20 69 e of the flags i
4a90: 6e 20 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 20 n OPTIMIZATIONS
4aa0: 61 72 65 20 6e 6f 74 20 72 65 61 6c 6c 79 0a 23 are not really.#
4ab0: 20 72 65 6c 61 74 65 64 20 74 6f 20 6f 70 74 69 related to opti
4ac0: 6d 69 7a 61 74 69 6f 6e 2e 20 54 68 65 79 20 61 mization. They a
4ad0: 72 65 20 70 6c 61 63 65 64 20 74 68 65 72 65 20 re placed there
4ae0: 6f 6e 6c 79 20 66 6f 72 20 6c 65 67 61 63 79 20 only for legacy
4af0: 72 65 61 73 6f 6e 73 0a 23 20 61 73 20 73 6f 6d reasons.# as som
4b00: 65 20 65 78 74 65 6e 73 69 6f 6e 73 20 65 78 70 e extensions exp
4b10: 65 63 74 20 74 68 65 6d 20 74 6f 20 62 65 20 69 ect them to be i
4b20: 6e 63 6c 75 64 65 64 20 69 6e 20 74 68 61 74 20 ncluded in that
4b30: 6d 61 63 72 6f 2e 0a 0a 23 20 2d 4f 70 20 69 6d macro...# -Op im
4b40: 70 72 6f 76 65 73 20 66 6c 6f 61 74 20 63 6f 6e proves float con
4b50: 73 69 73 74 65 6e 63 79 2e 20 4e 6f 74 65 20 6f sistency. Note o
4b60: 6e 6c 79 20 6e 65 65 64 65 64 20 66 6f 72 20 6f nly needed for o
4b70: 6c 64 65 72 20 63 6f 6d 70 69 6c 65 72 73 0a 23 lder compilers.#
4b80: 20 4e 65 77 65 72 20 63 6f 6d 70 69 6c 65 72 73 Newer compilers
4b90: 20 64 6f 20 6e 6f 74 20 6e 65 65 64 20 6f 72 20 do not need or
4ba0: 73 75 70 70 6f 72 74 20 74 68 69 73 20 6f 70 74 support this opt
4bb0: 69 6f 6e 2e 0a 21 69 66 20 5b 24 28 4e 4d 41 4b ion..!if [$(NMAK
4bc0: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 63 20 EHLP_NATIVE) -c
4bd0: 2d 4f 70 5d 0a 46 50 4f 50 54 53 20 20 3d 20 2d -Op].FPOPTS = -
4be0: 4f 70 0a 21 65 6e 64 69 66 0a 0a 23 20 53 74 72 Op.!endif..# Str
4bf0: 69 63 74 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 ict floating poi
4c00: 6e 74 20 73 65 6d 61 6e 74 69 63 73 20 2d 20 70 nt semantics - p
4c10: 72 65 73 65 6e 74 20 69 6e 20 6e 65 77 65 72 20 resent in newer
4c20: 63 6f 6d 70 69 6c 65 72 73 20 69 6e 20 6c 69 65 compilers in lie
4c30: 75 20 6f 66 20 2d 4f 70 0a 21 69 66 20 5b 24 28 u of -Op.!if [$(
4c40: 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 NMAKEHLP_NATIVE)
4c50: 20 2d 63 20 2d 66 70 3a 73 74 72 69 63 74 5d 0a -c -fp:strict].
4c60: 46 50 4f 50 54 53 20 20 3d 20 24 28 46 50 4f 50 FPOPTS = $(FPOP
4c70: 54 53 29 20 2d 66 70 3a 73 74 72 69 63 74 0a 21 TS) -fp:strict.!
4c80: 65 6e 64 69 66 0a 0a 21 69 66 20 22 24 28 4d 41 endif..!if "$(MA
4c90: 43 48 49 4e 45 29 22 20 3d 3d 20 22 49 58 38 36 CHINE)" == "IX86
4ca0: 22 0a 23 23 23 20 74 65 73 74 20 66 6f 72 20 70 ".### test for p
4cb0: 65 6e 74 69 75 6d 20 65 72 72 61 74 61 0a 21 69 entium errata.!i
4cc0: 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 f [$(NMAKEHLP_NA
4cd0: 54 49 56 45 29 20 2d 63 20 2d 51 49 30 66 5d 0a TIVE) -c -QI0f].
4ce0: 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 43 6f 6d !message *** Com
4cf0: 70 69 6c 65 72 20 68 61 73 20 27 50 65 6e 74 69 piler has 'Penti
4d00: 75 6d 20 30 78 30 66 20 66 69 78 27 0a 46 50 4f um 0x0f fix'.FPO
4d10: 50 54 53 20 20 3d 20 24 28 46 50 4f 50 54 53 29 PTS = $(FPOPTS)
4d20: 20 2d 51 49 30 66 0a 21 65 6c 73 65 0a 21 6d 65 -QI0f.!else.!me
4d30: 73 73 61 67 65 20 2a 2a 2a 20 43 6f 6d 70 69 6c ssage *** Compil
4d40: 65 72 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 er does not have
4d50: 20 27 50 65 6e 74 69 75 6d 20 30 78 30 66 20 66 'Pentium 0x0f f
4d60: 69 78 27 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 ix'.!endif.!endi
4d70: 66 0a 0a 23 23 23 20 74 65 73 74 20 66 6f 72 20 f..### test for
4d80: 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 73 0a 23 20 optimizations.#
4d90: 2f 4f 32 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e /O2 optimization
4da0: 20 69 6e 63 6c 75 64 65 73 20 2f 4f 67 20 2f 4f includes /Og /O
4db0: 69 20 2f 4f 74 20 2f 4f 79 20 2f 4f 62 32 20 2f i /Ot /Oy /Ob2 /
4dc0: 47 73 20 2f 47 46 20 2f 47 79 20 61 73 20 70 65 Gs /GF /Gy as pe
4dd0: 72 0a 23 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f r.# documentatio
4de0: 6e 2e 20 4e 6f 74 65 20 77 65 20 64 6f 20 4e 4f n. Note we do NO
4df0: 54 20 77 61 6e 74 20 2f 47 73 20 61 73 20 74 68 T want /Gs as th
4e00: 61 74 20 69 6e 73 65 72 74 73 20 61 20 5f 63 68 at inserts a _ch
4e10: 6b 73 74 6b 0a 23 20 73 74 61 63 6b 20 70 72 6f kstk.# stack pro
4e20: 62 65 20 61 74 20 2a 65 76 65 72 79 2a 20 66 75 be at *every* fu
4e30: 6e 63 74 69 6f 6e 20 65 6e 74 72 79 2c 20 6e 6f nction entry, no
4e40: 74 20 6a 75 73 74 20 74 68 6f 73 65 20 77 69 74 t just those wit
4e50: 68 20 6d 6f 72 65 20 74 68 61 6e 0a 23 20 61 20 h more than.# a
4e60: 70 61 67 65 20 6f 66 20 73 74 61 63 6b 20 61 6c page of stack al
4e70: 6c 6f 63 61 74 69 6f 6e 20 72 65 73 75 6c 74 69 location resulti
4e80: 6e 67 20 69 6e 20 61 20 70 65 72 66 6f 72 6d 61 ng in a performa
4e90: 6e 63 65 20 68 69 74 2e 20 20 48 6f 77 65 76 65 nce hit. Howeve
4ea0: 72 2c 0a 23 20 2f 4f 32 20 64 6f 63 75 6d 65 6e r,.# /O2 documen
4eb0: 74 61 74 69 6f 6e 20 69 73 20 6d 69 73 6c 65 61 tation is mislea
4ec0: 64 69 6e 67 20 61 73 20 69 74 73 20 73 74 61 63 ding as its stac
4ed0: 6b 20 70 72 6f 62 65 73 20 61 72 65 20 73 69 6d k probes are sim
4ee0: 70 6c 79 20 74 68 65 0a 23 20 64 65 66 61 75 6c ply the.# defaul
4ef0: 74 20 70 61 67 65 20 73 69 7a 65 20 6c 6f 63 61 t page size loca
4f00: 6c 73 20 61 6c 6c 6f 63 61 74 69 6f 6e 20 70 72 ls allocation pr
4f10: 6f 62 65 73 20 61 6e 64 20 6e 6f 74 20 77 68 61 obes and not wha
4f20: 74 20 69 73 20 69 6d 70 6c 69 65 64 0a 23 20 62 t is implied.# b
4f30: 79 20 61 6e 20 65 78 70 6c 69 63 69 74 20 2f 47 y an explicit /G
4f40: 73 20 6f 70 74 69 6f 6e 2e 0a 0a 4f 50 54 49 4d s option...OPTIM
4f50: 49 5a 41 54 49 4f 4e 53 20 3d 20 24 28 46 50 4f IZATIONS = $(FPO
4f60: 50 54 53 29 0a 0a 21 69 66 20 5b 24 28 4e 4d 41 PTS)..!if [$(NMA
4f70: 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 63 KEHLP_NATIVE) -c
4f80: 20 2d 4f 32 5d 0a 4f 50 54 49 4d 49 5a 49 4e 47 -O2].OPTIMIZING
4f90: 20 3d 20 31 0a 4f 50 54 49 4d 49 5a 41 54 49 4f = 1.OPTIMIZATIO
4fa0: 4e 53 20 20 20 3d 20 24 28 4f 50 54 49 4d 49 5a NS = $(OPTIMIZ
4fb0: 41 54 49 4f 4e 53 29 20 2d 4f 32 0a 21 65 6c 73 ATIONS) -O2.!els
4fc0: 65 0a 23 20 4c 65 67 61 63 79 2c 20 72 65 61 6c e.# Legacy, real
4fd0: 6c 79 2e 20 41 6c 6c 20 6d 6f 64 65 72 6e 20 63 ly. All modern c
4fe0: 6f 6d 70 69 6c 65 72 73 20 73 75 70 70 6f 72 74 ompilers support
4ff0: 20 74 68 69 73 0a 21 6d 65 73 73 61 67 65 20 2a this.!message *
5000: 2a 2a 20 43 6f 6d 70 69 6c 65 72 20 64 6f 65 73 ** Compiler does
5010: 20 6e 6f 74 20 68 61 76 65 20 27 4f 70 74 69 6d not have 'Optim
5020: 69 7a 61 74 69 6f 6e 73 27 0a 4f 50 54 49 4d 49 izations'.OPTIMI
5030: 5a 49 4e 47 20 3d 20 30 0a 21 65 6e 64 69 66 0a ZING = 0.!endif.
5040: 0a 23 20 43 68 65 63 6b 73 20 66 6f 72 20 62 75 .# Checks for bu
5050: 66 66 65 72 20 6f 76 65 72 66 6c 6f 77 73 20 69 ffer overflows i
5060: 6e 20 6c 6f 63 61 6c 20 61 72 72 61 79 73 0a 21 n local arrays.!
5070: 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e if [$(NMAKEHLP_N
5080: 41 54 49 56 45 29 20 2d 63 20 2d 47 53 5d 0a 4f ATIVE) -c -GS].O
5090: 50 54 49 4d 49 5a 41 54 49 4f 4e 53 20 20 3d 20 PTIMIZATIONS =
50a0: 24 28 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 29 $(OPTIMIZATIONS)
50b0: 20 2d 47 53 0a 21 65 6e 64 69 66 0a 0a 23 20 4c -GS.!endif..# L
50c0: 69 6e 6b 20 74 69 6d 65 20 6f 70 74 69 6d 69 7a ink time optimiz
50d0: 61 74 69 6f 6e 2e 20 4e 6f 74 65 20 74 68 61 74 ation. Note that
50e0: 20 74 68 69 73 20 6f 70 74 69 6f 6e 20 28 70 6f this option (po
50f0: 74 65 6e 74 69 61 6c 6c 79 29 20 6d 61 6b 65 73 tentially) makes
5100: 0a 23 20 67 65 6e 65 72 61 74 65 64 20 6c 69 62 .# generated lib
5110: 72 61 72 69 65 73 20 6f 6e 6c 79 20 75 73 61 62 raries only usab
5120: 6c 65 20 62 79 20 74 68 65 20 73 70 65 63 69 66 le by the specif
5130: 69 63 20 56 43 2b 2b 20 76 65 72 73 69 6f 6e 20 ic VC++ version
5140: 74 68 61 74 0a 23 20 63 72 65 61 74 65 64 20 69 that.# created i
5150: 74 2e 20 52 65 71 75 69 72 65 73 20 2f 4c 54 43 t. Requires /LTC
5160: 47 20 6c 69 6e 6b 65 72 20 6f 70 74 69 6f 6e 0a G linker option.
5170: 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f !if [$(NMAKEHLP_
5180: 4e 41 54 49 56 45 29 20 2d 63 20 2d 47 4c 5d 0a NATIVE) -c -GL].
5190: 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 20 20 3d OPTIMIZATIONS =
51a0: 20 24 28 4f 50 54 49 4d 49 5a 41 54 49 4f 4e 53 $(OPTIMIZATIONS
51b0: 29 20 2d 47 4c 0a 43 43 5f 47 4c 5f 4f 50 54 5f ) -GL.CC_GL_OPT_
51c0: 45 4e 41 42 4c 45 44 20 3d 20 31 0a 21 65 6c 73 ENABLED = 1.!els
51d0: 65 0a 23 20 49 6e 20 6e 65 77 65 72 20 63 6f 6d e.# In newer com
51e0: 70 69 6c 65 72 73 20 2d 47 4c 20 61 6e 64 20 2d pilers -GL and -
51f0: 59 58 20 61 72 65 20 69 6e 63 6f 6d 70 61 74 69 YX are incompati
5200: 62 6c 65 2e 0a 21 69 66 20 5b 24 28 4e 4d 41 4b ble..!if [$(NMAK
5210: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 63 20 EHLP_NATIVE) -c
5220: 2d 59 58 5d 0a 4f 50 54 49 4d 49 5a 41 54 49 4f -YX].OPTIMIZATIO
5230: 4e 53 20 20 3d 20 24 28 4f 50 54 49 4d 49 5a 41 NS = $(OPTIMIZA
5240: 54 49 4f 4e 53 29 20 2d 59 58 0a 21 65 6e 64 69 TIONS) -YX.!endi
5250: 66 0a 21 65 6e 64 69 66 20 23 20 5b 24 28 4e 4d f.!endif # [$(NM
5260: 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d AKEHLP_NATIVE) -
5270: 63 20 2d 47 4c 5d 0a 0a 44 45 42 55 47 46 4c 41 c -GL]..DEBUGFLA
5280: 47 53 20 20 20 20 20 3d 20 24 28 46 50 4f 50 54 GS = $(FPOPT
5290: 53 29 0a 0a 23 20 52 75 6e 20 74 69 6d 65 20 65 S)..# Run time e
52a0: 72 72 6f 72 20 63 68 65 63 6b 73 2e 20 4e 6f 74 rror checks. Not
52b0: 20 61 76 61 69 6c 61 62 6c 65 20 6f 72 20 76 61 available or va
52c0: 6c 69 64 20 69 6e 20 61 20 72 65 6c 65 61 73 65 lid in a release
52d0: 2c 20 6e 6f 6e 2d 64 65 62 75 67 20 62 75 69 6c , non-debug buil
52e0: 64 0a 23 20 52 54 43 20 69 73 20 66 6f 72 20 6d d.# RTC is for m
52f0: 6f 64 65 72 6e 20 63 6f 6d 70 69 6c 65 72 73 2c odern compilers,
5300: 20 2d 47 5a 20 69 73 20 6c 65 67 61 63 79 0a 21 -GZ is legacy.!
5310: 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e if [$(NMAKEHLP_N
5320: 41 54 49 56 45 29 20 2d 63 20 2d 52 54 43 31 5d ATIVE) -c -RTC1]
5330: 0a 44 45 42 55 47 46 4c 41 47 53 20 20 20 20 20 .DEBUGFLAGS
5340: 3d 20 24 28 44 45 42 55 47 46 4c 41 47 53 29 20 = $(DEBUGFLAGS)
5350: 2d 52 54 43 31 0a 21 65 6c 73 65 69 66 20 5b 24 -RTC1.!elseif [$
5360: 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 (NMAKEHLP_NATIVE
5370: 29 20 2d 63 20 2d 47 5a 5d 0a 44 45 42 55 47 46 ) -c -GZ].DEBUGF
5380: 4c 41 47 53 20 20 20 20 20 3d 20 24 28 44 45 42 LAGS = $(DEB
5390: 55 47 46 4c 41 47 53 29 20 2d 47 5a 0a 21 65 6e UGFLAGS) -GZ.!en
53a0: 64 69 66 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d dif..#----------
53b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
53c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
53d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
53e0: 2d 2d 2d 2d 2d 2d 0a 23 20 4c 69 6e 6b 65 72 20 ------.# Linker
53f0: 66 6c 61 67 73 0a 0a 23 20 4c 49 4e 4b 45 52 5f flags..# LINKER_
5400: 54 45 53 54 46 4c 41 47 53 20 61 72 65 20 66 6f TESTFLAGS are fo
5410: 72 20 69 6e 74 65 72 6e 61 6c 20 75 73 65 20 77 r internal use w
5420: 68 65 6e 20 77 65 20 63 61 6c 6c 20 6e 6d 61 6b hen we call nmak
5430: 65 68 6c 70 20 74 6f 20 74 65 73 74 0a 23 20 69 ehlp to test.# i
5440: 66 20 74 68 65 20 6c 69 6e 6b 65 72 20 73 75 70 f the linker sup
5450: 70 6f 72 74 73 20 61 20 73 70 65 63 69 66 69 63 ports a specific
5460: 20 6f 70 74 69 6f 6e 2e 20 57 69 74 68 6f 75 74 option. Without
5470: 20 74 68 65 73 65 20 66 6c 61 67 73 20 6c 69 6e these flags lin
5480: 6b 20 77 69 6c 6c 0a 23 20 72 65 74 75 72 6e 20 k will.# return
5490: 22 4c 4e 4b 31 35 36 31 3a 20 65 6e 74 72 79 20 "LNK1561: entry
54a0: 70 6f 69 6e 74 20 6d 75 73 74 20 62 65 20 64 65 point must be de
54b0: 66 69 6e 65 64 22 20 65 72 72 6f 72 20 63 6f 6d fined" error com
54c0: 70 69 6c 69 6e 67 20 66 72 6f 6d 20 56 53 2d 49 piling from VS-I
54d0: 44 45 3a 0a 23 20 54 68 65 79 20 61 72 65 20 6e DE:.# They are n
54e0: 6f 74 20 70 61 73 73 65 64 20 74 68 72 6f 75 67 ot passed throug
54f0: 68 20 74 6f 20 74 68 65 20 61 63 74 75 61 6c 20 h to the actual
5500: 61 70 70 6c 69 63 61 74 69 6f 6e 20 2f 20 65 78 application / ex
5510: 74 65 6e 73 69 6f 6e 0a 23 20 6c 69 6e 6b 20 72 tension.# link r
5520: 75 6c 65 73 2e 0a 21 69 66 6e 64 65 66 20 4c 49 ules..!ifndef LI
5530: 4e 4b 45 52 5f 54 45 53 54 46 4c 41 47 53 0a 4c NKER_TESTFLAGS.L
5540: 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41 47 53 20 INKER_TESTFLAGS
5550: 3d 20 2f 44 4c 4c 20 2f 4e 4f 45 4e 54 52 59 20 = /DLL /NOENTRY
5560: 2f 4f 55 54 3a 6e 6d 61 6b 65 68 6c 70 2e 6f 75 /OUT:nmakehlp.ou
5570: 74 0a 21 65 6e 64 69 66 0a 0a 4c 49 4e 4b 45 52 t.!endif..LINKER
5580: 46 4c 41 47 53 20 20 20 20 20 3d 0a 0a 23 20 49 FLAGS =..# I
5590: 66 20 63 6f 6d 70 69 6c 65 72 20 68 61 73 20 65 f compiler has e
55a0: 6e 61 62 6c 65 64 20 6c 69 6e 6b 20 74 69 6d 65 nabled link time
55b0: 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 2c 20 6c optimization, l
55c0: 69 6e 6b 65 72 20 6d 75 73 74 20 74 6f 6f 20 77 inker must too w
55d0: 69 74 68 20 2d 6c 74 63 67 0a 21 69 66 64 65 66 ith -ltcg.!ifdef
55e0: 20 43 43 5f 47 4c 5f 4f 50 54 5f 45 4e 41 42 4c CC_GL_OPT_ENABL
55f0: 45 44 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 ED.!if [$(NMAKEH
5600: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 6c 20 2d 6c LP_NATIVE) -l -l
5610: 74 63 67 20 24 28 4c 49 4e 4b 45 52 5f 54 45 53 tcg $(LINKER_TES
5620: 54 46 4c 41 47 53 29 5d 0a 4c 49 4e 4b 45 52 46 TFLAGS)].LINKERF
5630: 4c 41 47 53 20 20 20 20 20 3d 20 24 28 4c 49 4e LAGS = $(LIN
5640: 4b 45 52 46 4c 41 47 53 29 20 2d 6c 74 63 67 0a KERFLAGS) -ltcg.
5650: 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a 0a 0a !endif.!endif...
5660: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
5670: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
5680: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
5690: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
56a0: 0a 23 20 36 2e 20 45 78 74 72 61 63 74 20 76 61 .# 6. Extract va
56b0: 72 69 6f 75 73 20 76 65 72 73 69 6f 6e 20 6e 75 rious version nu
56c0: 6d 62 65 72 73 20 66 72 6f 6d 20 68 65 61 64 65 mbers from heade
56d0: 72 73 0a 23 20 46 6f 72 20 54 63 6c 20 61 6e 64 rs.# For Tcl and
56e0: 20 54 6b 2c 20 76 65 72 73 69 6f 6e 20 6e 75 6d Tk, version num
56f0: 62 65 72 73 20 61 72 65 20 65 78 74 72 61 63 74 bers are extract
5700: 65 64 20 66 72 6f 6d 20 74 63 6c 2e 68 20 61 6e ed from tcl.h an
5710: 64 20 74 6b 2e 68 0a 23 20 72 65 73 70 65 63 74 d tk.h.# respect
5720: 69 76 65 6c 79 2e 20 46 6f 72 20 65 78 74 65 6e ively. For exten
5730: 73 69 6f 6e 73 2c 20 76 65 72 73 69 6f 6e 73 20 sions, versions
5740: 61 72 65 20 65 78 74 72 61 63 74 65 64 20 66 72 are extracted fr
5750: 6f 6d 20 74 68 65 0a 23 20 63 6f 6e 66 69 67 75 om the.# configu
5760: 72 65 2e 69 6e 20 6f 72 20 63 6f 6e 66 69 67 75 re.in or configu
5770: 72 65 2e 61 63 20 66 72 6f 6d 20 74 68 65 20 54 re.ac from the T
5780: 45 41 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e EA configuration
5790: 20 69 66 20 69 74 0a 23 20 65 78 69 73 74 73 2c if it.# exists,
57a0: 20 61 6e 64 20 75 6e 73 65 74 20 6f 74 68 65 72 and unset other
57b0: 77 69 73 65 2e 0a 23 20 53 65 74 73 20 74 68 65 wise..# Sets the
57c0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f following macro
57d0: 73 3a 0a 23 20 54 43 4c 5f 4d 41 4a 4f 52 5f 56 s:.# TCL_MAJOR_V
57e0: 45 52 53 49 4f 4e 0a 23 20 54 43 4c 5f 4d 49 4e ERSION.# TCL_MIN
57f0: 4f 52 5f 56 45 52 53 49 4f 4e 0a 23 20 54 43 4c OR_VERSION.# TCL
5800: 5f 52 45 4c 45 41 53 45 5f 53 45 52 49 41 4c 0a _RELEASE_SERIAL.
5810: 23 20 54 43 4c 5f 50 41 54 43 48 5f 4c 45 56 45 # TCL_PATCH_LEVE
5820: 4c 0a 23 20 54 43 4c 5f 50 41 54 43 48 5f 4c 45 L.# TCL_PATCH_LE
5830: 54 54 45 52 0a 23 20 54 43 4c 5f 56 45 52 53 49 TTER.# TCL_VERSI
5840: 4f 4e 0a 23 20 54 4b 5f 4d 41 4a 4f 52 5f 56 45 ON.# TK_MAJOR_VE
5850: 52 53 49 4f 4e 0a 23 20 54 4b 5f 4d 49 4e 4f 52 RSION.# TK_MINOR
5860: 5f 56 45 52 53 49 4f 4e 0a 23 20 54 4b 5f 52 45 _VERSION.# TK_RE
5870: 4c 45 41 53 45 5f 53 45 52 49 41 4c 0a 23 20 54 LEASE_SERIAL.# T
5880: 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 0a 23 20 K_PATCH_LEVEL.#
5890: 54 4b 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 0a TK_PATCH_LETTER.
58a0: 23 20 54 4b 5f 56 45 52 53 49 4f 4e 0a 23 20 44 # TK_VERSION.# D
58b0: 4f 54 56 45 52 53 49 4f 4e 20 2d 20 73 65 74 20 OTVERSION - set
58c0: 61 73 20 28 66 6f 72 20 65 78 61 6d 70 6c 65 29 as (for example)
58d0: 20 32 2e 35 0a 23 20 56 45 52 53 49 4f 4e 20 2d 2.5.# VERSION -
58e0: 20 73 65 74 20 61 73 20 28 66 6f 72 20 65 78 61 set as (for exa
58f0: 6d 70 6c 65 20 32 35 29 0a 23 2d 2d 2d 2d 2d 2d mple 25).#------
5900: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5910: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5920: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5930: 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 21 69 66 20 5b 65 --------..!if [e
5940: 63 68 6f 20 52 45 4d 20 3d 20 54 68 69 73 20 66 cho REM = This f
5950: 69 6c 65 20 69 73 20 67 65 6e 65 72 61 74 65 64 ile is generated
5960: 20 66 72 6f 6d 20 72 75 6c 65 73 2e 76 63 20 3e from rules.vc >
5970: 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 versions.vc].!e
5980: 6e 64 69 66 0a 21 69 66 20 5b 65 63 68 6f 20 54 ndif.!if [echo T
5990: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e CL_MAJOR_VERSION
59a0: 20 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e = \>> versions.
59b0: 76 63 5d 20 5c 0a 20 20 20 26 26 20 5b 24 28 4e vc] \. && [$(N
59c0: 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 MAKEHLP_NATIVE)
59d0: 2d 56 20 22 24 28 5f 54 43 4c 5f 48 29 22 20 22 -V "$(_TCL_H)" "
59e0: 64 65 66 69 6e 65 20 54 43 4c 5f 4d 41 4a 4f 52 define TCL_MAJOR
59f0: 5f 56 45 52 53 49 4f 4e 22 20 3e 3e 20 76 65 72 _VERSION" >> ver
5a00: 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 sions.vc].!endif
5a10: 0a 21 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f 4d .!if [echo TCL_M
5a20: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 20 3d 20 5c INOR_VERSION = \
5a30: 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 >> versions.vc]
5a40: 5c 0a 20 20 20 26 26 20 5b 24 28 4e 4d 41 4b 45 \. && [$(NMAKE
5a50: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 56 20 22 HLP_NATIVE) -V "
5a60: 24 28 5f 54 43 4c 5f 48 29 22 20 22 64 65 66 69 $(_TCL_H)" "defi
5a70: 6e 65 20 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 ne TCL_MINOR_VER
5a80: 53 49 4f 4e 22 20 3e 3e 20 76 65 72 73 69 6f 6e SION" >> version
5a90: 73 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21 69 66 s.vc].!endif.!if
5aa0: 20 5b 65 63 68 6f 20 54 43 4c 5f 52 45 4c 45 41 [echo TCL_RELEA
5ab0: 53 45 5f 53 45 52 49 41 4c 20 3d 20 5c 3e 3e 20 SE_SERIAL = \>>
5ac0: 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 versions.vc] \.
5ad0: 20 20 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 && [$(NMAKEHLP
5ae0: 5f 4e 41 54 49 56 45 29 20 2d 56 20 22 24 28 5f _NATIVE) -V "$(_
5af0: 54 43 4c 5f 48 29 22 20 54 43 4c 5f 52 45 4c 45 TCL_H)" TCL_RELE
5b00: 41 53 45 5f 53 45 52 49 41 4c 20 3e 3e 20 76 65 ASE_SERIAL >> ve
5b10: 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 rsions.vc].!endi
5b20: 66 0a 21 69 66 20 5b 65 63 68 6f 20 54 43 4c 5f f.!if [echo TCL_
5b30: 50 41 54 43 48 5f 4c 45 56 45 4c 20 3d 20 5c 3e PATCH_LEVEL = \>
5b40: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c > versions.vc] \
5b50: 0a 20 20 20 26 26 20 5b 24 28 4e 4d 41 4b 45 48 . && [$(NMAKEH
5b60: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 56 20 22 24 LP_NATIVE) -V "$
5b70: 28 5f 54 43 4c 5f 48 29 22 20 54 43 4c 5f 50 41 (_TCL_H)" TCL_PA
5b80: 54 43 48 5f 4c 45 56 45 4c 20 3e 3e 20 76 65 72 TCH_LEVEL >> ver
5b90: 73 69 6f 6e 73 2e 76 63 5d 0a 21 65 6e 64 69 66 sions.vc].!endif
5ba0: 0a 0a 21 69 66 20 64 65 66 69 6e 65 64 28 5f 54 ..!if defined(_T
5bb0: 4b 5f 48 29 0a 21 69 66 20 5b 65 63 68 6f 20 54 K_H).!if [echo T
5bc0: 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 20 K_MAJOR_VERSION
5bd0: 3d 20 5c 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 = \>> versions.v
5be0: 63 5d 20 5c 0a 20 20 20 26 26 20 5b 24 28 4e 4d c] \. && [$(NM
5bf0: 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d AKEHLP_NATIVE) -
5c00: 56 20 24 28 5f 54 4b 5f 48 29 20 22 64 65 66 69 V $(_TK_H) "defi
5c10: 6e 65 20 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 ne TK_MAJOR_VERS
5c20: 49 4f 4e 22 20 3e 3e 20 76 65 72 73 69 6f 6e 73 ION" >> versions
5c30: 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21 69 66 20 .vc].!endif.!if
5c40: 5b 65 63 68 6f 20 54 4b 5f 4d 49 4e 4f 52 5f 56 [echo TK_MINOR_V
5c50: 45 52 53 49 4f 4e 20 3d 20 5c 3e 3e 20 76 65 72 ERSION = \>> ver
5c60: 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 26 sions.vc] \. &
5c70: 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 & [$(NMAKEHLP_NA
5c80: 54 49 56 45 29 20 2d 56 20 24 28 5f 54 4b 5f 48 TIVE) -V $(_TK_H
5c90: 29 20 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 ) TK_MINOR_VERSI
5ca0: 4f 4e 20 3e 3e 20 76 65 72 73 69 6f 6e 73 2e 76 ON >> versions.v
5cb0: 63 5d 0a 21 65 6e 64 69 66 0a 21 69 66 20 5b 65 c].!endif.!if [e
5cc0: 63 68 6f 20 54 4b 5f 52 45 4c 45 41 53 45 5f 53 cho TK_RELEASE_S
5cd0: 45 52 49 41 4c 20 3d 20 5c 3e 3e 20 76 65 72 73 ERIAL = \>> vers
5ce0: 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 26 26 ions.vc] \. &&
5cf0: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 [$(NMAKEHLP_NAT
5d00: 49 56 45 29 20 2d 56 20 22 24 28 5f 54 4b 5f 48 IVE) -V "$(_TK_H
5d10: 29 22 20 54 4b 5f 52 45 4c 45 41 53 45 5f 53 45 )" TK_RELEASE_SE
5d20: 52 49 41 4c 20 3e 3e 20 76 65 72 73 69 6f 6e 73 RIAL >> versions
5d30: 2e 76 63 5d 0a 21 65 6e 64 69 66 0a 21 69 66 20 .vc].!endif.!if
5d40: 5b 65 63 68 6f 20 54 4b 5f 50 41 54 43 48 5f 4c [echo TK_PATCH_L
5d50: 45 56 45 4c 20 3d 20 5c 3e 3e 20 76 65 72 73 69 EVEL = \>> versi
5d60: 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 20 26 26 20 ons.vc] \. &&
5d70: 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 [$(NMAKEHLP_NATI
5d80: 56 45 29 20 2d 56 20 24 28 5f 54 4b 5f 48 29 20 VE) -V $(_TK_H)
5d90: 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c 20 3e TK_PATCH_LEVEL >
5da0: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 > versions.vc].!
5db0: 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20 5f endif.!endif # _
5dc0: 54 4b 5f 48 0a 0a 21 69 6e 63 6c 75 64 65 20 76 TK_H..!include v
5dd0: 65 72 73 69 6f 6e 73 2e 76 63 0a 0a 54 43 4c 5f ersions.vc..TCL_
5de0: 56 45 52 53 49 4f 4e 09 3d 20 24 28 54 43 4c 5f VERSION.= $(TCL_
5df0: 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 24 28 MAJOR_VERSION)$(
5e00: 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f TCL_MINOR_VERSIO
5e10: 4e 29 0a 54 43 4c 5f 44 4f 54 56 45 52 53 49 4f N).TCL_DOTVERSIO
5e20: 4e 09 3d 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f N.= $(TCL_MAJOR_
5e30: 56 45 52 53 49 4f 4e 29 2e 24 28 54 43 4c 5f 4d VERSION).$(TCL_M
5e40: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 21 69 INOR_VERSION).!i
5e50: 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 f [$(NMAKEHLP_NA
5e60: 54 49 56 45 29 20 2d 66 20 24 28 54 43 4c 5f 50 TIVE) -f $(TCL_P
5e70: 41 54 43 48 5f 4c 45 56 45 4c 29 20 22 61 22 5d ATCH_LEVEL) "a"]
5e80: 0a 54 43 4c 5f 50 41 54 43 48 5f 4c 45 54 54 45 .TCL_PATCH_LETTE
5e90: 52 20 3d 20 61 0a 21 65 6c 73 65 69 66 20 5b 24 R = a.!elseif [$
5ea0: 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 (NMAKEHLP_NATIVE
5eb0: 29 20 2d 66 20 24 28 54 43 4c 5f 50 41 54 43 48 ) -f $(TCL_PATCH
5ec0: 5f 4c 45 56 45 4c 29 20 22 62 22 5d 0a 54 43 4c _LEVEL) "b"].TCL
5ed0: 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 20 3d 20 _PATCH_LETTER =
5ee0: 62 0a 21 65 6c 73 65 0a 54 43 4c 5f 50 41 54 43 b.!else.TCL_PATC
5ef0: 48 5f 4c 45 54 54 45 52 20 3d 20 2e 0a 21 65 6e H_LETTER = ..!en
5f00: 64 69 66 0a 0a 21 69 66 20 64 65 66 69 6e 65 64 dif..!if defined
5f10: 28 5f 54 4b 5f 48 29 0a 0a 54 4b 5f 56 45 52 53 (_TK_H)..TK_VERS
5f20: 49 4f 4e 09 3d 20 24 28 54 4b 5f 4d 41 4a 4f 52 ION.= $(TK_MAJOR
5f30: 5f 56 45 52 53 49 4f 4e 29 24 28 54 4b 5f 4d 49 _VERSION)$(TK_MI
5f40: 4e 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 54 4b 5f NOR_VERSION).TK_
5f50: 44 4f 54 56 45 52 53 49 4f 4e 09 3d 20 24 28 54 DOTVERSION.= $(T
5f60: 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 K_MAJOR_VERSION)
5f70: 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 .$(TK_MINOR_VERS
5f80: 49 4f 4e 29 0a 21 69 66 20 5b 24 28 4e 4d 41 4b ION).!if [$(NMAK
5f90: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 EHLP_NATIVE) -f
5fa0: 24 28 54 4b 5f 50 41 54 43 48 5f 4c 45 56 45 4c $(TK_PATCH_LEVEL
5fb0: 29 20 22 61 22 5d 0a 54 4b 5f 50 41 54 43 48 5f ) "a"].TK_PATCH_
5fc0: 4c 45 54 54 45 52 20 3d 20 61 0a 21 65 6c 73 65 LETTER = a.!else
5fd0: 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e if [$(NMAKEHLP_N
5fe0: 41 54 49 56 45 29 20 2d 66 20 24 28 54 4b 5f 50 ATIVE) -f $(TK_P
5ff0: 41 54 43 48 5f 4c 45 56 45 4c 29 20 22 62 22 5d ATCH_LEVEL) "b"]
6000: 0a 54 4b 5f 50 41 54 43 48 5f 4c 45 54 54 45 52 .TK_PATCH_LETTER
6010: 20 3d 20 62 0a 21 65 6c 73 65 0a 54 4b 5f 50 41 = b.!else.TK_PA
6020: 54 43 48 5f 4c 45 54 54 45 52 20 3d 20 2e 0a 21 TCH_LETTER = ..!
6030: 65 6e 64 69 66 0a 0a 21 65 6e 64 69 66 0a 0a 23 endif..!endif..#
6040: 20 53 65 74 20 44 4f 54 56 45 52 53 49 4f 4e 20 Set DOTVERSION
6050: 61 6e 64 20 56 45 52 53 49 4f 4e 0a 21 69 66 20 and VERSION.!if
6060: 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0a 0a 44 4f $(DOING_TCL)..DO
6070: 54 56 45 52 53 49 4f 4e 20 3d 20 24 28 54 43 4c TVERSION = $(TCL
6080: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e _MAJOR_VERSION).
6090: 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 $(TCL_MINOR_VERS
60a0: 49 4f 4e 29 0a 56 45 52 53 49 4f 4e 20 3d 20 24 ION).VERSION = $
60b0: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 0a 0a 21 (TCL_VERSION)..!
60c0: 65 6c 73 65 69 66 20 24 28 44 4f 49 4e 47 5f 54 elseif $(DOING_T
60d0: 4b 29 0a 0a 44 4f 54 56 45 52 53 49 4f 4e 20 3d K)..DOTVERSION =
60e0: 20 24 28 54 4b 5f 44 4f 54 56 45 52 53 49 4f 4e $(TK_DOTVERSION
60f0: 29 0a 56 45 52 53 49 4f 4e 20 3d 20 24 28 54 4b ).VERSION = $(TK
6100: 5f 56 45 52 53 49 4f 4e 29 0a 0a 21 65 6c 73 65 _VERSION)..!else
6110: 20 23 20 44 6f 69 6e 67 20 61 20 6e 6f 6e 2d 54 # Doing a non-T
6120: 6b 20 65 78 74 65 6e 73 69 6f 6e 0a 0a 23 20 49 k extension..# I
6130: 66 20 70 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c f parent makefil
6140: 65 20 68 61 73 20 6e 6f 74 20 64 65 66 69 6e 65 e has not define
6150: 64 20 44 4f 54 56 45 52 53 49 4f 4e 2c 20 74 72 d DOTVERSION, tr
6160: 79 20 74 6f 20 67 65 74 20 69 74 20 66 72 6f 6d y to get it from
6170: 20 54 45 41 0a 23 20 66 69 72 73 74 20 66 72 6f TEA.# first fro
6180: 6d 20 61 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e m a configure.in
6190: 20 66 69 6c 65 2c 20 61 6e 64 20 74 68 65 6e 20 file, and then
61a0: 66 72 6f 6d 20 63 6f 6e 66 69 67 75 72 65 2e 61 from configure.a
61b0: 63 0a 21 69 66 6e 64 65 66 20 44 4f 54 56 45 52 c.!ifndef DOTVER
61c0: 53 49 4f 4e 0a 21 69 66 20 5b 65 63 68 6f 20 44 SION.!if [echo D
61d0: 4f 54 56 45 52 53 49 4f 4e 20 3d 20 5c 3e 20 76 OTVERSION = \> v
61e0: 65 72 73 69 6f 6e 73 2e 76 63 5d 20 5c 0a 20 20 ersions.vc] \.
61f0: 20 7c 7c 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f || [$(NMAKEHLP_
6200: 4e 41 54 49 56 45 29 20 2d 56 20 24 28 52 4f 4f NATIVE) -V $(ROO
6210: 54 29 5c 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20 T)\configure.in
6220: 5e 5b 24 28 50 52 4f 4a 45 43 54 29 5e 5d 20 3e ^[$(PROJECT)^] >
6230: 3e 20 76 65 72 73 69 6f 6e 73 2e 76 63 5d 0a 21 > versions.vc].!
6240: 69 66 20 5b 65 63 68 6f 20 44 4f 54 56 45 52 53 if [echo DOTVERS
6250: 49 4f 4e 20 3d 20 5c 3e 20 76 65 72 73 69 6f 6e ION = \> version
6260: 73 2e 76 63 5d 20 5c 0a 20 20 20 7c 7c 20 5b 24 s.vc] \. || [$
6270: 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 (NMAKEHLP_NATIVE
6280: 29 20 2d 56 20 24 28 52 4f 4f 54 29 5c 63 6f 6e ) -V $(ROOT)\con
6290: 66 69 67 75 72 65 2e 61 63 20 5e 5b 24 28 50 52 figure.ac ^[$(PR
62a0: 4f 4a 45 43 54 29 5e 5d 20 3e 3e 20 76 65 72 73 OJECT)^] >> vers
62b0: 69 6f 6e 73 2e 76 63 5d 0a 21 65 72 72 6f 72 20 ions.vc].!error
62c0: 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 69 *** Could not fi
62d0: 67 75 72 65 20 6f 75 74 20 65 78 74 65 6e 73 69 gure out extensi
62e0: 6f 6e 20 76 65 72 73 69 6f 6e 2e 20 50 6c 65 61 on version. Plea
62f0: 73 65 20 64 65 66 69 6e 65 20 44 4f 54 56 45 52 se define DOTVER
6300: 53 49 4f 4e 20 69 6e 20 70 61 72 65 6e 74 20 6d SION in parent m
6310: 61 6b 65 66 69 6c 65 20 62 65 66 6f 72 65 20 69 akefile before i
6320: 6e 63 6c 75 64 69 6e 67 20 72 75 6c 65 73 2e 76 ncluding rules.v
6330: 63 2e 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 c..!endif.!endif
6340: 0a 21 69 6e 63 6c 75 64 65 20 76 65 72 73 69 6f .!include versio
6350: 6e 73 2e 76 63 0a 21 65 6e 64 69 66 20 23 20 44 ns.vc.!endif # D
6360: 4f 54 56 45 52 53 49 4f 4e 0a 56 45 52 53 49 4f OTVERSION.VERSIO
6370: 4e 20 20 20 20 20 20 20 20 20 3d 20 24 28 44 4f N = $(DO
6380: 54 56 45 52 53 49 4f 4e 3a 2e 3d 29 0a 0a 21 65 TVERSION:.=)..!e
6390: 6e 64 69 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 ndif # $(DOING_T
63a0: 43 4c 29 20 2e 2e 2e 20 65 74 63 2e 0a 0a 23 20 CL) ... etc...#
63b0: 57 69 6e 64 6f 77 73 20 52 43 20 66 69 6c 65 73 Windows RC files
63c0: 20 68 61 76 65 20 33 20 76 65 72 73 69 6f 6e 20 have 3 version
63d0: 63 6f 6d 70 6f 6e 65 6e 74 73 2e 20 45 6e 73 75 components. Ensu
63e0: 72 65 20 74 68 69 73 20 69 72 72 65 73 70 65 63 re this irrespec
63f0: 74 69 76 65 0a 23 20 6f 66 20 68 6f 77 20 6d 61 tive.# of how ma
6400: 6e 79 20 63 6f 6d 70 6f 6e 65 6e 74 73 20 74 68 ny components th
6410: 65 20 70 61 63 6b 61 67 65 20 68 61 73 20 73 70 e package has sp
6420: 65 63 69 66 69 65 64 2e 20 42 61 73 69 63 61 6c ecified. Basical
6430: 6c 79 2c 20 65 6e 73 75 72 65 0a 23 20 6d 69 6e ly, ensure.# min
6440: 69 6d 75 6d 20 34 20 63 6f 6d 70 6f 6e 65 6e 74 imum 4 component
6450: 73 20 62 79 20 61 70 70 65 6e 64 69 6e 67 20 34 s by appending 4
6460: 20 30 27 73 20 61 6e 64 20 74 68 65 6e 20 70 69 0's and then pi
6470: 63 6b 20 6f 75 74 20 74 68 65 20 66 69 72 73 74 ck out the first
6480: 20 34 2e 0a 23 20 41 6c 73 6f 20 74 61 6b 65 20 4..# Also take
6490: 63 61 72 65 20 6f 66 20 74 68 65 20 66 61 63 74 care of the fact
64a0: 20 74 68 61 74 20 44 4f 54 56 45 52 53 49 4f 4e that DOTVERSION
64b0: 20 6d 61 79 20 68 61 76 65 20 22 61 22 20 6f 72 may have "a" or
64c0: 20 22 62 22 20 69 6e 73 74 65 61 64 0a 23 20 6f "b" instead.# o
64d0: 66 20 22 2e 22 20 73 65 70 61 72 61 74 69 6e 67 f "." separating
64e0: 20 74 68 65 20 76 65 72 73 69 6f 6e 20 63 6f 6d the version com
64f0: 70 6f 6e 65 6e 74 73 2e 0a 44 4f 54 53 45 50 41 ponents..DOTSEPA
6500: 52 41 54 45 44 3d 24 28 44 4f 54 56 45 52 53 49 RATED=$(DOTVERSI
6510: 4f 4e 3a 61 3d 2e 29 0a 44 4f 54 53 45 50 41 52 ON:a=.).DOTSEPAR
6520: 41 54 45 44 3d 24 28 44 4f 54 53 45 50 41 52 41 ATED=$(DOTSEPARA
6530: 54 45 44 3a 62 3d 2e 29 0a 21 69 66 20 5b 65 63 TED:b=.).!if [ec
6540: 68 6f 20 52 43 43 4f 4d 4d 41 56 45 52 53 49 4f ho RCCOMMAVERSIO
6550: 4e 20 3d 20 5c 3e 20 76 65 72 73 69 6f 6e 73 2e N = \> versions.
6560: 76 63 5d 20 5c 0a 20 20 7c 7c 20 5b 66 6f 72 20 vc] \. || [for
6570: 2f 66 20 22 74 6f 6b 65 6e 73 3d 31 2c 32 2c 33 /f "tokens=1,2,3
6580: 2c 34 2c 35 2a 20 64 65 6c 69 6d 73 3d 2e 22 20 ,4,5* delims=."
6590: 25 61 20 69 6e 20 28 22 24 28 44 4f 54 53 45 50 %a in ("$(DOTSEP
65a0: 41 52 41 54 45 44 29 2e 30 2e 30 2e 30 2e 30 22 ARATED).0.0.0.0"
65b0: 29 20 64 6f 20 40 65 63 68 6f 20 25 61 2c 25 62 ) do @echo %a,%b
65c0: 2c 25 63 2c 25 64 20 3e 3e 20 76 65 72 73 69 6f ,%c,%d >> versio
65d0: 6e 73 2e 76 63 5d 0a 21 65 72 72 6f 72 20 2a 2a ns.vc].!error **
65e0: 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 67 65 6e 65 * Could not gene
65f0: 72 61 74 65 20 52 43 43 4f 4d 4d 41 56 45 52 53 rate RCCOMMAVERS
6600: 49 4f 4e 20 2a 2a 2a 0a 21 65 6e 64 69 66 0a 21 ION ***.!endif.!
6610: 69 6e 63 6c 75 64 65 20 76 65 72 73 69 6f 6e 73 include versions
6620: 2e 76 63 0a 0a 23 23 23 23 23 23 23 23 23 23 23 .vc..###########
6630: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6640: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6650: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
6660: 23 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 #############.#
6670: 37 2e 20 50 61 72 73 65 20 74 68 65 20 4f 50 54 7. Parse the OPT
6680: 53 20 6d 61 63 72 6f 20 74 6f 20 77 6f 72 6b 20 S macro to work
6690: 6f 75 74 20 74 68 65 20 72 65 71 75 65 73 74 65 out the requeste
66a0: 64 20 62 75 69 6c 64 20 63 6f 6e 66 69 67 75 72 d build configur
66b0: 61 74 69 6f 6e 2e 0a 23 20 42 61 73 65 64 20 6f ation..# Based o
66c0: 6e 20 74 68 69 73 2c 20 77 65 20 77 69 6c 6c 20 n this, we will
66d0: 63 6f 6e 73 74 72 75 63 74 20 74 68 65 20 61 63 construct the ac
66e0: 74 75 61 6c 20 73 77 69 74 63 68 65 73 20 74 6f tual switches to
66f0: 20 62 65 20 70 61 73 73 65 64 20 74 6f 20 74 68 be passed to th
6700: 65 0a 23 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64 e.# compiler and
6710: 20 6c 69 6e 6b 65 72 20 75 73 69 6e 67 20 74 68 linker using th
6720: 65 20 6d 61 63 72 6f 73 20 64 65 66 69 6e 65 64 e macros defined
6730: 20 69 6e 20 74 68 65 20 70 72 65 76 69 6f 75 73 in the previous
6740: 20 73 65 63 74 69 6f 6e 2e 0a 23 20 54 68 65 20 section..# The
6750: 66 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 following macros
6760: 20 61 72 65 20 64 65 66 69 6e 65 64 20 62 79 20 are defined by
6770: 74 68 69 73 20 73 65 63 74 69 6f 6e 20 62 61 73 this section bas
6780: 65 64 20 6f 6e 20 4f 50 54 53 0a 23 20 53 54 41 ed on OPTS.# STA
6790: 54 49 43 5f 42 55 49 4c 44 20 2d 20 30 20 2d 3e TIC_BUILD - 0 ->
67a0: 20 54 63 6c 20 69 73 20 74 6f 20 62 65 20 62 75 Tcl is to be bu
67b0: 69 6c 74 20 61 73 20 61 20 73 68 61 72 65 64 20 ilt as a shared
67c0: 6c 69 62 72 61 72 79 0a 23 20 20 20 20 20 20 20 library.#
67d0: 20 20 20 20 20 20 20 20 20 31 20 2d 3e 20 62 75 1 -> bu
67e0: 69 6c 64 20 61 73 20 61 20 73 74 61 74 69 63 20 ild as a static
67f0: 6c 69 62 72 61 72 79 20 61 6e 64 20 73 68 65 6c library and shel
6800: 6c 0a 23 20 54 43 4c 5f 54 48 52 45 41 44 53 20 l.# TCL_THREADS
6810: 2d 20 6c 65 67 61 63 79 20 62 75 74 20 61 6c 77 - legacy but alw
6820: 61 79 73 20 31 20 6f 6e 20 57 69 6e 64 6f 77 73 ays 1 on Windows
6830: 20 73 69 6e 63 65 20 77 69 6e 73 6f 63 6b 20 72 since winsock r
6840: 65 71 75 69 72 65 73 20 69 74 2e 0a 23 20 44 45 equires it..# DE
6850: 42 55 47 20 2d 20 31 20 2d 3e 20 64 65 62 75 67 BUG - 1 -> debug
6860: 20 62 75 69 6c 64 2c 20 30 20 2d 3e 20 72 65 6c build, 0 -> rel
6870: 65 61 73 65 20 62 75 69 6c 64 73 0a 23 20 53 59 ease builds.# SY
6880: 4d 42 4f 4c 53 20 2d 20 31 20 2d 3e 20 67 65 6e MBOLS - 1 -> gen
6890: 65 72 61 74 65 20 50 44 42 27 73 2c 20 30 20 2d erate PDB's, 0 -
68a0: 3e 20 6e 6f 20 50 44 42 27 73 0a 23 20 50 52 4f > no PDB's.# PRO
68b0: 46 49 4c 45 20 2d 20 31 20 2d 3e 20 67 65 6e 65 FILE - 1 -> gene
68c0: 72 61 74 65 20 70 72 6f 66 69 6c 69 6e 67 20 69 rate profiling i
68d0: 6e 66 6f 2c 20 30 20 2d 3e 20 6e 6f 20 70 72 6f nfo, 0 -> no pro
68e0: 66 69 6c 69 6e 67 0a 23 20 50 47 4f 20 20 20 20 filing.# PGO
68f0: 20 2d 20 31 20 2d 3e 20 70 72 6f 66 69 6c 65 20 - 1 -> profile
6900: 62 61 73 65 64 20 6f 70 74 69 6d 69 7a 61 74 69 based optimizati
6910: 6f 6e 2c 20 30 20 2d 3e 20 6e 6f 0a 23 20 4d 53 on, 0 -> no.# MS
6920: 56 43 52 54 20 20 2d 20 31 20 2d 3e 20 6c 69 6e VCRT - 1 -> lin
6930: 6b 20 74 6f 20 64 79 6e 61 6d 69 63 20 43 20 72 k to dynamic C r
6940: 75 6e 74 69 6d 65 20 65 76 65 6e 20 77 68 65 6e untime even when
6950: 20 62 75 69 6c 64 69 6e 67 20 73 74 61 74 69 63 building static
6960: 20 54 63 6c 20 62 75 69 6c 64 0a 23 20 20 20 20 Tcl build.#
6970: 20 20 20 20 20 20 20 30 20 2d 3e 20 6c 69 6e 6b 0 -> link
6980: 20 74 6f 20 73 74 61 74 69 63 20 43 20 72 75 6e to static C run
6990: 74 69 6d 65 20 66 6f 72 20 73 74 61 74 69 63 20 time for static
69a0: 54 63 6c 20 62 75 69 6c 64 2e 0a 23 20 20 20 20 Tcl build..#
69b0: 20 20 20 20 20 20 20 44 6f 65 73 20 6e 6f 74 20 Does not
69c0: 69 6d 70 61 63 74 20 73 68 61 72 65 64 20 54 63 impact shared Tc
69d0: 6c 20 62 75 69 6c 64 73 20 28 53 54 41 54 49 43 l builds (STATIC
69e0: 5f 42 55 49 4c 44 20 3d 3d 20 30 29 0a 23 20 20 _BUILD == 0).#
69f0: 20 20 20 20 20 20 20 20 20 44 65 66 61 75 6c 74 Default
6a00: 3a 20 31 20 66 6f 72 20 54 63 6c 20 39 2e 30 20 : 1 for Tcl 9.0
6a10: 61 6e 64 20 75 70 2c 20 30 20 6f 74 68 65 72 77 and up, 0 otherw
6a20: 69 73 65 2e 0a 23 20 54 43 4c 5f 55 53 45 5f 53 ise..# TCL_USE_S
6a30: 54 41 54 49 43 5f 50 41 43 4b 41 47 45 53 20 2d TATIC_PACKAGES -
6a40: 20 31 20 2d 3e 20 73 74 61 74 69 63 61 6c 6c 79 1 -> statically
6a50: 20 6c 69 6e 6b 20 74 68 65 20 72 65 67 69 73 74 link the regist
6a60: 72 79 20 61 6e 64 20 64 64 65 20 65 78 74 65 6e ry and dde exten
6a70: 73 69 6f 6e 73 0a 23 20 20 20 20 20 20 20 20 20 sions.#
6a80: 20 20 69 6e 20 74 68 65 20 54 63 6c 20 61 6e 64 in the Tcl and
6a90: 20 57 69 73 68 20 73 68 65 6c 6c 2e 20 30 20 2d Wish shell. 0 -
6aa0: 3e 20 6b 65 65 70 20 74 68 65 6d 20 61 73 20 73 > keep them as s
6ab0: 68 61 72 65 64 20 6c 69 62 72 61 72 69 65 73 2e hared libraries.
6ac0: 20 44 6f 65 73 0a 23 20 20 20 20 20 20 20 20 20 Does.#
6ad0: 20 20 6e 6f 74 20 69 6d 70 61 63 74 20 73 68 61 not impact sha
6ae0: 72 65 64 20 54 63 6c 20 62 75 69 6c 64 73 2e 20 red Tcl builds.
6af0: 49 6d 70 6c 69 65 64 20 62 79 20 53 54 41 54 49 Implied by STATI
6b00: 43 5f 42 55 49 4c 44 20 73 69 6e 63 65 20 54 63 C_BUILD since Tc
6b10: 6c 20 39 2e 30 2e 0a 23 20 55 53 45 5f 54 48 52 l 9.0..# USE_THR
6b20: 45 41 44 5f 41 4c 4c 4f 43 20 2d 20 31 20 2d 3e EAD_ALLOC - 1 ->
6b30: 20 55 73 65 20 61 20 73 68 61 72 65 64 20 67 6c Use a shared gl
6b40: 6f 62 61 6c 20 66 72 65 65 20 70 6f 6f 6c 20 66 obal free pool f
6b50: 6f 72 20 61 6c 6c 6f 63 61 74 69 6f 6e 2e 0a 23 or allocation..#
6b60: 20 20 20 20 20 20 20 20 20 20 20 30 20 2d 3e 20 0 ->
6b70: 55 73 65 20 74 68 65 20 6e 6f 6e 2d 74 68 72 65 Use the non-thre
6b80: 61 64 20 61 6c 6c 6f 63 61 74 6f 72 2e 0a 23 20 ad allocator..#
6b90: 55 4e 43 48 45 43 4b 45 44 20 2d 20 31 20 2d 3e UNCHECKED - 1 ->
6ba0: 20 77 68 65 6e 20 64 6f 69 6e 67 20 61 20 64 65 when doing a de
6bb0: 62 75 67 20 62 75 69 6c 64 20 77 69 74 68 20 73 bug build with s
6bc0: 79 6d 62 6f 6c 73 2c 20 75 73 65 20 74 68 65 20 ymbols, use the
6bd0: 72 65 6c 65 61 73 65 0a 23 20 20 20 20 20 20 20 release.#
6be0: 20 20 20 20 43 20 72 75 6e 74 69 6d 65 2c 20 30 C runtime, 0
6bf0: 20 2d 3e 20 75 73 65 20 74 68 65 20 64 65 62 75 -> use the debu
6c00: 67 20 43 20 72 75 6e 74 69 6d 65 2e 0a 23 20 55 g C runtime..# U
6c10: 53 45 5f 53 54 55 42 53 20 2d 20 31 20 2d 3e 20 SE_STUBS - 1 ->
6c20: 63 6f 6d 70 69 6c 65 20 74 6f 20 75 73 65 20 73 compile to use s
6c30: 74 75 62 73 20 69 6e 74 65 72 66 61 63 65 73 2c tubs interfaces,
6c40: 20 30 20 2d 3e 20 64 69 72 65 63 74 20 6c 69 6e 0 -> direct lin
6c50: 6b 69 6e 67 0a 23 20 43 4f 4e 46 49 47 5f 43 48 king.# CONFIG_CH
6c60: 45 43 4b 20 2d 20 31 20 2d 3e 20 63 68 65 63 6b ECK - 1 -> check
6c70: 20 63 75 72 72 65 6e 74 20 62 75 69 6c 64 20 63 current build c
6c80: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 61 67 61 onfiguration aga
6c90: 69 6e 73 74 20 54 63 6c 0a 23 20 20 20 20 20 20 inst Tcl.#
6ca0: 20 20 20 20 20 63 6f 6e 66 69 67 75 72 61 74 69 configurati
6cb0: 6f 6e 20 28 69 67 6e 6f 72 65 64 20 66 6f 72 20 on (ignored for
6cc0: 54 63 6c 20 69 74 73 65 6c 66 29 0a 23 20 5f 55 Tcl itself).# _U
6cd0: 53 45 5f 36 34 42 49 54 5f 54 49 4d 45 5f 54 20 SE_64BIT_TIME_T
6ce0: 2d 20 66 6f 72 63 65 73 20 61 20 62 75 69 6c 64 - forces a build
6cf0: 20 75 73 69 6e 67 20 36 34 2d 62 69 74 20 74 69 using 64-bit ti
6d00: 6d 65 5f 74 20 66 6f 72 20 33 32 2d 62 69 74 20 me_t for 32-bit
6d10: 62 75 69 6c 64 0a 23 20 20 20 20 20 20 20 20 20 build.#
6d20: 20 20 28 43 52 54 20 6c 69 62 72 61 72 79 20 73 (CRT library s
6d30: 68 6f 75 6c 64 20 73 75 70 70 6f 72 74 20 74 68 hould support th
6d40: 69 73 2c 20 6e 6f 74 20 6e 65 65 64 65 64 20 66 is, not needed f
6d50: 6f 72 20 54 63 6c 20 39 2e 78 29 0a 23 20 46 75 or Tcl 9.x).# Fu
6d60: 72 74 68 65 72 2c 20 4c 49 4e 4b 45 52 46 4c 41 rther, LINKERFLA
6d70: 47 53 20 61 72 65 20 6d 6f 64 69 66 69 65 64 20 GS are modified
6d80: 62 61 73 65 64 20 6f 6e 20 61 62 6f 76 65 2e 0a based on above..
6d90: 0a 23 20 44 65 66 61 75 6c 74 20 76 61 6c 75 65 .# Default value
6da0: 73 20 66 6f 72 20 61 6c 6c 20 74 68 65 20 61 62 s for all the ab
6db0: 6f 76 65 0a 53 54 41 54 49 43 5f 42 55 49 4c 44 ove.STATIC_BUILD
6dc0: 09 3d 20 30 0a 54 43 4c 5f 54 48 52 45 41 44 53 .= 0.TCL_THREADS
6dd0: 09 3d 20 31 0a 44 45 42 55 47 09 09 3d 20 30 0a .= 1.DEBUG..= 0.
6de0: 53 59 4d 42 4f 4c 53 09 09 3d 20 30 0a 50 52 4f SYMBOLS..= 0.PRO
6df0: 46 49 4c 45 09 09 3d 20 30 0a 50 47 4f 09 09 3d FILE..= 0.PGO..=
6e00: 20 30 0a 4d 53 56 43 52 54 09 09 3d 20 31 0a 54 0.MSVCRT..= 1.T
6e10: 43 4c 5f 55 53 45 5f 53 54 41 54 49 43 5f 50 41 CL_USE_STATIC_PA
6e20: 43 4b 41 47 45 53 09 3d 20 30 0a 55 53 45 5f 54 CKAGES.= 0.USE_T
6e30: 48 52 45 41 44 5f 41 4c 4c 4f 43 20 3d 20 31 0a HREAD_ALLOC = 1.
6e40: 55 4e 43 48 45 43 4b 45 44 09 3d 20 30 0a 43 4f UNCHECKED.= 0.CO
6e50: 4e 46 49 47 5f 43 48 45 43 4b 20 20 20 20 3d 20 NFIG_CHECK =
6e60: 31 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 43 1.!if $(DOING_TC
6e70: 4c 29 0a 55 53 45 5f 53 54 55 42 53 20 20 20 20 L).USE_STUBS
6e80: 20 20 20 3d 20 30 0a 21 65 6c 73 65 0a 55 53 45 = 0.!else.USE
6e90: 5f 53 54 55 42 53 20 20 20 20 20 20 20 3d 20 31 _STUBS = 1
6ea0: 0a 21 65 6e 64 69 66 0a 56 45 52 42 4f 53 45 09 .!endif.VERBOSE.
6eb0: 09 3d 20 30 0a 0a 23 20 49 66 20 4f 50 54 53 20 .= 0..# If OPTS
6ec0: 69 73 20 6e 6f 74 20 65 6d 70 74 79 20 41 4e 44 is not empty AND
6ed0: 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69 does not contai
6ee0: 6e 20 22 6e 6f 6e 65 22 20 77 68 69 63 68 20 74 n "none" which t
6ef0: 75 72 6e 73 20 6f 66 66 20 61 6c 6c 20 4f 50 54 urns off all OPT
6f00: 53 0a 23 20 73 65 74 20 74 68 65 20 61 62 6f 76 S.# set the abov
6f10: 65 20 6d 61 63 72 6f 73 20 62 61 73 65 64 20 6f e macros based o
6f20: 6e 20 4f 50 54 53 20 63 6f 6e 74 65 6e 74 0a 21 n OPTS content.!
6f30: 69 66 20 22 24 28 4f 50 54 53 29 22 20 21 3d 20 if "$(OPTS)" !=
6f40: 22 22 20 26 26 20 21 5b 24 28 4e 4d 41 4b 45 48 "" && ![$(NMAKEH
6f50: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 22 24 LP_NATIVE) -f "$
6f60: 28 4f 50 54 53 29 22 20 22 6e 6f 6e 65 22 5d 0a (OPTS)" "none"].
6f70: 0a 23 20 4f 50 54 53 20 61 72 65 20 73 70 65 63 .# OPTS are spec
6f80: 69 66 69 65 64 2c 20 70 61 72 73 65 20 74 68 65 ified, parse the
6f90: 6d 0a 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 m..!if [$(NMAKEH
6fa0: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 LP_NATIVE) -f $(
6fb0: 4f 50 54 53 29 20 22 73 74 61 74 69 63 22 5d 0a OPTS) "static"].
6fc0: 53 54 41 54 49 43 5f 42 55 49 4c 44 09 3d 20 31 STATIC_BUILD.= 1
6fd0: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b 24 28 .!endif..!if [$(
6fe0: 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 NMAKEHLP_NATIVE)
6ff0: 20 2d 66 20 24 28 4f 50 54 53 29 20 22 6e 6f 73 -f $(OPTS) "nos
7000: 74 75 62 73 22 5d 0a 55 53 45 5f 53 54 55 42 53 tubs"].USE_STUBS
7010: 09 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 .= 0.!endif..!if
7020: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 [$(NMAKEHLP_NAT
7030: 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 IVE) -f $(OPTS)
7040: 22 6e 6f 6d 73 76 63 72 74 22 5d 0a 4d 53 56 43 "nomsvcrt"].MSVC
7050: 52 54 09 09 3d 20 30 0a 21 65 6c 73 65 0a 21 69 RT..= 0.!else.!i
7060: 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 f [$(NMAKEHLP_NA
7070: 54 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 TIVE) -f $(OPTS)
7080: 20 22 6d 73 76 63 72 74 22 5d 0a 21 65 6c 73 65 "msvcrt"].!else
7090: 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 .!if $(TCL_MAJOR
70a0: 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 20 26 _VERSION) == 8 &
70b0: 26 20 24 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 & $(TCL_MINOR_VE
70c0: 52 53 49 4f 4e 29 20 3c 20 37 20 26 26 20 24 28 RSION) < 7 && $(
70d0: 53 54 41 54 49 43 5f 42 55 49 4c 44 29 0a 4d 53 STATIC_BUILD).MS
70e0: 56 43 52 54 09 09 3d 20 30 0a 21 65 6e 64 69 66 VCRT..= 0.!endif
70f0: 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 .!endif.!endif #
7100: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 [$(NMAKEHLP_NAT
7110: 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 IVE) -f $(OPTS)
7120: 22 6e 6f 6d 73 76 63 72 74 22 5d 0a 0a 21 69 66 "nomsvcrt"]..!if
7130: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 [$(NMAKEHLP_NAT
7140: 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 IVE) -f $(OPTS)
7150: 22 73 74 61 74 69 63 70 6b 67 22 5d 20 26 26 20 "staticpkg"] &&
7160: 24 28 53 54 41 54 49 43 5f 42 55 49 4c 44 29 0a $(STATIC_BUILD).
7170: 54 43 4c 5f 55 53 45 5f 53 54 41 54 49 43 5f 50 TCL_USE_STATIC_P
7180: 41 43 4b 41 47 45 53 09 3d 20 31 0a 21 65 6e 64 ACKAGES.= 1.!end
7190: 69 66 0a 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 if..!if [$(NMAKE
71a0: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 HLP_NATIVE) -f $
71b0: 28 4f 50 54 53 29 20 22 6e 6f 74 68 72 65 61 64 (OPTS) "nothread
71c0: 73 22 5d 0a 54 43 4c 5f 54 48 52 45 41 44 53 20 s"].TCL_THREADS
71d0: 3d 20 30 0a 55 53 45 5f 54 48 52 45 41 44 5f 41 = 0.USE_THREAD_A
71e0: 4c 4c 4f 43 3d 20 30 0a 21 65 6e 64 69 66 0a 0a LLOC= 0.!endif..
71f0: 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f !if [$(NMAKEHLP_
7200: 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f 50 54 NATIVE) -f $(OPT
7210: 53 29 20 22 74 63 6c 38 22 5d 0a 54 43 4c 5f 42 S) "tcl8"].TCL_B
7220: 55 49 4c 44 5f 46 4f 52 20 3d 20 38 0a 21 65 6e UILD_FOR = 8.!en
7230: 64 69 66 0a 0a 21 69 66 20 24 28 54 43 4c 5f 4d dif..!if $(TCL_M
7240: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d AJOR_VERSION) ==
7250: 20 38 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 8.!if [$(NMAKEH
7260: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 LP_NATIVE) -f $(
7270: 4f 50 54 53 29 20 22 74 69 6d 65 36 34 62 69 74 OPTS) "time64bit
7280: 22 5d 0a 5f 55 53 45 5f 36 34 42 49 54 5f 54 49 "]._USE_64BIT_TI
7290: 4d 45 5f 54 20 3d 20 31 0a 21 65 6e 64 69 66 0a ME_T = 1.!endif.
72a0: 21 65 6e 64 69 66 0a 0a 23 20 59 65 73 2c 20 69 !endif..# Yes, i
72b0: 74 27 73 20 77 65 69 72 64 20 74 68 61 74 20 74 t's weird that t
72c0: 68 65 20 22 73 79 6d 62 6f 6c 73 22 20 6f 70 74 he "symbols" opt
72d0: 69 6f 6e 20 63 6f 6e 74 72 6f 6c 73 20 44 45 42 ion controls DEB
72e0: 55 47 20 61 6e 64 0a 23 20 74 68 65 20 22 70 64 UG and.# the "pd
72f0: 62 73 22 20 6f 70 74 69 6f 6e 20 63 6f 6e 74 72 bs" option contr
7300: 6f 6c 73 20 53 59 4d 42 4f 4c 53 2e 20 54 68 61 ols SYMBOLS. Tha
7310: 74 27 73 20 68 69 73 74 6f 72 69 63 61 6c 2e 0a t's historical..
7320: 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f !if [$(NMAKEHLP_
7330: 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f 50 54 NATIVE) -f $(OPT
7340: 53 29 20 22 73 79 6d 62 6f 6c 73 22 5d 0a 44 45 S) "symbols"].DE
7350: 42 55 47 09 09 3d 20 31 0a 21 65 6c 73 65 0a 44 BUG..= 1.!else.D
7360: 45 42 55 47 09 09 3d 20 30 0a 21 65 6e 64 69 66 EBUG..= 0.!endif
7370: 0a 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c ..!if [$(NMAKEHL
7380: 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f P_NATIVE) -f $(O
7390: 50 54 53 29 20 22 70 64 62 73 22 5d 0a 53 59 4d PTS) "pdbs"].SYM
73a0: 42 4f 4c 53 09 09 3d 20 31 0a 21 65 6c 73 65 0a BOLS..= 1.!else.
73b0: 53 59 4d 42 4f 4c 53 09 09 3d 20 30 0a 21 65 6e SYMBOLS..= 0.!en
73c0: 64 69 66 0a 0a 21 69 66 20 5b 24 28 4e 4d 41 4b dif..!if [$(NMAK
73d0: 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 EHLP_NATIVE) -f
73e0: 24 28 4f 50 54 53 29 20 22 70 72 6f 66 69 6c 65 $(OPTS) "profile
73f0: 22 5d 0a 50 52 4f 46 49 4c 45 09 09 3d 20 31 0a "].PROFILE..= 1.
7400: 21 65 6c 73 65 0a 50 52 4f 46 49 4c 45 09 09 3d !else.PROFILE..=
7410: 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b 0.!endif..!if [
7420: 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 $(NMAKEHLP_NATIV
7430: 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 22 70 E) -f $(OPTS) "p
7440: 67 69 22 5d 0a 50 47 4f 09 09 3d 20 31 0a 21 65 gi"].PGO..= 1.!e
7450: 6c 73 65 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c lseif [$(NMAKEHL
7460: 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f P_NATIVE) -f $(O
7470: 50 54 53 29 20 22 70 67 6f 22 5d 0a 50 47 4f 09 PTS) "pgo"].PGO.
7480: 09 3d 20 32 0a 21 65 6c 73 65 0a 50 47 4f 09 09 .= 2.!else.PGO..
7490: 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 = 0.!endif..!if
74a0: 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 [$(NMAKEHLP_NATI
74b0: 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 22 VE) -f $(OPTS) "
74c0: 6c 6f 69 6d 70 61 63 74 22 5d 0a 21 6d 65 73 73 loimpact"].!mess
74d0: 61 67 65 20 2a 2a 2a 20 57 61 72 6e 69 6e 67 3a age *** Warning:
74e0: 20 69 67 6e 6f 72 69 6e 67 20 6f 70 74 69 6f 6e ignoring option
74f0: 20 22 6c 6f 69 6d 70 61 63 74 22 20 2d 20 64 65 "loimpact" - de
7500: 70 72 65 63 61 74 65 64 20 6f 6e 20 6d 6f 64 65 precated on mode
7510: 72 6e 20 57 69 6e 64 6f 77 73 2e 0a 21 65 6e 64 rn Windows..!end
7520: 69 66 0a 0a 23 20 54 42 44 20 2d 20 73 68 6f 75 if..# TBD - shou
7530: 6c 64 20 67 65 74 20 72 69 64 20 6f 66 20 74 68 ld get rid of th
7540: 69 73 20 6f 70 74 69 6f 6e 0a 21 69 66 20 5b 24 is option.!if [$
7550: 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 (NMAKEHLP_NATIVE
7560: 29 20 2d 66 20 24 28 4f 50 54 53 29 20 22 74 68 ) -f $(OPTS) "th
7570: 72 64 61 6c 6c 6f 63 22 5d 0a 55 53 45 5f 54 48 rdalloc"].USE_TH
7580: 52 45 41 44 5f 41 4c 4c 4f 43 20 3d 20 31 0a 21 READ_ALLOC = 1.!
7590: 65 6e 64 69 66 0a 0a 21 69 66 20 5b 24 28 4e 4d endif..!if [$(NM
75a0: 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d AKEHLP_NATIVE) -
75b0: 66 20 24 28 4f 50 54 53 29 20 22 74 63 6c 61 6c f $(OPTS) "tclal
75c0: 6c 6f 63 22 5d 0a 55 53 45 5f 54 48 52 45 41 44 loc"].USE_THREAD
75d0: 5f 41 4c 4c 4f 43 20 3d 20 30 0a 21 65 6e 64 69 _ALLOC = 0.!endi
75e0: 66 0a 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 f..!if [$(NMAKEH
75f0: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 LP_NATIVE) -f $(
7600: 4f 50 54 53 29 20 22 75 6e 63 68 65 63 6b 65 64 OPTS) "unchecked
7610: 22 5d 0a 55 4e 43 48 45 43 4b 45 44 20 3d 20 31 "].UNCHECKED = 1
7620: 0a 21 65 6c 73 65 0a 55 4e 43 48 45 43 4b 45 44 .!else.UNCHECKED
7630: 20 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 = 0.!endif..!if
7640: 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 [$(NMAKEHLP_NAT
7650: 49 56 45 29 20 2d 66 20 24 28 4f 50 54 53 29 20 IVE) -f $(OPTS)
7660: 22 6e 6f 63 6f 6e 66 69 67 63 68 65 63 6b 22 5d "noconfigcheck"]
7670: 0a 43 4f 4e 46 49 47 5f 43 48 45 43 4b 20 3d 20 .CONFIG_CHECK =
7680: 31 0a 21 65 6c 73 65 0a 43 4f 4e 46 49 47 5f 43 1.!else.CONFIG_C
7690: 48 45 43 4b 20 3d 20 30 0a 21 65 6e 64 69 66 0a HECK = 0.!endif.
76a0: 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 .!if [$(NMAKEHLP
76b0: 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 4f 50 _NATIVE) -f $(OP
76c0: 54 53 29 20 22 76 65 72 62 6f 73 65 22 5d 0a 56 TS) "verbose"].V
76d0: 45 52 42 4f 53 45 09 09 3d 20 31 0a 21 65 6c 73 ERBOSE..= 1.!els
76e0: 65 0a 56 45 52 42 4f 53 45 09 09 3d 20 30 0a 21 e.VERBOSE..= 0.!
76f0: 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 56 45 52 endif..!if $(VER
7700: 42 4f 53 45 29 0a 21 6d 65 73 73 61 67 65 20 2a BOSE).!message *
7710: 2a 2a 20 4f 50 54 53 3d 24 28 4f 50 54 53 29 0a ** OPTS=$(OPTS).
7720: 21 65 6e 64 69 66 0a 0a 21 65 6e 64 69 66 20 23 !endif..!endif #
7730: 20 22 24 28 4f 50 54 53 29 22 20 21 3d 20 22 22 "$(OPTS)" != ""
7740: 20 20 26 26 20 2e 2e 2e 20 70 61 72 73 69 6e 67 && ... parsing
7750: 20 6f 66 20 4f 50 54 53 0a 0a 23 20 53 65 74 20 of OPTS..# Set
7760: 6c 69 6e 6b 65 72 20 66 6c 61 67 73 20 62 61 73 linker flags bas
7770: 65 64 20 6f 6e 20 61 62 6f 76 65 0a 0a 21 69 66 ed on above..!if
7780: 20 24 28 50 47 4f 29 20 3e 20 31 0a 21 69 66 20 $(PGO) > 1.!if
7790: 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 [$(NMAKEHLP_NATI
77a0: 56 45 29 20 2d 6c 20 2d 6c 74 63 67 3a 70 67 6f VE) -l -ltcg:pgo
77b0: 70 74 69 6d 69 7a 65 20 24 28 4c 49 4e 4b 45 52 ptimize $(LINKER
77c0: 5f 54 45 53 54 46 4c 41 47 53 29 5d 0a 4c 49 4e _TESTFLAGS)].LIN
77d0: 4b 45 52 46 4c 41 47 53 09 3d 20 24 28 4c 49 4e KERFLAGS.= $(LIN
77e0: 4b 45 52 46 4c 41 47 53 3a 2d 6c 74 63 67 3d 29 KERFLAGS:-ltcg=)
77f0: 20 2d 6c 74 63 67 3a 70 67 6f 70 74 69 6d 69 7a -ltcg:pgoptimiz
7800: 65 0a 21 65 6c 73 65 0a 4d 53 47 3d 5e 0a 54 68 e.!else.MSG=^.Th
7810: 69 73 20 63 6f 6d 70 69 6c 65 72 20 64 6f 65 73 is compiler does
7820: 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 70 72 6f not support pro
7830: 66 69 6c 65 20 67 75 69 64 65 64 20 6f 70 74 69 file guided opti
7840: 6d 69 7a 61 74 69 6f 6e 2e 0a 21 65 72 72 6f 72 mization..!error
7850: 20 24 28 4d 53 47 29 0a 21 65 6e 64 69 66 0a 21 $(MSG).!endif.!
7860: 65 6c 73 65 69 66 20 24 28 50 47 4f 29 20 3e 20 elseif $(PGO) >
7870: 30 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 0.!if [$(NMAKEHL
7880: 50 5f 4e 41 54 49 56 45 29 20 2d 6c 20 2d 6c 74 P_NATIVE) -l -lt
7890: 63 67 3a 70 67 69 6e 73 74 72 75 6d 65 6e 74 20 cg:pginstrument
78a0: 24 28 4c 49 4e 4b 45 52 5f 54 45 53 54 46 4c 41 $(LINKER_TESTFLA
78b0: 47 53 29 5d 0a 4c 49 4e 4b 45 52 46 4c 41 47 53 GS)].LINKERFLAGS
78c0: 09 3d 20 24 28 4c 49 4e 4b 45 52 46 4c 41 47 53 .= $(LINKERFLAGS
78d0: 3a 2d 6c 74 63 67 3d 29 20 2d 6c 74 63 67 3a 70 :-ltcg=) -ltcg:p
78e0: 67 69 6e 73 74 72 75 6d 65 6e 74 0a 21 65 6c 73 ginstrument.!els
78f0: 65 0a 4d 53 47 3d 5e 0a 54 68 69 73 20 63 6f 6d e.MSG=^.This com
7900: 70 69 6c 65 72 20 64 6f 65 73 20 6e 6f 74 20 73 piler does not s
7910: 75 70 70 6f 72 74 20 70 72 6f 66 69 6c 65 20 67 upport profile g
7920: 75 69 64 65 64 20 6f 70 74 69 6d 69 7a 61 74 69 uided optimizati
7930: 6f 6e 2e 0a 21 65 72 72 6f 72 20 24 28 4d 53 47 on..!error $(MSG
7940: 29 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 66 0a ).!endif.!endif.
7950: 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 .###############
7960: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
7970: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
7980: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
7990: 23 0a 23 20 38 2e 20 50 61 72 73 65 20 74 68 65 #.# 8. Parse the
79a0: 20 53 54 41 54 53 20 6d 61 63 72 6f 20 74 6f 20 STATS macro to
79b0: 63 6f 6e 66 69 67 75 72 65 20 63 6f 64 65 20 69 configure code i
79c0: 6e 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0a 23 nstrumentation.#
79d0: 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6d The following m
79e0: 61 63 72 6f 73 20 61 72 65 20 73 65 74 20 62 79 acros are set by
79f0: 20 74 68 69 73 20 73 65 63 74 69 6f 6e 3a 0a 23 this section:.#
7a00: 20 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 20 2d TCL_MEM_DEBUG -
7a10: 20 31 20 2d 3e 20 65 6e 61 62 6c 65 73 20 6d 65 1 -> enables me
7a20: 6d 6f 72 79 20 61 6c 6c 6f 63 61 74 69 6f 6e 20 mory allocation
7a30: 69 6e 73 74 72 75 6d 65 6e 74 61 74 69 6f 6e 0a instrumentation.
7a40: 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 #
7a50: 20 20 30 20 2d 3e 20 64 69 73 61 62 6c 65 73 0a 0 -> disables.
7a60: 23 20 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 44 45 # TCL_COMPILE_DE
7a70: 42 55 47 20 2d 20 31 20 2d 3e 20 65 6e 61 62 6c BUG - 1 -> enabl
7a80: 65 73 20 62 79 74 65 20 63 6f 6d 70 69 6c 65 72 es byte compiler
7a90: 20 6c 6f 67 67 69 6e 67 0a 23 20 20 20 20 20 20 logging.#
7aa0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 0
7ab0: 20 2d 3e 20 64 69 73 61 62 6c 65 73 0a 0a 23 20 -> disables..#
7ac0: 44 65 66 61 75 6c 74 20 62 6f 74 68 20 61 72 65 Default both are
7ad0: 20 6f 66 66 0a 54 43 4c 5f 4d 45 4d 5f 44 45 42 off.TCL_MEM_DEB
7ae0: 55 47 09 20 20 20 20 3d 20 30 0a 54 43 4c 5f 43 UG. = 0.TCL_C
7af0: 4f 4d 50 49 4c 45 5f 44 45 42 55 47 20 20 20 3d OMPILE_DEBUG =
7b00: 20 30 0a 0a 21 69 66 20 22 24 28 53 54 41 54 53 0..!if "$(STATS
7b10: 29 22 20 21 3d 20 22 22 20 26 26 20 21 5b 24 28 )" != "" && ![$(
7b20: 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 NMAKEHLP_NATIVE)
7b30: 20 2d 66 20 22 24 28 53 54 41 54 53 29 22 20 22 -f "$(STATS)" "
7b40: 6e 6f 6e 65 22 5d 0a 0a 21 69 66 20 24 28 56 45 none"]..!if $(VE
7b50: 52 42 4f 53 45 29 0a 21 6d 65 73 73 61 67 65 20 RBOSE).!message
7b60: 2a 2a 2a 20 53 54 41 54 53 3d 24 28 53 54 41 54 *** STATS=$(STAT
7b70: 53 29 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 5b S).!endif..!if [
7b80: 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 $(NMAKEHLP_NATIV
7b90: 45 29 20 2d 66 20 24 28 53 54 41 54 53 29 20 22 E) -f $(STATS) "
7ba0: 6d 65 6d 64 62 67 22 5d 0a 54 43 4c 5f 4d 45 4d memdbg"].TCL_MEM
7bb0: 5f 44 45 42 55 47 09 20 20 20 20 3d 20 31 0a 21 _DEBUG. = 1.!
7bc0: 65 6c 73 65 0a 54 43 4c 5f 4d 45 4d 5f 44 45 42 else.TCL_MEM_DEB
7bd0: 55 47 09 20 20 20 20 3d 20 30 0a 21 65 6e 64 69 UG. = 0.!endi
7be0: 66 0a 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 f..!if [$(NMAKEH
7bf0: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 28 LP_NATIVE) -f $(
7c00: 53 54 41 54 53 29 20 22 63 6f 6d 70 64 62 67 22 STATS) "compdbg"
7c10: 5d 0a 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 44 45 ].TCL_COMPILE_DE
7c20: 42 55 47 20 20 20 3d 20 31 0a 21 65 6c 73 65 0a BUG = 1.!else.
7c30: 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 44 45 42 55 TCL_COMPILE_DEBU
7c40: 47 20 20 20 3d 20 30 0a 21 65 6e 64 69 66 0a 0a G = 0.!endif..
7c50: 21 65 6e 64 69 66 0a 0a 23 23 23 23 23 23 23 23 !endif..########
7c60: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
7c70: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
7c80: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
7c90: 23 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 39 ############.# 9
7ca0: 2e 20 50 61 72 73 65 20 74 68 65 20 43 48 45 43 . Parse the CHEC
7cb0: 4b 53 20 6d 61 63 72 6f 20 74 6f 20 63 6f 6e 66 KS macro to conf
7cc0: 69 67 75 72 65 20 61 64 64 69 74 69 6f 6e 61 6c igure additional
7cd0: 20 63 6f 6d 70 69 6c 65 72 20 63 68 65 63 6b 73 compiler checks
7ce0: 0a 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 .# The following
7cf0: 20 6d 61 63 72 6f 73 20 61 72 65 20 73 65 74 20 macros are set
7d00: 62 79 20 74 68 69 73 20 73 65 63 74 69 6f 6e 3a by this section:
7d10: 0a 23 20 57 41 52 4e 49 4e 47 53 20 2d 20 63 6f .# WARNINGS - co
7d20: 6d 70 69 6c 65 72 20 73 77 69 74 63 68 65 73 20 mpiler switches
7d30: 74 68 61 74 20 63 6f 6e 74 72 6f 6c 20 74 68 65 that control the
7d40: 20 77 61 72 6e 69 6e 67 73 20 6c 65 76 65 6c 0a warnings level.
7d50: 23 20 54 43 4c 5f 4e 4f 5f 44 45 50 52 45 43 41 # TCL_NO_DEPRECA
7d60: 54 45 44 20 2d 20 31 20 2d 3e 20 64 69 73 61 62 TED - 1 -> disab
7d70: 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 64 le support for d
7d80: 65 70 72 65 63 61 74 65 64 20 66 75 6e 63 74 69 eprecated functi
7d90: 6f 6e 73 0a 23 20 20 20 20 20 20 20 20 20 20 20 ons.#
7da0: 20 20 20 20 20 20 20 20 20 20 30 20 2d 3e 20 65 0 -> e
7db0: 6e 61 62 6c 65 20 64 65 70 72 65 63 61 74 65 64 nable deprecated
7dc0: 20 66 75 6e 63 74 69 6f 6e 73 0a 0a 23 20 44 65 functions..# De
7dd0: 66 61 75 6c 74 73 20 2d 20 50 65 72 6d 69 74 20 faults - Permit
7de0: 64 65 70 72 65 63 61 74 65 64 20 66 75 6e 63 74 deprecated funct
7df0: 69 6f 6e 73 20 61 6e 64 20 77 61 72 6e 69 6e 67 ions and warning
7e00: 20 6c 65 76 65 6c 20 33 0a 54 43 4c 5f 4e 4f 5f level 3.TCL_NO_
7e10: 44 45 50 52 45 43 41 54 45 44 09 20 20 20 20 3d DEPRECATED. =
7e20: 20 30 0a 57 41 52 4e 49 4e 47 53 09 09 20 20 20 0.WARNINGS..
7e30: 20 3d 20 2d 57 33 0a 0a 21 69 66 20 22 24 28 43 = -W3..!if "$(C
7e40: 48 45 43 4b 53 29 22 20 21 3d 20 22 22 20 26 26 HECKS)" != "" &&
7e50: 20 21 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 ![$(NMAKEHLP_NA
7e60: 54 49 56 45 29 20 2d 66 20 22 24 28 43 48 45 43 TIVE) -f "$(CHEC
7e70: 4b 53 29 22 20 22 6e 6f 6e 65 22 5d 0a 0a 21 69 KS)" "none"]..!i
7e80: 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 f [$(NMAKEHLP_NA
7e90: 54 49 56 45 29 20 2d 66 20 24 28 43 48 45 43 4b TIVE) -f $(CHECK
7ea0: 53 29 20 22 6e 6f 64 65 70 22 5d 0a 54 43 4c 5f S) "nodep"].TCL_
7eb0: 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 09 20 20 NO_DEPRECATED.
7ec0: 20 20 3d 20 31 0a 21 65 6e 64 69 66 0a 0a 21 69 = 1.!endif..!i
7ed0: 66 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 f [$(NMAKEHLP_NA
7ee0: 54 49 56 45 29 20 2d 66 20 24 28 43 48 45 43 4b TIVE) -f $(CHECK
7ef0: 53 29 20 22 66 75 6c 6c 77 61 72 6e 22 5d 0a 57 S) "fullwarn"].W
7f00: 41 52 4e 49 4e 47 53 09 09 20 20 20 20 3d 20 2d ARNINGS.. = -
7f10: 57 34 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 48 W4.!if [$(NMAKEH
7f20: 4c 50 5f 4e 41 54 49 56 45 29 20 2d 6c 20 2d 77 LP_NATIVE) -l -w
7f30: 61 72 6e 3a 33 20 24 28 4c 49 4e 4b 45 52 5f 54 arn:3 $(LINKER_T
7f40: 45 53 54 46 4c 41 47 53 29 5d 0a 4c 49 4e 4b 45 ESTFLAGS)].LINKE
7f50: 52 46 4c 41 47 53 09 09 20 20 20 20 3d 20 24 28 RFLAGS.. = $(
7f60: 4c 49 4e 4b 45 52 46 4c 41 47 53 29 20 2d 77 61 LINKERFLAGS) -wa
7f70: 72 6e 3a 33 0a 21 65 6e 64 69 66 0a 21 65 6e 64 rn:3.!endif.!end
7f80: 69 66 0a 0a 21 69 66 20 5b 24 28 4e 4d 41 4b 45 if..!if [$(NMAKE
7f90: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 66 20 24 HLP_NATIVE) -f $
7fa0: 28 43 48 45 43 4b 53 29 20 22 36 34 62 69 74 22 (CHECKS) "64bit"
7fb0: 5d 20 26 26 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 ] && [$(NMAKEHLP
7fc0: 5f 4e 41 54 49 56 45 29 20 2d 63 20 2d 57 70 36 _NATIVE) -c -Wp6
7fd0: 34 5d 0a 57 41 52 4e 49 4e 47 53 09 09 20 20 20 4].WARNINGS..
7fe0: 20 3d 20 24 28 57 41 52 4e 49 4e 47 53 29 20 2d = $(WARNINGS) -
7ff0: 57 70 36 34 0a 21 65 6e 64 69 66 0a 0a 21 65 6e Wp64.!endif..!en
8000: 64 69 66 0a 0a 0a 23 23 23 23 23 23 23 23 23 23 dif...##########
8010: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
8020: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
8030: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
8040: 23 23 23 23 23 23 0a 23 20 31 30 2e 20 43 6f 6e ######.# 10. Con
8050: 73 74 72 75 63 74 20 6f 75 74 70 75 74 20 64 69 struct output di
8060: 72 65 63 74 6f 72 79 20 61 6e 64 20 66 69 6c 65 rectory and file
8070: 20 70 61 74 68 73 0a 23 20 46 69 67 75 72 65 2d paths.# Figure-
8080: 6f 75 74 20 68 6f 77 20 74 6f 20 6e 61 6d 65 20 out how to name
8090: 6f 75 72 20 69 6e 74 65 72 6d 65 64 69 61 74 65 our intermediate
80a0: 20 61 6e 64 20 6f 75 74 70 75 74 20 64 69 72 65 and output dire
80b0: 63 74 6f 72 69 65 73 2e 0a 23 20 49 6e 20 6f 72 ctories..# In or
80c0: 64 65 72 20 74 6f 20 61 76 6f 69 64 20 69 6e 61 der to avoid ina
80d0: 64 76 65 72 74 65 6e 74 20 6d 69 78 69 6e 67 20 dvertent mixing
80e0: 6f 66 20 6f 62 6a 65 63 74 20 66 69 6c 65 73 20 of object files
80f0: 62 75 69 6c 74 20 75 73 69 6e 67 0a 23 20 64 69 built using.# di
8100: 66 66 65 72 65 6e 74 20 63 6f 6d 70 69 6c 65 72 fferent compiler
8110: 73 2c 20 62 75 69 6c 64 20 63 6f 6e 66 69 67 75 s, build configu
8120: 72 61 74 69 6f 6e 73 20 65 74 63 2e 2c 0a 23 0a rations etc.,.#.
8130: 23 20 4e 61 6d 69 6e 67 20 63 6f 6e 76 65 6e 74 # Naming convent
8140: 69 6f 6e 20 28 73 75 66 66 69 78 65 73 29 3a 0a ion (suffixes):.
8150: 23 20 20 20 74 20 3d 20 66 75 6c 6c 20 74 68 72 # t = full thr
8160: 65 61 64 20 73 75 70 70 6f 72 74 2e 20 28 4e 6f ead support. (No
8170: 74 20 75 73 65 64 20 66 6f 72 20 54 63 6c 20 3e t used for Tcl >
8180: 3d 20 39 2e 30 29 0a 23 20 20 20 73 20 3d 20 73 = 9.0).# s = s
8190: 74 61 74 69 63 20 6c 69 62 72 61 72 79 20 28 61 tatic library (a
81a0: 73 20 6f 70 70 6f 73 65 64 20 74 6f 20 61 6e 20 s opposed to an
81b0: 69 6d 70 6f 72 74 20 6c 69 62 72 61 72 79 29 0a import library).
81c0: 23 20 20 20 67 20 3d 20 6c 69 6e 6b 65 64 20 74 # g = linked t
81d0: 6f 20 74 68 65 20 64 65 62 75 67 20 65 6e 61 62 o the debug enab
81e0: 6c 65 64 20 43 20 72 75 6e 2d 74 69 6d 65 2e 0a led C run-time..
81f0: 23 20 20 20 78 20 3d 20 73 70 65 63 69 61 6c 20 # x = special
8200: 73 74 61 74 69 63 20 62 75 69 6c 64 20 77 68 65 static build whe
8210: 6e 20 69 74 20 6c 69 6e 6b 73 20 74 6f 20 74 68 n it links to th
8220: 65 20 64 79 6e 61 6d 69 63 20 43 20 72 75 6e 2d e dynamic C run-
8230: 74 69 6d 65 2e 0a 23 0a 23 20 54 68 65 20 66 6f time..#.# The fo
8240: 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 20 61 llowing macros a
8250: 72 65 20 73 65 74 20 69 6e 20 74 68 69 73 20 73 re set in this s
8260: 65 63 74 69 6f 6e 3a 0a 23 20 53 55 46 58 20 2d ection:.# SUFX -
8270: 20 74 68 65 20 73 75 66 66 69 78 20 74 6f 20 75 the suffix to u
8280: 73 65 20 66 6f 72 20 62 69 6e 61 72 69 65 73 20 se for binaries
8290: 62 61 73 65 64 20 6f 6e 20 61 62 6f 76 65 20 6e based on above n
82a0: 61 6d 69 6e 67 20 63 6f 6e 76 65 6e 74 69 6f 6e aming convention
82b0: 0a 23 20 42 55 49 4c 44 44 49 52 54 4f 50 20 2d .# BUILDDIRTOP -
82c0: 20 74 68 65 20 74 6f 70 6c 65 76 65 6c 20 64 65 the toplevel de
82d0: 66 61 75 6c 74 20 6f 75 74 70 75 74 20 64 69 72 fault output dir
82e0: 65 63 74 6f 72 79 0a 23 20 20 20 20 20 20 69 73 ectory.# is
82f0: 20 6f 66 20 74 68 65 20 66 6f 72 6d 20 7b 52 65 of the form {Re
8300: 6c 65 61 73 65 2c 44 65 62 75 67 7d 5b 5f 41 4d lease,Debug}[_AM
8310: 44 36 34 5d 5b 5f 43 4f 4d 50 49 4c 45 52 56 45 D64][_COMPILERVE
8320: 52 53 49 4f 4e 5d 0a 23 20 20 20 20 20 20 75 6e RSION].# un
8330: 6c 65 73 73 20 6f 76 65 72 72 69 64 64 65 6e 20 less overridden
8340: 62 79 20 64 65 66 69 6e 69 6e 67 20 4f 55 54 5f by defining OUT_
8350: 44 49 52 20 6f 6e 20 74 68 65 20 63 6f 6d 6d 61 DIR on the comma
8360: 6e 64 20 6c 69 6e 65 2e 0a 23 20 54 4d 50 5f 44 nd line..# TMP_D
8370: 49 52 20 2d 20 64 69 72 65 63 74 6f 72 79 20 77 IR - directory w
8380: 68 65 72 65 20 6f 62 6a 65 63 74 20 66 69 6c 65 here object file
8390: 73 20 61 72 65 20 63 72 65 61 74 65 64 0a 23 20 s are created.#
83a0: 4f 55 54 5f 44 49 52 20 2d 20 64 69 72 65 63 74 OUT_DIR - direct
83b0: 6f 72 79 20 77 68 65 72 65 20 6f 75 74 70 75 74 ory where output
83c0: 20 65 78 65 63 75 74 61 62 6c 65 73 20 61 72 65 executables are
83d0: 20 63 72 65 61 74 65 64 0a 23 20 42 6f 74 68 20 created.# Both
83e0: 54 4d 50 5f 44 49 52 20 61 6e 64 20 4f 55 54 5f TMP_DIR and OUT_
83f0: 44 49 52 20 61 72 65 20 64 65 66 61 75 6c 74 65 DIR are defaulte
8400: 64 20 6f 6e 6c 79 20 69 66 20 6e 6f 74 20 64 65 d only if not de
8410: 66 69 6e 65 64 20 62 79 20 74 68 65 0a 23 20 70 fined by the.# p
8420: 61 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 28 arent makefile (
8430: 6f 72 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 29 or command line)
8440: 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20 76 61 . The default va
8450: 6c 75 65 73 20 61 72 65 0a 23 20 62 61 73 65 64 lues are.# based
8460: 20 6f 6e 20 42 55 49 4c 44 44 49 52 54 4f 50 2e on BUILDDIRTOP.
8470: 0a 23 20 53 54 55 42 50 52 45 46 49 58 20 2d 20 .# STUBPREFIX -
8480: 6e 61 6d 65 20 6f 66 20 74 68 65 20 73 74 75 62 name of the stub
8490: 73 20 6c 69 62 72 61 72 79 20 66 6f 72 20 74 68 s library for th
84a0: 69 73 20 70 72 6f 6a 65 63 74 0a 23 20 50 52 4a is project.# PRJ
84b0: 49 4d 50 4c 49 42 20 2d 20 6f 75 74 70 75 74 20 IMPLIB - output
84c0: 70 61 74 68 20 6f 66 20 74 68 65 20 67 65 6e 65 path of the gene
84d0: 72 61 74 65 64 20 70 72 6f 6a 65 63 74 20 69 6d rated project im
84e0: 70 6f 72 74 20 6c 69 62 72 61 72 79 0a 23 20 50 port library.# P
84f0: 52 4a 4c 49 42 4e 41 4d 45 20 2d 20 6e 61 6d 65 RJLIBNAME - name
8500: 20 6f 66 20 67 65 6e 65 72 61 74 65 64 20 70 72 of generated pr
8510: 6f 6a 65 63 74 20 6c 69 62 72 61 72 79 0a 23 20 oject library.#
8520: 50 52 4a 4c 49 42 20 20 20 20 20 2d 20 6f 75 74 PRJLIB - out
8530: 70 75 74 20 70 61 74 68 20 6f 66 20 67 65 6e 65 put path of gene
8540: 72 61 74 65 64 20 70 72 6f 6a 65 63 74 20 6c 69 rated project li
8550: 62 72 61 72 79 0a 23 20 50 52 4a 53 54 55 42 4c brary.# PRJSTUBL
8560: 49 42 4e 41 4d 45 20 2d 20 6e 61 6d 65 20 6f 66 IBNAME - name of
8570: 20 74 68 65 20 67 65 6e 65 72 61 74 65 64 20 70 the generated p
8580: 72 6f 6a 65 63 74 20 73 74 75 62 73 20 6c 69 62 roject stubs lib
8590: 72 61 72 79 0a 23 20 50 52 4a 53 54 55 42 4c 49 rary.# PRJSTUBLI
85a0: 42 20 2d 20 6f 75 74 70 75 74 20 70 61 74 68 20 B - output path
85b0: 6f 66 20 74 68 65 20 67 65 6e 65 72 61 74 65 64 of the generated
85c0: 20 70 72 6f 6a 65 63 74 20 73 74 75 62 73 20 6c project stubs l
85d0: 69 62 72 61 72 79 0a 23 20 52 45 53 46 49 4c 45 ibrary.# RESFILE
85e0: 20 2d 20 6f 75 74 70 75 74 20 72 65 73 6f 75 72 - output resour
85f0: 63 65 20 66 69 6c 65 20 28 6f 6e 6c 79 20 69 66 ce file (only if
8600: 20 6e 6f 74 20 73 74 61 74 69 63 20 62 75 69 6c not static buil
8610: 64 29 0a 0a 53 55 46 58 09 20 20 20 20 3d 20 74 d)..SUFX. = t
8620: 73 67 78 0a 0a 23 20 49 66 20 4f 55 54 5f 44 49 sgx..# If OUT_DI
8630: 52 20 69 73 20 64 65 66 69 6e 65 64 20 28 76 69 R is defined (vi
8640: 61 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 6f a command line o
8650: 72 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 29 20 6d r environment) m
8660: 61 6b 65 20 74 68 61 74 0a 23 20 64 65 66 69 6e ake that.# defin
8670: 65 20 42 55 49 4c 44 44 49 52 54 4f 50 20 61 73 e BUILDDIRTOP as
8680: 20 69 74 73 20 74 61 69 6c 2e 20 4f 74 68 65 72 its tail. Other
8690: 77 69 73 65 2c 20 64 65 66 61 75 6c 74 20 69 74 wise, default it
86a0: 20 61 73 20 62 65 6c 6f 77 20 61 6e 64 0a 23 20 as below and.#
86b0: 64 65 66 69 6e 65 20 4f 55 54 5f 44 49 52 20 62 define OUT_DIR b
86c0: 61 73 65 64 20 6f 6e 20 42 55 49 4c 44 44 49 52 ased on BUILDDIR
86d0: 54 4f 50 2e 0a 21 69 66 64 65 66 20 4f 55 54 5f TOP..!ifdef OUT_
86e0: 44 49 52 0a 23 20 52 65 6c 61 74 69 76 65 20 70 DIR.# Relative p
86f0: 61 74 68 73 20 2d 3e 20 61 62 73 6f 6c 75 74 65 aths -> absolute
8700: 0a 21 69 66 20 5b 65 63 68 6f 20 4f 55 54 5f 44 .!if [echo OUT_D
8710: 49 52 20 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c 70 IR = \> nmakehlp
8720: 2e 6f 75 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b 24 .out] \. || [$
8730: 28 4e 4d 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 (NMAKEHLP_NATIVE
8740: 29 20 2d 51 20 22 24 28 4f 55 54 5f 44 49 52 29 ) -Q "$(OUT_DIR)
8750: 22 20 3e 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 " >> nmakehlp.ou
8760: 74 5d 0a 21 65 72 72 6f 72 20 2a 2a 2a 20 43 6f t].!error *** Co
8770: 75 6c 64 20 6e 6f 74 20 66 75 6c 6c 79 20 71 75 uld not fully qu
8780: 61 6c 69 66 79 20 70 61 74 68 20 4f 55 54 5f 44 alify path OUT_D
8790: 49 52 3d 24 28 4f 55 54 5f 44 49 52 29 0a 21 65 IR=$(OUT_DIR).!e
87a0: 6e 64 69 66 0a 23 20 54 68 65 20 75 6e 64 65 66 ndif.# The undef
87b0: 20 69 73 20 6e 65 65 64 65 64 20 77 68 65 6e 20 is needed when
87c0: 4f 55 54 5f 44 49 52 20 69 73 20 70 61 73 73 65 OUT_DIR is passe
87d0: 64 20 6f 6e 20 74 68 65 20 63 6f 6d 6d 61 6e 64 d on the command
87e0: 20 6c 69 6e 65 0a 23 20 6f 74 68 65 72 77 69 73 line.# otherwis
87f0: 65 20 74 68 65 20 64 65 66 69 6e 69 74 69 6f 6e e the definition
8800: 20 69 6e 20 74 68 65 20 69 6e 63 6c 75 64 65 20 in the include
8810: 77 69 6c 6c 20 6e 6f 74 20 74 61 6b 65 20 65 66 will not take ef
8820: 66 65 63 74 0a 21 75 6e 64 65 66 20 4f 55 54 5f fect.!undef OUT_
8830: 44 49 52 0a 21 69 6e 63 6c 75 64 65 20 6e 6d 61 DIR.!include nma
8840: 6b 65 68 6c 70 2e 6f 75 74 0a 21 69 66 20 5b 65 kehlp.out.!if [e
8850: 63 68 6f 20 42 55 49 4c 44 44 49 52 54 4f 50 20 cho BUILDDIRTOP
8860: 3d 20 5c 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 = \> nmakehlp.ou
8870: 74 5d 20 5c 0a 20 20 20 7c 7c 20 5b 66 6f 72 20 t] \. || [for
8880: 25 41 20 69 6e 20 28 22 24 28 4f 55 54 5f 44 49 %A in ("$(OUT_DI
8890: 52 29 22 29 20 64 6f 20 65 63 68 6f 20 25 7e 6e R)") do echo %~n
88a0: 78 41 20 5c 3e 3e 20 6e 6d 61 6b 65 68 6c 70 2e xA \>> nmakehlp.
88b0: 6f 75 74 5d 0a 21 65 72 72 6f 72 20 2a 2a 2a 20 out].!error ***
88c0: 43 6f 75 6c 64 20 6e 6f 74 20 67 65 74 20 74 61 Could not get ta
88d0: 69 6c 20 6f 66 20 70 61 74 68 20 4f 55 54 5f 44 il of path OUT_D
88e0: 49 52 3d 24 28 4f 55 54 5f 44 49 52 29 0a 21 65 IR=$(OUT_DIR).!e
88f0: 6e 64 69 66 0a 21 69 6e 63 6c 75 64 65 20 6e 6d ndif.!include nm
8900: 61 6b 65 68 6c 70 2e 6f 75 74 0a 0a 21 65 6c 73 akehlp.out..!els
8910: 65 0a 0a 21 69 66 20 24 28 44 45 42 55 47 29 0a e..!if $(DEBUG).
8920: 42 55 49 4c 44 44 49 52 54 4f 50 20 3d 20 44 65 BUILDDIRTOP = De
8930: 62 75 67 0a 21 65 6c 73 65 0a 42 55 49 4c 44 44 bug.!else.BUILDD
8940: 49 52 54 4f 50 20 3d 20 52 65 6c 65 61 73 65 0a IRTOP = Release.
8950: 21 65 6e 64 69 66 0a 0a 0a 21 69 66 20 22 24 28 !endif...!if "$(
8960: 4d 41 43 48 49 4e 45 29 22 20 21 3d 20 22 49 58 MACHINE)" != "IX
8970: 38 36 22 0a 42 55 49 4c 44 44 49 52 54 4f 50 20 86".BUILDDIRTOP
8980: 3d 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5f =$(BUILDDIRTOP)_
8990: 24 28 4d 41 43 48 49 4e 45 29 0a 21 65 6e 64 69 $(MACHINE).!endi
89a0: 66 0a 21 69 66 20 24 28 56 43 56 45 52 29 20 3e f.!if $(VCVER) >
89b0: 20 36 0a 42 55 49 4c 44 44 49 52 54 4f 50 20 3d 6.BUILDDIRTOP =
89c0: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5f 56 $(BUILDDIRTOP)_V
89d0: 43 24 28 56 43 56 45 52 29 0a 21 65 6e 64 69 66 C$(VCVER).!endif
89e0: 0a 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 21 24 ..!endif..!if !$
89f0: 28 44 45 42 55 47 29 20 7c 7c 20 24 28 54 43 4c (DEBUG) || $(TCL
8a00: 5f 56 45 52 53 49 4f 4e 29 20 3e 20 38 36 20 7c _VERSION) > 86 |
8a10: 7c 20 24 28 44 45 42 55 47 29 20 26 26 20 24 28 | $(DEBUG) && $(
8a20: 55 4e 43 48 45 43 4b 45 44 29 0a 53 55 46 58 09 UNCHECKED).SUFX.
8a30: 20 20 20 20 3d 20 24 28 53 55 46 58 3a 67 3d 29 = $(SUFX:g=)
8a40: 0a 21 65 6e 64 69 66 0a 0a 54 4d 50 5f 44 49 52 .!endif..TMP_DIR
8a50: 46 55 4c 4c 20 3d 20 2e 5c 24 28 42 55 49 4c 44 FULL = .\$(BUILD
8a60: 44 49 52 54 4f 50 29 5c 24 28 50 52 4f 4a 45 43 DIRTOP)\$(PROJEC
8a70: 54 29 5f 54 68 72 65 61 64 65 64 44 79 6e 61 6d T)_ThreadedDynam
8a80: 69 63 53 74 61 74 69 63 58 0a 0a 21 69 66 20 21 icStaticX..!if !
8a90: 24 28 53 54 41 54 49 43 5f 42 55 49 4c 44 29 0a $(STATIC_BUILD).
8aa0: 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d 20 24 28 TMP_DIRFULL = $(
8ab0: 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 53 74 61 74 TMP_DIRFULL:Stat
8ac0: 69 63 3d 29 0a 53 55 46 58 09 20 20 20 20 3d 20 ic=).SUFX. =
8ad0: 24 28 53 55 46 58 3a 73 3d 29 0a 45 58 54 09 20 $(SUFX:s=).EXT.
8ae0: 20 20 20 3d 20 64 6c 6c 0a 54 4d 50 5f 44 49 52 = dll.TMP_DIR
8af0: 46 55 4c 4c 20 3d 20 24 28 54 4d 50 5f 44 49 52 FULL = $(TMP_DIR
8b00: 46 55 4c 4c 3a 58 3d 29 0a 53 55 46 58 09 20 20 FULL:X=).SUFX.
8b10: 20 20 3d 20 24 28 53 55 46 58 3a 78 3d 29 0a 21 = $(SUFX:x=).!
8b20: 65 6c 73 65 0a 54 4d 50 5f 44 49 52 46 55 4c 4c else.TMP_DIRFULL
8b30: 20 3d 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c = $(TMP_DIRFULL
8b40: 3a 44 79 6e 61 6d 69 63 3d 29 0a 45 58 54 09 20 :Dynamic=).EXT.
8b50: 20 20 20 3d 20 6c 69 62 0a 21 69 66 20 24 28 4d = lib.!if $(M
8b60: 53 56 43 52 54 29 20 26 26 20 24 28 54 43 4c 5f SVCRT) && $(TCL_
8b70: 56 45 52 53 49 4f 4e 29 20 3e 20 38 36 20 7c 7c VERSION) > 86 ||
8b80: 20 21 24 28 4d 53 56 43 52 54 29 20 26 26 20 24 !$(MSVCRT) && $
8b90: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3c 20 (TCL_VERSION) <
8ba0: 38 37 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d 87.TMP_DIRFULL =
8bb0: 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 58 $(TMP_DIRFULL:X
8bc0: 3d 29 0a 53 55 46 58 09 20 20 20 20 3d 20 24 28 =).SUFX. = $(
8bd0: 53 55 46 58 3a 78 3d 29 0a 21 65 6e 64 69 66 0a SUFX:x=).!endif.
8be0: 21 65 6e 64 69 66 0a 0a 21 69 66 20 21 24 28 54 !endif..!if !$(T
8bf0: 43 4c 5f 54 48 52 45 41 44 53 29 20 7c 7c 20 24 CL_THREADS) || $
8c00: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3e 20 (TCL_VERSION) >
8c10: 38 36 0a 54 4d 50 5f 44 49 52 46 55 4c 4c 20 3d 86.TMP_DIRFULL =
8c20: 20 24 28 54 4d 50 5f 44 49 52 46 55 4c 4c 3a 54 $(TMP_DIRFULL:T
8c30: 68 72 65 61 64 65 64 3d 29 0a 53 55 46 58 09 20 hreaded=).SUFX.
8c40: 20 20 20 3d 20 24 28 53 55 46 58 3a 74 3d 29 0a = $(SUFX:t=).
8c50: 21 65 6e 64 69 66 0a 0a 21 69 66 6e 64 65 66 20 !endif..!ifndef
8c60: 54 4d 50 5f 44 49 52 0a 54 4d 50 5f 44 49 52 09 TMP_DIR.TMP_DIR.
8c70: 20 20 20 20 3d 20 24 28 54 4d 50 5f 44 49 52 46 = $(TMP_DIRF
8c80: 55 4c 4c 29 0a 21 69 66 6e 64 65 66 20 4f 55 54 ULL).!ifndef OUT
8c90: 5f 44 49 52 0a 4f 55 54 5f 44 49 52 09 20 20 20 _DIR.OUT_DIR.
8ca0: 20 3d 20 2e 5c 24 28 42 55 49 4c 44 44 49 52 54 = .\$(BUILDDIRT
8cb0: 4f 50 29 0a 21 65 6e 64 69 66 0a 21 65 6c 73 65 OP).!endif.!else
8cc0: 0a 21 69 66 6e 64 65 66 20 4f 55 54 5f 44 49 52 .!ifndef OUT_DIR
8cd0: 0a 4f 55 54 5f 44 49 52 09 20 20 20 20 3d 20 24 .OUT_DIR. = $
8ce0: 28 54 4d 50 5f 44 49 52 29 0a 21 65 6e 64 69 66 (TMP_DIR).!endif
8cf0: 0a 21 65 6e 64 69 66 0a 0a 23 20 52 65 6c 61 74 .!endif..# Relat
8d00: 69 76 65 20 70 61 74 68 73 20 2d 3e 20 61 62 73 ive paths -> abs
8d10: 6f 6c 75 74 65 0a 21 69 66 20 5b 65 63 68 6f 20 olute.!if [echo
8d20: 4f 55 54 5f 44 49 52 20 3d 20 5c 3e 20 6e 6d 61 OUT_DIR = \> nma
8d30: 6b 65 68 6c 70 2e 6f 75 74 5d 20 5c 0a 20 20 20 kehlp.out] \.
8d40: 7c 7c 20 5b 24 28 4e 4d 41 4b 45 48 4c 50 5f 4e || [$(NMAKEHLP_N
8d50: 41 54 49 56 45 29 20 2d 51 20 22 24 28 4f 55 54 ATIVE) -Q "$(OUT
8d60: 5f 44 49 52 29 22 20 3e 3e 20 6e 6d 61 6b 65 68 _DIR)" >> nmakeh
8d70: 6c 70 2e 6f 75 74 5d 0a 21 65 72 72 6f 72 20 2a lp.out].!error *
8d80: 2a 2a 20 43 6f 75 6c 64 20 6e 6f 74 20 66 75 6c ** Could not ful
8d90: 6c 79 20 71 75 61 6c 69 66 79 20 70 61 74 68 20 ly qualify path
8da0: 4f 55 54 5f 44 49 52 3d 24 28 4f 55 54 5f 44 49 OUT_DIR=$(OUT_DI
8db0: 52 29 0a 21 65 6e 64 69 66 0a 21 69 66 20 5b 65 R).!endif.!if [e
8dc0: 63 68 6f 20 54 4d 50 5f 44 49 52 20 3d 20 5c 3e cho TMP_DIR = \>
8dd0: 3e 20 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 20 > nmakehlp.out]
8de0: 5c 0a 20 20 20 7c 7c 20 5b 24 28 4e 4d 41 4b 45 \. || [$(NMAKE
8df0: 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 51 20 22 HLP_NATIVE) -Q "
8e00: 24 28 54 4d 50 5f 44 49 52 29 22 20 3e 3e 20 6e $(TMP_DIR)" >> n
8e10: 6d 61 6b 65 68 6c 70 2e 6f 75 74 5d 0a 21 65 72 makehlp.out].!er
8e20: 72 6f 72 20 2a 2a 2a 20 43 6f 75 6c 64 20 6e 6f ror *** Could no
8e30: 74 20 66 75 6c 6c 79 20 71 75 61 6c 69 66 79 20 t fully qualify
8e40: 70 61 74 68 20 54 4d 50 5f 44 49 52 3d 24 28 54 path TMP_DIR=$(T
8e50: 4d 50 5f 44 49 52 29 0a 21 65 6e 64 69 66 0a 21 MP_DIR).!endif.!
8e60: 69 6e 63 6c 75 64 65 20 6e 6d 61 6b 65 68 6c 70 include nmakehlp
8e70: 2e 6f 75 74 0a 0a 23 20 54 68 65 20 6e 61 6d 65 .out..# The name
8e80: 20 6f 66 20 74 68 65 20 73 74 75 62 73 20 6c 69 of the stubs li
8e90: 62 72 61 72 79 20 66 6f 72 20 74 68 65 20 70 72 brary for the pr
8ea0: 6f 6a 65 63 74 20 62 65 69 6e 67 20 62 75 69 6c oject being buil
8eb0: 74 0a 53 54 55 42 50 52 45 46 49 58 20 20 20 20 t.STUBPREFIX
8ec0: 20 20 3d 20 24 28 50 52 4f 4a 45 43 54 29 73 74 = $(PROJECT)st
8ed0: 75 62 0a 0a 23 0a 23 20 53 65 74 20 75 70 20 70 ub..#.# Set up p
8ee0: 61 74 68 73 20 74 6f 20 76 61 72 69 6f 75 73 20 aths to various
8ef0: 54 63 6c 20 65 78 65 63 75 74 61 62 6c 65 73 20 Tcl executables
8f00: 61 6e 64 20 6c 69 62 72 61 72 69 65 73 20 6e 65 and libraries ne
8f10: 65 64 65 64 20 62 79 20 65 78 74 65 6e 73 69 6f eded by extensio
8f20: 6e 73 0a 23 0a 0a 23 20 54 49 50 20 34 33 30 2e ns.#..# TIP 430.
8f30: 20 55 6e 75 73 65 64 20 66 6f 72 20 38 2e 36 20 Unused for 8.6
8f40: 62 75 74 20 6e 6f 20 68 61 72 6d 20 64 65 66 69 but no harm defi
8f50: 6e 69 6e 67 20 69 74 20 74 6f 20 61 6c 6c 6f 77 ning it to allow
8f60: 20 61 20 63 6f 6d 6d 6f 6e 20 72 75 6c 65 73 2e a common rules.
8f70: 76 63 0a 54 43 4c 5f 5a 49 50 5f 46 49 4c 45 20 vc.TCL_ZIP_FILE
8f80: 3d 20 6c 69 62 74 63 6c 24 28 54 43 4c 5f 4d 41 = libtcl$(TCL_MA
8f90: 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 2e 24 28 54 JOR_VERSION).$(T
8fa0: 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e CL_MINOR_VERSION
8fb0: 29 24 28 54 43 4c 5f 50 41 54 43 48 5f 4c 45 54 )$(TCL_PATCH_LET
8fc0: 54 45 52 29 24 28 54 43 4c 5f 52 45 4c 45 41 53 TER)$(TCL_RELEAS
8fd0: 45 5f 53 45 52 49 41 4c 29 2e 7a 69 70 0a 54 4b E_SERIAL).zip.TK
8fe0: 5f 5a 49 50 5f 46 49 4c 45 20 3d 20 6c 69 62 74 _ZIP_FILE = libt
8ff0: 6b 24 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 k$(TK_MAJOR_VERS
9000: 49 4f 4e 29 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f ION).$(TK_MINOR_
9010: 56 45 52 53 49 4f 4e 29 24 28 54 4b 5f 50 41 54 VERSION)$(TK_PAT
9020: 43 48 5f 4c 45 54 54 45 52 29 24 28 54 4b 5f 52 CH_LETTER)$(TK_R
9030: 45 4c 45 41 53 45 5f 53 45 52 49 41 4c 29 2e 7a ELEASE_SERIAL).z
9040: 69 70 0a 0a 21 69 66 20 24 28 44 4f 49 4e 47 5f ip..!if $(DOING_
9050: 54 43 4c 29 0a 54 43 4c 53 48 4e 41 4d 45 20 20 TCL).TCLSHNAME
9060: 20 20 20 20 20 3d 20 24 28 50 52 4f 4a 45 43 54 = $(PROJECT
9070: 29 73 68 24 28 56 45 52 53 49 4f 4e 29 24 28 53 )sh$(VERSION)$(S
9080: 55 46 58 29 2e 65 78 65 0a 54 43 4c 53 48 09 09 UFX).exe.TCLSH..
9090: 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 = $(OUT_DIR)\$(T
90a0: 43 4c 53 48 4e 41 4d 45 29 0a 54 43 4c 49 4d 50 CLSHNAME).TCLIMP
90b0: 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 LIB.= $(OUT_DIR)
90c0: 5c 24 28 50 52 4f 4a 45 43 54 29 24 28 56 45 52 \$(PROJECT)$(VER
90d0: 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69 62 SION)$(SUFX).lib
90e0: 0a 54 43 4c 4c 49 42 4e 41 4d 45 09 3d 20 24 28 .TCLLIBNAME.= $(
90f0: 50 52 4f 4a 45 43 54 29 24 28 56 45 52 53 49 4f PROJECT)$(VERSIO
9100: 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58 54 29 N)$(SUFX).$(EXT)
9110: 0a 54 43 4c 4c 49 42 09 09 3d 20 24 28 4f 55 54 .TCLLIB..= $(OUT
9120: 5f 44 49 52 29 5c 24 28 54 43 4c 4c 49 42 4e 41 _DIR)\$(TCLLIBNA
9130: 4d 45 29 0a 54 43 4c 53 43 52 49 50 54 5a 49 50 ME).TCLSCRIPTZIP
9140: 20 20 20 20 3d 20 24 28 4f 55 54 5f 44 49 52 29 = $(OUT_DIR)
9150: 5c 24 28 54 43 4c 5f 5a 49 50 5f 46 49 4c 45 29 \$(TCL_ZIP_FILE)
9160: 0a 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f ..!if $(TCL_MAJO
9170: 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 0a R_VERSION) == 8.
9180: 54 43 4c 53 54 55 42 4c 49 42 4e 41 4d 45 09 3d TCLSTUBLIBNAME.=
9190: 20 24 28 53 54 55 42 50 52 45 46 49 58 29 24 28 $(STUBPREFIX)$(
91a0: 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0a 21 65 6c VERSION).lib.!el
91b0: 73 65 0a 54 43 4c 53 54 55 42 4c 49 42 4e 41 4d se.TCLSTUBLIBNAM
91c0: 45 09 3d 20 24 28 53 54 55 42 50 52 45 46 49 58 E.= $(STUBPREFIX
91d0: 29 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 54 43 4c ).lib.!endif.TCL
91e0: 53 54 55 42 4c 49 42 09 3d 20 24 28 4f 55 54 5f STUBLIB.= $(OUT_
91f0: 44 49 52 29 5c 24 28 54 43 4c 53 54 55 42 4c 49 DIR)\$(TCLSTUBLI
9200: 42 4e 41 4d 45 29 0a 54 43 4c 5f 49 4e 43 4c 55 BNAME).TCL_INCLU
9210: 44 45 53 20 20 20 20 3d 20 2d 49 22 24 28 57 49 DES = -I"$(WI
9220: 4e 5f 44 49 52 29 22 20 2d 49 22 24 28 47 45 4e N_DIR)" -I"$(GEN
9230: 45 52 49 43 44 49 52 29 22 0a 0a 21 65 6c 73 65 ERICDIR)"..!else
9240: 20 23 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 # !$(DOING_TCL)
9250: 0a 0a 21 69 66 20 24 28 54 43 4c 49 4e 53 54 41 ..!if $(TCLINSTA
9260: 4c 4c 29 20 23 20 42 75 69 6c 64 69 6e 67 20 61 LL) # Building a
9270: 67 61 69 6e 73 74 20 61 6e 20 69 6e 73 74 61 6c gainst an instal
9280: 6c 65 64 20 54 63 6c 0a 0a 23 20 57 68 65 6e 20 led Tcl..# When
9290: 62 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73 69 building extensi
92a0: 6f 6e 73 2c 20 77 65 20 6e 65 65 64 20 74 6f 20 ons, we need to
92b0: 6c 6f 63 61 74 65 20 74 63 6c 73 68 2e 20 44 65 locate tclsh. De
92c0: 70 65 6e 64 69 6e 67 20 6f 6e 20 76 65 72 73 69 pending on versi
92d0: 6f 6e 0a 23 20 6f 66 20 54 63 6c 20 77 65 20 61 on.# of Tcl we a
92e0: 72 65 20 62 75 69 6c 64 69 6e 67 20 61 67 61 69 re building agai
92f0: 6e 73 74 2c 20 74 68 69 73 20 6d 61 79 20 6f 72 nst, this may or
9300: 20 6d 61 79 20 6e 6f 74 20 68 61 76 65 20 61 20 may not have a
9310: 22 74 22 20 73 75 66 66 69 78 2e 0a 23 20 54 72 "t" suffix..# Tr
9320: 79 20 76 61 72 69 6f 75 73 20 70 6f 73 73 69 62 y various possib
9330: 69 6c 69 74 69 65 73 20 69 6e 20 74 75 72 6e 2e ilities in turn.
9340: 0a 54 43 4c 53 48 09 09 3d 20 24 28 5f 54 43 4c .TCLSH..= $(_TCL
9350: 44 49 52 29 5c 62 69 6e 5c 74 63 6c 73 68 24 28 DIR)\bin\tclsh$(
9360: 54 43 4c 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 TCL_VERSION)$(SU
9370: 46 58 3a 74 3d 29 2e 65 78 65 0a 21 69 66 20 21 FX:t=).exe.!if !
9380: 65 78 69 73 74 28 22 24 28 54 43 4c 53 48 29 22 exist("$(TCLSH)"
9390: 29 0a 54 43 4c 53 48 20 20 20 20 20 20 20 20 20 ).TCLSH
93a0: 20 20 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 62 = $(_TCLDIR)\b
93b0: 69 6e 5c 74 63 6c 73 68 24 28 54 43 4c 5f 56 45 in\tclsh$(TCL_VE
93c0: 52 53 49 4f 4e 29 74 24 28 53 55 46 58 3a 74 3d RSION)t$(SUFX:t=
93d0: 29 2e 65 78 65 0a 21 65 6e 64 69 66 0a 0a 21 69 ).exe.!endif..!i
93e0: 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 f $(TCL_MAJOR_VE
93f0: 52 53 49 4f 4e 29 20 3d 3d 20 38 0a 54 43 4c 53 RSION) == 8.TCLS
9400: 54 55 42 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 TUBLIB.= $(_TCLD
9410: 49 52 29 5c 6c 69 62 5c 74 63 6c 73 74 75 62 24 IR)\lib\tclstub$
9420: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 2e 6c 69 (TCL_VERSION).li
9430: 62 0a 21 65 6c 73 65 0a 54 43 4c 53 54 55 42 4c b.!else.TCLSTUBL
9440: 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c IB.= $(_TCLDIR)\
9450: 6c 69 62 5c 74 63 6c 73 74 75 62 2e 6c 69 62 0a lib\tclstub.lib.
9460: 21 65 6e 64 69 66 0a 54 43 4c 49 4d 50 4c 49 42 !endif.TCLIMPLIB
9470: 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 .= $(_TCLDIR)\li
9480: 62 5c 74 63 6c 24 28 54 43 4c 5f 56 45 52 53 49 b\tcl$(TCL_VERSI
9490: 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 ON)$(SUFX:t=).li
94a0: 62 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e b.# When buildin
94b0: 67 20 65 78 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 g extensions, ma
94c0: 79 20 62 65 20 6c 69 6e 6b 69 6e 67 20 61 67 61 y be linking aga
94d0: 69 6e 73 74 20 54 63 6c 20 74 68 61 74 20 64 6f inst Tcl that do
94e0: 65 73 20 6e 6f 74 20 61 64 64 0a 23 20 22 74 22 es not add.# "t"
94f0: 20 73 75 66 66 69 78 20 28 65 2e 67 2e 20 38 2e suffix (e.g. 8.
9500: 36 29 2e 20 49 66 20 6c 69 62 20 6e 6f 74 20 66 6). If lib not f
9510: 6f 75 6e 64 20 63 68 65 63 6b 20 66 6f 72 20 74 ound check for t
9520: 68 61 74 20 70 6f 73 73 69 62 69 6c 69 74 79 2e hat possibility.
9530: 0a 21 69 66 20 21 65 78 69 73 74 28 22 24 28 54 .!if !exist("$(T
9540: 43 4c 49 4d 50 4c 49 42 29 22 29 0a 54 43 4c 49 CLIMPLIB)").TCLI
9550: 4d 50 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 MPLIB.= $(_TCLDI
9560: 52 29 5c 6c 69 62 5c 74 63 6c 24 28 54 43 4c 5f R)\lib\tcl$(TCL_
9570: 56 45 52 53 49 4f 4e 29 74 24 28 53 55 46 58 3a VERSION)t$(SUFX:
9580: 74 3d 29 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 54 t=).lib.!endif.T
9590: 43 4c 5f 4c 49 42 52 41 52 59 09 3d 20 24 28 5f CL_LIBRARY.= $(_
95a0: 54 43 4c 44 49 52 29 5c 6c 69 62 0a 54 43 4c 52 TCLDIR)\lib.TCLR
95b0: 45 47 4c 49 42 09 3d 20 24 28 5f 54 43 4c 44 49 EGLIB.= $(_TCLDI
95c0: 52 29 5c 6c 69 62 5c 74 63 6c 72 65 67 31 33 24 R)\lib\tclreg13$
95d0: 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a 54 43 (SUFX:t=).lib.TC
95e0: 4c 44 44 45 4c 49 42 09 3d 20 24 28 5f 54 43 4c LDDELIB.= $(_TCL
95f0: 44 49 52 29 5c 6c 69 62 5c 74 63 6c 64 64 65 31 DIR)\lib\tcldde1
9600: 34 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a 4$(SUFX:t=).lib.
9610: 54 43 4c 53 43 52 49 50 54 5a 49 50 09 3d 20 24 TCLSCRIPTZIP.= $
9620: 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 24 28 (_TCLDIR)\lib\$(
9630: 54 43 4c 5f 5a 49 50 5f 46 49 4c 45 29 0a 54 43 TCL_ZIP_FILE).TC
9640: 4c 54 4f 4f 4c 53 44 49 52 09 3d 20 5c 6d 75 73 LTOOLSDIR.= \mus
9650: 74 5c 68 61 76 65 5c 74 63 6c 5c 73 6f 75 72 63 t\have\tcl\sourc
9660: 65 73 5c 74 6f 5c 62 75 69 6c 64 5c 74 68 69 73 es\to\build\this
9670: 5c 74 61 72 67 65 74 0a 54 43 4c 5f 49 4e 43 4c \target.TCL_INCL
9680: 55 44 45 53 20 20 20 20 3d 20 2d 49 22 24 28 5f UDES = -I"$(_
9690: 54 43 4c 44 49 52 29 5c 69 6e 63 6c 75 64 65 22 TCLDIR)\include"
96a0: 0a 0a 21 65 6c 73 65 20 23 20 42 75 69 6c 64 69 ..!else # Buildi
96b0: 6e 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 73 ng against Tcl s
96c0: 6f 75 72 63 65 73 0a 0a 54 43 4c 53 48 09 09 3d ources..TCLSH..=
96d0: 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c $(_TCLDIR)\win\
96e0: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 $(BUILDDIRTOP)\t
96f0: 63 6c 73 68 24 28 54 43 4c 5f 56 45 52 53 49 4f clsh$(TCL_VERSIO
9700: 4e 29 24 28 53 55 46 58 3a 74 3d 29 2e 65 78 65 N)$(SUFX:t=).exe
9710: 0a 21 69 66 20 21 65 78 69 73 74 28 24 28 54 43 .!if !exist($(TC
9720: 4c 53 48 29 29 0a 54 43 4c 53 48 09 09 3d 20 24 LSH)).TCLSH..= $
9730: 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 (_TCLDIR)\win\$(
9740: 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c BUILDDIRTOP)\tcl
9750: 73 68 24 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 sh$(TCL_VERSION)
9760: 74 24 28 53 55 46 58 3a 74 3d 29 2e 65 78 65 0a t$(SUFX:t=).exe.
9770: 21 65 6e 64 69 66 0a 21 69 66 20 24 28 54 43 4c !endif.!if $(TCL
9780: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 _MAJOR_VERSION)
9790: 3d 3d 20 38 0a 54 43 4c 53 54 55 42 4c 49 42 09 == 8.TCLSTUBLIB.
97a0: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e = $(_TCLDIR)\win
97b0: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c \$(BUILDDIRTOP)\
97c0: 74 63 6c 73 74 75 62 24 28 54 43 4c 5f 56 45 52 tclstub$(TCL_VER
97d0: 53 49 4f 4e 29 2e 6c 69 62 0a 21 65 6c 73 65 0a SION).lib.!else.
97e0: 54 43 4c 53 54 55 42 4c 49 42 09 3d 20 24 28 5f TCLSTUBLIB.= $(_
97f0: 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 TCLDIR)\win\$(BU
9800: 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 73 74 ILDDIRTOP)\tclst
9810: 75 62 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 54 43 ub.lib.!endif.TC
9820: 4c 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 43 4c LIMPLIB.= $(_TCL
9830: 44 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 DIR)\win\$(BUILD
9840: 44 49 52 54 4f 50 29 5c 74 63 6c 24 28 54 43 4c DIRTOP)\tcl$(TCL
9850: 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 3a _VERSION)$(SUFX:
9860: 74 3d 29 2e 6c 69 62 0a 23 20 57 68 65 6e 20 62 t=).lib.# When b
9870: 75 69 6c 64 69 6e 67 20 65 78 74 65 6e 73 69 6f uilding extensio
9880: 6e 73 2c 20 6d 61 79 20 62 65 20 6c 69 6e 6b 69 ns, may be linki
9890: 6e 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 74 ng against Tcl t
98a0: 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 61 64 64 hat does not add
98b0: 0a 23 20 22 74 22 20 73 75 66 66 69 78 20 28 65 .# "t" suffix (e
98c0: 2e 67 2e 20 38 2e 36 29 2e 20 49 66 20 6c 69 62 .g. 8.6). If lib
98d0: 20 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65 63 6b not found check
98e0: 20 66 6f 72 20 74 68 61 74 20 70 6f 73 73 69 62 for that possib
98f0: 69 6c 69 74 79 2e 0a 21 69 66 20 21 65 78 69 73 ility..!if !exis
9900: 74 28 22 24 28 54 43 4c 49 4d 50 4c 49 42 29 22 t("$(TCLIMPLIB)"
9910: 29 0a 54 43 4c 49 4d 50 4c 49 42 09 3d 20 24 28 ).TCLIMPLIB.= $(
9920: 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c 24 28 42 _TCLDIR)\win\$(B
9930: 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 63 6c 24 UILDDIRTOP)\tcl$
9940: 28 54 43 4c 5f 56 45 52 53 49 4f 4e 29 74 24 28 (TCL_VERSION)t$(
9950: 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a 21 65 6e SUFX:t=).lib.!en
9960: 64 69 66 0a 54 43 4c 5f 4c 49 42 52 41 52 59 09 dif.TCL_LIBRARY.
9970: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 6c 69 62 = $(_TCLDIR)\lib
9980: 72 61 72 79 0a 54 43 4c 52 45 47 4c 49 42 09 3d rary.TCLREGLIB.=
9990: 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c $(_TCLDIR)\win\
99a0: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 $(BUILDDIRTOP)\t
99b0: 63 6c 72 65 67 31 33 24 28 53 55 46 58 3a 74 3d clreg13$(SUFX:t=
99c0: 29 2e 6c 69 62 0a 54 43 4c 44 44 45 4c 49 42 09 ).lib.TCLDDELIB.
99d0: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e = $(_TCLDIR)\win
99e0: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c \$(BUILDDIRTOP)\
99f0: 74 63 6c 64 64 65 31 34 24 28 53 55 46 58 3a 74 tcldde14$(SUFX:t
9a00: 3d 29 2e 6c 69 62 0a 54 43 4c 53 43 52 49 50 54 =).lib.TCLSCRIPT
9a10: 5a 49 50 09 3d 20 24 28 5f 54 43 4c 44 49 52 29 ZIP.= $(_TCLDIR)
9a20: 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 \win\$(BUILDDIRT
9a30: 4f 50 29 5c 24 28 54 43 4c 5f 5a 49 50 5f 46 49 OP)\$(TCL_ZIP_FI
9a40: 4c 45 29 0a 54 43 4c 54 4f 4f 4c 53 44 49 52 09 LE).TCLTOOLSDIR.
9a50: 3d 20 24 28 5f 54 43 4c 44 49 52 29 5c 74 6f 6f = $(_TCLDIR)\too
9a60: 6c 73 0a 54 43 4c 5f 49 4e 43 4c 55 44 45 53 09 ls.TCL_INCLUDES.
9a70: 3d 20 2d 49 22 24 28 5f 54 43 4c 44 49 52 29 5c = -I"$(_TCLDIR)\
9a80: 67 65 6e 65 72 69 63 22 20 2d 49 22 24 28 5f 54 generic" -I"$(_T
9a90: 43 4c 44 49 52 29 5c 77 69 6e 22 0a 0a 21 65 6e CLDIR)\win"..!en
9aa0: 64 69 66 20 23 20 54 43 4c 49 4e 53 54 41 4c 4c dif # TCLINSTALL
9ab0: 0a 0a 21 69 66 20 21 24 28 53 54 41 54 49 43 5f ..!if !$(STATIC_
9ac0: 42 55 49 4c 44 29 20 26 26 20 22 24 28 54 43 4c BUILD) && "$(TCL
9ad0: 5f 42 55 49 4c 44 5f 46 4f 52 29 22 20 3d 3d 20 _BUILD_FOR)" ==
9ae0: 22 38 22 0a 74 63 6c 6c 69 62 73 20 3d 20 22 24 "8".tcllibs = "$
9af0: 28 54 43 4c 53 54 55 42 4c 49 42 29 22 0a 21 65 (TCLSTUBLIB)".!e
9b00: 6c 73 65 0a 74 63 6c 6c 69 62 73 20 3d 20 22 24 lse.tcllibs = "$
9b10: 28 54 43 4c 53 54 55 42 4c 49 42 29 22 20 22 24 (TCLSTUBLIB)" "$
9b20: 28 54 43 4c 49 4d 50 4c 49 42 29 22 0a 21 65 6e (TCLIMPLIB)".!en
9b30: 64 69 66 0a 0a 21 65 6e 64 69 66 20 23 20 24 28 dif..!endif # $(
9b40: 44 4f 49 4e 47 5f 54 43 4c 29 0a 0a 23 20 57 65 DOING_TCL)..# We
9b50: 20 6e 65 65 64 20 61 20 74 63 6c 73 68 20 74 68 need a tclsh th
9b60: 61 74 20 77 69 6c 6c 20 72 75 6e 20 6f 6e 20 74 at will run on t
9b70: 68 65 20 68 6f 73 74 20 6d 61 63 68 69 6e 65 20 he host machine
9b80: 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 62 as part of the b
9b90: 75 69 6c 64 2e 0a 23 20 49 58 38 36 20 72 75 6e uild..# IX86 run
9ba0: 73 20 6f 6e 20 61 6c 6c 20 61 72 63 68 69 74 65 s on all archite
9bb0: 63 74 75 72 65 73 2e 0a 21 69 66 6e 64 65 66 20 ctures..!ifndef
9bc0: 54 43 4c 53 48 5f 4e 41 54 49 56 45 0a 21 69 66 TCLSH_NATIVE.!if
9bd0: 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d "$(MACHINE)" ==
9be0: 20 22 49 58 38 36 22 20 7c 7c 20 22 24 28 4d 41 "IX86" || "$(MA
9bf0: 43 48 49 4e 45 29 22 20 3d 3d 20 22 24 28 4e 41 CHINE)" == "$(NA
9c00: 54 49 56 45 5f 41 52 43 48 29 22 0a 54 43 4c 53 TIVE_ARCH)".TCLS
9c10: 48 5f 4e 41 54 49 56 45 09 3d 20 24 28 54 43 4c H_NATIVE.= $(TCL
9c20: 53 48 29 0a 21 65 6c 73 65 0a 21 65 72 72 6f 72 SH).!else.!error
9c30: 20 59 6f 75 20 6d 75 73 74 20 65 78 70 6c 69 63 You must explic
9c40: 69 74 6c 79 20 73 65 74 20 54 43 4c 53 48 5f 4e itly set TCLSH_N
9c50: 41 54 49 56 45 20 66 6f 72 20 63 72 6f 73 73 2d ATIVE for cross-
9c60: 63 6f 6d 70 69 6c 61 74 69 6f 6e 0a 21 65 6e 64 compilation.!end
9c70: 69 66 0a 21 65 6e 64 69 66 0a 0a 23 20 44 6f 20 if.!endif..# Do
9c80: 74 68 65 20 73 61 6d 65 20 66 6f 72 20 54 6b 20 the same for Tk
9c90: 61 6e 64 20 54 6b 20 65 78 74 65 6e 73 69 6f 6e and Tk extension
9ca0: 73 20 74 68 61 74 20 72 65 71 75 69 72 65 20 74 s that require t
9cb0: 68 65 20 54 6b 20 6c 69 62 72 61 72 69 65 73 0a he Tk libraries.
9cc0: 21 69 66 20 24 28 44 4f 49 4e 47 5f 54 4b 29 20 !if $(DOING_TK)
9cd0: 7c 7c 20 24 28 4e 45 45 44 5f 54 4b 29 0a 57 49 || $(NEED_TK).WI
9ce0: 53 48 4e 41 4d 45 50 52 45 46 49 58 20 3d 20 77 SHNAMEPREFIX = w
9cf0: 69 73 68 0a 57 49 53 48 4e 41 4d 45 20 3d 20 24 ish.WISHNAME = $
9d00: 28 57 49 53 48 4e 41 4d 45 50 52 45 46 49 58 29 (WISHNAMEPREFIX)
9d10: 24 28 54 4b 5f 56 45 52 53 49 4f 4e 29 24 28 53 $(TK_VERSION)$(S
9d20: 55 46 58 29 2e 65 78 65 0a 54 4b 4c 49 42 4e 41 UFX).exe.TKLIBNA
9d30: 4d 45 38 09 3d 20 74 6b 24 28 54 4b 5f 56 45 52 ME8.= tk$(TK_VER
9d40: 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 28 45 SION)$(SUFX).$(E
9d50: 58 54 29 0a 54 4b 4c 49 42 4e 41 4d 45 39 09 3d XT).TKLIBNAME9.=
9d60: 20 74 63 6c 39 74 6b 24 28 54 4b 5f 56 45 52 53 tcl9tk$(TK_VERS
9d70: 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 28 45 58 ION)$(SUFX).$(EX
9d80: 54 29 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a T).!if $(TCL_MAJ
9d90: 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 OR_VERSION) == 8
9da0: 20 7c 7c 20 22 24 28 54 43 4c 5f 42 55 49 4c 44 || "$(TCL_BUILD
9db0: 5f 46 4f 52 29 22 20 3d 3d 20 22 38 22 0a 54 4b _FOR)" == "8".TK
9dc0: 4c 49 42 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b LIBNAME.= tk$(TK
9dd0: 5f 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 _VERSION)$(SUFX)
9de0: 2e 24 28 45 58 54 29 0a 54 4b 49 4d 50 4c 49 42 .$(EXT).TKIMPLIB
9df0: 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45 NAME.= tk$(TK_VE
9e00: 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69 RSION)$(SUFX).li
9e10: 62 0a 21 65 6c 73 65 0a 54 4b 4c 49 42 4e 41 4d b.!else.TKLIBNAM
9e20: 45 09 3d 20 74 63 6c 39 74 6b 24 28 54 4b 5f 56 E.= tcl9tk$(TK_V
9e30: 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 24 ERSION)$(SUFX).$
9e40: 28 45 58 54 29 0a 54 4b 49 4d 50 4c 49 42 4e 41 (EXT).TKIMPLIBNA
9e50: 4d 45 09 3d 20 74 63 6c 39 74 6b 24 28 54 4b 5f ME.= tcl9tk$(TK_
9e60: 56 45 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e VERSION)$(SUFX).
9e70: 6c 69 62 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 lib.!endif.!if $
9e80: 28 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f (TK_MAJOR_VERSIO
9e90: 4e 29 20 3d 3d 20 38 0a 54 4b 53 54 55 42 4c 49 N) == 8.TKSTUBLI
9ea0: 42 4e 41 4d 45 09 3d 20 74 6b 73 74 75 62 24 28 BNAME.= tkstub$(
9eb0: 54 4b 5f 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0a TK_VERSION).lib.
9ec0: 21 65 6c 73 65 0a 54 4b 53 54 55 42 4c 49 42 4e !else.TKSTUBLIBN
9ed0: 41 4d 45 09 3d 20 74 6b 73 74 75 62 2e 6c 69 62 AME.= tkstub.lib
9ee0: 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 44 .!endif..!if $(D
9ef0: 4f 49 4e 47 5f 54 4b 29 0a 57 49 53 48 09 09 3d OING_TK).WISH..=
9f00: 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 28 57 49 $(OUT_DIR)\$(WI
9f10: 53 48 4e 41 4d 45 29 0a 54 4b 53 54 55 42 4c 49 SHNAME).TKSTUBLI
9f20: 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 29 5c 24 B.= $(OUT_DIR)\$
9f30: 28 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45 29 0a (TKSTUBLIBNAME).
9f40: 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 4f 55 54 TKIMPLIB.= $(OUT
9f50: 5f 44 49 52 29 5c 24 28 54 4b 49 4d 50 4c 49 42 _DIR)\$(TKIMPLIB
9f60: 4e 41 4d 45 29 0a 54 4b 4c 49 42 09 09 3d 20 24 NAME).TKLIB..= $
9f70: 28 4f 55 54 5f 44 49 52 29 5c 24 28 54 4b 4c 49 (OUT_DIR)\$(TKLI
9f80: 42 4e 41 4d 45 29 0a 54 4b 5f 49 4e 43 4c 55 44 BNAME).TK_INCLUD
9f90: 45 53 20 20 20 20 20 3d 20 2d 49 22 24 28 57 49 ES = -I"$(WI
9fa0: 4e 5f 44 49 52 29 22 20 2d 49 22 24 28 47 45 4e N_DIR)" -I"$(GEN
9fb0: 45 52 49 43 44 49 52 29 22 0a 54 4b 53 43 52 49 ERICDIR)".TKSCRI
9fc0: 50 54 5a 49 50 20 20 20 20 20 3d 20 24 28 4f 55 PTZIP = $(OU
9fd0: 54 5f 44 49 52 29 5c 24 28 54 4b 5f 5a 49 50 5f T_DIR)\$(TK_ZIP_
9fe0: 46 49 4c 45 29 0a 0a 21 65 6c 73 65 20 23 20 65 FILE)..!else # e
9ff0: 66 66 65 63 74 69 76 65 6c 79 20 4e 45 45 44 5f ffectively NEED_
a000: 54 4b 0a 0a 21 69 66 20 24 28 54 4b 49 4e 53 54 TK..!if $(TKINST
a010: 41 4c 4c 29 20 23 20 42 75 69 6c 64 69 6e 67 20 ALL) # Building
a020: 61 67 61 69 6e 73 74 20 69 6e 73 74 61 6c 6c 65 against installe
a030: 64 20 54 6b 0a 57 49 53 48 09 09 3d 20 24 28 5f d Tk.WISH..= $(_
a040: 54 4b 44 49 52 29 5c 62 69 6e 5c 24 28 57 49 53 TKDIR)\bin\$(WIS
a050: 48 4e 41 4d 45 29 0a 54 4b 53 54 55 42 4c 49 42 HNAME).TKSTUBLIB
a060: 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c 6c 69 62 .= $(_TKDIR)\lib
a070: 5c 24 28 54 4b 53 54 55 42 4c 49 42 4e 41 4d 45 \$(TKSTUBLIBNAME
a080: 29 0a 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f ).TKIMPLIB.= $(_
a090: 54 4b 44 49 52 29 5c 6c 69 62 5c 24 28 54 4b 49 TKDIR)\lib\$(TKI
a0a0: 4d 50 4c 49 42 4e 41 4d 45 29 0a 23 20 57 68 65 MPLIBNAME).# Whe
a0b0: 6e 20 62 75 69 6c 64 69 6e 67 20 65 78 74 65 6e n building exten
a0c0: 73 69 6f 6e 73 2c 20 6d 61 79 20 62 65 20 6c 69 sions, may be li
a0d0: 6e 6b 69 6e 67 20 61 67 61 69 6e 73 74 20 54 6b nking against Tk
a0e0: 20 74 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 61 that does not a
a0f0: 64 64 0a 23 20 22 74 22 20 73 75 66 66 69 78 20 dd.# "t" suffix
a100: 28 65 2e 67 2e 20 38 2e 36 29 2e 20 49 66 20 6c (e.g. 8.6). If l
a110: 69 62 20 6e 6f 74 20 66 6f 75 6e 64 20 63 68 65 ib not found che
a120: 63 6b 20 66 6f 72 20 74 68 61 74 20 70 6f 73 73 ck for that poss
a130: 69 62 69 6c 69 74 79 2e 0a 21 69 66 20 21 65 78 ibility..!if !ex
a140: 69 73 74 28 22 24 28 54 4b 49 4d 50 4c 49 42 29 ist("$(TKIMPLIB)
a150: 22 29 0a 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 09 ").TKIMPLIBNAME.
a160: 3d 20 74 6b 24 28 54 4b 5f 56 45 52 53 49 4f 4e = tk$(TK_VERSION
a170: 29 24 28 53 55 46 58 3a 74 3d 29 2e 6c 69 62 0a )$(SUFX:t=).lib.
a180: 54 4b 49 4d 50 4c 49 42 09 3d 20 24 28 5f 54 4b TKIMPLIB.= $(_TK
a190: 44 49 52 29 5c 6c 69 62 5c 24 28 54 4b 49 4d 50 DIR)\lib\$(TKIMP
a1a0: 4c 49 42 4e 41 4d 45 29 0a 21 65 6e 64 69 66 0a LIBNAME).!endif.
a1b0: 54 4b 5f 49 4e 43 4c 55 44 45 53 20 20 20 20 20 TK_INCLUDES
a1c0: 3d 20 2d 49 22 24 28 5f 54 4b 44 49 52 29 5c 69 = -I"$(_TKDIR)\i
a1d0: 6e 63 6c 75 64 65 22 0a 54 4b 53 43 52 49 50 54 nclude".TKSCRIPT
a1e0: 5a 49 50 20 20 20 20 20 3d 20 24 28 5f 54 4b 44 ZIP = $(_TKD
a1f0: 49 52 29 5c 6c 69 62 5c 24 28 54 4b 5f 5a 49 50 IR)\lib\$(TK_ZIP
a200: 5f 46 49 4c 45 29 0a 0a 21 65 6c 73 65 20 23 20 _FILE)..!else #
a210: 42 75 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 Building against
a220: 20 54 6b 20 73 6f 75 72 63 65 73 0a 0a 57 49 53 Tk sources..WIS
a230: 48 09 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77 H..= $(_TKDIR)\w
a240: 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 in\$(BUILDDIRTOP
a250: 29 5c 24 28 57 49 53 48 4e 41 4d 45 29 0a 54 4b )\$(WISHNAME).TK
a260: 53 54 55 42 4c 49 42 09 3d 20 24 28 5f 54 4b 44 STUBLIB.= $(_TKD
a270: 49 52 29 5c 77 69 6e 5c 24 28 42 55 49 4c 44 44 IR)\win\$(BUILDD
a280: 49 52 54 4f 50 29 5c 24 28 54 4b 53 54 55 42 4c IRTOP)\$(TKSTUBL
a290: 49 42 4e 41 4d 45 29 0a 54 4b 49 4d 50 4c 49 42 IBNAME).TKIMPLIB
a2a0: 09 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77 69 6e .= $(_TKDIR)\win
a2b0: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c \$(BUILDDIRTOP)\
a2c0: 24 28 54 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0a $(TKIMPLIBNAME).
a2d0: 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 # When building
a2e0: 65 78 74 65 6e 73 69 6f 6e 73 2c 20 6d 61 79 20 extensions, may
a2f0: 62 65 20 6c 69 6e 6b 69 6e 67 20 61 67 61 69 6e be linking again
a300: 73 74 20 54 6b 20 74 68 61 74 20 64 6f 65 73 20 st Tk that does
a310: 6e 6f 74 20 61 64 64 0a 23 20 22 74 22 20 73 75 not add.# "t" su
a320: 66 66 69 78 20 28 65 2e 67 2e 20 38 2e 36 29 2e ffix (e.g. 8.6).
a330: 20 49 66 20 6c 69 62 20 6e 6f 74 20 66 6f 75 6e If lib not foun
a340: 64 20 63 68 65 63 6b 20 66 6f 72 20 74 68 61 74 d check for that
a350: 20 70 6f 73 73 69 62 69 6c 69 74 79 2e 0a 21 69 possibility..!i
a360: 66 20 21 65 78 69 73 74 28 22 24 28 54 4b 49 4d f !exist("$(TKIM
a370: 50 4c 49 42 29 22 29 0a 54 4b 49 4d 50 4c 49 42 PLIB)").TKIMPLIB
a380: 4e 41 4d 45 09 3d 20 74 6b 24 28 54 4b 5f 56 45 NAME.= tk$(TK_VE
a390: 52 53 49 4f 4e 29 24 28 53 55 46 58 3a 74 3d 29 RSION)$(SUFX:t=)
a3a0: 2e 6c 69 62 0a 54 4b 49 4d 50 4c 49 42 09 3d 20 .lib.TKIMPLIB.=
a3b0: 24 28 5f 54 4b 44 49 52 29 5c 77 69 6e 5c 24 28 $(_TKDIR)\win\$(
a3c0: 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 24 28 54 BUILDDIRTOP)\$(T
a3d0: 4b 49 4d 50 4c 49 42 4e 41 4d 45 29 0a 21 65 6e KIMPLIBNAME).!en
a3e0: 64 69 66 0a 54 4b 5f 49 4e 43 4c 55 44 45 53 20 dif.TK_INCLUDES
a3f0: 20 20 20 20 3d 20 2d 49 22 24 28 5f 54 4b 44 49 = -I"$(_TKDI
a400: 52 29 5c 67 65 6e 65 72 69 63 22 20 2d 49 22 24 R)\generic" -I"$
a410: 28 5f 54 4b 44 49 52 29 5c 77 69 6e 22 20 2d 49 (_TKDIR)\win" -I
a420: 22 24 28 5f 54 4b 44 49 52 29 5c 78 6c 69 62 22 "$(_TKDIR)\xlib"
a430: 0a 54 4b 53 43 52 49 50 54 5a 49 50 20 20 20 20 .TKSCRIPTZIP
a440: 20 3d 20 24 28 5f 54 4b 44 49 52 29 5c 77 69 6e = $(_TKDIR)\win
a450: 5c 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c \$(BUILDDIRTOP)\
a460: 24 28 54 4b 5f 5a 49 50 5f 46 49 4c 45 29 0a 0a $(TK_ZIP_FILE)..
a470: 21 65 6e 64 69 66 20 23 20 54 4b 49 4e 53 54 41 !endif # TKINSTA
a480: 4c 4c 0a 0a 74 6b 6c 69 62 73 20 3d 20 22 24 28 LL..tklibs = "$(
a490: 54 4b 53 54 55 42 4c 49 42 29 22 20 22 24 28 54 TKSTUBLIB)" "$(T
a4a0: 4b 49 4d 50 4c 49 42 29 22 0a 0a 21 65 6e 64 69 KIMPLIB)"..!endi
a4b0: 66 20 23 20 24 28 44 4f 49 4e 47 5f 54 4b 29 0a f # $(DOING_TK).
a4c0: 21 65 6e 64 69 66 20 23 20 24 28 44 4f 49 4e 47 !endif # $(DOING
a4d0: 5f 54 4b 29 20 7c 7c 20 24 28 4e 45 45 44 5f 54 _TK) || $(NEED_T
a4e0: 4b 29 0a 0a 23 20 56 61 72 69 6f 75 73 20 6f 75 K)..# Various ou
a4f0: 74 70 75 74 20 70 61 74 68 73 0a 50 52 4a 49 4d tput paths.PRJIM
a500: 50 4c 49 42 09 3d 20 24 28 4f 55 54 5f 44 49 52 PLIB.= $(OUT_DIR
a510: 29 5c 24 28 50 52 4f 4a 45 43 54 29 24 28 56 45 )\$(PROJECT)$(VE
a520: 52 53 49 4f 4e 29 24 28 53 55 46 58 29 2e 6c 69 RSION)$(SUFX).li
a530: 62 0a 23 20 45 76 65 6e 20 77 68 65 6e 20 62 75 b.# Even when bu
a540: 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54 ilding against T
a550: 63 6c 20 39 2c 20 50 52 4a 4c 49 42 4e 41 4d 45 cl 9, PRJLIBNAME
a560: 38 20 6d 75 73 74 20 68 61 76 65 20 22 74 22 0a 8 must have "t".
a570: 50 52 4a 4c 49 42 4e 41 4d 45 38 09 3d 20 24 28 PRJLIBNAME8.= $(
a580: 50 52 4f 4a 45 43 54 29 24 28 56 45 52 53 49 4f PROJECT)$(VERSIO
a590: 4e 29 74 24 28 53 55 46 58 3a 74 3d 29 2e 24 28 N)t$(SUFX:t=).$(
a5a0: 45 58 54 29 0a 23 20 45 76 65 6e 20 77 68 65 6e EXT).# Even when
a5b0: 20 62 75 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 building agains
a5c0: 74 20 54 63 6c 20 38 2c 20 50 52 4a 4c 49 42 4e t Tcl 8, PRJLIBN
a5d0: 41 4d 45 39 20 6d 75 73 74 20 6e 6f 74 20 68 61 AME9 must not ha
a5e0: 76 65 20 22 74 22 0a 50 52 4a 4c 49 42 4e 41 4d ve "t".PRJLIBNAM
a5f0: 45 39 09 3d 20 74 63 6c 39 24 28 50 52 4f 4a 45 E9.= tcl9$(PROJE
a600: 43 54 29 24 28 56 45 52 53 49 4f 4e 29 24 28 53 CT)$(VERSION)$(S
a610: 55 46 58 3a 74 3d 29 2e 24 28 45 58 54 29 0a 21 UFX:t=).$(EXT).!
a620: 69 66 20 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 if $(TCL_MAJOR_V
a630: 45 52 53 49 4f 4e 29 20 3d 3d 20 38 20 7c 7c 20 ERSION) == 8 ||
a640: 22 24 28 54 43 4c 5f 42 55 49 4c 44 5f 46 4f 52 "$(TCL_BUILD_FOR
a650: 29 22 20 3d 3d 20 22 38 22 0a 50 52 4a 4c 49 42 )" == "8".PRJLIB
a660: 4e 41 4d 45 09 3d 20 24 28 50 52 4a 4c 49 42 4e NAME.= $(PRJLIBN
a670: 41 4d 45 38 29 0a 21 65 6c 73 65 0a 50 52 4a 4c AME8).!else.PRJL
a680: 49 42 4e 41 4d 45 09 3d 20 24 28 50 52 4a 4c 49 IBNAME.= $(PRJLI
a690: 42 4e 41 4d 45 39 29 0a 21 65 6e 64 69 66 0a 50 BNAME9).!endif.P
a6a0: 52 4a 4c 49 42 09 09 3d 20 24 28 4f 55 54 5f 44 RJLIB..= $(OUT_D
a6b0: 49 52 29 5c 24 28 50 52 4a 4c 49 42 4e 41 4d 45 IR)\$(PRJLIBNAME
a6c0: 29 0a 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 4a )..!if $(TCL_MAJ
a6d0: 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 38 OR_VERSION) == 8
a6e0: 0a 50 52 4a 53 54 55 42 4c 49 42 4e 41 4d 45 09 .PRJSTUBLIBNAME.
a6f0: 3d 20 24 28 53 54 55 42 50 52 45 46 49 58 29 24 = $(STUBPREFIX)$
a700: 28 56 45 52 53 49 4f 4e 29 2e 6c 69 62 0a 21 65 (VERSION).lib.!e
a710: 6c 73 65 0a 50 52 4a 53 54 55 42 4c 49 42 4e 41 lse.PRJSTUBLIBNA
a720: 4d 45 09 3d 20 24 28 53 54 55 42 50 52 45 46 49 ME.= $(STUBPREFI
a730: 58 29 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 50 52 X).lib.!endif.PR
a740: 4a 53 54 55 42 4c 49 42 09 3d 20 24 28 4f 55 54 JSTUBLIB.= $(OUT
a750: 5f 44 49 52 29 5c 24 28 50 52 4a 53 54 55 42 4c _DIR)\$(PRJSTUBL
a760: 49 42 4e 41 4d 45 29 0a 0a 23 20 49 66 20 65 78 IBNAME)..# If ex
a770: 74 65 6e 73 69 6f 6e 20 70 61 72 65 6e 74 20 6d tension parent m
a780: 61 6b 65 66 69 6c 65 20 68 61 73 20 6e 6f 74 20 akefile has not
a790: 64 65 66 69 6e 65 64 20 61 20 72 65 73 6f 75 72 defined a resour
a7a0: 63 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 66 69 ce definition fi
a7b0: 6c 65 2c 0a 23 20 77 65 20 77 69 6c 6c 20 67 65 le,.# we will ge
a7c0: 6e 65 72 61 74 65 20 6f 6e 65 20 66 72 6f 6d 20 nerate one from
a7d0: 73 74 61 6e 64 61 72 64 20 74 65 6d 70 6c 61 74 standard templat
a7e0: 65 2e 0a 21 69 66 20 21 24 28 44 4f 49 4e 47 5f e..!if !$(DOING_
a7f0: 54 43 4c 29 20 26 26 20 21 24 28 44 4f 49 4e 47 TCL) && !$(DOING
a800: 5f 54 4b 29 20 26 26 20 21 24 28 53 54 41 54 49 _TK) && !$(STATI
a810: 43 5f 42 55 49 4c 44 29 0a 21 69 66 64 65 66 20 C_BUILD).!ifdef
a820: 52 43 46 49 4c 45 0a 52 45 53 46 49 4c 45 20 3d RCFILE.RESFILE =
a830: 20 24 28 54 4d 50 5f 44 49 52 29 5c 24 28 52 43 $(TMP_DIR)\$(RC
a840: 46 49 4c 45 3a 2e 72 63 3d 2e 72 65 73 29 0a 21 FILE:.rc=.res).!
a850: 65 6c 73 65 0a 52 45 53 46 49 4c 45 20 3d 20 24 else.RESFILE = $
a860: 28 54 4d 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a (TMP_DIR)\$(PROJ
a870: 45 43 54 29 2e 72 65 73 0a 21 65 6e 64 69 66 0a ECT).res.!endif.
a880: 21 65 6e 64 69 66 0a 0a 23 23 23 23 23 23 23 23 !endif..########
a890: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
a8a0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
a8b0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
a8c0: 23 23 23 23 23 23 23 23 23 23 23 0a 23 20 31 31 ###########.# 11
a8d0: 2e 20 43 6f 6e 73 74 72 75 63 74 20 74 68 65 20 . Construct the
a8e0: 70 61 74 68 73 20 66 6f 72 20 74 68 65 20 69 6e paths for the in
a8f0: 73 74 61 6c 6c 61 74 69 6f 6e 20 64 69 72 65 63 stallation direc
a900: 74 6f 72 69 65 73 0a 23 20 54 68 65 20 66 6f 6c tories.# The fol
a910: 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 20 67 65 lowing macros ge
a920: 74 20 64 65 66 69 6e 65 64 20 69 6e 20 74 68 69 t defined in thi
a930: 73 20 73 65 63 74 69 6f 6e 3a 0a 23 20 4c 49 42 s section:.# LIB
a940: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77 _INSTALL_DIR - w
a950: 68 65 72 65 20 6c 69 62 72 61 72 69 65 73 20 73 here libraries s
a960: 68 6f 75 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c hould be install
a970: 65 64 0a 23 20 42 49 4e 5f 49 4e 53 54 41 4c 4c ed.# BIN_INSTALL
a980: 5f 44 49 52 20 2d 20 77 68 65 72 65 20 74 68 65 _DIR - where the
a990: 20 65 78 65 63 75 74 61 62 6c 65 73 20 73 68 6f executables sho
a9a0: 75 6c 64 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 uld be installed
a9b0: 0a 23 20 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 .# DOC_INSTALL_D
a9c0: 49 52 20 2d 20 77 68 65 72 65 20 64 6f 63 75 6d IR - where docum
a9d0: 65 6e 74 61 74 69 6f 6e 20 73 68 6f 75 6c 64 20 entation should
a9e0: 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23 20 53 be installed.# S
a9f0: 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 CRIPT_INSTALL_DI
aa00: 52 20 2d 20 77 68 65 72 65 20 73 63 72 69 70 74 R - where script
aa10: 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 73 74 s should be inst
aa20: 61 6c 6c 65 64 0a 23 20 49 4e 43 4c 55 44 45 5f alled.# INCLUDE_
aa30: 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 INSTALL_DIR - wh
aa40: 65 72 65 20 43 20 69 6e 63 6c 75 64 65 20 66 69 ere C include fi
aa50: 6c 65 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e les should be in
aa60: 73 74 61 6c 6c 65 64 0a 23 20 44 45 4d 4f 5f 49 stalled.# DEMO_I
aa70: 4e 53 54 41 4c 4c 5f 44 49 52 20 2d 20 77 68 65 NSTALL_DIR - whe
aa80: 72 65 20 64 65 6d 6f 73 20 73 68 6f 75 6c 64 20 re demos should
aa90: 62 65 20 69 6e 73 74 61 6c 6c 65 64 0a 23 20 50 be installed.# P
aaa0: 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 20 2d RJ_INSTALL_DIR -
aab0: 20 77 68 65 72 65 20 70 61 63 6b 61 67 65 20 77 where package w
aac0: 69 6c 6c 20 62 65 20 69 6e 73 74 61 6c 6c 65 64 ill be installed
aad0: 20 28 6e 6f 74 20 73 65 74 20 66 6f 72 20 54 63 (not set for Tc
aae0: 6c 20 61 6e 64 20 54 6b 29 0a 0a 21 69 66 20 24 l and Tk)..!if $
aaf0: 28 44 4f 49 4e 47 5f 54 43 4c 29 20 7c 7c 20 24 (DOING_TCL) || $
ab00: 28 44 4f 49 4e 47 5f 54 4b 29 0a 4c 49 42 5f 49 (DOING_TK).LIB_I
ab10: 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 NSTALL_DIR..= $(
ab20: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c 69 62 _INSTALLDIR)\lib
ab30: 0a 42 49 4e 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 .BIN_INSTALL_DIR
ab40: 09 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 ..= $(_INSTALLDI
ab50: 52 29 5c 62 69 6e 0a 44 4f 43 5f 49 4e 53 54 41 R)\bin.DOC_INSTA
ab60: 4c 4c 5f 44 49 52 09 09 3d 20 24 28 5f 49 4e 53 LL_DIR..= $(_INS
ab70: 54 41 4c 4c 44 49 52 29 5c 64 6f 63 0a 21 69 66 TALLDIR)\doc.!if
ab80: 20 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0a 53 43 $(DOING_TCL).SC
ab90: 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 RIPT_INSTALL_DIR
aba0: 09 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 .= $(_INSTALLDIR
abb0: 29 5c 6c 69 62 5c 24 28 50 52 4f 4a 45 43 54 29 )\lib\$(PROJECT)
abc0: 24 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 $(TCL_MAJOR_VERS
abd0: 49 4f 4e 29 2e 24 28 54 43 4c 5f 4d 49 4e 4f 52 ION).$(TCL_MINOR
abe0: 5f 56 45 52 53 49 4f 4e 29 0a 4d 4f 44 55 4c 45 _VERSION).MODULE
abf0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 _INSTALL_DIR.= $
ac00: 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c 69 (_INSTALLDIR)\li
ac10: 62 5c 74 63 6c 24 28 54 43 4c 5f 4d 41 4a 4f 52 b\tcl$(TCL_MAJOR
ac20: 5f 56 45 52 53 49 4f 4e 29 0a 21 65 6c 73 65 20 _VERSION).!else
ac30: 23 20 44 4f 49 4e 47 5f 54 4b 0a 53 43 52 49 50 # DOING_TK.SCRIP
ac40: 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 T_INSTALL_DIR.=
ac50: 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 6c $(_INSTALLDIR)\l
ac60: 69 62 5c 24 28 50 52 4f 4a 45 43 54 29 24 28 54 ib\$(PROJECT)$(T
ac70: 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 K_MAJOR_VERSION)
ac80: 2e 24 28 54 4b 5f 4d 49 4e 4f 52 5f 56 45 52 53 .$(TK_MINOR_VERS
ac90: 49 4f 4e 29 0a 21 65 6e 64 69 66 0a 44 45 4d 4f ION).!endif.DEMO
aca0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 _INSTALL_DIR.= $
acb0: 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f (SCRIPT_INSTALL_
acc0: 44 49 52 29 5c 64 65 6d 6f 73 0a 49 4e 43 4c 55 DIR)\demos.INCLU
acd0: 44 45 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d DE_INSTALL_DIR.=
ace0: 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c $(_INSTALLDIR)\
acf0: 69 6e 63 6c 75 64 65 0a 0a 21 65 6c 73 65 20 23 include..!else #
ad00: 20 65 78 74 65 6e 73 69 6f 6e 20 6f 74 68 65 72 extension other
ad10: 20 74 68 61 6e 20 54 6b 0a 0a 50 52 4a 5f 49 4e than Tk..PRJ_IN
ad20: 53 54 41 4c 4c 5f 44 49 52 20 20 20 20 20 20 20 STALL_DIR
ad30: 20 20 3d 20 24 28 5f 49 4e 53 54 41 4c 4c 44 49 = $(_INSTALLDI
ad40: 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 24 28 44 R)\$(PROJECT)$(D
ad50: 4f 54 56 45 52 53 49 4f 4e 29 0a 21 69 66 20 24 OTVERSION).!if $
ad60: 28 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d 5f 49 (MULTIPLATFORM_I
ad70: 4e 53 54 41 4c 4c 29 0a 42 49 4e 5f 49 4e 53 54 NSTALL).BIN_INST
ad80: 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 50 52 4a ALL_DIR..= $(PRJ
ad90: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 5c 24 28 _INSTALL_DIR)\$(
ada0: 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 46 PLATFORM_IDENTIF
adb0: 59 29 0a 21 65 6c 73 65 0a 42 49 4e 5f 49 4e 53 Y).!else.BIN_INS
adc0: 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 50 52 TALL_DIR..= $(PR
add0: 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0a 21 J_INSTALL_DIR).!
ade0: 65 6e 64 69 66 0a 21 69 66 20 24 28 53 54 41 54 endif.!if $(STAT
adf0: 49 43 5f 42 55 49 4c 44 29 0a 23 20 46 6f 72 20 IC_BUILD).# For
ae00: 65 78 74 65 6e 73 69 6f 6e 73 2c 20 5f 49 4e 53 extensions, _INS
ae10: 54 41 4c 4c 44 49 52 20 69 73 20 6c 6f 63 61 74 TALLDIR is locat
ae20: 69 6f 6e 20 6f 66 20 54 63 6c 27 73 20 73 74 61 ion of Tcl's sta
ae30: 74 69 63 20 6c 69 62 73 0a 4c 49 42 5f 49 4e 53 tic libs.LIB_INS
ae40: 54 41 4c 4c 5f 44 49 52 09 09 3d 20 24 28 5f 49 TALL_DIR..= $(_I
ae50: 4e 53 54 41 4c 4c 44 49 52 29 0a 21 65 6c 73 65 NSTALLDIR).!else
ae60: 0a 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 .LIB_INSTALL_DIR
ae70: 09 09 3d 20 24 28 42 49 4e 5f 49 4e 53 54 41 4c ..= $(BIN_INSTAL
ae80: 4c 5f 44 49 52 29 0a 21 65 6e 64 69 66 0a 44 4f L_DIR).!endif.DO
ae90: 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 09 3d C_INSTALL_DIR..=
aea0: 20 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 $(PRJ_INSTALL_D
aeb0: 49 52 29 0a 53 43 52 49 50 54 5f 49 4e 53 54 41 IR).SCRIPT_INSTA
aec0: 4c 4c 5f 44 49 52 09 3d 20 24 28 50 52 4a 5f 49 LL_DIR.= $(PRJ_I
aed0: 4e 53 54 41 4c 4c 5f 44 49 52 29 0a 44 45 4d 4f NSTALL_DIR).DEMO
aee0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 _INSTALL_DIR.= $
aef0: 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 (PRJ_INSTALL_DIR
af00: 29 5c 64 65 6d 6f 73 0a 49 4e 43 4c 55 44 45 5f )\demos.INCLUDE_
af10: 49 4e 53 54 41 4c 4c 5f 44 49 52 09 3d 20 24 28 INSTALL_DIR.= $(
af20: 5f 49 4e 53 54 41 4c 4c 44 49 52 29 5c 2e 2e 5c _INSTALLDIR)\..\
af30: 69 6e 63 6c 75 64 65 0a 0a 21 65 6e 64 69 66 0a include..!endif.
af40: 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 .###############
af50: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
af60: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
af70: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
af80: 23 23 23 23 0a 23 20 31 32 2e 20 53 65 74 20 75 ####.# 12. Set u
af90: 70 20 61 63 74 75 61 6c 20 6f 70 74 69 6f 6e 73 p actual options
afa0: 20 74 6f 20 62 65 20 70 61 73 73 65 64 20 74 6f to be passed to
afb0: 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 61 6e the compiler an
afc0: 64 20 6c 69 6e 6b 65 72 0a 23 20 4e 6f 77 20 77 d linker.# Now w
afd0: 65 20 68 61 76 65 20 61 6c 6c 20 74 68 65 20 69 e have all the i
afe0: 6e 66 6f 72 6d 61 74 69 6f 6e 20 77 65 20 6e 65 nformation we ne
aff0: 65 64 2c 20 73 65 74 20 75 70 20 74 68 65 20 61 ed, set up the a
b000: 63 74 75 61 6c 20 66 6c 61 67 73 20 61 6e 64 0a ctual flags and.
b010: 23 20 6f 70 74 69 6f 6e 73 20 74 68 61 74 20 77 # options that w
b020: 65 20 77 69 6c 6c 20 70 61 73 73 20 74 6f 20 74 e will pass to t
b030: 68 65 20 63 6f 6d 70 69 6c 65 72 20 61 6e 64 20 he compiler and
b040: 6c 69 6e 6b 65 72 2e 20 54 68 65 20 6d 61 69 6e linker. The main
b050: 0a 23 20 6d 61 6b 65 66 69 6c 65 20 73 68 6f 75 .# makefile shou
b060: 6c 64 20 75 73 65 20 74 68 65 73 65 20 69 6e 20 ld use these in
b070: 63 6f 6d 62 69 6e 61 74 69 6f 6e 20 77 69 74 68 combination with
b080: 20 77 68 61 74 65 76 65 72 20 6f 74 68 65 72 20 whatever other
b090: 66 6c 61 67 73 0a 23 20 61 6e 64 20 73 77 69 74 flags.# and swit
b0a0: 63 68 65 73 20 61 72 65 20 73 70 65 63 69 66 69 ches are specifi
b0b0: 63 20 74 6f 20 69 74 2e 0a 23 20 54 68 65 20 66 c to it..# The f
b0c0: 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 20 ollowing macros
b0d0: 61 72 65 20 64 65 66 69 6e 65 64 2c 20 6e 61 6d are defined, nam
b0e0: 65 73 20 61 72 65 20 66 6f 72 20 68 69 73 74 6f es are for histo
b0f0: 72 69 63 61 6c 20 63 6f 6d 70 61 74 69 62 69 6c rical compatibil
b100: 69 74 79 3a 0a 23 20 4f 50 54 44 45 46 49 4e 45 ity:.# OPTDEFINE
b110: 53 20 2d 20 2f 44 78 78 78 20 43 20 6d 61 63 72 S - /Dxxx C macr
b120: 6f 20 66 6c 61 67 73 20 62 61 73 65 64 20 6f 6e o flags based on
b130: 20 75 73 65 72 2d 73 70 65 63 69 66 69 65 64 20 user-specified
b140: 4f 50 54 53 0a 23 20 43 4f 4d 50 49 4c 45 52 46 OPTS.# COMPILERF
b150: 4c 41 47 53 20 2d 20 2f 44 78 78 78 20 43 20 6d LAGS - /Dxxx C m
b160: 61 63 72 6f 20 66 6c 61 67 73 20 69 6e 64 65 70 acro flags indep
b170: 65 6e 64 65 6e 74 20 6f 66 20 61 6e 79 20 63 6f endent of any co
b180: 6e 66 69 67 75 72 61 74 69 6f 6e 20 6f 70 74 69 nfiguration opti
b190: 6f 6e 73 0a 23 20 63 72 74 20 2d 20 43 6f 6d 70 ons.# crt - Comp
b1a0: 69 6c 65 72 20 73 77 69 74 63 68 20 74 68 61 74 iler switch that
b1b0: 20 73 65 6c 65 63 74 73 20 74 68 65 20 61 70 70 selects the app
b1c0: 72 6f 70 72 69 61 74 65 20 43 20 72 75 6e 74 69 ropriate C runti
b1d0: 6d 65 0a 23 20 63 64 65 62 75 67 20 2d 20 43 6f me.# cdebug - Co
b1e0: 6d 70 69 6c 65 72 20 73 77 69 74 63 68 65 73 20 mpiler switches
b1f0: 72 65 6c 61 74 65 64 20 74 6f 20 64 65 62 75 67 related to debug
b200: 20 41 4e 44 20 6f 70 74 69 6d 69 7a 61 74 69 6f AND optimizatio
b210: 6e 73 0a 23 20 63 77 61 72 6e 20 2d 20 43 6f 6d ns.# cwarn - Com
b220: 70 69 6c 65 72 20 73 77 69 74 63 68 65 73 20 74 piler switches t
b230: 68 61 74 20 73 65 74 20 77 61 72 6e 69 6e 67 20 hat set warning
b240: 6c 65 76 65 6c 73 0a 23 20 63 66 6c 61 67 73 20 levels.# cflags
b250: 2d 20 63 6f 6d 70 6c 65 74 65 20 63 6f 6d 70 69 - complete compi
b260: 6c 65 72 20 73 77 69 74 63 68 65 73 20 28 73 75 ler switches (su
b270: 62 73 75 6d 65 73 20 63 64 65 62 75 67 20 61 6e bsumes cdebug an
b280: 64 20 63 77 61 72 6e 29 0a 23 20 6c 64 65 62 75 d cwarn).# ldebu
b290: 67 20 2d 20 4c 69 6e 6b 65 72 20 73 77 69 74 63 g - Linker switc
b2a0: 68 65 73 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 20 hes controlling
b2b0: 64 65 62 75 67 20 69 6e 66 6f 72 6d 61 74 69 6f debug informatio
b2c0: 6e 20 61 6e 64 20 6f 70 74 69 6d 69 7a 61 74 69 n and optimizati
b2d0: 6f 6e 0a 23 20 6c 66 6c 61 67 73 20 2d 20 63 6f on.# lflags - co
b2e0: 6d 70 6c 65 74 65 20 6c 69 6e 6b 65 72 20 73 77 mplete linker sw
b2f0: 69 74 63 68 65 73 20 28 73 75 62 73 75 6d 65 73 itches (subsumes
b300: 20 6c 64 65 62 75 67 29 20 65 78 63 65 70 74 20 ldebug) except
b310: 73 75 62 73 79 73 74 65 6d 20 74 79 70 65 0a 23 subsystem type.#
b320: 20 64 6c 6c 6c 66 6c 61 67 73 20 2d 20 63 6f 6d dlllflags - com
b330: 70 6c 65 74 65 20 6c 69 6e 6b 65 72 20 73 77 69 plete linker swi
b340: 74 63 68 65 73 20 74 6f 20 62 75 69 6c 64 20 44 tches to build D
b350: 4c 4c 73 20 28 73 75 62 73 75 6d 65 73 20 6c 66 LLs (subsumes lf
b360: 6c 61 67 73 29 0a 23 20 63 6f 6e 6c 66 6c 61 67 lags).# conlflag
b370: 73 20 2d 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e s - complete lin
b380: 6b 65 72 20 73 77 69 74 63 68 65 73 20 66 6f 72 ker switches for
b390: 20 63 6f 6e 73 6f 6c 65 20 70 72 6f 67 72 61 6d console program
b3a0: 20 28 73 75 62 73 75 6d 65 73 20 6c 66 6c 61 67 (subsumes lflag
b3b0: 73 29 0a 23 20 67 75 69 6c 66 6c 61 67 73 20 2d s).# guilflags -
b3c0: 20 63 6f 6d 70 6c 65 74 65 20 6c 69 6e 6b 65 72 complete linker
b3d0: 20 73 77 69 74 63 68 65 73 20 66 6f 72 20 47 55 switches for GU
b3e0: 49 20 70 72 6f 67 72 61 6d 20 28 73 75 62 73 75 I program (subsu
b3f0: 6d 65 73 20 6c 66 6c 61 67 73 29 0a 23 20 62 61 mes lflags).# ba
b400: 73 65 6c 69 62 73 20 2d 20 6d 69 6e 69 6d 75 6d selibs - minimum
b410: 20 57 69 6e 64 6f 77 73 20 6c 69 62 72 61 72 69 Windows librari
b420: 65 73 20 72 65 71 75 69 72 65 64 2e 20 50 61 72 es required. Par
b430: 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 63 61 6e ent makefile can
b440: 0a 23 20 20 20 20 64 65 66 69 6e 65 20 50 52 4a .# define PRJ
b450: 5f 4c 49 42 53 20 62 65 66 6f 72 65 20 69 6e 63 _LIBS before inc
b460: 6c 75 64 69 6e 67 20 72 75 6c 65 73 2e 72 63 20 luding rules.rc
b470: 69 66 20 61 64 64 69 74 69 6f 6e 61 6c 20 6c 69 if additional li
b480: 62 73 20 61 72 65 20 6e 65 65 64 65 64 0a 0a 4f bs are needed..O
b490: 50 54 44 45 46 49 4e 45 53 09 3d 20 2f 44 53 54 PTDEFINES.= /DST
b4a0: 44 43 5f 48 45 41 44 45 52 53 20 2f 44 55 53 45 DC_HEADERS /DUSE
b4b0: 5f 4e 4d 41 4b 45 3d 31 0a 21 69 66 20 24 28 56 _NMAKE=1.!if $(V
b4c0: 43 56 45 52 53 49 4f 4e 29 20 3e 20 31 36 30 30 CVERSION) > 1600
b4d0: 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 .OPTDEFINES.= $(
b4e0: 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 48 41 OPTDEFINES) /DHA
b4f0: 56 45 5f 53 54 44 49 4e 54 5f 48 3d 31 0a 21 65 VE_STDINT_H=1.!e
b500: 6c 73 65 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d lse.OPTDEFINES.=
b510: 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f $(OPTDEFINES) /
b520: 44 4d 50 5f 4e 4f 5f 53 54 44 49 4e 54 3d 31 0a DMP_NO_STDINT=1.
b530: 21 65 6e 64 69 66 0a 21 69 66 20 24 28 56 43 56 !endif.!if $(VCV
b540: 45 52 53 49 4f 4e 29 20 3e 3d 20 31 38 30 30 0a ERSION) >= 1800.
b550: 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f OPTDEFINES.= $(O
b560: 50 54 44 45 46 49 4e 45 53 29 20 2f 44 48 41 56 PTDEFINES) /DHAV
b570: 45 5f 49 4e 54 54 59 50 45 53 5f 48 3d 31 20 2f E_INTTYPES_H=1 /
b580: 44 48 41 56 45 5f 53 54 44 42 4f 4f 4c 5f 48 3d DHAVE_STDBOOL_H=
b590: 31 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 24 28 1.!endif..!if $(
b5a0: 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 29 0a 4f TCL_MEM_DEBUG).O
b5b0: 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 PTDEFINES.= $(OP
b5c0: 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f TDEFINES) /DTCL_
b5d0: 4d 45 4d 5f 44 45 42 55 47 0a 21 65 6e 64 69 66 MEM_DEBUG.!endif
b5e0: 0a 21 69 66 20 24 28 54 43 4c 5f 43 4f 4d 50 49 .!if $(TCL_COMPI
b5f0: 4c 45 5f 44 45 42 55 47 29 0a 4f 50 54 44 45 46 LE_DEBUG).OPTDEF
b600: 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 INES.= $(OPTDEFI
b610: 4e 45 53 29 20 2f 44 54 43 4c 5f 43 4f 4d 50 49 NES) /DTCL_COMPI
b620: 4c 45 5f 44 45 42 55 47 20 2f 44 54 43 4c 5f 43 LE_DEBUG /DTCL_C
b630: 4f 4d 50 49 4c 45 5f 53 54 41 54 53 0a 21 65 6e OMPILE_STATS.!en
b640: 64 69 66 0a 21 69 66 20 24 28 54 43 4c 5f 54 48 dif.!if $(TCL_TH
b650: 52 45 41 44 53 29 20 26 26 20 24 28 54 43 4c 5f READS) && $(TCL_
b660: 56 45 52 53 49 4f 4e 29 20 3c 20 38 37 0a 4f 50 VERSION) < 87.OP
b670: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 TDEFINES.= $(OPT
b680: 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 54 DEFINES) /DTCL_T
b690: 48 52 45 41 44 53 3d 31 0a 21 69 66 20 24 28 55 HREADS=1.!if $(U
b6a0: 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 SE_THREAD_ALLOC)
b6b0: 20 26 26 20 24 28 54 43 4c 5f 56 45 52 53 49 4f && $(TCL_VERSIO
b6c0: 4e 29 20 3c 20 38 37 0a 4f 50 54 44 45 46 49 4e N) < 87.OPTDEFIN
b6d0: 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 ES.= $(OPTDEFINE
b6e0: 53 29 20 2f 44 55 53 45 5f 54 48 52 45 41 44 5f S) /DUSE_THREAD_
b6f0: 41 4c 4c 4f 43 3d 31 0a 21 65 6e 64 69 66 0a 21 ALLOC=1.!endif.!
b700: 65 6e 64 69 66 0a 21 69 66 20 24 28 53 54 41 54 endif.!if $(STAT
b710: 49 43 5f 42 55 49 4c 44 29 0a 4f 50 54 44 45 46 IC_BUILD).OPTDEF
b720: 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 INES.= $(OPTDEFI
b730: 4e 45 53 29 20 2f 44 53 54 41 54 49 43 5f 42 55 NES) /DSTATIC_BU
b740: 49 4c 44 0a 21 65 6c 73 65 69 66 20 24 28 54 43 ILD.!elseif $(TC
b750: 4c 5f 56 45 52 53 49 4f 4e 29 20 3e 20 38 36 0a L_VERSION) > 86.
b760: 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f OPTDEFINES.= $(O
b770: 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c PTDEFINES) /DTCL
b780: 5f 57 49 54 48 5f 45 58 54 45 52 4e 41 4c 5f 54 _WITH_EXTERNAL_T
b790: 4f 4d 4d 41 54 48 0a 21 69 66 20 22 24 28 4d 41 OMMATH.!if "$(MA
b7a0: 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 4d 44 36 CHINE)" == "AMD6
b7b0: 34 22 20 7c 7c 20 22 24 28 4d 41 43 48 49 4e 45 4" || "$(MACHINE
b7c0: 29 22 20 3d 3d 20 22 41 52 4d 36 34 22 0a 4f 50 )" == "ARM64".OP
b7d0: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 TDEFINES.= $(OPT
b7e0: 44 45 46 49 4e 45 53 29 20 2f 44 4d 50 5f 36 34 DEFINES) /DMP_64
b7f0: 42 49 54 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 BIT.!endif.!endi
b800: 66 0a 21 69 66 20 24 28 54 43 4c 5f 4e 4f 5f 44 f.!if $(TCL_NO_D
b810: 45 50 52 45 43 41 54 45 44 29 0a 4f 50 54 44 45 EPRECATED).OPTDE
b820: 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 FINES.= $(OPTDEF
b830: 49 4e 45 53 29 20 2f 44 54 43 4c 5f 4e 4f 5f 44 INES) /DTCL_NO_D
b840: 45 50 52 45 43 41 54 45 44 0a 21 65 6e 64 69 66 EPRECATED.!endif
b850: 0a 0a 21 69 66 20 24 28 55 53 45 5f 53 54 55 42 ..!if $(USE_STUB
b860: 53 29 0a 23 20 4e 6f 74 65 20 77 65 20 64 6f 20 S).# Note we do
b870: 6e 6f 74 20 64 65 66 69 6e 65 20 55 53 45 5f 54 not define USE_T
b880: 43 4c 5f 53 54 55 42 53 20 65 76 65 6e 20 77 68 CL_STUBS even wh
b890: 65 6e 20 62 75 69 6c 64 69 6e 67 20 74 6b 20 73 en building tk s
b8a0: 69 6e 63 65 20 73 6f 6d 65 0a 23 20 74 65 73 74 ince some.# test
b8b0: 20 74 61 72 67 65 74 73 20 69 6e 20 74 6b 20 64 targets in tk d
b8c0: 6f 20 6e 6f 74 20 75 73 65 20 73 74 75 62 73 0a o not use stubs.
b8d0: 21 69 66 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c !if !$(DOING_TCL
b8e0: 29 0a 55 53 45 5f 53 54 55 42 53 5f 44 45 46 53 ).USE_STUBS_DEFS
b8f0: 20 20 3d 20 2f 44 55 53 45 5f 54 43 4c 5f 53 54 = /DUSE_TCL_ST
b900: 55 42 53 20 2f 44 55 53 45 5f 54 43 4c 4f 4f 5f UBS /DUSE_TCLOO_
b910: 53 54 55 42 53 0a 21 69 66 20 24 28 4e 45 45 44 STUBS.!if $(NEED
b920: 5f 54 4b 29 0a 55 53 45 5f 53 54 55 42 53 5f 44 _TK).USE_STUBS_D
b930: 45 46 53 20 20 3d 20 24 28 55 53 45 5f 53 54 55 EFS = $(USE_STU
b940: 42 53 5f 44 45 46 53 29 20 2f 44 55 53 45 5f 54 BS_DEFS) /DUSE_T
b950: 4b 5f 53 54 55 42 53 0a 21 65 6e 64 69 66 0a 21 K_STUBS.!endif.!
b960: 65 6e 64 69 66 0a 21 65 6e 64 69 66 20 23 20 55 endif.!endif # U
b970: 53 45 5f 53 54 55 42 53 0a 0a 21 69 66 20 21 24 SE_STUBS..!if !$
b980: 28 44 45 42 55 47 29 0a 4f 50 54 44 45 46 49 4e (DEBUG).OPTDEFIN
b990: 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 ES.= $(OPTDEFINE
b9a0: 53 29 20 2f 44 4e 44 45 42 55 47 0a 21 69 66 20 S) /DNDEBUG.!if
b9b0: 24 28 4f 50 54 49 4d 49 5a 49 4e 47 29 0a 4f 50 $(OPTIMIZING).OP
b9c0: 54 44 45 46 49 4e 45 53 09 3d 20 24 28 4f 50 54 TDEFINES.= $(OPT
b9d0: 44 45 46 49 4e 45 53 29 20 2f 44 54 43 4c 5f 43 DEFINES) /DTCL_C
b9e0: 46 47 5f 4f 50 54 49 4d 49 5a 45 44 0a 21 65 6e FG_OPTIMIZED.!en
b9f0: 64 69 66 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 dif.!endif.!if $
ba00: 28 50 52 4f 46 49 4c 45 29 0a 4f 50 54 44 45 46 (PROFILE).OPTDEF
ba10: 49 4e 45 53 09 3d 20 24 28 4f 50 54 44 45 46 49 INES.= $(OPTDEFI
ba20: 4e 45 53 29 20 2f 44 54 43 4c 5f 43 46 47 5f 50 NES) /DTCL_CFG_P
ba30: 52 4f 46 49 4c 45 44 0a 21 65 6e 64 69 66 0a 21 ROFILED.!endif.!
ba40: 69 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 if "$(MACHINE)"
ba50: 3d 3d 20 22 41 4d 44 36 34 22 20 7c 7c 20 22 24 == "AMD64" || "$
ba60: 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 (MACHINE)" == "A
ba70: 52 4d 36 34 22 0a 4f 50 54 44 45 46 49 4e 45 53 RM64".OPTDEFINES
ba80: 09 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 .= $(OPTDEFINES)
ba90: 20 2f 44 54 43 4c 5f 43 46 47 5f 44 4f 36 34 42 /DTCL_CFG_DO64B
baa0: 49 54 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28 IT.!endif.!if $(
bab0: 56 43 56 45 52 53 49 4f 4e 29 20 3c 20 31 33 30 VCVERSION) < 130
bac0: 30 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 0.OPTDEFINES.= $
bad0: 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 4e (OPTDEFINES) /DN
bae0: 4f 5f 53 54 52 54 4f 49 36 34 3d 31 0a 21 65 6e O_STRTOI64=1.!en
baf0: 64 69 66 0a 0a 21 69 66 20 24 28 54 43 4c 5f 4d dif..!if $(TCL_M
bb00: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d AJOR_VERSION) ==
bb10: 20 38 0a 21 69 66 20 22 24 28 5f 55 53 45 5f 36 8.!if "$(_USE_6
bb20: 34 42 49 54 5f 54 49 4d 45 5f 54 29 22 20 3d 3d 4BIT_TIME_T)" ==
bb30: 20 22 31 22 0a 4f 50 54 44 45 46 49 4e 45 53 09 "1".OPTDEFINES.
bb40: 3d 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 20 = $(OPTDEFINES)
bb50: 2f 44 5f 55 53 45 5f 36 34 42 49 54 5f 54 49 4d /D_USE_64BIT_TIM
bb60: 45 5f 54 3d 31 0a 21 65 6e 64 69 66 0a 21 65 6e E_T=1.!endif.!en
bb70: 64 69 66 0a 21 69 66 20 22 24 28 54 43 4c 5f 42 dif.!if "$(TCL_B
bb80: 55 49 4c 44 5f 46 4f 52 29 22 20 3d 3d 20 22 38 UILD_FOR)" == "8
bb90: 22 0a 4f 50 54 44 45 46 49 4e 45 53 09 3d 20 24 ".OPTDEFINES.= $
bba0: 28 4f 50 54 44 45 46 49 4e 45 53 29 20 2f 44 54 (OPTDEFINES) /DT
bbb0: 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e CL_MAJOR_VERSION
bbc0: 3d 38 20 2f 44 54 4b 5f 4d 41 4a 4f 52 5f 56 45 =8 /DTK_MAJOR_VE
bbd0: 52 53 49 4f 4e 3d 38 0a 21 65 6e 64 69 66 0a 0a RSION=8.!endif..
bbe0: 23 20 4c 69 6b 65 20 74 68 65 20 54 45 41 20 73 # Like the TEA s
bbf0: 79 73 74 65 6d 20 6f 6e 6c 79 20 73 65 74 20 74 ystem only set t
bc00: 68 69 73 20 6e 6f 6e 20 65 6d 70 74 79 20 66 6f his non empty fo
bc10: 72 20 6e 6f 6e 2d 54 6b 20 65 78 74 65 6e 73 69 r non-Tk extensi
bc20: 6f 6e 73 0a 23 20 4e 6f 74 65 3a 20 73 6f 6d 65 ons.# Note: some
bc30: 20 65 78 74 65 6e 73 69 6f 6e 73 20 75 73 65 20 extensions use
bc40: 50 41 43 4b 41 47 45 5f 4e 41 4d 45 20 61 6e 64 PACKAGE_NAME and
bc50: 20 6f 74 68 65 72 73 20 75 73 65 20 50 41 43 4b others use PACK
bc60: 41 47 45 5f 54 43 4c 4e 41 4d 45 0a 23 20 73 6f AGE_TCLNAME.# so
bc70: 20 77 65 20 70 61 73 73 20 62 6f 74 68 0a 21 69 we pass both.!i
bc80: 66 20 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 20 f !$(DOING_TCL)
bc90: 26 26 20 21 24 28 44 4f 49 4e 47 5f 54 4b 29 0a && !$(DOING_TK).
bca0: 50 4b 47 4e 41 4d 45 46 4c 41 47 53 20 3d 20 2f PKGNAMEFLAGS = /
bcb0: 44 50 41 43 4b 41 47 45 5f 4e 41 4d 45 3d 22 5c DPACKAGE_NAME="\
bcc0: 22 24 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 "$(PRJ_PACKAGE_T
bcd0: 43 4c 4e 41 4d 45 29 5c 22 22 20 5c 0a 09 2f 44 CLNAME)\"" \../D
bce0: 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 3d PACKAGE_TCLNAME=
bcf0: 22 5c 22 24 28 50 52 4a 5f 50 41 43 4b 41 47 45 "\"$(PRJ_PACKAGE
bd00: 5f 54 43 4c 4e 41 4d 45 29 5c 22 22 20 5c 0a 09 _TCLNAME)\"" \..
bd10: 2f 44 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f /DPACKAGE_VERSIO
bd20: 4e 3d 22 5c 22 24 28 44 4f 54 56 45 52 53 49 4f N="\"$(DOTVERSIO
bd30: 4e 29 5c 22 22 20 5c 0a 09 2f 44 4d 4f 44 55 4c N)\"" \../DMODUL
bd40: 45 5f 53 43 4f 50 45 3d 65 78 74 65 72 6e 0a 21 E_SCOPE=extern.!
bd50: 65 6e 64 69 66 0a 0a 23 20 63 72 74 20 70 69 63 endif..# crt pic
bd60: 6b 73 20 74 68 65 20 43 20 72 75 6e 20 74 69 6d ks the C run tim
bd70: 65 20 62 61 73 65 64 20 6f 6e 20 73 65 6c 65 63 e based on selec
bd80: 74 65 64 20 4f 50 54 53 0a 21 69 66 20 24 28 4d ted OPTS.!if $(M
bd90: 53 56 43 52 54 29 0a 21 69 66 20 24 28 44 45 42 SVCRT).!if $(DEB
bda0: 55 47 29 20 26 26 20 21 24 28 55 4e 43 48 45 43 UG) && !$(UNCHEC
bdb0: 4b 45 44 29 0a 63 72 74 20 3d 20 2d 4d 44 64 0a KED).crt = -MDd.
bdc0: 21 65 6c 73 65 0a 63 72 74 20 3d 20 2d 4d 44 0a !else.crt = -MD.
bdd0: 21 65 6e 64 69 66 0a 21 65 6c 73 65 0a 21 69 66 !endif.!else.!if
bde0: 20 24 28 44 45 42 55 47 29 20 26 26 20 21 24 28 $(DEBUG) && !$(
bdf0: 55 4e 43 48 45 43 4b 45 44 29 0a 63 72 74 20 3d UNCHECKED).crt =
be00: 20 2d 4d 54 64 0a 21 65 6c 73 65 0a 63 72 74 20 -MTd.!else.crt
be10: 3d 20 2d 4d 54 0a 21 65 6e 64 69 66 0a 21 65 6e = -MT.!endif.!en
be20: 64 69 66 0a 0a 23 20 63 64 65 62 75 67 20 69 6e dif..# cdebug in
be30: 63 6c 75 64 65 73 20 63 6f 6d 70 69 6c 65 72 20 cludes compiler
be40: 6f 70 74 69 6f 6e 73 20 66 6f 72 20 64 65 62 75 options for debu
be50: 67 67 69 6e 67 20 61 73 20 77 65 6c 6c 20 61 73 gging as well as
be60: 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 2e 0a 21 optimization..!
be70: 69 66 20 24 28 44 45 42 55 47 29 0a 0a 23 20 49 if $(DEBUG)..# I
be80: 6e 20 64 65 62 75 67 67 69 6e 67 20 6d 6f 64 65 n debugging mode
be90: 2c 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 73 20 , optimizations
bea0: 6e 65 65 64 20 74 6f 20 62 65 20 64 69 73 61 62 need to be disab
beb0: 6c 65 64 0a 63 64 65 62 75 67 20 3d 20 2d 5a 69 led.cdebug = -Zi
bec0: 20 2d 4f 64 20 24 28 44 45 42 55 47 46 4c 41 47 -Od $(DEBUGFLAG
bed0: 53 29 0a 0a 21 65 6c 73 65 0a 0a 63 64 65 62 75 S)..!else..cdebu
bee0: 67 20 3d 20 24 28 4f 50 54 49 4d 49 5a 41 54 49 g = $(OPTIMIZATI
bef0: 4f 4e 53 29 0a 21 69 66 20 24 28 53 59 4d 42 4f ONS).!if $(SYMBO
bf00: 4c 53 29 0a 63 64 65 62 75 67 20 3d 20 24 28 63 LS).cdebug = $(c
bf10: 64 65 62 75 67 29 20 2d 5a 69 0a 21 65 6e 64 69 debug) -Zi.!endi
bf20: 66 0a 0a 21 65 6e 64 69 66 20 23 20 24 28 44 45 f..!endif # $(DE
bf30: 42 55 47 29 0a 0a 23 20 63 77 61 72 6e 20 69 6e BUG)..# cwarn in
bf40: 63 6c 75 64 65 73 20 64 65 66 61 75 6c 74 20 77 cludes default w
bf50: 61 72 6e 69 6e 67 20 6c 65 76 65 6c 73 2c 20 61 arning levels, a
bf60: 6c 73 6f 20 43 34 30 39 30 20 28 62 75 67 67 79 lso C4090 (buggy
bf70: 29 20 61 6e 64 20 43 34 31 34 36 20 69 73 20 75 ) and C4146 is u
bf80: 73 65 6c 65 73 73 2e 0a 63 77 61 72 6e 20 3d 20 seless..cwarn =
bf90: 24 28 57 41 52 4e 49 4e 47 53 29 20 2d 77 64 34 $(WARNINGS) -wd4
bfa0: 30 39 30 20 2d 77 64 34 31 34 36 0a 0a 21 69 66 090 -wd4146..!if
bfb0: 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d 3d "$(MACHINE)" ==
bfc0: 20 22 41 4d 44 36 34 22 20 7c 7c 20 22 24 28 4d "AMD64" || "$(M
bfd0: 41 43 48 49 4e 45 29 22 20 3d 3d 20 22 41 52 4d ACHINE)" == "ARM
bfe0: 36 34 22 0a 23 20 44 69 73 61 62 6c 65 20 70 6f 64".# Disable po
bff0: 69 6e 74 65 72 3c 2d 3e 69 6e 74 20 77 61 72 6e inter<->int warn
c000: 69 6e 67 73 20 72 65 6c 61 74 65 64 20 74 6f 20 ings related to
c010: 63 61 73 74 20 62 65 74 77 65 65 6e 20 64 69 66 cast between dif
c020: 66 65 72 65 6e 74 20 73 69 7a 65 73 0a 23 20 54 ferent sizes.# T
c030: 68 65 72 65 20 61 72 65 20 61 20 67 61 64 7a 69 here are a gadzi
c040: 6c 6c 69 6f 6e 20 6f 66 20 74 68 65 73 65 20 64 llion of these d
c050: 75 65 20 74 6f 20 75 73 65 20 6f 66 20 43 6c 69 ue to use of Cli
c060: 65 6e 74 44 61 74 61 20 61 6e 64 0a 23 20 63 6c entData and.# cl
c070: 75 74 74 65 72 20 75 70 20 63 6f 6d 70 69 6c 65 utter up compile
c080: 72 0a 23 20 6f 75 74 70 75 74 20 69 6e 63 72 65 r.# output incre
c090: 61 73 69 6e 67 20 63 68 61 6e 63 65 20 6f 66 20 asing chance of
c0a0: 61 20 72 65 61 6c 20 77 61 72 6e 69 6e 67 20 67 a real warning g
c0b0: 65 74 74 69 6e 67 20 6c 6f 73 74 2e 20 53 6f 20 etting lost. So
c0c0: 64 69 73 61 62 6c 65 20 74 68 65 6d 2e 0a 23 20 disable them..#
c0d0: 45 76 65 6e 74 75 61 6c 6c 79 20 73 6f 6d 65 20 Eventually some
c0e0: 64 61 79 2c 20 54 63 6c 20 77 69 6c 6c 20 62 65 day, Tcl will be
c0f0: 20 36 34 2d 62 69 74 20 63 6c 65 61 6e 2e 0a 63 64-bit clean..c
c100: 77 61 72 6e 20 3d 20 24 28 63 77 61 72 6e 29 20 warn = $(cwarn)
c110: 2d 77 64 34 33 31 31 20 2d 77 64 34 33 31 32 0a -wd4311 -wd4312.
c120: 21 65 6e 64 69 66 0a 0a 23 23 23 20 43 6f 6d 6d !endif..### Comm
c130: 6f 6e 20 63 6f 6d 70 69 6c 65 72 20 6f 70 74 69 on compiler opti
c140: 6f 6e 73 20 74 68 61 74 20 61 72 65 20 61 72 63 ons that are arc
c150: 68 69 74 65 63 74 75 72 65 20 73 70 65 63 69 66 hitecture specif
c160: 69 63 0a 21 69 66 20 22 24 28 4d 41 43 48 49 4e ic.!if "$(MACHIN
c170: 45 29 22 20 3d 3d 20 22 41 52 4d 22 0a 63 61 72 E)" == "ARM".car
c180: 63 68 20 3d 20 2f 44 5f 41 52 4d 5f 57 49 4e 41 ch = /D_ARM_WINA
c190: 50 49 5f 50 41 52 54 49 54 49 4f 4e 5f 44 45 53 PI_PARTITION_DES
c1a0: 4b 54 4f 50 5f 53 44 4b 5f 41 56 41 49 4c 41 42 KTOP_SDK_AVAILAB
c1b0: 4c 45 0a 21 65 6c 73 65 0a 63 61 72 63 68 20 3d LE.!else.carch =
c1c0: 0a 21 65 6e 64 69 66 0a 0a 23 20 63 70 75 69 64 .!endif..# cpuid
c1d0: 20 69 73 20 6f 6e 6c 79 20 61 76 61 69 6c 61 62 is only availab
c1e0: 6c 65 20 6f 6e 20 69 6e 74 65 6c 20 6d 61 63 68 le on intel mach
c1f0: 69 6e 65 73 0a 21 69 66 20 22 24 28 4d 41 43 48 ines.!if "$(MACH
c200: 49 4e 45 29 22 20 3d 3d 20 22 49 58 38 36 22 20 INE)" == "IX86"
c210: 7c 7c 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 || "$(MACHINE)"
c220: 3d 3d 20 22 41 4d 44 36 34 22 0a 63 61 72 63 68 == "AMD64".carch
c230: 20 3d 20 24 28 63 61 72 63 68 29 20 2f 44 48 41 = $(carch) /DHA
c240: 56 45 5f 43 50 55 49 44 3d 31 0a 21 65 6e 64 69 VE_CPUID=1.!endi
c250: 66 0a 0a 21 69 66 20 24 28 44 45 42 55 47 29 0a f..!if $(DEBUG).
c260: 23 20 54 75 72 6e 20 77 61 72 6e 69 6e 67 73 20 # Turn warnings
c270: 69 6e 74 6f 20 65 72 72 6f 72 73 0a 63 77 61 72 into errors.cwar
c280: 6e 20 3d 20 24 28 63 77 61 72 6e 29 20 2d 57 58 n = $(cwarn) -WX
c290: 0a 21 65 6e 64 69 66 0a 0a 49 4e 43 4c 55 44 45 .!endif..INCLUDE
c2a0: 53 20 3d 20 24 28 54 43 4c 5f 49 4e 43 4c 55 44 S = $(TCL_INCLUD
c2b0: 45 53 29 20 24 28 54 4b 5f 49 4e 43 4c 55 44 45 ES) $(TK_INCLUDE
c2c0: 53 29 20 24 28 50 52 4a 5f 49 4e 43 4c 55 44 45 S) $(PRJ_INCLUDE
c2d0: 53 29 0a 21 69 66 20 21 24 28 44 4f 49 4e 47 5f S).!if !$(DOING_
c2e0: 54 43 4c 29 20 26 26 20 21 24 28 44 4f 49 4e 47 TCL) && !$(DOING
c2f0: 5f 54 4b 29 0a 49 4e 43 4c 55 44 45 53 20 3d 20 _TK).INCLUDES =
c300: 24 28 49 4e 43 4c 55 44 45 53 29 20 2d 49 22 24 $(INCLUDES) -I"$
c310: 28 47 45 4e 45 52 49 43 44 49 52 29 22 20 2d 49 (GENERICDIR)" -I
c320: 22 24 28 57 49 4e 5f 44 49 52 29 22 20 2d 49 22 "$(WIN_DIR)" -I"
c330: 24 28 43 4f 4d 50 41 54 44 49 52 29 22 0a 21 65 $(COMPATDIR)".!e
c340: 6e 64 69 66 0a 0a 23 20 54 68 65 73 65 20 66 6c ndif..# These fl
c350: 61 67 73 20 61 72 65 20 64 65 66 69 6e 65 64 20 ags are defined
c360: 72 6f 75 67 68 6c 79 20 69 6e 20 74 68 65 20 6f roughly in the o
c370: 72 64 65 72 20 6f 66 20 74 68 65 20 70 72 65 2d rder of the pre-
c380: 72 65 66 6f 72 6d 0a 23 20 72 75 6c 65 73 2e 76 reform.# rules.v
c390: 63 2f 6d 61 6b 65 66 69 6c 65 2e 76 63 20 74 6f c/makefile.vc to
c3a0: 20 68 65 6c 70 20 76 69 73 75 61 6c 6c 79 20 63 help visually c
c3b0: 6f 6d 70 61 72 65 20 74 68 61 74 20 74 68 65 20 ompare that the
c3c0: 70 72 65 2d 20 61 6e 64 0a 23 20 70 6f 73 74 2d pre- and.# post-
c3d0: 72 65 66 6f 72 6d 20 62 75 69 6c 64 20 6c 6f 67 reform build log
c3e0: 73 0a 0a 23 20 63 66 6c 61 67 73 20 63 6f 6e 74 s..# cflags cont
c3f0: 61 69 6e 73 20 67 65 6e 65 72 69 63 20 66 6c 61 ains generic fla
c400: 67 73 20 75 73 65 64 20 66 6f 72 20 62 75 69 6c gs used for buil
c410: 64 69 6e 67 20 70 72 61 63 74 69 63 61 6c 6c 79 ding practically
c420: 20 61 6c 6c 20 6f 62 6a 65 63 74 20 66 69 6c 65 all object file
c430: 73 0a 63 66 6c 61 67 73 20 3d 20 2d 6e 6f 6c 6f s.cflags = -nolo
c440: 67 6f 20 2d 63 20 24 28 43 4f 4d 50 49 4c 45 52 go -c $(COMPILER
c450: 46 4c 41 47 53 29 20 24 28 63 61 72 63 68 29 20 FLAGS) $(carch)
c460: 24 28 63 77 61 72 6e 29 20 2d 46 70 24 28 54 4d $(cwarn) -Fp$(TM
c470: 50 5f 44 49 52 29 5e 5c 20 24 28 63 64 65 62 75 P_DIR)^\ $(cdebu
c480: 67 29 0a 0a 21 69 66 20 24 28 54 43 4c 5f 4d 41 g)..!if $(TCL_MA
c490: 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 20 3d 3d 20 JOR_VERSION) ==
c4a0: 38 20 26 26 20 24 28 54 43 4c 5f 4d 49 4e 4f 52 8 && $(TCL_MINOR
c4b0: 5f 56 45 52 53 49 4f 4e 29 20 3c 20 37 0a 63 66 _VERSION) < 7.cf
c4c0: 6c 61 67 73 20 3d 20 24 28 63 66 6c 61 67 73 29 lags = $(cflags)
c4d0: 20 2d 44 54 63 6c 5f 53 69 7a 65 3d 69 6e 74 0a -DTcl_Size=int.
c4e0: 21 65 6e 64 69 66 0a 0a 23 20 61 70 70 63 66 6c !endif..# appcfl
c4f0: 61 67 73 20 63 6f 6e 74 61 69 6e 73 20 24 28 63 ags contains $(c
c500: 66 6c 61 67 73 29 20 61 6e 64 20 66 6c 61 67 73 flags) and flags
c510: 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 74 68 for building th
c520: 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 0a 23 20 e application.#
c530: 6f 62 6a 65 63 74 20 66 69 6c 65 73 20 28 65 2e object files (e.
c540: 67 2e 20 74 63 6c 73 68 2c 20 6f 72 20 77 69 73 g. tclsh, or wis
c550: 68 29 20 70 6b 67 63 66 6c 61 67 73 20 63 6f 6e h) pkgcflags con
c560: 74 61 69 6e 73 20 24 28 63 66 6c 61 67 73 29 20 tains $(cflags)
c570: 70 6c 75 73 0a 23 20 66 6c 61 67 73 20 75 73 65 plus.# flags use
c580: 64 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 73 d for building s
c590: 68 61 72 65 64 20 6f 62 6a 65 63 74 20 66 69 6c hared object fil
c5a0: 65 73 20 54 68 65 20 74 77 6f 20 64 69 66 66 65 es The two diffe
c5b0: 72 20 69 6e 20 74 68 65 0a 23 20 42 55 49 4c 44 r in the.# BUILD
c5c0: 5f 24 28 50 52 4f 4a 45 43 54 29 20 6d 61 63 72 _$(PROJECT) macr
c5d0: 6f 20 77 68 69 63 68 20 73 68 6f 75 6c 64 20 62 o which should b
c5e0: 65 20 64 65 66 69 6e 65 64 20 6f 6e 6c 79 20 66 e defined only f
c5f0: 6f 72 20 74 68 65 20 73 68 61 72 65 64 0a 23 20 or the shared.#
c600: 6c 69 62 72 61 72 79 20 2a 69 6d 70 6c 65 6d 65 library *impleme
c610: 6e 74 61 74 69 6f 6e 2a 20 61 6e 64 20 6e 6f 74 ntation* and not
c620: 20 66 6f 72 20 69 74 73 20 63 61 6c 6c 65 72 20 for its caller
c630: 69 6e 74 65 72 66 61 63 65 0a 0a 61 70 70 63 66 interface..appcf
c640: 6c 61 67 73 5f 6e 6f 73 74 75 62 73 20 3d 20 24 lags_nostubs = $
c650: 28 63 66 6c 61 67 73 29 20 24 28 63 72 74 29 20 (cflags) $(crt)
c660: 24 28 49 4e 43 4c 55 44 45 53 29 20 24 28 54 43 $(INCLUDES) $(TC
c670: 4c 5f 44 45 46 49 4e 45 53 29 20 24 28 50 52 4a L_DEFINES) $(PRJ
c680: 5f 44 45 46 49 4e 45 53 29 20 24 28 4f 50 54 44 _DEFINES) $(OPTD
c690: 45 46 49 4e 45 53 29 0a 61 70 70 63 66 6c 61 67 EFINES).appcflag
c6a0: 73 20 3d 20 24 28 61 70 70 63 66 6c 61 67 73 5f s = $(appcflags_
c6b0: 6e 6f 73 74 75 62 73 29 20 24 28 55 53 45 5f 53 nostubs) $(USE_S
c6c0: 54 55 42 53 5f 44 45 46 53 29 0a 70 6b 67 63 66 TUBS_DEFS).pkgcf
c6d0: 6c 61 67 73 20 3d 20 24 28 61 70 70 63 66 6c 61 lags = $(appcfla
c6e0: 67 73 29 20 24 28 50 4b 47 4e 41 4d 45 46 4c 41 gs) $(PKGNAMEFLA
c6f0: 47 53 29 20 2f 44 42 55 49 4c 44 5f 24 28 50 52 GS) /DBUILD_$(PR
c700: 4f 4a 45 43 54 29 0a 70 6b 67 63 66 6c 61 67 73 OJECT).pkgcflags
c710: 5f 6e 6f 73 74 75 62 73 20 3d 20 24 28 61 70 70 _nostubs = $(app
c720: 63 66 6c 61 67 73 5f 6e 6f 73 74 75 62 73 29 20 cflags_nostubs)
c730: 24 28 50 4b 47 4e 41 4d 45 46 4c 41 47 53 29 20 $(PKGNAMEFLAGS)
c740: 2f 44 42 55 49 4c 44 5f 24 28 50 52 4f 4a 45 43 /DBUILD_$(PROJEC
c750: 54 29 0a 0a 23 20 73 74 75 62 73 63 66 6c 61 67 T)..# stubscflag
c760: 73 20 63 6f 6e 74 61 69 6e 73 20 24 28 63 66 6c s contains $(cfl
c770: 61 67 73 29 20 70 6c 75 73 20 66 6c 61 67 73 20 ags) plus flags
c780: 75 73 65 64 20 66 6f 72 20 62 75 69 6c 64 69 6e used for buildin
c790: 67 20 61 20 73 74 75 62 73 0a 23 20 6c 69 62 72 g a stubs.# libr
c7a0: 61 72 79 20 66 6f 72 20 74 68 65 20 70 61 63 6b ary for the pack
c7b0: 61 67 65 2e 20 20 4e 6f 74 65 3a 20 2f 44 53 54 age. Note: /DST
c7c0: 41 54 49 43 5f 42 55 49 4c 44 20 69 73 20 64 65 ATIC_BUILD is de
c7d0: 66 69 6e 65 64 20 69 6e 0a 23 20 24 28 4f 50 54 fined in.# $(OPT
c7e0: 44 45 46 49 4e 45 53 29 20 6f 6e 6c 79 20 69 66 DEFINES) only if
c7f0: 20 74 68 65 20 4f 50 54 53 20 63 6f 6e 66 69 67 the OPTS config
c800: 75 72 61 74 69 6f 6e 20 69 6e 64 69 63 61 74 65 uration indicate
c810: 73 20 61 20 73 74 61 74 69 63 0a 23 20 6c 69 62 s a static.# lib
c820: 72 61 72 79 2e 20 48 6f 77 65 76 65 72 20 74 68 rary. However th
c830: 65 20 73 74 75 62 73 20 6c 69 62 72 61 72 79 20 e stubs library
c840: 69 73 20 41 4c 57 41 59 53 20 73 74 61 74 69 63 is ALWAYS static
c850: 20 68 65 6e 63 65 20 69 6e 63 6c 75 64 65 64 0a hence included.
c860: 23 20 68 65 72 65 20 69 72 72 65 73 70 65 63 74 # here irrespect
c870: 69 76 65 20 6f 66 20 74 68 65 20 4f 50 54 53 20 ive of the OPTS
c880: 73 65 74 74 69 6e 67 2e 0a 23 0a 23 20 54 42 44 setting..#.# TBD
c890: 20 2d 20 74 63 6c 76 66 73 20 68 61 73 20 61 20 - tclvfs has a
c8a0: 63 6f 6d 6d 65 6e 74 20 74 68 61 74 20 73 74 75 comment that stu
c8b0: 62 73 20 6c 69 62 73 20 73 68 6f 75 6c 64 20 6e bs libs should n
c8c0: 6f 74 20 62 65 20 63 6f 6d 70 69 6c 65 64 20 77 ot be compiled w
c8d0: 69 74 68 20 2d 47 4c 0a 23 20 77 69 74 68 6f 75 ith -GL.# withou
c8e0: 74 20 73 74 61 74 69 6e 67 20 77 68 79 2e 20 54 t stating why. T
c8f0: 63 6c 20 69 74 73 65 6c 66 20 63 6f 6d 70 69 6c cl itself compil
c900: 65 64 20 73 74 75 62 73 20 6c 69 62 73 20 77 69 ed stubs libs wi
c910: 74 68 20 74 68 69 73 20 66 6c 61 67 2e 0a 23 20 th this flag..#
c920: 73 6f 20 77 65 20 64 6f 20 6e 6f 74 20 72 65 6d so we do not rem
c930: 6f 76 65 20 69 74 20 66 72 6f 6d 20 63 66 6c 61 ove it from cfla
c940: 67 73 2e 20 2d 47 4c 20 6d 61 79 20 70 72 65 76 gs. -GL may prev
c950: 65 6e 74 20 65 78 74 65 6e 73 69 6f 6e 73 0a 23 ent extensions.#
c960: 20 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 6f compiled with o
c970: 6e 65 20 56 43 20 76 65 72 73 69 6f 6e 20 74 6f ne VC version to
c980: 20 66 61 69 6c 20 74 6f 20 6c 69 6e 6b 20 61 67 fail to link ag
c990: 61 69 6e 73 74 20 73 74 75 62 73 20 6c 69 62 72 ainst stubs libr
c9a0: 61 72 79 0a 23 20 63 6f 6d 70 69 6c 65 64 20 77 ary.# compiled w
c9b0: 69 74 68 20 61 6e 6f 74 68 65 72 20 56 43 20 76 ith another VC v
c9c0: 65 72 73 69 6f 6e 2e 20 43 68 65 63 6b 20 66 6f ersion. Check fo
c9d0: 72 20 74 68 69 73 20 61 6e 64 20 66 69 78 20 61 r this and fix a
c9e0: 63 63 6f 72 64 69 6e 67 6c 79 2e 0a 73 74 75 62 ccordingly..stub
c9f0: 73 63 66 6c 61 67 73 20 3d 20 24 28 63 66 6c 61 scflags = $(cfla
ca00: 67 73 29 20 24 28 50 4b 47 4e 41 4d 45 46 4c 41 gs) $(PKGNAMEFLA
ca10: 47 53 29 20 24 28 50 52 4a 5f 44 45 46 49 4e 45 GS) $(PRJ_DEFINE
ca20: 53 29 20 24 28 4f 50 54 44 45 46 49 4e 45 53 29 S) $(OPTDEFINES)
ca30: 20 2f 5a 6c 20 2f 47 4c 2d 20 2f 44 53 54 41 54 /Zl /GL- /DSTAT
ca40: 49 43 5f 42 55 49 4c 44 20 24 28 49 4e 43 4c 55 IC_BUILD $(INCLU
ca50: 44 45 53 29 20 24 28 55 53 45 5f 53 54 55 42 53 DES) $(USE_STUBS
ca60: 5f 44 45 46 53 29 0a 0a 23 20 4c 69 6e 6b 20 66 _DEFS)..# Link f
ca70: 6c 61 67 73 0a 0a 21 69 66 20 24 28 44 45 42 55 lags..!if $(DEBU
ca80: 47 29 0a 6c 64 65 62 75 67 09 3d 20 2d 64 65 62 G).ldebug.= -deb
ca90: 75 67 20 2d 64 65 62 75 67 74 79 70 65 3a 63 76 ug -debugtype:cv
caa0: 0a 21 65 6c 73 65 0a 6c 64 65 62 75 67 09 3d 20 .!else.ldebug.=
cab0: 2d 72 65 6c 65 61 73 65 20 2d 6f 70 74 3a 72 65 -release -opt:re
cac0: 66 20 2d 6f 70 74 3a 69 63 66 2c 33 0a 21 69 66 f -opt:icf,3.!if
cad0: 20 24 28 53 59 4d 42 4f 4c 53 29 0a 6c 64 65 62 $(SYMBOLS).ldeb
cae0: 75 67 09 3d 20 24 28 6c 64 65 62 75 67 29 20 2d ug.= $(ldebug) -
caf0: 64 65 62 75 67 20 2d 64 65 62 75 67 74 79 70 65 debug -debugtype
cb00: 3a 63 76 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 :cv.!endif.!endi
cb10: 66 0a 0a 23 20 4e 6f 74 65 3a 20 50 72 6f 66 69 f..# Note: Profi
cb20: 6c 69 6e 67 20 69 73 20 63 75 72 72 65 6e 74 6c ling is currentl
cb30: 79 20 6f 6e 6c 79 20 70 6f 73 73 69 62 6c 65 20 y only possible
cb40: 77 69 74 68 20 74 68 65 20 56 69 73 75 61 6c 20 with the Visual
cb50: 53 74 75 64 69 6f 20 45 6e 74 65 72 70 72 69 73 Studio Enterpris
cb60: 65 0a 21 69 66 20 24 28 50 52 4f 46 49 4c 45 29 e.!if $(PROFILE)
cb70: 0a 6c 64 65 62 75 67 3d 20 24 28 6c 64 65 62 75 .ldebug= $(ldebu
cb80: 67 29 20 2d 70 72 6f 66 69 6c 65 0a 21 65 6e 64 g) -profile.!end
cb90: 69 66 0a 0a 23 23 23 20 44 65 63 6c 61 72 61 74 if..### Declarat
cba0: 69 6f 6e 73 20 63 6f 6d 6d 6f 6e 20 74 6f 20 61 ions common to a
cbb0: 6c 6c 20 6c 69 6e 6b 65 72 20 76 65 72 73 69 6f ll linker versio
cbc0: 6e 73 0a 6c 66 6c 61 67 73 09 3d 20 2d 6e 6f 6c ns.lflags.= -nol
cbd0: 6f 67 6f 20 2d 6d 61 63 68 69 6e 65 3a 24 28 4d ogo -machine:$(M
cbe0: 41 43 48 49 4e 45 29 20 24 28 4c 49 4e 4b 45 52 ACHINE) $(LINKER
cbf0: 46 4c 41 47 53 29 20 24 28 6c 64 65 62 75 67 29 FLAGS) $(ldebug)
cc00: 0a 0a 21 69 66 20 24 28 4d 53 56 43 52 54 29 20 ..!if $(MSVCRT)
cc10: 26 26 20 21 28 24 28 44 45 42 55 47 29 20 26 26 && !($(DEBUG) &&
cc20: 20 21 24 28 55 4e 43 48 45 43 4b 45 44 29 29 20 !$(UNCHECKED))
cc30: 26 26 20 24 28 56 43 56 45 52 53 49 4f 4e 29 20 && $(VCVERSION)
cc40: 3e 3d 20 31 39 30 30 0a 6c 66 6c 61 67 73 09 3d >= 1900.lflags.=
cc50: 20 24 28 6c 66 6c 61 67 73 29 20 2d 6e 6f 64 65 $(lflags) -node
cc60: 66 61 75 6c 74 6c 69 62 3a 75 63 72 74 2e 6c 69 faultlib:ucrt.li
cc70: 62 0a 21 65 6e 64 69 66 0a 0a 64 6c 6c 6c 66 6c b.!endif..dlllfl
cc80: 61 67 73 20 3d 20 24 28 6c 66 6c 61 67 73 29 20 ags = $(lflags)
cc90: 2d 64 6c 6c 0a 63 6f 6e 6c 66 6c 61 67 73 20 3d -dll.conlflags =
cca0: 20 24 28 6c 66 6c 61 67 73 29 20 2d 73 75 62 73 $(lflags) -subs
ccb0: 79 73 74 65 6d 3a 63 6f 6e 73 6f 6c 65 0a 67 75 ystem:console.gu
ccc0: 69 6c 66 6c 61 67 73 20 3d 20 24 28 6c 66 6c 61 ilflags = $(lfla
ccd0: 67 73 29 20 2d 73 75 62 73 79 73 74 65 6d 3a 77 gs) -subsystem:w
cce0: 69 6e 64 6f 77 73 0a 0a 23 20 4c 69 62 72 61 72 indows..# Librar
ccf0: 69 65 73 20 74 68 61 74 20 61 72 65 20 72 65 71 ies that are req
cd00: 75 69 72 65 64 20 66 6f 72 20 65 76 65 72 79 20 uired for every
cd10: 69 6d 61 67 65 2e 0a 23 20 45 78 74 65 6e 73 69 image..# Extensi
cd20: 6f 6e 73 20 73 68 6f 75 6c 64 20 64 65 66 69 6e ons should defin
cd30: 65 20 61 6e 79 20 61 64 64 69 74 69 6f 6e 61 6c e any additional
cd40: 20 6c 69 62 72 61 72 69 65 73 20 77 69 74 68 20 libraries with
cd50: 24 28 50 52 4a 5f 4c 49 42 53 29 0a 77 69 6e 6c $(PRJ_LIBS).winl
cd60: 69 62 73 20 20 20 3d 20 6b 65 72 6e 65 6c 33 32 ibs = kernel32
cd70: 2e 6c 69 62 20 61 64 76 61 70 69 33 32 2e 6c 69 .lib advapi32.li
cd80: 62 0a 0a 21 69 66 20 24 28 4e 45 45 44 5f 54 4b b..!if $(NEED_TK
cd90: 29 0a 77 69 6e 6c 69 62 73 20 3d 20 24 28 77 69 ).winlibs = $(wi
cda0: 6e 6c 69 62 73 29 20 67 64 69 33 32 2e 6c 69 62 nlibs) gdi32.lib
cdb0: 20 75 73 65 72 33 32 2e 6c 69 62 20 75 78 74 68 user32.lib uxth
cdc0: 65 6d 65 2e 6c 69 62 0a 21 65 6e 64 69 66 0a 0a eme.lib.!endif..
cdd0: 23 20 41 76 6f 69 64 20 27 75 6e 72 65 73 6f 6c # Avoid 'unresol
cde0: 76 65 64 20 65 78 74 65 72 6e 61 6c 20 73 79 6d ved external sym
cdf0: 62 6f 6c 20 5f 5f 73 65 63 75 72 69 74 79 5f 63 bol __security_c
ce00: 6f 6f 6b 69 65 27 20 65 72 72 6f 72 73 2e 0a 23 ookie' errors..#
ce10: 20 63 2e 66 2e 20 68 74 74 70 3a 2f 2f 73 75 70 c.f. http://sup
ce20: 70 6f 72 74 2e 6d 69 63 72 6f 73 6f 66 74 2e 63 port.microsoft.c
ce30: 6f 6d 2f 3f 69 64 3d 38 39 34 35 37 33 0a 21 69 om/?id=894573.!i
ce40: 66 20 22 24 28 4d 41 43 48 49 4e 45 29 22 20 3d f "$(MACHINE)" =
ce50: 3d 20 22 41 4d 44 36 34 22 0a 21 69 66 20 24 28 = "AMD64".!if $(
ce60: 56 43 56 45 52 53 49 4f 4e 29 20 3e 20 31 33 39 VCVERSION) > 139
ce70: 39 20 26 26 20 24 28 56 43 56 45 52 53 49 4f 4e 9 && $(VCVERSION
ce80: 29 20 3c 20 31 35 30 30 0a 77 69 6e 6c 69 62 73 ) < 1500.winlibs
ce90: 20 20 20 3d 20 24 28 77 69 6e 6c 69 62 73 29 20 = $(winlibs)
cea0: 62 75 66 66 65 72 6f 76 65 72 66 6c 6f 77 55 2e bufferoverflowU.
ceb0: 6c 69 62 0a 21 65 6e 64 69 66 0a 21 65 6e 64 69 lib.!endif.!endi
cec0: 66 0a 0a 62 61 73 65 6c 69 62 73 20 3d 20 24 28 f..baselibs = $(
ced0: 77 69 6e 6c 69 62 73 29 20 24 28 50 52 4a 5f 4c winlibs) $(PRJ_L
cee0: 49 42 53 29 0a 0a 21 69 66 20 24 28 4d 53 56 43 IBS)..!if $(MSVC
cef0: 52 54 29 20 26 26 20 21 28 24 28 44 45 42 55 47 RT) && !($(DEBUG
cf00: 29 20 26 26 20 21 24 28 55 4e 43 48 45 43 4b 45 ) && !$(UNCHECKE
cf10: 44 29 29 20 26 26 20 24 28 56 43 56 45 52 53 49 D)) && $(VCVERSI
cf20: 4f 4e 29 20 3e 3d 20 31 39 30 30 0a 62 61 73 65 ON) >= 1900.base
cf30: 6c 69 62 73 20 20 20 3d 20 24 28 62 61 73 65 6c libs = $(basel
cf40: 69 62 73 29 20 75 63 72 74 2e 6c 69 62 0a 21 65 ibs) ucrt.lib.!e
cf50: 6e 64 69 66 0a 0a 23 23 23 23 23 23 23 23 23 23 ndif..##########
cf60: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
cf70: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
cf80: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
cf90: 23 23 23 23 23 23 0a 23 20 31 33 2e 20 44 65 66 ######.# 13. Def
cfa0: 69 6e 65 20 73 74 61 6e 64 61 72 64 20 63 6f 6d ine standard com
cfb0: 6d 61 6e 64 73 2c 20 63 6f 6d 6d 6f 6e 20 6d 61 mands, common ma
cfc0: 6b 65 20 74 61 72 67 65 74 73 20 61 6e 64 20 69 ke targets and i
cfd0: 6d 70 6c 69 63 69 74 20 72 75 6c 65 73 0a 0a 43 mplicit rules..C
cfe0: 43 50 4b 47 43 4d 44 20 3d 20 24 28 63 63 33 32 CPKGCMD = $(cc32
cff0: 29 20 24 28 70 6b 67 63 66 6c 61 67 73 29 20 2d ) $(pkgcflags) -
d000: 46 6f 24 28 54 4d 50 5f 44 49 52 29 5e 5c 0a 43 Fo$(TMP_DIR)^\.C
d010: 43 41 50 50 43 4d 44 20 3d 20 24 28 63 63 33 32 CAPPCMD = $(cc32
d020: 29 20 24 28 61 70 70 63 66 6c 61 67 73 29 20 2d ) $(appcflags) -
d030: 46 6f 24 28 54 4d 50 5f 44 49 52 29 5e 5c 0a 43 Fo$(TMP_DIR)^\.C
d040: 43 53 54 55 42 53 43 4d 44 20 3d 20 24 28 63 63 CSTUBSCMD = $(cc
d050: 33 32 29 20 24 28 73 74 75 62 73 63 66 6c 61 67 32) $(stubscflag
d060: 73 29 20 2d 46 6f 24 28 54 4d 50 5f 44 49 52 29 s) -Fo$(TMP_DIR)
d070: 5e 5c 0a 0a 4c 49 42 43 4d 44 20 3d 20 24 28 6c ^\..LIBCMD = $(l
d080: 69 62 33 32 29 20 2d 6e 6f 6c 6f 67 6f 20 24 28 ib32) -nologo $(
d090: 4c 49 4e 4b 45 52 46 4c 41 47 53 29 20 2d 6f 75 LINKERFLAGS) -ou
d0a0: 74 3a 24 40 0a 44 4c 4c 43 4d 44 20 3d 20 24 28 t:[email protected] = $(
d0b0: 6c 69 6e 6b 33 32 29 20 24 28 64 6c 6c 6c 66 6c link32) $(dlllfl
d0c0: 61 67 73 29 20 2d 6f 75 74 3a 24 40 20 24 28 62 ags) -out:$@ $(b
d0d0: 61 73 65 6c 69 62 73 29 20 24 28 74 63 6c 6c 69 aselibs) $(tclli
d0e0: 62 73 29 20 24 28 74 6b 6c 69 62 73 29 0a 0a 43 bs) $(tklibs)..C
d0f0: 4f 4e 45 58 45 43 4d 44 20 3d 20 24 28 6c 69 6e ONEXECMD = $(lin
d100: 6b 33 32 29 20 24 28 63 6f 6e 6c 66 6c 61 67 73 k32) $(conlflags
d110: 29 20 2d 6f 75 74 3a 24 40 20 24 28 62 61 73 65 ) -out:$@ $(base
d120: 6c 69 62 73 29 20 24 28 74 63 6c 6c 69 62 73 29 libs) $(tcllibs)
d130: 20 24 28 74 6b 6c 69 62 73 29 0a 47 55 49 45 58 $(tklibs).GUIEX
d140: 45 43 4d 44 20 3d 20 24 28 6c 69 6e 6b 33 32 29 ECMD = $(link32)
d150: 20 24 28 67 75 69 6c 66 6c 61 67 73 29 20 2d 6f $(guilflags) -o
d160: 75 74 3a 24 40 20 24 28 62 61 73 65 6c 69 62 73 ut:$@ $(baselibs
d170: 29 20 24 28 74 63 6c 6c 69 62 73 29 20 24 28 74 ) $(tcllibs) $(t
d180: 6b 6c 69 62 73 29 0a 52 45 53 43 4d 44 20 20 3d klibs).RESCMD =
d190: 20 24 28 72 63 33 32 29 20 2d 66 6f 20 24 40 20 $(rc32) -fo $@
d1a0: 2d 72 20 2d 69 20 22 24 28 47 45 4e 45 52 49 43 -r -i "$(GENERIC
d1b0: 44 49 52 29 22 20 2d 69 20 22 24 28 54 4d 50 5f DIR)" -i "$(TMP_
d1c0: 44 49 52 29 22 20 5c 0a 09 20 20 20 20 24 28 54 DIR)" \.. $(T
d1d0: 43 4c 5f 49 4e 43 4c 55 44 45 53 29 20 2f 44 53 CL_INCLUDES) /DS
d1e0: 54 41 54 49 43 5f 42 55 49 4c 44 3d 24 28 53 54 TATIC_BUILD=$(ST
d1f0: 41 54 49 43 5f 42 55 49 4c 44 29 20 5c 0a 09 20 ATIC_BUILD) \..
d200: 20 20 20 2f 44 44 45 42 55 47 3d 24 28 44 45 42 /DDEBUG=$(DEB
d210: 55 47 29 20 2d 64 20 55 4e 43 48 45 43 4b 45 44 UG) -d UNCHECKED
d220: 3d 24 28 55 4e 43 48 45 43 4b 45 44 29 20 5c 0a =$(UNCHECKED) \.
d230: 09 20 20 20 20 2f 44 43 4f 4d 4d 41 56 45 52 53 . /DCOMMAVERS
d240: 49 4f 4e 3d 24 28 52 43 43 4f 4d 4d 41 56 45 52 ION=$(RCCOMMAVER
d250: 53 49 4f 4e 29 20 5c 0a 09 20 20 20 20 2f 44 44 SION) \.. /DD
d260: 4f 54 56 45 52 53 49 4f 4e 3d 5c 22 24 28 44 4f OTVERSION=\"$(DO
d270: 54 56 45 52 53 49 4f 4e 29 5c 22 20 5c 0a 09 20 TVERSION)\" \..
d280: 20 20 20 2f 44 56 45 52 53 49 4f 4e 3d 5c 22 24 /DVERSION=\"$
d290: 28 56 45 52 53 49 4f 4e 29 5c 22 20 5c 0a 09 20 (VERSION)\" \..
d2a0: 20 20 20 2f 44 53 55 46 58 3d 5c 22 24 28 53 55 /DSUFX=\"$(SU
d2b0: 46 58 29 5c 22 20 5c 0a 09 20 20 20 20 2f 44 50 FX)\" \.. /DP
d2c0: 52 4f 4a 45 43 54 3d 5c 22 24 28 50 52 4f 4a 45 ROJECT=\"$(PROJE
d2d0: 43 54 29 5c 22 20 5c 0a 09 20 20 20 20 2f 44 50 CT)\" \.. /DP
d2e0: 52 4a 4c 49 42 4e 41 4d 45 3d 5c 22 24 28 50 52 RJLIBNAME=\"$(PR
d2f0: 4a 4c 49 42 4e 41 4d 45 29 5c 22 0a 0a 21 69 66 JLIBNAME)\"..!if
d300: 6e 64 65 66 20 44 45 46 41 55 4c 54 5f 42 55 49 ndef DEFAULT_BUI
d310: 4c 44 5f 54 41 52 47 45 54 0a 44 45 46 41 55 4c LD_TARGET.DEFAUL
d320: 54 5f 42 55 49 4c 44 5f 54 41 52 47 45 54 20 3d T_BUILD_TARGET =
d330: 20 24 28 50 52 4f 4a 45 43 54 29 0a 21 65 6e 64 $(PROJECT).!end
d340: 69 66 0a 0a 64 65 66 61 75 6c 74 2d 74 61 72 67 if..default-targ
d350: 65 74 3a 20 24 28 44 45 46 41 55 4c 54 5f 42 55 et: $(DEFAULT_BU
d360: 49 4c 44 5f 54 41 52 47 45 54 29 0a 0a 21 69 66 ILD_TARGET)..!if
d370: 20 24 28 4d 55 4c 54 49 50 4c 41 54 46 4f 52 4d $(MULTIPLATFORM
d380: 5f 49 4e 53 54 41 4c 4c 29 0a 64 65 66 61 75 6c _INSTALL).defaul
d390: 74 2d 70 6b 67 69 6e 64 65 78 3a 0a 09 40 65 63 t-pkgindex:..@ec
d3a0: 68 6f 20 69 66 20 7b 5b 70 61 63 6b 61 67 65 20 ho if {[package
d3b0: 76 73 61 74 69 73 66 69 65 73 20 5b 70 61 63 6b vsatisfies [pack
d3c0: 61 67 65 20 70 72 6f 76 69 64 65 20 54 63 6c 5d age provide Tcl]
d3d0: 20 39 2e 30 5d 7d 20 7b 20 3e 20 24 28 4f 55 54 9.0]} { > $(OUT
d3e0: 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 _DIR)\pkgIndex.t
d3f0: 63 6c 0a 09 40 65 63 68 6f 20 70 61 63 6b 61 67 cl..@echo packag
d400: 65 20 69 66 6e 65 65 64 65 64 20 24 28 50 52 4a e ifneeded $(PRJ
d410: 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 _PACKAGE_TCLNAME
d420: 29 20 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 20 ) $(DOTVERSION)
d430: 5c 0a 09 20 20 20 20 5b 6c 69 73 74 20 6c 6f 61 \.. [list loa
d440: 64 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 24 64 d [file join $$d
d450: 69 72 20 24 28 50 4c 41 54 46 4f 52 4d 5f 49 44 ir $(PLATFORM_ID
d460: 45 4e 54 49 46 59 29 20 24 28 50 52 4a 4c 49 42 ENTIFY) $(PRJLIB
d470: 4e 41 4d 45 39 29 5d 5d 20 3e 3e 20 24 28 4f 55 NAME9)]] >> $(OU
d480: 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e T_DIR)\pkgIndex.
d490: 74 63 6c 0a 09 40 65 63 68 6f 20 7d 20 65 6c 73 tcl..@echo } els
d4a0: 65 20 7b 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52 e { >> $(OUT_DIR
d4b0: 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 09 )\pkgIndex.tcl..
d4c0: 40 65 63 68 6f 20 70 61 63 6b 61 67 65 20 69 66 @echo package if
d4d0: 6e 65 65 64 65 64 20 24 28 50 52 4a 5f 50 41 43 needed $(PRJ_PAC
d4e0: 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 20 24 28 KAGE_TCLNAME) $(
d4f0: 44 4f 54 56 45 52 53 49 4f 4e 29 20 5c 0a 09 20 DOTVERSION) \..
d500: 20 20 20 5b 6c 69 73 74 20 6c 6f 61 64 20 5b 66 [list load [f
d510: 69 6c 65 20 6a 6f 69 6e 20 24 24 64 69 72 20 24 ile join $$dir $
d520: 28 50 4c 41 54 46 4f 52 4d 5f 49 44 45 4e 54 49 (PLATFORM_IDENTI
d530: 46 59 29 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 FY) $(PRJLIBNAME
d540: 38 29 5d 5d 20 3e 3e 20 24 28 4f 55 54 5f 44 49 8)]] >> $(OUT_DI
d550: 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a R)\pkgIndex.tcl.
d560: 09 40 65 63 68 6f 20 7d 20 3e 3e 20 24 28 4f 55 .@echo } >> $(OU
d570: 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e T_DIR)\pkgIndex.
d580: 74 63 6c 0a 21 65 6c 73 65 0a 64 65 66 61 75 6c tcl.!else.defaul
d590: 74 2d 70 6b 67 69 6e 64 65 78 3a 0a 09 40 65 63 t-pkgindex:..@ec
d5a0: 68 6f 20 69 66 20 7b 5b 70 61 63 6b 61 67 65 20 ho if {[package
d5b0: 76 73 61 74 69 73 66 69 65 73 20 5b 70 61 63 6b vsatisfies [pack
d5c0: 61 67 65 20 70 72 6f 76 69 64 65 20 54 63 6c 5d age provide Tcl]
d5d0: 20 39 2e 30 5d 7d 20 7b 20 3e 20 24 28 4f 55 54 9.0]} { > $(OUT
d5e0: 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 78 2e 74 _DIR)\pkgIndex.t
d5f0: 63 6c 0a 09 40 65 63 68 6f 20 70 61 63 6b 61 67 cl..@echo packag
d600: 65 20 69 66 6e 65 65 64 65 64 20 24 28 50 52 4a e ifneeded $(PRJ
d610: 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 _PACKAGE_TCLNAME
d620: 29 20 24 28 44 4f 54 56 45 52 53 49 4f 4e 29 20 ) $(DOTVERSION)
d630: 5c 0a 09 20 20 20 20 5b 6c 69 73 74 20 6c 6f 61 \.. [list loa
d640: 64 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 24 64 d [file join $$d
d650: 69 72 20 24 28 50 52 4a 4c 49 42 4e 41 4d 45 39 ir $(PRJLIBNAME9
d660: 29 5d 5d 20 3e 3e 20 24 28 4f 55 54 5f 44 49 52 )]] >> $(OUT_DIR
d670: 29 5c 70 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 09 )\pkgIndex.tcl..
d680: 40 65 63 68 6f 20 7d 20 65 6c 73 65 20 7b 20 3e @echo } else { >
d690: 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 > $(OUT_DIR)\pkg
d6a0: 49 6e 64 65 78 2e 74 63 6c 0a 09 40 65 63 68 6f Index.tcl..@echo
d6b0: 20 70 61 63 6b 61 67 65 20 69 66 6e 65 65 64 65 package ifneede
d6c0: 64 20 24 28 50 52 4a 5f 50 41 43 4b 41 47 45 5f d $(PRJ_PACKAGE_
d6d0: 54 43 4c 4e 41 4d 45 29 20 24 28 44 4f 54 56 45 TCLNAME) $(DOTVE
d6e0: 52 53 49 4f 4e 29 20 5c 0a 09 20 20 20 20 5b 6c RSION) \.. [l
d6f0: 69 73 74 20 6c 6f 61 64 20 5b 66 69 6c 65 20 6a ist load [file j
d700: 6f 69 6e 20 24 24 64 69 72 20 24 28 50 52 4a 4c oin $$dir $(PRJL
d710: 49 42 4e 41 4d 45 38 29 5d 5d 20 3e 3e 20 24 28 IBNAME8)]] >> $(
d720: 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 OUT_DIR)\pkgInde
d730: 78 2e 74 63 6c 0a 09 40 65 63 68 6f 20 7d 20 3e x.tcl..@echo } >
d740: 3e 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 > $(OUT_DIR)\pkg
d750: 49 6e 64 65 78 2e 74 63 6c 0a 21 65 6e 64 69 66 Index.tcl.!endif
d760: 0a 0a 64 65 66 61 75 6c 74 2d 70 6b 67 69 6e 64 ..default-pkgind
d770: 65 78 2d 74 65 61 3a 0a 09 40 69 66 20 65 78 69 ex-tea:..@if exi
d780: 73 74 20 24 28 52 4f 4f 54 29 5c 70 6b 67 49 6e st $(ROOT)\pkgIn
d790: 64 65 78 2e 74 63 6c 2e 69 6e 20 24 28 4e 4d 41 dex.tcl.in $(NMA
d7a0: 4b 45 48 4c 50 5f 4e 41 54 49 56 45 29 20 2d 73 KEHLP_NATIVE) -s
d7b0: 20 3c 3c 20 24 28 52 4f 4f 54 29 5c 70 6b 67 49 << $(ROOT)\pkgI
d7c0: 6e 64 65 78 2e 74 63 6c 2e 69 6e 20 3e 20 24 28 ndex.tcl.in > $(
d7d0: 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 6e 64 65 OUT_DIR)\pkgInde
d7e0: 78 2e 74 63 6c 0a 40 50 41 43 4b 41 47 45 5f 56 x.tcl.@PACKAGE_V
d7f0: 45 52 53 49 4f 4e 40 20 20 20 20 24 28 44 4f 54 ERSION@ $(DOT
d800: 56 45 52 53 49 4f 4e 29 0a 40 50 41 43 4b 41 47 VERSION).@PACKAG
d810: 45 5f 4e 41 4d 45 40 20 20 20 20 20 20 20 24 28 E_NAME@ $(
d820: 50 52 4a 5f 50 41 43 4b 41 47 45 5f 54 43 4c 4e PRJ_PACKAGE_TCLN
d830: 41 4d 45 29 0a 40 50 41 43 4b 41 47 45 5f 54 43 AME).@PACKAGE_TC
d840: 4c 4e 41 4d 45 40 20 20 20 20 24 28 50 52 4a 5f LNAME@ $(PRJ_
d850: 50 41 43 4b 41 47 45 5f 54 43 4c 4e 41 4d 45 29 PACKAGE_TCLNAME)
d860: 0a 40 50 4b 47 5f 4c 49 42 5f 46 49 4c 45 40 20 .@PKG_LIB_FILE@
d870: 20 20 20 20 20 20 24 28 50 52 4a 4c 49 42 4e 41 $(PRJLIBNA
d880: 4d 45 29 0a 40 50 4b 47 5f 4c 49 42 5f 46 49 4c ME).@PKG_LIB_FIL
d890: 45 38 40 20 20 20 20 20 20 24 28 50 52 4a 4c 49 E8@ $(PRJLI
d8a0: 42 4e 41 4d 45 38 29 0a 40 50 4b 47 5f 4c 49 42 BNAME8).@PKG_LIB
d8b0: 5f 46 49 4c 45 39 40 20 20 20 20 20 20 24 28 50 _FILE9@ $(P
d8c0: 52 4a 4c 49 42 4e 41 4d 45 39 29 0a 3c 3c 0a 0a RJLIBNAME9).<<..
d8d0: 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 3a default-install:
d8e0: 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c default-install
d8f0: 2d 62 69 6e 61 72 69 65 73 20 64 65 66 61 75 6c -binaries defaul
d900: 74 2d 69 6e 73 74 61 6c 6c 2d 6c 69 62 72 61 72 t-install-librar
d910: 69 65 73 0a 21 69 66 20 24 28 53 59 4d 42 4f 4c ies.!if $(SYMBOL
d920: 53 29 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 S).default-insta
d930: 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 ll: default-inst
d940: 61 6c 6c 2d 70 64 62 73 0a 21 65 6e 64 69 66 0a all-pdbs.!endif.
d950: 0a 23 20 41 67 61 69 6e 20 74 6f 20 64 65 61 6c .# Again to deal
d960: 20 77 69 74 68 20 68 69 73 74 6f 72 69 63 61 6c with historical
d970: 20 62 72 6f 6b 65 6e 6e 65 73 73 2c 20 74 68 65 brokenness, the
d980: 72 65 20 69 73 20 73 6f 6d 65 20 63 6f 6e 66 75 re is some confu
d990: 73 69 6f 6e 0a 23 20 69 6e 20 74 65 72 6d 69 6e sion.# in termin
d9a0: 6c 6f 67 79 2e 20 46 6f 72 20 65 78 74 65 6e 73 logy. For extens
d9b0: 69 6f 6e 73 2c 20 74 68 65 20 22 69 6e 73 74 61 ions, the "insta
d9c0: 6c 6c 2d 62 69 6e 61 72 69 65 73 22 20 77 61 73 ll-binaries" was
d9d0: 20 75 73 65 64 20 74 6f 0a 23 20 6c 6f 63 61 74 used to.# locat
d9e0: 65 20 74 61 72 67 65 74 20 64 69 72 65 63 74 6f e target directo
d9f0: 72 79 20 66 6f 72 20 2a 62 69 6e 61 72 79 20 73 ry for *binary s
da00: 68 61 72 65 64 20 6c 69 62 72 61 72 69 65 73 2a hared libraries*
da10: 20 61 6e 64 20 74 68 75 73 0a 23 20 74 68 65 20 and thus.# the
da20: 61 70 70 72 6f 70 72 69 61 74 65 20 6d 61 63 72 appropriate macr
da30: 6f 20 69 73 20 4c 49 42 5f 49 4e 53 54 41 4c 4c o is LIB_INSTALL
da40: 5f 44 49 52 20 73 69 6e 63 65 20 42 49 4e 5f 49 _DIR since BIN_I
da50: 4e 53 54 41 4c 4c 5f 44 49 52 20 69 73 0a 23 20 NSTALL_DIR is.#
da60: 66 6f 72 20 65 78 65 63 75 74 61 62 6c 65 73 20 for executables
da70: 28 65 78 65 73 29 2e 20 4f 6e 20 74 68 65 20 6f (exes). On the o
da80: 74 68 65 72 20 68 61 6e 64 20 74 68 65 20 22 69 ther hand the "i
da90: 6e 73 74 61 6c 6c 2d 6c 69 62 72 61 72 69 65 73 nstall-libraries
daa0: 22 0a 23 20 74 61 72 67 65 74 20 69 73 20 66 6f ".# target is fo
dab0: 72 20 2a 73 63 72 69 70 74 73 2a 20 61 6e 64 20 r *scripts* and
dac0: 73 68 6f 75 6c 64 20 68 61 76 65 20 62 65 65 6e should have been
dad0: 20 63 61 6c 6c 65 64 20 22 69 6e 73 74 61 6c 6c called "install
dae0: 2d 73 63 72 69 70 74 73 22 2e 0a 64 65 66 61 75 -scripts"..defau
daf0: 6c 74 2d 69 6e 73 74 61 6c 6c 2d 62 69 6e 61 72 lt-install-binar
db00: 69 65 73 3a 20 24 28 50 52 4a 4c 49 42 29 0a 09 ies: $(PRJLIB)..
db10: 40 24 28 45 43 48 4f 29 20 49 6e 73 74 61 6c 6c @$(ECHO) Install
db20: 69 6e 67 20 24 28 50 52 4a 4c 49 42 29 20 74 6f ing $(PRJLIB) to
db30: 20 27 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f '$(LIB_INSTALL_
db40: 44 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20 65 DIR)'..@if not e
db50: 78 69 73 74 20 22 24 28 4c 49 42 5f 49 4e 53 54 xist "$(LIB_INST
db60: 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72 20 ALL_DIR)" mkdir
db70: 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 "$(LIB_INSTALL_D
db80: 49 52 29 22 0a 09 40 24 28 43 50 59 29 20 24 28 IR)"..@$(CPY) $(
db90: 50 52 4a 4c 49 42 29 20 22 24 28 4c 49 42 5f 49 PRJLIB) "$(LIB_I
dba0: 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 3e 4e 55 NSTALL_DIR)" >NU
dbb0: 4c 0a 0a 23 20 41 6c 69 61 73 20 66 6f 72 20 64 L..# Alias for d
dbc0: 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 73 efault-install-s
dbd0: 63 72 69 70 74 73 0a 64 65 66 61 75 6c 74 2d 69 cripts.default-i
dbe0: 6e 73 74 61 6c 6c 2d 6c 69 62 72 61 72 69 65 73 nstall-libraries
dbf0: 3a 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c : default-instal
dc00: 6c 2d 73 63 72 69 70 74 73 0a 0a 64 65 66 61 75 l-scripts..defau
dc10: 6c 74 2d 69 6e 73 74 61 6c 6c 2d 73 63 72 69 70 lt-install-scrip
dc20: 74 73 3a 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 ts: $(OUT_DIR)\p
dc30: 6b 67 49 6e 64 65 78 2e 74 63 6c 0a 09 40 24 28 kgIndex.tcl..@$(
dc40: 45 43 48 4f 29 20 49 6e 73 74 61 6c 6c 69 6e 67 ECHO) Installing
dc50: 20 24 28 50 52 4f 4a 45 43 54 29 20 73 63 72 69 $(PROJECT) scri
dc60: 70 74 73 20 74 6f 20 27 24 28 53 43 52 49 50 54 pts to '$(SCRIPT
dc70: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 _INSTALL_DIR)'..
dc80: 40 69 66 20 6e 6f 74 20 65 78 69 73 74 20 22 24 @if not exist "$
dc90: 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f (SCRIPT_INSTALL_
dca0: 44 49 52 29 22 20 6d 6b 64 69 72 20 22 24 28 53 DIR)" mkdir "$(S
dcb0: 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 CRIPT_INSTALL_DI
dcc0: 52 29 22 0a 09 40 69 66 20 65 78 69 73 74 20 24 R)"..@if exist $
dcd0: 28 4c 49 42 44 49 52 29 20 24 28 43 50 59 29 20 (LIBDIR) $(CPY)
dce0: 24 28 4c 49 42 44 49 52 29 5c 2a 2e 74 63 6c 20 $(LIBDIR)\*.tcl
dcf0: 22 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41 4c "$(SCRIPT_INSTAL
dd00: 4c 5f 44 49 52 29 22 0a 09 40 24 28 43 50 59 29 L_DIR)"..@$(CPY)
dd10: 20 24 28 4f 55 54 5f 44 49 52 29 5c 70 6b 67 49 $(OUT_DIR)\pkgI
dd20: 6e 64 65 78 2e 74 63 6c 20 24 28 53 43 52 49 50 ndex.tcl $(SCRIP
dd30: 54 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 0a 0a T_INSTALL_DIR)..
dd40: 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d default-install-
dd50: 73 74 75 62 73 3a 0a 09 40 24 28 45 43 48 4f 29 stubs:..@$(ECHO)
dd60: 20 49 6e 73 74 61 6c 6c 69 6e 67 20 73 74 75 62 Installing stub
dd70: 73 20 6c 69 62 72 61 72 79 20 74 6f 20 27 24 28 s library to '$(
dd80: 53 43 52 49 50 54 5f 49 4e 53 54 41 4c 4c 5f 44 SCRIPT_INSTALL_D
dd90: 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20 65 78 IR)'..@if not ex
dda0: 69 73 74 20 22 24 28 53 43 52 49 50 54 5f 49 4e ist "$(SCRIPT_IN
ddb0: 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 STALL_DIR)" mkdi
ddc0: 72 20 22 24 28 53 43 52 49 50 54 5f 49 4e 53 54 r "$(SCRIPT_INST
ddd0: 41 4c 4c 5f 44 49 52 29 22 0a 09 40 24 28 43 50 ALL_DIR)"..@$(CP
dde0: 59 29 20 24 28 50 52 4a 53 54 55 42 4c 49 42 29 Y) $(PRJSTUBLIB)
ddf0: 20 22 24 28 53 43 52 49 50 54 5f 49 4e 53 54 41 "$(SCRIPT_INSTA
de00: 4c 4c 5f 44 49 52 29 22 20 3e 4e 55 4c 0a 0a 64 LL_DIR)" >NUL..d
de10: 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d 70 efault-install-p
de20: 64 62 73 3a 0a 21 69 66 20 21 24 28 53 54 41 54 dbs:.!if !$(STAT
de30: 49 43 5f 42 55 49 4c 44 29 0a 09 40 24 28 45 43 IC_BUILD)..@$(EC
de40: 48 4f 29 20 49 6e 73 74 61 6c 6c 69 6e 67 20 50 HO) Installing P
de50: 44 42 73 20 74 6f 20 27 24 28 4c 49 42 5f 49 4e DBs to '$(LIB_IN
de60: 53 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 STALL_DIR)'..@if
de70: 20 6e 6f 74 20 65 78 69 73 74 20 22 24 28 4c 49 not exist "$(LI
de80: 42 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 B_INSTALL_DIR)"
de90: 6d 6b 64 69 72 20 22 24 28 4c 49 42 5f 49 4e 53 mkdir "$(LIB_INS
dea0: 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 24 28 43 TALL_DIR)"..@$(C
deb0: 50 59 29 20 22 24 28 4f 55 54 5f 44 49 52 29 5c PY) "$(OUT_DIR)\
dec0: 2a 2e 70 64 62 22 20 22 24 28 4c 49 42 5f 49 4e *.pdb" "$(LIB_IN
ded0: 53 54 41 4c 4c 5f 44 49 52 29 5c 22 0a 21 65 6e STALL_DIR)\".!en
dee0: 64 69 66 0a 0a 23 20 22 65 6d 61 63 73 20 66 6f dif..# "emacs fo
def0: 6e 74 2d 6c 6f 63 6b 20 68 69 67 68 6c 69 67 68 nt-lock highligh
df00: 74 69 6e 67 20 66 69 78 0a 0a 64 65 66 61 75 6c ting fix..defaul
df10: 74 2d 69 6e 73 74 61 6c 6c 2d 64 6f 63 73 2d 68 t-install-docs-h
df20: 74 6d 6c 3a 0a 09 40 24 28 45 43 48 4f 29 20 49 tml:..@$(ECHO) I
df30: 6e 73 74 61 6c 6c 69 6e 67 20 64 6f 63 75 6d 65 nstalling docume
df40: 6e 74 61 74 69 6f 6e 20 66 69 6c 65 73 20 74 6f ntation files to
df50: 20 27 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f '$(DOC_INSTALL_
df60: 44 49 52 29 27 0a 09 40 69 66 20 6e 6f 74 20 65 DIR)'..@if not e
df70: 78 69 73 74 20 22 24 28 44 4f 43 5f 49 4e 53 54 xist "$(DOC_INST
df80: 41 4c 4c 5f 44 49 52 29 22 20 6d 6b 64 69 72 20 ALL_DIR)" mkdir
df90: 22 24 28 44 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 "$(DOC_INSTALL_D
dfa0: 49 52 29 22 0a 09 40 69 66 20 65 78 69 73 74 20 IR)"..@if exist
dfb0: 24 28 44 4f 43 44 49 52 29 20 66 6f 72 20 25 66 $(DOCDIR) for %f
dfc0: 20 69 6e 20 28 22 24 28 44 4f 43 44 49 52 29 5c in ("$(DOCDIR)\
dfd0: 2a 2e 68 74 6d 6c 22 20 22 24 28 44 4f 43 44 49 *.html" "$(DOCDI
dfe0: 52 29 5c 2a 2e 63 73 73 22 20 22 24 28 44 4f 43 R)\*.css" "$(DOC
dff0: 44 49 52 29 5c 2a 2e 70 6e 67 22 29 20 64 6f 20 DIR)\*.png") do
e000: 40 24 28 43 4f 50 59 29 20 25 66 20 22 24 28 44 @$(COPY) %f "$(D
e010: 4f 43 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 OC_INSTALL_DIR)"
e020: 0a 0a 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c ..default-instal
e030: 6c 2d 64 6f 63 73 2d 6e 3a 0a 09 40 24 28 45 43 l-docs-n:..@$(EC
e040: 48 4f 29 20 49 6e 73 74 61 6c 6c 69 6e 67 20 64 HO) Installing d
e050: 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 69 6c ocumentation fil
e060: 65 73 20 74 6f 20 27 24 28 44 4f 43 5f 49 4e 53 es to '$(DOC_INS
e070: 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 20 TALL_DIR)'..@if
e080: 6e 6f 74 20 65 78 69 73 74 20 22 24 28 44 4f 43 not exist "$(DOC
e090: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 6d _INSTALL_DIR)" m
e0a0: 6b 64 69 72 20 22 24 28 44 4f 43 5f 49 4e 53 54 kdir "$(DOC_INST
e0b0: 41 4c 4c 5f 44 49 52 29 22 0a 09 40 69 66 20 65 ALL_DIR)"..@if e
e0c0: 78 69 73 74 20 24 28 44 4f 43 44 49 52 29 20 66 xist $(DOCDIR) f
e0d0: 6f 72 20 25 66 20 69 6e 20 28 22 24 28 44 4f 43 or %f in ("$(DOC
e0e0: 44 49 52 29 5c 2a 2e 6e 22 29 20 64 6f 20 40 24 DIR)\*.n") do @$
e0f0: 28 43 4f 50 59 29 20 25 66 20 22 24 28 44 4f 43 (COPY) %f "$(DOC
e100: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a 0a _INSTALL_DIR)"..
e110: 64 65 66 61 75 6c 74 2d 69 6e 73 74 61 6c 6c 2d default-install-
e120: 64 65 6d 6f 73 3a 0a 09 40 24 28 45 43 48 4f 29 demos:..@$(ECHO)
e130: 20 49 6e 73 74 61 6c 6c 69 6e 67 20 64 65 6d 6f Installing demo
e140: 73 20 74 6f 20 27 24 28 44 45 4d 4f 5f 49 4e 53 s to '$(DEMO_INS
e150: 54 41 4c 4c 5f 44 49 52 29 27 0a 09 40 69 66 20 TALL_DIR)'..@if
e160: 6e 6f 74 20 65 78 69 73 74 20 22 24 28 44 45 4d not exist "$(DEM
e170: 4f 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 20 O_INSTALL_DIR)"
e180: 6d 6b 64 69 72 20 22 24 28 44 45 4d 4f 5f 49 4e mkdir "$(DEMO_IN
e190: 53 54 41 4c 4c 5f 44 49 52 29 22 0a 09 40 69 66 STALL_DIR)"..@if
e1a0: 20 65 78 69 73 74 20 24 28 44 45 4d 4f 44 49 52 exist $(DEMODIR
e1b0: 29 20 24 28 43 50 59 44 49 52 29 20 22 24 28 44 ) $(CPYDIR) "$(D
e1c0: 45 4d 4f 44 49 52 29 22 20 22 24 28 44 45 4d 4f EMODIR)" "$(DEMO
e1d0: 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a 0a _INSTALL_DIR)"..
e1e0: 64 65 66 61 75 6c 74 2d 63 6c 65 61 6e 3a 0a 09 default-clean:..
e1f0: 40 24 28 45 43 48 4f 29 20 43 6c 65 61 6e 69 6e @$(ECHO) Cleanin
e200: 67 20 24 28 54 4d 50 5f 44 49 52 29 5c 2a 20 2e g $(TMP_DIR)\* .
e210: 2e 2e 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 ....@if exist $(
e220: 54 4d 50 5f 44 49 52 29 5c 6e 75 6c 20 24 28 52 TMP_DIR)\nul $(R
e230: 4d 44 49 52 29 20 24 28 54 4d 50 5f 44 49 52 29 MDIR) $(TMP_DIR)
e240: 0a 09 40 24 28 45 43 48 4f 29 20 43 6c 65 61 6e ..@$(ECHO) Clean
e250: 69 6e 67 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e ing $(WIN_DIR)\n
e260: 6d 61 6b 65 68 6c 70 2e 6f 62 6a 2c 20 6e 6d 61 makehlp.obj, nma
e270: 6b 65 68 6c 70 2e 65 78 65 20 2e 2e 2e 0a 09 40 kehlp.exe .....@
e280: 69 66 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44 if exist $(WIN_D
e290: 49 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f 62 6a IR)\nmakehlp.obj
e2a0: 20 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c del $(WIN_DIR)\
e2b0: 6e 6d 61 6b 65 68 6c 70 2e 6f 62 6a 0a 09 40 69 nmakehlp.obj..@i
e2c0: 66 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44 49 f exist $(WIN_DI
e2d0: 52 29 5c 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 20 R)\nmakehlp.exe
e2e0: 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e del $(WIN_DIR)\n
e2f0: 6d 61 6b 65 68 6c 70 2e 65 78 65 0a 09 40 69 66 makehlp.exe..@if
e300: 20 65 78 69 73 74 20 24 28 57 49 4e 5f 44 49 52 exist $(WIN_DIR
e310: 29 5c 6e 6d 61 6b 65 68 6c 70 2e 6f 75 74 20 64 )\nmakehlp.out d
e320: 65 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d el $(WIN_DIR)\nm
e330: 61 6b 65 68 6c 70 2e 6f 75 74 0a 09 40 24 28 45 akehlp.out..@$(E
e340: 43 48 4f 29 20 43 6c 65 61 6e 69 6e 67 20 24 28 CHO) Cleaning $(
e350: 57 49 4e 5f 44 49 52 29 5c 6e 6d 68 6c 70 2d 6f WIN_DIR)\nmhlp-o
e360: 75 74 2e 74 78 74 20 2e 2e 2e 0a 09 40 69 66 20 ut.txt .....@if
e370: 65 78 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 exist $(WIN_DIR)
e380: 5c 6e 6d 68 6c 70 2d 6f 75 74 2e 74 78 74 20 64 \nmhlp-out.txt d
e390: 65 6c 20 24 28 57 49 4e 5f 44 49 52 29 5c 6e 6d el $(WIN_DIR)\nm
e3a0: 68 6c 70 2d 6f 75 74 2e 74 78 74 0a 09 40 24 28 hlp-out.txt..@$(
e3b0: 45 43 48 4f 29 20 43 6c 65 61 6e 69 6e 67 20 24 ECHO) Cleaning $
e3c0: 28 57 49 4e 5f 44 49 52 29 5c 5f 6a 75 6e 6b 2e (WIN_DIR)\_junk.
e3d0: 70 63 68 20 2e 2e 2e 0a 09 40 69 66 20 65 78 69 pch .....@if exi
e3e0: 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 5f 6a st $(WIN_DIR)\_j
e3f0: 75 6e 6b 2e 70 63 68 20 64 65 6c 20 24 28 57 49 unk.pch del $(WI
e400: 4e 5f 44 49 52 29 5c 5f 6a 75 6e 6b 2e 70 63 68 N_DIR)\_junk.pch
e410: 0a 09 40 24 28 45 43 48 4f 29 20 43 6c 65 61 6e ..@$(ECHO) Clean
e420: 69 6e 67 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 ing $(WIN_DIR)\v
e430: 65 72 63 6c 2e 78 2c 20 76 65 72 63 6c 2e 69 20 ercl.x, vercl.i
e440: 2e 2e 2e 0a 09 40 69 66 20 65 78 69 73 74 20 24 .....@if exist $
e450: 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 63 6c 2e (WIN_DIR)\vercl.
e460: 78 20 64 65 6c 20 24 28 57 49 4e 5f 44 49 52 29 x del $(WIN_DIR)
e470: 5c 76 65 72 63 6c 2e 78 0a 09 40 69 66 20 65 78 \vercl.x..@if ex
e480: 69 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 ist $(WIN_DIR)\v
e490: 65 72 63 6c 2e 69 20 64 65 6c 20 24 28 57 49 4e ercl.i del $(WIN
e4a0: 5f 44 49 52 29 5c 76 65 72 63 6c 2e 69 0a 09 40 _DIR)\vercl.i..@
e4b0: 24 28 45 43 48 4f 29 20 43 6c 65 61 6e 69 6e 67 $(ECHO) Cleaning
e4c0: 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 73 $(WIN_DIR)\vers
e4d0: 69 6f 6e 73 2e 76 63 2c 20 76 65 72 73 69 6f 6e ions.vc, version
e4e0: 2e 76 63 20 2e 2e 2e 0a 09 40 69 66 20 65 78 69 .vc .....@if exi
e4f0: 73 74 20 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 st $(WIN_DIR)\ve
e500: 72 73 69 6f 6e 73 2e 76 63 20 64 65 6c 20 24 28 rsions.vc del $(
e510: 57 49 4e 5f 44 49 52 29 5c 76 65 72 73 69 6f 6e WIN_DIR)\version
e520: 73 2e 76 63 0a 09 40 69 66 20 65 78 69 73 74 20 s.vc..@if exist
e530: 24 28 57 49 4e 5f 44 49 52 29 5c 76 65 72 73 69 $(WIN_DIR)\versi
e540: 6f 6e 2e 76 63 20 64 65 6c 20 24 28 57 49 4e 5f on.vc del $(WIN_
e550: 44 49 52 29 5c 76 65 72 73 69 6f 6e 2e 76 63 0a DIR)\version.vc.
e560: 0a 64 65 66 61 75 6c 74 2d 68 6f 73 65 3a 20 64 .default-hose: d
e570: 65 66 61 75 6c 74 2d 63 6c 65 61 6e 0a 09 40 65 efault-clean..@e
e580: 63 68 6f 20 48 6f 73 69 6e 67 20 24 28 4f 55 54 cho Hosing $(OUT
e590: 5f 44 49 52 29 5c 2a 20 2e 2e 2e 0a 09 40 69 66 _DIR)\* .....@if
e5a0: 20 65 78 69 73 74 20 24 28 4f 55 54 5f 44 49 52 exist $(OUT_DIR
e5b0: 29 5c 6e 75 6c 20 24 28 52 4d 44 49 52 29 20 24 )\nul $(RMDIR) $
e5c0: 28 4f 55 54 5f 44 49 52 29 0a 0a 23 20 4f 6e 6c (OUT_DIR)..# Onl
e5d0: 79 20 66 6f 72 20 62 61 63 6b 77 61 72 64 20 63 y for backward c
e5e0: 6f 6d 70 61 74 69 62 69 6c 69 74 79 0a 64 65 66 ompatibility.def
e5f0: 61 75 6c 74 2d 64 69 73 74 63 6c 65 61 6e 3a 20 ault-distclean:
e600: 64 65 66 61 75 6c 74 2d 68 6f 73 65 0a 0a 64 65 default-hose..de
e610: 66 61 75 6c 74 2d 73 65 74 75 70 3a 0a 09 40 69 fault-setup:..@i
e620: 66 20 6e 6f 74 20 65 78 69 73 74 20 24 28 4f 55 f not exist $(OU
e630: 54 5f 44 49 52 29 5c 6e 75 6c 20 6d 6b 64 69 72 T_DIR)\nul mkdir
e640: 20 24 28 4f 55 54 5f 44 49 52 29 0a 09 40 69 66 $(OUT_DIR)..@if
e650: 20 6e 6f 74 20 65 78 69 73 74 20 24 28 54 4d 50 not exist $(TMP
e660: 5f 44 49 52 29 5c 6e 75 6c 20 6d 6b 64 69 72 20 _DIR)\nul mkdir
e670: 24 28 54 4d 50 5f 44 49 52 29 0a 0a 21 69 66 20 $(TMP_DIR)..!if
e680: 22 24 28 54 45 53 54 50 41 54 29 22 20 21 3d 20 "$(TESTPAT)" !=
e690: 22 22 0a 54 45 53 54 46 4c 41 47 53 20 3d 20 24 "".TESTFLAGS = $
e6a0: 28 54 45 53 54 46 4c 41 47 53 29 20 2d 66 69 6c (TESTFLAGS) -fil
e6b0: 65 20 24 28 54 45 53 54 50 41 54 29 0a 21 65 6e e $(TESTPAT).!en
e6c0: 64 69 66 0a 0a 64 65 66 61 75 6c 74 2d 74 65 73 dif..default-tes
e6d0: 74 3a 20 64 65 66 61 75 6c 74 2d 73 65 74 75 70 t: default-setup
e6e0: 20 24 28 50 52 4f 4a 45 43 54 29 0a 09 40 73 65 $(PROJECT)..@se
e6f0: 74 20 54 43 4c 4c 49 42 50 41 54 48 3d 24 28 4f t TCLLIBPATH=$(O
e700: 55 54 5f 44 49 52 3a 5c 3d 2f 29 0a 09 40 69 66 UT_DIR:\=/)..@if
e710: 20 65 78 69 73 74 20 24 28 4c 49 42 44 49 52 29 exist $(LIBDIR)
e720: 20 66 6f 72 20 25 66 20 69 6e 20 28 22 24 28 4c for %f in ("$(L
e730: 49 42 44 49 52 29 5c 2a 2e 74 63 6c 22 29 20 64 IBDIR)\*.tcl") d
e740: 6f 20 40 24 28 43 4f 50 59 29 20 25 66 20 22 24 o @$(COPY) %f "$
e750: 28 4f 55 54 5f 44 49 52 29 22 0a 09 63 64 20 22 (OUT_DIR)"..cd "
e760: 24 28 54 45 53 54 44 49 52 29 22 20 26 26 20 24 $(TESTDIR)" && $
e770: 28 44 45 42 55 47 47 45 52 29 20 24 28 54 43 4c (DEBUGGER) $(TCL
e780: 53 48 29 20 61 6c 6c 2e 74 63 6c 20 24 28 54 45 SH) all.tcl $(TE
e790: 53 54 46 4c 41 47 53 29 0a 0a 64 65 66 61 75 6c STFLAGS)..defaul
e7a0: 74 2d 73 68 65 6c 6c 3a 20 64 65 66 61 75 6c 74 t-shell: default
e7b0: 2d 73 65 74 75 70 20 24 28 50 52 4f 4a 45 43 54 -setup $(PROJECT
e7c0: 29 0a 09 40 73 65 74 20 54 43 4c 4c 49 42 50 41 )..@set TCLLIBPA
e7d0: 54 48 3d 24 28 4f 55 54 5f 44 49 52 3a 5c 3d 2f TH=$(OUT_DIR:\=/
e7e0: 29 0a 09 40 69 66 20 65 78 69 73 74 20 24 28 4c )..@if exist $(L
e7f0: 49 42 44 49 52 29 20 66 6f 72 20 25 66 20 69 6e IBDIR) for %f in
e800: 20 28 22 24 28 4c 49 42 44 49 52 29 5c 2a 2e 74 ("$(LIBDIR)\*.t
e810: 63 6c 22 29 20 64 6f 20 40 24 28 43 4f 50 59 29 cl") do @$(COPY)
e820: 20 25 66 20 22 24 28 4f 55 54 5f 44 49 52 29 22 %f "$(OUT_DIR)"
e830: 0a 09 24 28 44 45 42 55 47 47 45 52 29 20 24 28 ..$(DEBUGGER) $(
e840: 54 43 4c 53 48 29 0a 0a 23 20 47 65 6e 65 72 61 TCLSH)..# Genera
e850: 74 69 6f 6e 20 6f 66 20 57 69 6e 64 6f 77 73 20 tion of Windows
e860: 76 65 72 73 69 6f 6e 20 72 65 73 6f 75 72 63 65 version resource
e870: 0a 21 69 66 64 65 66 20 52 43 46 49 4c 45 0a 0a .!ifdef RCFILE..
e880: 23 20 4e 6f 74 65 3a 20 64 6f 6e 27 74 20 75 73 # Note: don't us
e890: 65 20 24 2a 2a 20 69 6e 20 62 65 6c 6f 77 20 72 e $** in below r
e8a0: 75 6c 65 20 62 65 63 61 75 73 65 20 74 68 65 72 ule because ther
e8b0: 65 20 6d 61 79 20 62 65 20 6f 74 68 65 72 20 64 e may be other d
e8c0: 65 70 65 6e 64 65 6e 63 69 65 73 0a 23 20 61 6e ependencies.# an
e8d0: 64 20 6f 6e 6c 79 20 74 68 65 20 22 6d 61 69 6e d only the "main
e8e0: 22 20 72 63 20 6d 75 73 74 20 62 65 20 70 61 73 " rc must be pas
e8f0: 73 65 64 20 74 6f 20 74 68 65 20 72 65 73 6f 75 sed to the resou
e900: 72 63 65 20 63 6f 6d 70 69 6c 65 72 0a 24 28 54 rce compiler.$(T
e910: 4d 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 43 MP_DIR)\$(PROJEC
e920: 54 29 2e 72 65 73 3a 20 24 28 52 43 44 49 52 29 T).res: $(RCDIR)
e930: 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 63 0a 09 \$(PROJECT).rc..
e940: 24 28 52 45 53 43 4d 44 29 20 24 28 52 43 44 49 $(RESCMD) $(RCDI
e950: 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 63 R)\$(PROJECT).rc
e960: 0a 0a 21 65 6c 73 65 0a 0a 23 20 49 66 20 70 61 ..!else..# If pa
e970: 72 65 6e 74 20 6d 61 6b 65 66 69 6c 65 20 68 61 rent makefile ha
e980: 73 20 6e 6f 74 20 64 65 66 69 6e 65 64 20 61 20 s not defined a
e990: 72 65 73 6f 75 72 63 65 20 64 65 66 69 6e 69 74 resource definit
e9a0: 69 6f 6e 20 66 69 6c 65 2c 0a 23 20 77 65 20 77 ion file,.# we w
e9b0: 69 6c 6c 20 67 65 6e 65 72 61 74 65 20 6f 6e 65 ill generate one
e9c0: 20 66 72 6f 6d 20 73 74 61 6e 64 61 72 64 20 74 from standard t
e9d0: 65 6d 70 6c 61 74 65 2e 0a 24 28 54 4d 50 5f 44 emplate..$(TMP_D
e9e0: 49 52 29 5c 24 28 50 52 4f 4a 45 43 54 29 2e 72 IR)\$(PROJECT).r
e9f0: 65 73 3a 20 24 28 54 4d 50 5f 44 49 52 29 5c 24 es: $(TMP_DIR)\$
ea00: 28 50 52 4f 4a 45 43 54 29 2e 72 63 0a 0a 24 28 (PROJECT).rc..$(
ea10: 54 4d 50 5f 44 49 52 29 5c 24 28 50 52 4f 4a 45 TMP_DIR)\$(PROJE
ea20: 43 54 29 2e 72 63 3a 0a 09 40 24 28 43 4f 50 59 CT).rc:..@$(COPY
ea30: 29 20 3c 3c 20 24 28 54 4d 50 5f 44 49 52 29 5c ) << $(TMP_DIR)\
ea40: 24 28 50 52 4f 4a 45 43 54 29 2e 72 63 0a 23 69 $(PROJECT).rc.#i
ea50: 6e 63 6c 75 64 65 20 3c 77 69 6e 76 65 72 2e 68 nclude <winver.h
ea60: 3e 0a 0a 56 53 5f 56 45 52 53 49 4f 4e 5f 49 4e >..VS_VERSION_IN
ea70: 46 4f 20 56 45 52 53 49 4f 4e 49 4e 46 4f 0a 20 FO VERSIONINFO.
ea80: 46 49 4c 45 56 45 52 53 49 4f 4e 09 43 4f 4d 4d FILEVERSION.COMM
ea90: 41 56 45 52 53 49 4f 4e 0a 20 50 52 4f 44 55 43 AVERSION. PRODUC
eaa0: 54 56 45 52 53 49 4f 4e 09 43 4f 4d 4d 41 56 45 TVERSION.COMMAVE
eab0: 52 53 49 4f 4e 0a 20 46 49 4c 45 46 4c 41 47 53 RSION. FILEFLAGS
eac0: 4d 41 53 4b 09 30 78 33 66 4c 0a 23 69 66 64 65 MASK.0x3fL.#ifde
ead0: 66 20 44 45 42 55 47 0a 20 46 49 4c 45 46 4c 41 f DEBUG. FILEFLA
eae0: 47 53 09 56 53 5f 46 46 5f 44 45 42 55 47 0a 23 GS.VS_FF_DEBUG.#
eaf0: 65 6c 73 65 0a 20 46 49 4c 45 46 4c 41 47 53 09 else. FILEFLAGS.
eb00: 30 78 30 4c 0a 23 65 6e 64 69 66 0a 20 46 49 4c 0x0L.#endif. FIL
eb10: 45 4f 53 09 09 56 4f 53 5f 4e 54 5f 57 49 4e 44 EOS..VOS_NT_WIND
eb20: 4f 57 53 33 32 0a 20 46 49 4c 45 54 59 50 45 09 OWS32. FILETYPE.
eb30: 56 46 54 5f 44 4c 4c 0a 20 46 49 4c 45 53 55 42 VFT_DLL. FILESUB
eb40: 54 59 50 45 09 30 78 30 4c 0a 42 45 47 49 4e 0a TYPE.0x0L.BEGIN.
eb50: 20 20 20 20 42 4c 4f 43 4b 20 22 53 74 72 69 6e BLOCK "Strin
eb60: 67 46 69 6c 65 49 6e 66 6f 22 0a 20 20 20 20 42 gFileInfo". B
eb70: 45 47 49 4e 0a 09 42 4c 4f 43 4b 20 22 30 34 30 EGIN..BLOCK "040
eb80: 39 30 34 62 30 22 0a 09 42 45 47 49 4e 0a 09 20 904b0"..BEGIN..
eb90: 20 20 20 56 41 4c 55 45 20 22 46 69 6c 65 44 65 VALUE "FileDe
eba0: 73 63 72 69 70 74 69 6f 6e 22 2c 20 20 22 54 63 scription", "Tc
ebb0: 6c 20 65 78 74 65 6e 73 69 6f 6e 20 22 20 50 52 l extension " PR
ebc0: 4f 4a 45 43 54 0a 09 20 20 20 20 56 41 4c 55 45 OJECT.. VALUE
ebd0: 20 22 4f 72 69 67 69 6e 61 6c 46 69 6c 65 6e 61 "OriginalFilena
ebe0: 6d 65 22 2c 20 50 52 4a 4c 49 42 4e 41 4d 45 0a me", PRJLIBNAME.
ebf0: 09 20 20 20 20 56 41 4c 55 45 20 22 46 69 6c 65 . VALUE "File
ec00: 56 65 72 73 69 6f 6e 22 2c 20 20 20 20 20 20 44 Version", D
ec10: 4f 54 56 45 52 53 49 4f 4e 0a 09 20 20 20 20 56 OTVERSION.. V
ec20: 41 4c 55 45 20 22 50 72 6f 64 75 63 74 4e 61 6d ALUE "ProductNam
ec30: 65 22 2c 20 20 20 20 20 20 22 50 61 63 6b 61 67 e", "Packag
ec40: 65 20 22 20 50 52 4f 4a 45 43 54 20 22 20 66 6f e " PROJECT " fo
ec50: 72 20 54 63 6c 22 0a 09 20 20 20 20 56 41 4c 55 r Tcl".. VALU
ec60: 45 20 22 50 72 6f 64 75 63 74 56 65 72 73 69 6f E "ProductVersio
ec70: 6e 22 2c 20 20 20 44 4f 54 56 45 52 53 49 4f 4e n", DOTVERSION
ec80: 0a 09 45 4e 44 0a 20 20 20 20 45 4e 44 0a 20 20 ..END. END.
ec90: 20 20 42 4c 4f 43 4b 20 22 56 61 72 46 69 6c 65 BLOCK "VarFile
eca0: 49 6e 66 6f 22 0a 20 20 20 20 42 45 47 49 4e 0a Info". BEGIN.
ecb0: 09 56 41 4c 55 45 20 22 54 72 61 6e 73 6c 61 74 .VALUE "Translat
ecc0: 69 6f 6e 22 2c 20 30 78 34 30 39 2c 20 31 32 30 ion", 0x409, 120
ecd0: 30 0a 20 20 20 20 45 4e 44 0a 45 4e 44 0a 0a 3c 0. END.END..<
ece0: 3c 0a 0a 21 65 6e 64 69 66 20 23 20 69 66 64 65 <..!endif # ifde
ecf0: 66 20 52 43 46 49 4c 45 0a 0a 21 69 66 6e 64 65 f RCFILE..!ifnde
ed00: 66 20 44 49 53 41 42 4c 45 5f 49 4d 50 4c 49 43 f DISABLE_IMPLIC
ed10: 49 54 5f 52 55 4c 45 53 0a 44 49 53 41 42 4c 45 IT_RULES.DISABLE
ed20: 5f 49 4d 50 4c 49 43 49 54 5f 52 55 4c 45 53 20 _IMPLICIT_RULES
ed30: 3d 20 30 0a 21 65 6e 64 69 66 0a 0a 21 69 66 20 = 0.!endif..!if
ed40: 21 24 28 44 49 53 41 42 4c 45 5f 49 4d 50 4c 49 !$(DISABLE_IMPLI
ed50: 43 49 54 5f 52 55 4c 45 53 29 0a 23 20 49 6d 70 CIT_RULES).# Imp
ed60: 6c 69 63 69 74 20 72 75 6c 65 20 64 65 66 69 6e licit rule defin
ed70: 69 74 69 6f 6e 73 20 2d 20 6f 6e 6c 79 20 66 6f itions - only fo
ed80: 72 20 62 75 69 6c 64 69 6e 67 20 6c 69 62 72 61 r building libra
ed90: 72 79 20 6f 62 6a 65 63 74 73 2e 20 46 6f 72 20 ry objects. For
eda0: 73 74 75 62 73 20 61 6e 64 0a 23 20 6d 61 69 6e stubs and.# main
edb0: 20 61 70 70 6c 69 63 61 74 69 6f 6e 2c 20 74 68 application, th
edc0: 65 20 6d 61 6b 65 66 69 6c 65 20 73 68 6f 75 6c e makefile shoul
edd0: 64 20 64 65 66 69 6e 65 20 65 78 70 6c 69 63 69 d define explici
ede0: 74 20 72 75 6c 65 73 2e 0a 0a 7b 24 28 52 4f 4f t rules...{$(ROO
edf0: 54 29 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 T)}.c{$(TMP_DIR)
ee00: 7d 2e 6f 62 6a 3a 3a 0a 09 24 28 43 43 50 4b 47 }.obj::..$(CCPKG
ee10: 43 4d 44 29 20 40 3c 3c 0a 24 3c 0a 3c 3c 0a 0a CMD) @<<.$<.<<..
ee20: 7b 24 28 57 49 4e 5f 44 49 52 29 7d 2e 63 7b 24 {$(WIN_DIR)}.c{$
ee30: 28 54 4d 50 5f 44 49 52 29 7d 2e 6f 62 6a 3a 3a (TMP_DIR)}.obj::
ee40: 0a 09 24 28 43 43 50 4b 47 43 4d 44 29 20 40 3c ..$(CCPKGCMD) @<
ee50: 3c 0a 24 3c 0a 3c 3c 0a 0a 7b 24 28 47 45 4e 45 <.$<.<<..{$(GENE
ee60: 52 49 43 44 49 52 29 7d 2e 63 7b 24 28 54 4d 50 RICDIR)}.c{$(TMP
ee70: 5f 44 49 52 29 7d 2e 6f 62 6a 3a 3a 0a 09 24 28 _DIR)}.obj::..$(
ee80: 43 43 50 4b 47 43 4d 44 29 20 40 3c 3c 0a 24 3c CCPKGCMD) @<<.$<
ee90: 0a 3c 3c 0a 0a 7b 24 28 43 4f 4d 50 41 54 44 49 .<<..{$(COMPATDI
eea0: 52 29 7d 2e 63 7b 24 28 54 4d 50 5f 44 49 52 29 R)}.c{$(TMP_DIR)
eeb0: 7d 2e 6f 62 6a 3a 3a 0a 09 24 28 43 43 50 4b 47 }.obj::..$(CCPKG
eec0: 43 4d 44 29 20 40 3c 3c 0a 24 3c 0a 3c 3c 0a 0a CMD) @<<.$<.<<..
eed0: 7b 24 28 52 43 44 49 52 29 7d 2e 72 63 7b 24 28 {$(RCDIR)}.rc{$(
eee0: 54 4d 50 5f 44 49 52 29 7d 2e 72 65 73 3a 0a 09 TMP_DIR)}.res:..
eef0: 24 28 52 45 53 43 4d 44 29 20 24 3c 0a 0a 7b 24 $(RESCMD) $<..{$
ef00: 28 57 49 4e 5f 44 49 52 29 7d 2e 72 63 7b 24 28 (WIN_DIR)}.rc{$(
ef10: 54 4d 50 5f 44 49 52 29 7d 2e 72 65 73 3a 0a 09 TMP_DIR)}.res:..
ef20: 24 28 52 45 53 43 4d 44 29 20 24 3c 0a 0a 7b 24 $(RESCMD) $<..{$
ef30: 28 54 4d 50 5f 44 49 52 29 7d 2e 72 63 7b 24 28 (TMP_DIR)}.rc{$(
ef40: 54 4d 50 5f 44 49 52 29 7d 2e 72 65 73 3a 0a 09 TMP_DIR)}.res:..
ef50: 24 28 52 45 53 43 4d 44 29 20 24 3c 0a 0a 2e 53 $(RESCMD) $<...S
ef60: 55 46 46 49 58 45 53 3a 0a 2e 53 55 46 46 49 58 UFFIXES:..SUFFIX
ef70: 45 53 3a 2e 63 20 2e 72 63 0a 0a 21 65 6e 64 69 ES:.c .rc..!endi
ef80: 66 0a 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 f..#############
ef90: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
efa0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
efb0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
efc0: 23 23 23 0a 23 20 31 34 2e 20 53 61 6e 69 74 79 ###.# 14. Sanity
efd0: 20 63 68 65 63 6b 20 73 65 6c 65 63 74 65 64 20 check selected
efe0: 6f 70 74 69 6f 6e 73 20 61 67 61 69 6e 73 74 20 options against
eff0: 54 63 6c 20 62 75 69 6c 64 20 6f 70 74 69 6f 6e Tcl build option
f000: 73 0a 23 20 57 68 65 6e 20 62 75 69 6c 64 69 6e s.# When buildin
f010: 67 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e 2c 20 g an extension,
f020: 63 65 72 74 61 69 6e 20 63 6f 6e 66 69 67 75 72 certain configur
f030: 61 74 69 6f 6e 20 6f 70 74 69 6f 6e 73 20 73 68 ation options sh
f040: 6f 75 6c 64 0a 23 20 6d 61 74 63 68 20 74 68 65 ould.# match the
f050: 20 6f 6e 65 73 20 75 73 65 64 20 77 68 65 6e 20 ones used when
f060: 54 63 6c 20 77 61 73 20 62 75 69 6c 74 2e 20 48 Tcl was built. H
f070: 65 72 65 20 77 65 20 63 68 65 63 6b 20 61 6e 64 ere we check and
f080: 0a 23 20 77 61 72 6e 20 6f 6e 20 61 20 6d 69 73 .# warn on a mis
f090: 6d 61 74 63 68 2e 0a 21 69 66 20 21 24 28 44 4f match..!if !$(DO
f0a0: 49 4e 47 5f 54 43 4c 29 0a 0a 21 69 66 20 24 28 ING_TCL)..!if $(
f0b0: 54 43 4c 49 4e 53 54 41 4c 4c 29 20 23 20 42 75 TCLINSTALL) # Bu
f0c0: 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 61 ilding against a
f0d0: 6e 20 69 6e 73 74 61 6c 6c 65 64 20 54 63 6c 0a n installed Tcl.
f0e0: 21 69 66 20 65 78 69 73 74 28 22 24 28 5f 54 43 !if exist("$(_TC
f0f0: 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d 61 6b 65 5c LDIR)\lib\nmake\
f100: 74 63 6c 2e 6e 6d 61 6b 65 22 29 0a 54 43 4c 4e tcl.nmake").TCLN
f110: 4d 41 4b 45 43 4f 4e 46 49 47 20 3d 20 22 24 28 MAKECONFIG = "$(
f120: 5f 54 43 4c 44 49 52 29 5c 6c 69 62 5c 6e 6d 61 _TCLDIR)\lib\nma
f130: 6b 65 5c 74 63 6c 2e 6e 6d 61 6b 65 22 0a 21 65 ke\tcl.nmake".!e
f140: 6e 64 69 66 0a 21 65 6c 73 65 20 23 20 21 24 28 ndif.!else # !$(
f150: 54 43 4c 49 4e 53 54 41 4c 4c 29 20 2d 20 62 75 TCLINSTALL) - bu
f160: 69 6c 64 69 6e 67 20 61 67 61 69 6e 73 74 20 54 ilding against T
f170: 63 6c 20 73 6f 75 72 63 65 0a 21 69 66 20 65 78 cl source.!if ex
f180: 69 73 74 28 22 24 28 5f 54 43 4c 44 49 52 29 5c ist("$(_TCLDIR)\
f190: 77 69 6e 5c 24 28 42 55 49 4c 44 44 49 52 54 4f win\$(BUILDDIRTO
f1a0: 50 29 5c 74 63 6c 2e 6e 6d 61 6b 65 22 29 0a 54 P)\tcl.nmake").T
f1b0: 43 4c 4e 4d 41 4b 45 43 4f 4e 46 49 47 09 3d 20 CLNMAKECONFIG.=
f1c0: 22 24 28 5f 54 43 4c 44 49 52 29 5c 77 69 6e 5c "$(_TCLDIR)\win\
f1d0: 24 28 42 55 49 4c 44 44 49 52 54 4f 50 29 5c 74 $(BUILDDIRTOP)\t
f1e0: 63 6c 2e 6e 6d 61 6b 65 22 0a 21 65 6e 64 69 66 cl.nmake".!endif
f1f0: 0a 21 65 6e 64 69 66 20 23 20 54 43 4c 49 4e 53 .!endif # TCLINS
f200: 54 41 4c 4c 0a 0a 21 69 66 20 24 28 43 4f 4e 46 TALL..!if $(CONF
f210: 49 47 5f 43 48 45 43 4b 29 0a 21 69 66 64 65 66 IG_CHECK).!ifdef
f220: 20 54 43 4c 4e 4d 41 4b 45 43 4f 4e 46 49 47 0a TCLNMAKECONFIG.
f230: 21 69 6e 63 6c 75 64 65 20 24 28 54 43 4c 4e 4d !include $(TCLNM
f240: 41 4b 45 43 4f 4e 46 49 47 29 0a 0a 21 69 66 20 AKECONFIG)..!if
f250: 64 65 66 69 6e 65 64 28 43 4f 52 45 5f 4d 41 43 defined(CORE_MAC
f260: 48 49 4e 45 29 20 26 26 20 22 24 28 43 4f 52 45 HINE) && "$(CORE
f270: 5f 4d 41 43 48 49 4e 45 29 22 20 21 3d 20 22 24 _MACHINE)" != "$
f280: 28 4d 41 43 48 49 4e 45 29 22 0a 21 65 72 72 6f (MACHINE)".!erro
f290: 72 20 45 52 52 4f 52 3a 20 42 75 69 6c 64 20 74 r ERROR: Build t
f2a0: 61 72 67 65 74 20 28 24 28 4d 41 43 48 49 4e 45 arget ($(MACHINE
f2b0: 29 29 20 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 )) does not matc
f2c0: 68 20 74 68 65 20 54 63 6c 20 6c 69 62 72 61 72 h the Tcl librar
f2d0: 79 20 61 72 63 68 69 74 65 63 74 75 72 65 20 28 y architecture (
f2e0: 24 28 43 4f 52 45 5f 4d 41 43 48 49 4e 45 29 29 $(CORE_MACHINE))
f2f0: 2e 0a 21 65 6e 64 69 66 0a 21 69 66 20 24 28 54 ..!endif.!if $(T
f300: 43 4c 5f 56 45 52 53 49 4f 4e 29 20 3c 20 38 37 CL_VERSION) < 87
f310: 20 26 26 20 64 65 66 69 6e 65 64 28 43 4f 52 45 && defined(CORE
f320: 5f 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f _USE_THREAD_ALLO
f330: 43 29 20 26 26 20 24 28 43 4f 52 45 5f 55 53 45 C) && $(CORE_USE
f340: 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 29 20 21 _THREAD_ALLOC) !
f350: 3d 20 24 28 55 53 45 5f 54 48 52 45 41 44 5f 41 = $(USE_THREAD_A
f360: 4c 4c 4f 43 29 0a 21 6d 65 73 73 61 67 65 20 57 LLOC).!message W
f370: 41 52 4e 49 4e 47 3a 20 56 61 6c 75 65 20 6f 66 ARNING: Value of
f380: 20 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f USE_THREAD_ALLO
f390: 43 20 28 24 28 55 53 45 5f 54 48 52 45 41 44 5f C ($(USE_THREAD_
f3a0: 41 4c 4c 4f 43 29 29 20 64 6f 65 73 20 6e 6f 74 ALLOC)) does not
f3b0: 20 6d 61 74 63 68 20 69 74 73 20 54 63 6c 20 63 match its Tcl c
f3c0: 6f 72 65 20 76 61 6c 75 65 20 28 24 28 43 4f 52 ore value ($(COR
f3d0: 45 5f 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c E_USE_THREAD_ALL
f3e0: 4f 43 29 29 2e 0a 21 65 6e 64 69 66 0a 21 69 66 OC))..!endif.!if
f3f0: 20 64 65 66 69 6e 65 64 28 43 4f 52 45 5f 44 45 defined(CORE_DE
f400: 42 55 47 29 20 26 26 20 24 28 43 4f 52 45 5f 44 BUG) && $(CORE_D
f410: 45 42 55 47 29 20 21 3d 20 24 28 44 45 42 55 47 EBUG) != $(DEBUG
f420: 29 0a 21 6d 65 73 73 61 67 65 20 57 41 52 4e 49 ).!message WARNI
f430: 4e 47 3a 20 56 61 6c 75 65 20 6f 66 20 44 45 42 NG: Value of DEB
f440: 55 47 20 28 24 28 44 45 42 55 47 29 29 20 64 6f UG ($(DEBUG)) do
f450: 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 69 74 73 es not match its
f460: 20 54 63 6c 20 6c 69 62 72 61 72 79 20 63 6f 6e Tcl library con
f470: 66 69 67 75 72 61 74 69 6f 6e 20 28 24 28 44 45 figuration ($(DE
f480: 42 55 47 29 29 2e 0a 21 65 6e 64 69 66 0a 21 65 BUG))..!endif.!e
f490: 6e 64 69 66 0a 0a 21 65 6e 64 69 66 20 23 20 54 ndif..!endif # T
f4a0: 43 4c 4e 4d 41 4b 45 43 4f 4e 46 49 47 0a 0a 21 CLNMAKECONFIG..!
f4b0: 65 6e 64 69 66 20 23 20 21 24 28 44 4f 49 4e 47 endif # !$(DOING
f4c0: 5f 54 43 4c 29 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d _TCL)...#-------
f4d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
f4e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
f4f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
f500: 2d 2d 2d 0a 23 20 44 69 73 70 6c 61 79 20 73 74 ---.# Display st
f510: 61 74 73 20 62 65 69 6e 67 20 75 73 65 64 2e 0a ats being used..
f520: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d #---------------
f530: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
f540: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
f550: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 21 69 66 -----------..!if
f560: 20 24 28 56 45 52 42 4f 53 45 29 0a 21 69 66 20 $(VERBOSE).!if
f570: 21 24 28 44 4f 49 4e 47 5f 54 43 4c 29 0a 21 6d !$(DOING_TCL).!m
f580: 65 73 73 61 67 65 20 2a 2a 2a 20 42 75 69 6c 64 essage *** Build
f590: 69 6e 67 20 61 67 61 69 6e 73 74 20 54 63 6c 20 ing against Tcl
f5a0: 61 74 20 27 24 28 5f 54 43 4c 44 49 52 29 27 0a at '$(_TCLDIR)'.
f5b0: 21 65 6e 64 69 66 0a 21 69 66 20 21 24 28 44 4f !endif.!if !$(DO
f5c0: 49 4e 47 5f 54 4b 29 20 26 26 20 24 28 4e 45 45 ING_TK) && $(NEE
f5d0: 44 5f 54 4b 29 0a 21 6d 65 73 73 61 67 65 20 2a D_TK).!message *
f5e0: 2a 2a 20 42 75 69 6c 64 69 6e 67 20 61 67 61 69 ** Building agai
f5f0: 6e 73 74 20 54 6b 20 61 74 20 27 24 28 5f 54 4b nst Tk at '$(_TK
f600: 44 49 52 29 27 0a 21 65 6e 64 69 66 0a 21 6d 65 DIR)'.!endif.!me
f610: 73 73 61 67 65 20 2a 2a 2a 20 49 6e 74 65 72 6d ssage *** Interm
f620: 65 64 69 61 74 65 20 64 69 72 65 63 74 6f 72 79 ediate directory
f630: 20 77 69 6c 6c 20 62 65 20 27 24 28 54 4d 50 5f will be '$(TMP_
f640: 44 49 52 29 27 0a 21 6d 65 73 73 61 67 65 20 2a DIR)'.!message *
f650: 2a 2a 20 4f 75 74 70 75 74 20 64 69 72 65 63 74 ** Output direct
f660: 6f 72 79 20 77 69 6c 6c 20 62 65 20 27 24 28 4f ory will be '$(O
f670: 55 54 5f 44 49 52 29 27 0a 21 6d 65 73 73 61 67 UT_DIR)'.!messag
f680: 65 20 2a 2a 2a 20 49 6e 73 74 61 6c 6c 61 74 69 e *** Installati
f690: 6f 6e 2c 20 69 66 20 73 65 6c 65 63 74 65 64 2c on, if selected,
f6a0: 20 77 69 6c 6c 20 62 65 20 69 6e 20 27 24 28 5f will be in '$(_
f6b0: 49 4e 53 54 41 4c 4c 44 49 52 29 27 0a 21 6d 65 INSTALLDIR)'.!me
f6c0: 73 73 61 67 65 20 2a 2a 2a 20 53 75 66 66 69 78 ssage *** Suffix
f6d0: 20 66 6f 72 20 62 69 6e 61 72 69 65 73 20 77 69 for binaries wi
f6e0: 6c 6c 20 62 65 20 27 24 28 53 55 46 58 29 27 0a ll be '$(SUFX)'.
f6f0: 21 6d 65 73 73 61 67 65 20 2a 2a 2a 20 43 6f 6d !message *** Com
f700: 70 69 6c 65 72 20 76 65 72 73 69 6f 6e 20 24 28 piler version $(
f710: 56 43 56 45 52 29 2e 20 54 61 72 67 65 74 20 24 VCVER). Target $
f720: 28 4d 41 43 48 49 4e 45 29 2c 20 68 6f 73 74 20 (MACHINE), host
f730: 24 28 4e 41 54 49 56 45 5f 41 52 43 48 29 2e 0a $(NATIVE_ARCH)..
f740: 21 65 6e 64 69 66 0a 0a 21 65 6e 64 69 66 20 23 !endif..!endif #
f750: 20 69 66 64 65 66 20 5f 52 55 4c 45 53 5f 56 43 ifdef _RULES_VC
f760: 0a .