mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 21:38:27 +02:00
added svn2revisioninc to the makefiles
git-svn-id: trunk@7862 -
This commit is contained in:
parent
8aa081ebd9
commit
f8cf04723c
@ -340,103 +340,103 @@ ifeq ($(FULL_TARGET),arm-linux)
|
||||
override TARGET_DIRS+=apiwizz
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-linux)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-go32v2)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-win32)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-os2)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-freebsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-beos)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netbsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-solaris)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-qnx)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netware)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-openbsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wdosx)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-emx)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-watcom)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netwlibc)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-linux)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-freebsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-netbsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-amiga)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-atari)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-openbsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-palmos)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-linux)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-netbsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-macos)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-darwin)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-morphos)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-linux)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-netbsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-solaris)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-linux)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-freebsd)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-linux)
|
||||
override TARGET_PROGRAMS+=lazres updatepofiles
|
||||
override TARGET_PROGRAMS+=lazres svn2revisioninc updatepofiles
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-linux)
|
||||
override COMPILER_OPTIONS+=-gl
|
||||
@ -2909,4 +2909,5 @@ endif
|
||||
.PHONY: all
|
||||
all: apiwizz_all
|
||||
$(MAKE) --assume-new=lazres.pp lazres$(EXEEXT)
|
||||
$(MAKE) --assume-new=svn2revisioninc.pas svn2revisioninc.pas$(EXEEXT)
|
||||
$(MAKE) --assume-new=updatepofiles.pas updatepofiles$(EXEEXT)
|
||||
|
@ -9,7 +9,7 @@ version=0.9b
|
||||
|
||||
[target]
|
||||
dirs=apiwizz
|
||||
programs=lazres updatepofiles
|
||||
programs=lazres svn2revisioninc updatepofiles
|
||||
|
||||
[require]
|
||||
packages=rtl fcl
|
||||
@ -41,6 +41,7 @@ export LCL_PLATFORM
|
||||
|
||||
all: apiwizz_all
|
||||
$(MAKE) --assume-new=lazres.pp lazres$(EXEEXT)
|
||||
$(MAKE) --assume-new=svn2revisioninc.pas svn2revisioninc.pas$(EXEEXT)
|
||||
$(MAKE) --assume-new=updatepofiles.pas updatepofiles$(EXEEXT)
|
||||
|
||||
# end.
|
||||
|
@ -51,6 +51,10 @@ var
|
||||
RevisionIncFileName: string;
|
||||
RevisionStr: string = 'Unknown';
|
||||
|
||||
const
|
||||
RevisionIncComment = '// Created by Svn2RevisionInc';
|
||||
ConstStart = 'const RevisionStr = ''';
|
||||
|
||||
function FindRevision: boolean;
|
||||
var
|
||||
SvnDir: string;
|
||||
@ -87,7 +91,6 @@ var
|
||||
EntriesFileName: string;
|
||||
EntriesDoc: TXMLDocument;
|
||||
EntryNode: TDomNode;
|
||||
NameAttribute: TDOMNode;
|
||||
begin
|
||||
Result:=false;
|
||||
EntriesFileName:=AppendPathDelim(SourceDirectory)+'.svn'+PathDelim+'entries';
|
||||
@ -114,14 +117,29 @@ begin
|
||||
Result := GetRevisionFromSvnVersion or GetRevisionFromEntries;
|
||||
end;
|
||||
|
||||
function IsValidRevisionInc: boolean;
|
||||
var
|
||||
Lines: TStringList;
|
||||
begin
|
||||
Result:=false;
|
||||
if FileExists(RevisionIncFileName) then begin
|
||||
Lines := TStringList.Create;
|
||||
Lines.LoadFromFile(RevisionIncFileName);
|
||||
if (Lines.Count=2) and
|
||||
(Lines[1]=RevisionIncComment) and
|
||||
(copy(Lines[2], 1, length(ConstStart))=ConstStart) then
|
||||
Result:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure WriteRevisionInc;
|
||||
var
|
||||
RevisionIncText: Text;
|
||||
begin
|
||||
AssignFile(RevisionIncText, RevisionIncFileName);
|
||||
Rewrite(RevisionIncText);
|
||||
writeln(RevisionIncText, '// Created by Svn2RevisionInc');
|
||||
writeln(RevisionIncText, 'const RevisionStr = ''', RevisionStr, ''';');
|
||||
writeln(RevisionIncText, RevisionIncComment);
|
||||
writeln(RevisionIncText, ConstStart, RevisionStr, ''';');
|
||||
CloseFile(RevisionIncText);
|
||||
writeln(format('Created %s for revision: %s',
|
||||
[RevisionIncFileName, RevisionStr]));
|
||||
@ -152,7 +170,7 @@ begin
|
||||
writeln('Usage: ',ExtractFileName(ParamStr(0)),' sourcedir revision.inc');
|
||||
halt(1);
|
||||
end;
|
||||
if FindRevision or not FileExists(RevisionIncFileName) then
|
||||
if FindRevision or not IsValidRevisionInc then
|
||||
WriteRevisionInc;
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user