Sign in Join
FPDoc Onlineexperiment

Variables that affect the generated makefile

The makefile generated by fpcmake contains a lot of variables. Some of them are set in the makefile itself, others can be set and are taken into account when set.

These variables can be split in two groups:

  • Directory variables.

  • Compiler command line variables.

Each group will be discussed separately.

Directory variables

The first set of variables controls the directories that are recognized in the makefile. They should not be set in the Makefile.fpc file, but can be specified on the command line.

INCDIR

This is a list of directories, separated by spaces, that will be added as include directories to the compiler command line. Each directory in the list is prepended with -Fi and added to the compiler options.

UNITDIR

This is a list of directories, separated by spaces, that will be added as unit search directories to the compiler command line. Each directory in the list is prepended with -Fu and added to the compiler options.

LIBDIR

Is a list of library paths, separated by spaces. Each directory in the list is prepended with -Fl and added to the compiler options.

OBJDIR

Is a list of object file directories, separated by spaces, that is added to the object files path, i.e. Each directory in the list is prepended with -Fo.

Compiler command line variables

The following variables can be set on the make command line, they will be recognized and integrated in the compiler command line options.:

CREATESMART

If this variable is defined, it tells the compiler to create smartlinked units. Adds -CX to the command line options.

DEBUG

If defined, this will cause the compiler to include debug information in the generated units and programs. It adds -gl to the compiler command line, and will define the DEBUG define.

LINKSMART

Defining this variable tells the compiler to use smartlinking. It adds -XX to the compiler command line options.

OPT

Any options that you want to pass to the compiler. The contents of OPT is simply added to the compiler command line.

OPTDEF

Are optional defines, added to the command line of the compiler. They get -d prepended to them.

OPTIMIZE

If this variable is defined, this will add -OG2p3 to the command line options.

RELEASE

If this variable is defined, this will add the -Xs -OG2p3 -n options to the command line options, and will define the RELEASE define.

STRIP

If this variable is defined, this will add the -Xs option to the command line options.

VERBOSE

If this variable is defined, then -vnwi will be added to the command line options.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.