[fpc-pascal] fpmake question

Bernd prof7bit at googlemail.com
Thu Jun 14 17:38:57 CEST 2012


I have some questions about fpmake. I cannot find any real examples or
helpful explanations about it, so I'm currently experimenting with the
incomplete information from the wiki.

>From what I have understood so far (might be completely wrong) I
assume that my fpmake.pp is the equivalent of the Makefile (containing
all the targets, rules and other logic) and fppkg is the equivalent of
the make command.

the folder structure I currently have (without fpmake) is here:
https://github.com/prof7bit/TorChat/tree/

As you can see currently I have a bunch of small handcrafted
makefiles. One top level makefile and the folders below src also have
their own makefiles and the targets are just doing simple stuff and
calling fpc with some options. Now I am investigating whether I could
change this so that I am using fpmake instead of make.

I have now started experimenting with the folder 'src/core/' because
this one is self-contained and does not have any dependencies (but
other parts of the project will depend on it and use it. Note also
that currently for example purpletorchat.lpi has all these core units
as part of the project, I assume I need to remove them).

now I have started with the simple example from the wiki and put an
fpmake.pas into the core folder (exactly next to all the other unit
files in the core folder) containing this:

program fpmake;

uses fpmkunit;

Var
  P: TPackage;
  T: TTarget;

begin
  With Installer do begin
    P := AddPackage('core');
    P.Directory := '.';
    P.OSes := [win32,openbsd,netbsd,freebsd,darwin,linux];
    P.Targets.AddUnit('tc_interfaces');
    P.Targets.AddUnit('tc_client');
    // most other units still missing because I get errors alread,
    // don't understand how this is supposed to work.
    Run;
  end;
end.

now (while in the core folder) from the console I do fppkg build and
this happens:

bernd at t40:~/proj/git_torchat_laz/src/core\ $ fppkg build
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
Start building package core for target i386-linux.
Warning: Source file "tc_interfaces" from package core not found for i386-linux
Warning: Source file "tc_client" from package core not found for i386-linux
The installer encountered the following error:
Could not compile target tc_interfaces from package core
The FPC Package tool encountered the following error:
[<currentdir>] Execution of FPMake build failed

I don't have the slightest idea what is going on here, why can't it
find the units, what is the string argument in AddPackage() supposed
to mean (is it a name or a directory), what does 'AddPackge' even mean
(to *what* will the package be added? Can't I have a package without
adding it to anything? I just want to compile the units and maybe
(later) depending on the build environment do some other stuff
before/after compiling. Is fpmake even the right tool to use or should
I stick with makefiles?)

Bernd



More information about the fpc-pascal mailing list