Getting started

The Stony Brook development system

The development system consists of multiple programs, however you perform all normal tasks using the environment. From the environment you control all aspects of creating, editing, compiling, linking and debugging programs, DLLs and code libraries.

The development system consists of the following primary programs:

The environment performs all "make" operations automatically. This means the environment automatically figures out what needs to be compiled and linked, and in what order. Your only job is to add any necessary files to a project and then you command the environment to perform the task you need.

The most common commands are:

Each of the above commands takes only a single keystroke.

For example, if you tell the environment to run a program you are working on. The environment first makes sure all files that are part of the program have been compiled with the compilation options currently in force. The environment knows what files are a part of your program because it reads the source files of the program and stores this information. Anytime a file is updated this information is updated, even when a file is altered by a program other than the environment. The environment will compile all files that need to be compiled before attempting to link the program. After compilation the environment will link the program if necessary. If files have been compiled, then linking is necessary. If nothing has changed since the last link then linking is not necessary. Finally once the program is linked then your program can be executed.

Running the environment

Windows

The environment can be found on the Stony Brook menu created at installation.

Windows Hint: You might like to create operating system shortcuts to your projects. See the How To topic Setting up your computer.

"Unix"

m2e is the program name of the environment.

Creating projects

You create projects from the file menu. You will be prompted for the operating system target of the project and for a path and name of the project. While a project is open, the current directory is the directory where the project file exists. This is important if you use relative file paths for source files. Using relative file paths allows your development projects to be moved from one directory to another, or to another machine and still function as long as the relative paths still hold true.

Location of source files

The environment uses search paths to find files. Setting up these search paths is the only time you are ever bothered with a files location on disk. Within the environment you only deal with files by their name. The environment handles the rest, by using these search paths to find the source files. The search paths are handled via the Options menu Directories option.

Note: You should not place your projects and/or source files in the compiler installation directory. You may create a directory within the install directory and place your sources and projects there if you so desire.

Editing your source files

To edit a file you simply select module in the project window and press the Enter key or double click with the mouse. The file is opened in the editor. Selecting a file is as easy as typing the module name and watching the environment select the module as you type. Say goodbye to using a "File Open" dialog to edit your source files.

Modules

This is the term we use for items contained within a project. For example two module types are language source files and binary resource files. The modules in a project are displayed in column format and are identified by their name and the type of module. You can select a module by simply typing its name and the environment will match the module name while you are typing.

Adding modules to a project

Modules are added by name. In the Stony Brook system, a modules file name and language compilation unit name must be the same. Once added, the environment uses the search paths to find the file. If not found the module is still added to the project, however it is marked as having not been found.

The environment scans your source files and will add modules to your project automatically when necessary. For example if File1 imports File2 and File2 is not currently in the project the environment will automatically add File2 to the project. At this point File2 will be scanned and the process continues until no new modules have been added. Given this, if you add just the main program module to a project all necessary files will automatically be added to the project.

Importing other projects

You can compartmentalize your code into multiple projects and import one project into another. When one project imports another project it instantly knows everything about all of the modules contained within the imported project. Modules from imported projects are never compiled and must have been compiled within their native project. This is how you create pre-compiled code with the Stony Brook development system.

The runtime library included with your language is a project that is automatically imported into all projects that you create and therefore the modules within this project are always available to use.

Using your existing source files

To quickly get going and build your program(s) with Stony Brook, follow these steps.

  1. Determine where you want to create the project. Do not create project in the same directory as the Stony Brook installation. You can create your own directory within this directory if you like.
  2. Create your project file
  3. Setup the directory search paths so that the environment can find all of the source files that make up your program.
  4. Add the main program file to the project.
  5. Link, Run or Debug your program.

Learning more...

To learn more about the environment concepts and operation consult the Basic Skills help topic.

The Modula-2 and Ada95 topics contain information specific to developing supported applications with each development system.

The How To help topic in this help file contains numerous topics discussing specific features and actions. This section also contains tips for efficient use of the development system.