fpmake.pp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {$ifndef ALLPACKAGES}
  2. {$define allpackages}
  3. {$define no_parent}
  4. {$mode objfpc}{$H+}
  5. program fpmake;
  6. uses
  7. {$ifdef unix}
  8. cwstring,
  9. {$ifndef NO_THREADING}
  10. cthreads,
  11. {$endif}
  12. {$endif}
  13. sysutils, Classes, fpmkunit;
  14. Var
  15. TBuild,T : TTarget;
  16. PBuild,P : TPackage;
  17. D : TDependency;
  18. I : Integer;
  19. {$endif ALLPACKAGES}
  20. (*
  21. The include files are generated with the following commands:
  22. rm fpmake_proc.inc fpmake_add.inc ; /bin/ls -1 */fpmake.pp| while read file; do dir=`dirname $file` ; cleanedname=`echo $dir | sed -e 's+-+_+g'` ; if ! `grep -i "^procedure add_$cleanedname" $file >/dev/null` ; then printf 'procedure add_%s(const ADirectory: string);\nbegin\n with Installer do\n{$include %s}\nend;\n\n' $cleanedname $file >> fpmake_proc.inc; else printf '{$include %s}\n\n' $file >> fpmake_proc.inc; fi; echo " add_$cleanedname(ADirectory+IncludeTrailingPathDelimiter('$dir'));" >> fpmake_add.inc; done
  23. *)
  24. {$include fpmake_proc.inc}
  25. procedure add_packages_comandlineoptions();
  26. begin
  27. AddCustomFpmakeCommandlineOption('data2inc', 'Use indicated data2inc executable.');
  28. AddCustomFpmakeCommandlineOption('genfpmkunit', 'Regenerate the fpmkunitsrc.inc file (fppkg).');
  29. add_ide_comandlineoptions();
  30. end;
  31. procedure add_packages(const ADirectory: string);
  32. begin
  33. {$include fpmake_add.inc}
  34. With Installer do
  35. begin
  36. // Create fpc-all package
  37. PBuild:=AddPackage('fpc-all');
  38. PBuild.ShortName := 'fpca';
  39. PBuild.Version:='3.3.1';
  40. { The source files fpmake_proc.inc and fpmake_add.inc
  41. need to be added explicitly to be integrated in source zip }
  42. PBuild.Sources.AddSrc('fpmake_proc.inc');
  43. PBuild.Sources.AddSrc('fpmake_add.inc');
  44. end;
  45. end;
  46. {$ifdef no_parent}
  47. begin
  48. add_packages_comandlineoptions();
  49. if Assigned(Installer) then
  50. begin
  51. add_packages('');
  52. Installer.Run;
  53. end;
  54. end.
  55. {$endif no_parent}