# Generated automatically from Makefile.in by configure.
#
# Makefile --
#
# Top-level makefile for Extended Tcl.
# 
#------------------------------------------------------------------------------
# Copyright 1992-1995 Karl Lehenbauer and Mark Diekhans.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies.  Karl Lehenbauer and
# Mark Diekhans make no representations about the suitability of this
# software for any purpose.  It is provided "as is" without express or
# implied warranty.
#------------------------------------------------------------------------------
# $Id: Makefile.in,v 5.0 1995/07/25 06:00:54 markd Rel $
#------------------------------------------------------------------------------
#
SHELL=/bin/sh

#------------------------------------------------------------------------------
# Autoconfig defines that can be overridden in Config.mk

CC                = gcc
CFLAGS            = -g
CXX               = c++
CXXFLAGS          = -g
RANLIB            = ranlib
STRIP             = @STRIP@
srcdir            = .
srcbasedir        = /opt/dsap/tcl7.4tk4.0/itcl2.0/tclX7.4a-p2
bldbasedir        = /opt/dsap/tcl7.4tk4.0/itcl2.0/tclX7.4a-p2
prefix            = /opt/dsap/tcl7.4tk4.0
exec_prefix       = ${prefix}
ARCH              = 

#------------------------------------------------------------------------------
# Include user-editable defines.

include ${bldbasedir}/Config.mk

#------------------------------------------------------------------------------
# Flags that were passed on the command line that are to be passed on to
# second level makes.  C++ flags are only passed to the src dir build.

PASS_FLAGS = "CC=${CC}" "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}"
PASSXX_FLAGS = ${PASS_FLAGS} "CXX=${CXX}" "CXXFLAGS=${CXXFLAGS}"

#------------------------------------------------------------------------------
# The made.tmp files are used to indicate a makefile has successfully added
# it's .o files to a library.  We need to purge the right ones one a new
# library is copied.

TCLMADE.TMP = osSupport/made.tmp src/made.tmp
TKMADE.TMP  = tksrc/made.tmp

#------------------------------------------------------------------------------

all: TCLX runtcl COMP_${TK_BUILD}

#------------------------------------------------------------------------------
# Compile the Extended Tcl library and link the Tcl shell.
#

TCLX: runtcl
	cd tools;     ${MAKE} ${PASS_FLAGS} all
	cd osSupport; ${MAKE} ${PASS_FLAGS} all
	cd src;       ${MAKE} ${PASSXX_FLAGS} all
	cd tclsrc;    ${MAKE} ${PASS_FLAGS} all
	cd tests;     ${MAKE} ${PASS_FLAGS} all
	cd src;       ${MAKE} ${PASSXX_FLAGS} checkup

#------------------------------------------------------------------------------
# Generate a wish shell {wishx} with Extended Tcl commands.
#

COMP_WISHX: runwishx
	cd tksrc;    ${MAKE} ${PASS_FLAGS} all
	cd tktclsrc; ${MAKE} ${PASS_FLAGS} all
	cd tktests;  ${MAKE} ${PASS_FLAGS} all

COMP_:

#------------------------------------------------------------------------------
# Generate scripts to point the TCLX_LIBRARY/TKX_LIBRARY environment variable
# at the local master directories so tcl & wishx can be run before installing.

runtcl:
	@echo '#!/bin/sh'                                           >runtcl
	@echo '# script for testing Tcl before installation'       >>runtcl
	@echo "TCLX_LIBRARY=${bldbasedir}/tclmaster"               >>runtcl
	@echo "TCL_PROGRAM=${bldbasedir}/src/tcl"                  >>runtcl
	@echo "export TCLX_LIBRARY TCL_PROGRAM"                    >>runtcl
	@echo "if [ \$$# = 0 ]"                                    >>runtcl
	@echo "then"                                               >>runtcl
	@echo "    exec \$$TCL_PROGRAM"                            >>runtcl
	@echo "else"                                               >>runtcl
	@echo "    exec \$$TCL_PROGRAM \"\$$@\""                   >>runtcl
	@echo "fi"                                                 >>runtcl
	chmod a+rx runtcl

runwishx:
	@echo '#!/bin/sh'                                          >runwishx
	@echo '# script for testing wishx before installation'    >>runwishx
	@echo "TCLX_LIBRARY=${bldbasedir}/tclmaster"              >>runwishx
	@echo "TKX_LIBRARY=${bldbasedir}/tkmaster"                >>runwishx
	@echo "TCL_PROGRAM=${bldbasedir}/src/tcl"                 >>runwishx
	@echo "WISHX=${bldbasedir}/tksrc/wishx"                   >>runwishx
	@echo "export TCLX_LIBRARY TKX_LIBRARY TCL_PROGRAM"       >>runwishx
	@echo "if [ \$$# = 0 ]"                                   >>runwishx
	@echo "then"                                              >>runwishx
	@echo "    exec \$$WISHX"                                 >>runwishx
	@echo "else"                                              >>runwishx
	@echo "    exec \$$WISHX \"\$$@\""                        >>runwishx
	@echo "fi"                                                >>runwishx
	chmod a+rx runwishx

#------------------------------------------------------------------------------
# Test to see if the C++ include file compiles and links.

tcl++:
	cd src;${MAKE} tcl++

#------------------------------------------------------------------------------
# Relink using shared libraries.  The libraries must be built and installed
# by hand.

shlink: TCL_SHLINK SHLINK_${TK_BUILD}

TCL_SHLINK:
	cd src;  ${MAKE} ${PASSXX_FLAGS} shlink

SHLINK_WISHX:
	cd tksrc;  ${MAKE} ${PASSXX_FLAGS} shlink

SHLINK_:

#------------------------------------------------------------------------------
# Run the tests.

test: all
	cd tests;     ${MAKE} ${PASS_FLAGS} test

ucbtests: all
	cd tests;     ${MAKE} ${PASS_FLAGS} ucbtests

extdtests: all
	cd tests;     ${MAKE} ${PASS_FLAGS} extdtests

tktest: all
	cd tktests;   ${MAKE} ${PASS_FLAGS} test

#------------------------------------------------------------------------------
# Rebuild help files.  The are shipped with TclX, but can be rebuilt if Tcl or
# Tk versions have changed.

buildhelp: buildtclhelp buildtkhelp

buildtclhelp:
	cd tclsrc;   ${MAKE} buildtclhelp

buildtkhelp:
	cd tktclsrc; ${MAKE} buildtkhelp

#------------------------------------------------------------------------------

install: all TCLXINSTALL INST_${TK_BUILD}

install-exec: all TCLXINSTALL_EXEC INST_EXEC_${TK_BUILD}

TCLXINSTALL:
	@echo ""
	@echo "   Install Extended Tcl using standard model"
	@echo ""
	cd src;       ${MAKE} install
	cd tclsrc;    ${MAKE} install
	cd man;       ${MAKE} install

TCLXINSTALL_EXEC:
	@echo ""
	@echo "   Install Extended Tcl executables using standard model"
	@echo ""
	cd src;       ${MAKE} install-exec

TKXINSTALL:
	cd tksrc;     ${MAKE} install
	cd tktclsrc;  ${MAKE} install

TKXINSTALL_EXEC:
	cd tksrc;     ${MAKE} install-exec
	cd tktclsrc;  ${MAKE} install-exec

# Targets to decide if we install wishx or not.

INST_WISHX: TKXINSTALL
INST_EXEC_WISHX: TKXINSTALL_EXEC

INST_:
INST_EXEC_:

#------------------------------------------------------------------------------
# Install Extended Tcl using the master directory model.

install-master: all MASTER-NOTE TCLXMINSTALL ${TK_BUILD}MMAYBE

install-master-exec: all MASTER-NOTE TCLXMINSTALL-EXEC ${TK_BUILD}MMAYBE-EXEC

MASTER-NOTE:
	@echo ""
	@echo "*************************************************************"
	@echo "*** TclX currently does not build symbolic links to the   ***"
	@echo "*** manual pages in the master directories.  If you need  ***"
	@echo "*** these man page links you must build them by hand.     ***"
	@echo "*************************************************************"
	@echo ""

TCLXMINSTALL:
	@echo ""
	@echo "   Install TclX using master directory model"
	@echo ""
	cd src;       ${MAKE} install-master
	cd tclsrc;    ${MAKE} install-master
	cd man;       ${MAKE} install-master

TCLXMINSTALL-EXEC:
	@echo ""
	@echo "   Install TclX executables using master directory model"
	@echo ""
	cd src;       ${MAKE} install-master-exec

TKXMINSTALL:
	cd tksrc;     ${MAKE} install-master
	cd tktclsrc;  ${MAKE} install-master
	cd man;       ${MAKE} install-tk-master

TKXMINSTALL-EXEC:
	cd tksrc;     ${MAKE} install-master-exec
	cd tktclsrc;  ${MAKE} install-master-exec

# Fake targets to decide if we install wishx or not.

MMAYBE:
MMAYBE-EXEC:

WISHXMMAYBE: TKXMINSTALL
WISHXMMAYBE-EXEC: TKXMINSTALL-EXEC

#------------------------------------------------------------------------------
# Clean up all files that were built by make.

clean:
	cd tools;     ${MAKE} ${PASS_FLAGS} clean
	cd osSupport; ${MAKE} ${PASS_FLAGS} clean
	cd src;       ${MAKE} ${PASS_FLAGS} clean
	cd tclsrc;    ${MAKE} ${PASS_FLAGS} clean
	cd tksrc;     ${MAKE} ${PASS_FLAGS} clean
	cd tktclsrc;  ${MAKE} ${PASS_FLAGS} clean
	cd tests;     ${MAKE} ${PASS_FLAGS} clean
	cd tktests;   ${MAKE} ${PASS_FLAGS} clean
	cd man;       ${MAKE} ${PASS_FLAGS} clean
	-rm -f runtcl runwishx
	-rm -rf tclmaster tkmaster

#------------------------------------------------------------------------------
# Restore to the distributed state.

distclean: clean
	cd tools;     ${MAKE} ${PASS_FLAGS} distclean
	cd osSupport; ${MAKE} ${PASS_FLAGS} distclean
	cd src;       ${MAKE} ${PASS_FLAGS} distclean
	cd tclsrc;    ${MAKE} ${PASS_FLAGS} distclean
	cd tksrc;     ${MAKE} ${PASS_FLAGS} distclean
	cd tktclsrc;  ${MAKE} ${PASS_FLAGS} distclean
	cd tests;     ${MAKE} ${PASS_FLAGS} distclean
	cd tktests;   ${MAKE} ${PASS_FLAGS} distclean
	cd man;       ${MAKE} ${PASS_FLAGS} distclean
	rm -f Makefile config.status config.cache config.log

# Disable Sun's parallel make, it doesn't get the dependencies right.
.NO_PARALLEL:
