FCM System User Guide Annex: Declarations in FCM build package configuration file
Author: FCM development team
Keywords: FCM, user guide, annex

# Annex:
Declarations in FCM build package configuration file

The following is a list of supported declarations for package configuration files. The package configuration is used by the build system. It must be stored in a file called `@PACKAGE.cfg` in a source directory. The labels in all declarations in a package configuration file contain two fields delimited by the double colon "::". The first field is the name of the label, which is case insensitive. The second field is the name of a file, which the declaration is associated with.

Label | Content
--- | ---
TYPE::file | Description | This declares the type of file. The value of this declaration is a list of type flags delimited by the double colon "::". Each type flag is used internally to describe the nature of the file. Supported flags are the same as those used in the INFILE_EXT declarations in the build configuration file. For a list of these flags, please see the Input file extension type flags table of the FCM System User Guide > Annex: Declarations in FCM build configuration file document.
Example |
    # Declare a Fortran 9X program source file
    type::MyFortranProg.f90  FORTRAN::FORTRAN9X::SOURCE::PROGRAM

    # Declare a target to build a shared object library
    type::libbooks.a         BINARY::LIB
SCAN::file | Description | This declares a flag to determine whether file needs to be scanned for dependency. Set the value to 1 to switch on, and 0 to switch off. If file is declared a shared library, this flag is automatically set to 0. For all other files, this flag is automatically set to 1.
Example |
    scan::MyFortranProg.f90  0
TARGET::file | Description | This declares the executable name of file if it is a C or Fortran program. If not set, the default executable name of a program is the root name (i.e. base name without the file extension) of file suffixed with the file extension ".exe".
Example |
    target::MyFortranProg.f90  hello_world
INTNAME::file | Description | This declares the internal name of file if it contains a Fortran subroutine, function or module. The internal name determines the name of the compiled object file of file. If not set, the default depends on whether the file will be scanned for dependencies. If so, the name of the first program unit will be used as the internal name. Otherwise, the root name of file will be used.
Example |
    intname::YourFortranMod.f90  hello_mod
DEP::file | Description | This declares a dependency target for file. The value of this declaration must contain two fields separated by the double colon "::". The first field denotes the dependency type, and the second field is the dependency target. Supported dependency types are the same as those used in the EXCL_DEP declarations in the build configuration file. For a list of these flags, please see the dependency types table of the FCM System User Guide > Annex: Declarations in FCM build configuration file document.
Example |
    dep::MyFortranProg.f90  USE::YourFortranMod
    dep::MyFortranProg.f90  INTERFACE::HerFortran.interface
    dep::MyFortranProg.f90  INC::HisFortranInc.inc
    dep::MyFortranProg.f90  H::TheirHeader.h
    dep::MyFortranProg.f90  OBJ::ItsObject.o

    dep::libbooks.a         OBJ::MyObject.o
    dep::libbooks.a         OBJ::YourObject.o
    dep::libbooks.a         OBJ::HisObject.o
    dep::libbooks.a         OBJ::HerObject.o
    dep::libbooks.a         OBJ::TheirObject.o
    dep::libbooks.a         OBJ::ItsObject.o
Label | Content