Variables set by fpcmake
The makefile generated by fpcmake contains a lot of makefile variables. fpcmake will write all of the keys in the makefile.fpc as makefile variables in the form SECTION_KEYNAME. This means that the following section:
[package] name=mysql version=1.0.5
will result in the following variable definitions:
override PACKAGE_NAME=mysql override PACKAGE_VERSION=1.0.5
Most targets and rules are constructed using these variables. They will be listed below, together with other variables that are defined by fpcmake.
The following sets of variables are defined:
Directory variables.
Program names.
File extensions.
Target files.
Each of these sets is discussed in the subsequent:
Directory variables
The following compiler directories are defined by the makefile:
- BASEDIR
-
Is set to the current directory if the
pwdcommand is available. If not, it is set to ’.’. - COMPILER_INCDIR
-
Is a space-separated list of include file paths. Each directory in the list is prepended with
-Fiand added to the compiler options. Set by theincdirkeyword in theCompilersection. - COMPILER_LIBDIR
-
Is a space-separated list of library paths. Each directory in the list is prepended with
-Fland added to the compiler options. Set by thelibdirkeyword in theCompilersection. - COMPILER_OBJDIR
-
Is a list of object file directories, separated by spaces. Each directory in the list is prepended with
-Foand added to the compiler options. Set by theobjdirkeyword in theCompilersection. - COMPILER_TARGETDIR
-
This directory is added as the output directory of the compiler, where all units and executables are written, i.e. it gets
-FEprepended. It is set by thetargetdirkeyword in theCompilersection. - COMPILER_TARGETUNITDIR
-
If set, this directory is added as the output directory of the compiler, where all units and executables are written, i.e. it gets
-FUprepended.It is set by thetargetdirkeyword in theDirssection. - COMPILER_UNITDIR
-
Is a list of unit directories, separated by spaces. Each directory in the list is prepended with
-Fuand is added to the compiler options. Set by theunitdirkeyword in theCompilersection. - GCCLIBDIR
-
(Linuxonly) Is set to the directory where
libgcc.ais. Ifneedgcclibis set toTruein theLibssection, then this directory is added to the compiler command line with-Fl. - OTHERLIBDIR
-
Is a space-separated list of library paths. Each directory in the list is prepended with
-Fland added to the compiler options. If it is not defined on linux, then the contents of the/etc/ld.so.conffile is added.
The following directories are used for installs:
- INSTALL_BASEDIR
-
Is the base for all directories where units are installed. By default, On Linux, this is set to
$(INSTALL_PREFIX)/lib/fpc/$(RELEASEVER).
On other systems, it is set to$(PREFIXINSTALLDIR). You can also set it with thebasedirvariable in theInstallsection. - INSTALL_BINDIR
-
Is set to
$(INSTALL_BASEDIR)/binon Linux, and
$(INSTALL_BASEDIR)/bin/$(OS_TARGET)on other systems. This is the place where binaries are installed. - INSTALL_DATADIR
-
The directory where data files are installed. Set by the
Datakey in theInstallsection. - INSTALL_LIBDIR
-
Is set to
$(INSTALL_PREFIX)/lib on Linux,
and$(INSTALL_UNITDIR)on other systems. - INSTALL_PREFIX
-
Is set to
/usr/localon Linux,/ppon DOS or . Set by theprefixkeyword in theInstallsection. - INSTALL_UNITDIR
-
Is where units will be installed. This is set to
$(INSTALL_BASEDIR)/units/$(OS_TARGET). If the units are compiled as a package,$(PACKAGE_NAME)is added to the directory.
Target variables
The second set of variables controls the targets that are constructed by the makefile. They are created by fpcmake, so you can use them in your rules, but you shouldn’t assign values to them yourself.
- TARGET_DIRS
-
This is the list of directories that make will descend into when compiling. Set by the
Dirskey in theTargetsection? - TARGET_EXAMPLES
-
The list of examples programs that must be compiled. Set by the
exampleskey in theTargetsection. - TARGET_EXAMPLEDIRS
-
The list of directories that make will descend into when compiling examples. Set by the
exampledirskey in theTargetsection. - TARGET_LOADERS
-
Is a list of space-separated names that identify loaders to be compiled. This is mainly used in the compiler’s RTL sources. It is set by the
loaderskeyword in theTargetssection. - TARGET_PROGRAMS
-
This is a list of executable names that will be compiled. the makefile appends
$(EXEEXT)to these names. It is set by theprogramskeyword in theTargetsection. - TARGET_UNITS
-
This is a list of unit names that will be compiled. The makefile appends
$(PPUEXT)to each of these names to form the unit file name. The sourcename is formed by adding$(PASEXT). It is set by theunitskeyword in theTargetsection. - ZIPNAME
-
Is the name of the archive that will be created by the makefile. It is set by the
zipnamekeyword in theZipsection. - ZIPTARGET
-
Is the target that is built before the archive is made. This target is built first. If successful, the zip archive will be made. It is set by the
ziptargetkeyword in theZipsection.
Compiler command line variables
The following variables control the compiler command line:
- CPU_SOURCE
-
The source CPU type is added as a define to the compiler command line. This is determined by the Makefile itself.
- CPU_TARGET
-
The target CPU type is added as a define to the compiler command line. This is determined by the Makefile itself.
- OS_SOURCE
-
What platform the makefile is used on. Detected automatically.
- OS_TARGET
-
What platform will be compiled for. Added to the compiler command line with a
-Tprepended.
Program names
The following variables are program names, used in makefile targets.
- AS
-
The assembler. Default set to
as. - COPY
-
A file copy program. Default set to
cp -fp. - COPYTREE
-
A directory tree copy program. Default set to
cp -frp. - CMP
-
A program to compare files. Default set to
cmp. - DEL
-
A file removal program. Default set to
rm -f. - DELTREE
-
A directory removal program. Default set to
rm -rf. - DATE
-
A program to display the date.
- DIFF
-
A program to produce diff files.
- ECHO
-
An echo program.
- FPC
-
The Free Pascal compiler executable. Default set to
ppc386.exe - INSTALL
-
A program to install files. Default set to
install -m 644on Linux. - INSTALLEXE
-
A program to install executable files. Default set to
install -m 755on Linux. - LD
-
The linker. Default set to
ld. - LDCONFIG
-
(Linuxonly) The program used to update the loader cache.
- MKDIR
-
A program to create directories if they don’t exist yet. Default set to
install -m 755 -d. - MOVE
-
A file move program. Default set to
mv -f. - PP
-
The Free Pascal compiler executable. Default set to
ppc386.exe - PPAS
-
The name of the shell script created by the compiler if the
-soption is specified. This command will be executed after compilation, if the-soption was detected among the options. - PPUMOVE
-
The program to move units into one big unit library.
- PWD
-
The pwd program.
- SED
-
A stream-line editor program. Default set to
sed. - UPX
-
An executable packer to compress your executables into self-extracting compressed executables.
- ZIPPROG
-
A zip program to compress files. Zip targets are made with this program.
File extensions
The following variables denote extensions of files. These variables include the . (dot) of the extension. They are appended to object names.
- ASMEXT
-
Is the extension of assembler files produced by the compiler.
- LOADEREXT
-
Is the extension of the assembler files that make up the executable startup code.
- OEXT
-
Is the extension of the object files that the compiler creates.
- PACKAGESUFFIX
-
Is a suffix that is appended to package names in zip targets. This serves so packages can be made for different OSes.
- PPLEXT
-
Is the extension of shared library unit files.
- PPUEXT
-
Is the extension of default units.
- RSTEXT
-
Is the extension of the
.rstresource string files. - SHAREDLIBEXT
-
Is the extension of shared libraries.
- SMARTEXT
-
Is the extension of smartlinked unit assembler files.
- STATICLIBEXT
-
Is the extension of static libraries.
Target files
The following variables are defined to make targets and rules easier:
- COMPILER
-
Is the complete compiler command line, with all options added, after all
Makefilevariables have been examined. - DATESTR
-
Contains the date.
- UNITPPUFILES
-
A list of unit files that will be made. This is just the list of unit objects, with the correct unit extension appended.
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
