fpmake.pp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {$ifndef ALLPACKAGES}
  2. {$mode objfpc}{$H+}
  3. program fpmake;
  4. uses fpmkunit;
  5. {$endif ALLPACKAGES}
  6. procedure add_tply(const ADirectory: string);
  7. Var
  8. P : TPackage;
  9. T : TTarget;
  10. lexyaccpath: string;
  11. begin
  12. With Installer do
  13. begin
  14. P:=AddPackage('utils-lexyacc');
  15. P.ShortName:='tply';
  16. { java and jvm-android do not support
  17. fpc_get_output used in these sources }
  18. if Defaults.CPU=jvm then
  19. P.OSes := P.OSes - [java,android];
  20. { palmos does not support command line parameters }
  21. P.OSes := P.OSes - [palmos];
  22. { Program does not fit in 16-bit memory constraints }
  23. P.OSes := P.OSes - [msdos,win16,zxspectrum,msxdos,amstradcpc,sinclairql];
  24. { avr-embedded and i8086-embedded do not meet needed requirements }
  25. if Defaults.CPU in [avr,i8086,z80] then
  26. P.OSes := P.OSes - [embedded];
  27. { wasm32 CPU does not support
  28. goto used in these sources }
  29. if Defaults.CPU=wasm32 then
  30. P.OSes := P.OSes - [wasi,embedded];
  31. P.Author := '<various>';
  32. P.License := 'LGPL with modification';
  33. P.HomepageURL := 'www.freepascal.org';
  34. P.Email := '';
  35. P.Description := 'A compiler generator for Turbo Pascal and compatibles.';
  36. P.NeedLibC:= false;
  37. P.Directory:=ADirectory;
  38. P.Version:='3.3.1';
  39. P.Dependencies.Add('tplylib');
  40. P.Options.Add('-Sg');
  41. T:=P.Targets.AddProgram('plex.pas');
  42. T.Dependencies.AddUnit('lexbase');
  43. T.Dependencies.AddUnit('lexopt');
  44. T.Dependencies.AddUnit('lexdfa');
  45. T.Dependencies.AddUnit('lexpos');
  46. T.Dependencies.AddUnit('lexlist');
  47. T.Dependencies.AddUnit('lexrules');
  48. T.Dependencies.AddUnit('lexmsgs');
  49. T.Dependencies.AddUnit('lextable');
  50. T:=P.Targets.AddProgram('pyacc.pas');
  51. T.Dependencies.AddUnit('yaccbase');
  52. T.Dependencies.AddUnit('yaccmsgs');
  53. T.Dependencies.AddUnit('yaccclos');
  54. T.Dependencies.AddUnit('yaccpars');
  55. T.Dependencies.AddUnit('yacclook');
  56. T.Dependencies.AddUnit('yaccsem');
  57. T.Dependencies.AddUnit('yacclr0');
  58. T.Dependencies.AddUnit('yacctabl');
  59. P.Targets.AddUnit('lexbase.pas').install:=false;
  60. P.Targets.AddUnit('lexopt.pas').install:=false;
  61. P.Targets.AddUnit('lexdfa.pas').install:=false;
  62. P.Targets.AddUnit('lexpos.pas').install:=false;
  63. P.Targets.AddUnit('lexlist.pas').install:=false;
  64. P.Targets.AddUnit('lexrules.pas').install:=false;
  65. P.Targets.AddUnit('lexmsgs.pas').install:=false;
  66. P.Targets.AddUnit('lextable.pas').install:=false;
  67. P.Targets.AddUnit('yaccbase.pas').install:=false;
  68. P.Targets.AddUnit('yaccmsgs.pas').install:=false;
  69. P.Targets.AddUnit('yaccclos.pas').install:=false;
  70. P.Targets.AddUnit('yaccpars.pas').install:=false;
  71. P.Targets.AddUnit('yacclook.pas').install:=false;
  72. P.Targets.AddUnit('yaccsem.pas').install:=false;
  73. P.Targets.AddUnit('yacclr0.pas').install:=false;
  74. P.Targets.AddUnit('yacctabl.pas').install:=false;
  75. if (OSToString(defaults.OS)=lowercase({$I %FPCTARGETOS%})) and
  76. (CPUToString(defaults.CPU)=lowercase({$I %FPCTARGETCPU%})) then
  77. begin
  78. // Do not install these files when performing a cross-installation
  79. if Defaults.OS in AllUnixOSes then
  80. lexyaccpath:='$(prefix)lib/fpc/lexyacc'
  81. else
  82. lexyaccpath:='$(bininstalldir)';
  83. P.InstallFiles.Add('yylex.cod',lexyaccpath);
  84. P.InstallFiles.Add('yyparse.cod',lexyaccpath);
  85. end;
  86. end;
  87. end;
  88. {$ifndef ALLPACKAGES}
  89. begin
  90. add_tply('');
  91. Installer.Run;
  92. end.
  93. {$endif ALLPACKAGES}