Tycho has a certain directory structure that you need to know about if you are planning on extending tycho.
tylndir
$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 and to get changes that other developers make.
For example, to create your own private tree in ~/ty
from
the master sources in ~ptdesign/tycho
, do the following:
mkdir ~/ty
cd ~/ty
~ptdesign/tycho/bin/tylndir ~ptdesign/tycho
TYCHO
environment to ~/ty
.
If you are running the C shell, you would type:
setenv TYCHO ~/tyYou could place the above line in your
.cshrc
file so that
it is set each time you log in.
$TYCHO/bin
in your path:
set path = ($TYCHO/bin $path)
tycho
.
tylndir
is not perfect, as it will create links for garbage
files such as ,*
and *~
in your private tree.
The tree that tylndir
builds has links for the
SCCS
directories, so that everyone is sharing the
the master ~ptdesign
SCCS
directories via links.
When you start using your tree, most of the files are also links.
If you check out a file, then the link is removed, and checked out
version of the file is put in its place. The SCCS version control system
creates a lock file in the shared SCCS
directory.
so that noone can check out that file while you have it checked out.
To update your tree, you do cd $TYCHO; make sources
.
This will update any files that have been changed by others.
It would be nice if we had CVS and could have concurrent and truly parallel trees, but the amount of training is fairly substantial.
It is best if the makefiles do not contain any
GNU make
extensions so that the makefiles can be used with non-GNU
make
. Over time we are migrating away from makefiles and
using Tcl scripts and the BuilderDialog instead.
The Makefile editor can insert a makefile template by using the
Template
choice of the Special
menu.
$TYCHO/edit/textedi/templates/Cmakefile.mk
contains the template that the
Makefile editor actually inserts.
The general structure of a Tycho makefile is
ROOT
and
VPATH
.
ROOT
VPATH
$(ROOT)
.
$TYCHO/kernel/gui/makefile
contains:
# Root of Tycho directory ROOT = .. # True source directory VPATH = $(ROOT)/kernel/gui
$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)
TCL_SRCS
.tcl
suffix
ITCL_SRCS
.itcl
suffix
EXTRA_SRCS
$(TCL_SRCS) $(ITCL_SRCS)
. The name
EXTRA_SRCS
is from Ptolemy and indicates that these files
are not compiled or otherwise processed.
MISC_FILES
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
REALCLEAN_STUFF
make realclean
TYDOC_DESC
all
and install
rule:
all install: sources $(MISC_SRCS) tclIndex
$TYCHO/mk/no-compile.mk
$TYCHO/mk/no-compile.mk
These rules are useful when extending Tycho.
make sources
make sources
will update any files that have changed
in the master tree, but not in the local tree.
make all
make all
does things like create
tclIndex
files, and fix the permissions on scripts.
make all
also runs the make sources
rules.
make install
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.
make clean
*.o core *~ *.bak ,*
make realclean
make clean
does, and it
removed any files named in the REALCLEAN_STUFF
makefile
variable. For example, in $TYCHO/kernel/gui/makefile
REALCLEAN_STUFF
is set so that tclIndex
is
removed when make realclean
is run
make extraclean
make realclean
does. Note that to retrieve the sources
automatically after running make extraclean
you 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
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
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.