* move lexlib and yacclib to their own package

git-svn-id: trunk@46388 -
This commit is contained in:
svenbarth 2020-08-12 19:06:29 +00:00
parent 5eabf9851e
commit cb98d97b78
8 changed files with 169 additions and 6 deletions

6
.gitattributes vendored
View File

@ -9081,6 +9081,10 @@ packages/tosunits/src/aes.pas svneol=native#text/plain
packages/tosunits/src/gemdos.pas svneol=native#text/plain
packages/tosunits/src/vdi.pas svneol=native#text/plain
packages/tosunits/src/xbios.pas svneol=native#text/plain
packages/tplylib/Makefile.fpc svneol=native#text/plain
packages/tplylib/fpmake.pp svneol=native#text/pascal
packages/tplylib/src/lexlib.pas svneol=native#text/pascal
packages/tplylib/src/yacclib.pas svneol=native#text/pascal
packages/univint/Makefile svneol=native#text/plain
packages/univint/Makefile.fpc svneol=native#text/plain
packages/univint/Makefile.fpc.fpcmake svneol=native#text/plain
@ -19503,7 +19507,6 @@ utils/tply/README.txt svneol=native#text/plain
utils/tply/fpmake.pp svneol=native#text/plain
utils/tply/lexbase.pas svneol=native#text/plain
utils/tply/lexdfa.pas svneol=native#text/plain
utils/tply/lexlib.pas svneol=native#text/plain
utils/tply/lexlist.pas svneol=native#text/plain
utils/tply/lexmsgs.pas svneol=native#text/plain
utils/tply/lexopt.pas svneol=native#text/plain
@ -19517,7 +19520,6 @@ utils/tply/tply.doc -text
utils/tply/tply.tex -text
utils/tply/yaccbase.pas svneol=native#text/plain
utils/tply/yaccclos.pas svneol=native#text/plain
utils/tply/yacclib.pas svneol=native#text/plain
utils/tply/yacclook.pas svneol=native#text/plain
utils/tply/yacclr0.pas svneol=native#text/plain
utils/tply/yaccmsgs.pas svneol=native#text/plain

View File

@ -118,6 +118,7 @@
add_syslog(ADirectory+IncludeTrailingPathDelimiter('syslog'));
add_tcl(ADirectory+IncludeTrailingPathDelimiter('tcl'));
add_tosunits(ADirectory+IncludeTrailingPathDelimiter('tosunits'));
add_tplylib(ADirectory+IncludeTrailingPathDelimiter('tplylib'));
add_univint(ADirectory+IncludeTrailingPathDelimiter('univint'));
add_unixutil(ADirectory+IncludeTrailingPathDelimiter('unixutil'));
add_unzip(ADirectory+IncludeTrailingPathDelimiter('unzip'));

View File

@ -679,6 +679,12 @@ begin
{$include tosunits/fpmake.pp}
end;
procedure add_tplylib(const ADirectory: string);
begin
with Installer do
{$include tplylib/fpmake.pp}
end;
procedure add_univint(const ADirectory: string);
begin
with Installer do

View File

@ -0,0 +1,102 @@
#
# Makefile.fpc for running fpmake
#
[package]
name=tplylib
version=3.3.1
[require]
packages=rtl fpmkunit
[install]
fpcpackage=y
[default]
fpcdir=../..
[prerules]
FPMAKE_BIN_CLEAN=$(wildcard ./fpmake$(SRCEXEEXT))
ifdef OS_TARGET
FPC_TARGETOPT+=--os=$(OS_TARGET)
endif
ifdef CPU_TARGET
FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
endif
LOCALFPMAKE=./fpmake$(SRCEXEEXT)
[rules]
# Do not pass the Makefile's unit and binary target locations. Fpmake uses it's own.
override FPCOPT:=$(filter-out -FU%,$(FPCOPT))
override FPCOPT:=$(filter-out -FE%,$(FPCOPT))
# Do not pass the package-unitdirectories. Fpmake adds those and this way they don't apear in the .fpm
override FPCOPT:=$(filter-out $(addprefix -Fu,$(COMPILER_UNITDIR)),$(FPCOPT))# Compose general fpmake-parameters
# Compose general fpmake-parameters
ifdef FPMAKEOPT
FPMAKE_OPT+=$(FPMAKEOPT)
endif
FPMAKE_OPT+=--localunitdir=../..
FPMAKE_OPT+=--globalunitdir=..
FPMAKE_OPT+=$(FPC_TARGETOPT)
FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT))
FPMAKE_OPT+=--compiler=$(FPC)
FPMAKE_OPT+=-bu
.NOTPARALLEL:
fpmake$(SRCEXEEXT): fpmake.pp
$(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
all: fpmake$(SRCEXEEXT)
$(LOCALFPMAKE) compile $(FPMAKE_OPT)
smart: fpmake$(SRCEXEEXT)
$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX
release: fpmake$(SRCEXEEXT)
$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE
debug: fpmake$(SRCEXEEXT)
$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG
# If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
# most often fail because the dependencies are cleared.
# In case of a clean, simply do nothing
ifeq ($(FPMAKE_BIN_CLEAN),)
clean:
else
clean:
$(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT)
endif
# In case of a distclean, perform an 'old'-style distclean. This to avoid problems
# when the package is compiled using fpcmake prior to running this clean using fpmake
ifeq ($(FPMAKE_BIN_CLEAN),)
distclean: $(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
else
distclean:
ifdef inUnix
{ $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi; }
else
$(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT)
endif
-$(DEL) $(LOCALFPMAKE)
endif
cleanall: distclean
install: fpmake$(SRCEXEEXT)
ifdef UNIXHier
$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
else
$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
endif
# distinstall also installs the example-sources and omits the location of the source-
# files from the fpunits.cfg files.
distinstall: fpmake$(SRCEXEEXT)
ifdef UNIXHier
$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0
else
$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0
endif
zipinstall: fpmake$(SRCEXEEXT)
$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX)
zipdistinstall: fpmake$(SRCEXEEXT)
$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie -fsp 0
zipsourceinstall: fpmake$(SRCEXEEXT)
ifdef UNIXHier
$(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=share/src/fpc-\$$\(PACKAGEVERSION\)/$(INSTALL_FPCSUBDIR)/\$$\(PACKAGEDIRECTORY\)
else
$(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=source\\$(INSTALL_FPCSUBDIR)\\\$$\(PACKAGEDIRECTORY\)
endif

View File

@ -0,0 +1,54 @@
{$ifndef ALLPACKAGES}
{$mode objfpc}{$H+}
program fpmake;
uses fpmkunit;
Var
T : TTarget;
P : TPackage;
begin
With Installer do
begin
{$endif ALLPACKAGES}
P:=AddPackage('tplylib');
P.ShortName:='tplylib';
{$ifdef ALLPACKAGES}
P.Directory:=ADirectory;
{$endif ALLPACKAGES}
P.Version:='3.3.1';
{ java and jvm-android do not support
fpc_get_output used in these sources }
if Defaults.CPU=jvm then
P.OSes := P.OSes - [java,android];
{ palmos does not support command line parameters }
P.OSes := P.OSes - [palmos];
{ Program does not fit in 16-bit memory constraints }
P.OSes := P.OSes - [msdos,win16];
{ avr-embedded and i8086-embedded do not meet needed requirements }
if Defaults.CPU in [avr,i8086] then
P.OSes := P.OSes - [embedded];
P.Author := '<various>';
P.License := 'LGPL with modification';
P.HomepageURL := 'www.freepascal.org';
P.Email := '';
P.Description := 'Library units for a compiler generator for Turbo Pascal and compatibles.';
P.NeedLibC:= false;
P.SourcePath.Add('src');
P.IncludePath.Add('src');
P.Options.Add('-Sg');
P.Targets.AddUnit('lexlib.pas');
P.Targets.AddUnit('yacclib.pas');
{$ifndef ALLPACKAGES}
Run;
end;
end.
{$endif ALLPACKAGES}

View File

@ -39,6 +39,8 @@ begin
P.Directory:=ADirectory;
P.Version:='3.3.1';
P.Dependencies.Add('tplylib');
P.Options.Add('-Sg');
T:=P.Targets.AddProgram('plex.pas');
@ -62,10 +64,6 @@ begin
T.Dependencies.AddUnit('yacclr0');
T.Dependencies.AddUnit('yacctabl');
P.Targets.AddUnit('lexlib.pas');
P.Targets.AddUnit('yacclib.pas');
P.Targets.AddUnit('lexbase.pas').install:=false;
P.Targets.AddUnit('lexopt.pas').install:=false;
P.Targets.AddUnit('lexdfa.pas').install:=false;