2
0

fpmake.pp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {$ifndef ALLPACKAGES}
  2. {$define allpackages}
  3. {$define no_parent}
  4. {$mode objfpc}{$H+}
  5. program fpmake;
  6. uses {$ifdef unix}cthreads,{$endif} sysutils, Classes, fpmkunit;
  7. Var
  8. TBuild,T : TTarget;
  9. PBuild,P : TPackage;
  10. D : TDependency;
  11. I : Integer;
  12. {$endif ALLPACKAGES}
  13. (*
  14. The include files are generated with the following commands:
  15. 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
  16. *)
  17. {$include fpmake_proc.inc}
  18. procedure add_packages_comandlineoptions();
  19. begin
  20. AddCustomFpmakeCommandlineOption('data2inc', 'Use indicated data2inc executable.');
  21. AddCustomFpmakeCommandlineOption('genfpmkunit', 'Regenerate the fpmkunitsrc.inc file (fppkg).');
  22. add_ide_comandlineoptions();
  23. end;
  24. procedure add_packages(const ADirectory: string);
  25. begin
  26. {$include fpmake_add.inc}
  27. With Installer do
  28. begin
  29. // Create fpc-all package
  30. PBuild:=AddPackage('fpc-all');
  31. PBuild.ShortName := 'fpca';
  32. PBuild.Version:='3.3.1';
  33. { The source files fpmake_proc.inc and fpmake_add.inc
  34. need to be added explicitly to be integrated in source zip }
  35. PBuild.Sources.AddSrc('fpmake_proc.inc');
  36. PBuild.Sources.AddSrc('fpmake_add.inc');
  37. end;
  38. end;
  39. {$ifdef no_parent}
  40. begin
  41. add_packages_comandlineoptions();
  42. add_packages('');
  43. Installer.Run;
  44. end.
  45. {$endif no_parent}