Browse Source

* removed makefile.fpc
* use Makefile.fpc for the top Makefile

peter 26 years ago
parent
commit
dd588ce47b
4 changed files with 1299 additions and 1325 deletions
  1. 892 115
      base/Makefile
  2. 400 0
      base/Makefile.fpc
  3. 7 11
      base/README
  4. 0 1199
      base/makefile.fpc

+ 892 - 115
base/Makefile

@@ -1,17 +1,897 @@
 #
 #
-#   $Id$
-#   Copyright (c) 1999 by the Free Pascal Development Team
-#
-#   Makefile for Free Pascal Source Tree
-#
-#   See the file COPYING.FPC, included in this distribution,
-#   for details about the copyright.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# Makefile generated by fpcmake v0.99.13 on 1999-11-14 17:43
 #
 #
 
 
+defaultrule: info
+
+#####################################################################
+# Autodetect OS (Linux or Dos or Windows NT)
+# define inlinux when running under linux
+# define inWinNT when running under WinNT
+#####################################################################
+
+# We need only / in the path
+override PATH:=$(subst \,/,$(PATH))
+
+# Search for PWD and determine also if we are under linux
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
+ifeq ($(PWD),)
+nopwd:
+	@echo You need the GNU utils package to use this Makefile!
+	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
+	@exit
+else
+inlinux=1
+endif
+else
+PWD:=$(firstword $(PWD))
+endif
+
+# Detect NT - NT sets OS to Windows_NT
+ifndef inlinux
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+endif
+endif
+
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inlinux
+ifndef inWinNT
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+endif
+
+# The extension of executables
+ifdef inlinux
+EXEEXT=
+else
+EXEEXT=.exe
+endif
+
+# The path which is search separated by spaces
+ifdef inlinux
+SEARCHPATH=$(subst :, ,$(PATH))
+else
+SEARCHPATH=$(subst ;, ,$(PATH))
+endif
+
+#####################################################################
+# FPC version/target Detection
+#####################################################################
+
+# What compiler to use ?
+ifndef FPC
+ifdef inOS2
+export FPC=ppos2$(EXEEXT)
+else
+export FPC=ppc386$(EXEEXT)
+endif
+endif
+
+# Target OS
+ifndef OS_TARGET
+export OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+
+# Source OS
+ifndef OS_SOURCE
+export OS_SOURCE:=$(shell $(FPC) -iSO)
+endif
+
+# Target CPU
+ifndef CPU_TARGET
+export CPU_TARGET:=$(shell $(FPC) -iTP)
+endif
+
+# Source CPU
+ifndef CPU_SOURCE
+export CPU_SOURCE:=$(shell $(FPC) -iSP)
+endif
+
+# FPC version
+ifndef FPC_VERSION
+export FPC_VERSION:=$(shell $(FPC) -iV)
+endif
+
+#####################################################################
+# Default Settings
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifdef RELEASE
+override OPT:=-Xs -OG2p3 -n
+endif
+
+# Verbose settings (warning,note,info)
+ifdef VERBOSE
+override OPT+=-vwni
+endif
+
+#####################################################################
+# User Settings
+#####################################################################
+
+
+# Targets
+
+
+# Clean
+
+
+# Install
+
+
+# Defaults
+
+
+# Directories
+
+
+# Libraries
+
+
+# Info
+
+FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+#####################################################################
+# Default Directories
+#####################################################################
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
+# set the prefix directory where to install everything
+ifndef PREFIXINSTALLDIR
+ifdef inlinux
+export PREFIXINSTALLDIR=/usr
+else
+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
+#####################################################################
+
+# set the base directory where to install everything
+ifndef BASEINSTALLDIR
+ifdef inlinux
+BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
+else
+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
+BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
+else
+BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
+endif
+endif
+
+# Where the .msg files will be stored
+ifndef MSGINSTALLDIR
+MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+endif
+
+# Where the .msg files will be stored
+ifndef SOURCEINSTALLDIR
+SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
+endif
+
+# Where the doc files will be stored
+ifndef DOCINSTALLDIR
+ifdef inlinux
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+else
+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
+endif
+
+
+#####################################################################
+# Compiler Command Line
+#####################################################################
+
+# Load commandline OPTDEF and add FPC_CPU define
+override FPCOPTDEF:=-d$(CPU_TARGET)
+
+# Load commandline OPT and add target and unit dir to be sure
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+
+
+ifdef NEEDOPT
+override FPCOPT+=$(NEEDOPT)
+endif
+
+# Smartlinking
+ifeq ($(SMARTLINK),YES)
+override FPCOPT+=-Cx
+endif
+
+# Add commandline options
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+
+# Add defines from FPCOPTDEF to FPCOPT
+ifdef FPCOPTDEF
+override FPCOPT+=$(FPCOPTDEF)
+endif
+
+# Was a config file specified ?
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+
+override COMPILER=$(FPC) $(FPCOPT)
+
+#####################################################################
+# Shell tools
+#####################################################################
+
+# To copy pograms
+ifndef COPY
+export COPY:=cp -fp
+endif
+
+# To move pograms
+ifndef MOVE
+export MOVE:=mv -f
+endif
+
+# Check delete program
+ifndef DEL
+export DEL:=rm -f
+endif
+
+# Check deltree program
+ifndef DELTREE
+export DELTREE:=rm -rf
+endif
+
+# To install files
+ifndef INSTALL
+ifdef inlinux
+export INSTALL:=install -m 644
+else
+export INSTALL:=$(COPY)
+endif
+endif
+
+# To install programs
+ifndef INSTALLEXE
+ifdef inlinux
+export INSTALLEXE:=install -m 755
+else
+export INSTALLEXE:=$(COPY)
+endif
+endif
+
+# To make a directory.
+ifndef MKDIR
+ifdef inlinux
+export MKDIR:=install -m 755 -d
+else
+export MKDIR:=ginstall -m 755 -d
+endif
+endif
+
+#####################################################################
+# Default Tools
+#####################################################################
+
+# assembler, redefine it if cross compiling
+ifndef AS
+AS=as
+endif
+
+# linker, but probably not used
+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
+else
+ifdef inOS2
+PPAS=ppas.cmd
+else
+PPAS=ppas.bat
+endif
+endif
+
+# also call ppas if with command option -s
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+EXECPPAS=@$(PPAS)
+endif
+
+# ldconfig to rebuild .so cache
+ifdef inlinux
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+export ECHO:=echo
+else
+export ECHO:=$(firstword $(ECHO))
+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
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+export UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+
+# gdate/date
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
+ifeq ($(DATE),)
+DATE=
+else
+export DATE:=$(firstword $(DATE))
+endif
+else
+export DATE:=$(firstword $(DATE))
+endif
+endif
+
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+
+# ZipProg, you can't use Zip as the var name (PFV)
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG=
+else
+export ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
+endif
+endif
+
+ifndef ZIPEXT
+ZIPEXT=.zip
+endif
+
+#####################################################################
+# Default extensions
+#####################################################################
+
+# Default needed extensions (Go32v2,Linux)
+LOADEREXT=.as
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+PACKAGESUFFIX=
+
+# Go32v1
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+PACKAGESUFFIX=v1
+endif
+
+# Go32v2
+ifeq ($(OS_TARGET),go32v2)
+PACKAGESUFFIX=go32
+endif
+
+# Linux
+ifeq ($(OS_TARGET),linux)
+PACKAGESUFFIX=linux
+endif
+
+# Win32
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+PACKAGESUFFIX=win32
+endif
+
+# OS/2
+ifeq ($(OS_TARGET),os2)
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+SMARTEXT=.so
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+PACKAGESUFFIX=os2
+endif
+
+# library prefix
+LIBPREFIX=lib
+ifeq ($(OS_TARGET),go32v2)
+LIBPREFIX=
+endif
+ifeq ($(OS_TARGET),go32v1)
+LIBPREFIX=
+endif
+
+# determine which .pas extension is used
+ifndef PASEXT
+ifdef EXEOBJECTS
+override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS)))))
+else
+override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS)))))
+endif
+ifeq ($(TESTPAS),)
+PASEXT=.pp
+else
+PASEXT=.pas
+endif
+endif
+
+#####################################################################
+# Default rules
+#####################################################################
+
+.PHONY: defaultrule all staticlib sharedlib showinstall install \
+	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+	clean cleanall depend info
+
+staticlib: fpc_staticlib
+
+sharedlib: fpc_sharedlib
+
+showinstall: fpc_showinstall
+
+libinstall: fpc_libinstall
+
+zipinstall: fpc_zipinstall
+
+zipinstalladd: fpc_zipinstalladd
+
+clean_all: fpc_clean_all
+
+depend: fpc_depend
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+
+# Create Filenames
+LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
+EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
+EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
+UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
+UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
+UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
+ifdef DEFAULTUNITS
+fpc_all: fpc_loaders fpc_units
+else
+fpc_all: fpc_loaders fpc_units fpc_exes
+endif
+
+fpc_loaders: $(LOADEROFILES)
+
+fpc_units: $(UNITPPUFILES)
+
+fpc_exes: $(EXEFILES)
+
+# General compile rules, available for both possible PASEXT
+%$(PPUEXT): %.pp
+	$(COMPILER) $< $(REDIR)
+	$(EXECPASS)
+
+%$(PPUEXT): %.pas
+	$(COMPILER) $< $(REDIR)
+	$(EXECPASS)
+
+%$(EXEEXT): %.pp
+	$(COMPILER) $< $(REDIR)
+	$(EXECPASS)
+
+%$(EXEEXT): %.pas
+	$(COMPILER) $< $(REDIR)
+	$(EXECPASS)
+
+%$(OEXT): %$(LOADEREXT)
+	$(AS) -o $*$(OEXT) $<
+
+#####################################################################
+# Library
+#####################################################################
+
+.PHONY: fpc_staticlib fpc_sharedlib
+
+# Default sharedlib units are all unit objects
+ifndef SHAREDLIBUNITOBJECTS
+SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
+endif
+
+fpc_staticlib:
+	$(MAKE) libsclean
+	$(MAKE) all SMARTLINK=YES
+
+fpc_sharedlib: all
+ifdef inlinux
+ifndef LIBNAME
+	@$(ECHO) LIBNAME not set
+else
+	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+
+#####################################################################
+# Install rules
+#####################################################################
+
+.PHONY: fpc_showinstallfiles fpc_install
+
+ifdef UNITOBJECTS
+override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
+endif
+ifdef EXTRAINSTALLUNITS
+override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+endif
+
+fpc_showinstallfiles : all
+ifndef DEFAULTUNITS
+ifdef EXEOBJECTS
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+endif
+endif
+ifdef LOADEROBJECTS
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+endif
+ifdef UNITINSTALLFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
+endif
+ifdef EXTRAINSTALLFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+endif
+
+fpc_install:
+# Create UnitInstallFiles
+ifndef DEFAULTUNITS
+ifdef EXEOBJECTS
+	$(MKDIR) $(BININSTALLDIR)
+# Compress the exes if upx is defined
+ifdef UPXPROG
+	-$(UPXPROG) $(EXEFILES)
+endif
+	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+endif
+endif
+ifdef LOADEROBJECTS
+	$(MKDIR) $(UNITINSTALLDIR)
+	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+endif
+ifdef UNITINSTALLFILES
+	$(MKDIR) $(UNITINSTALLDIR)
+	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
+endif
+ifdef EXTRAINSTALLFILES
+	$(MKDIR) $(UNITINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+endif
+
+#####################################################################
+# Zip
+#####################################################################
+
+.PHONY: fpc_zipinstall fpc_zipinstalladd
+
+# Temporary path to pack a file
+ifndef PACKDIR
+ifndef inlinux
+PACKDIR=pack_tmp
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+
+# Test dir if none specified
+ifndef PACKAGEDIR
+PACKAGEDIR=$(BASEDIR)
+endif
+
+# Add .zip/.tar.gz extension
+ifdef ZIPNAME
+ifndef inlinux
+override ZIPNAME:=$(ZIPNAME)$(ZIPEXT)
+endif
+endif
+
+# Default target which is call before zipping
+ifndef ZIPTARGET
+ZIPTARGET=install
+endif
+
+# Note: This will not remove the zipfile first
+fpc_zipinstalladd:
+ifndef ZIPNAME
+	@$(ECHO) Please specify ZIPNAME!
+	@exit
+else
+	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
+ifdef inlinux
+	gzip -d $(PACKAGEDIR)/$(ZIPNAME).tar.gz
+	cd $(PACKDIR) ; tar rv --file $(PACKAGEDIR)/$(ZIPNAME).tar * ; cd $(BASEDIR)
+	gzip $(PACKAGEDIR)/$(ZIPNAME).tar
+else
+	cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
+endif
+	$(DELTREE) $(PACKDIR)
+endif
+
+# First remove the zip and then install
+fpc_zipinstall:
+ifndef ZIPNAME
+	@$(ECHO) Please specify ZIPNAME!
+	@exit
+else
+	$(DEL) $(PACKAGEDIR)/$(ZIPNAME)
+	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
+ifdef inlinux
+	cd $(PACKDIR) ; tar cvz --file $(PACKAGEDIR)/$(ZIPNAME).tar.gz * ; cd $(BASEDIR)
+else
+	cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
+endif
+	$(DELTREE) $(PACKDIR)
+endif
+
+#####################################################################
+# Clean rules
+#####################################################################
+
+.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+
+ifdef UNITOBJECTS
+override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
+endif
+ifdef EXTRACLEANUNITS
+override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+endif
+
+fpc_clean:
+ifdef EXEOBJECTS
+	-$(DEL) $(EXEFILES) $(EXEOFILES)
+endif
+ifdef LOADEROBJECTS
+	-$(DEL) $(LOADEROFILES)
+endif
+ifdef UNITCLEANFILES
+	-$(DEL) $(UNITCLEANFILES)
+endif
+ifdef EXTRACLEANFILES
+	-$(DEL) $(EXTRACLEANFILES)
+endif
+	-$(DEL) $(PPAS) link.res log
+
+fpc_libsclean: clean
+	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+
+fpc_cleanall:
+ifdef EXEOBJECTS
+	-$(DEL) $(EXEFILES)
+endif
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+	-$(DELTREE) *$(SMARTEXT)
+
+#####################################################################
+# Depend rules
+#####################################################################
+
+.PHONY: fpc_depend
+
+fpc_depend:
+	$(PPDEP) $(UNITOBJECTS)
+
+#####################################################################
+# Info rules
+#####################################################################
+
+.PHONY: fpc_info fpc_cfginfo fpc_objectinfo fpc_toolsinfo fpc_installinfo \
+	fpc_dirinfo
+
+fpc_info: $(FPCINFO)
+
+fpc_infocfg:
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC....... $(FPC)
+	@$(ECHO)  Version... $(FPC_VERSION)
+	@$(ECHO)  CPU....... $(CPU_TARGET)
+	@$(ECHO)  Source.... $(OS_SOURCE)
+	@$(ECHO)  Target.... $(OS_TARGET)
+	@$(ECHO)
+
+
+fpc_infoinstall:
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+ifdef DATE
+	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
+	@$(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)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)
+
+#####################################################################
+# Users rules
+#####################################################################
+
+
 #####################################################################
 #####################################################################
 # Config
 # Config
 #####################################################################
 #####################################################################
@@ -75,7 +955,7 @@ endif
 # Defaults
 # Defaults
 #####################################################################
 #####################################################################
 
 
-RELEASE=1
+export RELEASE=1
 
 
 
 
 #####################################################################
 #####################################################################
@@ -114,55 +994,6 @@ staticinstall: $(addsuffix _staticinstall,$(MODULES))
 
 
 sharedinstall: $(addsuffix _sharedinstall,$(MODULES))
 sharedinstall: $(addsuffix _sharedinstall,$(MODULES))
 
 
-
-#####################################################################
-# Include default makefile
-#####################################################################
-
-# test if FPCMAKE is still valid
-ifndef FPCMAKE
-ifdef FPCDIR
-FPCMAKE=$(FPCDIR)/makefile.fpc
-endif
-endif
-ifdef FPCMAKE
-ifeq ($(strip $(wildcard $(FPCMAKE))),)
-FPCDIR=
-FPCMAKE=
-endif
-endif
-
-ifndef FPCDIR
-ifdef DEFAULTFPCDIR
-FPCDIR=$(DEFAULTFPCDIR)
-endif
-endif
-
-ifndef FPCMAKE
-ifdef FPCDIR
-FPCMAKE=$(FPCDIR)/makefile.fpc
-else
-FPCMAKE=makefile.fpc
-endif
-endif
-
-override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
-ifndef FPCMAKE
-testfpcmake:
-	@echo makefile.fpc not found!
-	@echo Check the FPCMAKE and FPCDIR environment variables.
-	@stopnow
-ifndef NODEFAULTALL
-all: testfpcmake
-endif
-install: testfpcmake
-clean: testfpcmake
-else
-include $(FPCMAKE)
-testfpcmake:
-endif
-
-
 #####################################################################
 #####################################################################
 # Dependencies
 # Dependencies
 #####################################################################
 #####################################################################
@@ -453,57 +1284,3 @@ compilerzip: compiler_clean rtl_clean
 utilszip: utils_clean rtl_clean
 utilszip: utils_clean rtl_clean
 	$(MAKE) utils_all
 	$(MAKE) utils_all
 	$(MAKE) -C $(UTILSDIR) fpc_zipinstall ZIPNAME=utils-$(PACKAGESUFFIX)
 	$(MAKE) -C $(UTILSDIR) fpc_zipinstall ZIPNAME=utils-$(PACKAGESUFFIX)
-
-#
-# $Log$
-# Revision 1.21  1999-11-10 08:54:22  pierre
-#  * gdb_??? target renamed gdbint_???
-#
-# Revision 1.20  1999/07/29 11:40:01  peter
-#   * utils need fcl
-#
-# Revision 1.19  1999/07/05 17:48:58  peter
-#   * merged
-#
-# Revision 1.18.2.1  1999/07/05 17:03:20  peter
-#   * modules are checked if they exists
-#
-# Revision 1.18  1999/06/08 22:11:26  peter
-#   * debian updates
-#
-# Revision 1.17  1999/06/08 18:28:11  peter
-#   * fixes for 0.99.12 release
-#
-# Revision 1.16  1999/05/16 02:37:29  peter
-#   + fpc_showinstallfiles to show which files will be added to the system
-#
-# Revision 1.15  1999/05/12 16:17:06  peter
-#   + utils_X targets
-#   * missing export of prefixinstalldir
-#
-# Revision 1.14  1999/04/21 10:25:39  michael
-# + Split idezips target
-#
-# Revision 1.13  1999/04/19 12:53:02  peter
-#   * fixed idezips target
-#
-# Revision 1.12  1999/04/16 20:15:41  michael
-# + Adapted ide Makefiles
-#
-# Revision 1.11  1999/04/08 10:16:16  peter
-#   * zipinstall for linux with .tar.gz
-#
-# Revision 1.10  1999/04/01 22:16:02  peter
-#   * renamed ide zips
-#
-# Revision 1.9	1999/03/18 11:19:31  peter
-#   * fixed zipinstall
-#
-# Revision 1.8	1999/03/16 00:46:54  peter
-#   * makefile.fpc targets start with fpc_
-#   * small updates for install scripts
-#
-# Revision 1.7	1999/03/09 01:35:46  peter
-#   * makefile.fpc updates and defaultfpcdir var
-#
-#

+ 400 - 0
base/Makefile.fpc

@@ -0,0 +1,400 @@
+#
+#   Makefile.fpc for Free Pascal Source Tree
+#
+
+[defaults]
+defaultrule=info
+
+[rules]
+#####################################################################
+# Config
+#####################################################################
+
+# Try to determine which modules are installed
+MODULES+=$(wildcard compiler)
+MODULES+=$(wildcard rtl)
+MODULES+=$(wildcard utils)
+MODULES+=$(wildcard fcl)
+MODULES+=$(wildcard gtk)
+MODULES+=$(wildcard api)
+MODULES+=$(wildcard fv)
+MODULES+=$(wildcard gdbint)
+MODULES+=$(wildcard ide)
+
+###############################
+# Default paths
+###############################
+
+ifndef RTLDIR
+RTLDIR=rtl
+endif
+
+ifndef COMPILERDIR
+COMPILERDIR=compiler
+endif
+
+ifndef UTILSDIR
+UTILSDIR=utils
+endif
+
+ifndef FCLDIR
+FCLDIR=fcl
+endif
+
+ifndef GTKDIR
+GTKDIR=gtk
+endif
+
+ifndef APIDIR
+APIDIR=api
+endif
+
+ifndef FVDIR
+FVDIR=fv
+endif
+
+ifndef GDBDIR
+GDBDIR=gdbint
+endif
+
+ifndef FPINSTDIR
+FPINSTDIR=fpinst
+endif
+
+ifndef IDEDIR
+IDEDIR=ide
+endif
+
+#####################################################################
+# Defaults
+#####################################################################
+
+export RELEASE=1
+
+
+#####################################################################
+# Main targets
+#####################################################################
+
+.PHONY: all clean install staticinstall sharedinstall \
+        $(addsuffix _all,$(MODULES)) \
+        $(addsuffix _clean,$(MODULES)) \
+        $(addsuffix _install,$(MODULES)) \
+        $(addsuffix _staticinstall,$(MODULES)) \
+        $(addsuffix _sharedinstall,$(MODULES))\
+        compiler_cycle \
+        idezips ide_allzip ide_gdbzip ide_fullzip ide_fullgdbzip \
+        fclzip gtkzip fvzip compilerzip utilszip
+
+info:
+        @echo
+        @echo Please use one of the following targets:
+        @echo
+        @echo $(MODULES)
+        @echo
+        @echo All targets can follow after a _ with:
+        @echo all,clean,install,staticinstall,sharedinstall
+        @echo
+        @echo example: make api_staticinstall
+        @exit
+
+all: $(addsuffix _all,$(MODULES))
+
+clean: $(addsuffix _clean,$(MODULES))
+
+install: $(addsuffix _install,$(MODULES))
+
+staticinstall: $(addsuffix _staticinstall,$(MODULES))
+
+sharedinstall: $(addsuffix _sharedinstall,$(MODULES))
+
+#####################################################################
+# Dependencies
+#####################################################################
+
+#######################################
+# RTL
+#######################################
+
+override RTLDIR:=$(RTLDIR)/$(OS_TARGET)
+
+rtl_all:
+        $(MAKE) -C $(RTLDIR) all
+
+rtl_clean:
+        $(MAKE) -C $(RTLDIR) clean
+
+rtl_install:
+        $(MAKE) -C $(RTLDIR) install
+
+rtl_staticinstall:
+        $(MAKE) -C $(RTLDIR) staticlibinstall
+
+rtl_sharedinstall:
+        $(MAKE) -C $(RTLDIR) sharedlibinstall
+
+
+#######################################
+# Compiler
+#######################################
+
+compiler_cycle:
+        $(MAKE) -C $(COMPILERDIR) cycle
+
+compiler_all: rtl_all
+        $(MAKE) -C $(COMPILERDIR) all
+
+compiler_clean:
+        $(MAKE) -C $(COMPILERDIR) distclean
+
+compiler_install:
+        $(MAKE) -C $(COMPILERDIR) install
+
+compiler_installlib:
+        $(MAKE) -C $(COMPILERDIR) installlib
+
+compiler_staticinstall:
+
+compiler_sharedinstall:
+
+
+#######################################
+# Utils
+#######################################
+
+utils_all: rtl_all fcl_all
+        $(MAKE) -C $(UTILSDIR) all
+
+utils_clean:
+        $(MAKE) -C $(UTILSDIR) clean
+
+utils_install:
+        $(MAKE) -C $(UTILSDIR) install
+
+utils_installlib:
+        $(MAKE) -C $(UTILSDIR) installlib
+
+utils_staticinstall:
+
+utils_sharedinstall:
+
+
+#######################################
+# FCL
+#######################################
+
+override FCLDIR:=$(FCLDIR)/$(OS_TARGET)
+
+fcl_all: rtl_all
+        $(MAKE) -C $(FCLDIR) all
+
+fcl_clean:
+        $(MAKE) -C $(FCLDIR) clean
+
+fcl_install:
+        $(MAKE) -C $(FCLDIR) install
+
+fcl_staticinstall:
+        $(MAKE) -C $(FCLDIR) staticlibinstall
+
+fcl_sharedinstall:
+        $(MAKE) -C $(FCLDIR) sharedlibinstall
+
+
+#######################################
+# GTK
+#######################################
+
+gtk_all: rtl_all
+        $(MAKE) -C $(GTKDIR) all
+
+gtk_clean:
+        $(MAKE) -C $(GTKDIR) clean
+
+gtk_install:
+        $(MAKE) -C $(GTKDIR) install
+
+gtk_staticinstall:
+        $(MAKE) -C $(GTKDIR) staticlibinstall
+
+gtk_sharedinstall:
+        $(MAKE) -C $(GTKDIR) sharedlibinstall
+
+
+
+#######################################
+# API
+#######################################
+
+api_all: rtl_all
+        $(MAKE) -C $(APIDIR) all
+
+api_clean:
+        $(MAKE) -C $(APIDIR) clean
+
+api_install:
+        $(MAKE) -C $(APIDIR) install
+
+api_staticinstall:
+        $(MAKE) -C $(APIDIR) staticlibinstall
+
+api_sharedinstall:
+        $(MAKE) -C $(APIDIR) sharedlibinstall
+
+
+#######################################
+# FV
+#######################################
+
+fv_all: rtl_all api_all
+        $(MAKE) -C $(FVDIR) all
+
+fv_clean:
+        $(MAKE) -C $(FVDIR) clean
+
+fv_install:
+        $(MAKE) -C $(FVDIR) install
+
+fv_staticinstall:
+        $(MAKE) -C $(FVDIR) staticlibinstall
+
+fv_sharedinstall:
+        $(MAKE) -C $(FVDIR) sharedlibinstall
+
+
+#######################################
+# GDB
+#######################################
+
+gdbint_all: rtl_all
+        $(MAKE) -C $(GDBDIR) all
+
+gdbint_clean:
+        $(MAKE) -C $(GDBDIR) clean
+
+gdbint_install:
+        $(MAKE) -C $(GDBDIR) install
+
+gdbint_staticinstall:
+        $(MAKE) -C $(GDBDIR) staticlibinstall
+
+gdbint_sharedinstall:
+        $(MAKE) -C $(GDBDIR) sharedlibinstall
+
+
+#######################################
+# FPC fpinst
+#######################################
+
+fpinst_all: rtl_all api_all fv_all
+        $(MAKE) -C $(FPINSTDIR) all
+
+fpinst_clean:
+        $(MAKE) -C $(FPINSTDIR) clean
+
+fpinst_install:
+        $(MAKE) -C $(FPINSTDIR) install
+
+fpinst_staticinstall:
+        $(MAKE) -C $(FPINSTDIR) staticlibinstall
+
+fpinst_sharedinstall:
+        $(MAKE) -C $(FPINSTDIR) sharedlibinstall
+
+
+#######################################
+# IDE
+#######################################
+
+ide_all: rtl_all api_all fv_all
+        $(MAKE) -C $(IDEDIR) all
+
+ide_gdb: rtl_all api_all fv_all gdbnt_all
+        $(MAKE) -C $(IDEDIR) gdb
+
+ide_full: rtl_all api_all fv_all
+        $(MAKE) -C $(IDEDIR) full
+
+ide_fullgdb: rtl_all api_all fv_all gdbint_all
+        $(MAKE) -C $(IDEDIR) fullgdb
+
+ide_clean:
+        $(MAKE) -C $(IDEDIR) clean
+
+ide_install:
+        $(MAKE) -C $(IDEDIR) install
+
+ide_staticinstall:
+        $(MAKE) -C $(IDEDIR) staticlibinstall
+
+ide_sharedinstall:
+        $(MAKE) -C $(IDEDIR) sharedlibinstall
+
+
+#######################################
+# Install targets
+#######################################
+
+base_install:
+        $(INSTALL) base/Makefile $(LIBINSTALLDIR)
+        $(INSTALL) base/makefile.fpc $(LIBINSTALLDIR)
+
+demo_install:
+        $(MAKE) -C demo installdemo
+
+man_install:
+        $(MAKE) -C man installman
+
+
+#######################################
+# Packaging targets
+#######################################
+
+ifndef ZIPTARGET
+ZIPTARGET=install
+endif
+
+export ZIPTARGET
+export PACKAGEDIR=$(BASEDIR)
+
+idezips: clean ide_allzip ide_gdbzip ide_fullzip ide_fullgdbzip
+
+ide_allzip:
+        $(MAKE) ide_clean
+        $(MAKE) ide_all
+        $(MAKE) -C $(IDEDIR)/text fpc_zipinstall ZIPNAME=ide-fake-$(PACKAGESUFFIX)
+ide_gdbzip:
+        $(MAKE) ide_clean
+        $(MAKE) ide_gdb
+        $(MAKE) -C $(IDEDIR)/text fpc_zipinstall ZIPNAME=ide-gdb-$(PACKAGESUFFIX)
+ide_fullzip:
+        $(MAKE) ide_clean
+        $(MAKE) ide_full
+        $(MAKE) -C $(IDEDIR)/text fpc_zipinstall ZIPNAME=ide-comp-$(PACKAGESUFFIX)
+ide_fullgdbzip:
+        $(MAKE) ide_clean
+        $(MAKE) ide_fullgdb
+        $(MAKE) -C $(IDEDIR)/text fpc_zipinstall ZIPNAME=ide-full-$(PACKAGESUFFIX)
+
+fvzip: rtl_clean api_clean fv_clean
+        $(MAKE) api_all
+        $(MAKE) -C $(APIDIR) fpc_zipinstall ZIPNAME=fv-$(PACKAGESUFFIX)
+        $(MAKE) fv_all
+        $(MAKE) -C $(FVDIR) fpc_zipinstalladd ZIPNAME=fv-$(PACKAGESUFFIX)
+
+fclzip: rtl_clean fcl_clean
+        $(MAKE) fcl_all
+        $(MAKE) -C $(FCLDIR) fpc_zipinstall ZIPNAME=fcl-$(PACKAGESUFFIX)
+
+gtkzip: rtl_clean gtk_clean
+        $(MAKE) gtk_all
+        $(MAKE) -C $(GTKDIR) fpc_zipinstall ZIPNAME=gtk-$(PACKAGESUFFIX)
+
+compilerzip: compiler_clean rtl_clean
+        $(MAKE) compiler_all
+        $(MAKE) -C $(COMPILERDIR) fpc_zipinstall ZIPTARGET=quickinstall ZIPNAME=compiler-$(PACKAGESUFFIX)
+        $(MAKE) -C $(RTLDIR) fpc_zipinstalladd ZIPNAME=compiler-$(PACKAGESUFFIX)
+
+utilszip: utils_clean rtl_clean
+        $(MAKE) utils_all
+        $(MAKE) -C $(UTILSDIR) fpc_zipinstall ZIPNAME=utils-$(PACKAGESUFFIX)

+ 7 - 11
base/README

@@ -9,8 +9,8 @@ OS_TARGET       The target operating system you are going to compile for
 OS_SOURCE       The source operating system you compiling under
 OS_SOURCE       The source operating system you compiling under
                 (Note: This has autodetection for go32v2,linux,winnt)
                 (Note: This has autodetection for go32v2,linux,winnt)
 
 
-CPU             The target CPU that is used (currently m68k,i386)
-                Default: CPU=i386
+CPU_TARGET      The target CPU that is used (currently m68k,i386)
+                Default: CPU_TARGET=i386
 
 
 OPT             General commandline options you want to give
 OPT             General commandline options you want to give
                 Example to compile with debug info: OPT=-g
                 Example to compile with debug info: OPT=-g
@@ -23,8 +23,8 @@ NEEDOPT         Realy needed commandline options, also used when
 
 
 NEEDUNITDIR     Realy needed unitdir
 NEEDUNITDIR     Realy needed unitdir
 
 
-PP              compiler to use, default is ppc386
-                Example to compile with version 0.99.8: PP=ppc998
+FPC             compiler to use, default is ppc386
+                Example to compile with version 0.99.8: FPC=ppc998
 
 
 AS              assembler to use to compile the loaders
 AS              assembler to use to compile the loaders
                 Default: AS=as
                 Default: AS=as
@@ -63,13 +63,7 @@ NODEFAULTRULES  Don't include the default compiler rules. This is needed for
 Location:
 Location:
 ---------
 ---------
 INC             Where to find the .inc files.
 INC             Where to find the .inc files.
-                Example: INC=inc
-
-PROCINC         Where to find processor dependent .inc files
-                Example: PROCINC=$(CPU)
-
-OSINC           Where to find operating system dependent .inc files
-                Example: OSINC=$(OS_TARGET)
+                Example: INC=inc $(OS_TARGET)
 
 
 TARGETDIR       Where to place all the .o,.ppu,.exe files
 TARGETDIR       Where to place all the .o,.ppu,.exe files
                 Example: TARGETDIR=. (this is needed when you compile
                 Example: TARGETDIR=. (this is needed when you compile
@@ -101,6 +95,8 @@ DIFF            GNU Diff
 DATE            GNU Date (automaticly searched)
 DATE            GNU Date (automaticly searched)
 SED             GNU Sed (automaticly searched)
 SED             GNU Sed (automaticly searched)
 PWD             GNU PWD (automaticly searched)
 PWD             GNU PWD (automaticly searched)
+UPXPROG         UPX ExeFile compressor (automaticly searched)
+ZIPPROG         ZIP compressor (automaticly searched)
 
 
 
 
 Directories:
 Directories:

+ 0 - 1199
base/makefile.fpc

@@ -1,1199 +0,0 @@
-#
-#   $Id$
-#   Copyright (c) 1999 by the Free Pascal Development Team
-#
-#   Common makefile for Free Pascal
-#
-#   See the file COPYING.FPC, included in this distribution,
-#   for details about the copyright.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#
-
-#####################################################################
-# Autodetect OS (Linux or Dos or Windows NT)
-# define inlinux when running under linux
-# define inWinNT when running under WinNT
-#####################################################################
-
-# We want only / in the path !
-override PATH:=$(subst \,/,$(PATH))
-
-# Search for PWD and determine also if we are under linux
-PWD=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
-ifeq ($(PWD),)
-PWD=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
-ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this makefile!
-	@echo Get ftp://tflily.fys.kuleuven.ac.be/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
-else
-inlinux=1
-endif
-else
-PWD:=$(firstword $(PWD))
-endif
-
-# Detect NT - NT sets OS to Windows_NT
-ifndef inlinux
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-endif
-endif
-
-# Detect OS/2 - OS/2 has OS2_SHELL defined
-ifndef inlinux
-ifndef inWinNT
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-endif
-
-# The extension of executables
-ifdef inlinux
-EXEEXT=
-else
-EXEEXT=.exe
-endif
-
-
-#####################################################################
-# Check for FPCDIR environment
-#####################################################################
-
-ifndef FPCDIR
-nofpcdir:
-	@echo You need to set the FPCDIR environment variable to use
-	@echo this Makefile.
-	@echo Example: SET FPCDIR=/pp
-	@exit
-endif
-
-
-#####################################################################
-# Targets
-#####################################################################
-
-# What compiler to use ?
-ifndef PP
-ifdef inOS2
-PP=ppos2$(EXEEXT)
-else
-PP=ppc386$(EXEEXT)
-endif
-endif
-
-# Target OS
-ifndef OS_TARGET
-OS_TARGET=$(shell $(PP) -iTO)
-endif
-
-# Source OS
-ifndef OS_SOURCE
-OS_SOURCE=$(shell $(PP) -iSO)
-endif
-
-# CPU
-ifndef CPU
-CPU=$(shell $(PP) -iTP)
-endif
-
-# FPC version
-FPC_VERSION=$(shell $(PP) -iV)
-
-# Options
-ifndef OPT
-OPT=
-endif
-
-# assembler, redefine it if cross compiling
-ifndef AS
-AS=as
-endif
-
-# linker, but probably not used
-ifndef LD
-LD=ld
-endif
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
-
-#####################################################################
-# Shell commands
-#####################################################################
-
-# To copy pograms
-ifndef COPY
-COPY=cp -fp
-endif
-
-# To move pograms
-ifndef MOVE
-MOVE=mv -f
-endif
-
-# Check delete program
-ifndef DEL
-DEL=rm -f
-endif
-
-# Check deltree program
-ifndef DELTREE
-DELTREE=rm -rf
-endif
-
-# To install files
-ifndef INSTALL
-ifdef inlinux
-INSTALL=install -m 644
-else
-INSTALL=$(COPY)
-# ginstall has the strange thing to stubify all .o files !
-#INSTALL=ginstall -m 644
-endif
-endif
-
-# To install programs
-ifndef INSTALLEXE
-ifdef inlinux
-INSTALLEXE=install -m 755
-else
-INSTALLEXE=$(COPY)
-# ginstall has the strange thing to stubify all .o files !
-#INSTALLEXE=ginstall -m 755
-endif
-endif
-
-# To make a directory.
-ifndef MKDIR
-ifdef inlinux
-MKDIR=install -m 755 -d
-else
-MKDIR=ginstall -m 755 -d
-endif
-endif
-
-
-#####################################################################
-# Default Tools
-#####################################################################
-
-# ppas.bat / ppas.sh
-ifdef inlinux
-PPAS=ppas.sh
-else
-ifdef inOS2
-PPAS=ppas.cmd
-else
-PPAS=ppas.bat
-endif
-endif
-
-# The path which is search separated by spaces
-ifdef inlinux
-SEARCHPATH=$(subst :, ,$(PATH))
-else
-SEARCHPATH=$(subst ;, ,$(PATH))
-endif
-
-# ldconfig to rebuild .so cache
-ifdef inlinux
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# diff
-ifndef DIFF
-DIFF=$(strip $(wildcard $(addsuffix /diff$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(DIFF),)
-DIFF=
-else
-export DIFF:=$(firstword $(DIFF))
-endif
-endif
-
-# cmp
-ifndef CMP
-CMP=$(strip $(wildcard $(addsuffix /cmp$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(CMP),)
-CMP=
-else
-export CMP:=$(firstword $(CMP))
-endif
-endif
-
-# echo
-ifndef ECHO
-ECHO=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-export ECHO:=echo
-else
-export ECHO:=$(firstword $(ECHO))
-endif
-endif
-
-# gdate/date
-ifndef DATE
-DATE=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-export DATE:=$(firstword $(DATE))
-endif
-else
-export DATE:=$(firstword $(DATE))
-endif
-endif
-
-# Sed
-ifndef SED
-SED=$(strip $(wildcard $(addsuffix /sed$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(SED),)
-SED=
-else
-export SED:=$(firstword $(SED))
-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
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG=1
-endif
-ifdef UPXPROG
-UPXPROG=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(UPX),)
-UPXPROG=
-else
-export UPXPROG:=$(firstword $(UPX))
-endif
-else
-UPXPROG=
-endif
-endif
-
-# ZipProg, you can't use Zip as the var name (PFV)
-ifndef ZIPPROG
-ZIPPROG=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-export ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
-endif
-endif
-
-ifndef ZIPEXT
-ZIPEXT=.zip
-endif
-
-
-#####################################################################
-# Default Directories
-#####################################################################
-
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-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
-
-# set the prefix directory where to install everything
-ifndef PREFIXINSTALLDIR
-ifdef inlinux
-PREFIXINSTALLDIR=/usr
-else
-PREFIXINSTALLDIR=/pp
-endif
-endif
-
-# set the base directory where to install everything
-ifndef BASEINSTALLDIR
-ifdef inlinux
-BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
-else
-BASEINSTALLDIR=$(PREFIXINSTALLDIR)
-endif
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-ifndef OTHERLIBDIR
-OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
-
-#####################################################################
-# Install Directories based on BASEINSTALLDIR
-#####################################################################
-
-# 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
-BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
-else
-BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
-endif
-endif
-
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
-endif
-
-# Where the .msg files will be stored
-ifndef SOURCEINSTALLDIR
-SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
-endif
-
-# Where the doc files will be stored
-ifndef DOCINSTALLDIR
-ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
-else
-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
-endif
-
-
-#####################################################################
-# Compiler Command Line
-#####################################################################
-
-# Load commandline OPTDEF and add CPU define
-override PPOPTDEF:=$(OPTDEF) -d$(CPU)
-
-# Load commandline OPT and add target and unit dir to be sure
-override PPOPT:=-T$(OS_TARGET) $(NEEDOPT) $(OPT)
-
-# RTL first and then Unit dir (a unit can override RTLunit)
-ifdef RTLDIR
-override PPOPT+=$(addprefix -Fu,$(RTLDIR))
-endif
-ifdef UNITDIR
-override PPOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef NEEDUNITDIR
-override PPOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
-endif
-
-# Library dirs
-ifdef LIBDIR
-override PPOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef NEEDLIBDIR
-override PPOPT+=$(addprefix -Fl,$(NEEDLIBDIR))
-endif
-
-# Add GCC lib path if asked
-ifdef NEEDGCCLIB
-ifdef GCCLIBDIR
-override PPOPT+=-Fl$(GCCLIBDIR)
-endif
-endif
-
-# Add Other dirs path if asked
-ifdef NEEDOTHERLIB
-ifdef OTHERLIBDIR
-override PPOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
-endif
-endif
-
-# Object dirs
-ifdef OBJDIR
-override PPOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef NEEDOBJDIR
-override PPOPT+=$(addprefix -Fo,$(NEEDOBJDIR))
-endif
-
-# Add include dirs INC and PROCINC and OSINC
-ifdef INC
-override PPOPT+=$(addprefix -Fi,$(INC))
-endif
-ifdef PROCINC
-override PPOPT+=$(addprefix -Fi,$(PROCINC))
-endif
-ifdef OSINC
-override PPOPT+=$(addprefix -Fi,$(OSINC))
-endif
-
-# Target dirs
-ifdef TARGETDIR
-override PPOPT+=-FE$(TARGETDIR)
-endif
-ifdef UNITTARGETDIR
-override PPOPT+=-FU$(UNITTARGETDIR)
-endif
-
-# Smartlinking
-ifeq ($(SMARTLINK),YES)
-override PPOPT+=-CX
-endif
-
-# Add defines from PPOPTDEF to PPOPT
-override PPOPT:=$(PPOPT) $(PPOPTDEF)
-
-# Was a config file specified ?
-ifdef CFGFILE
-override PPOPT:=$(PPOPT) @$(CFGFILE)
-endif
-
-override COMPILER=$(PP) $(PPOPT)
-
-
-#####################################################################
-# Default extensions
-#####################################################################
-
-# Default needed extensions (Go32v2,Linux)
-LOADEREXT=.as
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-PACKAGESUFFIX=
-
-# Go32v1
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-PACKAGESUFFIX=v1
-endif
-
-# Go32v2
-ifeq ($(OS_TARGET),go32v2)
-PACKAGESUFFIX=go32
-endif
-
-# Linux
-ifeq ($(OS_TARGET),linux)
-PACKAGESUFFIX=linux
-endif
-
-# Win32
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
-endif
-
-# OS/2
-ifeq ($(OS_TARGET),os2)
-PPUEXT=.ppo
-ASMEXT=.so2
-OEXT=.oo2
-SMARTEXT=.so
-STATICLIBEXT=.ao2
-SHAREDLIBEXT=.dll
-PACKAGESUFFIX=os2
-endif
-
-# library prefix
-LIBPREFIX=lib
-ifeq ($(OS_TARGET),go32v2)
-LIBPREFIX=
-endif
-ifeq ($(OS_TARGET),go32v1)
-LIBPREFIX=
-endif
-
-# determine which .pas extension is used
-ifndef PASEXT
-ifdef EXEOBJECTS
-override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS)))))
-else
-override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS)))))
-endif
-ifeq ($(TESTPAS),)
-PASEXT=.pp
-else
-PASEXT=.pas
-endif
-endif
-
-# also call ppas if with command option -s
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-EXECPPAS=@$(PPAS)
-endif
-
-ifdef DATE
-DATESTR=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-
-
-#####################################################################
-# Export commandline values, so nesting use the same values
-#####################################################################
-
-# Makefile
-export FPCDIR FPCMAKE
-
-# Compiler info
-export FPC_VERSION OS_SOURCE OS_TARGET CPU
-export OPT OPTDEF PP RELEASE VERBOSE SMARTLINK
-
-# Installation
-export PREFIXINSTALLDIR PACKAGESUFFIX
-
-# Directories
-export GCCLIBDIR OTHERLIBDIR
-
-
-#####################################################################
-# General compile rules
-#####################################################################
-
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
-UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
-
-.PHONY : fpc_all fpc_units fpc_loaders fpc_exes \
-	 fpc_staticlib fpc_sharedlib \
-	 fpc_clean fpc_libsclean fpc_cleanall \
-	 fpc_install fpc_staticinstall fpc_sharedinstall fpc_libinstall \
-	 fpc_info fpc_cfginfo fpc_objectinfo fpc_installinfo fpc_filesinfo\
-	 fpc_dirinfo
-
-.SUFFIXES : $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
-
-
-#####################################################################
-# Default
-#####################################################################
-
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
-
-fpc_loaders: $(LOADEROFILES)
-
-fpc_units: $(UNITPPUFILES)
-
-fpc_exes: $(EXEFILES)
-
-# General compile rules, available for both possible PASEXT
-%$(PPUEXT): %.pp
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
-
-%$(PPUEXT): %.pas
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
-
-%$(EXEEXT): %.pp
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
-
-%$(EXEEXT): %.pas
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
-
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
-
-#####################################################################
-# Library
-#####################################################################
-
-# Default sharedlib units are all unit objects
-ifndef SHAREDLIBUNITOBJECTS
-SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
-endif
-
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
-
-fpc_sharedlib: all
-ifdef inlinux
-ifndef LIBNAME
-	@$(ECHO) LIBNAME not set
-else
-	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
-endif
-else
-	@$(ECHO) Shared Libraries not supported
-endif
-
-
-#####################################################################
-# Install rules
-#####################################################################
-
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
-endif
-endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
-endif
-ifdef UNITOBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES)))
-endif
-ifdef EXTRAINSTALLUNITS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))))
-endif
-
-fpc_install : all
-	$(MAKE) fpc_install2
-
-fpc_install2 :
-# Create UnitInstallFiles
-ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
-endif
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	$(MKDIR) $(BININSTALLDIR)
-# Compress the exes if upx is defined
-ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
-endif
-endif
-ifdef LOADEROBJECTS
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
-endif
-ifdef UNITOBJECTS
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES)) $(UNITINSTALLDIR)
-endif
-ifneq ($(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))),)
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))) $(UNITINSTALLDIR)
-endif
-
-
-# Target for the sharedlib install which is not avail for all targets
-ifdef inlinux
-SHAREDINSTALL=sharedinstall
-else
-SHAREDINSTALL=
-endif
-
-fpc_staticinstall: staticlib
-	$(MKDIR) $(STATIC_UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(STATIC_UNITINSTALLDIR)
-	$(MKDIR) $(STATIC_LIBINSTALLDIR)
-	$(INSTALLEXE) *$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
-
-fpc_sharedinstall: sharedlib
-	$(MKDIR) $(SHARED_UNITINSTALLDIR)
-ifdef UNITINSTALLFILES
-	$(INSTALL) $(UNITINSTALLFILES) $(SHARED_UNITINSTALLDIR)
-else
-	$(INSTALL) $(UNITOFILES) $(SHARED_UNITINSTALLDIR)
-endif
-	$(MKDIR) $(SHARED_LIBINSTALLDIR)
-	$(INSTALLEXE) *$(SHAREDLIBEXT) $(SHARED_LIBINSTALLDIR)
-
-
-fpc_libinstall: staticinstall $(SHAREDINSTALL)
-
-
-#####################################################################
-# Zip
-#####################################################################
-
-# Temporary path to pack a file
-ifndef PACKDIR
-ifndef inlinux
-PACKDIR=pack_tmp
-else
-PACKDIR=/tmp/fpc-pack
-endif
-endif
-
-# Test dir if none specified
-ifndef PACKAGEDIR
-PACKAGEDIR=$(BASEDIR)
-endif
-
-# Add .zip/.tar.gz extension
-ifdef ZIPNAME
-ifndef inlinux
-override ZIPNAME:=$(ZIPNAME)$(ZIPEXT)
-endif
-endif
-
-# Default target which is call before zipping
-ifndef ZIPTARGET
-ZIPTARGET=install
-endif
-
-# Note: This will not remove the zipfile first
-fpc_zipinstalladd:
-ifndef ZIPNAME
-	@$(ECHO) Please specify ZIPNAME!
-	@exit
-else
-	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
-ifdef inlinux
-	gzip -d $(PACKAGEDIR)/$(ZIPNAME).tar.gz
-	cd $(PACKDIR) ; tar rv --file $(PACKAGEDIR)/$(ZIPNAME).tar * ; cd $(BASEDIR)
-	gzip $(PACKAGEDIR)/$(ZIPNAME).tar
-else
-	cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
-endif
-	$(DELTREE) $(PACKDIR)
-endif
-
-# First remove the zip and then install
-fpc_zipinstall:
-ifndef ZIPNAME
-	@$(ECHO) Please specify ZIPNAME!
-	@exit
-else
-	$(DEL) $(PACKAGEDIR)/$(ZIPNAME)
-	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
-ifdef inlinux
-	cd $(PACKDIR) ; tar cvz --file $(PACKAGEDIR)/$(ZIPNAME).tar.gz * ; cd $(BASEDIR)
-else
-	cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
-endif
-	$(DELTREE) $(PACKDIR)
-endif
-
-
-#####################################################################
-# Clean rules
-#####################################################################
-
-fpc_clean:
-	make fpc_clean2
-
-fpc_clean2:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
-endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
-endif
-ifdef UNITOBJECTS
-	-$(DEL) $(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
-ifneq ($(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))) ,)
-	-$(DEL) $(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
-endif
-	-$(DEL) $(PPAS) link.res log
-
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
-fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
-
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-fpc_depend:
-	makedep $(UNITOBJECTS)
-
-
-#####################################################################
-# Info rules
-#####################################################################
-
-fpc_info: fpc_cfginfo fpc_objectinfo fpc_toolsinfo fpc_installinfo\
-	  fpc_dirinfo
-
-fpc_cfginfo:
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPCDir.... $(FPCDIR)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)
-	@$(ECHO)  Version... $(FPC_VERSION)
-	@$(ECHO)  CPU....... $(CPU)
-	@$(ECHO)  Source.... $(OS_SOURCE)
-	@$(ECHO)  Target.... $(OS_TARGET)
-	@$(ECHO)
-
-fpc_dirinfo:
-ifdef inlinux
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-ifdef NEEDGCCLIB
-	@$(ECHO)  GCC library is needed.
-endif
-ifdef NEEDOTHERLIB
-	@$(ECHO)  Other library is needed.
-endif
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-
-endif
-
-fpc_toolsinfo:
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  Pwd....... $(PWD)
-	@$(ECHO)  Echo...... $(ECHO)
-ifdef SED
-	@$(ECHO)  Sed....... $(SED)
-endif
-ifdef DATE
-	@$(ECHO)  Date...... $(DATE)
-endif
-ifdef DIFF
-	@$(ECHO)  Diff...... $(DIFF)
-endif
-ifdef CMP
-	@$(ECHO)  Cmp....... $(CMP)
-endif
-ifdef UPXPROG
-	@$(ECHO)  Upx....... $(UPXPROG)
-endif
-ifdef ZIPPROG
-	@$(ECHO)  Zip....... $(ZIPPROG)
-endif
-	@$(ECHO)
-
-fpc_objectinfo:
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
-	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
-	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
-	@$(ECHO)
-	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
-	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
-	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLFILES)
-	@$(ECHO)
-	@$(ECHO)  == Unit info ==
-	@$(ECHO)
-	@$(ECHO)  UnitInstallFiles. $(UNITINSTALLFILES)
-	@$(ECHO)  UnitCleanFiles... $(UNITCLEANFILES)
-	@$(ECHO)
-
-fpc_installinfo:
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
-	@$(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)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)
-
-# try to get the files in the currentdir
-PASFILES:=$(wildcard *.pas)
-PPFILES:=$(wildcard *.pp)
-INCFILES:=$(wildcard *.inc)
-MSGFILES:=$(wildcard *.msg)
-ASFILES:=$(wildcard *.as)
-
-fpc_filesinfo:
-	@$(ECHO)
-	@$(ECHO)  == Files info ==
-	@$(ECHO)
-ifdef PASFILES
-	@$(ECHO)  Pas files are $(PASFILES)
-endif
-ifdef PPFILES
-	@$(ECHO)  PP  files are $(PPFILES)
-endif
-ifdef INCFILES
-	@$(ECHO)  Inc files are $(INCFILES)
-endif
-ifdef MSGFILES
-	@$(ECHO)  Msg files are $(MSGFILES)
-endif
-ifdef ASFILES
-	@$(ECHO)  As  files are $(ASFILES)
-endif
-
-#
-# $Log$
-# Revision 1.47  1999-09-27 08:08:15  peter
-#   * fixed smartlinking switch
-#
-# Revision 1.46  1999/08/30 12:07:43  pierre
-#  * use unitdir only if existing and non empty
-#
-# Revision 1.45  1999/08/19 06:50:25  michael
-# + Changes from Sebastian Gunther
-#
-# Revision 1.44  1999/08/13 15:35:37  peter
-#   * UPX -> UPXPROG, because upx 0.80+ use the environment itself
-#
-# Revision 1.43  1999/08/09 22:19:46  peter
-#   * classes vmt changed to only positive addresses
-#   * sharedlib creation is working
-#
-# Revision 1.42  1999/07/22 16:13:32  peter
-#   * install,clean fixes
-#
-# Revision 1.41  1999/07/21 14:21:00  peter
-#   * install works again
-#
-# Revision 1.40  1999/07/17 14:22:54  peter
-#   * ECHO is now again without @
-#
-# Revision 1.39  1999/07/17 11:30:23  peter
-#   * merged
-#
-# Revision 1.38  1999/07/16 13:45:24  peter
-#   * 0.99.12b updates
-#   * merges
-#
-# Revision 1.37  1999/07/05 21:37:35  peter
-#   * display extraunits in info
-#
-# Revision 1.36  1999/07/01 18:20:01  jonas
-#   * changed RELEASE=1 processor option from -Op2 to -Op3
-#
-# Revision 1.35  1999/06/18 11:03:08  peter
-#   * merged
-#
-# Revision 1.34  1999/06/18 10:11:18  peter
-#   * merged
-#
-# Revision 1.33  1999/06/13 22:43:23  peter
-#   * merged from fixes
-#
-# Revision 1.32  1999/06/11 13:31:14  hajny
-#   * fixes for OS/2
-#
-# Revision 1.31.2.5  1999/07/17 11:29:02  peter
-#   * more extrainstallunits,extracleanunits updates
-#
-# Revision 1.31.2.4  1999/07/16 13:40:56  peter
-#   + extrainstallunits,extracleanunits
-#
-# Revision 1.31.2.3  1999/06/18 10:55:31  peter
-#   * version fixes
-#   * EXTRAUNITS to set extra units that are build and needs to be cleaned
-#
-# Revision 1.31.2.2  1999/06/18 10:07:27  peter
-#   * rtl/linux and units/linux also for linux installs
-#
-# Revision 1.31.2.1  1999/06/13 22:36:38  peter
-#   * install msg files in msg/ instead of bin for not linux
-#
-# Revision 1.31  1999/06/10 15:02:08  peter
-#   * last fixes for 0.99.12 release
-#
-# Revision 1.30  1999/06/03 09:36:31  peter
-#   * first things for sharedlib to work again
-#
-# Revision 1.29  1999/06/01 13:27:24  peter
-#   * updates for linux
-#
-# Revision 1.28  1999/05/30 11:33:04  peter
-#   * releasever removed, fpc_version will be used
-#
-# Revision 1.27  1999/05/16 02:37:30  peter
-#   + fpc_showinstallfiles to show which files will be added to the system
-#
-# Revision 1.26  1999/05/14 22:46:21  peter
-#   * patch for comments in ld.so.conf
-#
-# Revision 1.25  1999/05/12 16:17:07  peter
-#   + utils_X targets
-#   * missing export of prefixinstalldir
-#
-# Revision 1.24  1999/05/11 00:48:12  peter
-#   * fixed some typos
-#
-# Revision 1.23  1999/05/10 15:18:43  peter
-#   * NEEDOTHERLIB define to load ld.so.conf for linux
-#
-# Revision 1.22  1999/05/04 23:20:42  pierre
-#  + FPC_VERSION (with shell $(PP) -iV)
-#
-# Revision 1.21  1999/05/03 22:38:10  peter
-#   * typo with -TP which should be -iTP
-#
-# Revision 1.20  1999/05/03 22:29:04  peter
-#   * os_source,os_target depends now on the compiler
-#   * cpu depends on the compiler
-#   * datestr y2k proof
-#
-# Revision 1.19  1999/05/03 18:04:58  peter
-#   + sourceinstalldir
-#
-# Revision 1.18  1999/04/29 15:52:38  peter
-#   * better gcclib dir detection
-#
-# Revision 1.17  1999/04/20 12:33:32  michael
-# + Fixed GCCLIB detection. Added fpc_dirinfo target
-#
-# Revision 1.16  1999/04/20 12:07:49  michael
-# Added autodetect of gcc lib for linux
-#
-# Revision 1.15  1999/04/16 20:12:35  michael
-# + install target now correctly takes the BASEINSTALLDIR on linux
-#
-# Revision 1.14  1999/04/08 10:16:17  peter
-#   * zipinstall for linux with .tar.gz
-#
-# Revision 1.13  1999/04/01 22:52:28  peter
-#   * don't override pasext if set
-#
-# Revision 1.12  1999/03/29 16:04:58  peter
-#   * place -T as the first parameter on the commandline so a OPT=-A can
-#     overwrite it
-#
-# Revision 1.11  1999/03/16 00:46:55  peter
-#   * makefile.fpc targets start with fpc_
-#   * small updates for install scripts
-#
-# Revision 1.10  1999/03/12 21:01:30  michael
-# + Changed clean and libsclean to fpc_target
-#
-# Revision 1.9	1999/03/11 17:54:00  peter
-#   * better check for makefile.fpc
-#   * check if cmp exists
-#
-# Revision 1.8	1999/03/09 01:35:47  peter
-#   * makefile.fpc updates and defaultfpcdir var
-#
-#