fpmake.pp 3.5 KB

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