1# Makefile.in --
2#
3#	This file is a Makefile for Expect TEA Extension.  If it has the name
4#	"Makefile.in" then it is a template for a Makefile;  to generate the
5#	actual Makefile, run "./configure", which is a configuration script
6#	generated by the "autoconf" program (constructs like "@foo@" will get
7#	replaced in the actual Makefile.
8#
9# Copyright (c) 1999 Scriptics Corporation.
10# Copyright (c) 2002-2005 ActiveState Corporation.
11#
12# See the file "license.terms" for information on usage and redistribution
13# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14#
15# RCS: @(#) $Id: Makefile.in,v 5.47 2010/09/01 21:32:32 andreas_kupries Exp $
16
17#========================================================================
18#========================================================================
19
20# expect must be setuid on crays in order to open ptys (and accordingly,
21# you must run this Makefile as root).
22# See the FAQ for more info on why this is necessary on Crays.
23SETUID = @SETUID@
24# SETUID = chmod u+s
25
26LIB_RUNTIME_DIR = $(DESTDIR)@libdir@
27
28# The following Expect scripts are not necessary to have installed as
29# commands, but are very useful. Edit out what you don't want
30# installed. The INSTALL file describes these and others in more
31# detail. Some Make's screw up if you delete all of them because
32# SCRIPTS is a target. If this is a problem, just comment out the
33# SCRIPTS target itself.
34
35SCRIPTS = timed-run timed-read ftp-rfc autopasswd lpunlock weather \
36	passmass rftp kibitz rlogin-cwd xpstat tkpasswd dislocate xkibitz \
37	tknewsbiff unbuffer mkpasswd cryptdir decryptdir autoexpect \
38	multixterm
39
40# A couple of the scripts have man pages of their own.
41# You can delete these too if you don't want'em.
42
43SCRIPTS_MANPAGES = kibitz dislocate xkibitz tknewsbiff unbuffer mkpasswd \
44	passmass cryptdir decryptdir autoexpect multixterm
45
46
47# allow us to handle null list gracefully, "end_of_list" should not exist
48
49SCRIPT_LIST         = $(SCRIPTS) end_of_list
50SCRIPT_MANPAGE_LIST = $(SCRIPTS_MANPAGES) end_of_list
51
52# Short directory path where binaries can be found to support #! hack.
53# This directory path can be the same as the directory in which the
54# binary actually sits except when the path is so long that the #!
55# mechanism breaks (usually at 32 characters). The solution is to
56# create a directory with a very short name, which consists only of
57# symbolic links back to the true binaries. Subtracting two for "#!"
58# and a couple more for arguments (typically " -f" or " --") gives you
59# 27 characters. Pathnames over this length won't be able to use the
60# #! magic. For more info on this, see the execve(2) man page.
61
62SHORT_BINDIR = $(exec_prefix)/bin
63
64#========================================================================
65# Nothing of the variables below this line should need to be changed.
66# Please check the TARGETS section below to make sure the make targets
67# are correct.
68#========================================================================
69
70#========================================================================
71# The names of the source files is defined in the configure script.
72# The object files are used for linking into the final library.
73# This will be used when a dist target is added to the Makefile.
74# It is not important to specify the directory, as long as it is the
75# $(srcdir) or in the generic, win or unix subdirectory.
76#========================================================================
77
78PKG_SOURCES	= @PKG_SOURCES@
79PKG_OBJECTS	= @PKG_OBJECTS@
80
81PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
82PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
83
84#========================================================================
85# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
86# this package that need to be installed, if any.
87#========================================================================
88
89PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
90
91#========================================================================
92# This is a list of public header files to be installed, if any.
93#========================================================================
94
95PKG_HEADERS	= @PKG_HEADERS@
96
97#========================================================================
98# "PKG_LIB_FILE" refers to the library (dynamic or static as per
99# configuration options) composed of the named objects.
100#========================================================================
101
102PKG_LIB_FILE	= @PKG_LIB_FILE@
103PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
104
105lib_BINARIES	= $(PKG_LIB_FILE)
106bin_BINARIES	= expect
107BINARIES	= $(lib_BINARIES) $(bin_BINARIES)
108
109SHELL		= @SHELL@
110
111srcdir		= @srcdir@
112prefix		= @prefix@
113exec_prefix	= @exec_prefix@
114
115bindir		= @bindir@
116libdir		= @libdir@
117datadir		= @datadir@
118mandir		= @mandir@
119includedir	= @includedir@
120
121DESTDIR		=
122
123PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
124pkgdatadir	= $(datadir)/$(PKG_DIR)
125pkglibdir	= $(libdir)/$(PKG_DIR)
126pkgincludedir	= $(includedir)/$(PKG_DIR)
127
128top_builddir	= .
129
130INSTALL		= @INSTALL@
131INSTALL_PROGRAM	= @INSTALL_PROGRAM@
132INSTALL_DATA	= @INSTALL_DATA@
133INSTALL_SCRIPT	= @INSTALL_SCRIPT@
134
135PACKAGE_NAME	= @PACKAGE_NAME@
136PACKAGE_VERSION	= @PACKAGE_VERSION@
137CC		= @CC@
138CFLAGS_DEFAULT	= @CFLAGS_DEFAULT@
139CFLAGS_WARNING	= @CFLAGS_WARNING@
140CLEANFILES	= @CLEANFILES@
141EXEEXT		= @EXEEXT@
142LDFLAGS_DEFAULT	= @LDFLAGS_DEFAULT@
143MAKE_LIB	= @MAKE_LIB@
144MAKE_SHARED_LIB	= @MAKE_SHARED_LIB@
145MAKE_STATIC_LIB	= @MAKE_STATIC_LIB@
146MAKE_STUB_LIB	= @MAKE_STUB_LIB@
147OBJEXT		= @OBJEXT@
148RANLIB		= @RANLIB@
149RANLIB_STUB	= @RANLIB_STUB@
150SHLIB_CFLAGS	= @SHLIB_CFLAGS@
151SHLIB_LD	= @SHLIB_LD@
152SHLIB_LD_LIBS	= @SHLIB_LD_LIBS@
153STLIB_LD	= @STLIB_LD@
154TCL_DEFS	= @TCL_DEFS@
155TCL_BIN_DIR	= @TCL_BIN_DIR@
156TCL_SRC_DIR	= @TCL_SRC_DIR@
157# Not used, but retained for reference of what libs Tcl required
158TCL_LIBS	= @TCL_LIBS@
159
160#========================================================================
161# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
162# package without installing.  The other environment variables allow us
163# to test against an uninstalled Tcl.  Add special env vars that you
164# require for testing here (like TCLX_LIBRARY).
165#========================================================================
166
167EXTRA_PATH	= $(top_builddir):$(TCL_BIN_DIR)
168TCLSH_ENV	= TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
169		  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
170		  PATH="$(EXTRA_PATH):$(PATH)" \
171		  TCLLIBPATH="$(top_builddir)"
172TCLSH_PROG	= @TCLSH_PROG@
173TCLSH		= $(TCLSH_ENV) $(TCLSH_PROG)
174SHARED_BUILD	= @SHARED_BUILD@
175
176INCLUDES	= @PKG_INCLUDES@ @TCL_INCLUDES@
177
178PKG_CFLAGS	= @PKG_CFLAGS@
179
180# TCL_DEFS is not strictly need here, but if you remove it, then you
181# must make sure that configure.in checks for the necessary components
182# that your library may use.  TCL_DEFS can actually be a problem if
183# you do not compile with a similar machine setup as the Tcl core was
184# compiled with.
185#DEFS		= $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS)
186DEFS		= @DEFS@ $(PKG_CFLAGS)
187
188CONFIG_CLEAN_FILES = Makefile
189
190CPPFLAGS	= @CPPFLAGS@
191LIBS		= @PKG_LIBS@ @LIBS@
192AR		= @AR@
193CFLAGS		= @CFLAGS@
194COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
195
196#========================================================================
197# Start of user-definable TARGETS section
198#========================================================================
199
200#========================================================================
201# TEA TARGETS.  Please note that the "libraries:" target refers to platform
202# independent files, and the "binaries:" target inclues executable programs and
203# platform-dependent libraries.  Modify these targets so that they install
204# the various pieces of your package.  The make and install rules
205# for the BINARIES that you specified above have already been done.
206#========================================================================
207
208all: binaries libraries doc
209
210#========================================================================
211# The binaries target builds executable programs, Windows .dll's, unix
212# shared/static libraries, and any other platform-dependent files.
213# The list of targets to build for "binaries:" is specified at the top
214# of the Makefile, in the "BINARIES" variable.
215#========================================================================
216
217binaries: $(BINARIES) pkgIndex.tcl-hand
218
219libraries:
220
221doc:
222
223install: all install-binaries install-libraries install-doc
224
225install-binaries: binaries install-lib-binaries install-bin-binaries
226
227#========================================================================
228# This rule installs platform-independent files, such as header files.
229#========================================================================
230
231install-libraries: libraries $(SCRIPTS)
232	@mkdir -p $(DESTDIR)$(includedir)
233	@echo "Installing header files in $(DESTDIR)$(includedir)"
234	@list='$(PKG_HEADERS)'; for i in $$list; do \
235	    echo "Installing $(srcdir)/$$i" ; \
236	    $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
237	done;
238# install standalone scripts and their man pages, if requested
239	@mkdir -p $(DESTDIR)$(prefix)/bin
240	-for i in $(SCRIPT_LIST) ; do \
241	  if [ -f $$i ] ; then \
242	    $(INSTALL_PROGRAM) $$i $(DESTDIR)$(prefix)/bin/$$i ; \
243	    rm -f $$i ; \
244	  else true; fi ; \
245	done
246
247#========================================================================
248# Install documentation.  Unix manpages should go in the $(mandir)
249# directory.
250#========================================================================
251
252install-doc: doc
253	@mkdir -p $(DESTDIR)$(mandir)/man1
254	@mkdir -p $(DESTDIR)$(mandir)/man3
255	@echo "Installing documentation in $(DESTDIR)$(mandir)"
256# install Expect man page
257	$(INSTALL_DATA) $(srcdir)/expect.man $(DESTDIR)$(mandir)/man1/expect.1
258# install man page for Expect library
259	$(INSTALL_DATA) $(srcdir)/libexpect.man $(DESTDIR)$(mandir)/man3/libexpect.3
260	-for i in $(SCRIPT_MANPAGE_LIST) ; do \
261	  if [ -f $(srcdir)/example/$$i.man ] ; then \
262	    $(INSTALL_DATA) $(srcdir)/example/$$i.man $(DESTDIR)$(mandir)/man1/$$i.1 ; \
263	  else true; fi ; \
264	done
265
266test: binaries libraries
267	$(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
268
269shell: binaries libraries
270	@$(TCLSH) $(SCRIPT)
271
272expectshell: binaries libraries
273	@$(TCLSH_ENV) expect $(SCRIPT)
274
275gdb:
276	$(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT)
277
278depend:
279
280#========================================================================
281# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
282# mentioned above.  That will ensure that this target is built when you
283# run "make binaries".
284#
285# The $(PKG_OBJECTS) objects are created and linked into the final
286# library.  In most cases these object files will correspond to the
287# source files above.
288#========================================================================
289
290$(PKG_LIB_FILE): $(PKG_OBJECTS)
291	-rm -f $(PKG_LIB_FILE)
292	${MAKE_LIB}
293	$(RANLIB) $(PKG_LIB_FILE)
294
295$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
296	-rm -f $(PKG_STUB_LIB_FILE)
297	${MAKE_STUB_LIB}
298	$(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
299
300#========================================================================
301# We need to enumerate the list of .c to .o lines here.
302#
303# In the following lines, $(srcdir) refers to the toplevel directory
304# containing your extension.  If your sources are in a subdirectory,
305# you will have to modify the paths to reflect this:
306#
307# Expect.$(OBJEXT): $(srcdir)/generic/Expect.c
308# 	$(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/Expect.c` -o $@
309#
310# Setting the VPATH variable to a list of paths will cause the makefile
311# to look into these paths when resolving .c to .obj dependencies.
312# As necessary, add $(srcdir):$(srcdir)/compat:....
313#========================================================================
314
315VPATH = $(srcdir)
316
317.c.@OBJEXT@:
318	$(COMPILE) -c `@CYGPATH@ $<` -o $@
319
320#========================================================================
321# Create the pkgIndex.tcl file.
322# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but
323# you may find that you need to customize the package.  If so, either
324# modify the -hand version, or create a pkgIndex.tcl.in file and have
325# the configure script output the pkgIndex.tcl by editing configure.in.
326#========================================================================
327
328pkgIndex.tcl:
329	( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH)
330
331pkgIndex.tcl-hand:
332	(echo 'if {![package vsatisfies [package provide Tcl] @TCL_VERSION@]} {return}' ; \
333	 echo 'package ifneeded Expect $(PACKAGE_VERSION) \
334	    [list load [file join $$dir $(PKG_LIB_FILE)]]'\
335	) > pkgIndex.tcl
336
337#========================================================================
338# Distribution creation
339# You may need to tweak this target to make it work correctly.
340#========================================================================
341
342#COMPRESS	= tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
343COMPRESS	= gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
344DIST_ROOT	= /tmp/dist
345DIST_DIR	= $(DIST_ROOT)/$(PKG_DIR)
346
347dist-clean:
348	rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
349
350dist: dist-clean doc
351	mkdir -p $(DIST_DIR)
352	cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/doc/license* \
353		$(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \
354		$(DIST_DIR)/
355	chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
356	chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in
357
358	mkdir $(DIST_DIR)/tclconfig
359	cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
360		$(DIST_DIR)/tclconfig/
361	chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
362	chmod +x $(DIST_DIR)/tclconfig/install-sh
363
364	-list='htdocs/art demos generic library mac tests unix win tea.tests tools tools/rules'; \
365	for p in $$list; do \
366	    if test -d $(srcdir)/$$p ; then \
367		mkdir -p $(DIST_DIR)/$$p; \
368		cp -p $(srcdir)/$$p/*.* $(srcdir)/$$p/* $(DIST_DIR)/$$p/; \
369	    fi; \
370	done
371
372	-list='doc'; \
373	for p in $$list; do \
374	    if test -d $$p ; then \
375		mkdir -p $(DIST_DIR)/$$p; \
376		cp -p $$p/*.* $$p/* $(DIST_DIR)/$$p/; \
377	    fi; \
378	done
379	-mv $(DIST_DIR)/htdocs/art $(DIST_DIR)/doc/art
380	rm -rf $(DIST_DIR)/htdocs
381
382	(cd $(DIST_ROOT); $(COMPRESS);)
383
384dist_orig:
385	rm -rf $(PKG_DIR)*
386	ls -d $(srcdir)/* > __FILES
387	mkdir $(PKG_DIR)
388	cp -rf `cat __FILES | grep -v __FILES` $(PKG_DIR)
389	rm __FILES
390	find $(PKG_DIR) -name CVS -prune -exec rm -rf {} \;
391	cd $(PKG_DIR) ; $(TCLSH_PROG) PREPARE
392	-tar cf - $(PKG_DIR) | gzip --best > $(PKG_DIR).tar.gz
393	-tar cf - $(PKG_DIR) | bzip2 > $(PKG_DIR).tar.bz2
394	-zip -r $(PKG_DIR).zip $(PKG_DIR)
395	rm -rf $(PKG_DIR)
396
397$(SCRIPTS):
398	$(TCLSH) $(srcdir)/fixline1 $(SHORT_BINDIR) < $(srcdir)/example/$@ > $@
399
400## We cannot use TCL_LIBS below (after TCL_LIB_SPEC) because its
401## expansion references the contents of LIBS, which contains linker
402## options we cannot use here (and which is what we are replacing in
403## the first place).
404
405expect:	exp_main_exp.o $(PKG_LIB_FILE)
406	$(CC) \
407		@CFLAGS@ \
408		@TCL_LD_FLAGS@ \
409		-o expect exp_main_exp.o \
410		@EXP_BUILD_LIB_SPEC@ \
411		@TCL_LIB_SPEC@ \
412		@TCL_DL_LIBS@ @PKG_LIBS@ @MATH_LIBS@ \
413		@TCL_CC_SEARCH_FLAGS@ \
414		@EXP_CC_SEARCH_FLAGS@
415	$(SETUID) expect
416
417expectk:
418	@echo "expectk remove from distribution"
419	@echo "use tclsh with package require Tk and Expect"
420
421#========================================================================
422# Produce FAQ and homepage
423#========================================================================
424
425WEBDIR = /proj/itl/www/div826/subject/expect
426VERSION = $(PACKAGE_VERSION)
427
428# create the FAQ in html form
429FAQ.html:	FAQ.src FAQ.tcl
430	FAQ.src html > FAQ.html
431
432# create the FAQ in text form
433FAQ:	FAQ.src FAQ.tcl
434	FAQ.src text > FAQ
435
436# generate Expect home page
437homepage.html:	homepage.src homepage.tcl expect.tar.gz.md5
438	homepage.src > homepage.html
439
440expect.tar.gz.md5:	expect-$(VERSION).tar.gz
441	md5 expect-$(VERSION).tar.gz > expect.tar.gz.md5
442
443# install various html docs on our web server
444install-html:	FAQ.html homepage.html
445	cp homepage.html $(WEBDIR)/index.html
446	cp FAQ.html $(WEBDIR)
447
448# HTMLize man pages for examples and push them out to the web server
449example-man-pages:
450	-for i in $(SCRIPT_MANPAGE_LIST) ; do \
451	  if [ -f $(srcdir)/example/$$i.man ] ; then \
452	    rman -f HTML $(srcdir)/example/$$i.man > $(srcdir)/example/$$i.man.html ; \
453	    cp $(srcdir)/example/$$i.man.html $(FTPDIR)/example ; \
454	  else true; fi ; \
455	done
456
457#========================================================================
458# Push out releases
459#========================================================================
460
461FTPDIR = /proj/itl/www/div826/subject/expect
462
463# make a private tar file for myself
464tar:	expect-$(VERSION).tar
465	mv expect-$(VERSION).tar expect.tar
466
467# make a release and install it on ftp server
468# update web page to reflect new version
469ftp:	expect-$(VERSION).tar.Z expect-$(VERSION).tar.gz install-html homepage.html
470	cp expect-$(VERSION).tar.Z $(FTPDIR)/expect.tar.Z
471	cp expect-$(VERSION).tar.gz $(FTPDIR)/expect.tar.gz
472	cp expect-$(VERSION).tar.gz $(FTPDIR)/old/expect-$(VERSION).tar.gz
473	md5 $(FTPDIR)/expect.tar.gz > expect.tar.gz.md5
474	cp HISTORY $(FTPDIR)
475	cp README $(FTPDIR)/README.distribution
476	cp example/README $(FTPDIR)/example
477	cp `pubfile example` $(FTPDIR)/example
478	ls -l $(FTPDIR)/expect.tar*
479#	delete .Z temp file, still need .gz though for md5 later
480	rm expect-$(VERSION).tar*
481
482# make an alpha release and install it on ftp server
483alpha:	expect-$(VERSION).tar.Z expect-$(VERSION).tar.gz
484	cp expect-$(VERSION).tar.Z $(FTPDIR)/alpha.tar.Z
485	cp expect-$(VERSION).tar.gz $(FTPDIR)/alpha.tar.gz
486	cp HISTORY $(FTPDIR)
487	rm expect-$(VERSION).tar*
488	ls -l $(FTPDIR)/alpha.tar*
489
490# make a beta release and install it on ftp server
491beta:	expect-$(VERSION).tar.Z expect-$(VERSION).tar.gz
492	rm -rf $(FTPDIR)/alpha.tar*
493	cp expect-$(VERSION).tar.Z $(FTPDIR)/beta.tar.Z
494	cp expect-$(VERSION).tar.gz $(FTPDIR)/beta.tar.gz
495	cp HISTORY $(FTPDIR)
496	rm expect-$(VERSION).tar*
497	ls -l $(FTPDIR)/beta.tar*
498
499expect-$(VERSION).tar: configure
500	rm -f ../expect-$(VERSION)
501	ln -s `pwd` ../expect-$(VERSION)
502	cd ..;tar cvfh $@ `pubfile expect-$(VERSION)`
503	mv ../$@ .
504
505expect-$(VERSION).tar.Z:	expect-$(VERSION).tar
506	compress -fc expect-$(VERSION).tar > $@
507
508expect-$(VERSION).tar.gz:	expect-$(VERSION).tar
509	gzip -fc expect-$(VERSION).tar > $@
510
511#========================================================================
512# End of user-definable section
513#========================================================================
514
515#========================================================================
516# Don't modify the file to clean here.  Instead, set the "CLEANFILES"
517# variable in configure.in
518#========================================================================
519
520clean:  
521	-test -z "$(BINARIES)" || rm -f $(BINARIES)
522	-rm -f *.$(OBJEXT) core *.core
523	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
524
525distclean: clean
526	-rm -f *.tab.c
527	-rm -f $(CONFIG_CLEAN_FILES)
528	-rm -f config.cache config.log config.status
529
530#========================================================================
531# Install binary object libraries.  On Windows this includes both .dll and
532# .lib files.  Because the .lib files are not explicitly listed anywhere,
533# we need to deduce their existence from the .dll file of the same name.
534# Library files go into the lib directory.
535# In addition, this will generate the pkgIndex.tcl
536# file in the install location (assuming it can find a usable tclsh shell)
537#
538# You should not have to modify this target.
539#========================================================================
540
541install-lib-binaries:
542	@mkdir -p $(DESTDIR)$(pkglibdir)
543	@list='$(lib_BINARIES)'; for p in $$list; do \
544	  if test -f $$p; then \
545	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
546	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
547	    stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
548	    if test "x$$stub" = "xstub"; then \
549		echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
550		$(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
551	    else \
552		echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
553		$(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
554	    fi; \
555	    ext=`echo $$p|sed -e "s/.*\.//"`; \
556	    if test "x$$ext" = "xdll"; then \
557		lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
558		if test -f $$lib; then \
559		    echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
560	            $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \
561		fi; \
562	    fi; \
563	  fi; \
564	done
565	@list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
566	  if test -f $(srcdir)/$$p; then \
567	    destp=`basename $$p`; \
568	    echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
569	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \
570	  fi; \
571	done
572	@if test "x$(SHARED_BUILD)" = "x1"; then \
573	    echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \
574	    $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \
575	fi
576
577#========================================================================
578# Install binary executables (e.g. .exe files and dependent .dll files)
579# This is for files that must go in the bin directory (located next to
580# wish and tclsh), like dependent .dll files on Windows.
581#
582# You should not have to modify this target, except to define bin_BINARIES
583# above if necessary.
584#========================================================================
585
586install-bin-binaries:
587	@mkdir -p $(DESTDIR)$(bindir)
588	@list='$(bin_BINARIES)'; for p in $$list; do \
589	  if test -f $$p; then \
590	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
591	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
592	  fi; \
593	done
594
595.SUFFIXES: .c .$(OBJEXT) .man .n .html
596
597#Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
598#	cd $(top_builddir) \
599#	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
600
601uninstall-binaries:
602	list='$(lib_BINARIES)'; for p in $$list; do \
603	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \
604	done
605	list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
606	  p=`basename $$p`; \
607	  rm -f $(DESTDIR)$(pkglibdir)/$$p; \
608	done
609	list='$(bin_BINARIES)'; for p in $$list; do \
610	  rm -f $(DESTDIR)$(bindir)/$$p; \
611	done
612
613#========================================================================
614#
615# Target to regenerate header files and stub files from the *.decls tables.
616#
617#========================================================================
618
619genstubs:
620	$(TCLSH_PROG)	\
621		$(srcdir)/tools/genStubs.tcl $(srcdir)/generic	\
622		$(srcdir)/Expect.decls
623
624#========================================================================
625#
626# Target to check that all exported functions have an entry in the stubs
627# tables.
628#
629#========================================================================
630
631Expect_DECLS = \
632	$(srcdir)/expect.decls
633
634checkstubs:
635	-@for i in `nm -p $(Expect_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \
636		| sort -n`; do \
637		match=0; \
638		for j in $(Expect_DECLS); do \
639		    if [ `grep -c $$i $$j` -gt 0 ]; then \
640			match=1; \
641		    fi; \
642		done; \
643		if [ $$match -eq 0 ]; then echo $$i; fi \
644	done
645
646
647.PHONY: all binaries clean depend distclean doc install libraries test chantest
648
649# Tell versions [3.59,3.63) of GNU make to not export all variables.
650# Otherwise a system limit (for SysV at least) may be exceeded.
651.NOEXPORT:
652