summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Make.8.in70
-rw-r--r--Make.lpr19
-rw-r--r--Make.lps127
-rw-r--r--dateibeziehungen.pas2
4 files changed, 102 insertions, 116 deletions
diff --git a/Make.8.in b/Make.8.in
index 3fc1ef3..7e1ce71 100644
--- a/Make.8.in
+++ b/Make.8.in
@@ -10,9 +10,6 @@ Make \- somewhat more powerfull alternative to make
.B "\-A, \-\-Ausgabe Ausgabedatei"
store commands in \fIAusgabedatei\fP
.TP
-.B "\-H, \-\-Hilfe"
-display help screen
-.TP
.B "\-W, \-\-Watte"
just print what would be done
.TP
@@ -27,53 +24,68 @@ refresh all checksums
.TP
.B "\-u, \-\-unsicher"
accept running jobs outside of directory of \fIAusgabedatei\fP or \fIPrüfsummendatei\fP
-.SH SYNTAX
-Empty lines and lines beginning with \fB#\fP are ignored.
+.TP
+Options \fB-D\fP, \fB-P\fP and either \fB-W\fP or \fB-A\fP are compulsory.
+.SH MACHDATEI SYNTAX
+\fB#\fP starts comments, empty lines are ignored.
.PP
-The file starts with definition of files:
+The file consists of four types of lines:
+.TP
+1. Definitions of files to watch.
+.TP
+2. Definitions of targets.
+.TP
+3. Regular expressions matching sources
+.TP
+4. Commands to execute for compiling targets from sources.
+.SH WATCH FILE DEFINITIONS
.TP
.B "/path/to/files"
add these files to currentness control
.TP
.B "-r /path/to/files"
recursively add these files and directories to currentness control
-.PP
-The rest of the file consists of compilation rules, each consisting of two consecutive lines:
-.TP
-The \fBfirst\fP line is a regex-aware rule for identifying dependencies and must not start with a space or tab.
-.TP
-.B ">1 target:sourceRegEx"
-Each (set of) \fItarget\fP(s) is generated by a separate command, possibly involving many source files matching \fIsourceRegEx\fP.
-.TP
-.B ">n target:sourceRegEx"
-All \fItarget\fPs are generated by a single command, possibly involving many source files matching \fIsourceRegEx\fP.
.TP
-The \fBfollowing\fP line(s) contain(s) commands to refresh the targets and must start with a space or tab.
-The \fBlast\fP line of these must end on \fB;\fP.
+.B "! excludeRegex"
+from now on do not add files matching the regular expression \fIexcludeRegex\fP to currentness control
+.SH TARGET DEFINITIONS
+These lines must end on \fB:\fP.
+Substitutions marked with (*) are allowed in this type of line.
+Multiple targets may be defined in one line if separated by spaces or in common bash syntax: \fB*\fP, \fB{one,two,three}\fP, \fB{1..3}\fP are expanded.
+Alternatively multiple targets may be defined in multiple consecutive lines.
+A single line containing the source regex must follow a set of target definition lines.
+.SH COMMAND DEFINITIONS
+Each of these lines must end on \fB;\fP.
+Substitutions marked with (*) are allowed in this type of line.
+Commands on one line are concatenated with \fB&&\fP instead of \fB;\fP \- to use a literal \fB;\fP in a command, one must write \fB;;\fP in the
+\fIMachdatei\fP.
.SH SUBSTITUTIONS
-Some substitutions and macros are recognized:
+Some substitutions and macros are recognized.
+Obviously, substitutions marked with \fB(*)\fP are only available in COMMAND- and TARGET-DEFINITION lines.
.TP
-.B "%nurmit'filePart'"
-only apply rule / generate target name from source file if name of source file contains \fIfilePart\fP
+.B "%nurmit'filePart'" (*)
+only execute command / generate target name from source file if name of source file contains \fIfilePart\fP
.TP
-.B "%nurohne'filePart'"
+.B "%nurohne'filePart'" (*)
opposite of \fB%nurmit'filePart'\fP
.TP
-.B "%in"
+.B "%in" (*)
file name and path of source file
.TP
-.B "%ifile"
+.B "%ifile" (*)
file name of source file
.TP
-.B "%basename"
+.B "%basename" (*)
file name of source file without extension(s)
.TP
-.B "%dirname(number)"
-last \fInumber\fP components of path so source file
+.B "%dirname(num1,num2)" (*)
+components \fInum1\fP upto \fInum2\fP of path to source file.
+Negative numbers are counted from the back - e.g. \fB-1\fP is the last path component, etc.
+\fInum2\fP may be omitted, it defaults to \fB-1\fP.
.TP
-.B "%dirname"
+.B "%dirname" (*)
path so source file.
-Identical to \fB%basedir(0)\fP.
+Identical to \fB%dirname(0)\fP.
.TP
.B "%DIRNAME"
path to \fIMachdatei\fP
diff --git a/Make.lpr b/Make.lpr
index 030e0c5..7ebbfa9 100644
--- a/Make.lpr
+++ b/Make.lpr
@@ -19,7 +19,6 @@ type
procedure doRun; override;
public
constructor create(theOwner: tComponent); override;
- procedure writeHelp; virtual;
end;
function liesPruefsummenfile(sumNam: string; var dats: tDateienMitDaten): boolean;
@@ -387,21 +386,14 @@ var
inputfile,pruefsummenfile,errorMsg: string;
mglAbhaengigkeiten,zutunAbhaengigkeiten: tAbhaengigkeiten;
dateien: tDateienMitDaten;
- i: longint;
begin
- errorMsg:=checkOptions('A:HWD:P:au','Ausgabe: Hilfe Watte Datei: Prüfsummen: alleSummenErneuern unsicher');
+ errorMsg:=checkOptions('A:WD:P:au','Ausgabe: Watte Datei: Prüfsummen: alleSummenErneuern unsicher');
if errorMsg<>'' then begin
showException(exception.create(errorMsg+#10'Hilfe: '+exename+' -H/--Hilfe'));
terminate;
exit;
end;
- if hasOption('H','Hilfe') then begin
- writeHelp;
- terminate;
- exit;
- end;
-
if (getOptionValue('A','Ausgabe')='') and not hasOption('W','Watte') then begin
showException(exception.create('Ausgabedatei wird benötigt!'));
terminate;
@@ -437,9 +429,6 @@ begin
exit;
end;
- for i:=0 to length(dateien)-1 do
- writeln(dateien[i].aktuell,' ',dateien[i].name);
-
writeln('Regeln: '+inttostr(length(mglAbhaengigkeiten))+', Dateien: '+inttostr(length(dateien)));
findeWasZuTunIst(mglAbhaengigkeiten,zuTunAbhaengigkeiten,dateien,inputfile);
writeln('anzuwendende Regeln: '+inttostr(length(zuTunAbhaengigkeiten)));
@@ -454,12 +443,6 @@ begin
stopOnException:=True;
end;
-procedure tMake.writeHelp;
-begin
- writeln('Verwendung:');
- writeln(' ',exeName,' -A/--Ausgabe $ausgabedatei -H/--Hilfe -W/--Watte -D/--Datei $Machdatei -P/--Prüfsummen $Prüfsummendatei -a/--alleSummenErneuern -u/--unsicher');
-end;
-
var
application: tMake;
begin
diff --git a/Make.lps b/Make.lps
index 2ca12b1..9b0ff05 100644
--- a/Make.lps
+++ b/Make.lps
@@ -8,16 +8,16 @@
<Filename Value="Make.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
- <TopLine Value="36"/>
- <CursorPos X="40" Y="58"/>
- <FoldState Value=" T3k8061 pjck50{SU"/>
- <UsageCount Value="57"/>
+ <TopLine Value="2"/>
+ <CursorPos Y="22"/>
+ <FoldState Value=" T3N0t3 plCmW0{S%"/>
+ <UsageCount Value="60"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="Machdatei.txt"/>
<IsPartOfProject Value="True"/>
- <UsageCount Value="57"/>
+ <UsageCount Value="60"/>
<DefaultSyntaxHighlighter Value="None"/>
</Unit1>
<Unit2>
@@ -26,8 +26,7 @@
<EditorIndex Value="2"/>
<TopLine Value="300"/>
<CursorPos Y="50"/>
- <FoldState Value=" T3f065 pk9kR0D4h"/>
- <UsageCount Value="36"/>
+ <UsageCount Value="39"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
@@ -37,36 +36,36 @@
<TopLine Value="37"/>
<CursorPos Y="111"/>
<FoldState Value=" T3i7039 pj2jP0B716."/>
- <UsageCount Value="33"/>
+ <UsageCount Value="36"/>
</Unit3>
<Unit4>
+ <Filename Value="dateibeziehungen.pas"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="dateiBeziehungen"/>
+ <EditorIndex Value="1"/>
+ <TopLine Value="55"/>
+ <CursorPos X="60" Y="199"/>
+ <FoldState Value=" T3e0C3j"/>
+ <UsageCount Value="28"/>
+ <Loaded Value="True"/>
+ </Unit4>
+ <Unit5>
<Filename Value="Machdatei"/>
<CursorPos X="45" Y="17"/>
<UsageCount Value="10"/>
<DefaultSyntaxHighlighter Value="None"/>
- </Unit4>
- <Unit5>
+ </Unit5>
+ <Unit6>
<Filename Value="../Stabile/lowlevelunit.pas"/>
<EditorIndex Value="-1"/>
<CursorPos X="26" Y="23"/>
<UsageCount Value="9"/>
- </Unit5>
- <Unit6>
+ </Unit6>
+ <Unit7>
<Filename Value="../units/lowlevelunit.pas"/>
<EditorIndex Value="-1"/>
<CursorPos X="15" Y="265"/>
<UsageCount Value="10"/>
- </Unit6>
- <Unit7>
- <Filename Value="dateibeziehungen.pas"/>
- <IsPartOfProject Value="True"/>
- <UnitName Value="dateiBeziehungen"/>
- <EditorIndex Value="1"/>
- <TopLine Value="16"/>
- <CursorPos Y="213"/>
- <FoldState Value=" T3e0C3 pjYkD0S1!"/>
- <UsageCount Value="26"/>
- <Loaded Value="True"/>
</Unit7>
<Unit8>
<Filename Value="/usr/lib/fpc/src/rtl/objpas/sysutils/datih.inc"/>
@@ -76,127 +75,119 @@
<UsageCount Value="10"/>
</Unit8>
</Units>
- <JumpHistory Count="30" HistoryIndex="29">
+ <JumpHistory Count="28" HistoryIndex="27">
<Position1>
<Filename Value="Make.lpr"/>
- <Caret Line="25" Column="72" TopLine="5"/>
+ <Caret Line="143" Column="129" TopLine="123"/>
</Position1>
<Position2>
<Filename Value="Make.lpr"/>
- <Caret Line="143" Column="129" TopLine="123"/>
+ <Caret Line="424" Column="53" TopLine="404"/>
</Position2>
<Position3>
<Filename Value="Make.lpr"/>
- <Caret Line="424" Column="53" TopLine="404"/>
+ <Caret Line="431" Column="77" TopLine="396"/>
</Position3>
<Position4>
<Filename Value="Make.lpr"/>
- <Caret Line="431" Column="77" TopLine="396"/>
+ <Caret Line="222" Column="59" TopLine="195"/>
</Position4>
<Position5>
- <Filename Value="Make.lpr"/>
- <Caret Line="222" Column="59" TopLine="195"/>
+ <Filename Value="dateibeziehungen.pas"/>
+ <Caret Line="205" Column="44" TopLine="50"/>
</Position5>
<Position6>
<Filename Value="dateibeziehungen.pas"/>
- <Caret Line="205" Column="44" TopLine="50"/>
+ <Caret Line="11" Column="40"/>
</Position6>
<Position7>
<Filename Value="dateibeziehungen.pas"/>
- <Caret Line="11" Column="40"/>
+ <Caret Line="109" Column="46" TopLine="87"/>
</Position7>
<Position8>
- <Filename Value="dateibeziehungen.pas"/>
- <Caret Line="109" Column="46" TopLine="87"/>
- </Position8>
- <Position9>
<Filename Value="Make.lpr"/>
<Caret Line="203" Column="79" TopLine="172"/>
- </Position9>
- <Position10>
+ </Position8>
+ <Position9>
<Filename Value="dateibeziehungen.pas"/>
<Caret Line="213" TopLine="16"/>
+ </Position9>
+ <Position10>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="55" Column="36" TopLine="36"/>
</Position10>
<Position11>
<Filename Value="Make.lpr"/>
- <Caret Line="215" Column="57" TopLine="236"/>
+ <Caret Line="64" Column="50" TopLine="44"/>
</Position11>
<Position12>
<Filename Value="Make.lpr"/>
- <Caret Line="55" Column="36" TopLine="36"/>
+ <Caret Line="103" Column="35" TopLine="84"/>
</Position12>
<Position13>
<Filename Value="Make.lpr"/>
- <Caret Line="64" Column="50" TopLine="44"/>
+ <Caret Line="149" Column="3" TopLine="123"/>
</Position13>
<Position14>
<Filename Value="Make.lpr"/>
- <Caret Line="103" Column="35" TopLine="84"/>
+ <Caret Line="242" Column="32" TopLine="224"/>
</Position14>
<Position15>
<Filename Value="Make.lpr"/>
- <Caret Line="149" Column="3" TopLine="123"/>
+ <Caret Line="245" Column="33" TopLine="224"/>
</Position15>
<Position16>
<Filename Value="Make.lpr"/>
- <Caret Line="242" Column="32" TopLine="224"/>
+ <Caret Line="244" Column="66" TopLine="225"/>
</Position16>
<Position17>
<Filename Value="Make.lpr"/>
- <Caret Line="245" Column="33" TopLine="224"/>
+ <Caret Line="242" Column="37" TopLine="224"/>
</Position17>
<Position18>
<Filename Value="Make.lpr"/>
- <Caret Line="244" Column="66" TopLine="225"/>
+ <Caret Line="244" Column="65" TopLine="224"/>
</Position18>
<Position19>
<Filename Value="Make.lpr"/>
- <Caret Line="242" Column="37" TopLine="224"/>
+ <Caret Line="255" Column="40" TopLine="235"/>
</Position19>
<Position20>
<Filename Value="Make.lpr"/>
- <Caret Line="244" Column="65" TopLine="224"/>
+ <Caret Line="149" Column="18" TopLine="120"/>
</Position20>
<Position21>
<Filename Value="Make.lpr"/>
- <Caret Line="255" Column="40" TopLine="235"/>
+ <Caret Line="244" Column="40" TopLine="222"/>
</Position21>
<Position22>
<Filename Value="Make.lpr"/>
- <Caret Line="149" Column="18" TopLine="120"/>
+ <Caret Line="250" Column="37" TopLine="227"/>
</Position22>
<Position23>
- <Filename Value="Make.lpr"/>
- <Caret Line="244" Column="40" TopLine="222"/>
+ <Filename Value="dateibeziehungen.pas"/>
+ <Caret Line="297" Column="69" TopLine="272"/>
</Position23>
<Position24>
- <Filename Value="Make.lpr"/>
- <Caret Line="250" Column="37" TopLine="227"/>
+ <Filename Value="dateibeziehungen.pas"/>
+ <Caret Line="220" Column="12" TopLine="209"/>
</Position24>
<Position25>
- <Filename Value="dateibeziehungen.pas"/>
- <Caret Line="297" Column="69" TopLine="272"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="25" Column="29" TopLine="17"/>
</Position25>
<Position26>
- <Filename Value="dateibeziehungen.pas"/>
- <Caret Line="220" Column="12" TopLine="209"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="437" Column="53" TopLine="407"/>
</Position26>
<Position27>
<Filename Value="Make.lpr"/>
- <Caret Line="143" TopLine="396"/>
+ <Caret Line="390" TopLine="137"/>
</Position27>
<Position28>
<Filename Value="Make.lpr"/>
- <Caret Line="25" Column="29" TopLine="17"/>
+ <Caret Line="447" TopLine="414"/>
</Position28>
- <Position29>
- <Filename Value="Make.lpr"/>
- <Caret Line="437" Column="53" TopLine="407"/>
- </Position29>
- <Position30>
- <Filename Value="Make.lpr"/>
- <Caret Line="394" Column="12" TopLine="403"/>
- </Position30>
</JumpHistory>
</ProjectSession>
</CONFIG>
diff --git a/dateibeziehungen.pas b/dateibeziehungen.pas
index 5296dd0..30dedeb 100644
--- a/dateibeziehungen.pas
+++ b/dateibeziehungen.pas
@@ -196,7 +196,7 @@ begin
if rekursiv and
(sr.name<>'.') and
(sr.name<>'..') then
- sammleDateien(extractfilepath(wo)+sr.name+'/'+extractfilename(wo),rekursiv,ignoriere,dats);
+ sammleDateien(extractfilepath(wo)+sr.name+'/*',rekursiv,ignoriere,dats);
end
else begin
setlength(dats,length(dats)+1);