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