Sign in Join
Wiki copytemporary

Fpcmake

Fpcmake is a makefile generator, to control the make utility by GNU. It generates a makefile named "Makefile" from a definition file called "Makefile.fpc" and its own built-in template. It is used in the FPC source tree (e.g. in FPC 2.6.0), but is planned to be succeeded by FPMake.

This template is located in utils/fpcm/fpcmake.ini, but since fpcmake.ini is included in the binary (to avoid path-searching issues), fpcmake has to be regenerated for each fpcmake.ini change.

The manual has a quite good chapter about Makefile.fpc syntax, and examples teach the rest (fpcmake.ini, the various Makefile.fpcs in the FPC source tree).

It defines some default targets that are always present:

Troubleshooting

Regenerating makefiles

Regenerating a Makefile from Makefile.fpc is quite easy. The basic syntax is

text
fpcmake -w -Tall
text
DON'T FORGET THIS WHEN COMMITTING TO FPC / LAZARUS SVN SERVER!.

For Lazarus developers:

text
YOU MUST USE THE FPC DEVELOPER VERSION (trunk, e.g. 2.7.1) TO GET ALL PLATFORMS.

If you regenerate makefiles outside the fpc/ SVN tree, (e.g. for Lazarus in projects), and fpcmake complains it can't find package.fpc for the RTL package, try setting the environment variable FPCDIR to the FPC source directory using commands like the following:

bash
# e.g. if your FPC directory is located in /location/to/fpc:
export FPCDIR=/location/to/fpc
dos
REM e.g. if your FPC directory is located in c:\location\to\fpc:
set FPCDIR=c:\location\to\fpc

Extending

CPU/OS

When adding a new operating system or CPU it's needed to extend fpcmake utility, so MAKE utility will call the proper binaries for the new target.

The following types and constants needs to be extended. The arrays are declared at fpcmmain.pp unit.

:* CpuStr - is the constant of representing strings for each TCPu entry

:* CpuSuffix - the CPU string used as a suffix. Simply by prefixing "_"

:* ppcSuffix - the CPU suffix to be used in the executable name

:* OSStr - the constant listing representing TOS as a string. The value is used when writing a file or parsing parameters

:* OSSuffix - the constant listing representing OS as a suffix

See also


From the Free Pascal wiki, page "Fpcmake", as it stood on 2022-02-17 after a change by Unxed, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.