home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / tcl / tcl+tk+t / tclx7.3bl / tclx7 / tclX7.3b / Makefile.in < prev    next >
Encoding:
Makefile  |  1994-07-16  |  13.6 KB  |  379 lines

  1. #
  2. # Makefile --
  3. #
  4. # Top-level makefile for Extended Tcl.
  5. #------------------------------------------------------------------------------
  6. # Copyright 1992-1994 Karl Lehenbauer and Mark Diekhans.
  7. #
  8. # Permission to use, copy, modify, and distribute this software and its
  9. # documentation for any purpose and without fee is hereby granted, provided
  10. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  11. # Mark Diekhans make no representations about the suitability of this
  12. # software for any purpose.  It is provided "as is" without express or
  13. # implied warranty.
  14. #------------------------------------------------------------------------------
  15. # $Id: Makefile.in,v 4.0 1994/07/16 05:31:16 markd Rel $
  16. #------------------------------------------------------------------------------
  17. #
  18. SHELL=/bin/sh
  19.  
  20. #------------------------------------------------------------------------------
  21. # Autoconfig defines that can be overridden in Config.mk
  22.  
  23. CC                = @CC@
  24. MCS               = @MCS_CMD@
  25. RANLIB            = @RANLIB@
  26. srcdir            = @srcdir@
  27. srcbasedir        = @srcbasedir@
  28. bldbasedir        = @bldbasedir@
  29. VPATH             = @srcdir@
  30. prefix            = /usr/local
  31. exec_prefix       = /usr/local
  32. ARCH              = @TCL_ARCH@
  33. MAN_DIR_SEPARATOR = @MAN_DIR_SEPARATOR@
  34. TCL_INST_MASTER   = ${TCL_MASTERDIR}/`tools/tclxversion`
  35. TK_INST_MASTER    = ${TK_MASTERDIR}/`tools/tkxversion`
  36.  
  37. #------------------------------------------------------------------------------
  38. # Include user-editable defines.
  39.  
  40. @MAKEINCLUDE@ @MAKEQUOTE@${bldbasedir}/Config.mk@MAKEQUOTE@
  41.  
  42. #------------------------------------------------------------------------------
  43. # Other macros.
  44.  
  45. LIBTCL_A   = tclmaster/lib${ARCH}/libtcl.a
  46. TCL_H      = tclmaster/include/tcl.h
  47. LIBTK_A    = tkmaster/lib${ARCH}/libtk.a
  48. TK_H       = tkmaster/include/tk.h
  49. INSTCOPY   = ./runtcl tools/instcopy
  50. CPMANPAGES = ./runtcl ${bldbasedir}/tools/cpmanpages
  51. SYMLINKEXT = ${bldbasedir}/tools/symlinkext
  52.  
  53. #------------------------------------------------------------------------------
  54. # Flags that were passed on the command line that are to be passed on to
  55. # second level makes.
  56.  
  57. PASS_FLAGS = "CC=$(CC)" "CFLAGS=$(CFLAGS)"
  58.  
  59. #------------------------------------------------------------------------------
  60. # The made.tmp files are used to indicate a makefile has successfully added
  61. # it's .o files to a library.  We need to purge the right ones one a new
  62. # library is copied.
  63.  
  64. TCLMADE.TMP = osSupport/made.tmp src/made.tmp
  65. TKMADE.TMP  = tksrc/made.tmp
  66.  
  67. #------------------------------------------------------------------------------
  68.  
  69. all: TCLX runtcl ${TK_BUILD}
  70.  
  71. #------------------------------------------------------------------------------
  72. # Compile the Extended Tcl library and link the Tcl shell.
  73. #
  74.  
  75. TCLX: TCLCOPY runtcl
  76.     cd tools;     ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} all
  77.     cd osSupport; ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} all
  78.     cd src;       ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} all
  79.     cd tclsrc;    ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} all
  80.  
  81. #------------------------------------------------------------------------------
  82. # Copy include and library files from the UCB Tcl distribution to the
  83. # tclmaster directory.
  84. #
  85. TCLCOPY: MKTCLDIRS ${LIBTCL_A} ${TCL_H}
  86.  
  87. MKTCLDIRS:
  88.     -mkdir tclmaster                2>/dev/null; exit 0
  89.     -mkdir tclmaster/lib${ARCH}     2>/dev/null; exit 0
  90.     -mkdir tclmaster/include        2>/dev/null; exit 0
  91.     -mkdir tclmaster/bin${ARCH}     2>/dev/null; exit 0
  92.     -mkdir tclmaster/src            2>/dev/null; exit 0
  93.  
  94. ${LIBTCL_A}: ${TCL_UCB_LIB}/libtcl.a
  95.     rm -f ${LIBTCL_A}
  96.     cp ${TCL_UCB_LIB}/libtcl.a ${LIBTCL_A}
  97.     ${RANLIB} ${LIBTCL_A}
  98.  
  99. ${TCL_H}: ${TCL_UCB_SRC}/tcl.h
  100.     rm -f ${TCL_H}
  101.     cp ${TCL_UCB_SRC}/tcl.h ${TCL_H}
  102.  
  103. #------------------------------------------------------------------------------
  104. # Generate a wish shell {wishx} with Extended Tcl commands.
  105. #
  106.  
  107. WISHX: TKCOPY runwishx
  108.     cd tksrc;    ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} all
  109.     cd tktclsrc; ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} all
  110.  
  111. #------------------------------------------------------------------------------
  112. # Copy include and library files from the UCB Tk distribution to the
  113. # tkmaster directory.
  114. #
  115.  
  116. TKCOPY: MKTKDIRS ${LIBTK_A} ${TK_H}
  117.  
  118. MKTKDIRS:
  119.     -mkdir tkmaster                2>/dev/null; exit 0
  120.     -mkdir tkmaster/lib${ARCH}     2>/dev/null; exit 0
  121.     -mkdir tkmaster/include        2>/dev/null; exit 0
  122.     -mkdir tkmaster/bin${ARCH}     2>/dev/null; exit 0
  123.     -mkdir tkmaster/src            2>/dev/null; exit 0
  124.  
  125. ${LIBTK_A}: ${TK_UCB_LIB}/libtk.a
  126.     rm -f ${LIBTK_A}
  127.     cp ${TK_UCB_LIB}/libtk.a ${LIBTK_A}
  128.     ${RANLIB} ${LIBTK_A}
  129.  
  130. ${TK_H}: ${TK_UCB_SRC}/tk.h
  131.     rm -f ${TK_H}
  132.     cp ${TK_UCB_SRC}/tk.h ${TK_H}
  133.  
  134. #------------------------------------------------------------------------------
  135. # Generate scripts to point the TCL_LIBRARY/TK_LIBRARY environment variable at
  136. # the local master directories so tcl & wishx can be run before installing.
  137.  
  138. runtcl:
  139.     @echo ':'                                                  >runtcl
  140.     @echo '# script for testing Tcl before installation'      >>runtcl
  141.     @echo "TCL_LIBRARY=`pwd`/tclmaster"                       >>runtcl
  142.     @echo "TCL_PROGRAM=`pwd`/tclmaster/bin${ARCH}/tcl"        >>runtcl
  143.     @echo "export TCL_LIBRARY TCL_PROGRAM"                    >>runtcl
  144.     @echo "if [ \$$# = 0 ]"                                   >>runtcl
  145.     @echo "then"                                              >>runtcl
  146.     @echo "    exec \$$TCL_PROGRAM"                           >>runtcl
  147.     @echo "else"                                              >>runtcl
  148.     @echo "    exec \$$TCL_PROGRAM \"\$$@\""                  >>runtcl
  149.     @echo "fi"                                                >>runtcl
  150.     chmod a+rx runtcl
  151.  
  152. runwishx:
  153.     @echo ':'                                                  >runwishx
  154.     @echo '# script for testing wishx before installation'    >>runwishx
  155.     @echo "TCL_LIBRARY=`pwd`/tclmaster"                       >>runwishx
  156.     @echo "TK_LIBRARY=`pwd`/tkmaster"                         >>runwishx
  157.     @echo "TCL_PROGRAM=`pwd`/tclmaster/bin${ARCH}/tcl"        >>runwishx
  158.     @echo "WISHX=`pwd`/tkmaster/bin${ARCH}/wishx"             >>runwishx
  159.     @echo "export TCL_LIBRARY TK_LIBRARY TCL_PROGRAM"         >>runwishx
  160.     @echo "if [ \$$# = 0 ]"                                   >>runwishx
  161.     @echo "then"                                              >>runwishx
  162.     @echo "    exec \$$WISHX"                                 >>runwishx
  163.     @echo "else"                                              >>runwishx
  164.     @echo "    exec \$$WISHX \"\$$@\""                        >>runwishx
  165.     @echo "fi"                                                >>runwishx
  166.     chmod a+rx runwishx
  167.  
  168. #------------------------------------------------------------------------------
  169. # Test to see if the C++ include file compiles and links.
  170.  
  171. tcl++:
  172.     cd src;${MAKE} -${MAKEFLAGS} tcl++
  173.  
  174. #------------------------------------------------------------------------------
  175. # Run the UCB and Extended Tcl tests.
  176.  
  177. test: ucbtests extdtests
  178.  
  179. ucbtests: all
  180.     @echo "***************************************************************"
  181.     @echo "*** Expect warnings about not having the following commands:"
  182.     @echo "***     testasync"
  183.     @echo "***     testcmdinfo"
  184.     @echo "***     testdcall"
  185.     @echo "***     testdstring"
  186.     @echo "***     testlink"
  187.     @echo "***"
  188.     @echo "*** Expect warnings about not having the following math functions:"
  189.     @echo "***     T1"
  190.     @echo "***     T2"
  191.     @echo "***************************************************************"
  192.     @echo ""
  193.     ./runtcl -c "cd ${TCL_UCB_SRC}/tests;source ${srcbasedir}/tests/all"
  194.  
  195. extdtests: all
  196.     ./runtcl -c "cd tests;source all"
  197.  
  198. tktest: all
  199.     @echo "***************************************************************"
  200.     @echo "*** Expect warnings about not having the following commands:"
  201.     @echo "***     testmakexists"
  202.     @echo "***************************************************************"
  203.     @echo ""
  204.     cd ${srcdir}/tktests ;\
  205.         ${bldbasedir}/runwishx -f tktests.tcl -n wish ${TK_UCB_SRC}
  206.  
  207. #------------------------------------------------------------------------------
  208. # Rebuild help files.  The are shipped with TclX, but can be rebuilt if Tcl or
  209. # Tk versions have changed.
  210.  
  211. buildhelp: buildtclhelp buildtkhelp
  212.  
  213. buildtclhelp:
  214.     cd tclsrc;   ${MAKE} -${MAKEFLAGS} buildtclhelp
  215.  
  216. buildtkhelp:
  217.     cd tktclsrc; ${MAKE} -${MAKEFLAGS} buildtkhelp
  218.  
  219. #------------------------------------------------------------------------------
  220. # Install Extended Tcl using the standard model
  221.  
  222. install: all TCLXINSTALL TCLXINSTALL-EXEC \
  223.              ${TK_BUILD}MAYBE ${TK_BUILD}MAYBE-EXEC
  224.  
  225. install-exec: all TCLXINSTALL-EXEC ${TK_BUILD}MAYBE-EXEC
  226.  
  227. TCLXINSTALL:
  228.     @echo ""
  229.     @echo "   Install Extended Tcl using standard model"
  230.     @echo ""
  231.     rm -rf ${TCL_INST_MASTER}
  232.     ${INSTCOPY} tclmaster/*.tcl tclmaster/*.tlib tclmaster/*.tndx \
  233.        tclmaster/help tclmaster/src ${TCL_INST_MASTER}
  234.     ${INSTCOPY} tclmaster/include/tclExtend.h tclmaster/include/tcl++.h \
  235.        ${TCL_INCLUDEDIR}
  236.     ${CPMANPAGES} -rmcat @${MAN_DIR_SEPARATOR}@ \
  237.         ${TCL_MAN_CMD_SECTION} ${TCL_MAN_FUNC_SECTION} @@ \
  238.         ${srcbasedir}/man ${TCL_MAN_BASEDIR}
  239.  
  240. TCLXINSTALL-EXEC:
  241.     ${INSTCOPY} tclmaster/bin${ARCH}/tcl ${TCL_BINDIR}
  242.     strip ${TCL_BINDIR}/tcl
  243.     ${MCS} ${TCL_BINDIR}/tcl
  244.     ${INSTCOPY} tclmaster/lib${ARCH}/libtclx.a ${TCL_LIBDIR}
  245.     ${RANLIB} ${TCL_LIBDIR}/libtclx.a
  246.  
  247. TKXINSTALL:
  248.     rm -rf ${TK_INST_MASTER}
  249.     ${INSTCOPY} tkmaster/*.tcl tkmaster/*.tlib tkmaster/*.tndx \
  250.        tkmaster/help tkmaster/src tkmaster/*.ps tkmaster/demos \
  251.        ${TK_INST_MASTER}
  252.  
  253. TKXINSTALL-EXEC:
  254.     ${INSTCOPY} tkmaster/bin${ARCH}/wishx ${TCL_BINDIR}
  255.     strip ${TCL_BINDIR}/wishx
  256.     ${MCS} ${TCL_BINDIR}/wishx
  257.     ${INSTCOPY} tkmaster/bin${ARCH}/tclhelp ${TCL_BINDIR}
  258.     ${INSTCOPY} tkmaster/lib${ARCH}/libtkx.a ${TCL_LIBDIR}
  259.     ${RANLIB} ${TCL_LIBDIR}/libtkx.a
  260.  
  261. # Fake targets to decide if we install wishx or not.
  262.  
  263. MAYBE:
  264. MAYBE-EXEC:
  265.  
  266. WISHXMAYBE: TKXINSTALL
  267. WISHXMAYBE-EXEC: TKXINSTALL-EXEC
  268.  
  269. #------------------------------------------------------------------------------
  270. # Install Extended Tcl using the master directory model.
  271.  
  272. install-master: all MASTER-NOTE TCLXMINSTALL ${TK_BUILD}MMAYBE
  273.  
  274. install-master-exec: all MASTER-NOTE TCLXMINSTALL-EXEC ${TK_BUILD}MMAYBE-EXEC
  275.  
  276. MASTER-NOTE:
  277.     @echo ""
  278.     @echo "*************************************************************"
  279.     @echo "*** TclX currently does not build symbolic links to the   ***"
  280.     @echo "*** manual pages in the master directories.  If you need  ***"
  281.     @echo "*** these man page links you must build them by hand.     ***"
  282.     @echo "*************************************************************"
  283.     @echo ""
  284.  
  285. TCLXMINSTALL:
  286.     @echo ""
  287.     @echo "   Install TclX master directory"
  288.     @echo ""
  289.     rm -rf ${TCL_INST_MASTER}
  290.     ${INSTCOPY} -dirname tclmaster ${TCL_INST_MASTER}
  291.     strip ${TCL_INST_MASTER}/bin/tcl
  292.     ${MCS}  ${TCL_INST_MASTER}/bin/tcl
  293.     ${RANLIB} ${TCL_INST_MASTER}/lib${ARCH}/*.a
  294.     ${CPMANPAGES} @${MAN_DIR_SEPARATOR}@ \
  295.         ${TCL_MAN_CMD_SECTION} ${TCL_MAN_FUNC_SECTION} @@ \
  296.         ${TCL_UCB_SRC}/doc ${TCL_INST_MASTER}/man
  297.     ${CPMANPAGES} @${MAN_DIR_SEPARATOR}@ \
  298.         ${TCL_MAN_CMD_SECTION} ${TCL_MAN_FUNC_SECTION} @@ \
  299.         ${srcbasedir}/man ${TCL_INST_MASTER}/man
  300.     ${SYMLINKEXT} ${TCL_INST_MASTER}/bin${ARCH}/* ${TCL_BINDIR}
  301.     ${SYMLINKEXT} ${TCL_INST_MASTER}/lib${ARCH}/* ${TCL_LIBDIR}
  302.     ${SYMLINKEXT} ${TCL_INST_MASTER}/include/* ${TCL_INCLUDEDIR}
  303.  
  304. TCLXMINSTALL-EXEC:
  305.     @echo ""
  306.     @echo "   Install TclX executables only"
  307.     @echo ""
  308.     ${INSTCOPY} tclmaster/bin${ARCH} ${TCL_INST_MASTER}
  309.     strip ${TCL_INST_MASTER}/bin/tcl
  310.     ${MCS}  ${TCL_INST_MASTER}/bin/tcl
  311.     ${INSTCOPY} tclmaster/lib${ARCH} ${TCL_INST_MASTER}
  312.     ${RANLIB} ${TCL_INST_MASTER}/lib${ARCH}/*.a
  313.     ${SYMLINKEXT} ${TCL_INST_MASTER}/bin${ARCH}/* ${TCL_BINDIR}
  314.     ${SYMLINKEXT} ${TCL_INST_MASTER}/lib${ARCH}/* ${TCL_LIBDIR}
  315.  
  316. TKXMINSTALL:
  317.     @echo ""
  318.     @echo "   Install TkX master directory"
  319.     @echo ""
  320.     rm -rf ${TK_INST_MASTER}
  321.     ${INSTCOPY} -dirname tkmaster ${TK_INST_MASTER}
  322.     strip ${TK_INST_MASTER}/bin/wishx
  323.     ${MCS}  ${TK_INST_MASTER}/bin/wishx
  324.     ${RANLIB} ${TK_INST_MASTER}/lib${ARCH}/*.a
  325.     ${CPMANPAGES} @${MAN_DIR_SEPARATOR}@ \
  326.         ${TK_MAN_CMD_SECTION} ${TK_MAN_FUNC_SECTION} \
  327.         ${TK_MAN_UNIXCMD_SECTION} \
  328.         ${TK_UCB_SRC}/doc ${TK_INST_MASTER}/man
  329.     ${SYMLINKEXT} ${TK_INST_MASTER}/bin${ARCH}/* ${TCL_BINDIR}
  330.     ${SYMLINKEXT} ${TK_INST_MASTER}/lib${ARCH}/* ${TCL_LIBDIR}
  331.     ${SYMLINKEXT} ${TK_INST_MASTER}/include/* ${TCL_INCLUDEDIR}
  332.  
  333. TKXMINSTALL-EXEC:
  334.     @echo ""
  335.     @echo "   Install TkX executables only"
  336.     @echo ""
  337.     ${INSTCOPY} tkmaster/bin${ARCH} ${TK_INST_MASTER}
  338.     strip ${TK_INST_MASTER}/bin/wishx
  339.     ${MCS}  ${TK_INST_MASTER}/bin/wishx
  340.     ${INSTCOPY} tkmaster/lib${ARCH} ${TK_INST_MASTER}
  341.     ${RANLIB} ${TK_INST_MASTER}/lib${ARCH}/*.a
  342.     ${SYMLINKEXT} ${TK_INST_MASTER}/bin${ARCH}/* ${TCL_BINDIR}
  343.     ${SYMLINKEXT} ${TK_INST_MASTER}/lib${ARCH}/* ${TCL_LIBDIR}
  344.  
  345. # Fake targets to decide if we install wishx or not.
  346.  
  347. MMAYBE:
  348. MMAYBE-EXEC:
  349.  
  350. WISHXMMAYBE: TKXMINSTALL
  351. WISHXMMAYBE-EXEC: TKXMINSTALL-EXEC
  352.  
  353. #------------------------------------------------------------------------------
  354. # Clean up all files that were built by make.
  355.  
  356. clean:
  357.     cd tools;     ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} clean
  358.     cd osSupport; ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} clean
  359.     cd src;       ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} clean
  360.     cd tclsrc;    ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} clean
  361.     cd tksrc;     ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} clean
  362.     cd tktclsrc;  ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} clean
  363.     -rm -f runtcl runwishx
  364.     -rm -rf tclmaster tkmaster
  365.  
  366. #------------------------------------------------------------------------------
  367. # Restore to the distributed state.
  368.  
  369. distclean: clean
  370.     cd tools;     ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} distclean
  371.     cd osSupport; ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} distclean
  372.     cd src;       ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} distclean
  373.     cd tclsrc;    ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} distclean
  374.     cd tksrc;     ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} distclean
  375.     cd tktclsrc;  ${MAKE} -${MAKEFLAGS} ${PASS_FLAGS} distclean
  376.     rm -f Makefile config.status
  377.  
  378.