Compiling the CHCI source with make
Once you have retrieved the source tree (see Retrieving the source tree with cvs) you can use the make tool to compile it.
Each directory in the source tree contains a file named Makefile that describes what should be compiled and where the compiled versions should go. In general, these simply specify that all java files that are more recent than their corresponding class files should be recompiled, with the resulting class files placed in a location specified in linc/build/Config.unix or linc/build/Config.dos. Before proceding, change the CLASS_DIR and DOCS_DIR variables in the appropriate one of these files to somewhere in your home directory. For example, if you have checked out the source in /home/your-id/linc, you probably want to set CLASS_DIR to /home/your-id/linc/classes.
In order to compile, make must be able to find the java compiler (typically javac or jikes) and tell it which libraries to compile against. This information is specified in linc/build/Config.unix for Linux/unix/osx or linc/build/Config.dos for windows.
If you are logged into java.cs.vt.edu, the existing Config.unix file should contain correct paths to all of the necessary libraries. If you are working on a remote machine, you will need to retrieve the jars specified in Config.unix (or Config.dos) to your machine and update the appropriate Config.xxx file to point to the correct locations. (Please do not check in a Config.xxx file that you have modified for use on your machine, since this may break other developer's builds.)
make should be included in most linux distributions and on the developer's tools cd under Mac OS. You can also retrieve the source from http://www.gnu.org/ and build the latest version under any unix-ish OS.
Once make has been installed, you should be able to enter the top directory of the source tree ("linc"), type "make", and go get a snack. The entire source tree should compile.
Other make notes:
-
make is recursive, so it will compile files at and below the directory where you execute it.
-
make will, by default, only compile modified files. This is generally what you want (since compiling everything is expensive), but there are some cases where this is problematic:
- Following a large update, it is often a good idea to restart compilation "from scratch". Running "
make clean" will thow away any existing compiled class files. Running make after make clean will therefore force a full, clean recompile.
- Java evaluates constants (
static final variables) at compile time. This means that if you have a constant in class A that you reference in class B, compile the two classes, and then change the value in A, make will recompile A but not B. A make clean is often the safest way to ensure that constant changes (hmmm) are recognized.
Instructions for using make in Windows
Under Windows you should install the CygWin package from http://www.cygnus.com/. This includes make and a number of other standard unix command line tools.
Before running make in CygWin, first unzip the files contained in Jars.zip [need to update this - pli] to a directory on your machine. Then edit the paths in the config.dos file located in linc\build to reflect the proper locations of the jars you just unzipped. You should then be able to run make with no problems from the CygWin shell.
|