From f0a75c1254221fe1f91203c5a30a81235a663c88 Mon Sep 17 00:00:00 2001
From: joost <joost@cnoc.nl>
Date: Fri, 6 Apr 2012 22:47:03 +0000
Subject: [PATCH]  * Added fpmake.pp files for some utils

git-svn-id: trunk@20736 -
---
 .gitattributes        |   3 ++
 utils/fpcm/fpmake.pp  |  56 +++++++++++++++++++++++
 utils/h2pas/fpmake.pp |  66 +++++++++++++++++++++++++++
 utils/tply/fpmake.pp  | 103 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 228 insertions(+)
 create mode 100644 utils/fpcm/fpmake.pp
 create mode 100644 utils/h2pas/fpmake.pp
 create mode 100644 utils/tply/fpmake.pp

diff --git a/.gitattributes b/.gitattributes
index 09c6b117ab..13a6843d5d 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -13217,6 +13217,7 @@ utils/fpcm/fpcmdic.pp svneol=native#text/plain
 utils/fpcm/fpcmmain.pp svneol=native#text/plain
 utils/fpcm/fpcmpkg.pp svneol=native#text/plain
 utils/fpcm/fpcmwr.pp svneol=native#text/plain
+utils/fpcm/fpmake.pp svneol=native#text/plain
 utils/fpcm/makefile.exm -text
 utils/fpcm/printmakefilefpcrequirements.sh svneol=native#text/plain
 utils/fpcm/readme.txt svneol=native#text/plain
@@ -13400,6 +13401,7 @@ utils/h2pas/Makefile svneol=native#text/plain
 utils/h2pas/Makefile.fpc svneol=native#text/plain
 utils/h2pas/README.txt svneol=native#text/plain
 utils/h2pas/converu.pas svneol=native#text/plain
+utils/h2pas/fpmake.pp svneol=native#text/plain
 utils/h2pas/h2pas.pas svneol=native#text/plain
 utils/h2pas/h2pas.y svneol=native#text/plain
 utils/h2pas/h2paspp.pas svneol=native#text/plain
@@ -13521,6 +13523,7 @@ utils/tply/COPYING.txt svneol=native#text/plain
 utils/tply/Makefile svneol=native#text/plain
 utils/tply/Makefile.fpc svneol=native#text/plain
 utils/tply/README.txt svneol=native#text/plain
+utils/tply/fpmake.pp svneol=native#text/plain
 utils/tply/lexbase.pas svneol=native#text/plain
 utils/tply/lexdfa.pas svneol=native#text/plain
 utils/tply/lexlib.pas svneol=native#text/plain
diff --git a/utils/fpcm/fpmake.pp b/utils/fpcm/fpmake.pp
new file mode 100644
index 0000000000..1957e08d38
--- /dev/null
+++ b/utils/fpcm/fpmake.pp
@@ -0,0 +1,56 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+{$endif ALLPACKAGES}
+
+procedure add_fpcm;
+
+Var
+  P : TPackage;
+  T : TTarget;
+
+begin
+  With Installer do
+    begin
+    P:=AddPackage('fpcm');
+
+    P.Author := '<various>';
+    P.License := 'LGPL with modification';
+    P.HomepageURL := 'www.freepascal.org';
+    P.Email := '';
+    P.Description := 'Tool to generate Makefile''s out of Makefile.fpc files';
+    P.NeedLibC:= false;
+
+{$ifdef ALLPACKAGES}
+    P.Directory:='fpcm';
+{$endif ALLPACKAGES}
+    P.Version:='2.7.1';
+
+    P.Dependencies.Add('fcl-base');
+
+    T:=P.Targets.AddProgram('fpcmake.pp');
+
+    T:=P.Targets.AddUnit('fpcmmain.pp');
+    T.install:=false;
+    T.ResourceStrings:=true;
+    P.Targets.AddUnit('fpcmdic.pp').install:=false;
+    P.Targets.AddUnit('fpcmwr.pp').install:=false;
+    P.Targets.AddUnit('fpcmpkg.pp').install:=false;
+
+    P.Sources.AddSrc('fpcmake.ini');
+    P.Sources.AddSrc('fpcmake.inc');
+    end;
+end;
+
+{$ifndef ALLPACKAGES}
+begin
+  add_fpcm;
+  Installer.Run;
+end.
+{$endif ALLPACKAGES}
+
+
+
+
diff --git a/utils/h2pas/fpmake.pp b/utils/h2pas/fpmake.pp
new file mode 100644
index 0000000000..7f7260bb7e
--- /dev/null
+++ b/utils/h2pas/fpmake.pp
@@ -0,0 +1,66 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+{$endif ALLPACKAGES}
+
+procedure add_h2pas;
+
+Var
+  P : TPackage;
+  T : TTarget;
+
+begin
+  With Installer do
+    begin
+    P:=AddPackage('h2pas');
+
+    P.Author := '<various>';
+    P.License := 'LGPL with modification';
+    P.HomepageURL := 'www.freepascal.org';
+    P.Email := '';
+    P.Description := 'An utility to create Pascal header files from c header files.';
+    P.NeedLibC:= false;
+
+{$ifdef ALLPACKAGES}
+    P.Directory:='h2pas';
+{$endif ALLPACKAGES}
+    P.Version:='2.7.1';
+
+    P.Options.Add('-Sg');
+
+    p.Commands.AddCommand(caBeforeCompile,'pyacc','h2pas.y','h2pas.pas','h2pas.y');
+    p.Commands.AddCommand(caBeforeCompile,'plex','scan.l','scan.pas','scan.l');
+
+    T:=P.Targets.AddProgram('h2pas.pas');
+    T.Dependencies.AddUnit('h2poptions');
+    T.Dependencies.AddUnit('h2plexlib');
+    T.Dependencies.AddUnit('scan');
+    T.Dependencies.AddUnit('h2pyacclib');
+    T.Dependencies.AddUnit('converu');
+
+    T:=P.Targets.AddUnit('scan.pas');
+    T.Install:=false;
+    T.Dependencies.AddUnit('converu');
+    T.Dependencies.AddUnit('h2poptions');
+
+    T:=P.Targets.AddProgram('h2paspp.pas');
+
+    P.Targets.AddUnit('h2poptions.pas').install:=false;
+    P.Targets.AddUnit('h2plexlib.pas').install:=false;
+    P.Targets.AddUnit('h2pyacclib.pas').install:=false;
+    P.Targets.AddUnit('converu.pas').install:=false;
+    end;
+end;
+
+{$ifndef ALLPACKAGES}
+begin
+  add_h2pas;
+  Installer.Run;
+end.
+{$endif ALLPACKAGES}
+
+
+
+
diff --git a/utils/tply/fpmake.pp b/utils/tply/fpmake.pp
new file mode 100644
index 0000000000..f9714b7b40
--- /dev/null
+++ b/utils/tply/fpmake.pp
@@ -0,0 +1,103 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+{$endif ALLPACKAGES}
+
+procedure add_lexyacc;
+
+Var
+  P : TPackage;
+  T : TTarget;
+  lexyaccpath: string;
+
+begin
+  With Installer do
+    begin
+    P:=AddPackage('lexyacc');
+
+    P.Author := '<various>';
+    P.License := 'LGPL with modification';
+    P.HomepageURL := 'www.freepascal.org';
+    P.Email := '';
+    P.Description := 'A compiler generator for Turbo Pascal and compatibles.';
+    P.NeedLibC:= false;
+
+{$ifdef ALLPACKAGES}
+    P.Directory:='lexyacc';
+{$endif ALLPACKAGES}
+    P.Version:='2.7.1';
+
+    P.Options.Add('-Sg');
+
+    T:=P.Targets.AddProgram('plex.pas');
+    T.Dependencies.AddUnit('lexbase');
+    T.Dependencies.AddUnit('lexopt');
+    T.Dependencies.AddUnit('lexdfa');
+    T.Dependencies.AddUnit('lexpos');
+    T.Dependencies.AddUnit('lexlist');
+    T.Dependencies.AddUnit('lexrules');
+    T.Dependencies.AddUnit('lexmsgs');
+    T.Dependencies.AddUnit('lextable');
+
+
+    T:=P.Targets.AddProgram('pyacc.pas');
+    T.Dependencies.AddUnit('yaccbase');
+    T.Dependencies.AddUnit('yaccmsgs');
+    T.Dependencies.AddUnit('yaccclos');
+    T.Dependencies.AddUnit('yaccpars');
+    T.Dependencies.AddUnit('yacclook');
+    T.Dependencies.AddUnit('yaccsem');
+    T.Dependencies.AddUnit('yacclr0');
+    T.Dependencies.AddUnit('yacctabl');
+
+
+    P.Targets.AddUnit('lexlib.pas');
+    P.Targets.AddUnit('yacclib.pas');
+
+    P.Targets.AddUnit('lexbase.pas').install:=false;
+    P.Targets.AddUnit('lexopt.pas').install:=false;
+    P.Targets.AddUnit('lexdfa.pas').install:=false;
+    P.Targets.AddUnit('lexpos.pas').install:=false;
+    P.Targets.AddUnit('lexlist.pas').install:=false;
+    P.Targets.AddUnit('lexrules.pas').install:=false;
+    P.Targets.AddUnit('lexmsgs.pas').install:=false;
+    P.Targets.AddUnit('lextable.pas').install:=false;
+    P.Targets.AddUnit('yaccbase.pas').install:=false;
+    P.Targets.AddUnit('yaccmsgs.pas').install:=false;
+    P.Targets.AddUnit('yaccclos.pas').install:=false;
+    P.Targets.AddUnit('yaccpars.pas').install:=false;
+    P.Targets.AddUnit('yacclook.pas').install:=false;
+    P.Targets.AddUnit('yaccsem.pas').install:=false;
+    P.Targets.AddUnit('yacclr0.pas').install:=false;
+    P.Targets.AddUnit('yacctabl.pas').install:=false;
+
+    P.Sources.AddSrc('fpcmake.ini');
+    P.Sources.AddSrc('fpcmake.inc');
+
+    writeln({$I %FPCTARGETOS%});
+    if (OSToString(defaults.OS)=lowercase({$I %FPCTARGETOS%})) and
+       (CPUToString(defaults.CPU)=lowercase({$I %FPCTARGETCPU%})) then
+      begin
+      // Do not install these files when performing a cross-installation
+      if Defaults.OS in AllUnixOSes then
+        lexyaccpath:='$(prefix)lib/fpc/lexyacc'
+      else
+        lexyaccpath:='$(bininstalldir)';
+      P.InstallFiles.Add('yylex.cod',lexyaccpath);
+      P.InstallFiles.Add('yyparse.cod',lexyaccpath);
+      end;
+    end;
+end;
+
+{$ifndef ALLPACKAGES}
+begin
+  add_lexyacc;
+  Installer.Run;
+end.
+{$endif ALLPACKAGES}
+
+
+
+