B Building SURF

The Surf development tree is in CVS and has the layout shown in Fig. 1. The development version can be built by using the default make target in the surf directory or by running the individual makefiles in the sculib, surflib, surf_kap and src directories. The Surf monolith is built in the src directory along with compilation of the IFC files (the monolith IFL file is created automatically from the task IFL files).

The current development version number (i.e. the version number written to history components of the NDF files) is defined in src/makefile via the PKG_VERS variable. (see surf_set_app_name.F for more information on the setting of the version number in the monolith.


  surf ---- src                          Top level surf_* and IFL files
        |
        |-- surflib                      surflib source code
        |
        |-- sculib                       sculib source code
        |
        |-- surf_kap                     Useful routines from KAPPA
        |
        |-- scripts                      Scripts (eg surf.csh, remdbm.pl)
        |
        |-- misc                         Miscellaneous (eg ipfile.dat)
        |
        |-- dream                        DREAM mode import routine
        |
        |-- starlink                     Starlink makefiles
        |
        |-- docs --------- hlp           On-line help system
                       |
                       |-- sun216        Main SURF documentation
                       |
                       |-- sc10          Photometry cookbook
                       |
                       |-- sc11          Mapping cookbook
                       |
                       |-- sc11_mini     mini mapping cookbook

Figure 1: Directory layout of SURF development system. CVS directories are not shown.


In order to generate a Starlink distribution the export target must be used from the root makefile. This generates tar files from each directory and copies them to the starlink directory. If required, the version number must be updated manually in the Starlink makefile. The platform dependencies are stored in the mk script that is used to run make with the correct environment. The environment is selected with the SYSTEM environment variable and can be one of sun4_Solaris, ix86_Linux or alpha_OSF1.

Once the SYSTEM environment variable has been set the mk script can be run to build and export Surf:

./mk export_source

Exports the source into a compressed tar file ready for distribution.
./mk build

Builds the monolith, extracting source files from tar files as required.
./mk export

Exports the built system into a compressed tar file ready for distribution. This will include the source code.
./mk export_run

Exports the run-only system into a compressed tar file ready for distribution. This will not include the source code.
./mk install

Installs the built system into the directory structure specified by the INSTALL environment variable. Files are installed below this directory into bin/surf, docs, help/surf and dates. Soft links are made from the installed binary directory to the current directory so that the installed files can be seen. Usually, INSTALL is set to /star.
./mk deinstall

Deinstall the package.