1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
-
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
-
+
|
CC = @CC@
AR = @AR@
RANLIB = @RANLIB@
CFLAGS = @CFLAGS@ @SHOBJFLAGS@
CPPFLAGS = @CPPFLAGS@ -I@srcdir@ -I. @DEFS@ @TCL_DEFS@
LDFLAGS = @LDFLAGS@ @SHOBJLDFLAGS@
LIBS = @LIBS@
INSTALL = @INSTALL@
PACKAGE_VERSION = @PACKAGE_VERSION@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
PACKAGE_INSTALL_DIR = $(TCL_PACKAGE_PATH)/tcltls$(PACKAGE_VERSION)
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
VPATH = @srcdir@
all: @EXTENSION_TARGET@
# The shared object target
tcltls.@SHOBJEXT@: tls.o tls_@TCLTLS_SSL_LIB@_bio.o tlsIO.o tlsX509.o Makefile
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o tcltls.@SHOBJEXT@ tls.o tls_@TCLTLS_SSL_LIB@_bio.o tlsIO.o tlsX509.o $(LIBS)
# The static target
tcltls.@AREXT@: tls.o tls_@TCLTLS_SSL_LIB@_bio.o tlsIO.o tlsX509.o Makefile
$(AR) rcu tcltls.a.new tls.o tls_@TCLTLS_SSL_LIB@_bio.o tlsIO.o tlsX509.o
$(RANLIB) tcltls.a.new
mv tcltls.a.new tcltls.a
# Dependencies for all our targets
tls.o: @srcdir@/tls.c @srcdir@/tlsInt.h @srcdir@/tclOpts.h @srcdir@/tls.tcl.h dh_params.h Makefile
tls.o: @srcdir@/tls.c @srcdir@/tlsInt.h @srcdir@/tclOpts.h tls.tcl.h dh_params.h Makefile
tls_openssl_bio.o: @srcdir@/tls_openssl_bio.c @srcdir@/tlsInt.h Makefile
tlsIO.o: @srcdir@/tlsIO.c @srcdir@/tlsInt.h Makefile
tlsX509.o: @srcdir@/tlsX509.c @srcdir@/tlsInt.h Makefile
# Create a C-source-ified version of the script resources
# for TclTLS so that we only need a single file to enable
# this extension
@srcdir@/tls.tcl.h: @srcdir@/tls.tcl
@XXD@ -i < '@srcdir@/tls.tcl' > '@srcdir@/tls.tcl.h.new'
mv '@srcdir@/tls.tcl.h.new' '@srcdir@/tls.tcl.h'
tls.tcl.h: @srcdir@/tls.tcl Makefile
od -A n -v -t xC < '@srcdir@/tls.tcl' > tls.tcl.h.new.1
sed 's@ *@@g;s@..@0x&, @g' < tls.tcl.h.new.1 > tls.tcl.h.new.2
rm -f tls.tcl.h.new.1
mv tls.tcl.h.new.2 tls.tcl.h
# Create default DH parameters
dh_params.h: @srcdir@/gen_dh_params Makefile
@srcdir@/gen_dh_params @GEN_DH_PARAMS_ARGS@ > dh_params.h.new
mv dh_params.h.new dh_params.h
# Generic target for building files from the "srcdir"
# tree -- the default target will not match paths
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -o "$@" -c "$<"
# Install the extension
install: @EXTENSION_TARGET@ pkgIndex.tcl
$(INSTALL) -d '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
$(INSTALL_PROGRAM) @EXTENSION_TARGET@ '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
$(INSTALL_DATA) pkgIndex.tcl '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
# A convienent helper to undo the installation just done
uninstall:
rm -f '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/@EXTENSION_TARGET@'
rm -f '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/pkgIndex.tcl'
$(INSTALL) -t '$(DESTDIR)$(PACKAGE_INSTALL_DIR)' @EXTENSION_TARGET@ pkgIndex.tcl
-rmdir '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
# Test target, run the automated test suite
test: @EXTENSION_TARGET@
@TCLSH_PROG@ @srcdir@/tests/all.tcl $(TESTFLAGS) -load "lappend auto_path $(shell pwd)"
# Clean the local build directory for rebuild against the same configuration
clean:
rm -f tls.o tls_openssl_bio.o tlsIO.o tlsX509.o
rm -f tcltls.@SHOBJEXT@
rm -f tcltls.@[email protected] tcltls.@[email protected]
rm -f tcltls.a.new tcltls.a
rm -f tls.tcl.h tls.tcl.h.new.1 tls.tcl.h.new.2
# Clean the local build directory back to what it was after unpacking the
# distribution tarball
distclean: clean
rm -f config.log config.status
rm -f dh_params.h.new dh_params.h
rm -f Makefile pkgIndex.tcl
rm -f tcltls.a.linkadd
# Clean the local build directory back to only thing things that exist in
# version control system
mrproper: distclean
rm -f @srcdir@/tls.tcl.h
rm -f @srcdir@/configure @srcdir@/config.sub @srcdir@/config.guess @srcdir@/install-sh
rm -f @srcdir@/aclocal.m4
rm -rf @srcdir@/autom4te.cache
.PHONY: all install clean distclean mrproper
.PHONY: all install uninstall clean distclean mrproper test
|