4 # Makefile for Extended Tcl.  This requires Tcl 6.1 or Tcl 6.2 from Berkeley,
 
   5 # which should be compiled before running this makefile.  Its location is
 
   8 #------------------------------------------------------------------------------
 
   9 # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
 
  11 # Permission to use, copy, modify, and distribute this software and its
 
  12 # documentation for any purpose and without fee is hereby granted, provided
 
  13 # that the above copyright notice appear in all copies.  Karl Lehenbauer and
 
  14 # Mark Diekhans make no representations about the suitability of this
 
  15 # software for any purpose.  It is provided "as is" without express or
 
  17 #------------------------------------------------------------------------------
 
  18 # $Id: Makefile,v 2.0 1992/10/16 04:54:45 markd Rel $
 
  19 #------------------------------------------------------------------------------
 
  23 include config/$(TCL_CONFIG_FILE)
 
  26 #------------------------------------------------------------------------------
 
  28 # List of files that are touched by secondary makefiles when something changes.
 
  30 MADE.FILES=ucbsrc/made.tmp ossupp/made.tmp src/made.tmp
 
  31 TKMADE.FILES=tkucbsrc/made.tmp
 
  33 CFLAGS= $(OPTIMIZE_FLAG) $(XCFLAGS) -I$(TCL_UCB_DIR) $(MEM_DEBUG_FLAGS) \
 
  36 #------------------------------------------------------------------------------
 
  38 all: tcl tcldef runtcl $(TCL_TK_SHELL)
 
  41 #------------------------------------------------------------------------------
 
  42 # Compile the Extended Tcl library and link the Tcl shell.
 
  48         cd ucbsrc;    $(MAKE) -$(MAKEFLAGS) all
 
  49         cd ossupp;    $(MAKE) -$(MAKEFLAGS) all
 
  50         cd tclsrc;    $(MAKE) -$(MAKEFLAGS) all
 
  51         cd src;       $(MAKE) -$(MAKEFLAGS) all
 
  54 # Copy the UCB libtcl.a file from where it was built.  Force the other
 
  55 # Makefiles to add their .o files to the library by nuking their made.tmp file.
 
  57 libtcl.a: $(TCL_UCB_DIR)/libtcl.a
 
  58         cp $(TCL_UCB_DIR)/libtcl.a .
 
  61 #------------------------------------------------------------------------------
 
  62 # Generate a libtk.a with extensions and a wish shell with Extended Tcl
 
  66 wish: TKX_MAKES runwish
 
  69         cd tkucbsrc; $(MAKE) -$(MAKEFLAGS) all
 
  70         cd tksrc;    $(MAKE) -$(MAKEFLAGS) all
 
  73 # Copy the UCB libtk.a file.  Force the other Makefiles to add their
 
  74 # .o files to the library by nuking their made.tmp file.
 
  76 libtk.a: $(TCL_TK_DIR)/libtk.a
 
  77         cp $(TCL_TK_DIR)/libtk.a libtk.a
 
  81 #------------------------------------------------------------------------------
 
  82 # Generate a temporary TCLDEFAULT file so Tcl can be run in this directory.
 
  83 # Also generate a script to point the TCLDEFAULT environment variable
 
  84 # at this file for testing Tcl before its installed.
 
  87         @echo " -       Generating temporary TCLDEFAULT file.     -"
 
  88         @echo " - Use runtcl script to test Tcl before installing -"
 
  89         @echo " - Use runwish script to test Tk before installing -"
 
  90         @echo '# Temporary TCLDEFAULT file for debugging'  >tcldef
 
  91         @echo "set TCLPATH `pwd`/tcllib"                  >>tcldef
 
  92         @echo "set TCLINIT `pwd`/tcllib/tclinit.tcl"      >>tcldef
 
  96         @echo '# script for testing Tcl before installation'  >>runtcl
 
  97         @echo "TCLDEFAULT=`pwd`/tcldef"                       >>runtcl
 
  98         @echo "export TCLDEFAULT"                             >>runtcl
 
  99         @echo "if [ \$$# = 0 ]"                               >>runtcl
 
 100         @echo "then"                                          >>runtcl
 
 101         @echo "    exec `pwd`/tcl"                            >>runtcl
 
 102         @echo "else"                                          >>runtcl
 
 103         @echo "    exec `pwd`/tcl \"\$$@\""                   >>runtcl
 
 109         @echo '# script for testing wish before installation' >>runwish
 
 110         @echo "TCLDEFAULT=`pwd`/tcldef"                       >>runwish
 
 111         @echo "export TCLDEFAULT"                             >>runwish
 
 112         @echo "if [ \$$# = 0 ]"                               >>runwish
 
 113         @echo "then"                                          >>runwish
 
 114         @echo "    exec `pwd`/wish"                           >>runwish
 
 115         @echo "else"                                          >>runwish
 
 116         @echo "    exec `pwd`/wish \"\$$@\""                  >>runwish
 
 120 #------------------------------------------------------------------------------
 
 122 #  just test to see if the C++ include file compiles and links
 
 125         cd src;$(MAKE) -$(MAKEFLAGS) tclplus
 
 127 #------------------------------------------------------------------------------
 
 129 # Run the UCB and Extended Tcl tests.
 
 131 test: ucbtests extdtests
 
 135         @echo "**************************************************"
 
 136         @echo "* Ignore failures in tests:  expr-2.2 & expr-2.6 *"
 
 137         @echo "**************************************************"
 
 139         ./runtcl -c "cd $(TCL_UCB_DIR)/tests;source all"
 
 142         ./runtcl -c "cd tests;source all"       
 
 144 #------------------------------------------------------------------------------
 
 148         ./runtcl tclsrc/install.tcl
 
 151 #------------------------------------------------------------------------------
 
 152 # Clean up the mess we made.
 
 155         cd ucbsrc;    $(MAKE) -$(MAKEFLAGS) clean
 
 156         cd ossupp;    $(MAKE) -$(MAKEFLAGS) clean
 
 157         cd src;       $(MAKE) -$(MAKEFLAGS) clean
 
 158         cd tclsrc;    $(MAKE) -$(MAKEFLAGS) clean
 
 159         cd tkucbsrc;  $(MAKE) -$(MAKEFLAGS) clean
 
 160         cd tksrc;     $(MAKE) -$(MAKEFLAGS) clean
 
 161         touch junk~ config/junk~
 
 162         -rm -f *~ config/*~ libtcl.a tcldef libtk.a runtcl runwish