Creating a Project with SDK and Unix

Unlike other integrated environments, in Unix we will be using a combination of tools and programs to manage our work. For our purposes, making a project will consist of the following steps:

  1. Create a project directory with mkdir.
  2. Create or copy any Java files or packages needed into that directory.
  3. Create or copy a make file.

A make file will be used to keep track of our program once we start breaking it up into pieces. For now we will ignore the make file, but will revisit it in the future.

You have already created the directory 0, so step 1 is complete.

Adding the ann Package to Your Project

Our project will require the ann.easyio package to run. You will use cp to accomplish the task. Your instructor will give you the exact command and paths for copying ann package into your directory.

You may also need to copy the annMakefile into your directory as well. Once it is there, at the unix prompt enter:

   % make -f annMakefile

This will compile the source files in the ann package you just copied and make object files that can be linked into program.

You should only have to do this particular make step once at the creation of the project.

Adding the hoj Package to Your Project

In some later projects, you will want to add the hoj package to your projects in addition to the ann package. The process will basically be the same as for the ann package. In this case the make file is called hojMakefile and unix command will be:

% make -f annMakefile

Creating a Makefile

We used make to compile the code in our packages. Later we will use make to control the compilation of the code in our project that we have written. By convention we will store commands for the make program in a file named Makefile. For some of the projects there is a make file already defined. They are in the directory Makefiles. The make file for a particular lab (if it exists) will have the lab number added as a suffix. After copying it, you will want to rename it to be just Makefile.



Back to the Lab

Back to the Table of Contents

Back to the Introduction

Copyright 2000 by Prentice Hall. All rights reserved.