* Small tool to regenerate fpcmake.inc. Execute "make regenerateinc" to use

This commit is contained in:
Michaël Van Canneyt 2023-07-27 10:25:22 +02:00
parent 401268818a
commit fb5d9285e3
2 changed files with 46 additions and 0 deletions

View File

@ -6,3 +6,19 @@ $(BS_UNITDIR):
bootstrap: $(BS_UNITDIR) fpcmake.inc
$(FPCFPMAKE) fpcmake.pp $(FPMAKE_SKIP_CONFIG) -Fu$(UNITDIR_FPMAKE_RTL) -FU$(BS_UNITDIR) $(OPT)
endif
regeninc$(EXEEXT): regeninc.pp
ifdef INSTALLEDCOMPILER
$(FPC) $<
else
$(COMPILER) $<
endif
regenerateinc: regeninc$(EXEEXT)
ifdef inUnix
./regeninc
else
regeninc$(EXEEXT)
endif

30
utils/fpcm/regeninc.pp Normal file
View File

@ -0,0 +1,30 @@
program regeninc;
uses Sysutils;
const
data2incname = 'data2inc';
ininame = 'fpcmake.ini';
incname = 'fpcmake.inc';
constname = 'fpcmakeini';
var
Data2Inc : string;
res : integer;
begin
Data2Inc:=ExeSearch('data2inc',GetEnvironmentVariable('PATH'));
if Data2Inc='' then
begin
Writeln('Data2inc not found');
Halt(1);
end;
if not FileExists(ininame) then
begin
Writeln('file ',ininame,' not found, this file must be in the current directory');
Halt(2);
end;
Res:=ExecuteProcess(data2inc,['-b','-s',ininame,incname,constname]);
if Res<>0 then
Halt(Res);
end.