regeninc.pp 620 B

123456789101112131415161718192021222324252627282930
  1. program regeninc;
  2. uses Sysutils;
  3. const
  4. data2incname = 'data2inc';
  5. ininame = 'fpcmake.ini';
  6. incname = 'fpcmake.inc';
  7. constname = 'fpcmakeini';
  8. var
  9. Data2Inc : string;
  10. res : integer;
  11. begin
  12. Data2Inc:=ExeSearch('data2inc',GetEnvironmentVariable('PATH'));
  13. if Data2Inc='' then
  14. begin
  15. Writeln('Data2inc not found');
  16. Halt(1);
  17. end;
  18. if not FileExists(ininame) then
  19. begin
  20. Writeln('file ',ininame,' not found, this file must be in the current directory');
  21. Halt(2);
  22. end;
  23. Res:=ExecuteProcess(data2inc,['-b','-s',ininame,incname,constname]);
  24. if Res<>0 then
  25. Halt(Res);
  26. end.