mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 12:09:30 +02:00
* fpcmade.<TARGET> added
* parameter support. So it can be using with "find -name 'Makefile.fpc'"
This commit is contained in:
parent
878b1b28e6
commit
2c5b28763b
File diff suppressed because it is too large
Load Diff
@ -450,11 +450,6 @@ endif
|
|||||||
# Default Tools
|
# Default Tools
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# file used to check if a package is compiled
|
|
||||||
ifndef FPCMAKED
|
|
||||||
FPCMAKED=fpcmaked
|
|
||||||
endif
|
|
||||||
|
|
||||||
# assembler, redefine it if cross compiling
|
# assembler, redefine it if cross compiling
|
||||||
ifndef AS
|
ifndef AS
|
||||||
AS=as
|
AS=as
|
||||||
@ -653,6 +648,7 @@ SMARTEXT=.sl
|
|||||||
STATICLIBEXT=.a
|
STATICLIBEXT=.a
|
||||||
SHAREDLIBEXT=.so
|
SHAREDLIBEXT=.so
|
||||||
PACKAGESUFFIX=
|
PACKAGESUFFIX=
|
||||||
|
FPCMADE=fpcmade
|
||||||
|
|
||||||
# Go32v1
|
# Go32v1
|
||||||
ifeq ($(OS_TARGET),go32v1)
|
ifeq ($(OS_TARGET),go32v1)
|
||||||
@ -663,16 +659,19 @@ SMARTEXT=.sl1
|
|||||||
STATICLIBEXT=.a1
|
STATICLIBEXT=.a1
|
||||||
SHAREDLIBEXT=.so1
|
SHAREDLIBEXT=.so1
|
||||||
PACKAGESUFFIX=v1
|
PACKAGESUFFIX=v1
|
||||||
|
FPCMADE=fpcmade.v1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Go32v2
|
# Go32v2
|
||||||
ifeq ($(OS_TARGET),go32v2)
|
ifeq ($(OS_TARGET),go32v2)
|
||||||
PACKAGESUFFIX=go32
|
PACKAGESUFFIX=go32
|
||||||
|
FPCMADE=fpcmade.dos
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
ifeq ($(OS_TARGET),linux)
|
ifeq ($(OS_TARGET),linux)
|
||||||
PACKAGESUFFIX=linux
|
PACKAGESUFFIX=linux
|
||||||
|
FPCMADE=fpcmade.lnx
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Win32
|
# Win32
|
||||||
@ -684,6 +683,7 @@ SMARTEXT=.slw
|
|||||||
STATICLIBEXT=.aw
|
STATICLIBEXT=.aw
|
||||||
SHAREDLIBEXT=.dll
|
SHAREDLIBEXT=.dll
|
||||||
PACKAGESUFFIX=win32
|
PACKAGESUFFIX=win32
|
||||||
|
FPCMADE=fpcmade.w32
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OS/2
|
# OS/2
|
||||||
@ -695,6 +695,7 @@ SMARTEXT=.so
|
|||||||
STATICLIBEXT=.ao2
|
STATICLIBEXT=.ao2
|
||||||
SHAREDLIBEXT=.dll
|
SHAREDLIBEXT=.dll
|
||||||
PACKAGESUFFIX=os2
|
PACKAGESUFFIX=os2
|
||||||
|
FPCMADE=fpcmade.os2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# library prefix
|
# library prefix
|
||||||
@ -819,12 +820,12 @@ fpc_test: examples
|
|||||||
|
|
||||||
.PHONY: fpc_all fpc_debug
|
.PHONY: fpc_all fpc_debug
|
||||||
|
|
||||||
$(FPCMAKED):
|
$(FPCMADE):
|
||||||
@$(ECHO) Compiled > $(FPCMAKED)
|
@$(ECHO) Compiled > $(FPCMADE)
|
||||||
|
|
||||||
fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
|
fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
|
||||||
$(addsuffix _component,$(COMPILECOMPONENTS)) \
|
$(addsuffix _component,$(COMPILECOMPONENTS)) \
|
||||||
$(ALLTARGET) $(FPCMAKED)
|
$(ALLTARGET) $(FPCMADE)
|
||||||
|
|
||||||
fpc_debug:
|
fpc_debug:
|
||||||
$(MAKE) all DEBUG=1
|
$(MAKE) all DEBUG=1
|
||||||
@ -897,7 +898,7 @@ else
|
|||||||
INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
|
INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES))
|
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1033,7 +1034,7 @@ ifdef CLEANPPUFILES
|
|||||||
ifdef PPUFILES
|
ifdef PPUFILES
|
||||||
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
|
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
|
||||||
else
|
else
|
||||||
CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES))
|
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1050,7 +1051,7 @@ endif
|
|||||||
ifdef EXTRACLEANFILES
|
ifdef EXTRACLEANFILES
|
||||||
-$(DEL) $(EXTRACLEANFILES)
|
-$(DEL) $(EXTRACLEANFILES)
|
||||||
endif
|
endif
|
||||||
-$(DEL) $(FPCMAKED) $(PPAS) link.res $(REDIRFILE)
|
-$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
|
||||||
|
|
||||||
fpc_cleanall: $(CLEANTARGET)
|
fpc_cleanall: $(CLEANTARGET)
|
||||||
ifdef CLEANEXEFILES
|
ifdef CLEANEXEFILES
|
||||||
@ -1058,7 +1059,7 @@ ifdef CLEANEXEFILES
|
|||||||
endif
|
endif
|
||||||
-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
|
-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
|
||||||
-$(DELTREE) *$(SMARTEXT)
|
-$(DELTREE) *$(SMARTEXT)
|
||||||
-$(DEL) $(FPCMAKED) $(PPAS) link.res $(REDIRFILE)
|
-$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
|
||||||
|
|
||||||
|
|
||||||
[dependrules]
|
[dependrules]
|
||||||
|
@ -237,9 +237,8 @@ end;
|
|||||||
Makefile.fpc reading
|
Makefile.fpc reading
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
function ReadMakefilefpc:boolean;
|
function ReadMakefilefpc(const fn:string):boolean;
|
||||||
var
|
var
|
||||||
fn : string;
|
|
||||||
ini : TIniFile;
|
ini : TIniFile;
|
||||||
|
|
||||||
procedure ReadTargetsString(var t:Ttargetsstring;const sec,name,def:string);
|
procedure ReadTargetsString(var t:Ttargetsstring;const sec,name,def:string);
|
||||||
@ -255,13 +254,6 @@ var
|
|||||||
sec : tsections;
|
sec : tsections;
|
||||||
begin
|
begin
|
||||||
ReadMakefilefpc:=false;
|
ReadMakefilefpc:=false;
|
||||||
if FileExists('Makefile.fpc') then
|
|
||||||
fn:='Makefile.fpc'
|
|
||||||
else
|
|
||||||
if FileExists('makefile.fpc') then
|
|
||||||
fn:='makefile.fpc'
|
|
||||||
else
|
|
||||||
exit;
|
|
||||||
|
|
||||||
Verbose('Reading '+fn);
|
Verbose('Reading '+fn);
|
||||||
ini:=TIniFile.Create(fn);
|
ini:=TIniFile.Create(fn);
|
||||||
@ -404,7 +396,7 @@ end;
|
|||||||
Makefile writing
|
Makefile writing
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
function WriteMakefile:boolean;
|
function WriteMakefile(const fn:string):boolean;
|
||||||
var
|
var
|
||||||
mf : TStringList;
|
mf : TStringList;
|
||||||
ss : TStringList;
|
ss : TStringList;
|
||||||
@ -560,7 +552,7 @@ var
|
|||||||
if ifdefneed then
|
if ifdefneed then
|
||||||
mf.Add('ifdef PACKAGE'+Uppercase(s));
|
mf.Add('ifdef PACKAGE'+Uppercase(s));
|
||||||
mf.Add('ifneq ($(wildcard '+packagedir+s3+'),)');
|
mf.Add('ifneq ($(wildcard '+packagedir+s3+'),)');
|
||||||
mf.Add('ifeq ($(wildcard '+packagedir+s3+'/$(FPCMAKED)),)');
|
mf.Add('ifeq ($(wildcard '+packagedir+s3+'/$(FPCMADE)),)');
|
||||||
mf.Add('override COMPILEPACKAGES+='+s2);
|
mf.Add('override COMPILEPACKAGES+='+s2);
|
||||||
mf.Add(s2+'_package:');
|
mf.Add(s2+'_package:');
|
||||||
mf.Add(#9'$(MAKE) -C '+packagedir+s3+' all');
|
mf.Add(#9'$(MAKE) -C '+packagedir+s3+' all');
|
||||||
@ -575,7 +567,7 @@ var
|
|||||||
begin
|
begin
|
||||||
mf.Add('ifdef COMPONENT'+Uppercase(s));
|
mf.Add('ifdef COMPONENT'+Uppercase(s));
|
||||||
mf.Add('ifneq ($(wildcard $(COMPONENTDIR)/'+s+'),)');
|
mf.Add('ifneq ($(wildcard $(COMPONENTDIR)/'+s+'),)');
|
||||||
mf.Add('ifeq ($(wildcard $(COMPONENTDIR)/'+s+'/$(FPCMAKED)),)');
|
mf.Add('ifeq ($(wildcard $(COMPONENTDIR)/'+s+'/$(FPCMADE)),)');
|
||||||
mf.Add('override COMPILECOMPONENTS+='+s);
|
mf.Add('override COMPILECOMPONENTS+='+s);
|
||||||
mf.Add(s+'_component:');
|
mf.Add(s+'_component:');
|
||||||
mf.Add(#9'$(MAKE) -C $(COMPONENTDIR)/'+s+' all');
|
mf.Add(#9'$(MAKE) -C $(COMPONENTDIR)/'+s+' all');
|
||||||
@ -617,7 +609,6 @@ var
|
|||||||
i : integer;
|
i : integer;
|
||||||
begin
|
begin
|
||||||
{ Open the Makefile }
|
{ Open the Makefile }
|
||||||
Verbose('Creating Makefile');
|
|
||||||
mf:=TStringList.Create;
|
mf:=TStringList.Create;
|
||||||
{ Buffer for reading and writing the sections }
|
{ Buffer for reading and writing the sections }
|
||||||
ss:=TStringList.Create;
|
ss:=TStringList.Create;
|
||||||
@ -944,34 +935,70 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Write the Makefile and cleanup }
|
{ Write the Makefile and cleanup }
|
||||||
Verbose('Writing Makefile');
|
Verbose('Writing '+fn);
|
||||||
FixTab(mf);
|
FixTab(mf);
|
||||||
mf.SaveToFile('Makefile');
|
mf.SaveToFile(fn);
|
||||||
mf.Destroy;
|
mf.Destroy;
|
||||||
ss.Destroy;
|
ss.Destroy;
|
||||||
WriteMakefile:=true;
|
WriteMakefile:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure UseMakefilefpc;
|
||||||
|
var
|
||||||
|
fn : string;
|
||||||
|
begin
|
||||||
|
if FileExists('Makefile.fpc') then
|
||||||
|
fn:='Makefile.fpc'
|
||||||
|
else
|
||||||
|
fn:='makefile.fpc';
|
||||||
|
{ Open Makefile.fpc }
|
||||||
|
if not ReadMakefilefpc(fn) then
|
||||||
|
Error('Can''t read '+fn);
|
||||||
|
{ Write Makefile }
|
||||||
|
if not WriteMakefile('Makefile') then
|
||||||
|
Error('Can''t write Makefile');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure UseParameters;
|
||||||
|
var
|
||||||
|
i : integer;
|
||||||
|
fn : string;
|
||||||
|
begin
|
||||||
|
for i:=1 to ParamCount do
|
||||||
|
begin
|
||||||
|
fn:=ParamStr(i);
|
||||||
|
{ Open Makefile.fpc }
|
||||||
|
if not ReadMakefilefpc(fn) then
|
||||||
|
Error('Can''t read '+fn);
|
||||||
|
{ Write Makefile }
|
||||||
|
if not WriteMakefile(ExtractFilePath(fn)+'Makefile') then
|
||||||
|
Error('Can''t write '+ExtractFilePath(fn)+'Makefile');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ Open userini.ini }
|
{ Open userini.ini }
|
||||||
fpcini:=ReadFpcMakeIni;
|
fpcini:=ReadFpcMakeIni;
|
||||||
if not assigned(fpcini) then
|
if not assigned(fpcini) then
|
||||||
Error('Can''t read fpcmake.ini');
|
Error('Can''t read fpcmake.ini');
|
||||||
|
|
||||||
{ Open Makefile.fpc }
|
if ParamCount=0 then
|
||||||
if not ReadMakefilefpc then
|
UseMakefilefpc
|
||||||
Error('Can''t read Makefile.fpc');
|
else
|
||||||
|
UseParameters;
|
||||||
{ Write Makefile }
|
|
||||||
if not WriteMakefile then
|
|
||||||
Error('Can''t write Makefile');
|
|
||||||
|
|
||||||
fpcini.destroy;
|
fpcini.destroy;
|
||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 1999-12-02 11:30:24 peter
|
Revision 1.12 1999-12-19 15:15:04 peter
|
||||||
|
* fpcmade.<TARGET> added
|
||||||
|
* parameter support. So it can be using with "find -name 'Makefile.fpc'"
|
||||||
|
|
||||||
|
Revision 1.11 1999/12/02 11:30:24 peter
|
||||||
* better dup checking
|
* better dup checking
|
||||||
|
|
||||||
Revision 1.10 1999/11/26 00:20:15 peter
|
Revision 1.10 1999/11/26 00:20:15 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user