mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 20:29:18 +02:00
* Accept presence of Makefile+fpmake.pp as alid package dir
This commit is contained in:
parent
ba534b1192
commit
0db8f72dcd
@ -201,15 +201,29 @@ program fpcmake;
|
|||||||
|
|
||||||
|
|
||||||
procedure ProcessFile(const fn:string; const aOutputFile : string);
|
procedure ProcessFile(const fn:string; const aOutputFile : string);
|
||||||
|
|
||||||
|
var
|
||||||
|
ofn : String;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Show(V_Verbose,TitleDate);
|
Show(V_Verbose,TitleDate);
|
||||||
case ParaMode of
|
case ParaMode of
|
||||||
m_None :
|
m_None :
|
||||||
Error('No operation specified, see -h for help');
|
Error('No operation specified, see -h for help');
|
||||||
m_Makefile :
|
m_Makefile :
|
||||||
ProcessFile_Makefile(fn,aOutputFile);
|
begin
|
||||||
|
ofn:=aOutputFile;
|
||||||
|
if ofn='' then
|
||||||
|
ofn:='Makefile';
|
||||||
|
ProcessFile_Makefile(fn,ofn);
|
||||||
|
end;
|
||||||
m_PackageFpc :
|
m_PackageFpc :
|
||||||
ProcessFile_PackageFpc(fn,aOutputFile);
|
begin
|
||||||
|
ofn:=aOutputFile;
|
||||||
|
if ofn='' then
|
||||||
|
ofn:='Package.fpc';
|
||||||
|
ProcessFile_PackageFpc(fn,ofn);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -985,6 +985,12 @@ implementation
|
|||||||
s:=SubstVariables('$(firstword $(wildcard '+s+'))');
|
s:=SubstVariables('$(firstword $(wildcard '+s+'))');
|
||||||
if TryFile(s) then
|
if TryFile(s) then
|
||||||
exit;
|
exit;
|
||||||
|
{ Check for Makefile }
|
||||||
|
s:=SubstVariables('$(addsuffix /'+ReqName+'/Makefile,$(FPCDIR)) $(addsuffix /'+ReqName+'/Makefile,$(PACKAGESDIR)) $(addsuffix /'+ReqName+'/Makefile,$(REQUIRE_PACKAGESDIR))');
|
||||||
|
Verbose(FPCMakeDebug,'Package "'+ReqName+'": Looking for Makefile+fpmake: "'+s+'"');
|
||||||
|
s:=SubstVariables('$(firstword $(wildcard '+s+'))');
|
||||||
|
if FileExists(s) then
|
||||||
|
exit;
|
||||||
Raise Exception.Create(Format(s_package_not_found,[OSStr[t],Reqname]));
|
Raise Exception.Create(Format(s_package_not_found,[OSStr[t],Reqname]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1002,8 +1008,12 @@ implementation
|
|||||||
{ give better error what is wrong }
|
{ give better error what is wrong }
|
||||||
if not PathExists(s) then
|
if not PathExists(s) then
|
||||||
Raise Exception.Create(Format(s_directory_not_found,[s]))
|
Raise Exception.Create(Format(s_directory_not_found,[s]))
|
||||||
|
// packages may no longer have 'Makefile.fpc', but they will have a Makefile.
|
||||||
|
// for such cases, the top Makefile.fpc must simply specify all dependencies recursively.
|
||||||
|
else if not FileExists(s+'/Makefile') then
|
||||||
|
Raise Exception.Create(Format(s_makefilefpc_not_found,[s]))
|
||||||
else
|
else
|
||||||
Raise Exception.Create(Format(s_makefilefpc_not_found,[s]));
|
exit;
|
||||||
end;
|
end;
|
||||||
{ Process Makefile.fpc }
|
{ Process Makefile.fpc }
|
||||||
ReqFPCMake:=TFPCMake.Create(currdir+subdir+'/Makefile.fpc');
|
ReqFPCMake:=TFPCMake.Create(currdir+subdir+'/Makefile.fpc');
|
||||||
|
@ -538,6 +538,14 @@ implementation
|
|||||||
unitfpmakedirvar:='UNITDIR_FPMAKE_'+VarName(pack);
|
unitfpmakedirvar:='UNITDIR_FPMAKE_'+VarName(pack);
|
||||||
{ Search packagedir by looking for Makefile.fpc }
|
{ Search packagedir by looking for Makefile.fpc }
|
||||||
FOutput.Add(packdirvar+':=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /'+pack+'/Makefile.fpc,$(PACKAGESDIR))))))');
|
FOutput.Add(packdirvar+':=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /'+pack+'/Makefile.fpc,$(PACKAGESDIR))))))');
|
||||||
|
{ Packages may no longer have a Makefile.fpc . Check existance of Makefile + fpmake.pp to be sure }
|
||||||
|
FOutput.Add('ifeq ($('+packdirvar+'),)');
|
||||||
|
FOutput.Add(packdirvar+':=$(firstword $(subst /Makefile,,$(strip $(wildcard $(addsuffix /'+pack+'/Makefile,$(PACKAGESDIR))))))');
|
||||||
|
FOutput.Add('ifneq ($('+packdirvar+'),)');
|
||||||
|
FOutput.Add(packdirvar+':=$(firstword $(subst /fpmake.pp,,$(strip $(wildcard $(addsuffix /'+pack+'/fpmake.pp,$(PACKAGESDIR))))))');
|
||||||
|
FOutput.Add('endif');
|
||||||
|
FOutput.Add('endif');
|
||||||
|
|
||||||
FOutput.Add('ifneq ($('+packdirvar+'),)');
|
FOutput.Add('ifneq ($('+packdirvar+'),)');
|
||||||
{ Create unit dir, check if os dependent dir exists }
|
{ Create unit dir, check if os dependent dir exists }
|
||||||
FOutput.Add('ifneq ($(wildcard $('+packdirvar+')/units/$(TARGETSUFFIX)),)');
|
FOutput.Add('ifneq ($(wildcard $('+packdirvar+')/units/$(TARGETSUFFIX)),)');
|
||||||
|
Loading…
Reference in New Issue
Block a user