fpcdep
Small Free Pascal utility to generate Makefile-style dependency files from Pascal source.
- Active · last change 2-10-2026
README
fpcdep
Small Free Pascal utility to generate Makefile-style dependency files from Pascal source.
[!CAUTION] This utility will no longer be maintained for the foreseeable future. I created it to be used with a complex Makefile build system for my hobby OS kernel. I have since moved to using the FPMAKE build system which has rendered this utility deprecated.
Required
fpc
make
Build
fpcmake && makeInstall
make installClean
make cleanUsage
fpcdep [options] <input>Options
-o <x>
Output to file <x> (default is input filename with .d extension)
-t <x>
Rule target, e.g., <x> : prerequisites (default is input filename with .o extension)
-I <x>
Add <x> to include search path
-Fi <x>
Add <x> to include search path
-Fu <x>
Add <x> to unit search path
-FU <x>
Set the prerequisite unit path to <x> (default is the directory of the target)
-Pe <x>
Set the prerequisite unit extension to <x> (default is .ppu)
[!NOTE] Any options not listed above will be ignored rather than returning an error. This will allow any flag variables passed to
fpcto also be passed tofpcdep.
[!IMPORTANT] Prerequisites will not be added if
fpcdepcannot find them in any of the provided search paths.
[!IMPORTANT] For units,
fpcdepwill look for the source files,.pasor.pp, and not compiled,.ppu.
Example
Input
myprg.pas
program myprg;
uses myunit;
begin
end.myunit.pas
unit myunit;
interface
{$I myinc1.inc}
implementation
end.myinc1.inc
{$I myinc2.inc}Output
fpcdep -Pe.o -FUunits -tmyprg myprg.pas
fpcdep -tunits/myunit.o myunit.pasmyprg.d
myprg : myprg.pas units/myunit.omyunit.d
units/myunit.o : myunit.pas myinc1.inc myinc2.incLicense
MIT License. See LICENSE file.

