Browse Source

* fpcmake updates

peter 26 years ago
parent
commit
a526026966

+ 671 - 69
fcl/Makefile

@@ -1,105 +1,714 @@
 #
 #
-#   $Id$
-#   Copyright (c) 1999 by the Free Pascal Development Team
-#
-#   Makefile for Free Component Library
-#
-#   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 from Makefile.fpc on 1999-11-09 16:13
 #
 #
 
 
+defaultrule: Makefile all
+
+Makefile: Makefile.fpc
+	fpcmake
+	
+
+#####################################################################
+# 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
 # Defaults
+
+
+# Directories
+
+
+# Libraries
+
+
+#####################################################################
+# 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)
+
+#####################################################################
+# Default Directories
 #####################################################################
 #####################################################################
 
 
-# Default place of the makefile.fpc
-DEFAULTFPCDIR=..
+# 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
 
 
 #####################################################################
 #####################################################################
-# Common targets
+# Install Directories based on BASEINSTALLDIR
 #####################################################################
 #####################################################################
 
 
-.PHONY: all clean install info \
-        staticlib sharedlib libsclean \
-        staticinstall sharedinstall libinstall \
+# set the base directory where to install everything
+ifndef BASEINSTALLDIR
+ifdef inlinux
+BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
+else
+BASEINSTALLDIR=$(PREFIXINSTALLDIR)
+endif
+endif
 
 
-all: testfpcmake
-	$(MAKE) -C $(OS_TARGET) all
-        
-clean: testfpcmake
-	$(MAKE) -C go32v2 clean
-	$(MAKE) -C linux clean
-	$(MAKE) -C win32 clean
-	$(MAKE) -C os2 clean
-	$(MAKE) -C tests clean
 
 
-install: testfpcmake
-	$(MAKE) -C $(OS_TARGET) install
+# Linux binary really goes to baseinstalldir
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(BASEINSTALLDIR)
+else
+LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
+endif
+endif
 
 
-info: testfpcmake fpc_info
+# set the directory where to install the binaries
+ifndef BININSTALLDIR
+ifdef inlinux
+BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
+else
+BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
+endif
+endif
 
 
-staticlib: testfpcmake
-	$(MAKE) -C $(OS_TARGET) staticlib
+# Where the .msg files will be stored
+ifndef MSGINSTALLDIR
+MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+endif
 
 
-sharedlib: testfpcmake
-	$(MAKE) -C $(OS_TARGET) sharedlib
+# Where the .msg files will be stored
+ifndef SOURCEINSTALLDIR
+SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
+endif
 
 
-libsclean: testfpcmake
-	$(MAKE) -C $(OS_TARGET) libsclean
+# Where the doc files will be stored
+ifndef DOCINSTALLDIR
+ifdef inlinux
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+else
+DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
+endif
+endif
 
 
-staticinstall: testfpcmake
-	$(MAKE) -C $(OS_TARGET) staticinstall
+########################
+# Unit Directories
+########################
 
 
-sharedinstall: testfpcmake
-	$(MAKE) -C $(OS_TARGET) sharedinstall
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
 
 
-libinstall: testfpcmake
-	$(MAKE) -C $(OS_TARGET) libinstall
+# 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
+
+#####################################################################
+# 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
+
+showinstall: fpc_showinstall
+
+zipinstall: fpc_zipinstall
+
+zipinstalladd: fpc_zipinstalladd
+
+clean_all: fpc_clean_all
+
+depend: fpc_depend
+
+info: fpc_info
+
+#####################################################################
+# 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
 
 
 #####################################################################
 #####################################################################
-# Include default makefile
+# Zip
 #####################################################################
 #####################################################################
 
 
-# test if FPCMAKE is still valid
-ifdef FPCMAKE
-ifeq ($(strip $(wildcard $(FPCMAKE))),)
-FPCDIR=
-FPCMAKE=
+.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
 endif
+
+# Test dir if none specified
+ifndef PACKAGEDIR
+PACKAGEDIR=$(BASEDIR)
 endif
 endif
 
 
-ifndef FPCDIR
-ifdef DEFAULTFPCDIR
-FPCDIR=$(DEFAULTFPCDIR)
+# Add .zip/.tar.gz extension
+ifdef ZIPNAME
+ifndef inlinux
+override ZIPNAME:=$(ZIPNAME)$(ZIPEXT)
+endif
 endif
 endif
+
+# Default target which is call before zipping
+ifndef ZIPTARGET
+ZIPTARGET=install
 endif
 endif
 
 
-ifndef FPCMAKE
-ifdef FPCDIR
-FPCMAKE=$(FPCDIR)/makefile.fpc
+# 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
 else
-FPCMAKE=makefile.fpc
+	cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
 endif
 endif
+	$(DELTREE) $(PACKDIR)
 endif
 endif
 
 
-override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
-ifeq ($(FPCMAKE),)
-testfpcmake:
-	@echo makefile.fpc not found!
-	@echo Check the FPCMAKE and FPCDIR environment variables.
-	@exit 1
+# 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
 else
-include $(FPCMAKE)
-testfpcmake:
+	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
 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)
+
+#####################################################################
+# Users rules
+#####################################################################
+
+
+all:
+	$(MAKE) -C $(OS_TARGET) all
+
+clean:
+	$(MAKE) -C go32v2 clean
+	$(MAKE) -C linux clean
+	$(MAKE) -C win32 clean
+	$(MAKE) -C os2 clean
+	$(MAKE) -C tests clean
+
+install:
+	$(MAKE) -C $(OS_TARGET) install
+
+staticlib:
+	$(MAKE) -C $(OS_TARGET) staticlib
+
+sharedlib:
+	$(MAKE) -C $(OS_TARGET) sharedlib
+
+libsclean:
+	$(MAKE) -C $(OS_TARGET) libsclean
+
+staticinstall:
+	$(MAKE) -C $(OS_TARGET) staticinstall
+
+sharedinstall:
+	$(MAKE) -C $(OS_TARGET) sharedinstall
+
+libinstall:
+	$(MAKE) -C $(OS_TARGET) libinstall
 
 
 
 
 #####################################################################
 #####################################################################
@@ -131,10 +740,3 @@ os2:
 
 
 win32:
 win32:
 	$(MAKE) -C win32
 	$(MAKE) -C win32
-
-#
-# $Log$
-# Revision 1.3  1999-04-08 10:18:47  peter
-#   * makefile updates
-#
-#

+ 1 - 1
fcl/db/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated from Makefile.fpc on 1999-11-09 15:26
+# Makefile generated from Makefile.fpc on 1999-11-09 16:02
 #
 #
 
 
 defaultrule: Makefile all
 defaultrule: Makefile all

+ 1 - 1
fcl/db/Makefile.fpc

@@ -1,5 +1,5 @@
 #
 #
-#   Makefile.fpc for shedit
+#   Makefile.fpc for TDataSet for FCL
 #
 #
 
 
 [targets]
 [targets]

+ 26 - 25
fcl/go32v2/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated from Makefile.fpc on 1999-11-04 11:51
+# Makefile generated from Makefile.fpc on 1999-11-09 16:00
 #
 #
 
 
 defaultrule: Makefile all
 defaultrule: Makefile all
 
 
 Makefile: Makefile.fpc
 Makefile: Makefile.fpc
 	fpcmake
 	fpcmake
-	$(MAKE)
+	
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
@@ -126,6 +126,9 @@ endif
 # User Settings
 # User Settings
 #####################################################################
 #####################################################################
 
 
+
+# Pre Settings
+
 # Include files
 # Include files
 INC=../inc
 INC=../inc
 XML=../xml
 XML=../xml
@@ -135,12 +138,23 @@ XML=../xml
 include $(INC)/Makefile.inc
 include $(INC)/Makefile.inc
 include $(XML)/Makefile.inc
 include $(XML)/Makefile.inc
 
 
+# Targets
+
 UNITOBJECTS=classes $(INCUNITS) $(XMLUNITS)
 UNITOBJECTS=classes $(INCUNITS) $(XMLUNITS)
-EXEOBJECTS=
+
+# Clean
+
+
+# Install
+
+
+# Defaults
 
 
 DEFAULTUNITS=1
 DEFAULTUNITS=1
 override NEEDOPT=-S2
 override NEEDOPT=-S2
 
 
+# Directories
+
 ifndef FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 FPCDIR=../..
 endif
 endif
@@ -149,6 +163,10 @@ ifndef TARGETDIR
 TARGETDIR=.
 TARGETDIR=.
 endif
 endif
 
 
+# Libraries
+
+
+# Info
 
 
 FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
 
@@ -157,7 +175,7 @@ FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall
 #####################################################################
 #####################################################################
 
 
 # Load commandline OPTDEF and add FPC_CPU define
 # Load commandline OPTDEF and add FPC_CPU define
-override FPCOPTDEF:=-d$(FPC_CPU)
+override FPCOPTDEF:=-d$(CPU_TARGET)
 
 
 # Load commandline OPT and add target and unit dir to be sure
 # Load commandline OPT and add target and unit dir to be sure
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 ifneq ($(OS_TARGET),$(OS_SOURCE))
@@ -728,12 +746,12 @@ endif
 
 
 .PHONY: fpc_showinstallfiles fpc_install
 .PHONY: fpc_showinstallfiles fpc_install
 
 
-ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
-endif
 ifdef UNITOBJECTS
 ifdef UNITOBJECTS
 override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
 override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
 endif
 endif
+ifdef EXTRAINSTALLUNITS
+override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+endif
 
 
 fpc_showinstallfiles : all
 fpc_showinstallfiles : all
 ifndef DEFAULTUNITS
 ifndef DEFAULTUNITS
@@ -851,7 +869,7 @@ ifdef UNITOBJECTS
 override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
 override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
 endif
 endif
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
 endif
 endif
 
 
 fpc_clean:
 fpc_clean:
@@ -908,23 +926,6 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 	@$(ECHO)
 
 
-fpc_infoobjects:
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
-	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
-	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
-	@$(ECHO)
-	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
-	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
-	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
-	@$(ECHO)
-	@$(ECHO)  == Unit info ==
-	@$(ECHO)
-	@$(ECHO)  UnitInstallFiles. $(UNITINSTALLFILES)
-	@$(ECHO)  UnitCleanFiles... $(UNITCLEANFILES)
-	@$(ECHO)
 
 
 fpc_infoinstall:
 fpc_infoinstall:
 	@$(ECHO)
 	@$(ECHO)

+ 41 - 41
fcl/go32v2/Makefile.fpc

@@ -1,41 +1,41 @@
-#
-#   Makefile.fpc for Free Component Library for Go32v2
-#
-
-[defaults]
-defaultunits=1
-defaulttarget=go32v2
-defaultcpu=i386
-defaultoptions=-S2
-
-[dirs]
-fpcdir=../..
-targetdir=.
-incdir=$(INC)
-
-[targets]
-units=classes $(INCUNITS) $(XMLUNITS)
-
-
-[presettings]
-# Include files
-INC=../inc
-XML=../xml
-
-# INCUNITS,XMLUNITS is defined in makefile.inc
-# They are default units for all platforms.
-include $(INC)/Makefile.inc
-include $(XML)/Makefile.inc
-
-
-[rules]
-vpath %$(PASEXT) $(INC) $(XML)
-
-INCFILES=$(addprefix $(INC)/,$(INCNAMES))
-
-classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
-
-inifiles$(PPUEXT): classes$(PPUEXT) inifiles$(PASEXT)
-
-ezcgi$(PPUEXT): ezcgi$(PASEXT) ezcgi.inc
-
+#
+#   Makefile.fpc for Free Component Library for Go32v2
+#
+
+[defaults]
+defaultunits=1
+defaulttarget=go32v2
+defaultcpu=i386
+defaultoptions=-S2
+
+[dirs]
+fpcdir=../..
+targetdir=.
+incdir=$(INC)
+
+[targets]
+units=classes $(INCUNITS) $(XMLUNITS)
+
+
+[presettings]
+# Include files
+INC=../inc
+XML=../xml
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+
+
+[rules]
+vpath %$(PASEXT) $(INC) $(XML)
+
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+inifiles$(PPUEXT): classes$(PPUEXT) inifiles$(PASEXT)
+
+ezcgi$(PPUEXT): ezcgi$(PASEXT) ezcgi.inc
+

+ 26 - 25
fcl/linux/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated from Makefile.fpc on 1999-11-06 18:16
+# Makefile generated from Makefile.fpc on 1999-11-09 16:00
 #
 #
 
 
 defaultrule: Makefile all
 defaultrule: Makefile all
 
 
 Makefile: Makefile.fpc
 Makefile: Makefile.fpc
 	fpcmake
 	fpcmake
-	$(MAKE)
+	
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
@@ -126,6 +126,9 @@ endif
 # User Settings
 # User Settings
 #####################################################################
 #####################################################################
 
 
+
+# Pre Settings
+
 # Include files
 # Include files
 INC=../inc
 INC=../inc
 XML=../xml
 XML=../xml
@@ -135,12 +138,23 @@ XML=../xml
 include $(INC)/Makefile.inc
 include $(INC)/Makefile.inc
 include $(XML)/Makefile.inc
 include $(XML)/Makefile.inc
 
 
+# Targets
+
 UNITOBJECTS=classes $(INCUNITS) $(XMLUNITS)
 UNITOBJECTS=classes $(INCUNITS) $(XMLUNITS)
-EXEOBJECTS=
+
+# Clean
+
+
+# Install
+
+
+# Defaults
 
 
 DEFAULTUNITS=1
 DEFAULTUNITS=1
 override NEEDOPT=-S2
 override NEEDOPT=-S2
 
 
+# Directories
+
 ifndef FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 FPCDIR=../..
 endif
 endif
@@ -149,6 +163,10 @@ ifndef TARGETDIR
 TARGETDIR=.
 TARGETDIR=.
 endif
 endif
 
 
+# Libraries
+
+
+# Info
 
 
 FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
 
@@ -157,7 +175,7 @@ FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall
 #####################################################################
 #####################################################################
 
 
 # Load commandline OPTDEF and add FPC_CPU define
 # Load commandline OPTDEF and add FPC_CPU define
-override FPCOPTDEF:=-d$(FPC_CPU)
+override FPCOPTDEF:=-d$(CPU_TARGET)
 
 
 # Load commandline OPT and add target and unit dir to be sure
 # Load commandline OPT and add target and unit dir to be sure
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 ifneq ($(OS_TARGET),$(OS_SOURCE))
@@ -728,12 +746,12 @@ endif
 
 
 .PHONY: fpc_showinstallfiles fpc_install
 .PHONY: fpc_showinstallfiles fpc_install
 
 
-ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
-endif
 ifdef UNITOBJECTS
 ifdef UNITOBJECTS
 override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
 override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
 endif
 endif
+ifdef EXTRAINSTALLUNITS
+override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+endif
 
 
 fpc_showinstallfiles : all
 fpc_showinstallfiles : all
 ifndef DEFAULTUNITS
 ifndef DEFAULTUNITS
@@ -851,7 +869,7 @@ ifdef UNITOBJECTS
 override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
 override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
 endif
 endif
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
 endif
 endif
 
 
 fpc_clean:
 fpc_clean:
@@ -908,23 +926,6 @@ fpc_infocfg:
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)  Target.... $(OS_TARGET)
 	@$(ECHO)
 	@$(ECHO)
 
 
-fpc_infoobjects:
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
-	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
-	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
-	@$(ECHO)
-	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
-	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
-	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
-	@$(ECHO)
-	@$(ECHO)  == Unit info ==
-	@$(ECHO)
-	@$(ECHO)  UnitInstallFiles. $(UNITINSTALLFILES)
-	@$(ECHO)  UnitCleanFiles... $(UNITCLEANFILES)
-	@$(ECHO)
 
 
 fpc_infoinstall:
 fpc_infoinstall:
 	@$(ECHO)
 	@$(ECHO)

+ 39 - 39
fcl/linux/Makefile.fpc

@@ -1,41 +1,41 @@
-#
+#
 #   Makefile.fpc for Free Component Library for Linux
 #   Makefile.fpc for Free Component Library for Linux
-#
-
-[defaults]
-defaultunits=1
+#
+
+[defaults]
+defaultunits=1
 defaulttarget=linux
 defaulttarget=linux
-defaultcpu=i386
-defaultoptions=-S2
-
-[dirs]
-fpcdir=../..
-targetdir=.
-incdir=$(INC)
-
-[targets]
-units=classes $(INCUNITS) $(XMLUNITS)
-
-
-[presettings]
-# Include files
-INC=../inc
-XML=../xml
-
-# INCUNITS,XMLUNITS is defined in makefile.inc
-# They are default units for all platforms.
-include $(INC)/Makefile.inc
-include $(XML)/Makefile.inc
-
-
-[rules]
-vpath %$(PASEXT) $(INC) $(XML)
-
-INCFILES=$(addprefix $(INC)/,$(INCNAMES))
-
-classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
-
-inifiles$(PPUEXT): classes$(PPUEXT) inifiles$(PASEXT)
-
-ezcgi$(PPUEXT): ezcgi$(PASEXT) ezcgi.inc
-
+defaultcpu=i386
+defaultoptions=-S2
+
+[dirs]
+fpcdir=../..
+targetdir=.
+incdir=$(INC)
+
+[targets]
+units=classes $(INCUNITS) $(XMLUNITS)
+
+
+[presettings]
+# Include files
+INC=../inc
+XML=../xml
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+
+
+[rules]
+vpath %$(PASEXT) $(INC) $(XML)
+
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+inifiles$(PPUEXT): classes$(PPUEXT) inifiles$(PASEXT)
+
+ezcgi$(PPUEXT): ezcgi$(PASEXT) ezcgi.inc
+

+ 901 - 78
fcl/os2/Makefile

@@ -1,141 +1,964 @@
 #
 #
-#   $Id$
-#   Copyright (c) 1999 by the Free Pascal Development Team
-#
-#   Makefile for Free Component Library for Linux
-#
-#   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 from Makefile.fpc on 1999-11-09 16:01
 #
 #
 
 
+defaultrule: Makefile all
+
+Makefile: Makefile.fpc
+	fpcmake
+	
 
 
 #####################################################################
 #####################################################################
-# Defaults
+# Autodetect OS (Linux or Dos or Windows NT)
+# define inlinux when running under linux
+# define inWinNT when running under WinNT
 #####################################################################
 #####################################################################
 
 
-# Default place of the makefile.fpc
-DEFAULTFPCDIR=../..
+# 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
+
+#####################################################################
+# Default target
+#####################################################################
+
+override OS_TARGET:=os2
+override CPU_TARGET:=i386
+
+#####################################################################
+# 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
+#####################################################################
+
+
+# Pre Settings
 
 
 # Include files
 # Include files
 INC=../inc
 INC=../inc
-PROCINC=../$(CPU)
+XML=../xml
 
 
-# Where to place the files
-TARGETDIR=.
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+
+# Targets
+
+UNITOBJECTS=classes $(INCUNITS) $(XMLUNITS)
+
+# Clean
 
 
-# We need always -S2
-NEEDOPT=-S2
 
 
-# As default make only the units
+# Install
+
+
+# Defaults
+
 DEFAULTUNITS=1
 DEFAULTUNITS=1
+override NEEDOPT=-S2
+
+# Directories
+
+ifndef FPCDIR
+FPCDIR=../..
+endif
+override NEEDINCDIR=$(INC)
+ifndef TARGETDIR
+TARGETDIR=.
+endif
+
+# Libraries
 
 
 
 
+# Info
+
+FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
 #####################################################################
 #####################################################################
-# Real targets
+# Compiler Command Line
 #####################################################################
 #####################################################################
 
 
-# INCUNITS is defined in makefile.inc
-# They are default units for all platforms.
-include $(INC)/Makefile.inc
+# 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
+
+# RTL first and then Unit dir (a unit can override RTLunit). Don't add the
+# dirs if fpcdir=. which can be used for the rtl makefiles
+ifdef FPCDIR
+ifneq ($(FPCDIR),.)
+override FPCOPT+=-Fu$(FPCDIR)/rtl/$(OS_TARGET) -Fu$(FPCDIR)/units/$(OS_TARGET)
+endif
+endif
+
+ifdef NEEDINCDIR
+override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
+endif
+
 
 
-UNITOBJECTS=classes $(INCUNITS)
-EXEOBJECTS=
+# Target dirs
+ifdef TARGETDIR
+override FPCOPT+=-FE$(TARGETDIR)
+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)
 
 
 #####################################################################
 #####################################################################
-# Common targets
+# Shell tools
 #####################################################################
 #####################################################################
 
 
-.PHONY: all clean install info \
-        staticlib sharedlib libsclean \
-        staticinstall sharedinstall libinstall \
-        
-all: testfpcmake fpc_all
+# To copy pograms
+ifndef COPY
+export COPY:=cp -fp
+endif
 
 
-clean: testfpcmake fpc_clean
+# To move pograms
+ifndef MOVE
+export MOVE:=mv -f
+endif
 
 
-install: testfpcmake fpc_install
+# Check delete program
+ifndef DEL
+export DEL:=rm -f
+endif
 
 
-info: testfpcmake fpc_info
+# Check deltree program
+ifndef DELTREE
+export DELTREE:=rm -rf
+endif
 
 
-staticlib: testfpcmake fpc_staticlib
+# To install files
+ifndef INSTALL
+ifdef inlinux
+export INSTALL:=install -m 644
+else
+export INSTALL:=$(COPY)
+endif
+endif
 
 
-sharedlib: testfpcmake fpc_sharedlib
+# To install programs
+ifndef INSTALLEXE
+ifdef inlinux
+export INSTALLEXE:=install -m 755
+else
+export INSTALLEXE:=$(COPY)
+endif
+endif
 
 
-libsclean: testfpcmake fpc_libsclean
+# 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
 
 
-staticinstall: testfpcmake fpc_staticinstall
+# Where is the ppdep program ?
+ifndef PPDEP
+PPDEP=ppdep
+endif
 
 
-sharedinstall: testfpcmake fpc_sharedinstall
+# ppas.bat / ppas.sh
+ifdef inlinux
+PPAS=ppas.sh
+else
+ifdef inOS2
+PPAS=ppas.cmd
+else
+PPAS=ppas.bat
+endif
+endif
 
 
-libinstall: testfpcmake fpc_libinstall
+# 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 ($(UPX),)
+UPXPROG=
+else
+export UPXPROG:=$(firstword $(UPX))
+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
 
 
 #####################################################################
 #####################################################################
-# Include default makefile
+# Default Directories
 #####################################################################
 #####################################################################
 
 
-# test if FPCMAKE is still valid
-ifdef FPCMAKE
-ifeq ($(strip $(wildcard $(FPCMAKE))),)
-FPCDIR=
-FPCMAKE=
+# 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
 endif
 endif
 
 
-ifndef FPCDIR
-ifdef DEFAULTFPCDIR
-FPCDIR=$(DEFAULTFPCDIR)
+# set the directory to the rtl base
+ifndef RTLDIR
+ifdef RTL
+RTLDIR:=$(RTL)/$(OS_TARGET)
+else
+RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
 endif
 endif
 endif
 endif
 
 
-ifndef FPCMAKE
-ifdef FPCDIR
-FPCMAKE=$(FPCDIR)/makefile.fpc
+# 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
+
+#####################################################################
+# 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
+
+all: fpc_all
+
+staticlib: fpc_staticlib
+
+sharedlib: fpc_sharedlib
+
+showinstall: fpc_showinstall
+
+install: fpc_install
+
+staticinstall: fpc_staticinstall
+
+sharedinstall: fpc_sharedinstall
+
+libinstall: fpc_libinstall
+
+zipinstall: fpc_zipinstall
+
+zipinstalladd: fpc_zipinstalladd
+
+clean: fpc_clean
+
+clean_all: fpc_clean_all
+
+depend: fpc_depend
+
+info: fpc_info
+
+#####################################################################
+# 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
 else
-FPCMAKE=makefile.fpc
+	@$(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
 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
 endif
 
 
-override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
-ifeq ($(FPCMAKE),)
-testfpcmake:
-	@echo makefile.fpc not found!
-	@echo Check the FPCMAKE and FPCDIR environment variables.
+# 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
 	@exit
 else
 else
-include $(FPCMAKE)
-testfpcmake:
+	$(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
 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)
 
 
 #####################################################################
 #####################################################################
-# Dependencies
+# Users rules
 #####################################################################
 #####################################################################
 
 
-vpath %$(PASEXT) $(INC)
+
+vpath %$(PASEXT) $(INC) $(XML)
 
 
 INCFILES=$(addprefix $(INC)/,$(INCNAMES))
 INCFILES=$(addprefix $(INC)/,$(INCNAMES))
 
 
 classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
 classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
 
 
-#
-# $Log$
-# Revision 1.6  1999-05-31 12:48:00  peter
-#   * classes unit to unitobjects
-#
-# Revision 1.5  1999/04/08 15:59:54  michael
-# + INCUNITS added
-#
-# Revision 1.8  1999/04/08 15:58:44  michael
-# + INCUNITS added
-#
-# Revision 1.7  1999/04/08 10:18:59  peter
-#   * makefile updates
-#
-#
+inifiles$(PPUEXT): classes$(PPUEXT) inifiles$(PASEXT)
+
+ezcgi$(PPUEXT): ezcgi$(PASEXT) ezcgi.inc

+ 41 - 0
fcl/os2/Makefile.fpc

@@ -0,0 +1,41 @@
+#
+#   Makefile.fpc for Free Component Library for OS/2
+#
+
+[defaults]
+defaultunits=1
+defaulttarget=os2
+defaultcpu=i386
+defaultoptions=-S2
+
+[dirs]
+fpcdir=../..
+targetdir=.
+incdir=$(INC)
+
+[targets]
+units=classes $(INCUNITS) $(XMLUNITS)
+
+
+[presettings]
+# Include files
+INC=../inc
+XML=../xml
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+
+
+[rules]
+vpath %$(PASEXT) $(INC) $(XML)
+
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+inifiles$(PPUEXT): classes$(PPUEXT) inifiles$(PASEXT)
+
+ezcgi$(PPUEXT): ezcgi$(PASEXT) ezcgi.inc
+

+ 0 - 141
fcl/template/Makefile

@@ -1,141 +0,0 @@
-#
-#   $Id$
-#   Copyright (c) 1999 by the Free Pascal Development Team
-#
-#   Makefile for Free Component Library for Linux
-#
-#   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.
-#
-
-
-#####################################################################
-# Defaults
-#####################################################################
-
-# Default place of the makefile.fpc
-DEFAULTFPCDIR=../..
-
-# Include files
-INC=../inc
-PROCINC=../$(CPU)
-
-# Where to place the files
-TARGETDIR=.
-
-# We need always -S2
-NEEDOPT=-S2
-
-# As default make only the units
-DEFAULTUNITS=1
-
-
-#####################################################################
-# Real targets
-#####################################################################
-
-# INCUNITS is defined in makefile.inc
-# They are default units for all platforms.
-include $(INC)/Makefile.inc
-
-UNITOBJECTS=classes $(INCUNITS)
-EXEOBJECTS=
-
-
-#####################################################################
-# Common targets
-#####################################################################
-
-.PHONY: all clean install info \
-        staticlib sharedlib libsclean \
-        staticinstall sharedinstall libinstall \
-        
-all: testfpcmake fpc_all
-
-clean: testfpcmake fpc_clean
-
-install: testfpcmake fpc_install
-
-info: testfpcmake fpc_info
-
-staticlib: testfpcmake fpc_staticlib
-
-sharedlib: testfpcmake fpc_sharedlib
-
-libsclean: testfpcmake fpc_libsclean
-
-staticinstall: testfpcmake fpc_staticinstall
-
-sharedinstall: testfpcmake fpc_sharedinstall
-
-libinstall: testfpcmake fpc_libinstall
-
-
-#####################################################################
-# Include default makefile
-#####################################################################
-
-# test if FPCMAKE is still valid
-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)))
-ifeq ($(FPCMAKE),)
-testfpcmake:
-	@echo makefile.fpc not found!
-	@echo Check the FPCMAKE and FPCDIR environment variables.
-	@exit
-else
-include $(FPCMAKE)
-testfpcmake:
-endif
-
-
-
-#####################################################################
-# Dependencies
-#####################################################################
-
-vpath %$(PASEXT) $(INC)
-
-INCFILES=$(addprefix $(INC)/,$(INCNAMES))
-
-classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
-
-#
-# $Log$
-# Revision 1.1  1999-05-31 12:48:01  peter
-#   * classes unit to unitobjects
-#
-# Revision 1.5  1999/04/08 15:59:54  michael
-# + INCUNITS added
-#
-# Revision 1.8  1999/04/08 15:58:44  michael
-# + INCUNITS added
-#
-# Revision 1.7  1999/04/08 10:18:59  peter
-#   * makefile updates
-#
-#

+ 41 - 0
fcl/template/Makefile.fpc

@@ -0,0 +1,41 @@
+#
+#   Makefile.fpc for Free Component Library for Go32v2
+#
+
+[defaults]
+defaultunits=1
+defaulttarget=<template>
+defaultcpu=i386
+defaultoptions=-S2
+
+[dirs]
+fpcdir=../..
+targetdir=.
+incdir=$(INC)
+
+[targets]
+units=classes $(INCUNITS) $(XMLUNITS)
+
+
+[presettings]
+# Include files
+INC=../inc
+XML=../xml
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+
+
+[rules]
+vpath %$(PASEXT) $(INC) $(XML)
+
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+inifiles$(PPUEXT): classes$(PPUEXT) inifiles$(PASEXT)
+
+ezcgi$(PPUEXT): ezcgi$(PASEXT) ezcgi.inc
+

+ 881 - 91
fcl/tests/Makefile

@@ -1,144 +1,934 @@
 #
 #
-#   $Id$
-#   Copyright (c) 1999 by the Free Pascal Development Team
-#
-#   Makefile for Free Component Library for Linux
-#
-#   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 from Makefile.fpc on 1999-11-09 16:01
 #
 #
 
 
+defaultrule: Makefile all
+
+Makefile: Makefile.fpc
+	fpcmake
+	
 
 
 #####################################################################
 #####################################################################
-# Defaults
+# 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
 #####################################################################
 #####################################################################
 
 
-# Default place of the makefile.fpc
-DEFAULTFPCDIR=../..
+# 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
+
+EXEOBJECTS=stringl dparser fstream mstream list threads testrtf cfgtest xmldump htdump testcgi tidea b64test b64test2 b64enc b64dec restest
+ifeq ($(OS_TARGET),win32)
+EXEOBJECTS+=testz testz2
+endif
+
+# Clean
 
 
-# Where need we to place the executables/ppu/objects
+EXTRACLEANFILES=restest.rst
+
+# Install
+
+
+# Defaults
+
+override NEEDOPT=-S2
+
+# Directories
+
+ifndef FPCDIR
+FPCDIR=../..
+endif
+override NEEDUNITDIR=../$(OS_TARGET)
+ifndef TARGETDIR
 TARGETDIR=.
 TARGETDIR=.
+endif
+
+# Libraries
 
 
-# Needed units
-NEEDUNITDIR=../$(OS_TARGET)
 
 
-# We need always -S2
-NEEDOPT=-S2
+# Info
 
 
+FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
 
 #####################################################################
 #####################################################################
-# Real targets
+# Compiler Command Line
 #####################################################################
 #####################################################################
 
 
-UNITOBJECTS=
-EXEOBJECTS=stringl dparser fstream mstream list threads testrtf\
-           cfgtest testz testz2 xmldump htdump testcgi tidea\
-           b64test b64test2 b64enc b64dec restest
+# 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
+
+# RTL first and then Unit dir (a unit can override RTLunit). Don't add the
+# dirs if fpcdir=. which can be used for the rtl makefiles
+ifdef FPCDIR
+ifneq ($(FPCDIR),.)
+override FPCOPT+=-Fu$(FPCDIR)/rtl/$(OS_TARGET) -Fu$(FPCDIR)/units/$(OS_TARGET)
+endif
+endif
+
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
+endif
+
+# Target dirs
+ifdef TARGETDIR
+override FPCOPT+=-FE$(TARGETDIR)
+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)
 
 
 #####################################################################
 #####################################################################
-# Common targets
+# Shell tools
 #####################################################################
 #####################################################################
 
 
-.PHONY: all clean install info \
-        staticlib sharedlib libsclean \
-        staticinstall sharedinstall libinstall \
-        
-all: testfpcmake fpc_all
+# 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
 
 
-clean: testfpcmake fpc_clean
+# To install programs
+ifndef INSTALLEXE
+ifdef inlinux
+export INSTALLEXE:=install -m 755
+else
+export INSTALLEXE:=$(COPY)
+endif
+endif
 
 
-install: testfpcmake fpc_install
+# 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
+#####################################################################
 
 
-info: testfpcmake fpc_info
+# assembler, redefine it if cross compiling
+ifndef AS
+AS=as
+endif
 
 
-staticlib: testfpcmake fpc_staticlib
+# linker, but probably not used
+ifndef LD
+LD=ld
+endif
 
 
-sharedlib: testfpcmake fpc_sharedlib
+# Where is the ppumove program ?
+ifndef PPUMOVE
+PPUMOVE=ppumove
+endif
 
 
-libsclean: testfpcmake fpc_libsclean
+# Where is the ppdep program ?
+ifndef PPDEP
+PPDEP=ppdep
+endif
 
 
-staticinstall: testfpcmake fpc_staticinstall
+# ppas.bat / ppas.sh
+ifdef inlinux
+PPAS=ppas.sh
+else
+ifdef inOS2
+PPAS=ppas.cmd
+else
+PPAS=ppas.bat
+endif
+endif
 
 
-sharedinstall: testfpcmake fpc_sharedinstall
+# also call ppas if with command option -s
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+EXECPPAS=@$(PPAS)
+endif
 
 
-libinstall: testfpcmake fpc_libinstall
+# 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 ($(UPX),)
+UPXPROG=
+else
+export UPXPROG:=$(firstword $(UPX))
+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
 
 
 #####################################################################
 #####################################################################
-# Include default makefile
+# Default Directories
 #####################################################################
 #####################################################################
 
 
-# test if FPCMAKE is still valid
-ifdef FPCMAKE
-ifeq ($(strip $(wildcard $(FPCMAKE))),)
-FPCDIR=
-FPCMAKE=
+# 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
 endif
 endif
 
 
-ifndef FPCDIR
-ifdef DEFAULTFPCDIR
-FPCDIR=$(DEFAULTFPCDIR)
+# set the directory to the rtl base
+ifndef RTLDIR
+ifdef RTL
+RTLDIR:=$(RTL)/$(OS_TARGET)
+else
+RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
 endif
 endif
 endif
 endif
 
 
-ifndef FPCMAKE
-ifdef FPCDIR
-FPCMAKE=$(FPCDIR)/makefile.fpc
+# specify where units are.
+ifndef UNITDIR
+ifdef UNITS
+UNITDIR=$(UNITS)/$(OS_TARGET)
 else
 else
-FPCMAKE=makefile.fpc
+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
 endif
 endif
 
 
-override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
-ifeq ($(FPCMAKE),)
-testfpcmake:
-	@echo makefile.fpc not found!
-	@echo Check the FPCMAKE and FPCDIR environment variables.
-	@exit 1
+# 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
 else
-include $(FPCMAKE)
-testfpcmake:
+BASEINSTALLDIR=$(PREFIXINSTALLDIR)
+endif
 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
 
 
 #####################################################################
 #####################################################################
-# Dependencies
+# Default extensions
 #####################################################################
 #####################################################################
 
 
-#
-# $Log$
-# Revision 1.12  1999-08-27 15:52:29  michael
-# + Initial implementation of resourcestrings test example
-#
-# Revision 1.11  1999/08/09 16:12:26  michael
-# * Fixes and new examples from Sebastian Guenther
-#
-# Revision 1.10  1999/08/03 17:02:36  michael
-# * Base64 en/de cdeing streams added
-#
-# Revision 1.9  1999/07/25 14:30:39  michael
-# Initial implementation of encryption stream
-#
-# Revision 1.8  1999/07/15 12:05:55  michael
-# + Added testcgi program
-#
-# Revision 1.7  1999/07/11 22:43:23  michael
-# + Added htdump
-#
-# Revision 1.6  1999/07/09 21:08:16  michael
-# + Added ztsream and xml demos
-#
-# Revision 1.5  1999/05/30 10:46:43  peter
-#   * start of tthread for linux,win32
-#
-# Revision 1.4  1999/04/08 10:19:04  peter
-#   * makefile updates
-#
-#
+# 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
+
+all: fpc_all
+
+staticlib: fpc_staticlib
+
+sharedlib: fpc_sharedlib
+
+showinstall: fpc_showinstall
+
+install: fpc_install
+
+staticinstall: fpc_staticinstall
+
+sharedinstall: fpc_sharedinstall
+
+libinstall: fpc_libinstall
+
+zipinstall: fpc_zipinstall
+
+zipinstalladd: fpc_zipinstalladd
+
+clean: fpc_clean
+
+clean_all: fpc_clean_all
+
+depend: fpc_depend
+
+info: fpc_info
+
+#####################################################################
+# 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)
+

+ 21 - 0
fcl/tests/Makefile.fpc

@@ -0,0 +1,21 @@
+#
+#   Makefile.fpc for Free Component Library Examples/Tests
+#
+
+[targets]
+programs=stringl dparser fstream mstream list threads testrtf \
+         cfgtest xmldump htdump testcgi tidea \
+         b64test b64test2 b64enc b64dec restest
+programs_win32=testz testz2
+
+[clean]
+files=restest.rst
+
+[dirs]
+fpcdir=../..
+unitdir=../$(OS_TARGET)
+targetdir=.
+
+[defaults]
+defaultoptions=-S2
+

+ 18 - 15
fcl/tests/htdump.pp

@@ -1,7 +1,7 @@
 // $Id$
 // $Id$
 
 
 {
 {
-  This program takes an W3 IDL XML file with interface definitions and 
+  This program takes an W3 IDL XML file with interface definitions and
   dumps a interface definition.
   dumps a interface definition.
 }
 }
 
 
@@ -22,25 +22,25 @@ var N,NN : TDOMNode;
     rettype : DOMString;
     rettype : DOMString;
     firstparam : boolean;
     firstparam : boolean;
     i : longint;
     i : longint;
-        
+
 begin
 begin
-   
+
    N:=Node.FindNode('returns');
    N:=Node.FindNode('returns');
    If N<>Nil then
    If N<>Nil then
       rettype:=TDomElement(N).GetAttribute('type');
       rettype:=TDomElement(N).GetAttribute('type');
-   If Not DoImplementation then 
+   If Not DoImplementation then
      Write (spc);
      Write (spc);
    If RetType='void' then
    If RetType='void' then
      Write ('Procedure ')
      Write ('Procedure ')
    else
    else
      Write ('Function ');
      Write ('Function ');
-   If DoImplementation then 
+   If DoImplementation then
      Write(TDomElement(Node.ParentNode).GetAttribute('name'),'.');
      Write(TDomElement(Node.ParentNode).GetAttribute('name'),'.');
    Write (Node.GetAttribute('name'));
    Write (Node.GetAttribute('name'));
    N:=Node.FindNode('params');
    N:=Node.FindNode('params');
    If N<>Nil then
    If N<>Nil then
      begin
      begin
-     FirstParam:=True;  
+     FirstParam:=True;
      for I:=1 to N.ChildNodes.Count-1 do
      for I:=1 to N.ChildNodes.Count-1 do
        begin
        begin
        NN:=N.ChildNodes.Item[i];
        NN:=N.ChildNodes.Item[i];
@@ -55,8 +55,8 @@ begin
            Write(';');
            Write(';');
          writeln (spc,NN.NodeName,' : ',TDOMElement(NN).GetAttribute('type'));
          writeln (spc,NN.NodeName,' : ',TDOMElement(NN).GetAttribute('type'));
          end;
          end;
-       end; 
-     If Not FirstParam then 
+       end;
+     If Not FirstParam then
      Write (')');
      Write (')');
      end;
      end;
    If RetType <>'void' then
    If RetType <>'void' then
@@ -97,9 +97,9 @@ Procedure DumpInterfaceNode (node : TDomElement; spc : String);
 Var N : TDOMNode;
 Var N : TDOMNode;
     C : TDOMNodeList;
     C : TDOMNodeList;
     I : longint;
     I : longint;
-    
+
 begin
 begin
-  If not DoImplementation then 
+  If not DoImplementation then
     begin
     begin
     Write(spc,Node.GetAttribute('name'),' = Class');
     Write(spc,Node.GetAttribute('name'),' = Class');
     N:=Node.Attributes.GetNamedItem('inherits');
     N:=Node.Attributes.GetNamedItem('inherits');
@@ -146,7 +146,7 @@ begin
   If Node.NodeName='interface' then
   If Node.NodeName='interface' then
     DumpInterfaceNode(TDOMElement(Node),Spc)
     DumpInterfaceNode(TDOMElement(Node),Spc)
   else if Node.NodeName='method' then
   else if Node.NodeName='method' then
-    DumpMethodNode(TDOMELEMENt(Node),Spc)  
+    DumpMethodNode(TDOMELEMENt(Node),Spc)
   else if Node.NodeName='attribute' then
   else if Node.NodeName='attribute' then
     DumpAttributeNode(True,TDomelement(node),spc)
     DumpAttributeNode(True,TDomelement(node),spc)
   else
   else
@@ -159,19 +159,19 @@ end;
 var
 var
   i : longint;
   i : longint;
   xml: TXMLDocument;
   xml: TXMLDocument;
-  
+
 begin
 begin
   if (ParamCount <1) or (paramcount>2) then begin
   if (ParamCount <1) or (paramcount>2) then begin
     WriteLn('htdump -m <xml>');
     WriteLn('htdump -m <xml>');
     exit;
     exit;
   end;
   end;
   I:=1;
   I:=1;
-  If paramstr(1)='-m' then 
+  If paramstr(1)='-m' then
     begin
     begin
     I:=2;
     I:=2;
     DoImplementation:=True;
     DoImplementation:=True;
     end;
     end;
-  xml := ReadXMLFile(ParamStr(i));
+  ReadXMLFile(xml, ParamStr(i));
   WriteLn ('// Created From file ',paramstr(I));
   WriteLn ('// Created From file ',paramstr(I));
   DumpNode(xml, '');
   DumpNode(xml, '');
 end.
 end.
@@ -179,7 +179,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1999-07-11 22:43:22  michael
+  Revision 1.2  1999-11-09 14:39:56  peter
+    * fpcmake updates
+
+  Revision 1.1  1999/07/11 22:43:22  michael
   + Added htdump
   + Added htdump
 
 
   Revision 1.1  1999/07/09 21:06:59  michael
   Revision 1.1  1999/07/09 21:06:59  michael

File diff suppressed because it is too large
+ 894 - 65
fcl/win32/Makefile


+ 41 - 0
fcl/win32/Makefile.fpc

@@ -0,0 +1,41 @@
+#
+#   Makefile.fpc for Free Component Library for Win32
+#
+
+[defaults]
+defaultunits=1
+defaulttarget=win32
+defaultcpu=i386
+defaultoptions=-S2
+
+[dirs]
+fpcdir=../..
+targetdir=.
+incdir=$(INC)
+
+[targets]
+units=classes $(INCUNITS) $(XMLUNITS) zlib zstream
+
+
+[presettings]
+# Include files
+INC=../inc
+XML=../xml
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+
+
+[rules]
+vpath %$(PASEXT) $(INC) $(XML)
+
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+inifiles$(PPUEXT): classes$(PPUEXT) inifiles$(PASEXT)
+
+ezcgi$(PPUEXT): ezcgi$(PASEXT) ezcgi.inc
+

+ 3 - 3
utils/Makefile

@@ -1,12 +1,12 @@
 #
 #
-# Makefile generated from Makefile.fpc on 1999-11-08 15:25
+# Makefile generated from Makefile.fpc on 1999-11-09 16:25
 #
 #
 
 
 defaultrule: Makefile all
 defaultrule: Makefile all
 
 
 Makefile: Makefile.fpc
 Makefile: Makefile.fpc
 	fpcmake
 	fpcmake
-	$(MAKE)
+	
 
 
 #####################################################################
 #####################################################################
 # Autodetect OS (Linux or Dos or Windows NT)
 # Autodetect OS (Linux or Dos or Windows NT)
@@ -122,7 +122,7 @@ endif
 
 
 # Targets
 # Targets
 
 
-EXEOBJECTS=ppudump ppumove ppdep ptop rstconv fpcmake
+EXEOBJECTS=ppudump ppumove ppdep ptop rstconv fpcmake data2inc
 
 
 # Clean
 # Clean
 
 

+ 1 - 1
utils/Makefile.fpc

@@ -4,7 +4,7 @@
 
 
 [targets]
 [targets]
 units=
 units=
-programs=ppudump ppumove ppdep ptop rstconv fpcmake
+programs=ppudump ppumove ppdep ptop rstconv fpcmake data2inc
 
 
 [clean]
 [clean]
 units=ppu ptopu
 units=ppu ptopu

+ 917 - 0
utils/simulator/Makefile

@@ -0,0 +1,917 @@
+#
+# Makefile generated from Makefile.fpc on 1999-11-09 16:29
+#
+
+defaultrule: Makefile all
+
+Makefile: Makefile.fpc
+	fpcmake
+	
+
+#####################################################################
+# 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
+
+EXEOBJECTS=alphasim
+
+# Clean
+
+EXTRACLEANUNITS=mm64 fastmm64 simlib simbase
+
+# Install
+
+
+# Defaults
+
+
+# Directories
+
+ifndef FPCDIR
+FPCDIR=../..
+endif
+
+# Libraries
+
+
+# Info
+
+FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+#####################################################################
+# 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
+
+# RTL first and then Unit dir (a unit can override RTLunit). Don't add the
+# dirs if fpcdir=. which can be used for the rtl makefiles
+ifdef FPCDIR
+ifneq ($(FPCDIR),.)
+override FPCOPT+=-Fu$(FPCDIR)/rtl/$(OS_TARGET) -Fu$(FPCDIR)/units/$(OS_TARGET)
+endif
+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 ($(UPX),)
+UPXPROG=
+else
+export UPXPROG:=$(firstword $(UPX))
+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 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
+
+#####################################################################
+# 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
+
+all: fpc_all
+
+staticlib: fpc_staticlib
+
+sharedlib: fpc_sharedlib
+
+showinstall: fpc_showinstall
+
+install: fpc_install
+
+staticinstall: fpc_staticinstall
+
+sharedinstall: fpc_sharedinstall
+
+libinstall: fpc_libinstall
+
+zipinstall: fpc_zipinstall
+
+zipinstalladd: fpc_zipinstalladd
+
+clean: fpc_clean
+
+clean_all: fpc_clean_all
+
+depend: fpc_depend
+
+info: fpc_info
+
+#####################################################################
+# 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)
+

+ 12 - 0
utils/simulator/Makefile.fpc

@@ -0,0 +1,12 @@
+#
+#   Makefile.fpc for shedit
+#
+
+[targets]
+programs=alphasim
+
+[clean]
+units=mm64 fastmm64 simlib simbase
+
+[dirs]
+fpcdir=../..

Some files were not shown because too many files changed in this diff