fpmake.pp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {$ifndef ALLPACKAGES}
  2. {$mode objfpc}{$H+}
  3. program fpmake;
  4. uses fpmkunit;
  5. {$endif ALLPACKAGES}
  6. procedure add_h2pas(const ADirectory: string);
  7. Var
  8. P : TPackage;
  9. T : TTarget;
  10. begin
  11. With Installer do
  12. begin
  13. P:=AddPackage('utils-h2pas');
  14. P.ShortName:='h2pa';
  15. { java and jvm-android do not support
  16. fpc_get_output used in these sources }
  17. if Defaults.CPU=jvm then
  18. P.OSes := P.OSes - [java,android];
  19. { palmos does not support command line parameters }
  20. P.OSes := P.OSes - [palmos];
  21. { Program does not fit in 16-bit memory constraints }
  22. P.OSes := P.OSes - [msdos,win16,zxspectrum,msxdos,amstradcpc,sinclairql];
  23. { avr-embedded and i8086-embedded do not support all needed features by default }
  24. if Defaults.CPU in [avr,i8086,z80] then
  25. P.OSes := P.OSes - [embedded];
  26. { wasm32 CPU does not support
  27. goto used in these sources }
  28. if Defaults.CPU=wasm32 then
  29. P.OSes := P.OSes - [wasi,embedded];
  30. P.Author := '<various>';
  31. P.License := 'LGPL with modification';
  32. P.HomepageURL := 'www.freepascal.org';
  33. P.Email := '';
  34. P.Description := 'A utility to create Pascal header files from c header files.';
  35. P.NeedLibC:= false;
  36. P.Directory:=ADirectory;
  37. P.Version:='3.3.1';
  38. P.Options.Add('-Sg');
  39. p.Commands.AddCommand(caBeforeCompile, AddProgramExtension('pyacc', Defaults.BuildOS), '$(SOURCE) $(DEST)','h2pparse.pp','h2pas.y');
  40. p.Commands.AddCommand(caBeforeCompile, AddProgramExtension('plex', Defaults.BuildOS), '$(SOURCE) $(DEST)','scan.pas','scan.l');
  41. T:=P.Targets.AddProgram('h2pas.pas');
  42. T.Dependencies.AddUnit('h2poptions');
  43. T.Dependencies.AddUnit('h2plexlib');
  44. T.Dependencies.AddUnit('scan');
  45. T.Dependencies.AddUnit('h2pyacclib');
  46. T:=P.Targets.AddUnit('scan.pas');
  47. T.Install:=false;
  48. T.Dependencies.AddUnit('h2pbase');
  49. T.Dependencies.AddUnit('scanbase');
  50. T.Dependencies.AddUnit('h2pconst');
  51. T:=P.Targets.AddUnit('h2ptypes.pas');
  52. T.install:=false;
  53. T:=P.Targets.AddUnit('h2pout.pp');
  54. T.install:=false;
  55. T.Dependencies.AddUnit('h2pconst');
  56. T.Dependencies.AddUnit('h2poptions');
  57. T.Dependencies.AddUnit('h2ptypes');
  58. T.Dependencies.AddUnit('h2plexlib');
  59. T.Dependencies.AddUnit('h2pyacclib');
  60. T:=P.Targets.AddUnit('scanbase.pp');
  61. T.install:=false;
  62. T.Dependencies.AddUnit('h2pconst');
  63. T.Dependencies.AddUnit('h2poptions');
  64. T.Dependencies.AddUnit('h2ptypes');
  65. T.Dependencies.AddUnit('h2plexlib');
  66. T:=P.Targets.AddUnit('h2pbase.pp');
  67. T.install:=false;
  68. T.Dependencies.AddUnit('h2pconst');
  69. T.Dependencies.AddUnit('h2poptions');
  70. T.Dependencies.AddUnit('h2ptypes');
  71. T.Dependencies.AddUnit('h2plexlib');
  72. T.Dependencies.AddUnit('h2pyacclib');
  73. T.Dependencies.AddUnit('scanbase');
  74. T.Dependencies.AddUnit('h2pout');
  75. T:=P.Targets.AddProgram('h2paspp.pas');
  76. T:=P.Targets.AddProgram('h2paschk.pas');
  77. P.Targets.AddUnit('h2poptions.pas').install:=false;
  78. P.Targets.AddUnit('h2plexlib.pas').install:=false;
  79. P.Targets.AddUnit('h2pyacclib.pas').install:=false;
  80. P.Targets.AddUnit('h2pconst.pas').install:=false;
  81. end;
  82. end;
  83. {$ifndef ALLPACKAGES}
  84. begin
  85. add_h2pas('');
  86. Installer.Run;
  87. end.
  88. {$endif ALLPACKAGES}