summaryrefslogtreecommitdiff
path: root/Make.lpr
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2014-09-12 12:08:13 +0200
committerErich Eckner <git@eckner.net>2014-09-12 12:08:13 +0200
commit5994d8d97ca8f83b689d5ce8efe910eb906b2602 (patch)
tree9fd2da717b68ffdd1c1793c1293720e18fe94b99 /Make.lpr
parent396180c5d4cc28dbd81cea1981c515345383fd1f (diff)
downloadMake-5994d8d97ca8f83b689d5ce8efe910eb906b2602.tar.xz
"%basedir{n}" und "%num'test1'" eingefügt
Diffstat (limited to 'Make.lpr')
-rw-r--r--Make.lpr51
1 files changed, 48 insertions, 3 deletions
diff --git a/Make.lpr b/Make.lpr
index 942f568..d8769e6 100644
--- a/Make.lpr
+++ b/Make.lpr
@@ -211,8 +211,9 @@ begin
fin:=s[length(s)]=';';
if fin then delete(s,length(s),1);
beg:=not (s[1] in [' ',#9]);
- if (notQuotedPos(':',s)>0) xor beg then begin
+ if (notQuotedPos(':',s)=0) and beg then begin
closefile(f);
+ writeln('In der Quell-Ziel-Zuordnung muss ein (unzitierter) Doppelpunkt auftauchen!');
exit;
end;
if beg then begin
@@ -285,8 +286,8 @@ begin
end;
function Quellersetzung(var worin: string; Quelle: string): boolean;
-var s: string;
- i: integer;
+var s,t: string;
+ i,a,e: integer;
begin
result:=false;
while pos('%nurmit''',worin)>0 do begin
@@ -321,6 +322,29 @@ begin
end;
while pos('%basename',worin)>0 do
worin:=copy(worin,1,pos('%basename',worin)-1)+s+copy(worin,pos('%basename',worin)+9,length(worin));
+ while pos('%basedir(',worin)>0 do begin
+ a:=pos('%basedir(',worin);
+ s:=copy(worin,1,a-1);
+ while (a<=length(worin)) and (worin[a]<>'(') do
+ inc(a);
+ e:=a;
+ while (e<=length(worin)) and (worin[e]<>')') do
+ inc(e);
+ i:=strtoint(copy(worin,a+1,e-a-1));
+ if (e<length(worin)) and (worin[e+1]='/') then
+ inc(e);
+ t:=extractfilepath(Quelle);
+ a:=length(t);
+ while i>0 do begin
+ while (a>0) and (t[a]='/') do
+ dec(a);
+ while (a>0) and (t[a]<>'/') do
+ dec(a);
+ dec(i);
+ end;
+ delete(t,1,a);
+ worin:=s+t+copy(worin,e+1,length(worin));
+ end;
s:=extractfilepath(Quelle);
while pos('%basedir/',worin)>0 do
worin:=copy(worin,1,pos('%basedir/',worin)-1)+s+copy(worin,pos('%basedir/',worin)+9,length(worin));
@@ -330,6 +354,27 @@ begin
worin:=copy(worin,1,pos('%BASEDIR/',worin)-1)+extractfilepath(inputfile)+copy(worin,pos('%BASEDIR/',worin)+9,length(worin));
while pos('%BASEDIR',worin)>0 do
worin:=copy(worin,1,pos('%BASEDIR',worin)-1)+extractfilepath(inputfile)+copy(worin,pos('%BASEDIR',worin)+8,length(worin));
+ while pos('%num''',worin)>0 do begin
+ a:=pos('%num''',worin);
+ e:=a;
+ while (e<=length(worin)) and (worin[e]<>'''') do
+ inc(e);
+ inc(e);
+ while (e<=length(worin)) and (worin[e]<>'''') do
+ inc(e);
+ s:=copy(worin,a,e-a-1);
+ for i:=length(s) downto 1 do
+ if s[i] in ['0'..'9'] then
+ break
+ else
+ delete(s,i,1);
+ for i:=length(s) downto 1 do
+ if not (s[i] in ['0'..'9']) then begin
+ delete(s,1,i);
+ break;
+ end;
+ worin:=copy(worin,1,a-1)+s+copy(worin,e+1,length(worin));
+ end;
end;
function bashMatch(was,worauf: string): boolean;