fpmake.pp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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)','h2pas.pas','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.Dependencies.AddUnit('converu');
  47. T:=P.Targets.AddUnit('scan.pas');
  48. T.Install:=false;
  49. T.Dependencies.AddUnit('converu');
  50. T.Dependencies.AddUnit('h2poptions');
  51. T:=P.Targets.AddProgram('h2paspp.pas');
  52. T:=P.Targets.AddProgram('h2paschk.pas');
  53. P.Targets.AddUnit('h2poptions.pas').install:=false;
  54. P.Targets.AddUnit('h2plexlib.pas').install:=false;
  55. P.Targets.AddUnit('h2pyacclib.pas').install:=false;
  56. P.Targets.AddUnit('converu.pas').install:=false;
  57. end;
  58. end;
  59. {$ifndef ALLPACKAGES}
  60. begin
  61. add_h2pas('');
  62. Installer.Run;
  63. end.
  64. {$endif ALLPACKAGES}