* fixed change variable accessing using _ instead of .

This commit is contained in:
peter 2001-02-20 21:49:31 +00:00
parent 18a87e23d4
commit 9fbe429084

View File

@ -611,29 +611,15 @@ implementation
sl : TStringList; sl : TStringList;
begin begin
prefix:='REQUIRE_PACKAGES_'; prefix:='REQUIRE_PACKAGES_';
// slall:=FInput.GetTargetRequires(t_all);
reqs:=''; reqs:='';
{ Add target defines } { Add target defines }
for t:=low(ttarget) to high(ttarget) do for t:=low(ttarget) to high(ttarget) do
begin begin
sl:=FInput.GetTargetRequires(t); sl:=FInput.GetTargetRequires(t);
{ optimize by removing the requires already in t_all }
{ if t<>t_all then
begin
i:=0;
while (i<sl.Count) do
begin
if (slall.IndexOf(sl[i])<>-1) then
sl.Delete(i)
else
inc(i);
end;
end; }
if sl.count>0 then if sl.count>0 then
begin begin
write(TargetStr[t]+' requires:'); write(TargetStr[t]+' requires:');
// if t<>t_all then FOutput.Add('ifeq ($(OS_TARGET),'+TargetStr[t]+')');
FOutput.Add('ifeq ($(OS_TARGET),'+TargetStr[t]+')');
for i:=0 to sl.count-1 do for i:=0 to sl.count-1 do
begin begin
FOutput.Add(prefix+VarName(sl[i])+'=1'); FOutput.Add(prefix+VarName(sl[i])+'=1');
@ -641,8 +627,7 @@ implementation
AddStrNoDup(reqs,sl[i]); AddStrNoDup(reqs,sl[i]);
end; end;
writeln; writeln;
// if t<>t_all then FOutput.Add('endif');
FOutput.Add('endif');
end; end;
sl.Free; sl.Free;
end; end;
@ -654,7 +639,6 @@ implementation
AddPackage(req,prefix); AddPackage(req,prefix);
until false; until false;
WritePhony; WritePhony;
// slall.Free;
end; end;
procedure TMakefileWriter.WriteGenericMakefile; procedure TMakefileWriter.WriteGenericMakefile;
@ -670,24 +654,24 @@ implementation
Add('#'); Add('#');
Add('# Don''t edit, this file is generated by '+TitleDate); Add('# Don''t edit, this file is generated by '+TitleDate);
Add('#'); Add('#');
if CheckVariable('default.rule') then if CheckVariable('default_rule') then
Add('default: '+FInput.GetVariable('default.rule')) Add('default: '+FInput.GetVariable('default_rule'))
else else
Add('default: all'); Add('default: all');
{ Add automatic detect sections } { Add automatic detect sections }
AddIniSection('osdetect'); AddIniSection('osdetect');
{ Forced target } { Forced target }
if CheckVariable('default.target') then if CheckVariable('default_target') then
Add('override OS_TARGET='+FInput.GetVariable('default.target')); Add('override OS_TARGET='+FInput.GetVariable('default_target'));
if CheckVariable('default.cpu') then if CheckVariable('default_cpu') then
Add('override CPU_TARGET='+FInput.GetVariable('default.cpu')); Add('override CPU_TARGET='+FInput.GetVariable('default_cpu'));
{ FPC Detection } { FPC Detection }
AddIniSection('fpcdetect'); AddIniSection('fpcdetect');
AddIniSection('fpcdircheckenv'); AddIniSection('fpcdircheckenv');
if CheckVariable('default.fpcdir') then if CheckVariable('default_fpcdir') then
begin begin
Add('ifeq ($(FPCDIR),wrong)'); Add('ifeq ($(FPCDIR),wrong)');
Add('override FPCDIR='+FInput.GetVariable('default.fpcdir')); Add('override FPCDIR='+FInput.GetVariable('default_fpcdir'));
Add('ifeq ($(wildcard $(FPCDIR)/rtl),)'); Add('ifeq ($(wildcard $(FPCDIR)/rtl),)');
Add('ifeq ($(wildcard $(FPCDIR)/units),)'); Add('ifeq ($(wildcard $(FPCDIR)/units),)');
Add('override FPCDIR=wrong'); Add('override FPCDIR=wrong');
@ -697,8 +681,8 @@ implementation
end; end;
AddIniSection('fpcdirdetect'); AddIniSection('fpcdirdetect');
{ Package } { Package }
AddVariable('package.name'); AddVariable('package_name');
AddVariable('package.version'); AddVariable('package_version');
{ First add the required packages sections } { First add the required packages sections }
// for i:=0 to FInput.RequireList.Count-1 do // for i:=0 to FInput.RequireList.Count-1 do
// AddCustomSection(FInput.Requirelist[i]); // AddCustomSection(FInput.Requirelist[i]);
@ -706,37 +690,37 @@ implementation
if assigned(FInput['prerules']) then if assigned(FInput['prerules']) then
AddStrings(TFPCMakeSection(FInput['prerules']).List); AddStrings(TFPCMakeSection(FInput['prerules']).List);
{ Default } { Default }
AddVariable('default.dir'); AddVariable('default_dir');
{ Targets } { Targets }
AddTargetVariable('target.dirs'); AddTargetVariable('target_dirs');
AddTargetVariable('target.programs'); AddTargetVariable('target_programs');
AddTargetVariable('target.units'); AddTargetVariable('target_units');
AddTargetVariable('target.loaders'); AddTargetVariable('target_loaders');
AddTargetVariable('target.rsts'); AddTargetVariable('target_rsts');
AddTargetVariable('target.examples'); AddTargetVariable('target_examples');
AddTargetVariable('target.exampledirs'); AddTargetVariable('target_exampledirs');
{ Clean } { Clean }
AddTargetVariable('clean.units'); AddTargetVariable('clean_units');
AddTargetVariable('clean.files'); AddTargetVariable('clean_files');
{ Install } { Install }
AddTargetVariable('install.units'); AddTargetVariable('install_units');
AddTargetVariable('install.files'); AddTargetVariable('install_files');
AddVariable('install.prefixdir'); AddVariable('install_prefixdir');
AddVariable('install.basedir'); AddVariable('install_basedir');
AddVariable('install.datadir'); AddVariable('install_datadir');
{ Dist } { Dist }
AddVariable('dist.zipname'); AddVariable('dist_zipname');
AddVariable('dist.ziptarget'); AddVariable('dist_ziptarget');
{ Compiler } { Compiler }
AddTargetVariable('compiler.options'); AddTargetVariable('compiler_options');
AddTargetVariable('compiler.version'); AddTargetVariable('compiler_version');
AddTargetVariable('compiler.includedir'); AddTargetVariable('compiler_includedir');
AddTargetVariable('compiler.unitdir'); AddTargetVariable('compiler_unitdir');
AddTargetVariable('compiler.sourcedir'); AddTargetVariable('compiler_sourcedir');
AddTargetVariable('compiler.objectdir'); AddTargetVariable('compiler_objectdir');
AddTargetVariable('compiler.librarydir'); AddTargetVariable('compiler_librarydir');
AddTargetVariable('compiler.targetdir'); AddTargetVariable('compiler_targetdir');
AddTargetVariable('compiler.unittargetdir'); AddTargetVariable('compiler_unittargetdir');
{ default dirs/tools/extensions } { default dirs/tools/extensions }
AddIniSection('shelltools'); AddIniSection('shelltools');
AddIniSection('defaulttools'); AddIniSection('defaulttools');
@ -752,19 +736,19 @@ implementation
AddIniSection('command_libc'); AddIniSection('command_libc');
AddIniSection('command_end'); AddIniSection('command_end');
{ compile } { compile }
if CheckTargetVariable('target.loaders') then if CheckTargetVariable('target_loaders') then
AddIniSection('loaderrules'); AddIniSection('loaderrules');
if CheckTargetVariable('target.units') then if CheckTargetVariable('target_units') then
AddIniSection('unitrules'); AddIniSection('unitrules');
if CheckTargetVariable('target.programs') then if CheckTargetVariable('target_programs') then
AddIniSection('exerules'); AddIniSection('exerules');
if CheckTargetVariable('target.rsts') then if CheckTargetVariable('target_rsts') then
AddIniSection('rstrules'); AddIniSection('rstrules');
if CheckTargetVariable('target.examples') or if CheckTargetVariable('target_examples') or
CheckTargetVariable('target.exampledirs') then CheckTargetVariable('target_exampledirs') then
AddIniSection('examplerules'); AddIniSection('examplerules');
AddIniSection('compilerules'); AddIniSection('compilerules');
if CheckVariable('lib.name') then if CheckVariable('lib_name') then
AddIniSection('libraryrules'); AddIniSection('libraryrules');
{ install } { install }
AddIniSection('installrules'); AddIniSection('installrules');
@ -775,10 +759,10 @@ implementation
{ info } { info }
AddIniSection('inforules'); AddIniSection('inforules');
{ Subdirs } { Subdirs }
AddTargetDirs('target.dirs'); AddTargetDirs('target_dirs');
AddTargetDirs('target.exampledirs'); AddTargetDirs('target_exampledirs');
{ Tools } { Tools }
AddTools('require.tools'); AddTools('require_tools');
{ Rules } { Rules }
AddRules; AddRules;
{ Users own rules } { Users own rules }
@ -795,7 +779,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.3 2001-02-01 22:00:10 peter Revision 1.4 2001-02-20 21:49:31 peter
* fixed change variable accessing using _ instead of .
Revision 1.3 2001/02/01 22:00:10 peter
* default.fpcdir is back * default.fpcdir is back
* subdir requirement checking works, but not very optimal yet as * subdir requirement checking works, but not very optimal yet as
it can load the same Makefile.fpc multiple times it can load the same Makefile.fpc multiple times