Hex Artifact Content

Artifact 75e334f0918ab0e16b131ed35e700c9b2733d9dacb7006e4df61c7d64748ff5e:


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 0a 23 20 4d 61 6b 65 66 69 6c 65 20 66 6f 72  #.# Makefile for
0060: 20 54 63 6c 54 4c 53 20 65 78 74 65 6e 73 69 6f   TclTLS extensio
0070: 6e 73 2e 0a 23 0a 23 20 42 61 73 69 63 20 62 75  ns..#.# Basic bu
0080: 69 6c 64 2c 20 74 65 73 74 20 61 6e 64 20 69 6e  ild, test and in
0090: 73 74 61 6c 6c 0a 23 20 20 20 6e 6d 61 6b 65 20  stall.#   nmake 
00a0: 2f 66 20 6d 61 6b 65 66 69 6c 65 2e 76 63 20 49  /f makefile.vc I
00b0: 4e 53 54 41 4c 4c 44 49 52 3d 63 3a 5c 70 61 74  NSTALLDIR=c:\pat
00c0: 68 5c 74 6f 5c 74 63 6c 0a 23 20 20 20 6e 6d 61  h\to\tcl.#   nma
00d0: 6b 65 20 2f 66 20 6d 61 6b 65 66 69 6c 65 2e 76  ke /f makefile.v
00e0: 63 20 49 4e 53 54 41 4c 4c 44 49 52 3d 63 3a 5c  c INSTALLDIR=c:\
00f0: 70 61 74 68 5c 74 6f 5c 74 63 6c 20 74 65 73 74  path\to\tcl test
0100: 0a 23 20 20 20 6e 6d 61 6b 65 20 2f 66 20 6d 61  .#   nmake /f ma
0110: 6b 65 66 69 6c 65 2e 76 63 20 49 4e 53 54 41 4c  kefile.vc INSTAL
0120: 4c 44 49 52 3d 63 3a 5c 70 61 74 68 5c 74 6f 5c  LDIR=c:\path\to\
0130: 74 63 6c 20 69 6e 73 74 61 6c 6c 0a 23 0a 23 20  tcl install.#.# 
0140: 46 6f 72 20 6f 74 68 65 72 20 62 75 69 6c 64 20  For other build 
0150: 6f 70 74 69 6f 6e 73 20 28 64 65 62 75 67 2c 20  options (debug, 
0160: 73 74 61 74 69 63 20 65 74 63 2e 29 2c 0a 23 20  static etc.),.# 
0170: 53 65 65 20 54 49 50 20 34 37 37 20 28 68 74 74  See TIP 477 (htt
0180: 70 73 3a 2f 2f 63 6f 72 65 2e 74 63 6c 2d 6c 61  ps://core.tcl-la
0190: 6e 67 2e 6f 72 67 2f 74 69 70 73 2f 64 6f 63 2f  ng.org/tips/doc/
01a0: 6d 61 69 6e 2f 74 69 70 2f 34 37 37 2e 6d 64 29  main/tip/477.md)
01b0: 20 66 6f 72 0a 23 20 64 65 74 61 69 6c 65 64 20   for.# detailed 
01c0: 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 0a 23  documentation..#
01d0: 0a 23 20 53 65 65 20 74 68 65 20 66 69 6c 65 20  .# See the file 
01e0: 22 6c 69 63 65 6e 73 65 2e 74 65 72 6d 73 22 20  "license.terms" 
01f0: 66 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20  for information 
0200: 6f 6e 20 75 73 61 67 65 20 61 6e 64 20 72 65 64  on usage and red
0210: 69 73 74 72 69 62 75 74 69 6f 6e 0a 23 20 6f 66  istribution.# of
0220: 20 74 68 69 73 20 66 69 6c 65 2c 20 61 6e 64 20   this file, and 
0230: 66 6f 72 20 61 20 44 49 53 43 4c 41 49 4d 45 52  for a DISCLAIMER
0240: 20 4f 46 20 41 4c 4c 20 57 41 52 52 41 4e 54 49   OF ALL WARRANTI
0250: 45 53 2e 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ES..#.#---------
0260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0280: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0290: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
02a0: 2d 2d 2d 2d 2d 0a 0a 23 20 54 68 65 20 6e 61 6d  -----..# The nam
02b0: 65 20 6f 66 20 74 68 65 20 70 61 63 6b 61 67 65  e of the package
02c0: 0a 50 52 4f 4a 45 43 54 3d 74 6c 73 0a 0a 21 69  .PROJECT=tls..!i
02d0: 6e 63 6c 75 64 65 20 22 72 75 6c 65 73 2d 65 78  nclude "rules-ex
02e0: 74 2e 76 63 22 0a 0a 23 20 44 65 66 69 6e 65 20  t.vc"..# Define 
02f0: 74 68 65 20 6f 62 6a 65 63 74 20 66 69 6c 65 73  the object files
0300: 20 61 6e 64 20 72 65 73 6f 75 72 63 65 20 66 69   and resource fi
0310: 6c 65 20 74 68 61 74 20 6d 61 6b 65 20 75 70 20  le that make up 
0320: 74 68 65 20 65 78 74 65 6e 73 69 6f 6e 2e 0a 23  the extension..#
0330: 20 4e 6f 74 65 20 74 68 65 20 72 65 73 6f 75 72   Note the resour
0340: 63 65 20 66 69 6c 65 20 64 6f 65 73 20 6e 6f 74  ce file does not
0350: 20 6d 61 6b 65 73 20 73 65 6e 73 65 20 69 66 20   makes sense if 
0360: 64 6f 69 6e 67 20 61 20 73 74 61 74 69 63 20 6c  doing a static l
0370: 69 62 72 61 72 79 20 62 75 69 6c 64 0a 23 20 68  ibrary build.# h
0380: 65 6e 63 65 20 69 74 20 69 73 20 75 6e 64 65 72  ence it is under
0390: 20 74 68 61 74 20 63 6f 6e 64 69 74 69 6f 6e 2e   that condition.
03a0: 20 54 4d 50 5f 44 49 52 20 69 73 20 74 68 65 20   TMP_DIR is the 
03b0: 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f 72 79  output directory
03c0: 0a 23 20 64 65 66 69 6e 65 64 20 62 79 20 72 75  .# defined by ru
03d0: 6c 65 73 20 66 6f 72 20 6f 62 6a 65 63 74 20 66  les for object f
03e0: 69 6c 65 73 2e 0a 50 52 4a 5f 4f 42 4a 53 20 3d  iles..PRJ_OBJS =
03f0: 20 24 28 54 4d 50 5f 44 49 52 29 5c 74 6c 73 2e   $(TMP_DIR)\tls.
0400: 6f 62 6a 20 5c 0a 09 24 28 54 4d 50 5f 44 49 52  obj \..$(TMP_DIR
0410: 29 5c 74 6c 73 42 49 4f 2e 6f 62 6a 20 5c 0a 09  )\tlsBIO.obj \..
0420: 24 28 54 4d 50 5f 44 49 52 29 5c 74 6c 73 44 69  $(TMP_DIR)\tlsDi
0430: 67 65 73 74 2e 6f 62 6a 20 5c 0a 09 24 28 54 4d  gest.obj \..$(TM
0440: 50 5f 44 49 52 29 5c 74 6c 73 45 6e 63 72 79 70  P_DIR)\tlsEncryp
0450: 74 2e 6f 62 6a 20 5c 0a 09 24 28 54 4d 50 5f 44  t.obj \..$(TMP_D
0460: 49 52 29 5c 74 6c 73 49 6e 66 6f 2e 6f 62 6a 20  IR)\tlsInfo.obj 
0470: 5c 0a 09 24 28 54 4d 50 5f 44 49 52 29 5c 74 6c  \..$(TMP_DIR)\tl
0480: 73 49 4f 2e 6f 62 6a 20 5c 0a 09 24 28 54 4d 50  sIO.obj \..$(TMP
0490: 5f 44 49 52 29 5c 74 6c 73 4b 44 46 2e 6f 62 6a  _DIR)\tlsKDF.obj
04a0: 20 5c 0a 09 24 28 54 4d 50 5f 44 49 52 29 5c 74   \..$(TMP_DIR)\t
04b0: 6c 73 52 61 6e 64 2e 6f 62 6a 20 5c 0a 09 24 28  lsRand.obj \..$(
04c0: 54 4d 50 5f 44 49 52 29 5c 74 6c 73 55 74 69 6c  TMP_DIR)\tlsUtil
04d0: 2e 6f 62 6a 20 5c 0a 09 24 28 54 4d 50 5f 44 49  .obj \..$(TMP_DI
04e0: 52 29 5c 74 6c 73 58 35 30 39 2e 6f 62 6a 0a 0a  R)\tlsX509.obj..
04f0: 23 20 44 65 66 69 6e 65 20 61 6e 79 20 61 64 64  # Define any add
0500: 69 74 69 6f 6e 61 6c 20 70 72 6f 6a 65 63 74 20  itional project 
0510: 69 6e 63 6c 75 64 65 20 66 6c 61 67 73 0a 23 20  include flags.# 
0520: 53 53 4c 5f 49 4e 53 54 41 4c 4c 5f 46 4f 4c 44  SSL_INSTALL_FOLD
0530: 45 52 20 3d 20 77 69 74 68 20 74 68 65 20 4f 70  ER = with the Op
0540: 65 6e 53 53 4c 20 69 6e 73 74 61 6c 6c 61 74 69  enSSL installati
0550: 6f 6e 20 66 6f 6c 64 65 72 20 66 6f 6c 6c 6f 77  on folder follow
0560: 69 6e 67 2e 0a 50 52 4a 5f 49 4e 43 4c 55 44 45  ing..PRJ_INCLUDE
0570: 53 20 3d 20 2d 49 22 24 28 53 53 4c 5f 49 4e 53  S = -I"$(SSL_INS
0580: 54 41 4c 4c 5f 46 4f 4c 44 45 52 29 5c 69 6e 63  TALL_FOLDER)\inc
0590: 6c 75 64 65 22 20 2d 49 22 24 28 4f 50 45 4e 53  lude" -I"$(OPENS
05a0: 53 4c 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 5c  SL_INSTALL_DIR)\
05b0: 69 6e 63 6c 75 64 65 22 0a 0a 23 20 44 65 66 69  include"..# Defi
05c0: 6e 65 20 61 6e 79 20 61 64 64 69 74 69 6f 6e 61  ne any additiona
05d0: 6c 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73  l compiler flags
05e0: 20 74 68 61 74 20 6d 69 67 68 74 20 62 65 20 72   that might be r
05f0: 65 71 75 69 72 65 64 20 66 6f 72 20 74 68 65 20  equired for the 
0600: 70 72 6f 6a 65 63 74 0a 50 52 4a 5f 44 45 46 49  project.PRJ_DEFI
0610: 4e 45 53 20 3d 20 2d 44 20 4e 4f 5f 53 53 4c 32  NES = -D NO_SSL2
0620: 20 2d 44 20 4e 4f 5f 53 53 4c 33 20 2d 44 20 5f   -D NO_SSL3 -D _
0630: 43 52 54 5f 53 45 43 55 52 45 5f 4e 4f 5f 57 41  CRT_SECURE_NO_WA
0640: 52 4e 49 4e 47 53 0a 0a 23 0a 23 20 53 53 4c 20  RNINGS..#.# SSL 
0650: 4c 69 62 73 3a 0a 23 20 20 20 20 31 2e 20 24 7b  Libs:.#    1. ${
0660: 4c 49 42 43 52 59 50 54 4f 7d 2e 64 6c 6c 0a 23  LIBCRYPTO}.dll.#
0670: 20 20 20 20 32 2e 20 24 7b 4c 49 42 53 53 4c 7d      2. ${LIBSSL}
0680: 2e 64 6c 6c 0a 23 20 57 68 65 72 65 20 4c 49 42  .dll.# Where LIB
0690: 43 52 59 50 54 4f 20 28 23 31 2e 29 20 61 6e 64  CRYPTO (#1.) and
06a0: 20 4c 49 42 53 53 4c 20 28 23 32 2e 29 20 61 72   LIBSSL (#2.) ar
06b0: 65 20 64 65 66 69 6e 65 64 20 61 73 20 66 6f 6c  e defined as fol
06c0: 6c 6f 77 73 3a 0a 23 20 20 20 20 76 31 2e 31 3a  lows:.#    v1.1:
06d0: 20 6c 69 62 63 72 79 70 74 6f 2d 31 2e 31 2d 78   libcrypto-1.1-x
06e0: 36 34 2e 64 6c 6c 20 61 6e 64 20 6c 69 62 73 73  64.dll and libss
06f0: 6c 2d 31 2e 31 2d 78 36 34 2e 64 6c 6c 0a 23 20  l-1.1-x64.dll.# 
0700: 20 20 20 76 33 3a 20 6c 69 62 63 72 79 70 74 6f     v3: libcrypto
0710: 2d 33 2d 78 36 34 2e 64 6c 6c 20 61 6e 64 20 6c  -3-x64.dll and l
0720: 69 62 73 73 6c 2d 33 2d 78 36 34 2e 64 6c 6c 0a  ibssl-3-x64.dll.
0730: 23 20 4f 6e 20 2a 6e 69 78 20 6c 69 62 63 72 79  # On *nix libcry
0740: 70 74 6f 2e 73 6f 2e 2a 20 61 6e 64 20 6c 69 62  pto.so.* and lib
0750: 73 73 6c 2e 73 6f 2e 2a 20 28 77 68 65 72 65 20  ssl.so.* (where 
0760: 73 75 66 66 69 78 20 69 73 20 61 20 76 65 72 73  suffix is a vers
0770: 69 6f 6e 20 69 6e 64 69 63 61 74 6f 72 29 2e 0a  ion indicator)..
0780: 23 0a 50 52 4a 5f 4c 49 42 53 20 3d 20 5c 0a 09  #.PRJ_LIBS = \..
0790: 22 24 28 53 53 4c 5f 49 4e 53 54 41 4c 4c 5f 46  "$(SSL_INSTALL_F
07a0: 4f 4c 44 45 52 29 5c 6c 69 62 5c 6c 69 62 73 73  OLDER)\lib\libss
07b0: 6c 2e 6c 69 62 22 20 5c 0a 09 22 24 28 53 53 4c  l.lib" \.."$(SSL
07c0: 5f 49 4e 53 54 41 4c 4c 5f 46 4f 4c 44 45 52 29  _INSTALL_FOLDER)
07d0: 5c 6c 69 62 5c 6c 69 62 63 72 79 70 74 6f 2e 6c  \lib\libcrypto.l
07e0: 69 62 22 20 5c 0a 09 57 53 32 5f 33 32 2e 4c 49  ib" \..WS2_32.LI
07f0: 42 20 47 44 49 33 32 2e 4c 49 42 20 41 44 56 41  B GDI32.LIB ADVA
0800: 50 49 33 32 2e 4c 49 42 20 43 52 59 50 54 33 32  PI32.LIB CRYPT32
0810: 2e 4c 49 42 20 55 53 45 52 33 32 2e 4c 49 42 0a  .LIB USER32.LIB.
0820: 0a 23 20 44 65 66 69 6e 65 20 74 68 65 20 73 74  .# Define the st
0830: 61 6e 64 61 72 64 20 74 61 72 67 65 74 73 0a 21  andard targets.!
0840: 69 6e 63 6c 75 64 65 20 22 74 61 72 67 65 74 73  include "targets
0850: 2e 76 63 22 0a 0a 23 20 50 72 6f 6a 65 63 74 20  .vc"..# Project 
0860: 73 70 65 63 69 66 69 63 20 74 61 72 67 65 74 73  specific targets
0870: 0a 0a 61 6c 6c 3a 0a 0a 63 6c 65 61 6e 3a 20 64  ..all:..clean: d
0880: 65 66 61 75 6c 74 2d 63 6c 65 61 6e 0a 0a 23 20  efault-clean..# 
0890: 57 65 20 6d 75 73 74 20 64 65 66 69 6e 65 20 61  We must define a
08a0: 20 70 6b 67 69 6e 64 65 78 20 74 61 72 67 65 74   pkgindex target
08b0: 20 74 68 61 74 20 77 69 6c 6c 20 63 72 65 61 74   that will creat
08c0: 65 20 61 20 70 6b 67 49 6e 64 65 78 2e 74 63 6c  e a pkgIndex.tcl
08d0: 0a 23 20 66 69 6c 65 20 69 6e 20 74 68 65 20 24  .# file in the $
08e0: 28 4f 55 54 5f 44 49 52 29 20 64 69 72 65 63 74  (OUT_DIR) direct
08f0: 6f 72 79 2e 20 57 65 20 63 61 6e 20 6a 75 73 74  ory. We can just
0900: 20 72 65 64 69 72 65 63 74 20 74 6f 20 74 68 65   redirect to the
0910: 0a 23 20 64 65 66 61 75 6c 74 2d 70 6b 67 69 6e  .# default-pkgin
0920: 64 65 78 20 74 61 72 67 65 74 20 66 6f 72 20 6f  dex target for o
0930: 75 72 20 73 61 6d 70 6c 65 20 65 78 74 65 6e 73  ur sample extens
0940: 69 6f 6e 2e 0a 70 6b 67 69 6e 64 65 78 3a 20 64  ion..pkgindex: d
0950: 65 66 61 75 6c 74 2d 70 6b 67 69 6e 64 65 78 0a  efault-pkgindex.
0960: 0a 23 20 54 68 65 20 64 65 66 61 75 6c 74 20 69  .# The default i
0970: 6e 73 74 61 6c 6c 20 74 61 72 67 65 74 20 6f 6e  nstall target on
0980: 6c 79 20 69 6e 73 74 61 6c 6c 73 20 62 69 6e 61  ly installs bina
0990: 72 69 65 73 20 61 6e 64 20 73 63 72 69 70 74 73  ries and scripts
09a0: 20 73 6f 20 61 64 64 0a 23 20 61 6e 20 61 64 64   so add.# an add
09b0: 69 74 69 6f 6e 61 6c 20 74 61 72 67 65 74 20 66  itional target f
09c0: 6f 72 20 6f 75 72 20 64 6f 63 75 6d 65 6e 74 61  or our documenta
09d0: 74 69 6f 6e 2e 20 4e 6f 74 65 20 74 68 69 73 20  tion. Note this 
09e0: 2a 61 64 64 73 2a 20 61 20 74 61 72 67 65 74 0a  *adds* a target.
09f0: 23 20 73 69 6e 63 65 20 6e 6f 20 63 6f 6d 6d 61  # since no comma
0a00: 6e 64 73 20 61 72 65 20 6c 69 73 74 65 64 20 61  nds are listed a
0a10: 66 74 65 72 20 69 74 2e 20 54 68 65 20 6f 72 69  fter it. The ori
0a20: 67 69 6e 61 6c 20 74 61 72 67 65 74 73 20 66 6f  ginal targets fo
0a30: 72 0a 23 20 69 6e 73 74 61 6c 6c 20 28 66 72 6f  r.# install (fro
0a40: 6d 20 74 61 72 67 65 74 73 2e 76 63 29 20 77 69  m targets.vc) wi
0a50: 6c 6c 20 72 65 6d 61 69 6e 2e 0a 69 6e 73 74 61  ll remain..insta
0a60: 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 70 6b 67 69  ll: default-pkgi
0a70: 6e 64 65 78 2d 74 65 61 20 64 65 66 61 75 6c 74  ndex-tea default
0a80: 2d 69 6e 73 74 61 6c 6c 20 64 65 66 61 75 6c 74  -install default
0a90: 2d 69 6e 73 74 61 6c 6c 2d 64 6f 63 73 2d 68 74  -install-docs-ht
0aa0: 6d 6c 0a 0a 23 20 54 65 73 74 20 70 61 63 6b 61  ml..# Test packa
0ab0: 67 65 0a 74 65 73 74 3a 20 64 65 66 61 75 6c 74  ge.test: default
0ac0: 2d 74 65 73 74 0a                                -test.