Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-04

How to use fpcmake

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Guillermo Martínez Jiménez

Hi.

I did read the documentation, I look for more information on the Internet and I've read some Makefile.fpc files on the FPC sources, but I can't create a Makefile.fpc file for my project. I can't understand most of the options and the project is pretty complex: it's a package that includes a bunch of examples, two demos, several tools and "pasdoc-style" documentation.

Isn't a "fpcmake For Dummys" somewhere? I really need it.

Guillermo "Ñuño" Martínez

Graeme Geldenhuys
to Guillermo Martínez Jiménez

Hi Guillermo,

I struggled with it as well. Henry Vermaak then created an example for me and showed how to use it. The example he did was for the fpGUI Toolkit project.

Usage:
- Compile fpmake.pas as follows:
fpc fpmake.pas

- To find out more about what fpmake can do and see some help fpmake --help

- Build and install fpGUI
fpmake install

Note that if you installed FPC in a non-standard location on you system you need to tell fpmake which compiler and units to use. The following is all in one line:
fpmake.exe -r c:\fpc\2.2.3\bin\i386-win32\ppc386.exe -UG c:\fpc\2.2.3\units\i386-win32
or
./fpmake -v build -UG /opt/fpc/lib/fpc/2.2.3/units/i386-linux/

To view the actual fpmake.pas file, you can check-out fpGUI from SourceForge, or view the specific file via the following url.

http://fpgui.git.sourceforge.net/git/gitweb.cgi?p=fpgui;a=blob;f=src/fpmake.pas;h=80e0be3d69132ae12b2c4c970fe29e14c500cb14;hb=67f8fcc69fec98c12d2dac11980ed97d12d380c6

If you have problems with the full URL, you can also use this one:

http://tinyurl.com/ce8s52

I have not read the documentation of fpmake for some time, but when I did, it was not clear as to how to compile and use it. I'll download a new copy of the documentation to see if things are improved - and contribute some "newbie" help if nothing has changed.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Joost van der Sluis
to Graeme Geldenhuys

Op dinsdag 14-04-2009 om 08:41 uur [tijdzone +0200], schreef Graeme Geldenhuys:

I have not read the documentation of fpmake for some time, but when I did, it was not clear as to how to compile and use it. I'll download a new copy of the documentation to see if things are improved - and contribute some "newbie" help if nothing has changed.

TYou are confusing fpcmake and fpmake. The question was about fpcmake and that is indeed pretty difficult. I woudn't use its anymore and go for the new fpmake-system.

But fpmake is still experimental and there's no real documentation available. So I doubt that you read it at all. ;)

But your short introduction to fpmake is quite good.

Joost.

Graeme Geldenhuys
to Joost van der Sluis
Joost van der Sluis wrote
> contribute some "newbie" help if nothing has changed. TYou are confusing fpcmake and fpmake. The question was about fpcmake and that is indeed pretty difficult.

Oops, my apologies. I did not realize it was the one spelt with a 'c'. :-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Guillermo Martínez Jiménez
Show quoted text 43 lines
From: Graeme Geldenhuys Hi Guillermo, I struggled with it as well. Henry Vermaak then created an example for me and showed how to use it. The example he did was for the fpGUI Toolkit project. Usage: - Compile fpmake.pas as follows: fpc fpmake.pas - To find out more about what fpmake can do and see some help fpmake --help - Build and install fpGUI fpmake install Note that if you installed FPC in a non-standard location on you system you need to tell fpmake which compiler and units to use. The following is all in one line: fpmake.exe -r c:\fpc\2.2.3\bin\i386-win32\ppc386.exe -UG c:\fpc\2.2.3\units\i386-win32 or ./fpmake -v build -UG /opt/fpc/lib/fpc/2.2.3/units/i386-linux/ To view the actual fpmake.pas file, you can check-out fpGUI from SourceForge, or view the specific file via the following url. http://fpgui.git.sourceforge.net/git/gitweb.cgi?p=fpgui;a=blob;f=src/fpmake.pas;h=80e0be3d69132ae12b2c4c970fe29e14c500cb14;hb=67f8fcc69fec98c12d2dac11980ed97d12d380c6 If you have problems with the full URL, you can also use this one: http://tinyurl.com/ce8s52 I have not read the documentation of fpmake for some time, but when I did, it was not clear as to how to compile and use it. I'll download a new copy of the documentation to see if things are improved - and contribute some "newbie" help if nothing has changed. Regards, - Graeme -

Actually I was asking for fpCmake...

Anyway, I'll test your suggestion. Thanks.

Guillermo "Ñuño" Martínez.

Guillermo Martínez Jiménez
Show quoted text 8 lines
From: Graeme Geldenhuys Subject: Re: [fpc-pascal] How to use fpcmake Hi Guillermo, I struggled with it as well. Henry Vermaak then created an example for me and showed how to use it. The example he did was for the fpGUI Toolkit project.

I did read Vermaak's example and I've found some documentation at the wiki (http://wiki.lazarus.freepascal.org/FPMake) but I can't understand it. That's the program I wrote:
________________________

PROGRAM fpmake;
USES
  fpmkunit;
VAR
  I: TCustomInstaller;
  P: TPackage;
  T: TTarget;
  UnitsList: ARRAY [0..8] OF STRING = (
    'albase', 'alblend', 'alfile', 'alfixed', 'alflic', 'algl', 'allegro',
    'alvga', 'alvtable'
  );
  IncList: ARRAY [0..1] OF STRING = (
    'alkeyid'. 'alsysdrv'
  );
  Cnt: INTEGER;
BEGIN
  I := Installer;
  P := I.AddPackage ('allegro.pas');
  P.Version := '4.3.0-SVN';
  P.UnitPath.Add ('lib');
  FOR Cnt := 0 TO 8 DO
  BEGIN
    T := P.Targets.AddUnit (UnitsList[Cnt]+'.pas');
  END;
{ How do I do to add included files?
  FOR Cnt := 0 TO 1 DO
  BEGIN
    T := P.Targets.AddUnit (IncList[Cnt]+'.inc');
  END;
}
  I.Run;
END.
________________________

It compiles but when I run "./fpmake archive" it returns a lot of "Warning: source file * not found for *" but they actually exists(!).

The idea is to install all files from "UnitsList" and "IncList" in the FPC's unit directory so they're accessible to any project. Optionally there's also documentation (build from sources using "pasdoc"), some examples, a complex demonstration (with data) and two tools.

Can somebody help me to understand it?

Guillermo "Ñuño" Martínez

Graeme Geldenhuys
to Guillermo Martínez Jiménez

2009/4/26 Guillermo Martínez Jiménez :

It compiles but when I run "./fpmake archive" it returns a lot of "Warning: source file * not found for *" but they actually exists(!).

I actually have no idea how to add include files. The example Henry created only sets up the include paths, but not include files for 'archive' functionality.

I browser the sources and noticed there is Sources.Add(), but I'm not sure if that will do the trick.
eg:

   T := P.Sources.AddSrc('filename_here');
Can somebody help me to understand it?

Michael? Any idea how to use the 'archive' feature of fpmake?

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 13 lines
2009/4/26 Guillermo Martínez Jiménez : > > It compiles but when I run "./fpmake archive" it returns a lot of > "Warning: source file * not found for *" but they actually exists(!). I actually have no idea how to add include files. The example Henry created only sets up the include paths, but not include files for 'archive' functionality. I browser the sources and noticed there is Sources.Add(), but I'm not sure if that will do the trick. eg: T := P.Sources.AddSrc('filename_here');

There is also:

procedure TSources.AddSrcFiles(const AFileMask: string; Recursive: boolean);

It does a search and adds all files.

Michael.

Henry Vermaak
to Guillermo Martínez Jiménez: I did read Vermaak's example and I've found some documentation at the wiki…

2009/4/26 Guillermo Martínez Jiménez :

Show quoted text 12 lines
> From: Graeme Geldenhuys > Subject: Re: [fpc-pascal] How to use fpcmake > > Hi Guillermo, > > I struggled with it as well. Henry Vermaak then created an example for > me and showed how to use it. The example he did was for the fpGUI > Toolkit project. I did read Vermaak's example and I've found some documentation at the wiki (http://wiki.lazarus.freepascal.org/FPMake) but I can't understand it. That's the program I wrote:

i'm sorry my example is a bit crap, never got round to do it properly. it's best if you work off something in the fpc sources. for example in packages/mysql/fpmake.pp there is this:

    T:=P.Targets.AddUnit('mysql3_com.pp');
      with T.Dependencies do
        begin
          AddInclude('mysql3_comtypes.inc');
          AddUnit('mysql3_version');
        end;

henry