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
8 # @(#) Makefile.in 1.24 95/07/27 12:40:13
10 # Current Tcl version; used in various names.
14 #----------------------------------------------------------------
15 # Things you can change to personalize the Makefile for your own
16 # site (you can make these changes in either Makefile.in or
17 # Makefile, but changes to Makefile will get lost if you re-run
18 # the configuration script).
19 #----------------------------------------------------------------
21 # Default top-level directories in which to install architecture-
22 # specific files (exec_prefix) and machine-independent files such
23 # as scripts (prefix). The values specified here may be overridden
24 # at configure-time with the --exec-prefix and --prefix options
25 # to the "configure" script.
28 exec_prefix = @exec_prefix@
30 # The following definition can be set to non-null for special systems
31 # like AFS with replication. It allows the pathnames used for installation
32 # to be different than those used for actually reference files at
33 # run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix
34 # when installing files.
37 # Directory from which applications will reference the library of Tcl
38 # scripts (note: you can set the TCL_LIBRARY environment variable at
39 # run-time to override this value):
40 TCL_LIBRARY = $(prefix)/lib/tcl$(VERSION)
42 # Path name to use when installing library scripts:
43 SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY)
45 # Directory in which to install the archive libtcl.a:
46 LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib
48 # Directory in which to install the program tclsh:
49 BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
51 # Directory in which to install the include file tcl.h:
52 INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include
54 # Top-level directory in which to install manual entries:
55 MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man
57 # Directory in which to install manual entry for tclsh:
58 MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1
60 # Directory in which to install manual entries for Tcl's C library
62 MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3
64 # Directory in which to install manual entries for the built-in
66 MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann
68 # Additional libraries to use when linking. The "LIBS" part will be
69 # replaced (or has already been replaced) with relevant libraries as
70 # determined by the configure script.
71 LIBS = ../fcgi-devel-kit/libfcgi/libfcgi.a @LIBS@
73 # To change the compiler switches, for example to change from -O
74 # to -g, change the following line:
75 CFLAGS = -g -I../fcgi-devel-kit/include -include ../fcgi-devel-kit/include/fcgi_stdio.h
77 # To disable ANSI-C procedure prototypes reverse the comment characters
78 # on the following lines:
80 #PROTO_FLAGS = -DNO_PROTOTYPE
82 # Mathematical functions like sin and atan2 are enabled for expressions
83 # by default. To disable them, reverse the comment characters on the
84 # following pairs of lines:
86 #MATH_FLAGS = -DTCL_NO_MATH
87 MATH_LIBS = @MATH_LIBS@
90 # To compile for non-UNIX systems (so that only the non-UNIX-specific
91 # commands are available), reverse the comment characters on the
92 # following pairs of lines. In addition, you'll have to provide your
93 # own replacement for the "panic" procedure (see panic.c for what
94 # the current one does).
96 #GENERIC_FLAGS = -DTCL_GENERIC_ONLY
97 UNIX_OBJS = panic.o tclEnv.o tclGlob.o tclMain.o tclMtherr.o \
98 tclUnixAZ.o tclUnixStr.o tclUnixUtil.o
101 # To enable memory debugging reverse the comment characters on the following
102 # lines. Warning: if you enable memory debugging, you must do it
103 # *everywhere*, including all the code that calls Tcl, and you must use
104 # ckalloc and ckfree everywhere instead of malloc and free.
106 #MEM_DEBUG_FLAGS = -DTCL_MEM_DEBUG
108 # Some versions of make, like SGI's, use the following variable to
109 # determine which shell to use for executing commands:
112 # Tcl used to let the configure script choose which program to use
113 # for installing, but there are just too many different versions of
114 # "install" around; better to use the install-sh script that comes
115 # with the distribution, which is slower but guaranteed to work.
117 INSTALL = @srcdir@/install-sh -c
119 #----------------------------------------------------------------
120 # The information below is modified by the configure script when
121 # Makefile is generated from Makefile.in. You shouldn't normally
122 # modify any of this stuff by hand.
123 #----------------------------------------------------------------
125 COMPAT_OBJS = @LIBOBJS@
127 INSTALL_PROGRAM = @INSTALL_PROGRAM@
128 INSTALL_DATA = @INSTALL_DATA@
133 #----------------------------------------------------------------
134 # The information below should be usable as is. The configure
135 # script won't modify it and you shouldn't need to modify it
137 #----------------------------------------------------------------
141 CC_SWITCHES = ${CFLAGS} -I. -I${SRC_DIR} ${AC_FLAGS} ${MATH_FLAGS} \
142 ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
143 -DTCL_LIBRARY=\"${TCL_LIBRARY}\"
145 GENERIC_OBJS = regexp.o tclAsync.o tclBasic.o tclCkalloc.o \
146 tclCmdAH.o tclCmdIL.o tclCmdMZ.o tclExpr.o tclGet.o \
147 tclHash.o tclHistory.o tclLink.o tclParse.o tclProc.o \
148 tclUtil.o tclVar.o tclFCGI.o
150 OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS}
152 SRCS= regexp.c tclAsync.c tclBasic.c tclCkalloc.c \
153 tclCmdAH.c tclCmdIL.c tclCmdMZ.c tclExpr.c tclGet.c \
154 tclHash.c tclHistory.c tclLink.c tclParse.c tclProc.c \
155 tclUtil.c tclVar.c panic.c tclEnv.c tclGlob.c tclMain.c \
156 tclMtherr.c tclUnixAZ.c tclUnixStr.c tclUnixUtil.c \
157 tclTest.c tclAppInit.c tclFCGI.c
163 ar cr libtcl.a ${OBJS}
166 tclsh: tclAppInit.o libtcl.a
167 ${CC} ${CC_SWITCHES} tclAppInit.o libtcl.a ${LIBS} ${MATH_LIBS} -o tclsh
169 tcltest: tclTest.o libtcl.a
170 ${CC} ${CC_SWITCHES} tclTest.o libtcl.a ${LIBS} ${MATH_LIBS} -o tcltest
174 cd $(SRC_DIR); TCL_LIBRARY=`pwd`/library; export TCL_LIBRARY; \
175 cd $$cwd; ( echo cd $(SRC_DIR)/tests\; source all ) | ./tcltest
179 @echo "# Definitions and libraries needed to build Tcl applications" >> configInfo
180 @echo "# (generated by the configure script):" >> configInfo
181 @echo "TCL_CC_SWITCHES = ${AC_FLAGS} ${MEM_DEBUG_FLAGS}" >> configInfo
182 @echo "TCL_LIBS = ${LIBS} ${MATH_LIBS}" >> configInfo
184 install: install-binaries install-libraries install-man
186 install-binaries: libtcl.a tclsh
187 @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
189 if [ ! -d $$i ] ; then \
190 echo "Making directory $$i"; \
196 @echo "Installing libtcl.a"
197 @$(INSTALL_DATA) libtcl.a $(LIB_INSTALL_DIR)/libtcl$(VERSION).a
198 @$(RANLIB) $(LIB_INSTALL_DIR)/libtcl$(VERSION).a
199 @echo "Installing tclsh"
200 @$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh$(VERSION)
203 @for i in $(INSTALL_ROOT)$(prefix)/lib $(INCLUDE_INSTALL_DIR) \
204 $(SCRIPT_INSTALL_DIR) ; \
206 if [ ! -d $$i ] ; then \
207 echo "Making directory $$i"; \
213 @echo "Installing tcl.h"
214 @$(INSTALL_DATA) $(SRC_DIR)/tcl.h $(INCLUDE_INSTALL_DIR)
215 @for i in $(SRC_DIR)/library/*.tcl $(SRC_DIR)/library/tclIndex $(SRC_DIR)/tclAppInit.c; \
217 echo "Installing $$i"; \
218 $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
222 @for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \
224 if [ ! -d $$i ] ; then \
225 echo "Making directory $$i"; \
231 @cd $(SRC_DIR)/doc; for i in *.1; \
233 echo "Installing doc/$$i"; \
234 rm -f $(MAN1_INSTALL_DIR)/$$i; \
235 sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
236 $$i > $(MAN1_INSTALL_DIR)/$$i; \
237 chmod 444 $(MAN1_INSTALL_DIR)/$$i; \
239 @cd $(SRC_DIR)/doc; for i in *.3; \
241 echo "Installing doc/$$i"; \
242 rm -f $(MAN3_INSTALL_DIR)/$$i; \
243 sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
244 $$i > $(MAN3_INSTALL_DIR)/$$i; \
245 chmod 444 $(MAN3_INSTALL_DIR)/$$i; \
247 @cd $(SRC_DIR)/doc; for i in *.n; \
249 echo "Installing doc/$$i"; \
250 rm -f $(MANN_INSTALL_DIR)/$$i; \
251 sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
252 $$i > $(MANN_INSTALL_DIR)/$$i; \
253 chmod 444 $(MANN_INSTALL_DIR)/$$i; \
256 Makefile: $(SRC_DIR)/Makefile.in
257 $(SHELL) config.status
260 rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors tclsh tcltest \
264 rm -f Makefile config.status config.cache
267 makedepend -- $(CC_SWITCHES) -- $(SRCS)
269 fixstrtod.o: $(SRC_DIR)/compat/fixstrtod.c
270 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/fixstrtod.c
272 getcwd.o: $(SRC_DIR)/compat/getcwd.c
273 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/getcwd.c
275 opendir.o: $(SRC_DIR)/compat/opendir.c
276 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/opendir.c
278 strerror.o: $(SRC_DIR)/compat/strerror.c
279 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strerror.c
281 strncasecmp.o: $(SRC_DIR)/compat/strncasecmp.c
282 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strncasecmp.c
284 strstr.o: $(SRC_DIR)/compat/strstr.c
285 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strstr.c
287 strtod.o: $(SRC_DIR)/compat/strtod.c
288 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtod.c
290 strtol.o: $(SRC_DIR)/compat/strtol.c
291 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtol.c
293 strtoul.o: $(SRC_DIR)/compat/strtoul.c
294 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtoul.c
296 tmpnam.o: $(SRC_DIR)/compat/tmpnam.c
297 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/tmpnam.c
299 waitpid.o: $(SRC_DIR)/compat/waitpid.c
300 $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/waitpid.c
303 $(CC) -c $(CC_SWITCHES) $<
306 # Target to check for proper usage of UCHAR macro.
310 -egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit $(SRCS) | grep -v UCHAR
313 # Target to make sure that only symbols with "Tcl" prefixes are
317 checkexports: libtcl.a
318 -nm -p libtcl.a | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]cl'
321 # Target to create a proper Tcl distribution from information in the
322 # master source directory. DISTDIR must be defined to indicate where
323 # to put the distribution.
326 configure: configure.in
331 cp Makefile.in $(DISTDIR)
332 chmod 664 $(DISTDIR)/Makefile.in
333 cp -p $(SRCS) $(DISTDIR)
334 cp -p tclRegexp.h tcl.h tclInt.h tclPort.h patchlevel.h $(DISTDIR)
335 cp configure configure.in $(DISTDIR)
336 chmod 775 $(DISTDIR)/configure $(DISTDIR)/configure.in
337 cp -p changes README porting.notes porting.old license.terms \
338 install-sh $(DISTDIR)
339 chmod +x $(DISTDIR)/install-sh
340 mkdir $(DISTDIR)/library
341 cp -p license.terms library/*.tcl library/tclIndex $(DISTDIR)/library
343 cp -p license.terms doc/*.[13n] doc/man.macros $(DISTDIR)/doc
344 mkdir $(DISTDIR)/compat
345 cp -p license.terms compat/*.c compat/*.h compat/README \
347 mkdir $(DISTDIR)/tests
348 cp -p license.terms $(DISTDIR)/tests
349 cp -p tests/*.test tests/README tests/all tests/defs $(DISTDIR)/tests
351 # DO NOT DELETE THIS LINE -- make depend depends on it.