mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 08:00:17 +02:00
updatemakefiles: update custom Makefiles too
This commit is contained in:
parent
3ff5d50aaa
commit
0d886d65e4
@ -34,10 +34,11 @@ program updatemakefiles;
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, sysutils, FileProcs, DefineTemplates, LazFileUtils, Laz2_XMLCfg,
|
Classes, sysutils, FileProcs, DefineTemplates, LazFileUtils, Laz2_XMLCfg,
|
||||||
FileUtil;
|
FileUtil, LazLogger;
|
||||||
|
|
||||||
var
|
var
|
||||||
LazarusDir: String;
|
LazarusDir: String;
|
||||||
|
FPCMake: String;
|
||||||
|
|
||||||
function FindLPK(Dir, MainSrc: string; out HasConditionals: boolean): string;
|
function FindLPK(Dir, MainSrc: string; out HasConditionals: boolean): string;
|
||||||
var
|
var
|
||||||
@ -146,7 +147,6 @@ procedure CheckFPCMake;
|
|||||||
const
|
const
|
||||||
LastTarget = 'aarch64-darwin';
|
LastTarget = 'aarch64-darwin';
|
||||||
var
|
var
|
||||||
FPCMake: String;
|
|
||||||
Lines: TStringList;
|
Lines: TStringList;
|
||||||
begin
|
begin
|
||||||
FPCMake:=FindDefaultExecutablePath('fpcmake');
|
FPCMake:=FindDefaultExecutablePath('fpcmake');
|
||||||
@ -160,6 +160,29 @@ begin
|
|||||||
Lines.Free;
|
Lines.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure UpdateCustomMakefiles;
|
||||||
|
const
|
||||||
|
Dirs: array[1..7] of string = (
|
||||||
|
'lcl/interfaces',
|
||||||
|
'components/virtualtreeview',
|
||||||
|
'components/chmhelp/lhelp',
|
||||||
|
'components',
|
||||||
|
'lcl/interfaces',
|
||||||
|
'ide',
|
||||||
|
'tools'
|
||||||
|
);
|
||||||
|
var
|
||||||
|
Dir: String;
|
||||||
|
Lines: TStringList;
|
||||||
|
begin
|
||||||
|
for Dir in Dirs do begin
|
||||||
|
writeln(dir);
|
||||||
|
Lines:=RunTool(FPCMake,'-TAll',LazarusDir+SetDirSeparators(Dir));
|
||||||
|
//writeln(Lines.Text);
|
||||||
|
Lines.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
LPKFiles: TStringList;
|
LPKFiles: TStringList;
|
||||||
LazbuildOut: TStringList;
|
LazbuildOut: TStringList;
|
||||||
@ -174,22 +197,28 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
CheckFPCMake;
|
CheckFPCMake;
|
||||||
|
|
||||||
LazarusDir:=CleanAndExpandDirectory(GetCurrentDirUTF8);
|
LazarusDir:=CleanAndExpandDirectory(GetCurrentDirUTF8);
|
||||||
if ExtractFileName(ChompPathDelim(LazarusDir))='tools' then
|
if ExtractFileName(ChompPathDelim(LazarusDir))='tools' then
|
||||||
LazarusDir:=ExtractFilePath(ChompPathDelim(LazarusDir));
|
LazarusDir:=ExtractFilePath(ChompPathDelim(LazarusDir));
|
||||||
|
LazarusDir:=AppendPathDelim(LazarusDir);
|
||||||
|
|
||||||
LPKFiles:=TStringList.Create;
|
LPKFiles:=TStringList.Create;
|
||||||
FindLPKFilesWithMakefiles(LazarusDir,LPKFiles);
|
FindLPKFilesWithMakefiles(LazarusDir,LPKFiles);
|
||||||
writeln(LPKFiles.Text);
|
writeln(LPKFiles.Text);
|
||||||
LPKFiles.StrictDelimiter:=true;
|
LPKFiles.StrictDelimiter:=true;
|
||||||
LPKFiles.Delimiter:=' ';
|
LPKFiles.Delimiter:=' ';
|
||||||
LazbuildExe:=SetDirSeparators(LazarusDir+'/lazbuild'+ExeExt);
|
LazbuildExe:=SetDirSeparators(LazarusDir+'lazbuild'+ExeExt);
|
||||||
if not FileIsExecutable(LazbuildExe) then
|
if not FileIsExecutable(LazbuildExe) then
|
||||||
begin
|
begin
|
||||||
writeln('Error: missing ',LazbuildExe);
|
writeln('Error: missing ',LazbuildExe);
|
||||||
Halt(1);
|
Halt(1);
|
||||||
end;
|
end;
|
||||||
LazbuildOut:=RunTool(SetDirSeparators(LazarusDir+'/lazbuild'+ExeExt),'--lazarusdir="'+LazarusDir+'" --create-makefile '+LPKFiles.DelimitedText,LazarusDir);
|
LazbuildOut:=RunTool(SetDirSeparators(LazarusDir+'lazbuild'+ExeExt),'--lazarusdir="'+LazarusDir+'" --create-makefile '+LPKFiles.DelimitedText,LazarusDir);
|
||||||
writeln(LazbuildOut.Text);
|
writeln(LazbuildOut.Text);
|
||||||
|
LazbuildOut.Free;
|
||||||
LPKFiles.Free;
|
LPKFiles.Free;
|
||||||
|
|
||||||
|
UpdateCustomMakefiles;
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user