Browse Source

* fpcmake updates

peter 26 years ago
parent
commit
d9402cf275
10 changed files with 902 additions and 2369 deletions
  1. 34 73
      compiler/Makefile
  2. 159 199
      compiler/new/Makefile
  3. 79 724
      ide/Makefile
  4. 11 23
      ide/Makefile.fpc
  5. 80 722
      ide/fake/Makefile
  6. 4 11
      ide/fake/Makefile.fpc
  7. 170 201
      ide/fake/compiler/Makefile
  8. 170 202
      ide/fake/gdb/Makefile
  9. 182 204
      ide/text/Makefile
  10. 13 10
      ide/text/Makefile.fpc

+ 34 - 73
compiler/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-23 12:24
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 23:15
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -316,7 +316,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
 
 
-
 ifdef NEEDOPT
 ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 override FPCOPT+=$(NEEDOPT)
 endif
 endif
@@ -339,6 +338,11 @@ ifdef SMARTLINK
 override FPCOPT+=-CX
 override FPCOPT+=-CX
 endif
 endif
 
 
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
+endif
+
 # Add commandline options
 # Add commandline options
 ifdef OPT
 ifdef OPT
 override FPCOPT+=$(OPT)
 override FPCOPT+=$(OPT)
@@ -659,10 +663,12 @@ endif
 # Default rules
 # Default rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: defaultrule all smart shared \
+.PHONY: defaultrule all debug examples test smart shared \
 	showinstall install zipinstall zipinstalladd \
 	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 	clean cleanall depend info
 
 
+debug: fpc_debug
+
 smart: fpc_smart
 smart: fpc_smart
 
 
 shared: fpc_shared
 shared: fpc_shared
@@ -681,35 +687,17 @@ info: fpc_info
 # General compile rules
 # General compile rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
-
-# Create Filenames
-ifdef LOADEROBJECTS
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-endif
-ifdef EXEOBJECTS
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
-endif
-ifdef UNITOBJECTS
-UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-endif
-
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+.PHONY: fpc_all fpc_debug
 
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+fpc_all: $(ALLTARGET)
 
 
-fpc_loaders: $(LOADEROFILES)
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 
-fpc_units: $(UNITPPUFILES)
+# General compile rules, available for both possible PASEXT
 
 
-fpc_exes: $(EXEFILES)
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
 
 
-# General compile rules, available for both possible PASEXT
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
@@ -726,9 +714,6 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
 
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 #####################################################################
 # Library
 # Library
 #####################################################################
 #####################################################################
@@ -760,9 +745,6 @@ endif
 
 
 .PHONY: fpc_showinstall fpc_install
 .PHONY: fpc_showinstall fpc_install
 
 
-ifdef UNITPPUFILES
-override INSTALLPPUFILES:=$(UNITPPUFILES)
-endif
 ifdef EXTRAINSTALLUNITS
 ifdef EXTRAINSTALLUNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 endif
@@ -778,14 +760,9 @@ endif
 endif
 endif
 endif
 endif
 
 
-fpc_showinstall:
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
-endif
-endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
 endif
 ifdef INSTALLPPUFILES
 ifdef INSTALLPPUFILES
 	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
 	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
@@ -800,21 +777,15 @@ ifdef EXTRAINSTALLFILES
 	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 endif
 
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 # Compress the exes if upx is defined
 ifdef UPXPROG
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
 endif
-endif
-ifdef LOADEROBJECTS
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
 endif
 ifdef INSTALLPPUFILES
 ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
 	$(MKDIR) $(UNITINSTALLDIR)
@@ -903,25 +874,25 @@ endif
 
 
 .PHONY: fpc_clean fpc_cleanall
 .PHONY: fpc_clean fpc_cleanall
 
 
-ifdef UNITPPUFILES
-override CLEANPPUFILES=$(UNITPPUFILES)
-endif
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 endif
 
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
 ifdef CLEANPPUFILES
 ifdef CLEANPPUFILES
 	-$(DEL) $(CLEANPPUFILES)
 	-$(DEL) $(CLEANPPUFILES)
-ifdef PPUFILES
-	-$(DEL) $(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
 endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 endif
 ifdef EXTRACLEANFILES
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 	-$(DEL) $(EXTRACLEANFILES)
@@ -929,22 +900,13 @@ endif
 	-$(DEL) $(PPAS) link.res log
 	-$(DEL) $(PPAS) link.res log
 
 
 fpc_cleanall:
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DEL) $(PPAS) link.res log
 	-$(DEL) $(PPAS) link.res log
 
 
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
-
 #####################################################################
 #####################################################################
 # Info rules
 # Info rules
 #####################################################################
 #####################################################################
@@ -1002,7 +964,6 @@ endif
 # Users rules
 # Users rules
 #####################################################################
 #####################################################################
 
 
-
 #####################################################################
 #####################################################################
 # Setup Targets
 # Setup Targets
 #####################################################################
 #####################################################################

+ 159 - 199
compiler/new/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-10 23:51
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 23:15
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -197,12 +197,18 @@ override NEEDOPT=-Sg
 ifndef FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 FPCDIR=../..
 endif
 endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
 override NEEDUNITDIR=$(CPU_TARGET) . $(OLDDIR)
 override NEEDUNITDIR=$(CPU_TARGET) . $(OLDDIR)
 override NEEDINCDIR=$(OLDDIR)
 override NEEDINCDIR=$(OLDDIR)
 ifndef TARGETDIR
 ifndef TARGETDIR
 TARGETDIR=.
 TARGETDIR=.
 endif
 endif
 
 
+# Packages
+
+
 # Libraries
 # Libraries
 
 
 
 
@@ -243,6 +249,11 @@ else
 BASEDIR=.
 BASEDIR=.
 endif
 endif
 
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
 ifdef inlinux
@@ -252,43 +263,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 endif
 endif
 
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 #####################################################################
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
@@ -300,16 +276,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 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
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
 ifdef inlinux
 ifdef inlinux
@@ -319,15 +285,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 endif
 endif
 
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
 endif
 endif
 
 
-# Where the .msg files will be stored
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
+endif
+
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
 endif
+endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
@@ -338,42 +317,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 endif
 endif
 
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 endif
 
 
 
 
@@ -389,7 +335,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
 
 
-
 ifdef NEEDOPT
 ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 override FPCOPT+=$(NEEDOPT)
 endif
 endif
@@ -417,8 +362,13 @@ override FPCOPT+=-FE$(TARGETDIR)
 endif
 endif
 
 
 # Smartlinking
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 endif
 
 
 # Add commandline options
 # Add commandline options
@@ -515,16 +465,6 @@ ifndef LD
 LD=ld
 LD=ld
 endif
 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
 # ppas.bat / ppas.sh
 ifdef inlinux
 ifdef inlinux
 PPAS=ppas.sh
 PPAS=ppas.sh
@@ -560,6 +500,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 endif
 endif
 
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 # upx uses that one itself (PFV)
 ifndef UPXPROG
 ifndef UPXPROG
@@ -721,27 +691,23 @@ endif
 # Default rules
 # Default rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 	clean cleanall depend info
 
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
 
-sharedlib: fpc_sharedlib
-
-showinstall: fpc_showinstall
+smart: fpc_smart
 
 
-staticinstall: fpc_staticinstall
+shared: fpc_shared
 
 
-sharedinstall: fpc_sharedinstall
-
-libinstall: fpc_libinstall
+showinstall: fpc_showinstall
 
 
 zipinstall: fpc_zipinstall
 zipinstall: fpc_zipinstall
 
 
 zipinstalladd: fpc_zipinstalladd
 zipinstalladd: fpc_zipinstalladd
 
 
-clean_all: fpc_clean_all
+cleanall: fpc_cleanall
 
 
 info: fpc_info
 info: fpc_info
 
 
@@ -749,31 +715,17 @@ info: fpc_info
 # General compile rules
 # General compile rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_all fpc_debug
 
 
-# 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))
+fpc_all: $(ALLTARGET)
 
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
-
-fpc_loaders: $(LOADEROFILES)
-
-fpc_units: $(UNITPPUFILES)
+# General compile rules, available for both possible PASEXT
 
 
-fpc_exes: $(EXEFILES)
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
 
 
-# General compile rules, available for both possible PASEXT
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
@@ -790,25 +742,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
 
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 #####################################################################
 # Library
 # Library
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 
 # Default sharedlib units are all unit objects
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 endif
 
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifdef inlinux
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
 	@$(ECHO) LIBNAME not set
@@ -823,54 +771,64 @@ endif
 # Install rules
 # Install rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 endif
 
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
 endif
 endif
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
 endif
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
+endif
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 endif
 
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 # Compress the exes if upx is defined
 ifdef UPXPROG
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 endif
 
 
 #####################################################################
 #####################################################################
@@ -942,48 +900,40 @@ endif
 # Clean rules
 # Clean rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 endif
 
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
+endif
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
 endif
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 endif
 ifdef EXTRACLEANFILES
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 endif
 	-$(DEL) $(PPAS) link.res log
 	-$(DEL) $(PPAS) link.res log
 
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 
 #####################################################################
 #####################################################################
 # Info rules
 # Info rules
@@ -1005,6 +955,20 @@ 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)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 
 fpc_infoinstall:
 fpc_infoinstall:
 	@$(ECHO)
 	@$(ECHO)
@@ -1017,21 +981,17 @@ endif
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 	@$(ECHO)
 
 
 #####################################################################
 #####################################################################
 # Users rules
 # Users rules
 #####################################################################
 #####################################################################
 
 
-
 #####################################################################
 #####################################################################
 # Setup Targets
 # Setup Targets
 #####################################################################
 #####################################################################

+ 79 - 724
ide/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-10 23:51
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 23:13
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -118,6 +118,7 @@ endif
 
 
 # Targets
 # Targets
 
 
+DIROBJECTS+=$(wildcard fake text)
 
 
 # Clean
 # Clean
 
 
@@ -130,772 +131,144 @@ endif
 
 
 # Directories
 # Directories
 
 
-
-# Libraries
-
-
-# Info
-
-FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall
-
-#####################################################################
-# Default Directories
-#####################################################################
-
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
-# set the prefix directory where to install everything
-ifndef PREFIXINSTALLDIR
-ifdef inlinux
-export PREFIXINSTALLDIR=/usr
-else
-export PREFIXINSTALLDIR=/pp
-endif
-endif
-
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
-#####################################################################
-# Install Directories based on BASEINSTALLDIR
-#####################################################################
-
-# set the base directory where to install everything
-ifndef BASEINSTALLDIR
-ifdef inlinux
-BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
-else
-BASEINSTALLDIR=$(PREFIXINSTALLDIR)
-endif
-endif
-
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
-# set the directory where to install the binaries
-ifndef BININSTALLDIR
-ifdef inlinux
-BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
-else
-BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
-endif
-endif
-
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
-endif
-
-# Where the .msg files will be stored
-ifndef SOURCEINSTALLDIR
-SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
-endif
-
-# Where the doc files will be stored
-ifndef DOCINSTALLDIR
-ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
-else
-DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
-endif
-endif
-
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
-endif
-
-
-#####################################################################
-# Compiler Command Line
-#####################################################################
-
-# Load commandline OPTDEF and add FPC_CPU define
-override FPCOPTDEF:=-d$(CPU_TARGET)
-
-# Load commandline OPT and add target and unit dir to be sure
-ifneq ($(OS_TARGET),$(OS_SOURCE))
-override FPCOPT+=-T$(OS_TARGET)
-endif
-
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
-# Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
-endif
-
-# Add commandline options
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-
-# Add defines from FPCOPTDEF to FPCOPT
-ifdef FPCOPTDEF
-override FPCOPT+=$(FPCOPTDEF)
-endif
-
-# Was a config file specified ?
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-
-override COMPILER=$(FPC) $(FPCOPT)
-
-#####################################################################
-# Shell tools
-#####################################################################
-
-# To copy pograms
-ifndef COPY
-export COPY:=cp -fp
-endif
-
-# To move pograms
-ifndef MOVE
-export MOVE:=mv -f
-endif
-
-# Check delete program
-ifndef DEL
-export DEL:=rm -f
-endif
-
-# Check deltree program
-ifndef DELTREE
-export DELTREE:=rm -rf
-endif
-
-# To install files
-ifndef INSTALL
-ifdef inlinux
-export INSTALL:=install -m 644
-else
-export INSTALL:=$(COPY)
-endif
-endif
-
-# To install programs
-ifndef INSTALLEXE
-ifdef inlinux
-export INSTALLEXE:=install -m 755
-else
-export INSTALLEXE:=$(COPY)
-endif
-endif
-
-# To make a directory.
-ifndef MKDIR
-ifdef inlinux
-export MKDIR:=install -m 755 -d
-else
-export MKDIR:=ginstall -m 755 -d
-endif
-endif
-
-#####################################################################
-# Default Tools
-#####################################################################
-
-# assembler, redefine it if cross compiling
-ifndef AS
-AS=as
-endif
-
-# linker, but probably not used
-ifndef LD
-LD=ld
-endif
-
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
-# ppas.bat / ppas.sh
-ifdef inlinux
-PPAS=ppas.sh
-else
-ifdef inOS2
-PPAS=ppas.cmd
-else
-PPAS=ppas.bat
-endif
-endif
-
-# also call ppas if with command option -s
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-EXECPPAS=@$(PPAS)
-endif
-
-# ldconfig to rebuild .so cache
-ifdef inlinux
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-export ECHO:=echo
-else
-export ECHO:=$(firstword $(ECHO))
-endif
-endif
-
-# Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
-# upx uses that one itself (PFV)
-ifndef UPXPROG
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG:=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG:=1
-endif
-ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(UPXPROG),)
-UPXPROG=
-else
-export UPXPROG:=$(firstword $(UPXPROG))
-endif
-else
-UPXPROG=
-endif
-endif
-
-# gdate/date
-ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-export DATE:=$(firstword $(DATE))
-endif
-else
-export DATE:=$(firstword $(DATE))
-endif
-endif
-
-ifdef DATE
-DATESTR:=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-
-# ZipProg, you can't use Zip as the var name (PFV)
-ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-export ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
-endif
-endif
-
-ifndef ZIPEXT
-ZIPEXT=.zip
-endif
-
-#####################################################################
-# Default extensions
-#####################################################################
-
-# Default needed extensions (Go32v2,Linux)
-LOADEREXT=.as
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-PACKAGESUFFIX=
-
-# Go32v1
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-PACKAGESUFFIX=v1
-endif
-
-# Go32v2
-ifeq ($(OS_TARGET),go32v2)
-PACKAGESUFFIX=go32
-endif
-
-# Linux
-ifeq ($(OS_TARGET),linux)
-PACKAGESUFFIX=linux
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
 endif
 endif
 
 
-# Win32
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
-endif
+# Packages
 
 
-# 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
+# Libraries
 
 
-# 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
 # Default rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 	clean cleanall depend info
 
 
-staticlib: fpc_staticlib
-
-sharedlib: fpc_sharedlib
+debug: $(addsuffix _debug,$(DIROBJECTS))
 
 
-showinstall: fpc_showinstall
+examples: $(addsuffix _examples,$(DIROBJECTS))
 
 
-staticinstall: fpc_staticinstall
+test: $(addsuffix _test,$(DIROBJECTS))
 
 
-sharedinstall: fpc_sharedinstall
+smart: $(addsuffix _smart,$(DIROBJECTS))
 
 
-libinstall: fpc_libinstall
+shared: $(addsuffix _shared,$(DIROBJECTS))
 
 
-zipinstalladd: fpc_zipinstalladd
+showinstall: $(addsuffix _showinstall,$(DIROBJECTS))
 
 
-clean_all: fpc_clean_all
+install: $(addsuffix _install,$(DIROBJECTS))
 
 
-depend: fpc_depend
+zipinstall: $(addsuffix _zipinstall,$(DIROBJECTS))
 
 
-info: fpc_info
+zipinstalladd: $(addsuffix _zipinstalladd,$(DIROBJECTS))
 
 
-#####################################################################
-# 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)
+clean: $(addsuffix _clean,$(DIROBJECTS))
 
 
-fpc_units: $(UNITPPUFILES)
+cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
 
 
-fpc_exes: $(EXEFILES)
+depend: $(addsuffix _depend,$(DIROBJECTS))
 
 
-# General compile rules, available for both possible PASEXT
-%$(PPUEXT): %.pp
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+info: $(addsuffix _info,$(DIROBJECTS))
 
 
-%$(PPUEXT): %.pas
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
 
 
-%$(EXEEXT): %.pp
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+# Dir fake
 
 
-%$(EXEEXT): %.pas
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+fake_all:
+	$(MAKE) -C fake all
 
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
+fake_debug:
+	$(MAKE) -C fake debug
 
 
-#####################################################################
-# Library
-#####################################################################
+fake_examples:
+	$(MAKE) -C fake examples
 
 
-.PHONY: fpc_staticlib fpc_sharedlib
+fake_test:
+	$(MAKE) -C fake test
 
 
-# Default sharedlib units are all unit objects
-ifndef SHAREDLIBUNITOBJECTS
-SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
-endif
+fake_smart:
+	$(MAKE) -C fake smart
 
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fake_shared:
+	$(MAKE) -C fake shared
 
 
-fpc_sharedlib: all
-ifdef inlinux
-ifndef LIBNAME
-	@$(ECHO) LIBNAME not set
-else
-	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
-endif
-else
-	@$(ECHO) Shared Libraries not supported
-endif
+fake_showinstall:
+	$(MAKE) -C fake showinstall
 
 
-#####################################################################
-# Install rules
-#####################################################################
+fake_install:
+	$(MAKE) -C fake install
 
 
-.PHONY: fpc_showinstallfiles fpc_install
+fake_zipinstall:
+	$(MAKE) -C fake zipinstall
 
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
-ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
-endif
+fake_zipinstalladd:
+	$(MAKE) -C fake zipinstalladd
 
 
-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
+fake_clean:
+	$(MAKE) -C fake clean
 
 
-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
+fake_cleanall:
+	$(MAKE) -C fake cleanall
 
 
-#####################################################################
-# Zip
-#####################################################################
+fake_depend:
+	$(MAKE) -C fake depend
 
 
-.PHONY: fpc_zipinstall fpc_zipinstalladd
+fake_info:
+	$(MAKE) -C fake info
 
 
-# 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
+# Dir text
 
 
-# Add .zip/.tar.gz extension
-ifdef ZIPNAME
-ifndef inlinux
-override ZIPNAME:=$(ZIPNAME)$(ZIPEXT)
-endif
-endif
+text_all:
+	$(MAKE) -C text all
 
 
-# Default target which is call before zipping
-ifndef ZIPTARGET
-ZIPTARGET=install
-endif
+text_debug:
+	$(MAKE) -C text debug
 
 
-# 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
+text_examples:
+	$(MAKE) -C text examples
 
 
-# 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
-#####################################################################
+text_test:
+	$(MAKE) -C text test
 
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+text_smart:
+	$(MAKE) -C text smart
 
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
-ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
-endif
+text_shared:
+	$(MAKE) -C text shared
 
 
-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
+text_showinstall:
+	$(MAKE) -C text showinstall
 
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+text_install:
+	$(MAKE) -C text install
 
 
-fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
+text_zipinstall:
+	$(MAKE) -C text zipinstall
 
 
-#####################################################################
-# Depend rules
-#####################################################################
+text_zipinstalladd:
+	$(MAKE) -C text zipinstalladd
 
 
-.PHONY: fpc_depend
+text_clean:
+	$(MAKE) -C text clean
 
 
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+text_cleanall:
+	$(MAKE) -C text cleanall
 
 
-#####################################################################
-# Info rules
-#####################################################################
+text_depend:
+	$(MAKE) -C text depend
 
 
-.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)
+text_info:
+	$(MAKE) -C text info
 
 
 #####################################################################
 #####################################################################
 # Users rules
 # Users rules
 #####################################################################
 #####################################################################
 
 
-
 .PHONY: gdb full fullgdb clean_compiler
 .PHONY: gdb full fullgdb clean_compiler
 
 
 all:
 all:
@@ -910,24 +283,6 @@ full:
 fullgdb:
 fullgdb:
 	$(MAKE) -C text all FULL=1 GDB=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
 	$(MAKE) -C text all FULL=1 GDB=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
 
 
-# This is necessary because we don't have all units separate in the
-# units targets
-clean:
-	$(MAKE) -C fake clean
-	$(MAKE) -C text clean
-
-
-#
-# Installation
-#
-install:
-	$(MAKE) -C fake install
-	$(MAKE) -C fake install
-
-zipinstall:
-	$(MAKE) -C fake zipinstall
-	$(MAKE) -C fake zipinstall
-
 #
 #
 # Misc
 # Misc
 #
 #

+ 11 - 23
ide/Makefile.fpc

@@ -2,41 +2,29 @@
 #   Makefile.fpc for FP IDE
 #   Makefile.fpc for FP IDE
 #
 #
 
 
+[targets]
+dirs=fake text
+
+[sections]
+none=1
+
 [rules]
 [rules]
 .PHONY: gdb full fullgdb clean_compiler
 .PHONY: gdb full fullgdb clean_compiler
 
 
 all:
 all:
-	$(MAKE) -C text all
+        $(MAKE) -C text all
 
 
 gdb:
 gdb:
-	$(MAKE) -C text all GDB=1
+        $(MAKE) -C text all GDB=1
 
 
 full:
 full:
-	$(MAKE) -C text all FULL=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
+        $(MAKE) -C text all FULL=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
 
 
 fullgdb:
 fullgdb:
-	$(MAKE) -C text all FULL=1 GDB=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
-
-# This is necessary because we don't have all units separate in the
-# units targets
-clean:
-	$(MAKE) -C fake clean
-	$(MAKE) -C text clean
-
-
-#
-# Installation
-#
-install:
-	$(MAKE) -C fake install
-	$(MAKE) -C fake install
-
-zipinstall:
-	$(MAKE) -C fake zipinstall
-	$(MAKE) -C fake zipinstall
+        $(MAKE) -C text all FULL=1 GDB=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
 
 
 #
 #
 # Misc
 # Misc
 #
 #
 clean_compiler:
 clean_compiler:
-	make -C ../../compiler clean
+        make -C ../../compiler clean

+ 80 - 722
ide/fake/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-10 23:51
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 23:13
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -118,6 +118,7 @@ endif
 
 
 # Targets
 # Targets
 
 
+DIROBJECTS+=$(wildcard compiler gdb)
 
 
 # Clean
 # Clean
 
 
@@ -130,782 +131,139 @@ endif
 
 
 # Directories
 # Directories
 
 
-
-# Libraries
-
-
-# Info
-
-FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
-
-#####################################################################
-# Default Directories
-#####################################################################
-
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
-# set the prefix directory where to install everything
-ifndef PREFIXINSTALLDIR
-ifdef inlinux
-export PREFIXINSTALLDIR=/usr
-else
-export PREFIXINSTALLDIR=/pp
-endif
-endif
-
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
-#####################################################################
-# Install Directories based on BASEINSTALLDIR
-#####################################################################
-
-# set the base directory where to install everything
-ifndef BASEINSTALLDIR
-ifdef inlinux
-BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
-else
-BASEINSTALLDIR=$(PREFIXINSTALLDIR)
-endif
-endif
-
-
-# Linux binary really goes to baseinstalldir
-ifndef LIBINSTALLDIR
-ifdef inlinux
-LIBINSTALLDIR=$(BASEINSTALLDIR)
-else
-LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
-endif
-endif
-
-# set the directory where to install the binaries
-ifndef BININSTALLDIR
-ifdef inlinux
-BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
-else
-BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
-endif
-endif
-
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
-endif
-
-# Where the .msg files will be stored
-ifndef SOURCEINSTALLDIR
-SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
-endif
-
-# Where the doc files will be stored
-ifndef DOCINSTALLDIR
-ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
-else
-DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
-endif
-endif
-
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
-endif
-
-
-#####################################################################
-# Compiler Command Line
-#####################################################################
-
-# Load commandline OPTDEF and add FPC_CPU define
-override FPCOPTDEF:=-d$(CPU_TARGET)
-
-# Load commandline OPT and add target and unit dir to be sure
-ifneq ($(OS_TARGET),$(OS_SOURCE))
-override FPCOPT+=-T$(OS_TARGET)
-endif
-
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
-# Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
-endif
-
-# Add commandline options
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-
-# Add defines from FPCOPTDEF to FPCOPT
-ifdef FPCOPTDEF
-override FPCOPT+=$(FPCOPTDEF)
-endif
-
-# Was a config file specified ?
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-
-override COMPILER=$(FPC) $(FPCOPT)
-
-#####################################################################
-# Shell tools
-#####################################################################
-
-# To copy pograms
-ifndef COPY
-export COPY:=cp -fp
-endif
-
-# To move pograms
-ifndef MOVE
-export MOVE:=mv -f
-endif
-
-# Check delete program
-ifndef DEL
-export DEL:=rm -f
-endif
-
-# Check deltree program
-ifndef DELTREE
-export DELTREE:=rm -rf
-endif
-
-# To install files
-ifndef INSTALL
-ifdef inlinux
-export INSTALL:=install -m 644
-else
-export INSTALL:=$(COPY)
-endif
-endif
-
-# To install programs
-ifndef INSTALLEXE
-ifdef inlinux
-export INSTALLEXE:=install -m 755
-else
-export INSTALLEXE:=$(COPY)
-endif
-endif
-
-# To make a directory.
-ifndef MKDIR
-ifdef inlinux
-export MKDIR:=install -m 755 -d
-else
-export MKDIR:=ginstall -m 755 -d
-endif
-endif
-
-#####################################################################
-# Default Tools
-#####################################################################
-
-# assembler, redefine it if cross compiling
-ifndef AS
-AS=as
-endif
-
-# linker, but probably not used
-ifndef LD
-LD=ld
-endif
-
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
-# Where is the ppdep program ?
-ifndef PPDEP
-PPDEP=ppdep
-endif
-
-# ppas.bat / ppas.sh
-ifdef inlinux
-PPAS=ppas.sh
-else
-ifdef inOS2
-PPAS=ppas.cmd
-else
-PPAS=ppas.bat
-endif
-endif
-
-# also call ppas if with command option -s
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-EXECPPAS=@$(PPAS)
-endif
-
-# ldconfig to rebuild .so cache
-ifdef inlinux
-LDCONFIG=ldconfig
-else
-LDCONFIG=
-endif
-
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-export ECHO:=echo
-else
-export ECHO:=$(firstword $(ECHO))
-endif
-endif
-
-# Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
-# upx uses that one itself (PFV)
-ifndef UPXPROG
-ifeq ($(OS_TARGET),go32v2)
-UPXPROG:=1
-endif
-ifeq ($(OS_TARGET),win32)
-UPXPROG:=1
-endif
-ifdef UPXPROG
-UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(UPXPROG),)
-UPXPROG=
-else
-export UPXPROG:=$(firstword $(UPXPROG))
-endif
-else
-UPXPROG=
-endif
-endif
-
-# gdate/date
-ifndef DATE
-DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(DATE),)
-DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
-ifeq ($(DATE),)
-DATE=
-else
-export DATE:=$(firstword $(DATE))
-endif
-else
-export DATE:=$(firstword $(DATE))
-endif
-endif
-
-ifdef DATE
-DATESTR:=$(shell $(DATE) +%Y%m%d)
-else
-DATESTR=
-endif
-
-# ZipProg, you can't use Zip as the var name (PFV)
-ifndef ZIPPROG
-ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ZIPPROG),)
-ZIPPROG=
-else
-export ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
-endif
-endif
-
-ifndef ZIPEXT
-ZIPEXT=.zip
-endif
-
-#####################################################################
-# Default extensions
-#####################################################################
-
-# Default needed extensions (Go32v2,Linux)
-LOADEREXT=.as
-PPLEXT=.ppl
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.so
-PACKAGESUFFIX=
-
-# Go32v1
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-PACKAGESUFFIX=v1
-endif
-
-# Go32v2
-ifeq ($(OS_TARGET),go32v2)
-PACKAGESUFFIX=go32
-endif
-
-# Linux
-ifeq ($(OS_TARGET),linux)
-PACKAGESUFFIX=linux
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
 endif
 endif
 
 
-# Win32
-ifeq ($(OS_TARGET),win32)
-PPUEXT=.ppw
-OEXT=.ow
-ASMEXT=.sw
-SMARTEXT=.slw
-STATICLIBEXT=.aw
-SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
-endif
+# Packages
 
 
-# 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
+# Libraries
 
 
-# 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
 # Default rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 	clean cleanall depend info
 
 
-staticlib: fpc_staticlib
-
-sharedlib: fpc_sharedlib
+all: $(addsuffix _all,$(DIROBJECTS))
 
 
-showinstall: fpc_showinstall
+debug: $(addsuffix _debug,$(DIROBJECTS))
 
 
-staticinstall: fpc_staticinstall
+examples: $(addsuffix _examples,$(DIROBJECTS))
 
 
-sharedinstall: fpc_sharedinstall
+test: $(addsuffix _test,$(DIROBJECTS))
 
 
-libinstall: fpc_libinstall
+smart: $(addsuffix _smart,$(DIROBJECTS))
 
 
-zipinstall: fpc_zipinstall
+shared: $(addsuffix _shared,$(DIROBJECTS))
 
 
-zipinstalladd: fpc_zipinstalladd
+showinstall: $(addsuffix _showinstall,$(DIROBJECTS))
 
 
-clean_all: fpc_clean_all
+install: $(addsuffix _install,$(DIROBJECTS))
 
 
-depend: fpc_depend
+zipinstall: $(addsuffix _zipinstall,$(DIROBJECTS))
 
 
-info: fpc_info
+zipinstalladd: $(addsuffix _zipinstalladd,$(DIROBJECTS))
 
 
-#####################################################################
-# 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)
+clean: $(addsuffix _clean,$(DIROBJECTS))
 
 
-fpc_units: $(UNITPPUFILES)
+cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
 
 
-fpc_exes: $(EXEFILES)
+depend: $(addsuffix _depend,$(DIROBJECTS))
 
 
-# General compile rules, available for both possible PASEXT
-%$(PPUEXT): %.pp
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+info: $(addsuffix _info,$(DIROBJECTS))
 
 
-%$(PPUEXT): %.pas
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
 
 
-%$(EXEEXT): %.pp
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+# Dir compiler
 
 
-%$(EXEEXT): %.pas
-	$(COMPILER) $< $(REDIR)
-	$(EXECPASS)
+compiler_all:
+	$(MAKE) -C compiler all
 
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
+compiler_debug:
+	$(MAKE) -C compiler debug
 
 
-#####################################################################
-# Library
-#####################################################################
+compiler_examples:
+	$(MAKE) -C compiler examples
 
 
-.PHONY: fpc_staticlib fpc_sharedlib
+compiler_test:
+	$(MAKE) -C compiler test
 
 
-# Default sharedlib units are all unit objects
-ifndef SHAREDLIBUNITOBJECTS
-SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
-endif
+compiler_smart:
+	$(MAKE) -C compiler smart
 
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+compiler_shared:
+	$(MAKE) -C compiler shared
 
 
-fpc_sharedlib: all
-ifdef inlinux
-ifndef LIBNAME
-	@$(ECHO) LIBNAME not set
-else
-	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
-endif
-else
-	@$(ECHO) Shared Libraries not supported
-endif
+compiler_showinstall:
+	$(MAKE) -C compiler showinstall
 
 
-#####################################################################
-# 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
+compiler_install:
+	$(MAKE) -C compiler install
 
 
-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
+compiler_zipinstall:
+	$(MAKE) -C compiler zipinstall
 
 
-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
+compiler_zipinstalladd:
+	$(MAKE) -C compiler zipinstalladd
 
 
-#####################################################################
-# Zip
-#####################################################################
+compiler_clean:
+	$(MAKE) -C compiler clean
 
 
-.PHONY: fpc_zipinstall fpc_zipinstalladd
+compiler_cleanall:
+	$(MAKE) -C compiler cleanall
 
 
-# Temporary path to pack a file
-ifndef PACKDIR
-ifndef inlinux
-PACKDIR=pack_tmp
-else
-PACKDIR=/tmp/fpc-pack
-endif
-endif
+compiler_depend:
+	$(MAKE) -C compiler depend
 
 
-# Test dir if none specified
-ifndef PACKAGEDIR
-PACKAGEDIR=$(BASEDIR)
-endif
+compiler_info:
+	$(MAKE) -C compiler info
 
 
-# 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
+# Dir gdb
 
 
-# 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
+gdb_all:
+	$(MAKE) -C gdb all
 
 
-#####################################################################
-# Clean rules
-#####################################################################
+gdb_debug:
+	$(MAKE) -C gdb debug
 
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+gdb_examples:
+	$(MAKE) -C gdb examples
 
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
-ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
-endif
+gdb_test:
+	$(MAKE) -C gdb test
 
 
-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
+gdb_smart:
+	$(MAKE) -C gdb smart
 
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+gdb_shared:
+	$(MAKE) -C gdb shared
 
 
-fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
-endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-	-$(DELTREE) *$(SMARTEXT)
+gdb_showinstall:
+	$(MAKE) -C gdb showinstall
 
 
-#####################################################################
-# Depend rules
-#####################################################################
+gdb_install:
+	$(MAKE) -C gdb install
 
 
-.PHONY: fpc_depend
+gdb_zipinstall:
+	$(MAKE) -C gdb zipinstall
 
 
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+gdb_zipinstalladd:
+	$(MAKE) -C gdb zipinstalladd
 
 
-#####################################################################
-# Info rules
-#####################################################################
-
-.PHONY: fpc_info fpc_cfginfo fpc_objectinfo fpc_toolsinfo fpc_installinfo \
-	fpc_dirinfo
-
-fpc_info: $(FPCINFO)
-
-fpc_infocfg:
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC....... $(FPC)
-	@$(ECHO)  Version... $(FPC_VERSION)
-	@$(ECHO)  CPU....... $(CPU_TARGET)
-	@$(ECHO)  Source.... $(OS_SOURCE)
-	@$(ECHO)  Target.... $(OS_TARGET)
-	@$(ECHO)
-
-
-fpc_infoinstall:
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-ifdef DATE
-	@$(ECHO)  DateStr.............. $(DATESTR)
-endif
-	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
-	@$(ECHO)
-	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
-	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
-	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
-	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)
-
-#####################################################################
-# Users rules
-#####################################################################
+gdb_clean:
+	$(MAKE) -C gdb clean
 
 
+gdb_cleanall:
+	$(MAKE) -C gdb cleanall
 
 
-all:
-	$(MAKE) -C compiler all
-	$(MAKE) -C gdb all
+gdb_depend:
+	$(MAKE) -C gdb depend
 
 
-clean :
-	$(MAKE) -C compiler clean
-	$(MAKE) -C gdb clean
+gdb_info:
+	$(MAKE) -C gdb info
 
 
-install:
-	$(MAKE) -C compiler install
-	$(MAKE) -C gdb install

+ 4 - 11
ide/fake/Makefile.fpc

@@ -2,15 +2,8 @@
 #   Makefile.fpc for Fake compiler/gdb
 #   Makefile.fpc for Fake compiler/gdb
 #
 #
 
 
-[rules]
-all:
-        $(MAKE) -C compiler all
-        $(MAKE) -C gdb all
+[targets]
+dirs=compiler gdb
 
 
-clean :
-        $(MAKE) -C compiler clean
-        $(MAKE) -C gdb clean
-
-install:
-        $(MAKE) -C compiler install
-        $(MAKE) -C gdb install
+[sections]
+none=1

+ 170 - 201
ide/fake/compiler/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-10 23:51
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 23:14
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -118,7 +118,7 @@ endif
 
 
 # Targets
 # Targets
 
 
-UNITOBJECTS=browcol compiler systems version comphook globtype tokens
+UNITOBJECTS+=browcol compiler systems version comphook globtype tokens
 
 
 # Clean
 # Clean
 
 
@@ -131,6 +131,12 @@ UNITOBJECTS=browcol compiler systems version comphook globtype tokens
 
 
 # Directories
 # Directories
 
 
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 
 # Libraries
 # Libraries
 
 
@@ -150,6 +156,11 @@ else
 BASEDIR=.
 BASEDIR=.
 endif
 endif
 
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
 ifdef inlinux
@@ -159,43 +170,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 endif
 endif
 
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 #####################################################################
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
@@ -207,16 +183,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 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
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
 ifdef inlinux
 ifdef inlinux
@@ -226,15 +192,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 endif
 endif
 
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
 endif
 endif
 
 
-# Where the .msg files will be stored
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
+endif
+
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
 endif
+endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
@@ -245,42 +224,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 endif
 endif
 
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 endif
 
 
 
 
@@ -296,14 +242,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
 
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
+# Smartlinking
+ifdef SMARTLINK
+override FPCOPT+=-CX
 endif
 endif
 
 
-# Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 endif
 
 
 # Add commandline options
 # Add commandline options
@@ -400,16 +346,6 @@ ifndef LD
 LD=ld
 LD=ld
 endif
 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
 # ppas.bat / ppas.sh
 ifdef inlinux
 ifdef inlinux
 PPAS=ppas.sh
 PPAS=ppas.sh
@@ -445,6 +381,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 endif
 endif
 
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 # upx uses that one itself (PFV)
 ifndef UPXPROG
 ifndef UPXPROG
@@ -586,67 +552,61 @@ endif
 # Default rules
 # Default rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 	clean cleanall depend info
 
 
 all: fpc_all
 all: fpc_all
 
 
-staticlib: fpc_staticlib
+debug: fpc_debug
+
+smart: fpc_smart
 
 
-sharedlib: fpc_sharedlib
+shared: fpc_shared
 
 
 showinstall: fpc_showinstall
 showinstall: fpc_showinstall
 
 
 install: fpc_install
 install: fpc_install
 
 
-staticinstall: fpc_staticinstall
-
-sharedinstall: fpc_sharedinstall
-
-libinstall: fpc_libinstall
-
 zipinstall: fpc_zipinstall
 zipinstall: fpc_zipinstall
 
 
 zipinstalladd: fpc_zipinstalladd
 zipinstalladd: fpc_zipinstalladd
 
 
 clean: fpc_clean
 clean: fpc_clean
 
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 
 info: fpc_info
 info: fpc_info
 
 
 #####################################################################
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# General compile rules
+#####################################################################
 
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_all fpc_debug
 
 
-fpc_units: $(UNITPPUFILES)
+fpc_all: $(ALLTARGET)
 
 
-fpc_exes: $(EXEFILES)
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 
 # General compile rules, available for both possible PASEXT
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
@@ -663,25 +623,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
 
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 #####################################################################
 # Library
 # Library
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 
 # Default sharedlib units are all unit objects
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 endif
 
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifdef inlinux
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
 	@$(ECHO) LIBNAME not set
@@ -696,54 +652,64 @@ endif
 # Install rules
 # Install rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 endif
 
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 endif
 
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 # Compress the exes if upx is defined
 ifdef UPXPROG
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 endif
 
 
 #####################################################################
 #####################################################################
@@ -815,48 +781,40 @@ endif
 # Clean rules
 # Clean rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 endif
 
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 endif
 ifdef EXTRACLEANFILES
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 endif
 	-$(DEL) $(PPAS) link.res log
 	-$(DEL) $(PPAS) link.res log
 
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 
 #####################################################################
 #####################################################################
 # Info rules
 # Info rules
@@ -878,6 +836,20 @@ 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)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 
 fpc_infoinstall:
 fpc_infoinstall:
 	@$(ECHO)
 	@$(ECHO)
@@ -890,13 +862,10 @@ endif
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 	@$(ECHO)
 
 

+ 170 - 202
ide/fake/gdb/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-10 23:51
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 23:14
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -118,7 +118,7 @@ endif
 
 
 # Targets
 # Targets
 
 
-UNITOBJECTS=gdbcon gdbint
+UNITOBJECTS+=gdbcon gdbint
 
 
 # Clean
 # Clean
 
 
@@ -131,6 +131,12 @@ UNITOBJECTS=gdbcon gdbint
 
 
 # Directories
 # Directories
 
 
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+
+# Packages
+
 
 
 # Libraries
 # Libraries
 
 
@@ -150,6 +156,11 @@ else
 BASEDIR=.
 BASEDIR=.
 endif
 endif
 
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
 ifdef inlinux
@@ -159,43 +170,8 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 endif
 endif
 
 
-# set the directory to the rtl base
-ifndef RTLDIR
-ifdef RTL
-RTLDIR:=$(RTL)/$(OS_TARGET)
-else
-RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
-endif
-endif
-
-# specify where units are.
-ifndef UNITDIR
-ifdef UNITS
-UNITDIR=$(UNITS)/$(OS_TARGET)
-else
-UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-endif
-ifeq ($(strip $(wildcard $(UNITDIR)/*)),)
-UNITDIR=
-endif
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 #####################################################################
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
@@ -207,16 +183,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 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
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
 ifdef inlinux
 ifdef inlinux
@@ -226,15 +192,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 endif
 endif
 
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
 endif
 endif
 
 
-# Where the .msg files will be stored
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
 endif
+endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
@@ -245,42 +224,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 endif
 endif
 
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 endif
 
 
 
 
@@ -296,14 +242,14 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
 
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
+# Smartlinking
+ifdef SMARTLINK
+override FPCOPT+=-CX
 endif
 endif
 
 
-# Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 endif
 
 
 # Add commandline options
 # Add commandline options
@@ -400,16 +346,6 @@ ifndef LD
 LD=ld
 LD=ld
 endif
 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
 # ppas.bat / ppas.sh
 ifdef inlinux
 ifdef inlinux
 PPAS=ppas.sh
 PPAS=ppas.sh
@@ -445,6 +381,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 endif
 endif
 
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 # upx uses that one itself (PFV)
 ifndef UPXPROG
 ifndef UPXPROG
@@ -586,67 +552,61 @@ endif
 # Default rules
 # Default rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 	clean cleanall depend info
 
 
 all: fpc_all
 all: fpc_all
 
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
 
-sharedlib: fpc_sharedlib
+smart: fpc_smart
+
+shared: fpc_shared
 
 
 showinstall: fpc_showinstall
 showinstall: fpc_showinstall
 
 
 install: fpc_install
 install: fpc_install
 
 
-staticinstall: fpc_staticinstall
-
-sharedinstall: fpc_sharedinstall
-
-libinstall: fpc_libinstall
-
 zipinstall: fpc_zipinstall
 zipinstall: fpc_zipinstall
 
 
 zipinstalladd: fpc_zipinstalladd
 zipinstalladd: fpc_zipinstalladd
 
 
 clean: fpc_clean
 clean: fpc_clean
 
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 
 info: fpc_info
 info: fpc_info
 
 
 #####################################################################
 #####################################################################
-# General compile rules
+# Units
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
 
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
-EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
 UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
 
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_units: $(UNITPPUFILES)
 
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+#####################################################################
+# General compile rules
+#####################################################################
 
 
-fpc_loaders: $(LOADEROFILES)
+.PHONY: fpc_all fpc_debug
 
 
-fpc_units: $(UNITPPUFILES)
+fpc_all: $(ALLTARGET)
 
 
-fpc_exes: $(EXEFILES)
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 
 # General compile rules, available for both possible PASEXT
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
@@ -663,25 +623,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
 
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 #####################################################################
 # Library
 # Library
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 
 # Default sharedlib units are all unit objects
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 endif
 
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifdef inlinux
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
 	@$(ECHO) LIBNAME not set
@@ -696,54 +652,64 @@ endif
 # Install rules
 # Install rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 endif
 
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 endif
 
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 # Compress the exes if upx is defined
 ifdef UPXPROG
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 endif
 
 
 #####################################################################
 #####################################################################
@@ -815,48 +781,40 @@ endif
 # Clean rules
 # Clean rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 endif
 
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 endif
 ifdef EXTRACLEANFILES
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 endif
 	-$(DEL) $(PPAS) link.res log
 	-$(DEL) $(PPAS) link.res log
 
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 
 #####################################################################
 #####################################################################
 # Info rules
 # Info rules
@@ -878,6 +836,20 @@ 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)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 
 fpc_infoinstall:
 fpc_infoinstall:
 	@$(ECHO)
 	@$(ECHO)
@@ -890,21 +862,17 @@ endif
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 	@$(ECHO)
 
 
 #####################################################################
 #####################################################################
 # Users rules
 # Users rules
 #####################################################################
 #####################################################################
 
 
-
 gdbint$(PPUEXT): gdbint$(PASEXT)
 gdbint$(PPUEXT): gdbint$(PASEXT)
 
 
 gdbcon$(PPUEXT): gdbcon$(PASEXT) gdbint$(PPUEXT)
 gdbcon$(PPUEXT): gdbcon$(PASEXT) gdbint$(PPUEXT)

+ 182 - 204
ide/text/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-11-10 23:51
+# Makefile generated by fpcmake v0.99.13 on 1999-11-24 23:10
 #
 #
 
 
 defaultrule: all
 defaultrule: all
@@ -121,7 +121,7 @@ endif
 # when making a full version include the compiler
 # when making a full version include the compiler
 ifeq ($(FULL),1)
 ifeq ($(FULL),1)
 override COMPUNITDIR+=../../compiler
 override COMPUNITDIR+=../../compiler
-override NEEDOPT+=-Sg -dGDB -dBROWSERCOL
+override NEEDOPT+=-dBrowserCol -dGDB -Sg
 else
 else
 override COMPUNITDIR+=../fake/compiler
 override COMPUNITDIR+=../fake/compiler
 endif
 endif
@@ -132,9 +132,9 @@ GDBINT=gdbint
 endif
 endif
 
 
 ifeq ($(GDB),1)
 ifeq ($(GDB),1)
-override GDBUNITDIR+=../../$(GDBINT)
-GDBLIBDIR+=../../$(GDBINT)/libgdb/$(OS_TARGET)
-GDBOBJDIR+=../../$(GDBINT)/libgdb/$(OS_TARGET)
+override GDBUNITDIR+=$(PACKAGEDIR)/$(GDBINT)
+GDBLIBDIR+=$(PACKAGEDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
+GDBOBJDIR+=$(PACKAGEDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
 ifeq ($(OS_TARGET),go32v2)
 ifeq ($(OS_TARGET),go32v2)
 ifneq ($(DJDIR),)
 ifneq ($(DJDIR),)
 GDBLIBDIR+=$(DJDIR)/lib
 GDBLIBDIR+=$(DJDIR)/lib
@@ -146,7 +146,7 @@ endif
 
 
 # Targets
 # Targets
 
 
-EXEOBJECTS=fp
+EXEOBJECTS+=fp
 
 
 # Clean
 # Clean
 
 
@@ -162,17 +162,25 @@ EXEOBJECTS=fp
 ifndef FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 FPCDIR=../..
 endif
 endif
-override NEEDUNITDIR=../../fv ../../api $(COMPUNITDIR) $(GDBUNITDIR)
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+override NEEDUNITDIR=$(COMPUNITDIR) $(GDBUNITDIR)
 override NEEDLIBDIR=$(GDBLIBDIR)
 override NEEDLIBDIR=$(GDBLIBDIR)
 override NEEDOBJDIR=$(GDBOBJDIR)
 override NEEDOBJDIR=$(GDBOBJDIR)
 
 
+# Packages
+
+PACKAGES=api fv
+override NEEDUNITDIR+=$(addprefix $(PACKAGEDIR)/,$(PACKAGES))
+
 # Libraries
 # Libraries
 
 
 override NEEDGCCLIB=1
 override NEEDGCCLIB=1
 
 
 # Info
 # Info
 
 
-FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall
+FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
 
 #####################################################################
 #####################################################################
 # Default Directories
 # Default Directories
@@ -185,6 +193,11 @@ else
 BASEDIR=.
 BASEDIR=.
 endif
 endif
 
 
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
 ifdef inlinux
@@ -194,27 +207,6 @@ export PREFIXINSTALLDIR=/pp
 endif
 endif
 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.
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
 ifdef inlinux
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
@@ -222,15 +214,8 @@ export GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 }
 endif
 endif
 endif
 endif
 
 
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-export OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-
 #####################################################################
 #####################################################################
-# Install Directories based on BASEINSTALLDIR
+# Install Directories
 #####################################################################
 #####################################################################
 
 
 # set the base directory where to install everything
 # set the base directory where to install everything
@@ -242,16 +227,6 @@ BASEINSTALLDIR=$(PREFIXINSTALLDIR)
 endif
 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
 # set the directory where to install the binaries
 ifndef BININSTALLDIR
 ifndef BININSTALLDIR
 ifdef inlinux
 ifdef inlinux
@@ -261,15 +236,28 @@ BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
 endif
 endif
 endif
 endif
 
 
-# Where the .msg files will be stored
-ifndef MSGINSTALLDIR
-MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
 endif
 endif
 
 
-# Where the .msg files will be stored
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
+endif
+
+# Where the source files will be stored
 ifndef SOURCEINSTALLDIR
 ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
 endif
 endif
+endif
 
 
 # Where the doc files will be stored
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifndef DOCINSTALLDIR
@@ -280,42 +268,9 @@ DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 endif
 endif
 
 
-########################
-# Unit Directories
-########################
-
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
-endif
-
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
-endif
-
-# set the directory where to install the units.
-ifndef STATIC_UNITINSTALLDIR
-STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
-endif
-
-# set the directory where to install the units.
-ifndef SHARED_UNITINSTALLDIR
-SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef STATIC_LIBINSTALLDIR
-STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
-endif
-
-# set the directory where to install the libs (must exist)
-ifndef SHARED_LIBINSTALLDIR
-ifdef inlinux
-SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
-else
-SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
-endif
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 endif
 
 
 
 
@@ -331,11 +286,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
 
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 # RTL first and then Unit dir (a unit can override RTLunit). Don't add the
 # 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
 # dirs if fpcdir=. which can be used for the rtl makefiles
 ifdef FPCDIR
 ifdef FPCDIR
@@ -362,8 +312,13 @@ override FPCOPT+=-Fl$(GCCLIBDIR)
 endif
 endif
 
 
 # Smartlinking
 # Smartlinking
-ifeq ($(SMARTLINK),YES)
-override FPCOPT+=-Cx
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
 endif
 endif
 
 
 # Add commandline options
 # Add commandline options
@@ -460,16 +415,6 @@ ifndef LD
 LD=ld
 LD=ld
 endif
 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
 # ppas.bat / ppas.sh
 ifdef inlinux
 ifdef inlinux
 PPAS=ppas.sh
 PPAS=ppas.sh
@@ -505,6 +450,36 @@ export ECHO:=$(firstword $(ECHO))
 endif
 endif
 endif
 endif
 
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
 # upx uses that one itself (PFV)
 ifndef UPXPROG
 ifndef UPXPROG
@@ -646,63 +621,58 @@ endif
 # Default rules
 # Default rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: defaultrule all staticlib sharedlib showinstall install \
-	staticinstall sharedinstall libinstall zipinstall zipinstalladd \
+.PHONY: defaultrule all debug examples test smart shared \
+	showinstall install zipinstall zipinstalladd \
 	clean cleanall depend info
 	clean cleanall depend info
 
 
 all: fpc_all
 all: fpc_all
 
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
 
-sharedlib: fpc_sharedlib
+smart: fpc_smart
 
 
-showinstall: fpc_showinstall
+shared: fpc_shared
 
 
-staticinstall: fpc_staticinstall
-
-sharedinstall: fpc_sharedinstall
-
-libinstall: fpc_libinstall
+showinstall: fpc_showinstall
 
 
 zipinstall: fpc_zipinstall
 zipinstall: fpc_zipinstall
 
 
 zipinstalladd: fpc_zipinstalladd
 zipinstalladd: fpc_zipinstalladd
 
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 
 info: fpc_info
 info: fpc_info
 
 
 #####################################################################
 #####################################################################
-# General compile rules
+# Exes
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_all fpc_units fpc_exes fpc_loaders
+.PHONY: fpc_exes
 
 
-# Create Filenames
-LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS))
 EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
 EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
 EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
-UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
-UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
 
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
 
 
-ifdef DEFAULTUNITS
-fpc_all: fpc_loaders fpc_units
-else
-fpc_all: fpc_loaders fpc_units fpc_exes
-endif
+fpc_exes: $(EXEFILES)
 
 
-fpc_loaders: $(LOADEROFILES)
+#####################################################################
+# General compile rules
+#####################################################################
 
 
-fpc_units: $(UNITPPUFILES)
+.PHONY: fpc_all fpc_debug
 
 
-fpc_exes: $(EXEFILES)
+fpc_all: $(ALLTARGET)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
 
 
 # General compile rules, available for both possible PASEXT
 # General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
@@ -719,25 +689,21 @@ fpc_exes: $(EXEFILES)
 	$(COMPILER) $< $(REDIR)
 	$(COMPILER) $< $(REDIR)
 	$(EXECPASS)
 	$(EXECPASS)
 
 
-%$(OEXT): %$(LOADEREXT)
-	$(AS) -o $*$(OEXT) $<
-
 #####################################################################
 #####################################################################
 # Library
 # Library
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_staticlib fpc_sharedlib
+.PHONY: fpc_smart fpc_shared
 
 
 # Default sharedlib units are all unit objects
 # Default sharedlib units are all unit objects
 ifndef SHAREDLIBUNITOBJECTS
 ifndef SHAREDLIBUNITOBJECTS
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 SHAREDLIBUNITOBJECTS=$(UNITOBJECTS)
 endif
 endif
 
 
-fpc_staticlib:
-	$(MAKE) libsclean
-	$(MAKE) all SMARTLINK=YES
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
 
 
-fpc_sharedlib: all
+fpc_shared: all
 ifdef inlinux
 ifdef inlinux
 ifndef LIBNAME
 ifndef LIBNAME
 	@$(ECHO) LIBNAME not set
 	@$(ECHO) LIBNAME not set
@@ -752,54 +718,64 @@ endif
 # Install rules
 # Install rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_showinstallfiles fpc_install
+.PHONY: fpc_showinstall fpc_install
 
 
-ifdef UNITOBJECTS
-override UNITINSTALLFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRAINSTALLUNITS
 ifdef EXTRAINSTALLUNITS
-override EXTRAINSTALLFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRAINSTALLUNITS)) $(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS)))
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
 endif
 endif
 
 
-fpc_showinstallfiles : all
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(EXEFILES))
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
 endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
 endif
-ifdef LOADEROBJECTS
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES))
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
 endif
-ifdef UNITINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(UNITINSTALLFILES))
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 endif
 
 
-fpc_install:
+fpc_install: $(INSTALLTARGET)
 # Create UnitInstallFiles
 # Create UnitInstallFiles
-ifndef DEFAULTUNITS
-ifdef EXEOBJECTS
+ifdef INSTALLEXEFILES
 	$(MKDIR) $(BININSTALLDIR)
 	$(MKDIR) $(BININSTALLDIR)
 # Compress the exes if upx is defined
 # Compress the exes if upx is defined
 ifdef UPXPROG
 ifdef UPXPROG
-	-$(UPXPROG) $(EXEFILES)
-endif
-	$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
+	-$(UPXPROG) $(INSTALLEXEFILES)
 endif
 endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
 endif
 endif
-ifdef LOADEROBJECTS
+ifdef INSTALLPPUFILES
 	$(MKDIR) $(UNITINSTALLDIR)
 	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
 endif
 endif
-ifdef UNITINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(UNITINSTALLFILES) $(UNITINSTALLDIR)
 endif
 endif
 ifdef EXTRAINSTALLFILES
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(UNITINSTALLDIR)
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 endif
 
 
 #####################################################################
 #####################################################################
@@ -871,48 +847,40 @@ endif
 # Clean rules
 # Clean rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_clean fpc_libsclean fpc_cleanall
+.PHONY: fpc_clean fpc_cleanall
 
 
-ifdef UNITOBJECTS
-override UNITCLEANFILES=$(wildcard $(UNITPPUFILES) $(UNITOFILES) $(UNITAFILES))
-endif
 ifdef EXTRACLEANUNITS
 ifdef EXTRACLEANUNITS
-override EXTRACLEANFILES+=$(wildcard $(addsuffix $(OEXT),$(EXTRACLEANUNITS)) $(addsuffix $(STATICLIBEXT),$(EXTRACLEANUNITS)) $(addsuffix $(PPUEXT),$(EXTRACLEANUNITS)))
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
 endif
 endif
 
 
-fpc_clean:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES) $(EXEOFILES)
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES=$(shell $(PPUFILES) $(CLEANPPUFILES))
 endif
 endif
-ifdef LOADEROBJECTS
-	-$(DEL) $(LOADEROFILES)
 endif
 endif
-ifdef UNITCLEANFILES
-	-$(DEL) $(UNITCLEANFILES)
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
 endif
 endif
 ifdef EXTRACLEANFILES
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 	-$(DEL) $(EXTRACLEANFILES)
 endif
 endif
 	-$(DEL) $(PPAS) link.res log
 	-$(DEL) $(PPAS) link.res log
 
 
-fpc_libsclean: clean
-	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-
 fpc_cleanall:
 fpc_cleanall:
-ifdef EXEOBJECTS
-	-$(DEL) $(EXEFILES)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
 endif
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DELTREE) *$(SMARTEXT)
-
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
+	-$(DEL) $(PPAS) link.res log
 
 
 #####################################################################
 #####################################################################
 # Info rules
 # Info rules
@@ -934,6 +902,20 @@ 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)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
 
 
 fpc_infoinstall:
 fpc_infoinstall:
 	@$(ECHO)
 	@$(ECHO)
@@ -946,21 +928,17 @@ endif
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
 	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
-	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
-	@$(ECHO)  StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR)
-	@$(ECHO)  SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
 	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
-	@$(ECHO)  StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR)
-	@$(ECHO)  SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR)
-	@$(ECHO)  MsgInstallDir........ $(MSGINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 	@$(ECHO)
 
 
 #####################################################################
 #####################################################################
 # Users rules
 # Users rules
 #####################################################################
 #####################################################################
 
 
-
 .PHONY: gdb full fullgdb clean_compiler
 .PHONY: gdb full fullgdb clean_compiler
 
 
 fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
 fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
@@ -969,14 +947,14 @@ gdb:
 	$(MAKE) all GDB=1
 	$(MAKE) all GDB=1
 
 
 full:
 full:
-	$(MAKE) all FULL=1 
+	$(MAKE) all FULL=1 NEEDOPT=-Sg
 
 
 fullgdb:
 fullgdb:
-	$(MAKE) all FULL=1 GDB=1 
+	$(MAKE) all FULL=1 GDB=1 NEEDOPT=-Sg
 
 
 # This is necessary because we don't have all units separate in the
 # This is necessary because we don't have all units separate in the
 # units targets
 # units targets
-clean : fpc_cleanall
+clean: fpc_cleanall
 
 
 #
 #
 # Installation
 # Installation

+ 13 - 10
ide/text/Makefile.fpc

@@ -7,10 +7,13 @@ programs=fp
 
 
 [dirs]
 [dirs]
 fpcdir=../..
 fpcdir=../..
-unitdir=../../fv ../../api $(COMPUNITDIR) $(GDBUNITDIR)
+unitdir=$(COMPUNITDIR) $(GDBUNITDIR)
 objdir=$(GDBOBJDIR)
 objdir=$(GDBOBJDIR)
 libdir=$(GDBLIBDIR)
 libdir=$(GDBLIBDIR)
 
 
+[packages]
+packages=api fv
+
 [libs]
 [libs]
 libgcc=1
 libgcc=1
 
 
@@ -30,9 +33,9 @@ GDBINT=gdbint
 endif
 endif
 
 
 ifeq ($(GDB),1)
 ifeq ($(GDB),1)
-override GDBUNITDIR+=../../$(GDBINT)
-GDBLIBDIR+=../../$(GDBINT)/libgdb/$(OS_TARGET)
-GDBOBJDIR+=../../$(GDBINT)/libgdb/$(OS_TARGET)
+override GDBUNITDIR+=$(PACKAGEDIR)/$(GDBINT)
+GDBLIBDIR+=$(PACKAGEDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
+GDBOBJDIR+=$(PACKAGEDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
 ifeq ($(OS_TARGET),go32v2)
 ifeq ($(OS_TARGET),go32v2)
 ifneq ($(DJDIR),)
 ifneq ($(DJDIR),)
 GDBLIBDIR+=$(DJDIR)/lib
 GDBLIBDIR+=$(DJDIR)/lib
@@ -49,26 +52,26 @@ endif
 fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
 fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
 
 
 gdb:
 gdb:
-	$(MAKE) all GDB=1
+        $(MAKE) all GDB=1
 
 
 full:
 full:
-	$(MAKE) all FULL=1 NEEDOPT=-Sg
+        $(MAKE) all FULL=1 NEEDOPT=-Sg
 
 
 fullgdb:
 fullgdb:
-	$(MAKE) all FULL=1 GDB=1 NEEDOPT=-Sg
+        $(MAKE) all FULL=1 GDB=1 NEEDOPT=-Sg
 
 
 # This is necessary because we don't have all units separate in the
 # This is necessary because we don't have all units separate in the
 # units targets
 # units targets
-clean : testfpcmake fpc_cleanall
+clean: fpc_cleanall
 
 
 #
 #
 # Installation
 # Installation
 #
 #
 install: fpc_install
 install: fpc_install
-	$(INSTALL) $(wildcard *.pt) $(wildcard *.tdf) readme.txt $(BININSTALLDIR)
+        $(INSTALL) $(wildcard *.pt) $(wildcard *.tdf) readme.txt $(BININSTALLDIR)
 
 
 #
 #
 # Misc
 # Misc
 #
 #
 clean_compiler:
 clean_compiler:
-	$(MAKE) -C ../../compiler clean
+        $(MAKE) -C ../../compiler clean