diff --git a/compiler/Makefile b/compiler/Makefile index 110446185f..5b5fd8df0a 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -1,5 +1,5 @@ # -# Makefile generated by fpcmake v0.99.13 on 1999-11-15 23:37 +# Makefile generated by fpcmake v0.99.13 on 1999-11-23 09:33 # defaultrule: all @@ -180,10 +180,16 @@ override NEEDOPT=-Sg ifndef FPCDIR FPCDIR=.. endif +ifndef PACKAGEDIR +PACKAGEDIR=$(FPCDIR)/packages +endif ifndef TARGETDIR TARGETDIR=. endif +# Packages + + # Libraries @@ -224,6 +230,11 @@ else BASEDIR=. endif +# this can be set to 'rtl' when the RTL units are installed +ifndef UNITPREFIX +UNITPREFIX=units +endif + # set the prefix directory where to install everything ifndef PREFIXINSTALLDIR ifdef inlinux @@ -233,43 +244,8 @@ export PREFIXINSTALLDIR=/pp endif endif -# set the directory to the rtl base -ifndef RTLDIR -ifdef RTL -RTLDIR:=$(RTL)/$(OS_TARGET) -else -RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET) -endif -endif - -# specify where units are. -ifndef UNITDIR -ifdef UNITS -UNITDIR=$(UNITS)/$(OS_TARGET) -else -UNITDIR=$(FPCDIR)/units/$(OS_TARGET) -endif -endif -ifeq ($(strip $(wildcard $(UNITDIR)/*)),) -UNITDIR= -endif - -# On linux, try to find where libgcc.a is. -ifdef inlinux -ifndef GCCLIBDIR -export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`) -endif -endif - -# Where to find other libraries -ifdef inlinux -ifndef OTHERLIBDIR -export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }') -endif -endif - ##################################################################### -# Install Directories based on BASEINSTALLDIR +# Install Directories ##################################################################### # set the base directory where to install everything @@ -281,16 +257,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR) endif endif - -# Linux binary really goes to baseinstalldir -ifndef LIBINSTALLDIR -ifdef inlinux -LIBINSTALLDIR=$(BASEINSTALLDIR) -else -LIBINSTALLDIR=$(BASEINSTALLDIR)/lib -endif -endif - # set the directory where to install the binaries ifndef BININSTALLDIR ifdef inlinux @@ -300,15 +266,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET) endif endif -# Where the .msg files will be stored -ifndef MSGINSTALLDIR -MSGINSTALLDIR=$(BASEINSTALLDIR)/msg +# set the directory where to install the units. +ifndef UNITINSTALLDIR +UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET) endif -# Where the .msg files will be stored +# Where to install shared libraries +ifndef LIBINSTALLDIR +ifdef inlinux +LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib +else +LIBINSTALLDIR=$(UNITINSTALLDIR) +endif +endif + +# Where the source files will be stored ifndef SOURCEINSTALLDIR +ifdef inlinux +SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION) +else SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source endif +endif # Where the doc files will be stored ifndef DOCINSTALLDIR @@ -319,42 +298,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc endif endif -######################## -# Unit Directories -######################## - -# this can be set to 'rtl' when the RTL units are installed -ifndef UNITPREFIX -UNITPREFIX=units -endif - -# set the directory where to install the units. -ifndef UNITINSTALLDIR -UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET) -endif - -# set the directory where to install the units. -ifndef STATIC_UNITINSTALLDIR -STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static -endif - -# set the directory where to install the units. -ifndef SHARED_UNITINSTALLDIR -SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared -endif - -# set the directory where to install the libs (must exist) -ifndef STATIC_LIBINSTALLDIR -STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR) -endif - -# set the directory where to install the libs (must exist) -ifndef SHARED_LIBINSTALLDIR -ifdef inlinux -SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib -else -SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR) -endif +# Where the some extra (data)files will be stored +ifndef EXTRAINSTALLDIR +EXTRAINSTALLDIR=$(BASEINSTALLDIR) endif @@ -389,8 +335,8 @@ override FPCOPT+=-FE$(TARGETDIR) endif # Smartlinking -ifeq ($(SMARTLINK),YES) -override FPCOPT+=-Cx +ifdef SMARTLINK +override FPCOPT+=-CX endif # Add commandline options @@ -487,16 +433,6 @@ ifndef LD LD=ld endif -# Where is the ppumove program ? -ifndef PPUMOVE -PPUMOVE=ppumove -endif - -# Where is the ppdep program ? -ifndef PPDEP -PPDEP=ppdep -endif - # ppas.bat / ppas.sh ifdef inlinux PPAS=ppas.sh @@ -532,6 +468,36 @@ export ECHO:=$(firstword $(ECHO)) endif endif +# ppdep +ifndef PPDEP +PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH)))) +ifeq ($(PPDEP),) +PPDEP= +else +export PPDEP:=$(firstword $(PPDEP)) +endif +endif + +# ppumove +ifndef PPUMOVE +PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH)))) +ifeq ($(PPUMOVE),) +PPUMOVE= +else +export PPUMOVE:=$(firstword $(PPUMOVE)) +endif +endif + +# ppufiles +ifndef PPUFILES +PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH)))) +ifeq ($(PPUFILES),) +PPUFILES= +else +export PPUFILES:=$(firstword $(PPUFILES)) +endif +endif + # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase # upx uses that one itself (PFV) ifndef UPXPROG @@ -693,27 +659,21 @@ endif # Default rules ##################################################################### -.PHONY: defaultrule all staticlib sharedlib showinstall install \ - staticinstall sharedinstall libinstall zipinstall zipinstalladd \ +.PHONY: defaultrule all smart shared \ + showinstall install zipinstall zipinstalladd \ clean cleanall depend info -staticlib: fpc_staticlib +smart: fpc_smart -sharedlib: fpc_sharedlib +shared: fpc_shared showinstall: fpc_showinstall -staticinstall: fpc_staticinstall - -sharedinstall: fpc_sharedinstall - -libinstall: fpc_libinstall - zipinstall: fpc_zipinstall zipinstalladd: fpc_zipinstalladd -clean_all: fpc_clean_all +cleanall: fpc_cleanall info: fpc_info @@ -724,12 +684,16 @@ info: fpc_info .PHONY: fpc_all fpc_units fpc_exes fpc_loaders # Create Filenames +ifdef LOADEROBJECTS LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS)) +endif +ifdef EXEOBJECTS EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS)) EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS)) +endif +ifdef UNITOBJECTS UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS)) -UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS)) -UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS)) +endif .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp @@ -769,18 +733,17 @@ fpc_exes: $(EXEFILES) # Library ##################################################################### -.PHONY: fpc_staticlib fpc_sharedlib +.PHONY: fpc_smart fpc_shared # Default sharedlib units are all unit objects ifndef SHAREDLIBUNITOBJECTS SHAREDLIBUNITOBJECTS=$(UNITOBJECTS) endif -fpc_staticlib: - $(MAKE) libsclean - $(MAKE) all SMARTLINK=YES +fpc_smart: + $(MAKE) all SMARTLINK=1 -fpc_sharedlib: all +fpc_shared: all ifdef inlinux ifndef LIBNAME @$(ECHO) LIBNAME not set @@ -795,16 +758,27 @@ endif # Install rules ##################################################################### -.PHONY: fpc_showinstallfiles fpc_install +.PHONY: fpc_showinstall fpc_install -ifdef UNITOBJECTS -override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES)) +ifdef UNITPPUFILES +override INSTALLPPUFILES:=$(UNITPPUFILES) endif ifdef EXTRAINSTALLUNITS -override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))) +override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)) endif -fpc_showinstallfiles : all +ifdef INSTALLPPUFILES +ifdef PPUFILES +ifdef inlinux +INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES)) +INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES)) +else +INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES)) +endif +endif +endif + +fpc_showinstall: ifndef DEFAULTUNITS ifdef EXEOBJECTS @$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES)) @@ -813,11 +787,17 @@ endif ifdef LOADEROBJECTS @$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES)) endif -ifdef UNITINSTALLFILES - @$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES)) +ifdef INSTALLPPUFILES + @$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES)) +ifneq ($(INSTALLPPULINKFILES),) + @$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES)) +endif +ifneq ($(INSTALLPPULIBFILES),) + @$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES)) +endif endif ifdef EXTRAINSTALLFILES - @$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES)) + @$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES)) endif fpc_install: @@ -836,13 +816,20 @@ ifdef LOADEROBJECTS $(MKDIR) $(UNITINSTALLDIR) $(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR) endif -ifdef UNITINSTALLFILES +ifdef INSTALLPPUFILES $(MKDIR) $(UNITINSTALLDIR) - $(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR) + $(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR) +ifneq ($(INSTALLPPULINKFILES),) + $(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR) +endif +ifneq ($(INSTALLPPULIBFILES),) + $(MKDIR) $(LIBINSTALLDIR) + $(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR) +endif endif ifdef EXTRAINSTALLFILES - $(MKDIR) $(UNITINSTALLDIR) - $(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR) + $(MKDIR) $(EXTRAINSTALLDIR) + $(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR) endif ##################################################################### @@ -914,13 +901,13 @@ endif # Clean rules ##################################################################### -.PHONY: fpc_clean fpc_libsclean fpc_cleanall +.PHONY: fpc_clean fpc_cleanall -ifdef UNITOBJECTS -override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES)) +ifdef UNITPPUFILES +override CLEANPPUFILES=$(UNITPPUFILES) endif ifdef EXTRACLEANUNITS -override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))) +override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)) endif fpc_clean: @@ -930,17 +917,17 @@ endif ifdef LOADEROBJECTS -$(DEL) $(LOADEROFILES) endif -ifdef UNITCLEANFILES - -$(DEL) $(UNITCLEANFILES) +ifdef CLEANPPUFILES + -$(DEL) $(CLEANPPUFILES) +ifdef PPUFILES + -$(DEL) $(shell $(PPUFILES) $(CLEANPPUFILES)) +endif endif ifdef EXTRACLEANFILES -$(DEL) $(EXTRACLEANFILES) endif -$(DEL) $(PPAS) link.res log -fpc_libsclean: clean - -$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) - fpc_cleanall: ifdef EXEOBJECTS -$(DEL) $(EXEFILES) @@ -978,6 +965,20 @@ fpc_infocfg: @$(ECHO) Target.... $(OS_TARGET) @$(ECHO) +fpc_infoobjects: + @$(ECHO) + @$(ECHO) == Object info == + @$(ECHO) + @$(ECHO) LoaderObjects..... $(LOADEROBJECTS) + @$(ECHO) UnitObjects....... $(UNITOBJECTS) + @$(ECHO) ExeObjects........ $(EXEOBJECTS) + @$(ECHO) + @$(ECHO) ExtraCleanUnits... $(EXTRACLEANUNITS) + @$(ECHO) ExtraCleanFiles... $(EXTRACLEANFILES) + @$(ECHO) + @$(ECHO) ExtraInstallUnits. $(EXTRAINSTALLUNITS) + @$(ECHO) ExtraInstallFiles. $(EXTRAINSTALLFILES) + @$(ECHO) fpc_infoinstall: @$(ECHO) @@ -990,14 +991,11 @@ endif @$(ECHO) @$(ECHO) BaseInstallDir....... $(BASEINSTALLDIR) @$(ECHO) BinInstallDir........ $(BININSTALLDIR) - @$(ECHO) UnitInstallDir....... $(UNITINSTALLDIR) - @$(ECHO) StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR) - @$(ECHO) SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR) @$(ECHO) LibInstallDir........ $(LIBINSTALLDIR) - @$(ECHO) StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR) - @$(ECHO) SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR) - @$(ECHO) MsgInstallDir........ $(MSGINSTALLDIR) + @$(ECHO) UnitInstallDir....... $(UNITINSTALLDIR) + @$(ECHO) SourceInstallDir..... $(SOURCEINSTALLDIR) @$(ECHO) DocInstallDir........ $(DOCINSTALLDIR) + @$(ECHO) ExtraInstallDir...... $(EXTRAINSTALLDIR) @$(ECHO) ##################################################################### @@ -1190,11 +1188,13 @@ cvstest: # Installation ##################################################################### +MSGINSTALLDIR=$(BASEINSTALLDIR)/msg + # This will only install the ppc386.exe, not the message files etc. quickinstall: ifdef inlinux - $(MKDIR) $(LIBINSTALLDIR) - $(INSTALLEXE) $(EXENAME) $(LIBINSTALLDIR) + $(MKDIR) $(BASEINSTALLDIR) + $(INSTALLEXE) $(EXENAME) $(BASEINSTALLDIR) else $(MKDIR) $(BININSTALLDIR) ifdef UPXPROG @@ -1205,7 +1205,7 @@ endif installlib: quickinstall ifdef inlinux - $(INSTALLEXE) $(COMPILERUTILS)/samplecfg $(LIBINSTALLDIR)/samplecfg + $(INSTALLEXE) $(COMPILERUTILS)/samplecfg $(BASEINSTALLDIR)/samplecfg endif $(MKDIR) $(MSGINSTALLDIR) $(INSTALL) $(MSGFILES) $(MSGINSTALLDIR) @@ -1214,7 +1214,7 @@ endif install: installlib ifdef inlinux $(MKDIR) $(BININSTALLDIR) - ln -sf $(LIBINSTALLDIR)/ppc386 $(BININSTALLDIR)/ppc386 + ln -sf $(BASEINSTALLDIR)/ppc386 $(BININSTALLDIR)/ppc386 endif diff --git a/compiler/Makefile.fpc b/compiler/Makefile.fpc index e421e87b6f..d195dfc0aa 100644 --- a/compiler/Makefile.fpc +++ b/compiler/Makefile.fpc @@ -268,11 +268,13 @@ cvstest: # Installation ##################################################################### +MSGINSTALLDIR=$(BASEINSTALLDIR)/msg + # This will only install the ppc386.exe, not the message files etc. quickinstall: ifdef inlinux - $(MKDIR) $(LIBINSTALLDIR) - $(INSTALLEXE) $(EXENAME) $(LIBINSTALLDIR) + $(MKDIR) $(BASEINSTALLDIR) + $(INSTALLEXE) $(EXENAME) $(BASEINSTALLDIR) else $(MKDIR) $(BININSTALLDIR) ifdef UPXPROG @@ -283,7 +285,7 @@ endif installlib: quickinstall ifdef inlinux - $(INSTALLEXE) $(COMPILERUTILS)/samplecfg $(LIBINSTALLDIR)/samplecfg + $(INSTALLEXE) $(COMPILERUTILS)/samplecfg $(BASEINSTALLDIR)/samplecfg endif $(MKDIR) $(MSGINSTALLDIR) $(INSTALL) $(MSGFILES) $(MSGINSTALLDIR) @@ -292,7 +294,7 @@ endif install: installlib ifdef inlinux $(MKDIR) $(BININSTALLDIR) - ln -sf $(LIBINSTALLDIR)/ppc386 $(BININSTALLDIR)/ppc386 + ln -sf $(BASEINSTALLDIR)/ppc386 $(BININSTALLDIR)/ppc386 endif diff --git a/compiler/ppu.pas b/compiler/ppu.pas index ab57b22c44..21a659ad62 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -369,8 +369,6 @@ end; procedure tppufile.close; -var - i : word; begin if Mode<>0 then begin @@ -378,7 +376,7 @@ begin {$I-} system.close(f); {$I+} - i:=ioresult; + if ioresult<>0 then; Mode:=0; closed:=true; end; @@ -395,7 +393,6 @@ function tppufile.GetPPUVersion:longint; var l : longint; code : integer; - begin Val(header.ver[1]+header.ver[2]+header.ver[3],l,code); if code=0 then @@ -437,7 +434,6 @@ var {$else delphi} i : word; {$endif delphi} - begin open:=false; assign(f,fname); @@ -958,8 +954,6 @@ end; procedure tppufile.tempclose; - var - i : word; begin if not closed then begin @@ -967,7 +961,7 @@ end; {$I-} system.close(f); {$I+} - i:=ioresult; + if ioresult<>0 then; closed:=true; tempclosed:=true; end; @@ -1000,7 +994,10 @@ end; end. { $Log$ - Revision 1.50 1999-11-21 01:42:37 pierre + Revision 1.51 1999-11-23 09:42:38 peter + * makefile updates to work with new fpcmake + + Revision 1.50 1999/11/21 01:42:37 pierre * Nextoverloading ordering fix Revision 1.49 1999/11/18 15:34:48 pierre