Initial revision
[catagits/fcgi2.git] / tcl / tcl7.4 / Makefile.in
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 # @(#) Makefile.in 1.24 95/07/27 12:40:13
9
10 # Current Tcl version;  used in various names.
11
12 VERSION = 7.4
13
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 #----------------------------------------------------------------
20
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.
26
27 prefix =        @prefix@
28 exec_prefix =   @exec_prefix@
29
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.
35 INSTALL_ROOT =
36
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)
41
42 # Path name to use when installing library scripts:
43 SCRIPT_INSTALL_DIR =    $(INSTALL_ROOT)$(TCL_LIBRARY)
44
45 # Directory in which to install the archive libtcl.a:
46 LIB_INSTALL_DIR =       $(INSTALL_ROOT)$(exec_prefix)/lib
47
48 # Directory in which to install the program tclsh:
49 BIN_INSTALL_DIR =       $(INSTALL_ROOT)$(exec_prefix)/bin
50
51 # Directory in which to install the include file tcl.h:
52 INCLUDE_INSTALL_DIR =   $(INSTALL_ROOT)$(prefix)/include
53
54 # Top-level directory in which to install manual entries:
55 MAN_INSTALL_DIR =       $(INSTALL_ROOT)$(prefix)/man
56
57 # Directory in which to install manual entry for tclsh:
58 MAN1_INSTALL_DIR =      $(MAN_INSTALL_DIR)/man1
59
60 # Directory in which to install manual entries for Tcl's C library
61 # procedures:
62 MAN3_INSTALL_DIR =      $(MAN_INSTALL_DIR)/man3
63
64 # Directory in which to install manual entries for the built-in
65 # Tcl commands:
66 MANN_INSTALL_DIR =      $(MAN_INSTALL_DIR)/mann
67
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@
72
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
76
77 # To disable ANSI-C procedure prototypes reverse the comment characters
78 # on the following lines:
79 PROTO_FLAGS =
80 #PROTO_FLAGS = -DNO_PROTOTYPE
81
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:
85 MATH_FLAGS =
86 #MATH_FLAGS = -DTCL_NO_MATH
87 MATH_LIBS = @MATH_LIBS@
88 #MATH_LIBS =
89
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).
95 GENERIC_FLAGS =
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
99 #UNIX_OBJS =
100
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.
105 MEM_DEBUG_FLAGS =
106 #MEM_DEBUG_FLAGS = -DTCL_MEM_DEBUG
107
108 # Some versions of make, like SGI's, use the following variable to
109 # determine which shell to use for executing commands:
110 SHELL =         /bin/sh
111
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.
116
117 INSTALL = @srcdir@/install-sh -c
118
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 #----------------------------------------------------------------
124
125 COMPAT_OBJS =           @LIBOBJS@
126 AC_FLAGS =              @DEFS@
127 INSTALL_PROGRAM =       @INSTALL_PROGRAM@
128 INSTALL_DATA =          @INSTALL_DATA@
129 RANLIB =                @RANLIB@
130 SRC_DIR =               @srcdir@
131 VPATH =                 @srcdir@
132
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
136 # either.
137 #----------------------------------------------------------------
138
139
140 CC =            @CC@
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}\"
144
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
149
150 OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS}
151
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
158
159 all: libtcl.a tclsh
160
161 libtcl.a: ${OBJS}
162         rm -f libtcl.a
163         ar cr libtcl.a ${OBJS}
164         $(RANLIB) libtcl.a
165
166 tclsh: tclAppInit.o libtcl.a
167         ${CC} ${CC_SWITCHES} tclAppInit.o libtcl.a ${LIBS} ${MATH_LIBS} -o tclsh
168
169 tcltest: tclTest.o libtcl.a
170         ${CC} ${CC_SWITCHES} tclTest.o libtcl.a ${LIBS} ${MATH_LIBS} -o tcltest
171
172 test: tcltest
173         @cwd=`pwd`; \
174         cd $(SRC_DIR); TCL_LIBRARY=`pwd`/library; export TCL_LIBRARY; \
175         cd $$cwd; ( echo cd $(SRC_DIR)/tests\; source all ) | ./tcltest
176
177 configInfo: Makefile
178         @rm -f configInfo
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
183
184 install: install-binaries install-libraries install-man
185
186 install-binaries: libtcl.a tclsh
187         @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
188             do \
189             if [ ! -d $$i ] ; then \
190                 echo "Making directory $$i"; \
191                 mkdir $$i; \
192                 chmod 755 $$i; \
193                 else true; \
194                 fi; \
195             done;
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)
201
202 install-libraries:
203         @for i in $(INSTALL_ROOT)$(prefix)/lib $(INCLUDE_INSTALL_DIR) \
204                 $(SCRIPT_INSTALL_DIR) ; \
205             do \
206             if [ ! -d $$i ] ; then \
207                 echo "Making directory $$i"; \
208                 mkdir $$i; \
209                 chmod 755 $$i; \
210                 else true; \
211                 fi; \
212             done;
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; \
216             do \
217             echo "Installing $$i"; \
218             $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
219             done;
220
221 install-man:
222         @for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \
223             do \
224             if [ ! -d $$i ] ; then \
225                 echo "Making directory $$i"; \
226                 mkdir $$i; \
227                 chmod 755 $$i; \
228                 else true; \
229                 fi; \
230             done;
231         @cd $(SRC_DIR)/doc; for i in *.1; \
232             do \
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; \
238             done;
239         @cd $(SRC_DIR)/doc; for i in *.3; \
240             do \
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; \
246             done;
247         @cd $(SRC_DIR)/doc; for i in *.n; \
248             do \
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; \
254             done;
255
256 Makefile: $(SRC_DIR)/Makefile.in
257         $(SHELL) config.status
258
259 clean:
260         rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors tclsh tcltest \
261                 config.info
262
263 distclean: clean
264         rm -f Makefile config.status config.cache
265
266 depend:
267         makedepend -- $(CC_SWITCHES) -- $(SRCS)
268
269 fixstrtod.o: $(SRC_DIR)/compat/fixstrtod.c
270         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/fixstrtod.c
271
272 getcwd.o: $(SRC_DIR)/compat/getcwd.c
273         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/getcwd.c
274
275 opendir.o: $(SRC_DIR)/compat/opendir.c
276         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/opendir.c
277
278 strerror.o: $(SRC_DIR)/compat/strerror.c
279         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strerror.c
280
281 strncasecmp.o: $(SRC_DIR)/compat/strncasecmp.c
282         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strncasecmp.c
283
284 strstr.o: $(SRC_DIR)/compat/strstr.c
285         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strstr.c
286
287 strtod.o: $(SRC_DIR)/compat/strtod.c
288         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtod.c
289
290 strtol.o: $(SRC_DIR)/compat/strtol.c
291         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtol.c
292
293 strtoul.o: $(SRC_DIR)/compat/strtoul.c
294         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtoul.c
295
296 tmpnam.o: $(SRC_DIR)/compat/tmpnam.c
297         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/tmpnam.c
298
299 waitpid.o: $(SRC_DIR)/compat/waitpid.c
300         $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/waitpid.c
301
302 .c.o:
303         $(CC) -c $(CC_SWITCHES) $<
304
305 #
306 # Target to check for proper usage of UCHAR macro.
307 #
308
309 checkuchar:
310         -egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit $(SRCS) | grep -v UCHAR
311
312 #
313 # Target to make sure that only symbols with "Tcl" prefixes are
314 # exported.
315 #
316
317 checkexports: libtcl.a
318         -nm -p libtcl.a | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]cl'
319
320 #
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.
324 #
325
326 configure: configure.in
327         autoconf
328 dist: configure
329         rm -rf $(DISTDIR)
330         mkdir $(DISTDIR)
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
342         mkdir $(DISTDIR)/doc
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 \
346                 $(DISTDIR)/compat
347         mkdir $(DISTDIR)/tests
348         cp -p license.terms $(DISTDIR)/tests
349         cp -p tests/*.test tests/README tests/all tests/defs $(DISTDIR)/tests
350
351 # DO NOT DELETE THIS LINE -- make depend depends on it.