Документ взят из кэша поисковой машины. Адрес оригинального документа : http://xmm.vilspa.esa.es/sas/6.0.0/doc/devel/make.html
Дата изменения: Wed Aug 9 16:29:06 2000
Дата индексирования: Sat Dec 22 07:16:01 2007
Кодировка:

Поисковые слова: manicouagan crater
SAS Makefiles

SAS Makefiles

Using Makefiles

Quick guide

Explanation

  1. To build the entire sas, you untar the packages in a subdirectory packages and do

    packages/sas/install
    ./configure
    source sas-setup.csh
    make

    The 'make' will build the libraries, executables and documentation. When an error occurs it will continue building the rest. If one or more errors occurred it will report an error at the very end. The file build.html provides a table with all the errors that were encountered.

    If you want to run the tests, you do

    make test

    This will run all tests, and exit with an error message at the end if one ore more tests failed.

    If you have installed all the required and optional software no error should occur, since we only distribute packages that give no error on our systems.

  2. To build only your package you can do

    make

    at the toplevel of your package. This will build libraries, executables and documentation. You see a + for each stage that worked and a - if an error occurred. The file build_log contains the full make output.

    Unfortunately, and this is the accidental problem, if you do 'make' in a ~subdirectory~ of your package, it will do nothing and report an error. In this case you should do 'make depend', 'make bin' or 'make doc', depending on what you want to make. 

  3. You can perform a thorough check on your package or on the entire SAS with 

    make check

    If run at the toplevel of the SAS, it will traverse all packages; if run at the toplevel of a package, it will check and build the package. Note that this command will clean everything first, so it is not very suited for incremental builds during development. It will produce a +/- table, and after completion the file check.html provides a table of errors.

    When you want to submit a package you run 

    make check

    at the toplevel of your package, and no - should appear.

  4. If you want to run the stages of a make by hand, and see the commands and error rolling over your screen, you can perform the build stages by hand:

    make depend
    make bin
    make doc

    You can also do
    make clean
    or
    make clobber
    as you like

    All these procedures work recursively on all subdirectories.

  5. After building the entire SAS, you might want to know whether enough succeeded to be able to develop new tasks. You can run
    constructManifest
    at the SAS toplevel. This will construct a file manifest.ok that contains the packages that built OK. It exits with an error if that is not enough to build new tasks.

Writing Makefiles

Each subdirectory contains a Makefile that includes the toplevel Make.include. The Makefile defines variables that define the targets and the contents of the targets (e.g. a task and the object files that should be linked to generate it).

Each Makefile should define a few variables and then include the toplevel Makefile:

# Makefile
<var> = <value>
<var> = <value>
include $(SAS_DIR)/Make.include
Possible values for <var> are: For a complete list of variables see the top section of Make.include.

Examples

A package that is split out into several subdirectories might contain the following Makefiles: A simple package might combine the contents of several of these subdirectories. Ultimately only a single directory could be used that contains

Make.include

The Make.include is generated from a Make.include.in by the configure script, which is to be run by the user that wants to compile the SAS. The configure script will check the environment and adopt to a different compiler or operating system.

The configure script is generated from configure.in by the developers by running autoconf.

Modifying the rules

To modify the rules for the make procedure:
Updated on: August 9, 2000