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.
fpc
make
fpcmake && makemake installmake cleanfpcdep [options] <input>-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 fpc to also be passed to fpcdep.
Important
Prerequisites will not be added if fpcdep cannot find them in any of the provided search paths.
Important
For units, fpcdep will look for the source files, .pas or .pp, and not compiled, .ppu.
myprg.pas
program myprg;
uses myunit;
begin
end.myunit.pas
unit myunit;
interface
{$I myinc1.inc}
implementation
end.myinc1.inc
{$I myinc2.inc}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.incMIT License. See LICENSE file.