Tycho directory layout

Tycho has a certain directory structure that you need to know about if you are planning on extending tycho.

  • $TYCHO/README.files contains a description of the tycho directory structure.
  • tylndir and private trees
  • makefile structure
  • makefile rules

  • tylndir

    The script $TYCHO/bin/tylndir will create a private directory tree with links to a common Tycho tree. This allows tycho developers to maintain their own tree and edit it as they see fit.

    For example, to create your own private tree in ~/ty from the sources in ~ptdesign/tycho, do the following:

    1. mkdir ~/ty
    2. cd ~/ty
    3. ~ptdesign/tycho/bin/tylndir ~ptdesign/tycho
    4. Set your TYCHO environment to ~/ty. If you are running the C shell, you would type:
      setenv TYCHO ~/ty
      
      You could place the above line in your .cshrc file so that it is set each time you log in.
    5. Place $TYCHO/bin in your path:
      set path = ($TYCHO/bin $path)
      
    6. Start tycho with files in your private tree by typing tycho.
    tylndir is not perfect, as it will create links for garbage files such as ,* and *~ in your private tree.

    makefile structure

    It is best if the makefiles do not contain any GNU make extensions so that the makefiles can be used with non-GNU make.

    The general structure of a tycho makefile is

    1. A header that includes a one line summary, author, version and copyright information.
    2. A section that sets the makefile variables ROOT and VPATH.
      ROOT
      is a relative path to the top of the tycho distribution
      VPATH
      is a pathname to the current directory that uses $(ROOT).
      For example, $TYCHO/kernel/makefile contains:
      # Root of Tycho directory
      ROOT =		..
      
      # True source directory
      VPATH =		$(ROOT)/kernel
      
    3. A section that includes $TYCHO/mk/tycho.mk, which is a makefile that sets common makefile variables. For example:
      # Get configuration info
      CONFIG =	$(ROOT)/mk/tycho.mk
      include $(CONFIG)
      
    4. A section that sets makefile variables to files in the current directory.
      TCL_SRCS
      Tcl source files that usually have a .tcl suffix
      ITCL_SRCS
      Itcl source files that usually have a .itcl suffix
      EXTRA_SRCS
      Usually set to $(TCL_SRCS) $(ITCL_SRCS). The name EXTRA_SRCS is from Ptolemy, it denotes that these files are not compiled or otherwise processed.
      MISC_FILES
      This variable lists files that are part of the distribution but are not source files per se. MISC_FILES usually includes the names of any subdirectories, along with tclIndex and any README files that might be present. make checkjunk uses this variable.
      DIRS
      This variable lists any subdirectories that we should run make in.
      REALCLEAN_STUFF
      Files to be removed by make realclean
      TYDOC_DESC
      Title for the tydoc documentation system index page.
    5. The next section consists of any rules. Usually there is only a all and install rule:
      all install: sources $(MISC_SRCS) tclIndex
      
    6. The final section includes the makefile that has rules that are common to all tycho makefiles. This file is usually $TYCHO/mk/no-compile.mk

    makefile rules

    The following makefile rules are defined in $TYCHO/mk/no-compile.mk These rules are useful when extending Tycho.
    make sources
    This rule will update any source files that are out of date. The publicly available distribution of tycho does not include version control files, but the development distribution at UC Berkeley does have version control files. If a directory has version control files, then make sources will update any files that have changed in the master tree, but not in the local tree.
    make all
    For the most part, tycho uses interpreted files that do not require compilation, so make all does things like create tclIndex files, and fix the permissions on scripts. make all also runs the make sources rules.
    make install
    In tycho, make install usually just does whatever make all does. In tycho, there is no need to run make install after running make all. make install is present only for compatibility with other packages, such as Ptolemy.

    File Manipulation makefile rules

    The following makefile rules are used to manipulate files in the distribution
    make clean
    This rule removes files that are generated by installation or editing files. The files removed include: *.o core *~ *.bak ,*
    make realclean
    This rule does everything make clean does, and it removed any files named in the REALCLEAN_STUFF makefile variable. For example, in $TYCHO/kernel/makefile REALCLEAN_STUFF is set so that tclIndex is removed when make realclean is run
    make extraclean
    This rule removes the sources, along with everything that make realclean does. Note that to retrieve the sources automatically after running make extracleanyou need to have the sources checked into RCS or SCCS. The publically available distribution of tycho does not include SCCS files, so running this command is not recommended make extraclean sources is a good way to change all the links created by tylndir into actual files.
    make sccsinfo
    This rule is only useful if the tycho distribution has SCCS version control information. The publicly available distribution does not have SCCS version control information, so this rule is only useful in the tycho development tree. make sccsinfo traverses the distribution and runs sccs info in each directory. sccs info prints out the names of any files that are checked out.
    make checkjunk
    The make checkjunk rule traverses the distribution and prints the names of any files that are not mentioned in the makefile. This rule is useful for cleaning up the distribution before release.

    Tycho Home Page


    Copyright © 1996, The Regents of the University of California. All rights reserved.
    Last updated: 96/08/31, comments to: tycho@eecs.berkeley.edu