|
@@ -37,6 +37,7 @@ program fpcmake;
|
|
|
var
|
|
|
ParaMode : TMode;
|
|
|
ParaVerboseLevel : TVerboseLevel;
|
|
|
+ paraExtra : string;
|
|
|
ParaTargets : string;
|
|
|
ParaOutputFileName : string;
|
|
|
ParaRecursive : boolean;
|
|
@@ -83,7 +84,7 @@ program fpcmake;
|
|
|
Makefile output
|
|
|
*****************************************************************************}
|
|
|
|
|
|
- procedure ProcessFile_Makefile(const fn:string; const aOutputfile : string);
|
|
|
+ procedure ProcessFile_Makefile(const fn:string; const aOutputfile : string; aextra: string);
|
|
|
var
|
|
|
CurrFPCMake : TFPCMakeConsole;
|
|
|
CurrMakefile : TMakefileWriter;
|
|
@@ -98,6 +99,7 @@ program fpcmake;
|
|
|
{$endif NOEXCEPT}
|
|
|
{ Load Makefile.fpc }
|
|
|
CurrFPCMake:=TFPCMakeConsole.Create(fn);
|
|
|
+ CurrFPCMake.ExtraTargetsFile:=aExtra;
|
|
|
if ParaTargets<>'' then
|
|
|
CurrFPCMake.SetTargets(ParaTargets);
|
|
|
CurrFPCMake.LoadMakefileFPC;
|
|
@@ -156,7 +158,7 @@ program fpcmake;
|
|
|
s:=GetToken(subdirs,' ');
|
|
|
if s='' then
|
|
|
break;
|
|
|
- ProcessFile_Makefile(ExtractFilePath(fn)+s+'/Makefile.fpc',aOutputFile);
|
|
|
+ ProcessFile_Makefile(ExtractFilePath(fn)+s+'/Makefile.fpc',aOutputFile, paraExtra);
|
|
|
until false;
|
|
|
end;
|
|
|
|
|
@@ -166,7 +168,7 @@ program fpcmake;
|
|
|
Package.fpc output
|
|
|
*****************************************************************************}
|
|
|
|
|
|
- procedure ProcessFile_PackageFpc(const fn:string; const aOutputFile : string);
|
|
|
+ procedure ProcessFile_PackageFpc(const fn:string; const aOutputFile : string; aExtra : String);
|
|
|
var
|
|
|
CurrFPCMake : TFPCMakeConsole;
|
|
|
CurrPackageFpc : TPackageFpcWriter;
|
|
@@ -180,6 +182,7 @@ program fpcmake;
|
|
|
CurrFPCMake:=TFPCMakeConsole.Create(fn);
|
|
|
if ParaTargets<>'' then
|
|
|
CurrFPCMake.SetTargets(ParaTargets);
|
|
|
+ CurrFPCMake.ExtraTargetsFile:=aExtra;
|
|
|
CurrFPCMake.LoadMakefileFPC;
|
|
|
// CurrFPCMake.Print;
|
|
|
|
|
@@ -200,7 +203,7 @@ program fpcmake;
|
|
|
end;
|
|
|
|
|
|
|
|
|
- procedure ProcessFile(const fn:string; const aOutputFile : string);
|
|
|
+ procedure ProcessFile(const fn:string; const aOutputFile : string; const aExtra : string);
|
|
|
|
|
|
var
|
|
|
ofn : String;
|
|
@@ -215,14 +218,14 @@ program fpcmake;
|
|
|
ofn:=aOutputFile;
|
|
|
if ofn='' then
|
|
|
ofn:='Makefile';
|
|
|
- ProcessFile_Makefile(fn,ofn);
|
|
|
+ ProcessFile_Makefile(fn,ofn,aExtra);
|
|
|
end;
|
|
|
m_PackageFpc :
|
|
|
begin
|
|
|
ofn:=aOutputFile;
|
|
|
if ofn='' then
|
|
|
ofn:='Package.fpc';
|
|
|
- ProcessFile_PackageFpc(fn,ofn);
|
|
|
+ ProcessFile_PackageFpc(fn,ofn,aextra);
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
@@ -236,7 +239,7 @@ begin
|
|
|
fn:='Makefile.fpc'
|
|
|
else
|
|
|
fn:='makefile.fpc';
|
|
|
- ProcessFile(fn,ParaOutputFilename);
|
|
|
+ ProcessFile(fn,ParaOutputFilename, paraExtra);
|
|
|
end;
|
|
|
|
|
|
|
|
@@ -245,7 +248,7 @@ var
|
|
|
i : integer;
|
|
|
begin
|
|
|
for i:=OptInd to ParamCount do
|
|
|
- ProcessFile(ParamStr(i),ParaOutputFilename);
|
|
|
+ ProcessFile(ParamStr(i),ParaOutputFilename,ParaExtra);
|
|
|
end;
|
|
|
|
|
|
|
|
@@ -269,6 +272,7 @@ begin
|
|
|
writeln(' -s Skip writing package name');
|
|
|
writeln(' -q Be quiet');
|
|
|
writeln(' -h This help screen');
|
|
|
+ writeln(' -x file Read extra target definitions from file.');
|
|
|
Halt(0);
|
|
|
end;
|
|
|
|
|
@@ -285,7 +289,7 @@ Procedure ProcessOpts;
|
|
|
Process command line opions, and checks if command line options OK.
|
|
|
}
|
|
|
const
|
|
|
- ShortOpts = 'pwqrvh?VsT:o:';
|
|
|
+ ShortOpts = 'pwqrvh?VsT:o:x:';
|
|
|
var
|
|
|
C : char;
|
|
|
begin
|
|
@@ -307,6 +311,7 @@ begin
|
|
|
's' : ParaSkipPackageInfo:=True;
|
|
|
'v' : ParaVerboseLevel:=v_verbose;
|
|
|
'T' : ParaTargets:=OptArg;
|
|
|
+ 'x' : ParaExtra:=OptArg;
|
|
|
'?' : Usage;
|
|
|
'h' : Usage;
|
|
|
'V' : printVersion;
|