# Surprise! This is an executable README. You can run it with "sh # README". It compiles and runs three simple demos on the directory # /tmp/mktclapp, by default linking them with libtcl8.2 and libtk8.2; # to use other versions of the libraries you need to call this script # with the environment variables TCL and TK set to the right versions, # for example by doing: # TCL=8.0 TK=8.0 sh README # # Note: this file is Edrx's fault and is in the public domain. # Please don't blame D. Hipp for it! Thanks... # (find-node "(bash)Simple Command Expansion" "Otherwise") # (find-fline "Makefile") # Implement another way to set the library versions; # invoking like "sh README TCL=8.0 TCK=8.0" will also work. if [ $# != 0 ]; then export $* fi # Echo each next line before executing it. set -v # Use a temporary directory. Clean it first. rm -Rv /tmp/mktclapp mkdir /tmp/mktclapp cd /tmp/mktclapp cp -v /usr/doc/mktclapp/examples/* . # Run the "factor" demo. Note that the Tcl command "factor" is written in C. make factor cat factor.tcl ./factor factor.tcl read -p 'Press Enter to continue...' # the "factor" demo again, but now as a Tcl extension: make factor.so cat factor2.tcl tclsh factor2.tcl read -p 'Press Enter to continue...' # Run the "hello" demo, first without then with ballon help. make hello cp -v hello0.tcl hello.tcl ./hello cp -v hellob.tcl hello.tcl ./hello # Now you may want to clean the mess this script has left at /tmp/mktclapp. # I'm not cleaning it myself because I think you'd like to inspect it. :-)