mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 16:06:16 +02:00
* don't create temporary smartlink dir for internalassembler
This commit is contained in:
parent
fe7eb08eef
commit
eb95f58e21
@ -41,8 +41,6 @@ const
|
|||||||
|
|
||||||
type
|
type
|
||||||
TAssembler=class
|
TAssembler=class
|
||||||
private
|
|
||||||
procedure CreateSmartLinkPath(const s:string);
|
|
||||||
public
|
public
|
||||||
{filenames}
|
{filenames}
|
||||||
path : pathstr;
|
path : pathstr;
|
||||||
@ -60,6 +58,8 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TExternalAssembler=class(TAssembler)
|
TExternalAssembler=class(TAssembler)
|
||||||
|
private
|
||||||
|
procedure CreateSmartLinkPath(const s:string);
|
||||||
protected
|
protected
|
||||||
{outfile}
|
{outfile}
|
||||||
AsmSize,
|
AsmSize,
|
||||||
@ -144,20 +144,12 @@ begin
|
|||||||
{ load start values }
|
{ load start values }
|
||||||
asmfile:=current_module.asmfilename^;
|
asmfile:=current_module.asmfilename^;
|
||||||
objfile:=current_module.objfilename^;
|
objfile:=current_module.objfilename^;
|
||||||
name:=FixFileName(current_module.modulename^);
|
name:=Lower(current_module.modulename^);
|
||||||
|
path:=current_module.outputpath^;
|
||||||
SmartAsm:=smart;
|
SmartAsm:=smart;
|
||||||
SmartFilesCount:=0;
|
SmartFilesCount:=0;
|
||||||
SmartHeaderCount:=0;
|
SmartHeaderCount:=0;
|
||||||
SmartLinkOFiles.Clear;
|
SmartLinkOFiles.Clear;
|
||||||
{ Which path will be used ? }
|
|
||||||
if SmartAsm then
|
|
||||||
begin
|
|
||||||
path:=current_module.outputpath^+FixFileName(current_module.modulename^)+target_info.smartext;
|
|
||||||
CreateSmartLinkPath(path);
|
|
||||||
path:=FixPath(path,false);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
path:=current_module.outputpath^;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -176,40 +168,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TAssembler.CreateSmartLinkPath(const s:string);
|
|
||||||
var
|
|
||||||
dir : searchrec;
|
|
||||||
begin
|
|
||||||
if PathExists(s) then
|
|
||||||
begin
|
|
||||||
{ the path exists, now we clean only all the .o and .s files }
|
|
||||||
{ .o files }
|
|
||||||
findfirst(s+dirsep+'*'+target_info.objext,anyfile,dir);
|
|
||||||
while (doserror=0) do
|
|
||||||
begin
|
|
||||||
RemoveFile(s+dirsep+dir.name);
|
|
||||||
findnext(dir);
|
|
||||||
end;
|
|
||||||
findclose(dir);
|
|
||||||
{ .s files }
|
|
||||||
findfirst(s+dirsep+'*'+target_info.asmext,anyfile,dir);
|
|
||||||
while (doserror=0) do
|
|
||||||
begin
|
|
||||||
RemoveFile(s+dirsep+dir.name);
|
|
||||||
findnext(dir);
|
|
||||||
end;
|
|
||||||
findclose(dir);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
{$I-}
|
|
||||||
mkdir(s);
|
|
||||||
{$I+}
|
|
||||||
if ioresult<>0 then;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TAssembler.NextSmartName(place:tcutplace);
|
procedure TAssembler.NextSmartName(place:tcutplace);
|
||||||
var
|
var
|
||||||
s : string;
|
s : string;
|
||||||
@ -255,10 +213,53 @@ end;
|
|||||||
Constructor TExternalAssembler.Create(smart:boolean);
|
Constructor TExternalAssembler.Create(smart:boolean);
|
||||||
begin
|
begin
|
||||||
inherited Create(smart);
|
inherited Create(smart);
|
||||||
|
if SmartAsm then
|
||||||
|
begin
|
||||||
|
path:=FixPath(current_module.outputpath^+FixFileName(current_module.modulename^)+target_info.smartext,false);
|
||||||
|
CreateSmartLinkPath(path);
|
||||||
|
end;
|
||||||
Outcnt:=0;
|
Outcnt:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TExternalAssembler.CreateSmartLinkPath(const s:string);
|
||||||
|
var
|
||||||
|
dir : searchrec;
|
||||||
|
hs : string;
|
||||||
|
begin
|
||||||
|
if PathExists(s) then
|
||||||
|
begin
|
||||||
|
{ the path exists, now we clean only all the .o and .s files }
|
||||||
|
{ .o files }
|
||||||
|
findfirst(s+dirsep+'*'+target_info.objext,anyfile,dir);
|
||||||
|
while (doserror=0) do
|
||||||
|
begin
|
||||||
|
RemoveFile(s+dirsep+dir.name);
|
||||||
|
findnext(dir);
|
||||||
|
end;
|
||||||
|
findclose(dir);
|
||||||
|
{ .s files }
|
||||||
|
findfirst(s+dirsep+'*'+target_info.asmext,anyfile,dir);
|
||||||
|
while (doserror=0) do
|
||||||
|
begin
|
||||||
|
RemoveFile(s+dirsep+dir.name);
|
||||||
|
findnext(dir);
|
||||||
|
end;
|
||||||
|
findclose(dir);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
hs:=s;
|
||||||
|
if hs[length(hs)] in ['/','\'] then
|
||||||
|
delete(hs,length(hs),1);
|
||||||
|
{$I-}
|
||||||
|
mkdir(hs);
|
||||||
|
{$I+}
|
||||||
|
if ioresult<>0 then;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
lastas : byte=255;
|
lastas : byte=255;
|
||||||
var
|
var
|
||||||
@ -611,7 +612,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.15 2001-03-05 21:39:11 peter
|
Revision 1.16 2001-03-13 18:42:39 peter
|
||||||
|
* don't create temporary smartlink dir for internalassembler
|
||||||
|
|
||||||
|
Revision 1.15 2001/03/05 21:39:11 peter
|
||||||
* changed to class with common TAssembler also for internal assembler
|
* changed to class with common TAssembler also for internal assembler
|
||||||
|
|
||||||
Revision 1.14 2001/02/26 08:08:16 michael
|
Revision 1.14 2001/02/26 08:08:16 michael
|
||||||
|
Loading…
Reference in New Issue
Block a user