1#
2# This file is a Makefile for Tcl.  If it has the name "Makefile.in"
3# then it is a template for a Makefile;  to generate the actual Makefile,
4# run "./configure", which is a configuration script generated by the
5# "autoconf" program (constructs like "@foo@" will get replaced in the
6# actual Makefile.
7#
8# RCS: @(#) $Id: Makefile.in,v 1.121.2.25 2008/02/27 22:45:31 das Exp $
9
10VERSION 		= @TCL_VERSION@
11MAJOR_VERSION		= @TCL_MAJOR_VERSION@
12MINOR_VERSION		= @TCL_MINOR_VERSION@
13PATCH_LEVEL		= @TCL_PATCH_LEVEL@
14
15#----------------------------------------------------------------
16# Things you can change to personalize the Makefile for your own
17# site (you can make these changes in either Makefile.in or
18# Makefile, but changes to Makefile will get lost if you re-run
19# the configuration script).
20#----------------------------------------------------------------
21
22# Default top-level directories in which to install architecture-
23# specific files (exec_prefix) and machine-independent files such
24# as scripts (prefix).  The values specified here may be overridden
25# at configure-time with the --exec-prefix and --prefix options
26# to the "configure" script.  The *dir vars are standard configure
27# substitutions that are based off prefix and exec_prefix.
28
29prefix			= @prefix@
30exec_prefix		= @exec_prefix@
31bindir			= @bindir@
32libdir			= @libdir@
33includedir		= @includedir@
34mandir			= @mandir@
35
36# The following definition can be set to non-null for special systems
37# like AFS with replication.  It allows the pathnames used for installation
38# to be different than those used for actually reference files at
39# run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
40# when installing files.
41INSTALL_ROOT		= $(DESTDIR)
42
43# Path for the platform independent Tcl scripting libraries:
44TCL_LIBRARY		= @TCL_LIBRARY@
45
46# Path to use at runtime to refer to LIB_INSTALL_DIR:
47LIB_RUNTIME_DIR		= $(libdir)
48
49# Directory in which to install the program tclsh:
50BIN_INSTALL_DIR		= $(INSTALL_ROOT)$(bindir)
51
52# Directory in which to install libtcl.so or libtcl.a:
53LIB_INSTALL_DIR		= $(INSTALL_ROOT)$(libdir)
54
55# Path name to use when installing library scripts.
56SCRIPT_INSTALL_DIR	= $(INSTALL_ROOT)$(TCL_LIBRARY)
57
58# Directory in which to install the include file tcl.h:
59INCLUDE_INSTALL_DIR	= $(INSTALL_ROOT)$(includedir)
60
61# Path to the private tcl header dir:
62PRIVATE_INCLUDE_DIR	= @PRIVATE_INCLUDE_DIR@
63
64# Directory in which to (optionally) install the private tcl headers:
65PRIVATE_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(PRIVATE_INCLUDE_DIR)
66
67# Top-level directory in which to install manual entries:
68MAN_INSTALL_DIR		= $(INSTALL_ROOT)$(mandir)
69
70# Directory in which to install manual entry for tclsh:
71MAN1_INSTALL_DIR	= $(MAN_INSTALL_DIR)/man1
72
73# Directory in which to install manual entries for Tcl's C library
74# procedures:
75MAN3_INSTALL_DIR	= $(MAN_INSTALL_DIR)/man3
76
77# Directory in which to install manual entries for the built-in
78# Tcl commands:
79MANN_INSTALL_DIR	= $(MAN_INSTALL_DIR)/mann
80
81# Path to the html documentation dir:
82HTML_DIR		= @HTML_DIR@
83
84# Directory in which to install html documentation:
85HTML_INSTALL_DIR	= $(INSTALL_ROOT)$(HTML_DIR)
86
87# Package search path.
88TCL_PACKAGE_PATH	= @TCL_PACKAGE_PATH@
89
90# Libraries built with optimization switches have this additional extension
91TCL_DBGX		= @TCL_DBGX@
92
93# warning flags
94CFLAGS_WARNING		= @CFLAGS_WARNING@
95
96# The default switches for optimization or debugging
97CFLAGS_DEBUG		= @CFLAGS_DEBUG@
98CFLAGS_OPTIMIZE		= @CFLAGS_OPTIMIZE@
99
100# To change the compiler switches, for example to change from optimization to
101# debugging symbols, change the following line:
102#CFLAGS			= $(CFLAGS_DEBUG)
103#CFLAGS			= $(CFLAGS_OPTIMIZE)
104#CFLAGS			= $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE)
105CFLAGS			= @CFLAGS_DEFAULT@ @CFLAGS@ -DTCL_DBGX=$(TCL_DBGX)
106
107# Flags to pass to the linker
108LDFLAGS_DEBUG		= @LDFLAGS_DEBUG@
109LDFLAGS_OPTIMIZE	= @LDFLAGS_OPTIMIZE@
110LDFLAGS			= @LDFLAGS_DEFAULT@ @LDFLAGS@
111
112# To disable ANSI-C procedure prototypes reverse the comment characters
113# on the following lines:
114PROTO_FLAGS		=
115#PROTO_FLAGS		= -DNO_PROTOTYPE
116
117# Mathematical functions like sin and atan2 are enabled for expressions
118# by default.  To disable them, reverse the comment characters on the
119# following pairs of lines:
120MATH_FLAGS		=
121#MATH_FLAGS		= -DTCL_NO_MATH
122MATH_LIBS		= @MATH_LIBS@
123#MATH_LIBS		=
124
125# If you use the setenv, putenv, or unsetenv procedures to modify
126# environment variables in your application and you'd like those
127# modifications to appear in the "env" Tcl variable, switch the
128# comments on the two lines below so that Tcl provides these
129# procedures instead of your standard C library.
130
131ENV_FLAGS =
132#ENV_FLAGS = -DTclSetEnv=setenv -DTcl_PutEnv=putenv -DTclUnsetEnv=unsetenv
133
134# To compile for non-UNIX systems (so that only the non-UNIX-specific
135# commands are available), reverse the comment characters on the
136# following pairs of lines.  In addition, you'll have to provide your
137# own replacement for the "panic" procedure (see panic.c for what
138# the current one does).
139GENERIC_FLAGS =
140#GENERIC_FLAGS = -DTCL_GENERIC_ONLY
141UNIX_OBJS = tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o \
142	tclUnixFile.o tclUnixPipe.o tclUnixSock.o \
143	tclUnixTime.o tclUnixInit.o tclUnixThrd.o \
144	tclUnixCompat.o
145#UNIX_OBJS =
146NOTIFY_OBJS = tclUnixNotfy.o
147#NOTIFY_OBJS =
148
149# To enable memory debugging reverse the comment characters on the following
150# lines or call configure with --enable-symbols=mem
151# Warning:  if you enable memory debugging, you must do it *everywhere*,
152# including all the code that calls Tcl, and you must use ckalloc and
153# ckfree everywhere instead of malloc and free.
154MEM_DEBUG_FLAGS		=
155#MEM_DEBUG_FLAGS	= -DTCL_MEM_DEBUG
156
157TCL_STUB_LIB_FILE	= @TCL_STUB_LIB_FILE@
158#TCL_STUB_LIB_FILE	= libtclstub.a
159
160# Generic stub lib name used in rules that apply to tcl and tk
161STUB_LIB_FILE		= ${TCL_STUB_LIB_FILE}
162
163TCL_STUB_LIB_FLAG	= @TCL_STUB_LIB_FLAG@
164#TCL_STUB_LIB_FLAG	= -ltclstub
165
166# To enable compilation debugging reverse the comment characters on one
167# of the following lines or call configure with --enable-symbols=compile
168COMPILE_DEBUG_FLAGS	=
169#COMPILE_DEBUG_FLAGS	= -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
170
171# To compile without backward compatibility and deprecated code
172# uncomment the following
173NO_DEPRECATED_FLAGS	=
174#NO_DEPRECATED_FLAGS	= -DTCL_NO_DEPRECATED
175
176# Some versions of make, like SGI's, use the following variable to
177# determine which shell to use for executing commands:
178SHELL			= @MAKEFILE_SHELL@
179
180# Tcl used to let the configure script choose which program to use
181# for installing, but there are just too many different versions of
182# "install" around;  better to use the install-sh script that comes
183# with the distribution, which is slower but guaranteed to work.
184
185INSTALL_STRIP_PROGRAM   = -s
186INSTALL_STRIP_LIBRARY   = -S -S
187
188INSTALL			= @srcdir@/install-sh -c
189INSTALL_PROGRAM		= ${INSTALL}
190INSTALL_LIBRARY		= ${INSTALL}
191INSTALL_DATA		= ${INSTALL} -m 644
192
193# TCL_EXE is the name of a tclsh executable that is available *BEFORE*
194# running make for the first time. Certain build targets (make genstubs)
195# need it to be available on the PATH. This executable should *NOT* be
196# required just to do a normal build although it can be required to run
197# make dist.
198TCL_EXE			= tclsh
199
200# The symbols below provide support for dynamic loading and shared
201# libraries.  See configure.in for a description of what the
202# symbols mean.  The values of the symbols are normally set by the
203# configure script.  You shouldn't normally need to modify any of
204# these definitions by hand.
205
206STLIB_LD		= @STLIB_LD@
207SHLIB_LD		= @SHLIB_LD@
208SHLIB_CFLAGS		= @SHLIB_CFLAGS@
209SHLIB_LD_LIBS		= @SHLIB_LD_LIBS@
210TCL_SHLIB_LD_EXTRAS	= @TCL_SHLIB_LD_EXTRAS@
211
212SHLIB_SUFFIX		= @SHLIB_SUFFIX@
213#SHLIB_SUFFIX		=
214
215DLTEST_TARGETS		= dltest.marker
216
217# Additional search flags needed to find the various shared libraries
218# at run-time.  The first symbol is for use when creating a binary
219# with cc, and the second is for use when running ld directly.
220CC_SEARCH_FLAGS	= @CC_SEARCH_FLAGS@
221LD_SEARCH_FLAGS	= @LD_SEARCH_FLAGS@
222
223# The following symbol is defined to "$(DLTEST_TARGETS)" if dynamic
224# loading is available;  this causes everything in the "dltest"
225# subdirectory to be built when making "tcltest.  If dynamic loading
226# isn't available, configure defines this symbol to an empty string,
227# in which case the shared libraries aren't built.
228BUILD_DLTEST		= @BUILD_DLTEST@
229#BUILD_DLTEST		=
230
231TCL_LIB_FILE		= @TCL_LIB_FILE@
232#TCL_LIB_FILE		= libtcl.a
233
234# Generic lib name used in rules that apply to tcl and tk
235LIB_FILE		= ${TCL_LIB_FILE}
236
237TCL_LIB_FLAG		= @TCL_LIB_FLAG@
238#TCL_LIB_FLAG		= -ltcl
239
240TCL_EXP_FILE		= @TCL_EXP_FILE@
241TCL_BUILD_EXP_FILE	= @TCL_BUILD_EXP_FILE@
242
243# support for embedded libraries on Darwin / Mac OS X
244DYLIB_INSTALL_DIR	= ${LIB_RUNTIME_DIR}
245
246#----------------------------------------------------------------
247# The information below is modified by the configure script when
248# Makefile is generated from Makefile.in.  You shouldn't normally
249# modify any of this stuff by hand.
250#----------------------------------------------------------------
251
252COMPAT_OBJS		= @LIBOBJS@
253
254AC_FLAGS		= @DEFS@
255AR			= @AR@
256RANLIB			= @RANLIB@
257DTRACE			= @DTRACE@
258SRC_DIR			= @srcdir@
259TOP_DIR			= $(SRC_DIR)/..
260GENERIC_DIR		= $(TOP_DIR)/generic
261COMPAT_DIR		= $(TOP_DIR)/compat
262TOOL_DIR		= $(TOP_DIR)/tools
263UNIX_DIR		= $(SRC_DIR)
264MAC_OSX_DIR		= $(TOP_DIR)/macosx
265# Must be absolute because of the cd dltest $(DLTEST_DIR)/configure below.
266DLTEST_DIR		= @TCL_SRC_DIR@/unix/dltest
267# Must be absolute to so the corresponding tcltest's tcl_library is absolute.
268TCL_BUILDTIME_LIBRARY	= @TCL_SRC_DIR@/library
269
270CC			= @CC@
271#CC			= purify -best-effort @CC@ -DPURIFY
272
273# Flags to be passed to installManPage to control whether the manpages
274# should be compressed and linked with softlinks
275MAN_FLAGS               = @MAN_FLAGS@
276
277#----------------------------------------------------------------
278# The information below is usually usable as is.  The configure
279# script won't modify it and it only exists to make working
280# around selected rare system configurations easier.
281#----------------------------------------------------------------
282
283GDB			= gdb
284DDD			= ddd
285
286#----------------------------------------------------------------
287# The information below should be usable as is.  The configure
288# script won't modify it and you shouldn't need to modify it
289# either.
290#----------------------------------------------------------------
291
292STUB_CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} -I. \
293-I${GENERIC_DIR} -I${SRC_DIR} ${AC_FLAGS} ${MATH_FLAGS} ${GENERIC_FLAGS} \
294${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} ${COMPILE_DEBUG_FLAGS} ${ENV_FLAGS} \
295-DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\" @EXTRA_CC_SWITCHES@
296
297CC_SWITCHES =  $(STUB_CC_SWITCHES) ${NO_DEPRECATED_FLAGS}
298
299APP_CC_SWITCHES = $(CC_SWITCHES) @EXTRA_APP_CC_SWITCHES@
300
301LIBS		= @DL_LIBS@ @LIBS@ $(MATH_LIBS)
302
303DEPEND_SWITCHES	= ${CFLAGS} -I${GENERIC_DIR} -I${SRC_DIR} \
304${AC_FLAGS} ${MATH_FLAGS} \
305${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
306-DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\" @EXTRA_CC_SWITCHES@
307
308TCLSH_OBJS = tclAppInit.o
309
310TCLTEST_OBJS = tclTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o \
311	tclThreadTest.o tclUnixTest.o
312
313XTTEST_OBJS = xtTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o \
314	tclThreadTest.o tclUnixTest.o tclXtNotify.o tclXtTest.o
315
316GENERIC_OBJS = regcomp.o regexec.o regfree.o regerror.o tclAlloc.o \
317	tclAsync.o tclBasic.o tclBinary.o \
318	tclCkalloc.o tclClock.o tclCmdAH.o tclCmdIL.o tclCmdMZ.o \
319	tclCompCmds.o tclCompExpr.o tclCompile.o tclDate.o tclEncoding.o \
320	tclEnv.o tclEvent.o tclExecute.o tclFCmd.o tclFileName.o tclGet.o \
321	tclHash.o tclHistory.o tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o \
322	tclIOGT.o tclIOSock.o tclIOUtil.o tclLink.o tclListObj.o \
323	tclLiteral.o tclLoad.o tclMain.o tclNamesp.o tclNotify.o \
324	tclObj.o tclPanic.o tclParse.o tclParseExpr.o tclPipe.o \
325	tclPkg.o tclPosixStr.o tclPreserve.o tclProc.o tclRegexp.o \
326	tclResolve.o tclResult.o tclScan.o tclStringObj.o tclThread.o \
327	 tclThreadAlloc.o tclThreadJoin.o tclStubInit.o tclStubLib.o \
328	tclTimer.o tclUtf.o tclUtil.o tclVar.o
329
330STUB_LIB_OBJS = tclStubLib.o ${COMPAT_OBJS}
331
332MAC_OSX_OBJS = tclMacOSXBundle.o tclMacOSXNotify.o
333
334DTRACE_OBJ = tclDTrace.o
335
336TCL_OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${NOTIFY_OBJS} ${COMPAT_OBJS} \
337        @DL_OBJS@ @PLAT_OBJS@
338
339OBJS = ${TCL_OBJS} @DTRACE_OBJ@
340
341TCL_DECLS = \
342	$(GENERIC_DIR)/tcl.decls \
343	$(GENERIC_DIR)/tclInt.decls
344
345GENERIC_HDRS = \
346	$(GENERIC_DIR)/tcl.h \
347	$(GENERIC_DIR)/tclDecls.h \
348	$(GENERIC_DIR)/tclInt.h \
349	$(GENERIC_DIR)/tclIntDecls.h \
350	$(GENERIC_DIR)/tclIntPlatDecls.h \
351	$(GENERIC_DIR)/tclPatch.h \
352	$(GENERIC_DIR)/tclPlatDecls.h \
353	$(GENERIC_DIR)/tclPort.h \
354	$(GENERIC_DIR)/tclRegexp.h
355
356GENERIC_SRCS = \
357	$(GENERIC_DIR)/regcomp.c \
358	$(GENERIC_DIR)/regexec.c \
359	$(GENERIC_DIR)/regfree.c \
360	$(GENERIC_DIR)/regerror.c \
361	$(GENERIC_DIR)/tclAlloc.c \
362	$(GENERIC_DIR)/tclAsync.c \
363	$(GENERIC_DIR)/tclBasic.c \
364	$(GENERIC_DIR)/tclBinary.c \
365	$(GENERIC_DIR)/tclCkalloc.c \
366	$(GENERIC_DIR)/tclClock.c \
367	$(GENERIC_DIR)/tclCmdAH.c \
368	$(GENERIC_DIR)/tclCmdIL.c \
369	$(GENERIC_DIR)/tclCmdMZ.c \
370	$(GENERIC_DIR)/tclCompCmds.c \
371	$(GENERIC_DIR)/tclCompExpr.c \
372	$(GENERIC_DIR)/tclCompile.c \
373	$(GENERIC_DIR)/tclDate.c \
374	$(GENERIC_DIR)/tclEncoding.c \
375	$(GENERIC_DIR)/tclEnv.c \
376	$(GENERIC_DIR)/tclEvent.c \
377	$(GENERIC_DIR)/tclExecute.c \
378	$(GENERIC_DIR)/tclFCmd.c \
379	$(GENERIC_DIR)/tclFileName.c \
380	$(GENERIC_DIR)/tclGet.c \
381	$(GENERIC_DIR)/tclHash.c \
382	$(GENERIC_DIR)/tclHistory.c \
383	$(GENERIC_DIR)/tclIndexObj.c \
384	$(GENERIC_DIR)/tclInterp.c \
385	$(GENERIC_DIR)/tclIO.c \
386	$(GENERIC_DIR)/tclIOCmd.c \
387	$(GENERIC_DIR)/tclIOGT.c \
388	$(GENERIC_DIR)/tclIOSock.c \
389	$(GENERIC_DIR)/tclIOUtil.c \
390	$(GENERIC_DIR)/tclLink.c \
391	$(GENERIC_DIR)/tclListObj.c \
392	$(GENERIC_DIR)/tclLiteral.c \
393	$(GENERIC_DIR)/tclLoad.c \
394	$(GENERIC_DIR)/tclMain.c \
395	$(GENERIC_DIR)/tclNamesp.c \
396	$(GENERIC_DIR)/tclNotify.c \
397	$(GENERIC_DIR)/tclObj.c \
398        $(GENERIC_DIR)/tclParse.c \
399        $(GENERIC_DIR)/tclParseExpr.c \
400	$(GENERIC_DIR)/tclPipe.c \
401	$(GENERIC_DIR)/tclPkg.c \
402	$(GENERIC_DIR)/tclPosixStr.c \
403	$(GENERIC_DIR)/tclPreserve.c \
404	$(GENERIC_DIR)/tclProc.c \
405	$(GENERIC_DIR)/tclRegexp.c \
406	$(GENERIC_DIR)/tclResolve.c \
407	$(GENERIC_DIR)/tclResult.c \
408	$(GENERIC_DIR)/tclScan.c \
409	$(GENERIC_DIR)/tclStubInit.c \
410	$(GENERIC_DIR)/tclStubLib.c \
411	$(GENERIC_DIR)/tclStringObj.c \
412	$(GENERIC_DIR)/tclTest.c \
413	$(GENERIC_DIR)/tclTestObj.c \
414	$(GENERIC_DIR)/tclTestProcBodyObj.c \
415	$(GENERIC_DIR)/tclThread.c \
416	$(GENERIC_DIR)/tclThreadAlloc.c \
417	$(GENERIC_DIR)/tclThreadJoin.c \
418	$(GENERIC_DIR)/tclTimer.c \
419	$(GENERIC_DIR)/tclUtil.c \
420	$(GENERIC_DIR)/tclVar.c
421
422STUB_SRCS = \
423	$(GENERIC_DIR)/tclStubLib.c
424
425UNIX_HDRS = \
426	$(UNIX_DIR)/tclUnixPort.h
427
428UNIX_SRCS = \
429	$(UNIX_DIR)/tclAppInit.c \
430	$(UNIX_DIR)/tclUnixChan.c \
431	$(UNIX_DIR)/tclUnixEvent.c \
432	$(UNIX_DIR)/tclUnixFCmd.c \
433	$(UNIX_DIR)/tclUnixFile.c \
434	$(UNIX_DIR)/tclUnixPipe.c \
435	$(UNIX_DIR)/tclUnixSock.c \
436	$(UNIX_DIR)/tclUnixTest.c \
437	$(UNIX_DIR)/tclUnixThrd.c \
438	$(UNIX_DIR)/tclUnixTime.c \
439	$(UNIX_DIR)/tclUnixInit.c \
440	$(UNIX_DIR)/tclUnixCompat.c
441
442NOTIFY_SRCS = \
443	$(UNIX_DIR)/tclUnixNotfy.c
444
445DL_SRCS = \
446	$(UNIX_DIR)/tclLoadAix.c \
447	$(UNIX_DIR)/tclLoadAout.c \
448	$(UNIX_DIR)/tclLoadDl.c \
449	$(UNIX_DIR)/tclLoadDl2.c \
450	$(UNIX_DIR)/tclLoadDld.c \
451	$(UNIX_DIR)/tclLoadDyld.c \
452	$(GENERIC_DIR)/tclLoadNone.c \
453	$(UNIX_DIR)/tclLoadOSF.c \
454	$(UNIX_DIR)/tclLoadShl.c
455
456MAC_OSX_SRCS = \
457	$(MAC_OSX_DIR)/tclMacOSXBundle.c \
458	$(MAC_OSX_DIR)/tclMacOSXNotify.c
459
460DTRACE_HDR = tclDTrace.h
461
462DTRACE_SRC = $(GENERIC_DIR)/tclDTrace.d
463
464# Note: don't include DL_SRCS or MAC_OSX_SRCS in SRCS: most of those
465# files won't compile on the current machine, and they will cause
466# problems for things like "make depend".
467
468SRCS = $(GENERIC_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) $(STUB_SRCS) @PLAT_SRCS@
469
470all: binaries libraries doc
471
472binaries: ${LIB_FILE} $(STUB_LIB_FILE) $(TCL_BUILD_EXP_FILE) tclsh
473
474libraries:
475
476doc:
477
478# The following target is configured by autoconf to generate either
479# a shared library or non-shared library for Tcl.
480${LIB_FILE}: ${OBJS} ${STUB_LIB_FILE}
481	rm -f $@
482	@MAKE_LIB@
483
484${STUB_LIB_FILE}: ${STUB_LIB_OBJS}
485	rm -f $@
486	@MAKE_STUB_LIB@
487
488# Make target which outputs the list of the .o contained in the Tcl lib
489# usefull to build a single big shared library containing Tcl and other
490# extensions.  used for the Tcl Plugin.  -- dl
491# The dependency on OBJS is not there because we just want the list
492# of objects here, not actually building them
493tclLibObjs:
494	@echo ${OBJS}
495# This targets actually build the objects needed for the lib in the above
496# case
497objs: ${OBJS}
498
499
500tclsh: ${TCLSH_OBJS} ${TCL_LIB_FILE}
501	${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} @EXTRA_TCLSH_LIBS@ \
502		${CC_SEARCH_FLAGS} -o tclsh
503
504# Resetting the LIB_RUNTIME_DIR below is required so that
505# the generated tcltest executable gets the build directory
506# burned into its ld search path. This keeps tcltest from
507# picking up an already installed version of the Tcl library.
508
509tcltest: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${BUILD_DLTEST}
510	$(MAKE) tcltest-real LIB_RUNTIME_DIR=`pwd`
511
512tcltest-real:
513	${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} @EXTRA_TCLSH_LIBS@ \
514		${CC_SEARCH_FLAGS} -o tcltest
515
516# Note, in the target below TCL_LIBRARY needs to be set or else
517# "make test" won't work in the case where the compilation directory
518# isn't the same as the source directory.
519# Specifying TESTFLAGS on the command line is the standard way to pass
520# args to tcltest, ie:
521#	% make test TESTFLAGS="-verbose bps -file fileName.test"
522
523test: tcltest
524	@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
525	TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
526	./tcltest $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) $(TCLTESTARGS)
527
528# Useful target to launch a built tcltest with the proper path,...
529runtest: tcltest
530	@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
531	TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
532	./tcltest
533
534# Useful target for running the test suite with an unwritable current
535# directory...
536ro-test: tcltest
537	@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
538	TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
539	echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | ./tcltest
540
541# This target can be used to run tclsh from the build directory
542# via `make shell SCRIPT=/tmp/foo.tcl`
543shell: tclsh
544	@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
545	TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
546	./tclsh $(SCRIPT)
547
548# This target can be used to run tclsh inside either gdb or insight
549gdb: tclsh
550	@echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
551	@echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
552	$(GDB) ./tclsh --command=gdb.run
553	rm gdb.run
554
555# This target can be used to run tclsh inside ddd
556ddd: tclsh
557	@echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
558	@echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
559	$(DDD) -command=gdb.run ./tclsh
560	rm gdb.run
561
562VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v
563
564valgrind: tclsh tcltest
565	@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
566	TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
567	valgrind $(VALGRINDARGS) ./tcltest $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS) $(TCLTESTARGS)
568
569valgrindshell: tclsh
570	@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
571	TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
572	valgrind $(VALGRINDARGS) ./tclsh $(SCRIPT)
573
574# The following target outputs the name of the top-level source directory
575# for Tcl (it is used by Tk's configure script, for example).  The
576# .NO_PARALLEL line is needed to avoid problems under Sun's "pmake".
577# Note: this target is now obsolete (use the autoconf variable
578# TCL_SRC_DIR from tclConfig.sh instead).
579
580.NO_PARALLEL: topDirName
581topDirName:
582	@cd $(TOP_DIR); pwd
583
584# The following target generates the file generic/tclDate.c 
585# from the yacc grammar found in generic/tclGetDate.y.  This is
586# only run by hand as yacc is not available in all environments.
587# The name of the .c file is different than the name of the .y file
588# so that make doesn't try to automatically regenerate the .c file.
589
590gendate:
591	yacc -l $(GENERIC_DIR)/tclGetDate.y
592	sed -e 's/yy/TclDate/g' -e '/^#include <values.h>/d' \
593	    -e 's?SCCSID?RCS: @(#) ?' \
594	    -e '/#ifdef __STDC__/,/#endif/d' -e '/TclDateerrlab:/d' \
595	    -e '/TclDatenewstate:/d' -e '/#pragma/d' \
596	    -e '/#include <inttypes.h>/d' -e 's/const /CONST /g' \
597	    <y.tab.c >$(GENERIC_DIR)/tclDate.c
598	rm y.tab.c
599
600# The following target generates the shared libraries in dltest/ that
601# are used for testing;  they are included as part of the "tcltest"
602# target (via the BUILD_DLTEST variable) if dynamic loading is supported
603# on this platform. The Makefile in the dltest subdirectory creates
604# the dltest.marker file in this directory after a successful build.
605
606dltest.marker: ${STUB_LIB_FILE}
607	cd dltest ; $(MAKE)
608
609INSTALL_TARGETS = install-binaries install-libraries install-doc @EXTRA_INSTALL@
610
611install: $(INSTALL_TARGETS)
612
613install-strip:
614	$(MAKE) $(INSTALL_TARGETS) \
615		INSTALL_PROGRAM="$(INSTALL_PROGRAM) ${INSTALL_STRIP_PROGRAM}" \
616		INSTALL_LIBRARY="$(INSTALL_LIBRARY) ${INSTALL_STRIP_LIBRARY}"
617
618# Note: before running ranlib below, must cd to target directory because
619# some ranlibs write to current directory, and this might not always be
620# possible (e.g. if installing as root).
621
622install-binaries: binaries
623	@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
624	    do \
625	    if [ ! -d $$i ] ; then \
626		echo "Making directory $$i"; \
627		mkdir -p $$i; \
628		chmod 755 $$i; \
629		else true; \
630		fi; \
631	    done;
632	@if test ! -x $(SRC_DIR)/install-sh; then \
633	    chmod +x $(SRC_DIR)/install-sh; \
634	    fi
635	@echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/"
636	@@INSTALL_LIB@
637	@chmod 555 $(LIB_INSTALL_DIR)/$(LIB_FILE)
638	@if test "$(TCL_BUILD_EXP_FILE)" != ""; then \
639	    echo "Installing $(TCL_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \
640	    $(INSTALL_DATA) $(TCL_BUILD_EXP_FILE) \
641			$(LIB_INSTALL_DIR)/$(TCL_EXP_FILE); \
642	    fi
643	@echo "Installing tclsh as $(BIN_INSTALL_DIR)/tclsh$(VERSION)"
644	@$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh$(VERSION)
645	@echo "Installing tclConfig.sh to $(LIB_INSTALL_DIR)/"
646	@$(INSTALL_DATA) tclConfig.sh $(LIB_INSTALL_DIR)/tclConfig.sh
647	@if test "$(STUB_LIB_FILE)" != "" ; then \
648	    echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \
649	    @INSTALL_STUB_LIB@ ; \
650	fi
651	@EXTRA_INSTALL_BINARIES@
652
653install-libraries: libraries
654	@for i in $(INCLUDE_INSTALL_DIR) $(SCRIPT_INSTALL_DIR); \
655	    do \
656	    if [ ! -d $$i ] ; then \
657		echo "Making directory $$i"; \
658		mkdir -p $$i; \
659		chmod 755 $$i; \
660		else true; \
661		fi; \
662	    done;
663	@for i in platform http2.5 http1.0 opt0.4 encoding msgcat1.3 tcltest2.2; \
664	    do \
665	    if [ ! -d $(SCRIPT_INSTALL_DIR)/$$i ] ; then \
666		echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \
667		mkdir -p $(SCRIPT_INSTALL_DIR)/$$i; \
668		chmod 755 $(SCRIPT_INSTALL_DIR)/$$i; \
669		else true; \
670		fi; \
671	    done;
672	@if test ! -x $(SRC_DIR)/install-sh; then \
673	    chmod +x $(SRC_DIR)/install-sh; \
674	    fi
675	@echo "Installing header files";
676	@for i in $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h \
677		$(GENERIC_DIR)/tclPlatDecls.h; \
678	    do \
679	    $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \
680	    done;
681	@echo "Installing library files to $(SCRIPT_INSTALL_DIR)";
682	@for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \
683		$(UNIX_DIR)/tclAppInit.c $(UNIX_DIR)/ldAix @DTRACE_SRC@; \
684	    do \
685	    $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
686	    done;
687	@echo "Installing library platform directory";
688	@for j in $(TOP_DIR)/library/platform/*.tcl ; \
689	    do \
690	    $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/platform; \
691	    done;
692	@echo "Installing library http1.0 directory";
693	@for j in $(TOP_DIR)/library/http1.0/*.tcl ; \
694	    do \
695	    $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/http1.0; \
696	    done;
697	@echo "Installing library http2.5 directory";
698	@for j in $(TOP_DIR)/library/http/*.tcl ; \
699	    do \
700	    $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/http2.5; \
701	    done;
702	@echo "Installing library opt0.4 directory";
703	@for j in $(TOP_DIR)/library/opt/*.tcl ; \
704	    do \
705	    $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/opt0.4; \
706	    done;
707	@echo "Installing library msgcat1.3 directory";
708	@for j in $(TOP_DIR)/library/msgcat/*.tcl ; \
709	    do \
710	    $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/msgcat1.3; \
711	    done;
712	@echo "Installing library tcltest2.2 directory";
713	@for j in $(TOP_DIR)/library/tcltest/*.tcl ; \
714	    do \
715	    $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/tcltest2.2; \
716	    done;
717	@echo "Installing library encoding directory";
718	@for i in $(TOP_DIR)/library/encoding/*.enc ; do \
719		$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/encoding; \
720	done;
721
722install-doc: doc
723	@if test ! -x $(UNIX_DIR)/installManPage; then \
724	    chmod +x $(UNIX_DIR)/installManPage; \
725	    fi
726	@for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \
727	    do \
728	    if [ ! -d $$i ] ; then \
729		echo "Making directory $$i"; \
730		mkdir -p $$i; \
731		chmod 755 $$i; \
732		else true; \
733		fi; \
734	    done;
735	@echo "Installing and cross-linking top-level (.1) docs";
736	@for i in $(TOP_DIR)/doc/*.1; do \
737	    $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MAN1_INSTALL_DIR); \
738	done
739
740	@echo "Installing and cross-linking C API (.3) docs";
741	@for i in $(TOP_DIR)/doc/*.3; do \
742	    $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MAN3_INSTALL_DIR); \
743	done
744
745	@echo "Installing and cross-linking command (.n) docs";
746	@for i in $(TOP_DIR)/doc/*.n; do \
747	    $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MANN_INSTALL_DIR); \
748	done
749
750# Optional target to install private headers
751install-private-headers: libraries
752	@for i in $(PRIVATE_INCLUDE_INSTALL_DIR); \
753	    do \
754	    if [ ! -d $$i ] ; then \
755		echo "Making directory $$i"; \
756		mkdir -p $$i; \
757		chmod 755 $$i; \
758		else true; \
759		fi; \
760	    done;
761	@if test ! -x $(SRC_DIR)/install-sh; then \
762	    chmod +x $(SRC_DIR)/install-sh; \
763	    fi
764	@echo "Installing private header files";
765	@for i in $(GENERIC_DIR)/tclInt.h $(GENERIC_DIR)/tclIntDecls.h \
766		$(GENERIC_DIR)/tclIntPlatDecls.h \
767		$(UNIX_DIR)/tclUnixPort.h $(GENERIC_DIR)/tclMath.h; \
768	    do \
769	    $(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \
770	    done;
771	@sed -e 's#\.\./unix/##' $(GENERIC_DIR)/tclPort.h > tclPort.h; \
772	    $(INSTALL_DATA) tclPort.h $(PRIVATE_INCLUDE_INSTALL_DIR); \
773	    rm -f tclPort.h
774
775Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in
776	$(SHELL) config.status
777
778clean:
779	rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
780		errors tclsh tcltest lib.exp Tcl @DTRACE_HDR@
781	cd dltest ; $(MAKE) clean
782
783distclean: clean
784	rm -rf Makefile config.status config.cache config.log tclConfig.sh \
785		$(PACKAGE).* prototype *.plist Tcl.framework
786	cd dltest ; $(MAKE) distclean
787
788depend:
789	makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
790
791# Test binaries.  The rules for tclTestInit.o and xtTestInit.o are
792# complicated because they are compiled from tclAppInit.c.  Can't use
793# the "-o" option because this doesn't work on some strange compilers
794# (e.g. UnixWare).
795# To enable concurrent parallel make of tclsh and tcltest resp xttest, these
796# targets have to depend on tclsh, this ensures that linking of tclsh with
797# tclAppInit.o does not execute concurrently with the renaming and recompiling
798# of that same object file in the targets below.
799
800tclTestInit.o: $(UNIX_DIR)/tclAppInit.c tclsh
801	@if test -f tclAppInit.o ; then \
802	    rm -f tclAppInit.sav; \
803	    mv tclAppInit.o tclAppInit.sav; \
804	fi;
805	$(CC) -c $(APP_CC_SWITCHES) \
806		-DTCL_BUILDTIME_LIBRARY="\"${TCL_BUILDTIME_LIBRARY}\"" \
807		-DTCL_TEST $(UNIX_DIR)/tclAppInit.c
808	rm -f tclTestInit.o
809	mv tclAppInit.o tclTestInit.o
810	@if test -f tclAppInit.sav ; then \
811	    mv tclAppInit.sav tclAppInit.o; \
812	fi;
813
814xtTestInit.o: $(UNIX_DIR)/tclAppInit.c tclsh
815	@if test -f tclAppInit.o ; then \
816	    rm -f tclAppInit.sav; \
817	    mv tclAppInit.o tclAppInit.sav; \
818	fi;
819	$(CC) -c $(APP_CC_SWITCHES) \
820		-DTCL_BUILDTIME_LIBRARY="\"${TCL_BUILDTIME_LIBRARY}\"" \
821		-DTCL_TEST -DTCL_XT_TEST $(UNIX_DIR)/tclAppInit.c
822	rm -f xtTestInit.o
823	mv tclAppInit.o xtTestInit.o
824	@if test -f tclAppInit.sav ; then \
825	    mv tclAppInit.sav tclAppInit.o; \
826	fi;
827
828# Object files used on all Unix systems:
829
830REGHDRS=$(GENERIC_DIR)/regex.h $(GENERIC_DIR)/regguts.h \
831		$(GENERIC_DIR)/regcustom.h
832regcomp.o: $(REGHDRS) $(GENERIC_DIR)/regcomp.c $(GENERIC_DIR)/regc_lex.c \
833		$(GENERIC_DIR)/regc_color.c $(GENERIC_DIR)/regc_locale.c \
834		$(GENERIC_DIR)/regc_nfa.c $(GENERIC_DIR)/regc_cvec.c
835	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regcomp.c
836
837regexec.o: $(REGHDRS) $(GENERIC_DIR)/regexec.c $(GENERIC_DIR)/rege_dfa.c
838	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regexec.c
839
840regfree.o: $(REGHDRS) $(GENERIC_DIR)/regfree.c
841	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regfree.c
842
843regerror.o: $(REGHDRS) $(GENERIC_DIR)/regerrs.h $(GENERIC_DIR)/regerror.c
844	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regerror.c
845
846tclAppInit.o: $(UNIX_DIR)/tclAppInit.c
847	$(CC) -c $(APP_CC_SWITCHES) $(UNIX_DIR)/tclAppInit.c
848
849# On unix we want to use the normal malloc/free implementation, so we
850# specifically set the USE_TCLALLOC flag.
851
852tclAlloc.o: $(GENERIC_DIR)/tclAlloc.c
853	$(CC) -c $(CC_SWITCHES) -DUSE_TCLALLOC=0 $(GENERIC_DIR)/tclAlloc.c
854
855tclAsync.o: $(GENERIC_DIR)/tclAsync.c
856	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAsync.c
857
858tclBasic.o: $(GENERIC_DIR)/tclBasic.c
859	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclBasic.c
860
861tclBinary.o: $(GENERIC_DIR)/tclBinary.c
862	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclBinary.c
863
864tclCkalloc.o: $(GENERIC_DIR)/tclCkalloc.c
865	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCkalloc.c
866
867tclClock.o: $(GENERIC_DIR)/tclClock.c
868	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclClock.c
869
870tclCmdAH.o: $(GENERIC_DIR)/tclCmdAH.c
871	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCmdAH.c
872
873tclCmdIL.o: $(GENERIC_DIR)/tclCmdIL.c
874	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCmdIL.c
875
876tclCmdMZ.o: $(GENERIC_DIR)/tclCmdMZ.c
877	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCmdMZ.c
878
879tclDate.o: $(GENERIC_DIR)/tclDate.c
880	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclDate.c
881
882tclCompCmds.o: $(GENERIC_DIR)/tclCompCmds.c
883	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompCmds.c
884
885tclCompExpr.o: $(GENERIC_DIR)/tclCompExpr.c
886	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompExpr.c
887
888tclCompile.o: $(GENERIC_DIR)/tclCompile.c
889	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompile.c
890
891tclEncoding.o: $(GENERIC_DIR)/tclEncoding.c
892	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEncoding.c
893
894tclEnv.o: $(GENERIC_DIR)/tclEnv.c
895	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEnv.c
896
897tclEvent.o: $(GENERIC_DIR)/tclEvent.c
898	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEvent.c
899
900tclExecute.o: $(GENERIC_DIR)/tclExecute.c
901	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclExecute.c
902
903tclFCmd.o: $(GENERIC_DIR)/tclFCmd.c
904	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclFCmd.c
905
906tclFileName.o: $(GENERIC_DIR)/tclFileName.c
907	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclFileName.c
908
909tclGet.o: $(GENERIC_DIR)/tclGet.c
910	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclGet.c
911
912tclHash.o: $(GENERIC_DIR)/tclHash.c
913	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclHash.c
914
915tclHistory.o: $(GENERIC_DIR)/tclHistory.c
916	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclHistory.c
917
918tclIndexObj.o: $(GENERIC_DIR)/tclIndexObj.c
919	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIndexObj.c
920
921tclInterp.o: $(GENERIC_DIR)/tclInterp.c
922	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclInterp.c
923
924tclIO.o: $(GENERIC_DIR)/tclIO.c
925	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIO.c
926
927tclIOCmd.o: $(GENERIC_DIR)/tclIOCmd.c
928	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIOCmd.c
929
930tclIOGT.o: $(GENERIC_DIR)/tclIOGT.c
931	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIOGT.c
932
933tclIOSock.o: $(GENERIC_DIR)/tclIOSock.c
934	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIOSock.c
935
936tclIOUtil.o: $(GENERIC_DIR)/tclIOUtil.c
937	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIOUtil.c
938
939tclLink.o: $(GENERIC_DIR)/tclLink.c
940	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLink.c
941
942tclListObj.o: $(GENERIC_DIR)/tclListObj.c
943	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclListObj.c
944
945tclLiteral.o: $(GENERIC_DIR)/tclLiteral.c
946	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLiteral.c
947
948tclObj.o: $(GENERIC_DIR)/tclObj.c
949	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclObj.c
950
951tclLoad.o: $(GENERIC_DIR)/tclLoad.c
952	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLoad.c
953
954tclLoadAix.o: $(UNIX_DIR)/tclLoadAix.c
955	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadAix.c
956
957tclLoadAout.o: $(UNIX_DIR)/tclLoadAout.c
958	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadAout.c
959
960tclLoadDl.o: $(UNIX_DIR)/tclLoadDl.c
961	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadDl.c
962
963tclLoadDl2.o: $(UNIX_DIR)/tclLoadDl2.c
964	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadDl2.c
965
966tclLoadDld.o: $(UNIX_DIR)/tclLoadDld.c
967	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadDld.c
968
969tclLoadDyld.o: $(UNIX_DIR)/tclLoadDyld.c
970	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadDyld.c
971
972tclLoadNone.o: $(GENERIC_DIR)/tclLoadNone.c
973	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLoadNone.c
974
975tclLoadOSF.o: $(UNIX_DIR)/tclLoadOSF.c
976	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadOSF.c
977
978tclLoadShl.o: $(UNIX_DIR)/tclLoadShl.c
979	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadShl.c
980
981tclMain.o: $(GENERIC_DIR)/tclMain.c
982	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclMain.c
983
984tclNamesp.o: $(GENERIC_DIR)/tclNamesp.c
985	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclNamesp.c
986
987tclNotify.o: $(GENERIC_DIR)/tclNotify.c
988	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclNotify.c
989
990tclParse.o: $(GENERIC_DIR)/tclParse.c
991	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclParse.c
992
993tclParseExpr.o: $(GENERIC_DIR)/tclParseExpr.c
994	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclParseExpr.c
995
996tclPanic.o: $(GENERIC_DIR)/tclPanic.c
997	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPanic.c
998
999tclPipe.o: $(GENERIC_DIR)/tclPipe.c
1000	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPipe.c
1001
1002tclPkg.o: $(GENERIC_DIR)/tclPkg.c
1003	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPkg.c
1004
1005tclPosixStr.o: $(GENERIC_DIR)/tclPosixStr.c
1006	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPosixStr.c
1007
1008tclPreserve.o: $(GENERIC_DIR)/tclPreserve.c
1009	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPreserve.c
1010
1011tclProc.o: $(GENERIC_DIR)/tclProc.c
1012	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclProc.c
1013
1014tclRegexp.o: $(GENERIC_DIR)/tclRegexp.c
1015	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclRegexp.c
1016
1017tclResolve.o: $(GENERIC_DIR)/tclResolve.c
1018	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclResolve.c
1019
1020tclResult.o: $(GENERIC_DIR)/tclResult.c
1021	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclResult.c
1022
1023tclScan.o: $(GENERIC_DIR)/tclScan.c
1024	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclScan.c
1025
1026tclStringObj.o: $(GENERIC_DIR)/tclStringObj.c
1027	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStringObj.c
1028
1029tclStubInit.o: $(GENERIC_DIR)/tclStubInit.c
1030	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStubInit.c
1031
1032tclUtil.o: $(GENERIC_DIR)/tclUtil.c
1033	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclUtil.c
1034
1035tclUtf.o: $(GENERIC_DIR)/tclUtf.c $(GENERIC_DIR)/tclUniData.c
1036	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclUtf.c
1037
1038tclVar.o: $(GENERIC_DIR)/tclVar.c
1039	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclVar.c
1040
1041tclTest.o: $(GENERIC_DIR)/tclTest.c
1042	$(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTest.c
1043
1044tclTestObj.o: $(GENERIC_DIR)/tclTestObj.c
1045	$(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTestObj.c
1046
1047tclTestProcBodyObj.o: $(GENERIC_DIR)/tclTestProcBodyObj.c
1048	$(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTestProcBodyObj.c
1049
1050tclTimer.o: $(GENERIC_DIR)/tclTimer.c
1051	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclTimer.c
1052
1053tclThread.o: $(GENERIC_DIR)/tclThread.c
1054	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclThread.c
1055
1056tclThreadAlloc.o: $(GENERIC_DIR)/tclThreadAlloc.c
1057	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclThreadAlloc.c
1058
1059tclThreadJoin.o: $(GENERIC_DIR)/tclThreadJoin.c
1060	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclThreadJoin.c
1061
1062tclThreadTest.o: $(GENERIC_DIR)/tclThreadTest.c
1063	$(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclThreadTest.c
1064
1065tclUnixChan.o: $(UNIX_DIR)/tclUnixChan.c
1066	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixChan.c
1067
1068tclUnixEvent.o: $(UNIX_DIR)/tclUnixEvent.c
1069	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixEvent.c
1070
1071tclUnixFCmd.o: $(UNIX_DIR)/tclUnixFCmd.c
1072	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixFCmd.c
1073
1074tclUnixFile.o: $(UNIX_DIR)/tclUnixFile.c
1075	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixFile.c
1076
1077tclUnixNotfy.o: $(UNIX_DIR)/tclUnixNotfy.c
1078	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixNotfy.c
1079
1080tclUnixPipe.o: $(UNIX_DIR)/tclUnixPipe.c
1081	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixPipe.c
1082
1083tclUnixSock.o: $(UNIX_DIR)/tclUnixSock.c
1084	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixSock.c
1085
1086tclUnixTest.o: $(UNIX_DIR)/tclUnixTest.c
1087	$(CC) -c $(APP_CC_SWITCHES) $(UNIX_DIR)/tclUnixTest.c
1088
1089tclUnixThrd.o: $(UNIX_DIR)/tclUnixThrd.c
1090	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixThrd.c
1091
1092tclUnixTime.o: $(UNIX_DIR)/tclUnixTime.c
1093	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixTime.c
1094
1095tclUnixInit.o: $(UNIX_DIR)/tclUnixInit.c $(GENERIC_DIR)/tclInitScript.h tclConfig.sh
1096	$(CC) -c $(CC_SWITCHES) -DTCL_LIBRARY=\"${TCL_LIBRARY}\" \
1097		-DTCL_PACKAGE_PATH="\"${TCL_PACKAGE_PATH}\"" \
1098		$(UNIX_DIR)/tclUnixInit.c
1099
1100tclUnixCompat.o: $(UNIX_DIR)/tclUnixCompat.c
1101	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixCompat.c
1102
1103# The following are Mac OS X only sources:
1104tclMacOSXBundle.o: $(MAC_OSX_DIR)/tclMacOSXBundle.c
1105	$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tclMacOSXBundle.c
1106
1107tclMacOSXNotify.o: $(MAC_OSX_DIR)/tclMacOSXNotify.c
1108	$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tclMacOSXNotify.c
1109
1110# DTrace support
1111
1112$(TCL_OBJS) $(STUB_LIB_OBJS) $(TCLSH_OBJS) $(TCLTEST_OBJS) $(XTTEST_OBJS): @DTRACE_HDR@
1113
1114$(DTRACE_HDR): $(DTRACE_SRC)
1115	$(DTRACE) -h $(DTRACE_SWITCHES) -o $@ -s $(DTRACE_SRC)
1116
1117$(DTRACE_OBJ): $(DTRACE_SRC) $(TCL_OBJS)
1118	$(DTRACE) -G $(DTRACE_SWITCHES) -o $@ -s $(DTRACE_SRC) $(TCL_OBJS)
1119
1120# The following targets are not completely general.  They are provide
1121# purely for documentation purposes so people who are interested in
1122# the Xt based notifier can modify them to suit their own installation.
1123
1124xttest:  ${XTTEST_OBJS} ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS} \
1125	@DL_OBJS@ ${BUILD_DLTEST}
1126	${CC} ${XTTEST_OBJS} ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS} \
1127		@DL_OBJS@ @TCL_BUILD_LIB_SPEC@ ${LIBS} \
1128		${CC_SEARCH_FLAGS} -L/usr/openwin/lib -lXt -o xttest
1129
1130tclXtNotify.o: $(UNIX_DIR)/tclXtNotify.c
1131	$(CC) -c $(APP_CC_SWITCHES) -I/usr/openwin/include \
1132		$(UNIX_DIR)/tclXtNotify.c
1133
1134tclXtTest.o: $(UNIX_DIR)/tclXtTest.c
1135	$(CC) -c $(APP_CC_SWITCHES) -I/usr/openwin/include \
1136		$(UNIX_DIR)/tclXtTest.c
1137
1138# compat binaries, these must be compiled for use in a shared library
1139# even though they may be placed in a static executable or library.  Since
1140# they are included in both the tcl library and the stub library, they
1141# need to be relocatable.
1142
1143fixstrtod.o: $(COMPAT_DIR)/fixstrtod.c
1144	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/fixstrtod.c
1145
1146opendir.o: $(COMPAT_DIR)/opendir.c
1147	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/opendir.c
1148
1149memcmp.o: $(COMPAT_DIR)/memcmp.c
1150	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/memcmp.c
1151
1152strncasecmp.o: $(COMPAT_DIR)/strncasecmp.c
1153	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strncasecmp.c
1154
1155strstr.o: $(COMPAT_DIR)/strstr.c
1156	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strstr.c
1157
1158strtod.o: $(COMPAT_DIR)/strtod.c
1159	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtod.c
1160
1161strtol.o: $(COMPAT_DIR)/strtol.c
1162	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtol.c
1163
1164strtoll.o: $(COMPAT_DIR)/strtoll.c
1165	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoll.c
1166
1167strtoul.o: $(COMPAT_DIR)/strtoul.c
1168	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoul.c
1169
1170strtoull.o: $(COMPAT_DIR)/strtoull.c
1171	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoull.c
1172
1173tmpnam.o: $(COMPAT_DIR)/tmpnam.c
1174	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/tmpnam.c
1175
1176waitpid.o: $(COMPAT_DIR)/waitpid.c
1177	$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/waitpid.c
1178
1179# Stub library binaries, these must be compiled for use in a shared library
1180# even though they will be placed in a static archive
1181
1182tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c
1183	$(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclStubLib.c
1184
1185.c.o:
1186	$(CC) -c $(CC_SWITCHES) $<
1187
1188#
1189# Target to regenerate header files and stub files from the *.decls tables.
1190#
1191
1192$(GENERIC_DIR)/tclStubInit.c: $(GENERIC_DIR)/tcl.decls \
1193		$(GENERIC_DIR)/tclInt.decls
1194	@echo "Warning: tclStubInit.c may be out of date."
1195	@echo "Developers may want to run \"make genstubs\" to regenerate."
1196	@echo "This warning can be safely ignored, do not report as a bug!"
1197
1198genstubs:
1199	$(TCL_EXE) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \
1200		$(GENERIC_DIR)/tcl.decls $(GENERIC_DIR)/tclInt.decls
1201
1202#
1203# Target to check that all exported functions have an entry in the stubs
1204# tables.
1205#
1206
1207checkstubs: $(TCL_LIB_FILE)
1208	-@for i in `nm -p $(TCL_LIB_FILE) \
1209		| awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \
1210		| sort -n`; do \
1211		match=0; \
1212		for j in $(TCL_DECLS); do \
1213		    if [ `grep -c "$$i *(" $$j` -gt 0 ]; then \
1214			match=1; \
1215		    fi; \
1216		done; \
1217		if [ $$match -eq 0 ]; then echo $$i; fi \
1218	done
1219
1220#
1221# Target to check that all public APIs which are not command
1222# implementations have an entry in section three of the distributed
1223# manpages.
1224#
1225
1226checkdoc: $(TCL_LIB_FILE)
1227	-@for i in `nm -p $(TCL_LIB_FILE) | awk '$$3 ~ /Tcl_/ { print $$3 }' \
1228		| grep -v 'Cmd$$' | sort -n`; do \
1229		match=0; \
1230		for j in $(TOP_DIR)/doc/*.3; do \
1231		    if [ `grep '\-' $$j | grep -c $$i` -gt 0 ]; then \
1232			match=1; \
1233		    fi; \
1234		done; \
1235		if [ $$match -eq 0 ]; then echo $$i; fi \
1236	done
1237
1238#
1239# Target to check for proper usage of UCHAR macro.
1240#
1241
1242checkuchar:
1243	-egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR
1244
1245#
1246# Target to make sure that only symbols with "Tcl" prefixes are
1247# exported.
1248#
1249
1250checkexports: $(TCL_LIB_FILE)
1251	-@nm -p $(TCL_LIB_FILE) \
1252	| awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \
1253	| sort -n | grep -E -v '^[Tt]cl' || true
1254
1255#
1256# Target to create a Tcl RPM for Linux.  Requires that you be on a Linux
1257# system.
1258#
1259
1260rpm: all /bin/rpm
1261	rm -f THIS.TCL.SPEC
1262	echo "%define _builddir `pwd`" > THIS.TCL.SPEC
1263	echo "%define _rpmdir `pwd`/RPMS" >> THIS.TCL.SPEC
1264	cat tcl.spec >> THIS.TCL.SPEC
1265	mkdir -p RPMS/i386
1266	rpm -bb THIS.TCL.SPEC
1267	mv RPMS/i386/*.rpm .
1268	rm -rf RPMS THIS.TCL.SPEC
1269
1270#
1271# Target to create a proper Tcl distribution from information in the
1272# master source directory.  DISTDIR must be defined to indicate where
1273# to put the distribution.  DISTDIR must be an absolute path name.
1274#
1275
1276DISTROOT = /tmp/dist
1277DISTNAME = tcl${VERSION}${PATCH_LEVEL}
1278ZIPNAME	 = tcl${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip
1279DISTDIR	 = $(DISTROOT)/$(DISTNAME)
1280
1281dist:
1282	rm -rf $(DISTDIR)
1283	mkdir -p $(DISTDIR)/unix
1284	cp -p $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix
1285	cp $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix
1286	chmod 664 $(DISTDIR)/unix/Makefile.in
1287	cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.in \
1288		$(UNIX_DIR)/tcl.m4 $(UNIX_DIR)/aclocal.m4 \
1289		$(UNIX_DIR)/tclConfig.sh.in $(UNIX_DIR)/install-sh \
1290		$(UNIX_DIR)/README $(UNIX_DIR)/ldAix $(UNIX_DIR)/tcl.spec \
1291		$(UNIX_DIR)/installManPage \
1292		$(DISTDIR)/unix
1293	chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in
1294	chmod 775 $(DISTDIR)/unix/ldAix
1295	chmod +x $(DISTDIR)/unix/install-sh
1296	mkdir $(DISTDIR)/generic
1297	cp -p $(GENERIC_DIR)/*.[cdh] $(DISTDIR)/generic
1298	cp -p $(GENERIC_DIR)/*.decls $(DISTDIR)/generic
1299	cp -p $(GENERIC_DIR)/README $(DISTDIR)/generic
1300	cp -p $(GENERIC_DIR)/tclGetDate.y $(DISTDIR)/generic
1301	cp -p $(TOP_DIR)/changes $(TOP_DIR)/ChangeLog $(TOP_DIR)/README* \
1302		$(TOP_DIR)/ChangeLog.[12]??? $(TOP_DIR)/license.terms \
1303		$(DISTDIR)
1304	mkdir $(DISTDIR)/library
1305	cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/library/*.tcl \
1306		$(TOP_DIR)/library/tclIndex $(DISTDIR)/library
1307	for i in http1.0 http opt msgcat reg dde tcltest; \
1308	    do \
1309		mkdir $(DISTDIR)/library/$$i ;\
1310		cp -p $(TOP_DIR)/library/$$i/*.tcl $(DISTDIR)/library/$$i; \
1311	    done;
1312	mkdir $(DISTDIR)/library/encoding
1313	cp -p $(TOP_DIR)/library/encoding/*.enc $(DISTDIR)/library/encoding
1314	mkdir $(DISTDIR)/doc
1315	cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \
1316		$(TOP_DIR)/doc/man.macros $(DISTDIR)/doc
1317	mkdir $(DISTDIR)/compat
1318	cp -p $(TOP_DIR)/license.terms $(COMPAT_DIR)/*.c \
1319		$(COMPAT_DIR)/*.h $(COMPAT_DIR)/README \
1320		$(DISTDIR)/compat
1321	mkdir $(DISTDIR)/tests
1322	cp -p $(TOP_DIR)/license.terms $(DISTDIR)/tests
1323	cp -p $(TOP_DIR)/tests/*.test $(TOP_DIR)/tests/README \
1324		$(TOP_DIR)/tests/httpd $(TOP_DIR)/tests/*.tcl \
1325		$(DISTDIR)/tests
1326	mkdir $(DISTDIR)/win
1327	cp $(TOP_DIR)/win/Makefile.in $(DISTDIR)/win
1328	cp $(TOP_DIR)/win/configure.in $(TOP_DIR)/win/configure \
1329		$(TOP_DIR)/win/tclConfig.sh.in \
1330		$(TOP_DIR)/win/tcl.m4 $(TOP_DIR)/win/aclocal.m4 \
1331		$(DISTDIR)/win
1332	cp -p $(TOP_DIR)/win/*.c $(TOP_DIR)/win/*.h \
1333		$(TOP_DIR)/win/*.ico $(TOP_DIR)/win/*.rc \
1334		$(DISTDIR)/win
1335	cp -p $(TOP_DIR)/win/*.bat $(DISTDIR)/win
1336	$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/*.bat
1337	cp -p $(TOP_DIR)/win/makefile.* $(DISTDIR)/win
1338	$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/makefile.*
1339	cp -p $(TOP_DIR)/win/rules.vc $(DISTDIR)/win
1340	$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rules.vc
1341	cp -p $(TOP_DIR)/win/coffbase.txt $(DISTDIR)/win
1342	$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/coffbase.txt
1343	cp -p $(TOP_DIR)/win/tcl.hpj.in $(DISTDIR)/win
1344	$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/tcl.hpj.in
1345	cp -p $(TOP_DIR)/win/tcl.ds* $(DISTDIR)/win
1346	$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/tcl.ds*
1347	cp -p $(TOP_DIR)/win/README $(DISTDIR)/win
1348	cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win
1349	mkdir $(DISTDIR)/mac
1350	cp -p $(TOP_DIR)/mac/tcl*.sea.hqx \
1351		$(TOP_DIR)/mac/*.c $(TOP_DIR)/mac/*.h $(TOP_DIR)/mac/*.r \
1352		$(DISTDIR)/mac
1353	cp -p $(TOP_DIR)/mac/porting.notes $(TOP_DIR)/mac/README $(DISTDIR)/mac
1354	cp -p $(TOP_DIR)/mac/*.pch $(DISTDIR)/mac
1355	cp -p $(TOP_DIR)/mac/*.doc $(TOP_DIR)/mac/*.html $(DISTDIR)/mac
1356	cp -p $(TOP_DIR)/license.terms $(DISTDIR)/mac
1357	mkdir $(DISTDIR)/macosx
1358	cp -p $(MAC_OSX_DIR)/Makefile $(MAC_OSX_DIR)/README \
1359		$(MAC_OSX_DIR)/*.c $(MAC_OSX_DIR)/*.in \
1360		$(DISTDIR)/macosx
1361	cp -p $(TOP_DIR)/license.terms $(DISTDIR)/macosx
1362	mkdir $(DISTDIR)/macosx/Tcl.pbproj
1363	cp -p $(MAC_OSX_DIR)/Tcl.pbproj/*.pbx* $(DISTDIR)/macosx/Tcl.pbproj
1364	mkdir $(DISTDIR)/unix/dltest
1365	cp -p $(UNIX_DIR)/dltest/*.c $(UNIX_DIR)/dltest/Makefile.in \
1366		$(UNIX_DIR)/dltest/README \
1367		$(DISTDIR)/unix/dltest
1368	mkdir $(DISTDIR)/tools
1369	cp -p $(TOOL_DIR)/Makefile.in $(TOOL_DIR)/README \
1370		$(TOOL_DIR)/configure $(TOOL_DIR)/configure.in \
1371		$(TOOL_DIR)/*.tcl $(TOOL_DIR)/man2tcl.c \
1372		$(TOOL_DIR)/tcl.wse.in $(TOOL_DIR)/*.bmp \
1373		$(TOOL_DIR)/tcl.hpj.in \
1374		$(DISTDIR)/tools
1375	$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/tools/tcl.hpj.in \
1376		$(DISTDIR)/tools/tcl.wse.in
1377
1378#
1379# The following target can only be used for non-patch releases.  Use
1380# the "allpatch" target below for patch releases.
1381#
1382
1383alldist: dist
1384	rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME)
1385	cd $(DISTROOT); tar cf $(DISTNAME)-src.tar $(DISTNAME); \
1386		gzip -9 $(DISTNAME)-src.tar; zip -qr8 $(ZIPNAME) $(DISTNAME)
1387
1388#
1389# The target below is similar to "alldist" except it works for patch
1390# releases.  It is needed because patch releases are peculiar: the
1391# patch designation appears in the name of the compressed file
1392# (e.g. tcl8.0p1.tar.gz) but the extracted source directory doesn't
1393# include the patch designation (e.g. tcl8.0).
1394#
1395
1396allpatch: dist
1397	rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME)
1398	mv $(DISTROOT)/tcl${VERSION} $(DISTROOT)/old
1399	mv $(DISTROOT)/$(DISTNAME) $(DISTROOT)/tcl${VERSION}
1400	cd $(DISTROOT); tar cf $(DISTNAME)-src.tar tcl${VERSION}; \
1401		gzip -9 $(DISTNAME)-src.tar; zip -r8 $(ZIPNAME) tcl${VERSION}
1402	mv $(DISTROOT)/tcl${VERSION} $(DISTROOT)/$(DISTNAME)
1403	mv $(DISTROOT)/old $(DISTROOT)/tcl${VERSION}
1404
1405#
1406# This target creates the HTML folder for Tcl & Tk and places it
1407# in DISTDIR/html.  It uses the tcltk-man2html.tcl tool from
1408# the Tcl group's tool workspace.  It depends on the Tcl & Tk being
1409# in directories called tcl8.* & tk8.* up two directories from the
1410# TOOL_DIR.
1411#
1412
1413html: tclsh
1414	$(BUILD_HTML)
1415	@EXTRA_BUILD_HTML@
1416html-tcl: tclsh
1417	$(BUILD_HTML) --tcl
1418	@EXTRA_BUILD_HTML@
1419html-tk: tclsh
1420	$(BUILD_HTML) --tk
1421	@EXTRA_BUILD_HTML@
1422
1423BUILD_HTML = \
1424	@@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
1425	TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
1426	./tclsh $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \
1427		--srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS)
1428
1429#
1430# Target to create a Macintosh version of the distribution.  This will
1431# do a normal distribution and then massage the output to prepare it
1432# for moving to the Mac platform.  This requires a few scripts and
1433# programs found only in the Tcl group's tool workspace.
1434#
1435
1436macdist: dist machtml
1437
1438machtml:
1439	rm -f $(DISTDIR)/mac/tclMacProjects.sea.hqx
1440	rm -rf $(DISTDIR)/doc
1441	$(TCL_EXE) $(TOOL_DIR)/cvtEOL.tcl $(DISTDIR)
1442
1443#
1444# Targets to build Solaris package of the distribution for the current
1445# architecture.  To build stream packages for both sun4 and i86pc
1446# architectures: 
1447#
1448#   On the sun4 machine, execute the following:
1449#     make distclean; ./configure
1450#     make DISTDIR=<distdir> package
1451#
1452#   Once the build is complete, execute the following on the i86pc
1453#   machine:
1454#     make DISTDIR=<distdir> package-quick
1455#
1456# <distdir> is the absolute path to a directory where the build should
1457# take place.  These steps will generate the $(PACKAGE).sun4 and
1458# $(PACKAGE).i86pc stream packages.  It is important that the packages be
1459# built in this fashion in order to ensure that the architecture
1460# independent files are exactly the same, including timestamps, in
1461# both packages.
1462#
1463
1464PACKAGE=SCRPtcl
1465
1466package: dist package-config package-common package-binaries package-generate
1467package-quick: package-config package-binaries package-generate
1468
1469#
1470# Configure for the current architecture in the dist directory.
1471#
1472package-config:
1473	mkdir -p $(DISTDIR)/unix/`arch`
1474	cd $(DISTDIR)/unix/`arch`; \
1475        ../configure --prefix=/opt/$(PACKAGE)/$(VERSION) \
1476		--exec_prefix=/opt/$(PACKAGE)/$(VERSION)/`arch` \
1477		--enable-shared
1478	mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION)
1479	mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch`
1480
1481#
1482# Build and install the architecture independent files in the dist directory.
1483#
1484
1485package-common:
1486	cd $(DISTDIR)/unix/`arch`;\
1487	$(MAKE); \
1488	$(MAKE) prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION) \
1489		exec_prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch` \
1490		install-libraries install-man
1491	mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin
1492	sed -e "s/TCLVERSION/$(VERSION)/g" < $(UNIX_DIR)/tclsh.sh \
1493		> $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin/tclsh$(VERSION)
1494	chmod 755 $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin/tclsh$(VERSION)
1495
1496#
1497# Build and install the architecture specific files in the dist directory.
1498#
1499
1500package-binaries: 
1501	cd $(DISTDIR)/unix/`arch`; \
1502	$(MAKE); \
1503	$(MAKE) install-binaries prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION) \
1504		exec_prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch`
1505
1506#
1507# Generate a package from the installed files in the dist directory for the
1508# current architecture.
1509#
1510
1511package-generate:
1512	pkgproto $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin=bin \
1513		 $(DISTDIR)/$(PACKAGE)/$(VERSION)/include=include \
1514		 $(DISTDIR)/$(PACKAGE)/$(VERSION)/lib=lib \
1515		 $(DISTDIR)/$(PACKAGE)/$(VERSION)/man=man \
1516		 $(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch`=`arch` \
1517	| $(TCL_EXE) $(UNIX_DIR)/mkProto.tcl \
1518		$(VERSION) $(UNIX_DIR) > prototype
1519	pkgmk -o -d . -f prototype -a `arch`
1520	pkgtrans -s . $(PACKAGE).`arch` $(PACKAGE)
1521	rm -rf $(PACKAGE)
1522
1523# DO NOT DELETE THIS LINE -- make depend depends on it.
1524