Browse Source

* regenerated, win32 uses fpcext.cmd file to pass options instead of
environment
* packagename support

peter 25 years ago
parent
commit
55ce17b756
60 changed files with 6679 additions and 5056 deletions
  1. 76 46
      api/Makefile
  2. 118 92
      api/go32v2/Makefile
  3. 118 92
      api/linux/Makefile
  4. 118 92
      api/win32/Makefile
  5. 87 71
      base/Makefile
  6. 161 134
      compiler/Makefile
  7. 161 134
      compiler/new/Makefile
  8. 76 46
      fcl/Makefile
  9. 110 86
      fcl/db/Makefile
  10. 125 99
      fcl/go32v2/Makefile
  11. 125 99
      fcl/linux/Makefile
  12. 125 99
      fcl/os2/Makefile
  13. 109 85
      fcl/shedit/gtk/Makefile
  14. 113 89
      fcl/tests/Makefile
  15. 125 99
      fcl/win32/Makefile
  16. 76 46
      ide/Makefile
  17. 76 46
      ide/fake/Makefile
  18. 105 81
      ide/fake/compiler/Makefile
  19. 105 81
      ide/fake/gdb/Makefile
  20. 146 119
      ide/text/Makefile
  21. 188 210
      install/Makefile
  22. 113 87
      install/demo/Makefile
  23. 105 81
      install/fpinst/Makefile
  24. 275 189
      packages/Makefile
  25. 5 4
      packages/Makefile.fpc
  26. 109 85
      packages/forms/Makefile
  27. 114 90
      packages/forms/demo/Makefile
  28. 106 82
      packages/gdbint/Makefile
  29. 76 46
      packages/gdbint/libgdb/Makefile
  30. 105 81
      packages/ggi/Makefile
  31. 106 82
      packages/gtk/Makefile
  32. 107 83
      packages/gtk/examples/Makefile
  33. 107 83
      packages/gtk/tutorial/Makefile
  34. 105 81
      packages/ibase/Makefile
  35. 105 81
      packages/inet/Makefile
  36. 105 81
      packages/mysql/Makefile
  37. 105 81
      packages/ncurses/Makefile
  38. 76 46
      packages/opengl/Makefile
  39. 105 81
      packages/opengl/build/Makefile
  40. 114 90
      packages/opengl/examples/Makefile
  41. 109 85
      packages/opengl/linux/Makefile
  42. 105 81
      packages/paszlib/Makefile
  43. 105 81
      packages/postgres/Makefile
  44. 105 81
      packages/svgalib/Makefile
  45. 105 81
      packages/uncgi/Makefile
  46. 105 81
      packages/utmp/Makefile
  47. 105 81
      packages/x11/Makefile
  48. 105 81
      packages/zlib/Makefile
  49. 76 46
      rtl/Makefile
  50. 100 67
      rtl/go32v1/Makefile
  51. 101 68
      rtl/go32v2/Makefile
  52. 109 76
      rtl/linux/Makefile
  53. 100 67
      rtl/os2/Makefile
  54. 105 72
      rtl/win32/Makefile
  55. 77 47
      tests/Makefile
  56. 121 97
      utils/Makefile
  57. 236 133
      utils/fprcp/Makefile
  58. 105 81
      utils/h2pas/Makefile
  59. 105 81
      utils/simulator/Makefile
  60. 114 89
      utils/tply/Makefile

+ 76 - 46
api/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -188,6 +184,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -211,8 +228,23 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
+#####################################################################
+# Redirection
+#####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
 
 #####################################################################
 # Standard rules
@@ -251,16 +283,6 @@ info: $(addsuffix _info,$(OS_TARGET))
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall require info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -272,7 +294,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 
 # Target Dirs
@@ -538,3 +560,11 @@ test_info:
 	$(MAKE) -C test info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+

+ 118 - 92
api/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,21 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+INC=../inc
+
+# Override defaults
+override PASEXT=.pas
+
+include ../test/Makefile.api
+include $(INC)/Makefile.api
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,61 +170,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-INC=../inc
-
-# Override defaults
-override PASEXT=.pas
-
-include ../test/Makefile.api
-include $(INC)/Makefile.api
-
 # Targets
 
 override UNITOBJECTS+=$(APIOBJECTS) vesamode
@@ -203,6 +200,7 @@ override EXAMPLEOBJECTS+=$(TESTOBJECTS)
 # Install
 
 UNITSUBDIR=api
+PACKAGENAME=api
 ZIPTARGET=install
 
 # Defaults
@@ -218,6 +216,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+LIBNAME=fpapi
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -241,25 +265,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-LIBNAME=fpapi
-
-# Info
-
-INFOTARGET=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
@@ -332,6 +341,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -365,7 +392,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -410,11 +437,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -517,17 +543,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -669,7 +684,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -743,16 +758,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -764,7 +769,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -799,14 +804,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -952,6 +957,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1077,6 +1089,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1088,6 +1103,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 118 - 92
api/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,21 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+INC=../inc
+
+# Override defaults
+override PASEXT=.pas
+
+include ../test/Makefile.api
+include $(INC)/Makefile.api
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,61 +170,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-INC=../inc
-
-# Override defaults
-override PASEXT=.pas
-
-include ../test/Makefile.api
-include $(INC)/Makefile.api
-
 # Targets
 
 override UNITOBJECTS+=terminfo $(APIOBJECTS)
@@ -203,6 +200,7 @@ override EXAMPLEOBJECTS+=$(TESTOBJECTS)
 # Install
 
 UNITSUBDIR=api
+PACKAGENAME=api
 ZIPTARGET=install
 
 # Defaults
@@ -218,6 +216,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+LIBNAME=fpapi
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -241,25 +265,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-LIBNAME=fpapi
-
-# Info
-
-INFOTARGET=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
@@ -332,6 +341,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -365,7 +392,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -410,11 +437,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -517,17 +543,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -669,7 +684,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -743,16 +758,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -764,7 +769,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -799,14 +804,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -952,6 +957,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1077,6 +1089,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1088,6 +1103,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 118 - 92
api/win32/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,21 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+INC=../inc
+
+# Override defaults
+override PASEXT=.pas
+
+include ../test/Makefile.api
+include $(INC)/Makefile.api
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,61 +170,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-INC=../inc
-
-# Override defaults
-override PASEXT=.pas
-
-include ../test/Makefile.api
-include $(INC)/Makefile.api
-
 # Targets
 
 override UNITOBJECTS+=event $(APIOBJECTS)
@@ -203,6 +200,7 @@ override EXAMPLEOBJECTS+=$(TESTOBJECTS)
 # Install
 
 UNITSUBDIR=api
+PACKAGENAME=api
 ZIPTARGET=install
 
 # Defaults
@@ -218,6 +216,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+LIBNAME=fpapi
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -241,25 +265,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-LIBNAME=fpapi
-
-# Info
-
-INFOTARGET=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
@@ -332,6 +341,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -365,7 +392,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -410,11 +437,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -517,17 +543,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -669,7 +684,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -743,16 +758,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -764,7 +769,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -799,14 +804,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -952,6 +957,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1077,6 +1089,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1088,6 +1103,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 87 - 71
base/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: info
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -196,6 +192,33 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+#####################################################################
+# Post Settings
+#####################################################################
+
+export RELEASE=1
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -219,24 +242,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Post Settings
-
-export RELEASE=1
-
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -309,6 +318,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 #####################################################################
 # Shell tools
 #####################################################################
@@ -406,17 +433,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -558,7 +574,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -628,16 +644,6 @@ require: $(addsuffix _require,$(DIROBJECTS))
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall require
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -649,7 +655,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 
 # Target Dirs
@@ -1071,6 +1077,14 @@ ide_info:
 	$(MAKE) -C ide info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+
 #####################################################################
 # Users rules
 #####################################################################
@@ -1135,7 +1149,9 @@ man_install:
 # Packaging targets
 #######################################
 
+ifndef DESTZIPDIR
 export DESTZIPDIR:=$(BASEDIR)
+endif
 
 idezips: clean ide_allzip ide_gdbzip ide_fullzip ide_fullgdbzip
 

+ 161 - 134
compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,79 +122,9 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Test FPCDIR to look if the RTL dir exists
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=wrong
-endif
-else
-override FPCDIR=wrong
-endif
-
-# Default FPCDIR
-ifeq ($(FPCDIR),wrong)
-override FPCDIR=..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=wrong
-endif
-endif
-
-# Detect FPCDIR
-ifeq ($(FPCDIR),wrong)
-ifdef inlinux
-override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
-else
-override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
-endif
-endif
-
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
-# Create units dir
-ifneq ($(FPCDIR),.)
-UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
 #####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
-#####################################################################
-# User Settings
-#####################################################################
-
-
 # Pre Settings
+#####################################################################
 
 # Don't export OS_SOURCE because it can change after the first compile
 unexport OS_SOURCE
@@ -223,6 +171,55 @@ endif
 
 # Message files
 MSGFILES=$(wildcard error*.msg)
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),wrong)
+ifdef inlinux
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
+endif
+# Create units dir
+ifneq ($(FPCDIR),.)
+UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
+
+#####################################################################
+# User Settings
+#####################################################################
+
 
 # Targets
 
@@ -247,28 +244,6 @@ endif
 # Packages
 
 override PACKAGES+=rtl
-ifneq ($(wildcard $(FPCDIR)/rtl),)
-ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
-PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
-else
-PACKAGEDIR_RTL=$(FPCDIR)/rtl
-endif
-UNITDIR_RTL=$(PACKAGEDIR_RTL)
-else
-PACKAGEDIR_RTL=
-ifneq ($(wildcard $(UNITSDIR)/rtl),)
-ifneq ($(wildcard $(UNITSDIR)/rtl/$(OS_TARGET)),)
-UNITDIR_RTL=$(UNITSDIR)/rtl/$(OS_TARGET)
-else
-UNITDIR_RTL=$(UNITSDIR)/rtl
-endif
-else
-UNITDIR_RTL=
-endif
-endif
-ifdef UNITDIR_RTL
-override NEEDUNITDIR+=$(UNITDIR_RTL)
-endif
 
 # Libraries
 
@@ -277,7 +252,9 @@ endif
 
 INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
+#####################################################################
 # Post Settings
+#####################################################################
 
 # Default message file
 MSGFILE=error$(FPCLANG).msg
@@ -299,17 +276,50 @@ override LOCALOPT+=$(LOCALDEF)
 
 override FPCOPT+=$(LOCALOPT)
 
-#####################################################################
-# Default Directories
-#####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-BASEDIR=.
+PACKAGEDIR_RTL=$(FPCDIR)/rtl
+endif
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+else
+PACKAGEDIR_RTL=
+ifneq ($(wildcard $(UNITSDIR)/rtl),)
+ifneq ($(wildcard $(UNITSDIR)/rtl/$(OS_TARGET)),)
+UNITDIR_RTL=$(UNITSDIR)/rtl/$(OS_TARGET)
+else
+UNITDIR_RTL=$(UNITSDIR)/rtl
+endif
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
+#####################################################################
+# Default Directories
+#####################################################################
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -382,6 +392,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -419,7 +447,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -464,11 +492,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -571,17 +598,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -745,7 +761,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -809,16 +825,6 @@ info: fpc_info
 .PHONY:  debug smart shared showinstall sourceinstall zipinstall zipinstalladd cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -830,20 +836,20 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -989,6 +995,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1114,6 +1127,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1125,6 +1141,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 161 - 134
compiler/new/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,79 +122,9 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-# Test FPCDIR to look if the RTL dir exists
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=wrong
-endif
-else
-override FPCDIR=wrong
-endif
-
-# Default FPCDIR
-ifeq ($(FPCDIR),wrong)
-override FPCDIR=../..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=wrong
-endif
-endif
-
-# Detect FPCDIR
-ifeq ($(FPCDIR),wrong)
-ifdef inlinux
-override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
-else
-override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
-endif
-endif
-
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
-# Create units dir
-ifneq ($(FPCDIR),.)
-UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
-endif
-
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
 #####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
-#####################################################################
-# User Settings
-#####################################################################
-
-
 # Pre Settings
+#####################################################################
 
 # Allow ALPHA, POWERPC, M68K, I386 defines for target cpu
 ifdef ALPHA
@@ -238,6 +186,55 @@ endif
 ifeq ($(CPU_TARGET),powerpc)
 CPUSUF=ppc
 endif
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),wrong)
+ifdef inlinux
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
+endif
+# Create units dir
+ifneq ($(FPCDIR),.)
+UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
+
+#####################################################################
+# User Settings
+#####################################################################
+
 
 # Targets
 
@@ -264,28 +261,6 @@ endif
 # Packages
 
 override PACKAGES+=rtl
-ifneq ($(wildcard $(FPCDIR)/rtl),)
-ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
-PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
-else
-PACKAGEDIR_RTL=$(FPCDIR)/rtl
-endif
-UNITDIR_RTL=$(PACKAGEDIR_RTL)
-else
-PACKAGEDIR_RTL=
-ifneq ($(wildcard $(UNITSDIR)/rtl),)
-ifneq ($(wildcard $(UNITSDIR)/rtl/$(OS_TARGET)),)
-UNITDIR_RTL=$(UNITSDIR)/rtl/$(OS_TARGET)
-else
-UNITDIR_RTL=$(UNITSDIR)/rtl
-endif
-else
-UNITDIR_RTL=
-endif
-endif
-ifdef UNITDIR_RTL
-override NEEDUNITDIR+=$(UNITDIR_RTL)
-endif
 
 # Libraries
 
@@ -294,7 +269,9 @@ endif
 
 INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
+#####################################################################
 # Post Settings
+#####################################################################
 
 # Default message file
 MSGFILE=$(OLDDIR)/error$(FPCLANG).msg
@@ -316,17 +293,50 @@ override LOCALOPT+=$(LOCALDEF)
 
 override FPCOPT+=$(LOCALOPT)
 
-#####################################################################
-# Default Directories
-#####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 else
-BASEDIR=.
+PACKAGEDIR_RTL=$(FPCDIR)/rtl
+endif
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+else
+PACKAGEDIR_RTL=
+ifneq ($(wildcard $(UNITSDIR)/rtl),)
+ifneq ($(wildcard $(UNITSDIR)/rtl/$(OS_TARGET)),)
+UNITDIR_RTL=$(UNITSDIR)/rtl/$(OS_TARGET)
+else
+UNITDIR_RTL=$(UNITSDIR)/rtl
+endif
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
+#####################################################################
+# Default Directories
+#####################################################################
+
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -399,6 +409,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -441,7 +469,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -486,11 +514,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -593,17 +620,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -767,7 +783,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -831,16 +847,6 @@ info: fpc_info
 .PHONY:  debug smart shared showinstall sourceinstall zipinstall zipinstalladd cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -852,20 +858,20 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -1011,6 +1017,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1136,6 +1149,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1147,6 +1163,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 76 - 46
fcl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -188,6 +184,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -211,8 +228,23 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
+#####################################################################
+# Redirection
+#####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
 
 #####################################################################
 # Standard rules
@@ -251,16 +283,6 @@ info: $(addsuffix _info,$(OS_TARGET))
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall require info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -272,7 +294,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 
 # Target Dirs
@@ -538,3 +560,11 @@ tests_info:
 	$(MAKE) -C tests info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+

+ 110 - 86
fcl/db/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,46 +159,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -207,6 +203,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl fcl mysql
+
+# Libraries
+
+override NEEDGCCLIB=1
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -251,11 +273,11 @@ endif
 ifdef UNITDIR_FCL
 override NEEDUNITDIR+=$(UNITDIR_FCL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/mysql),)
-ifneq ($(wildcard $(PACKAGEDIR)/mysql/$(OS_TARGET)),)
-PACKAGEDIR_MYSQL=$(PACKAGEDIR)/mysql/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/mysql),)
+ifneq ($(wildcard $(PACKAGESDIR)/mysql/$(OS_TARGET)),)
+PACKAGEDIR_MYSQL=$(PACKAGESDIR)/mysql/$(OS_TARGET)
 else
-PACKAGEDIR_MYSQL=$(PACKAGEDIR)/mysql
+PACKAGEDIR_MYSQL=$(PACKAGESDIR)/mysql
 endif
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)
 else
@@ -274,25 +296,10 @@ ifdef UNITDIR_MYSQL
 override NEEDUNITDIR+=$(UNITDIR_MYSQL)
 endif
 
-# Libraries
-
-override NEEDGCCLIB=1
-
-# Info
-
-INFOTARGET=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
@@ -373,6 +380,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -415,7 +440,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -460,11 +485,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -567,17 +591,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -719,7 +732,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -793,16 +806,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEFCL=1
 PACKAGEMYSQL=1
@@ -834,7 +837,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package fcl_package mysql_package
+.PHONY:  rtl_package fcl_package mysql_package
 
 #####################################################################
 # Units
@@ -869,14 +872,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -1022,6 +1025,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1147,6 +1157,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1158,6 +1171,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 125 - 99
fcl/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,24 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+# Include files
+INC=../inc
+XML=../xml
+SHEDIT=../shedit
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+include $(SHEDIT)/Makefile.inc
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,64 +173,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-# Include files
-INC=../inc
-XML=../xml
-SHEDIT=../shedit
-
-# INCUNITS,XMLUNITS is defined in makefile.inc
-# They are default units for all platforms.
-include $(INC)/Makefile.inc
-include $(XML)/Makefile.inc
-include $(SHEDIT)/Makefile.inc
-
 # Targets
 
 override UNITOBJECTS+=classes $(INCUNITS) $(XMLUNITS) $(SHEDITUNITS)
@@ -205,6 +202,7 @@ override UNITOBJECTS+=classes $(INCUNITS) $(XMLUNITS) $(SHEDITUNITS)
 # Install
 
 UNITSUBDIR=fcl
+PACKAGENAME=fcl
 ZIPTARGET=install
 
 # Defaults
@@ -222,6 +220,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl paszlib
+
+# Libraries
+
+LIBNAME=fpfcl
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -244,11 +268,11 @@ endif
 ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib/$(OS_TARGET)),)
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib/$(OS_TARGET)),)
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib/$(OS_TARGET)
 else
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib
 endif
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
 else
@@ -267,25 +291,10 @@ ifdef UNITDIR_PASZLIB
 override NEEDUNITDIR+=$(UNITDIR_PASZLIB)
 endif
 
-# Libraries
-
-LIBNAME=fpfcl
-
-# Info
-
-INFOTARGET=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
@@ -358,6 +367,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -400,7 +427,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -445,11 +472,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -552,17 +578,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -704,7 +719,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -774,16 +789,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEPASZLIB=1
 ifdef PACKAGERTL
@@ -805,7 +810,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package paszlib_package
+.PHONY:  rtl_package paszlib_package
 
 #####################################################################
 # Units
@@ -825,14 +830,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -978,6 +983,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1103,6 +1115,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1114,6 +1129,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 125 - 99
fcl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,24 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+# Include files
+INC=../inc
+XML=../xml
+SHEDIT=../shedit
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+include $(SHEDIT)/Makefile.inc
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,64 +173,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-# Include files
-INC=../inc
-XML=../xml
-SHEDIT=../shedit
-
-# INCUNITS,XMLUNITS is defined in makefile.inc
-# They are default units for all platforms.
-include $(INC)/Makefile.inc
-include $(XML)/Makefile.inc
-include $(SHEDIT)/Makefile.inc
-
 # Targets
 
 override UNITOBJECTS+=classes $(INCUNITS) $(XMLUNITS) $(SHEDITUNITS)
@@ -205,6 +202,7 @@ override UNITOBJECTS+=classes $(INCUNITS) $(XMLUNITS) $(SHEDITUNITS)
 # Install
 
 UNITSUBDIR=fcl
+PACKAGENAME=fcl
 ZIPTARGET=install
 
 # Defaults
@@ -222,6 +220,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl zlib
+
+# Libraries
+
+LIBNAME=fpfcl
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -244,11 +268,11 @@ endif
 ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/zlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/zlib/$(OS_TARGET)),)
-PACKAGEDIR_ZLIB=$(PACKAGEDIR)/zlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/zlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/zlib/$(OS_TARGET)),)
+PACKAGEDIR_ZLIB=$(PACKAGESDIR)/zlib/$(OS_TARGET)
 else
-PACKAGEDIR_ZLIB=$(PACKAGEDIR)/zlib
+PACKAGEDIR_ZLIB=$(PACKAGESDIR)/zlib
 endif
 UNITDIR_ZLIB=$(PACKAGEDIR_ZLIB)
 else
@@ -267,25 +291,10 @@ ifdef UNITDIR_ZLIB
 override NEEDUNITDIR+=$(UNITDIR_ZLIB)
 endif
 
-# Libraries
-
-LIBNAME=fpfcl
-
-# Info
-
-INFOTARGET=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
@@ -358,6 +367,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -400,7 +427,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -445,11 +472,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -552,17 +578,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -704,7 +719,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -774,16 +789,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEZLIB=1
 ifdef PACKAGERTL
@@ -805,7 +810,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package zlib_package
+.PHONY:  rtl_package zlib_package
 
 #####################################################################
 # Units
@@ -825,14 +830,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -978,6 +983,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1103,6 +1115,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1114,6 +1129,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 125 - 99
fcl/os2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,24 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+# Include files
+INC=../inc
+XML=../xml
+SHEDIT=../shedit
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+include $(SHEDIT)/Makefile.inc
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,64 +173,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-# Include files
-INC=../inc
-XML=../xml
-SHEDIT=../shedit
-
-# INCUNITS,XMLUNITS is defined in makefile.inc
-# They are default units for all platforms.
-include $(INC)/Makefile.inc
-include $(XML)/Makefile.inc
-include $(SHEDIT)/Makefile.inc
-
 # Targets
 
 override UNITOBJECTS+=classes $(INCUNITS) $(XMLUNITS) $(SHEDITUNITS)
@@ -205,6 +202,7 @@ override UNITOBJECTS+=classes $(INCUNITS) $(XMLUNITS) $(SHEDITUNITS)
 # Install
 
 UNITSUBDIR=fcl
+PACKAGENAME=fcl
 ZIPTARGET=install
 
 # Defaults
@@ -222,6 +220,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl paszlib
+
+# Libraries
+
+LIBNAME=fpfcl
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -244,11 +268,11 @@ endif
 ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib/$(OS_TARGET)),)
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib/$(OS_TARGET)),)
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib/$(OS_TARGET)
 else
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib
 endif
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
 else
@@ -267,25 +291,10 @@ ifdef UNITDIR_PASZLIB
 override NEEDUNITDIR+=$(UNITDIR_PASZLIB)
 endif
 
-# Libraries
-
-LIBNAME=fpfcl
-
-# Info
-
-INFOTARGET=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
@@ -358,6 +367,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -400,7 +427,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -445,11 +472,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -552,17 +578,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -704,7 +719,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -774,16 +789,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEPASZLIB=1
 ifdef PACKAGERTL
@@ -805,7 +810,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package paszlib_package
+.PHONY:  rtl_package paszlib_package
 
 #####################################################################
 # Units
@@ -825,14 +830,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -978,6 +983,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1103,6 +1115,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1114,6 +1129,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 109 - 85
fcl/shedit/gtk/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl fcl gtk
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -241,11 +262,11 @@ endif
 ifdef UNITDIR_FCL
 override NEEDUNITDIR+=$(UNITDIR_FCL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/gtk),)
-ifneq ($(wildcard $(PACKAGEDIR)/gtk/$(OS_TARGET)),)
-PACKAGEDIR_GTK=$(PACKAGEDIR)/gtk/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/gtk),)
+ifneq ($(wildcard $(PACKAGESDIR)/gtk/$(OS_TARGET)),)
+PACKAGEDIR_GTK=$(PACKAGESDIR)/gtk/$(OS_TARGET)
 else
-PACKAGEDIR_GTK=$(PACKAGEDIR)/gtk
+PACKAGEDIR_GTK=$(PACKAGESDIR)/gtk
 endif
 UNITDIR_GTK=$(PACKAGEDIR_GTK)
 else
@@ -264,24 +285,10 @@ ifdef UNITDIR_GTK
 override NEEDUNITDIR+=$(UNITDIR_GTK)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -354,6 +361,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -382,7 +407,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -427,11 +452,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -534,17 +558,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -686,7 +699,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -756,16 +769,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEFCL=1
 PACKAGEGTK=1
@@ -797,7 +800,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package fcl_package gtk_package
+.PHONY:  rtl_package fcl_package gtk_package
 
 #####################################################################
 # Units
@@ -832,14 +835,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -985,6 +988,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1110,6 +1120,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1121,4 +1134,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 113 - 89
fcl/tests/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -207,6 +203,31 @@ endif
 ifeq ($(OS_TARGET),win32)
 override PACKAGES+=paszlib
 endif
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -251,11 +272,11 @@ endif
 ifdef UNITDIR_FCL
 override NEEDUNITDIR+=$(UNITDIR_FCL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/zlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/zlib/$(OS_TARGET)),)
-PACKAGEDIR_ZLIB=$(PACKAGEDIR)/zlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/zlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/zlib/$(OS_TARGET)),)
+PACKAGEDIR_ZLIB=$(PACKAGESDIR)/zlib/$(OS_TARGET)
 else
-PACKAGEDIR_ZLIB=$(PACKAGEDIR)/zlib
+PACKAGEDIR_ZLIB=$(PACKAGESDIR)/zlib
 endif
 UNITDIR_ZLIB=$(PACKAGEDIR_ZLIB)
 else
@@ -273,11 +294,11 @@ endif
 ifdef UNITDIR_ZLIB
 override NEEDUNITDIR+=$(UNITDIR_ZLIB)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib/$(OS_TARGET)),)
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib/$(OS_TARGET)),)
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib/$(OS_TARGET)
 else
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib
 endif
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
 else
@@ -296,24 +317,10 @@ ifdef UNITDIR_PASZLIB
 override NEEDUNITDIR+=$(UNITDIR_PASZLIB)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -386,6 +393,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -423,7 +448,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -468,11 +493,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -575,17 +599,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -727,7 +740,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -797,16 +810,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEFCL=1
 ifeq ($(OS_TARGET),linux)
@@ -852,7 +855,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package fcl_package zlib_package paszlib_package
+.PHONY:  rtl_package fcl_package zlib_package paszlib_package
 
 #####################################################################
 # Exes
@@ -881,14 +884,14 @@ override CLEANRSTFILES+=$(RSTFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -1034,6 +1037,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1159,6 +1169,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1170,4 +1183,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 125 - 99
fcl/win32/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,24 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+# Include files
+INC=../inc
+XML=../xml
+SHEDIT=../shedit
+
+# INCUNITS,XMLUNITS is defined in makefile.inc
+# They are default units for all platforms.
+include $(INC)/Makefile.inc
+include $(XML)/Makefile.inc
+include $(SHEDIT)/Makefile.inc
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,64 +173,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-# Include files
-INC=../inc
-XML=../xml
-SHEDIT=../shedit
-
-# INCUNITS,XMLUNITS is defined in makefile.inc
-# They are default units for all platforms.
-include $(INC)/Makefile.inc
-include $(XML)/Makefile.inc
-include $(SHEDIT)/Makefile.inc
-
 # Targets
 
 override UNITOBJECTS+=classes $(INCUNITS) $(XMLUNITS) $(SHEDITUNITS)
@@ -205,6 +202,7 @@ override UNITOBJECTS+=classes $(INCUNITS) $(XMLUNITS) $(SHEDITUNITS)
 # Install
 
 UNITSUBDIR=fcl
+PACKAGENAME=fcl
 ZIPTARGET=install
 
 # Defaults
@@ -222,6 +220,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl paszlib
+
+# Libraries
+
+LIBNAME=fpfcl
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -244,11 +268,11 @@ endif
 ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib/$(OS_TARGET)),)
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib/$(OS_TARGET)),)
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib/$(OS_TARGET)
 else
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib
 endif
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
 else
@@ -267,25 +291,10 @@ ifdef UNITDIR_PASZLIB
 override NEEDUNITDIR+=$(UNITDIR_PASZLIB)
 endif
 
-# Libraries
-
-LIBNAME=fpfcl
-
-# Info
-
-INFOTARGET=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
@@ -358,6 +367,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -400,7 +427,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -445,11 +472,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -552,17 +578,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -704,7 +719,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -774,16 +789,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEPASZLIB=1
 ifdef PACKAGERTL
@@ -805,7 +810,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package paszlib_package
+.PHONY:  rtl_package paszlib_package
 
 #####################################################################
 # Units
@@ -825,14 +830,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -978,6 +983,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1103,6 +1115,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1114,6 +1129,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 76 - 46
ide/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -188,6 +184,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -211,8 +228,23 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
+#####################################################################
+# Redirection
+#####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
 
 #####################################################################
 # Standard rules
@@ -243,16 +275,6 @@ require: $(addsuffix _require,$(DIROBJECTS))
 .PHONY:  debug examples test smart shared showinstall install sourceinstall clean cleanall require
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -264,7 +286,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 
 # Target Dirs
@@ -374,6 +396,14 @@ text_info:
 	$(MAKE) -C text info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+
 #####################################################################
 # Users rules
 #####################################################################

+ 76 - 46
ide/fake/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -188,6 +184,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -211,8 +228,23 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
+#####################################################################
+# Redirection
+#####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
 
 #####################################################################
 # Standard rules
@@ -245,16 +277,6 @@ require: $(addsuffix _require,$(DIROBJECTS))
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall require
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -266,7 +288,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 
 # Target Dirs
@@ -376,3 +398,11 @@ gdb_info:
 	$(MAKE) -C gdb info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+

+ 105 - 81
ide/fake/compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -188,6 +184,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -211,24 +232,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -301,6 +308,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -329,7 +354,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -374,11 +399,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -481,17 +505,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -633,7 +646,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -703,16 +716,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -724,7 +727,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -744,14 +747,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -897,6 +900,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1022,6 +1032,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1033,4 +1046,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 105 - 81
ide/fake/gdb/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -188,6 +184,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -211,24 +232,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -301,6 +308,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -329,7 +354,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -374,11 +399,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -481,17 +505,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -633,7 +646,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -703,16 +716,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -724,7 +727,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -744,14 +747,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -897,6 +900,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1022,6 +1032,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1033,6 +1046,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 146 - 119
ide/text/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,38 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+# when making a full version include the compiler
+ifeq ($(FULL),1)
+override COMPUNITDIR+=../../compiler
+else
+override COMPUNITDIR+=../fake/compiler
+endif
+
+# when including debugger include the gdbinterface
+ifndef GDBINT
+GDBINT=gdbint
+endif
+
+ifeq ($(GDB),1)
+GDBUNITDIR+=$(PACKAGEDIR)/$(GDBINT)
+GDBLIBDIR+=$(PACKAGEDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
+GDBOBJDIR+=$(PACKAGEDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
+ifeq ($(OS_TARGET),go32v2)
+ifneq ($(DJDIR),)
+GDBLIBDIR+=$(DJDIR)/lib
+endif
+endif
+else
+override GDBUNITDIR+=../fake/gdb
+endif
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,78 +181,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-# when making a full version include the compiler
-ifeq ($(FULL),1)
-override COMPUNITDIR+=../../compiler
-else
-override COMPUNITDIR+=../fake/compiler
-endif
-
-# when including debugger include the gdbinterface
-ifndef GDBINT
-GDBINT=gdbint
-endif
-
-ifeq ($(GDB),1)
-GDBUNITDIR+=$(PACKAGEDIR)/$(GDBINT)
-GDBLIBDIR+=$(PACKAGEDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
-GDBOBJDIR+=$(PACKAGEDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
-ifeq ($(OS_TARGET),go32v2)
-ifneq ($(DJDIR),)
-GDBLIBDIR+=$(DJDIR)/lib
-endif
-endif
-else
-override GDBUNITDIR+=../fake/gdb
-endif
-
 # Targets
 
 override EXEOBJECTS+=fp
@@ -227,6 +224,40 @@ override NEEDOBJDIR=$(GDBOBJDIR)
 # Packages
 
 override PACKAGES+=rtl api fv gdbint
+
+# Libraries
+
+override NEEDGCCLIB=1
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+#####################################################################
+# Post Settings
+#####################################################################
+
+ifeq ($(FULL),1)
+override NEEDOPT+=-dBrowserCol -dGDB -Sg
+endif
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -293,11 +324,11 @@ endif
 ifdef UNITDIR_FV
 override NEEDUNITDIR+=$(UNITDIR_FV)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/gdbint),)
-ifneq ($(wildcard $(PACKAGEDIR)/gdbint/$(OS_TARGET)),)
-PACKAGEDIR_GDBINT=$(PACKAGEDIR)/gdbint/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/gdbint),)
+ifneq ($(wildcard $(PACKAGESDIR)/gdbint/$(OS_TARGET)),)
+PACKAGEDIR_GDBINT=$(PACKAGESDIR)/gdbint/$(OS_TARGET)
 else
-PACKAGEDIR_GDBINT=$(PACKAGEDIR)/gdbint
+PACKAGEDIR_GDBINT=$(PACKAGESDIR)/gdbint
 endif
 UNITDIR_GDBINT=$(PACKAGEDIR_GDBINT)
 else
@@ -316,31 +347,10 @@ ifdef UNITDIR_GDBINT
 override NEEDUNITDIR+=$(UNITDIR_GDBINT)
 endif
 
-# Libraries
-
-override NEEDGCCLIB=1
-
-# Info
-
-INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
-
-# Post Settings
-
-ifeq ($(FULL),1)
-override NEEDOPT+=-dBrowserCol -dGDB -Sg
-endif
-
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -421,6 +431,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -466,7 +494,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -511,11 +539,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -618,17 +645,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -770,7 +786,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -836,16 +852,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall sourceinstall zipinstall zipinstalladd cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEAPI=1
 PACKAGEFV=1
@@ -887,7 +893,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package api_package fv_package gdbint_package
+.PHONY:  rtl_package api_package fv_package gdbint_package
 
 #####################################################################
 # Exes
@@ -908,14 +914,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -1061,6 +1067,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1186,6 +1199,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1197,6 +1213,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 188 - 210
install/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: help
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,43 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+OLDFPCDIR:=$(FPCDIR)
+
+checkfpcdir:
+ifdef OLDFPCDIR
+	@echo You must unset FPCDIR to use this Makefile
+	@exit 1
+endif
+
+# Test dir if none specified
+ifndef PREFIXINSTALLDIR
+PREFIXINSTALLDIR=/pptest
+endif
+
+# Directory to the base of the CVS tree
+CVSBASE=..
+
+# Always compile for release
+override RELEASE=1
+
+# Temporary path to pack a file
+BASEPACKDIR=$(BASEDIR)/basepack
+
+# Use new ppc386
+PPNEW=$(BASEDIR)/$(CVSBASE)/compiler/ppc386.exe
+PPUFILESNEW=$(BASEDIR)/$(CVSBASE)/utils/ppufiles.exe
+
+# Build/install options
+BUILDOPTS=FPC=$(PPNEW) RELEASE=1
+INSTALLOPTS=FPC=$(PPNEW) PPUFILES=$(PPUFILESNEW) ZIPDESTDIR=$(BASEDIR)
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -114,14 +169,6 @@ else
 override FPCDIR=wrong
 endif
 
-# Default FPCDIR
-ifeq ($(FPCDIR),wrong)
-override FPCDIR=..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-override FPCDIR=wrong
-endif
-endif
-
 # Detect FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifdef inlinux
@@ -131,79 +178,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-# Test dir if none specified
-ifndef PREFIXINSTALLDIR
-PREFIXINSTALLDIR=/pptest
-endif
-
-# Directory to the base of the CVS tree
-CVSBASE=..
-CFG=$(CVSBASE)/rtl/cfg
-
-# Temporary path to pack a file
-PACKDIR=$(subst \,/,$(TMP))/pp_tmp
-
-# Use new ppc386
-PPNEW=$(BASEDIR)/$(CVSBASE)/compiler/ppc386.exe
-PPUFILESNEW=$(BASEDIR)/$(CVSBASE)/utils/ppufiles.exe
-
-# Test dir if none specified
-ifndef PACKAGEDIR
-PACKAGEDIR=$(BASEDIR)
-endif
-
-BUILDOPTSGO32V2=OS_TARGET=go32v2 FPC=$(PPNEW) RELEASE=1
-INSTALLOPTSGO32V2=OS_TARGET=go32v2 FPC=$(PPNEW) PPUFILES=$(PPUFILESNEW)
-BUILDOPTSWIN32=OS_TARGET=win32 FPC=$(PPNEW) RELEASE=1
-INSTALLOPTSWIN32=OS_TARGET=win32 FPC=$(PPNEW) PPUFILES=$(PPUFILESNEW)
-
 # Targets
 
 
@@ -223,6 +216,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -246,20 +260,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -332,6 +336,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -360,7 +382,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -405,11 +427,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -512,17 +533,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -664,7 +674,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -721,26 +731,14 @@ install: fpc_install
 
 sourceinstall: fpc_sourceinstall
 
-zipinstall: fpc_zipinstall
-
 zipinstalladd: fpc_zipinstalladd
 
 clean: fpc_clean
 
 cleanall: fpc_cleanall
 
-.PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall
-
+.PHONY:  all debug smart shared showinstall install sourceinstall zipinstalladd clean cleanall
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
 
 PACKAGERTL=1
 ifdef PACKAGERTL
@@ -753,20 +751,20 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -912,6 +910,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -996,10 +1001,20 @@ endif
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+
 #####################################################################
 # Users rules
 #####################################################################
 
+.PHONY: help checkfpcdir
+
 help:
 	@echo
 	@echo Possible targets are:
@@ -1007,65 +1022,44 @@ help:
 	@echo basego32, basego32.zip
 	@echo basew32,  basew32.zip
 	@echo
-	@exit
+	@exit 1
+
 
 ##########################################################################
 # Install
 ##########################################################################
 
+.PHONY: installer
+
 installer:
 	$(MAKE) -C fpinst all RELEASE=1
 
+
 ##########################################################################
 # Basego32.zip
 ##########################################################################
 
-p:
-	$(MAKE) -C $(CVSBASE) compiler_install $(INSTALLOPTSGO32V2)
+.PHONY: build installbase zipinstall zipinstallbase zipinstallfcl \
+	zipinstallpackages
+
+export RELEASE DESTZIPDIR
 
-basego32:
+build: checkfpcdir
 # create new compiler
-	$(MAKE) -C $(CVSBASE) compiler_cycle OS_TARGET=go32v2 RELEASE=1
+	-$(MAKE) -C $(CVSBASE) compiler_cycle
 # clean
-	$(MAKE) -C $(CVSBASE) rtl_clean OS_TARGET=go32v2
-	$(MAKE) -C $(CVSBASE) fcl_clean OS_TARGET=go32v2
-	$(MAKE) -C $(CVSBASE) packages_clean OS_TARGET=go32v2
-	$(MAKE) -C $(CVSBASE) utils_clean OS_TARGET=go32v2
+	$(MAKE) -C $(CVSBASE) rtl_clean
+	$(MAKE) -C $(CVSBASE) fcl_clean
+	$(MAKE) -C $(CVSBASE) packages_clean
+	$(MAKE) -C $(CVSBASE) utils_clean
 # build everything
-	$(MAKE) -C $(CVSBASE) rtl_smart $(BUILDOPTSGO32V2)
-	$(MAKE) -C $(CVSBASE) fcl_smart $(BUILDOPTSGO32V2)
-	$(MAKE) -C $(CVSBASE) packages_smart $(BUILDOPTSGO32V2)
-	$(MAKE) -C $(CVSBASE) utils_all $(BUILDOPTSGO32V2)
-# install
-	# create dirs
-	$(MKDIR) $(BASEINSTALLDIR)
-	$(MKDIR) $(DOCINSTALLDIR)
-	$(MKDIR) $(BININSTALLDIR)
-	$(MKDIR) $(SOURCEINSTALLDIR)
-	# readme & whatsnew and docs
-	$(COPY) doc/*.txt doc/copying* $(DOCINSTALLDIR)
-	# bingo32 (cwsdpmi,wmemu387.dxe)
-	$(COPY) bingo32/* $(BININSTALLDIR)
-	# source (base)
-	$(COPY) $(CVSBASE)/Makefile $(CVSBASE)/Makefile.fpc $(SOURCEINSTALLDIR)
-	# install generated things
-	$(MAKE) -C $(CVSBASE) compiler_install $(INSTALLOPTSGO32V2)
-	$(MAKE) -C $(CVSBASE) rtl_install $(INSTALLOPTSGO32V2)
-	$(MAKE) -C $(CVSBASE) fcl_install $(INSTALLOPTSGO32V2)
-	$(MAKE) -C $(CVSBASE) packages_install $(INSTALLOPTSGO32V2)
-	$(MAKE) -C $(CVSBASE) utils_install $(INSTALLOPTSGO32V2)
-
-basego32.zip:
-	$(MAKE) basego32 BASEINSTALLDIR=$(PACKDIR)
-	cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/basego32.zip * ; cd $(BASEDIR)
-	$(DELTREE) $(PACKDIR)
+	$(MAKE) -C $(CVSBASE) rtl_smart $(BUILDOPTS)
+	$(MAKE) -C $(CVSBASE) fcl_smart $(BUILDOPTS)
+	$(MAKE) -C $(CVSBASE) packages_smart $(BUILDOPTS)
+	$(MAKE) -C $(CVSBASE) utils_all $(BUILDOPTS)
 
 
-##########################################################################
-# basew32.zip
-##########################################################################
-
-basew32:
+installbase:
 # create dirs
 	$(MKDIR) $(BASEINSTALLDIR)
 	$(MKDIR) $(DOCINSTALLDIR)
@@ -1073,62 +1067,46 @@ basew32:
 	$(MKDIR) $(SOURCEINSTALLDIR)
 # readme & whatsnew and docs
 	$(COPY) doc/*.txt doc/copying* $(DOCINSTALLDIR)
+# bingo32 (cwsdpmi,wmemu387.dxe)
+ifeq ($(OS_TARGET),go32v2)
+	$(COPY) bingo32/* $(BININSTALLDIR)
+endif
 # source (base)
-	$(COPY) $(CVSBASE)/base/Makefile $(CVSBASE)/base/makefile.fpc $(SOURCEINSTALLDIR)
-# readme.txt & whatsnew.txt
-	$(MKDIR) $(BASEINSTALLDIR)
-	$(COPY) readme.txt whatsnew.txt $(BASEINSTALLDIR)
-# compiler, the - is necessary because the files sometimes differ
-	-$(MAKE) -C $(CVSBASE)/compiler cycle OS_TARGET=win32 RELEASE=1
-	$(MAKE) -C $(CVSBASE)/compiler install OS_TARGET=win32
-# rtl
-	$(MAKE) -C $(CVSBASE)/rtl/win32 clean OS_TARGET=win32
-	$(MAKE) -C $(CVSBASE)/rtl/win32 install OS_TARGET=win32 RELEASE=1 FPC=$(PPNEW)
-# rtl libs
-#       $(MAKE) -C $(CVSBASE)/rtl/win32 clean OS_TARGET=win32
-#       $(MAKE) -C $(CVSBASE)/rtl/win32 libinstall OS_TARGET=win32 RELEASE=1 FPC=$(PPNEW)
-# utils
-	$(MAKE) -C $(CVSBASE)/utils clean OS_TARGET=win32
-	$(MAKE) -C $(CVSBASE)/utils install OS_TARGET=win32 RELEASE=1 FPC=$(PPNEW)
-
-basew32.zip:
-	$(MAKE) basew32 BASEINSTALLDIR=$(PACKDIR)
-	$(MKDIR) $(PACKAGEDIR)
-# Maybe you need 4dos for it, becuase unix paths with / are used
-	cd $(PACKDIR)
-	$(ZIPPROG) $(PACKAGEDIR)/basew32.zip *
-	cd $(BASEDIR)
-	$(DELTREE) $(PACKDIR)
+	$(COPY) $(CVSBASE)/Makefile $(CVSBASE)/Makefile.fpc $(SOURCEINSTALLDIR)
+# install generated things
+	$(MAKE) -C $(CVSBASE) compiler_install $(INSTALLOPTS)
+	$(MAKE) -C $(CVSBASE) rtl_install $(INSTALLOPTS)
+	$(MAKE) -C $(CVSBASE) utils_install $(INSTALLOPTS)
+
+zipinstallbase:
+	$(MKDIR) $(BASEPACKDIR)
+	$(MAKE) installbase PREFIXINSTALLDIR=$(BASEPACKDIR)
+	cd $(BASEPACKDIR) ; $(ZIPPROG) $(DESTZIPDIR)/basego32.zip * ; cd $(BASEDIR)
+	$(DELTREE) $(BASEPACKDIR)
+
+zipinstallapi:
+	$(MAKE) -C $(CVSBASE) api_zipinstall $(INSTALLOPTS)
+
+zipinstallfcl:
+	$(MAKE) -C $(CVSBASE) fcl_zipinstall $(INSTALLOPTS)
+
+zipinstallpackages:
+	$(MAKE) -C $(CVSBASE) packages_install $(INSTALLOPTS)
+
+
+zipinstall: build \
+	    zipinstallbase zipinstallapi zipinstallfcl \
+	    zipinstallpackages
 
 
 ##########################################################################
-# Baseemx.zip
+# go32v2,win32 specific targets
 ##########################################################################
 
-baseemx:
-# create dirs
-	$(MKDIR) $(BASEINSTALLDIR)
-	$(MKDIR) $(DOCINSTALLDIR)
-	$(MKDIR) $(BININSTALLDIR)
-	$(MKDIR) $(SOURCEINSTALLDIR)
-# readme & whatsnew and docs
-	$(COPY) doc/*.txt doc/copying* $(DOCINSTALLDIR)
-# source (base)
-	$(COPY) $(CVSBASE)/base/Makefile $(CVSBASE)/base/makefile.fpc $(SOURCEINSTALLDIR)
-# compiler
-	$(MAKE) -C $(CVSBASE)/compiler cycle OS_TARGET=os2 RELEASE=1
-	$(MAKE) -C $(CVSBASE)/compiler install OS_TARGET=os2
-# rtl os2
-	$(MAKE) -C $(CVSBASE)/rtl/go32v2 clean OS_TARGET=os2
-	$(MAKE) -C $(CVSBASE)/rtl/go32v2 install OS_TARGET=os2 RELEASE=1 FPC=$(PPNEW)
-# rtl go32v2 libs
-#       $(MAKE) -C $(CVSBASE)/rtl/go32v2 clean OS_TARGET=go32v2
-#       $(MAKE) -C $(CVSBASE)/rtl/go32v2 libinstall OS_TARGET=go32v2 RELEASE=1 FPC=$(PPNEW)
-# utils
-	$(MAKE) -C $(CVSBASE)/utils clean OS_TARGET=os2
-	$(MAKE) -C $(CVSBASE)/utils install OS_TARGET=os2 RELEASE=1 FPC=$(PPNEW)
-
-baseemx.zip:
-	$(MAKE) baseemx BASEINSTALLDIR=$(PACKDIR)
-	cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/baseemx.zip * ; cd $(BASEDIR)
-	$(DELTREE) $(PACKDIR)
+.PHONY: go32v2 win32
+
+go32v2:
+	$(MAKE) zipinstall OS_TARGET=go32v2
+
+win32:
+	$(MAKE) zipinstall OS_TARGET=win32

+ 113 - 87
install/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: both
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -210,6 +206,39 @@ endif
 # Packages
 
 override PACKAGES+=rtl api
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+#####################################################################
+# Post Settings
+#####################################################################
+
+ifdef GRAPHICS
+override FPCOPT+=-dUSEGRAPHICS
+endif
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -255,30 +284,10 @@ ifdef UNITDIR_API
 override NEEDUNITDIR+=$(UNITDIR_API)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
-
-# Post Settings
-
-ifdef GRAPHICS
-override FPCOPT+=-dUSEGRAPHICS
-endif
-
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -351,6 +360,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -384,7 +411,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -429,11 +456,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -536,17 +562,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -688,7 +703,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -756,16 +771,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEAPI=1
 ifdef PACKAGERTL
@@ -787,7 +792,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package api_package
+.PHONY:  rtl_package api_package
 
 #####################################################################
 # Units
@@ -822,14 +827,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -975,6 +980,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1100,6 +1112,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1111,6 +1126,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 105 - 81
install/fpinst/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -203,6 +199,31 @@ endif
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -226,24 +247,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -316,6 +323,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -349,7 +374,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -394,11 +419,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -501,17 +525,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -653,7 +666,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -723,16 +736,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -744,7 +747,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -765,14 +768,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -918,6 +921,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1043,6 +1053,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1054,4 +1067,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 275 - 189
packages/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -170,15 +166,15 @@ endif
 
 # Targets
 
-override DIROBJECTS+=$(wildcard ibase mysql uncgi paszlib)
+override DIROBJECTS+=$(wildcard paszlib)
 ifeq ($(OS_TARGET),linux)
-override DIROBJECTS+=$(wildcard gtk opengl gdbint utmp inet postgres ncurses x11 forms svgalib ggi zlib)
+override DIROBJECTS+=$(wildcard uncgi gtk opengl gdbint ibase mysql zlib utmp inet postgres ncurses x11 forms svgalib ggi)
 endif
 ifeq ($(OS_TARGET),go32v2)
-override DIROBJECTS+=$(wildcard gdbint)
+override DIROBJECTS+=$(wildcard uncgi gdbint)
 endif
 ifeq ($(OS_TARGET),win32)
-override DIROBJECTS+=$(wildcard gtk opengl gdbint)
+override DIROBJECTS+=$(wildcard uncgi gtk opengl gdbint ibase mysql zlib)
 endif
 
 # Clean
@@ -197,6 +193,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,8 +237,23 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
+#####################################################################
+# Redirection
+#####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
 
 #####################################################################
 # Standard rules
@@ -254,16 +286,6 @@ require: $(addsuffix _require,$(DIROBJECTS))
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall require
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -275,19 +297,20 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 
 # Target Dirs
 
-OBJECTDIRIBASE=1
-OBJECTDIRMYSQL=1
-OBJECTDIRUNCGI=1
 OBJECTDIRPASZLIB=1
 ifeq ($(OS_TARGET),linux)
+OBJECTDIRUNCGI=1
 OBJECTDIRGTK=1
 OBJECTDIROPENGL=1
 OBJECTDIRGDBINT=1
+OBJECTDIRIBASE=1
+OBJECTDIRMYSQL=1
+OBJECTDIRZLIB=1
 OBJECTDIRUTMP=1
 OBJECTDIRINET=1
 OBJECTDIRPOSTGRES=1
@@ -296,117 +319,70 @@ OBJECTDIRX11=1
 OBJECTDIRFORMS=1
 OBJECTDIRSVGALIB=1
 OBJECTDIRGGI=1
-OBJECTDIRZLIB=1
 endif
 ifeq ($(OS_TARGET),go32v2)
+OBJECTDIRUNCGI=1
 OBJECTDIRGDBINT=1
 endif
 ifeq ($(OS_TARGET),win32)
+OBJECTDIRUNCGI=1
 OBJECTDIRGTK=1
 OBJECTDIROPENGL=1
 OBJECTDIRGDBINT=1
+OBJECTDIRIBASE=1
+OBJECTDIRMYSQL=1
+OBJECTDIRZLIB=1
 endif
 
-# Dir ibase
-
-ifdef OBJECTDIRIBASE
-.PHONY:  ibase_all ibase_debug ibase_examples ibase_test ibase_smart ibase_shared ibase_showinstall ibase_install ibase_sourceinstall ibase_zipinstall ibase_zipinstalladd ibase_clean ibase_cleanall ibase_require ibase_info
-
-ibase_all:
-	$(MAKE) -C ibase all
-
-ibase_debug:
-	$(MAKE) -C ibase debug
-
-ibase_examples:
-	$(MAKE) -C ibase examples
-
-ibase_test:
-	$(MAKE) -C ibase test
-
-ibase_smart:
-	$(MAKE) -C ibase smart
-
-ibase_shared:
-	$(MAKE) -C ibase shared
-
-ibase_showinstall:
-	$(MAKE) -C ibase showinstall
-
-ibase_install:
-	$(MAKE) -C ibase install
-
-ibase_sourceinstall:
-	$(MAKE) -C ibase sourceinstall
-
-ibase_zipinstall:
-	$(MAKE) -C ibase zipinstall
-
-ibase_zipinstalladd:
-	$(MAKE) -C ibase zipinstalladd
-
-ibase_clean:
-	$(MAKE) -C ibase clean
-
-ibase_cleanall:
-	$(MAKE) -C ibase cleanall
-
-ibase_require:
-	$(MAKE) -C ibase require
-
-ibase_info:
-	$(MAKE) -C ibase info
-endif
-
-# Dir mysql
+# Dir paszlib
 
-ifdef OBJECTDIRMYSQL
-.PHONY:  mysql_all mysql_debug mysql_examples mysql_test mysql_smart mysql_shared mysql_showinstall mysql_install mysql_sourceinstall mysql_zipinstall mysql_zipinstalladd mysql_clean mysql_cleanall mysql_require mysql_info
+ifdef OBJECTDIRPASZLIB
+.PHONY:  paszlib_all paszlib_debug paszlib_examples paszlib_test paszlib_smart paszlib_shared paszlib_showinstall paszlib_install paszlib_sourceinstall paszlib_zipinstall paszlib_zipinstalladd paszlib_clean paszlib_cleanall paszlib_require paszlib_info
 
-mysql_all:
-	$(MAKE) -C mysql all
+paszlib_all:
+	$(MAKE) -C paszlib all
 
-mysql_debug:
-	$(MAKE) -C mysql debug
+paszlib_debug:
+	$(MAKE) -C paszlib debug
 
-mysql_examples:
-	$(MAKE) -C mysql examples
+paszlib_examples:
+	$(MAKE) -C paszlib examples
 
-mysql_test:
-	$(MAKE) -C mysql test
+paszlib_test:
+	$(MAKE) -C paszlib test
 
-mysql_smart:
-	$(MAKE) -C mysql smart
+paszlib_smart:
+	$(MAKE) -C paszlib smart
 
-mysql_shared:
-	$(MAKE) -C mysql shared
+paszlib_shared:
+	$(MAKE) -C paszlib shared
 
-mysql_showinstall:
-	$(MAKE) -C mysql showinstall
+paszlib_showinstall:
+	$(MAKE) -C paszlib showinstall
 
-mysql_install:
-	$(MAKE) -C mysql install
+paszlib_install:
+	$(MAKE) -C paszlib install
 
-mysql_sourceinstall:
-	$(MAKE) -C mysql sourceinstall
+paszlib_sourceinstall:
+	$(MAKE) -C paszlib sourceinstall
 
-mysql_zipinstall:
-	$(MAKE) -C mysql zipinstall
+paszlib_zipinstall:
+	$(MAKE) -C paszlib zipinstall
 
-mysql_zipinstalladd:
-	$(MAKE) -C mysql zipinstalladd
+paszlib_zipinstalladd:
+	$(MAKE) -C paszlib zipinstalladd
 
-mysql_clean:
-	$(MAKE) -C mysql clean
+paszlib_clean:
+	$(MAKE) -C paszlib clean
 
-mysql_cleanall:
-	$(MAKE) -C mysql cleanall
+paszlib_cleanall:
+	$(MAKE) -C paszlib cleanall
 
-mysql_require:
-	$(MAKE) -C mysql require
+paszlib_require:
+	$(MAKE) -C paszlib require
 
-mysql_info:
-	$(MAKE) -C mysql info
+paszlib_info:
+	$(MAKE) -C paszlib info
 endif
 
 # Dir uncgi
@@ -460,57 +436,6 @@ uncgi_info:
 	$(MAKE) -C uncgi info
 endif
 
-# Dir paszlib
-
-ifdef OBJECTDIRPASZLIB
-.PHONY:  paszlib_all paszlib_debug paszlib_examples paszlib_test paszlib_smart paszlib_shared paszlib_showinstall paszlib_install paszlib_sourceinstall paszlib_zipinstall paszlib_zipinstalladd paszlib_clean paszlib_cleanall paszlib_require paszlib_info
-
-paszlib_all:
-	$(MAKE) -C paszlib all
-
-paszlib_debug:
-	$(MAKE) -C paszlib debug
-
-paszlib_examples:
-	$(MAKE) -C paszlib examples
-
-paszlib_test:
-	$(MAKE) -C paszlib test
-
-paszlib_smart:
-	$(MAKE) -C paszlib smart
-
-paszlib_shared:
-	$(MAKE) -C paszlib shared
-
-paszlib_showinstall:
-	$(MAKE) -C paszlib showinstall
-
-paszlib_install:
-	$(MAKE) -C paszlib install
-
-paszlib_sourceinstall:
-	$(MAKE) -C paszlib sourceinstall
-
-paszlib_zipinstall:
-	$(MAKE) -C paszlib zipinstall
-
-paszlib_zipinstalladd:
-	$(MAKE) -C paszlib zipinstalladd
-
-paszlib_clean:
-	$(MAKE) -C paszlib clean
-
-paszlib_cleanall:
-	$(MAKE) -C paszlib cleanall
-
-paszlib_require:
-	$(MAKE) -C paszlib require
-
-paszlib_info:
-	$(MAKE) -C paszlib info
-endif
-
 # Dir gtk
 
 ifdef OBJECTDIRGTK
@@ -664,6 +589,159 @@ gdbint_info:
 	$(MAKE) -C gdbint info
 endif
 
+# Dir ibase
+
+ifdef OBJECTDIRIBASE
+.PHONY:  ibase_all ibase_debug ibase_examples ibase_test ibase_smart ibase_shared ibase_showinstall ibase_install ibase_sourceinstall ibase_zipinstall ibase_zipinstalladd ibase_clean ibase_cleanall ibase_require ibase_info
+
+ibase_all:
+	$(MAKE) -C ibase all
+
+ibase_debug:
+	$(MAKE) -C ibase debug
+
+ibase_examples:
+	$(MAKE) -C ibase examples
+
+ibase_test:
+	$(MAKE) -C ibase test
+
+ibase_smart:
+	$(MAKE) -C ibase smart
+
+ibase_shared:
+	$(MAKE) -C ibase shared
+
+ibase_showinstall:
+	$(MAKE) -C ibase showinstall
+
+ibase_install:
+	$(MAKE) -C ibase install
+
+ibase_sourceinstall:
+	$(MAKE) -C ibase sourceinstall
+
+ibase_zipinstall:
+	$(MAKE) -C ibase zipinstall
+
+ibase_zipinstalladd:
+	$(MAKE) -C ibase zipinstalladd
+
+ibase_clean:
+	$(MAKE) -C ibase clean
+
+ibase_cleanall:
+	$(MAKE) -C ibase cleanall
+
+ibase_require:
+	$(MAKE) -C ibase require
+
+ibase_info:
+	$(MAKE) -C ibase info
+endif
+
+# Dir mysql
+
+ifdef OBJECTDIRMYSQL
+.PHONY:  mysql_all mysql_debug mysql_examples mysql_test mysql_smart mysql_shared mysql_showinstall mysql_install mysql_sourceinstall mysql_zipinstall mysql_zipinstalladd mysql_clean mysql_cleanall mysql_require mysql_info
+
+mysql_all:
+	$(MAKE) -C mysql all
+
+mysql_debug:
+	$(MAKE) -C mysql debug
+
+mysql_examples:
+	$(MAKE) -C mysql examples
+
+mysql_test:
+	$(MAKE) -C mysql test
+
+mysql_smart:
+	$(MAKE) -C mysql smart
+
+mysql_shared:
+	$(MAKE) -C mysql shared
+
+mysql_showinstall:
+	$(MAKE) -C mysql showinstall
+
+mysql_install:
+	$(MAKE) -C mysql install
+
+mysql_sourceinstall:
+	$(MAKE) -C mysql sourceinstall
+
+mysql_zipinstall:
+	$(MAKE) -C mysql zipinstall
+
+mysql_zipinstalladd:
+	$(MAKE) -C mysql zipinstalladd
+
+mysql_clean:
+	$(MAKE) -C mysql clean
+
+mysql_cleanall:
+	$(MAKE) -C mysql cleanall
+
+mysql_require:
+	$(MAKE) -C mysql require
+
+mysql_info:
+	$(MAKE) -C mysql info
+endif
+
+# Dir zlib
+
+ifdef OBJECTDIRZLIB
+.PHONY:  zlib_all zlib_debug zlib_examples zlib_test zlib_smart zlib_shared zlib_showinstall zlib_install zlib_sourceinstall zlib_zipinstall zlib_zipinstalladd zlib_clean zlib_cleanall zlib_require zlib_info
+
+zlib_all:
+	$(MAKE) -C zlib all
+
+zlib_debug:
+	$(MAKE) -C zlib debug
+
+zlib_examples:
+	$(MAKE) -C zlib examples
+
+zlib_test:
+	$(MAKE) -C zlib test
+
+zlib_smart:
+	$(MAKE) -C zlib smart
+
+zlib_shared:
+	$(MAKE) -C zlib shared
+
+zlib_showinstall:
+	$(MAKE) -C zlib showinstall
+
+zlib_install:
+	$(MAKE) -C zlib install
+
+zlib_sourceinstall:
+	$(MAKE) -C zlib sourceinstall
+
+zlib_zipinstall:
+	$(MAKE) -C zlib zipinstall
+
+zlib_zipinstalladd:
+	$(MAKE) -C zlib zipinstalladd
+
+zlib_clean:
+	$(MAKE) -C zlib clean
+
+zlib_cleanall:
+	$(MAKE) -C zlib cleanall
+
+zlib_require:
+	$(MAKE) -C zlib require
+
+zlib_info:
+	$(MAKE) -C zlib info
+endif
+
 # Dir utmp
 
 ifdef OBJECTDIRUTMP
@@ -1123,3 +1201,11 @@ zlib_info:
 	$(MAKE) -C zlib info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+

+ 5 - 4
packages/Makefile.fpc

@@ -3,10 +3,11 @@
 #
 
 [targets]
-dirs=ibase mysql uncgi paszlib
-dirs_linux=gtk opengl gdbint utmp inet postgres ncurses x11 forms svgalib ggi zlib
-dirs_win32=gtk opengl gdbint
-dirs_go32v2=gdbint
+dirs=paszlib
+dirs_linux=uncgi gtk opengl gdbint ibase mysql zlib \
+           utmp inet postgres ncurses x11 forms svgalib ggi
+dirs_win32=uncgi gtk opengl gdbint ibase mysql zlib
+dirs_go32v2=uncgi gdbint
 
 [sections]
 none=1

+ 109 - 85
packages/forms/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl x11
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -219,11 +240,11 @@ endif
 ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/x11),)
-ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
-PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/x11),)
+ifneq ($(wildcard $(PACKAGESDIR)/x11/$(OS_TARGET)),)
+PACKAGEDIR_X11=$(PACKAGESDIR)/x11/$(OS_TARGET)
 else
-PACKAGEDIR_X11=$(PACKAGEDIR)/x11
+PACKAGEDIR_X11=$(PACKAGESDIR)/x11
 endif
 UNITDIR_X11=$(PACKAGEDIR_X11)
 else
@@ -242,24 +263,10 @@ ifdef UNITDIR_X11
 override NEEDUNITDIR+=$(UNITDIR_X11)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -332,6 +339,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -360,7 +385,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -405,11 +430,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -512,17 +536,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -664,7 +677,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -734,16 +747,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEX11=1
 ifdef PACKAGERTL
@@ -765,7 +768,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package x11_package
+.PHONY:  rtl_package x11_package
 
 #####################################################################
 # Units
@@ -800,14 +803,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -953,6 +956,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1078,6 +1088,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1089,6 +1102,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 114 - 90
packages/forms/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -196,6 +192,32 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl forms x11
+
+# Libraries
+
+override NEEDOTHERLIB=1
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -218,11 +240,11 @@ endif
 ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/forms),)
-ifneq ($(wildcard $(PACKAGEDIR)/forms/$(OS_TARGET)),)
-PACKAGEDIR_FORMS=$(PACKAGEDIR)/forms/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/forms),)
+ifneq ($(wildcard $(PACKAGESDIR)/forms/$(OS_TARGET)),)
+PACKAGEDIR_FORMS=$(PACKAGESDIR)/forms/$(OS_TARGET)
 else
-PACKAGEDIR_FORMS=$(PACKAGEDIR)/forms
+PACKAGEDIR_FORMS=$(PACKAGESDIR)/forms
 endif
 UNITDIR_FORMS=$(PACKAGEDIR_FORMS)
 else
@@ -240,11 +262,11 @@ endif
 ifdef UNITDIR_FORMS
 override NEEDUNITDIR+=$(UNITDIR_FORMS)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/x11),)
-ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
-PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/x11),)
+ifneq ($(wildcard $(PACKAGESDIR)/x11/$(OS_TARGET)),)
+PACKAGEDIR_X11=$(PACKAGESDIR)/x11/$(OS_TARGET)
 else
-PACKAGEDIR_X11=$(PACKAGEDIR)/x11
+PACKAGEDIR_X11=$(PACKAGESDIR)/x11
 endif
 UNITDIR_X11=$(PACKAGEDIR_X11)
 else
@@ -263,25 +285,10 @@ ifdef UNITDIR_X11
 override NEEDUNITDIR+=$(UNITDIR_X11)
 endif
 
-# Libraries
-
-override NEEDOTHERLIB=1
-
-# Info
-
-INFOTARGET=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
@@ -362,6 +369,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -395,7 +420,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -440,11 +465,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -547,17 +571,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -699,7 +712,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -769,16 +782,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEFORMS=1
 PACKAGEX11=1
@@ -810,7 +813,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package forms_package x11_package
+.PHONY:  rtl_package forms_package x11_package
 
 #####################################################################
 # Exes
@@ -831,14 +834,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -984,6 +987,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1109,6 +1119,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1120,4 +1133,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 106 - 82
packages/gdbint/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -202,6 +198,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+override NEEDGCCLIB=1
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -225,25 +247,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-override NEEDGCCLIB=1
-
-# Info
-
-INFOTARGET=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
@@ -324,6 +331,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -370,7 +395,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -415,11 +440,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -522,17 +546,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -674,7 +687,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -746,16 +759,6 @@ info: fpc_info
 .PHONY:  all debug examples smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -767,7 +770,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -802,14 +805,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -955,6 +958,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1080,6 +1090,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1091,6 +1104,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 76 - 46
packages/gdbint/libgdb/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -187,6 +183,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -210,24 +227,29 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
 #####################################################################
-# Standard rules
+# Redirection
 #####################################################################
 
-
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
 endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
 endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
 endif
 
+#####################################################################
+# Standard rules
+#####################################################################
+
+
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -239,7 +261,15 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 105 - 81
packages/ggi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,4 +1074,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 106 - 82
packages/gtk/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -200,6 +196,32 @@ endif
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+LIBNAME=fpgtk
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -223,25 +245,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-LIBNAME=fpgtk
-
-# Info
-
-INFOTARGET=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
@@ -314,6 +321,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -347,7 +372,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -392,11 +417,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -499,17 +523,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -651,7 +664,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -719,16 +732,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -740,7 +743,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -760,14 +763,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -913,6 +916,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1038,6 +1048,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1049,6 +1062,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 107 - 83
packages/gtk/examples/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -201,6 +197,33 @@ endif
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+override NEEDGCCLIB=1
+override NEEDOTHERLIB=1
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -224,26 +247,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-override NEEDGCCLIB=1
-override NEEDOTHERLIB=1
-
-# Info
-
-INFOTARGET=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
@@ -332,6 +339,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -375,7 +400,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -420,11 +445,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -527,17 +551,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -679,7 +692,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -749,16 +762,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -770,7 +773,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -791,14 +794,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -944,6 +947,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1069,6 +1079,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1080,4 +1093,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 107 - 83
packages/gtk/tutorial/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -200,6 +196,33 @@ endif
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+override NEEDGCCLIB=1
+override NEEDOTHERLIB=1
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -223,26 +246,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-override NEEDGCCLIB=1
-override NEEDOTHERLIB=1
-
-# Info
-
-INFOTARGET=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
@@ -331,6 +338,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -374,7 +399,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -419,11 +444,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -526,17 +550,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -678,7 +691,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -748,16 +761,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -769,7 +772,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -790,14 +793,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -943,6 +946,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1068,6 +1078,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1079,4 +1092,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 105 - 81
packages/ibase/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,6 +1074,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 105 - 81
packages/inet/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,6 +1074,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 105 - 81
packages/mysql/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,6 +1074,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 105 - 81
packages/ncurses/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,6 +1074,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 76 - 46
packages/opengl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -188,6 +184,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -211,8 +228,23 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
+#####################################################################
+# Redirection
+#####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
 
 #####################################################################
 # Standard rules
@@ -247,16 +279,6 @@ require: $(addsuffix _require,$(DIROBJECTS))
 .PHONY:  all debug test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall require
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -268,7 +290,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 
 # Target Dirs
@@ -430,6 +452,14 @@ build_info:
 	$(MAKE) -C build info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+
 #####################################################################
 # Users rules
 #####################################################################

+ 105 - 81
packages/opengl/build/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl fcl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -242,24 +263,10 @@ ifdef UNITDIR_FCL
 override NEEDUNITDIR+=$(UNITDIR_FCL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -332,6 +339,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -360,7 +385,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -405,11 +430,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -512,17 +536,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -664,7 +677,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -734,16 +747,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEFCL=1
 ifdef PACKAGERTL
@@ -765,7 +768,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package fcl_package
+.PHONY:  rtl_package fcl_package
 
 #####################################################################
 # Units
@@ -800,14 +803,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -953,6 +956,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1078,6 +1088,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1089,4 +1102,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 114 - 90
packages/opengl/examples/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -196,6 +192,32 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl opengl x11
+
+# Libraries
+
+override NEEDOTHERLIB=1
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -218,11 +240,11 @@ endif
 ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/opengl),)
-ifneq ($(wildcard $(PACKAGEDIR)/opengl/$(OS_TARGET)),)
-PACKAGEDIR_OPENGL=$(PACKAGEDIR)/opengl/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/opengl),)
+ifneq ($(wildcard $(PACKAGESDIR)/opengl/$(OS_TARGET)),)
+PACKAGEDIR_OPENGL=$(PACKAGESDIR)/opengl/$(OS_TARGET)
 else
-PACKAGEDIR_OPENGL=$(PACKAGEDIR)/opengl
+PACKAGEDIR_OPENGL=$(PACKAGESDIR)/opengl
 endif
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)
 else
@@ -240,11 +262,11 @@ endif
 ifdef UNITDIR_OPENGL
 override NEEDUNITDIR+=$(UNITDIR_OPENGL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/x11),)
-ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
-PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/x11),)
+ifneq ($(wildcard $(PACKAGESDIR)/x11/$(OS_TARGET)),)
+PACKAGEDIR_X11=$(PACKAGESDIR)/x11/$(OS_TARGET)
 else
-PACKAGEDIR_X11=$(PACKAGEDIR)/x11
+PACKAGEDIR_X11=$(PACKAGESDIR)/x11
 endif
 UNITDIR_X11=$(PACKAGEDIR_X11)
 else
@@ -263,25 +285,10 @@ ifdef UNITDIR_X11
 override NEEDUNITDIR+=$(UNITDIR_X11)
 endif
 
-# Libraries
-
-override NEEDOTHERLIB=1
-
-# Info
-
-INFOTARGET=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
@@ -362,6 +369,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -395,7 +420,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -440,11 +465,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -547,17 +571,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -699,7 +712,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -769,16 +782,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEOPENGL=1
 PACKAGEX11=1
@@ -810,7 +813,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package opengl_package x11_package
+.PHONY:  rtl_package opengl_package x11_package
 
 #####################################################################
 # Exes
@@ -831,14 +834,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -984,6 +987,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1109,6 +1119,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1120,4 +1133,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 109 - 85
packages/opengl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -110,6 +128,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -137,46 +159,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -202,6 +198,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl x11
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -224,11 +245,11 @@ endif
 ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/x11),)
-ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
-PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/x11),)
+ifneq ($(wildcard $(PACKAGESDIR)/x11/$(OS_TARGET)),)
+PACKAGEDIR_X11=$(PACKAGESDIR)/x11/$(OS_TARGET)
 else
-PACKAGEDIR_X11=$(PACKAGEDIR)/x11
+PACKAGEDIR_X11=$(PACKAGESDIR)/x11
 endif
 UNITDIR_X11=$(PACKAGEDIR_X11)
 else
@@ -247,24 +268,10 @@ ifdef UNITDIR_X11
 override NEEDUNITDIR+=$(UNITDIR_X11)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -337,6 +344,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -365,7 +390,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -410,11 +435,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -517,17 +541,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -669,7 +682,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -739,16 +752,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEX11=1
 ifdef PACKAGERTL
@@ -770,7 +773,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package x11_package
+.PHONY:  rtl_package x11_package
 
 #####################################################################
 # Units
@@ -790,14 +793,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -943,6 +946,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1068,6 +1078,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1079,4 +1092,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 105 - 81
packages/paszlib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -198,6 +194,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -221,24 +242,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -311,6 +318,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -339,7 +364,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -384,11 +409,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -491,17 +515,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -643,7 +656,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -717,16 +730,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -738,7 +741,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -773,14 +776,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -926,6 +929,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1051,6 +1061,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1062,4 +1075,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 105 - 81
packages/postgres/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,4 +1074,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 105 - 81
packages/svgalib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,4 +1074,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 105 - 81
packages/uncgi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,4 +1074,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 105 - 81
packages/utmp/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -716,16 +729,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -737,7 +740,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -772,14 +775,14 @@ fpc_test: examples
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +928,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1060,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,6 +1074,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 105 - 81
packages/x11/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -196,6 +192,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -219,24 +240,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -309,6 +316,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -337,7 +362,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -382,11 +407,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -489,17 +513,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -641,7 +654,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -711,16 +724,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -732,7 +735,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -752,14 +755,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -905,6 +908,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1030,6 +1040,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1041,4 +1054,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 105 - 81
packages/zlib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -196,6 +192,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -219,24 +240,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -309,6 +316,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -337,7 +362,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -382,11 +407,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -489,17 +513,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -641,7 +654,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -711,16 +724,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -732,7 +735,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -752,14 +755,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -905,6 +908,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1030,6 +1040,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1041,4 +1054,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 76 - 46
rtl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -188,6 +184,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -211,8 +228,23 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
+#####################################################################
+# Redirection
+#####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
 
 #####################################################################
 # Standard rules
@@ -251,16 +283,6 @@ info: $(addsuffix _info,$(OS_TARGET))
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall require info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -272,7 +294,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 
 # Target Dirs
@@ -538,3 +560,11 @@ go32v1_info:
 	$(MAKE) -C go32v1 info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+

+ 100 - 67
rtl/go32v1/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -111,6 +129,26 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+RTL=..
+INC=../inc
+PROCINC=../$(CPU_TARGET)
+
+UNITPREFIX=rtl
+
+# Paths
+OBJPASDIR=$(RTL)/objpas
+GRAPHDIR=$(INC)/graph
+
+# Define Go32v2 Units
+SYSTEMUNIT=system
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -138,50 +176,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-RTL=..
-INC=../inc
-PROCINC=../$(CPU_TARGET)
-
-UNITPREFIX=rtl
-
-# Paths
-OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-
-# Define Go32v2 Units
-SYSTEMUNIT=system
-
 # Targets
 
 override LOADEROBJECTS+=prt0
@@ -215,7 +223,9 @@ endif
 
 INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
+#####################################################################
 # Post Settings
+#####################################################################
 
 SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
 
@@ -234,17 +244,14 @@ SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
 # Put system unit dependencies together.
 SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 
+
+# Package/component dirs
+
+
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -317,6 +324,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -351,7 +376,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -396,11 +421,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -503,17 +527,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -655,7 +668,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -725,7 +738,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-
 #####################################################################
 # Loaders
 #####################################################################
@@ -772,14 +784,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +937,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1069,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,6 +1083,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 101 - 68
rtl/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -111,6 +129,26 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+RTL=..
+INC=../inc
+PROCINC=../$(CPU_TARGET)
+
+UNITPREFIX=rtl
+
+# Paths
+OBJPASDIR=$(RTL)/objpas
+GRAPHDIR=$(INC)/graph
+
+# Define Go32v2 Units
+SYSTEMUNIT=system
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -138,54 +176,24 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-RTL=..
-INC=../inc
-PROCINC=../$(CPU_TARGET)
-
-UNITPREFIX=rtl
-
-# Paths
-OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-
-# Define Go32v2 Units
-SYSTEMUNIT=system
-
 # Targets
 
 override LOADEROBJECTS+=prt0 exceptn fpu
-override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings go32 dpmiexcp initc profile dxeload emu387 dos crt objects printer graph sysutils math typinfo cpu mmx getopts heaptrc msmouse ports
+override UNITOBJECTS+=$(SYSTEMUNIT) objpas strings go32  dpmiexcp initc profile dxeload emu387 dos crt objects printer graph sysutils math typinfo cpu mmx getopts heaptrc msmouse ports
 
 # Clean
 
@@ -215,7 +223,9 @@ endif
 
 INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
+#####################################################################
 # Post Settings
+#####################################################################
 
 SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
 
@@ -234,17 +244,14 @@ SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
 # Put system unit dependencies together.
 SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 
+
+# Package/component dirs
+
+
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -317,6 +324,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -351,7 +376,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -396,11 +421,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -503,17 +527,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -655,7 +668,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -725,7 +738,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-
 #####################################################################
 # Loaders
 #####################################################################
@@ -772,14 +784,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +937,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1069,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,6 +1083,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 109 - 76
rtl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -111,6 +129,35 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+RTL=..
+INC=$(RTL)/inc
+PROCINC=$(RTL)/$(CPU_TARGET)
+
+UNITPREFIX=rtl
+
+# Paths
+OBJPASDIR=$(RTL)/objpas
+GRAPHDIR=$(INC)/graph
+
+# Define Go32v2 Units
+SYSTEMUNIT=syslinux
+
+# Use new graph unit ?
+# NEWGRAPH=YES
+# Use LibGGI ?
+# Use
+#
+ifndef USELIBGGI
+USELIBGGI=NO
+endif
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -138,59 +185,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-RTL=..
-INC=$(RTL)/inc
-PROCINC=$(RTL)/$(CPU_TARGET)
-
-UNITPREFIX=rtl
-
-# Paths
-OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-
-# Define Go32v2 Units
-SYSTEMUNIT=syslinux
-
-# Use new graph unit ?
-# NEWGRAPH=YES
-# Use LibGGI ?
-# Use
-#
-ifndef USELIBGGI
-USELIBGGI=NO
-endif
-
 # Targets
 
 override LOADEROBJECTS+=prt0 cprt0 gprt0 cprt21 gprt21
@@ -226,7 +234,9 @@ SHAREDLIBOBJECTUNITS=$(SYSTEMUNIT) objpas strings linux ports dos crt objects pr
 
 INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
+#####################################################################
 # Post Settings
+#####################################################################
 
 SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
 
@@ -245,17 +255,14 @@ SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
 # Put system unit dependencies together.
 SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 
+
+# Package/component dirs
+
+
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -328,6 +335,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -362,7 +387,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -407,11 +432,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -514,17 +538,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -666,7 +679,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -736,7 +749,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-
 #####################################################################
 # Loaders
 #####################################################################
@@ -783,14 +795,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -936,6 +948,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1061,6 +1080,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1072,6 +1094,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 100 - 67
rtl/os2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -111,6 +129,26 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+RTL=..
+INC=$(RTL)/inc
+PROCINC=$(RTL)/$(CPU_TARGET)
+
+UNITPREFIX=rtl
+
+# Paths
+OBJPASDIR=$(RTL)/objpas
+GRAPHDIR=$(INC)/graph
+
+# Define Go32v2 Units
+SYSTEMUNIT=sysos2
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -138,50 +176,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-RTL=..
-INC=$(RTL)/inc
-PROCINC=$(RTL)/$(CPU_TARGET)
-
-UNITPREFIX=rtl
-
-# Paths
-OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-
-# Define Go32v2 Units
-SYSTEMUNIT=sysos2
-
 # Targets
 
 override LOADEROBJECTS+=prt0 prt1 code2 code3
@@ -215,7 +223,9 @@ endif
 
 INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
+#####################################################################
 # Post Settings
+#####################################################################
 
 SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
 
@@ -234,17 +244,14 @@ SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
 # Put system unit dependencies together.
 SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 
+
+# Package/component dirs
+
+
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -317,6 +324,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -351,7 +376,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -396,11 +421,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -503,17 +527,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -655,7 +668,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -725,7 +738,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-
 #####################################################################
 # Loaders
 #####################################################################
@@ -772,14 +784,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -925,6 +937,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1050,6 +1069,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1061,6 +1083,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 105 - 72
rtl/win32/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # Default target
 #####################################################################
@@ -111,6 +129,31 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+RTL=..
+INC=$(RTL)/inc
+PROCINC=$(RTL)/$(CPU_TARGET)
+WININC=wininc
+
+UNITPREFIX=rtl
+
+# Paths
+OBJPASDIR=$(RTL)/objpas
+GRAPHDIR=$(INC)/graph
+
+SYSTEMUNIT=syswin32
+
+# Files used by windows.pp
+include $(WININC)/makefile.inc
+
+WINDOWS_SOURCE_FILES=$(addprefix $(WININC)/,$(addsuffix .inc,$(WINDOWS_FILES)))
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -138,55 +181,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-RTL=..
-INC=$(RTL)/inc
-PROCINC=$(RTL)/$(CPU_TARGET)
-WININC=wininc
-
-UNITPREFIX=rtl
-
-# Paths
-OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-
-SYSTEMUNIT=syswin32
-
-# Files used by windows.pp
-include $(WININC)/makefile.inc
-
-WINDOWS_SOURCE_FILES=$(addprefix $(WININC)/,$(addsuffix .inc,$(WINDOWS_FILES)))
-
 # Targets
 
 override LOADEROBJECTS+=wprt0 wdllprt0
@@ -220,7 +228,9 @@ endif
 
 INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
+#####################################################################
 # Post Settings
+#####################################################################
 
 SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
 
@@ -239,17 +249,14 @@ SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
 # Put system unit dependencies together.
 SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 
+
+# Package/component dirs
+
+
 #####################################################################
 # Default Directories
 #####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
-endif
-
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
@@ -322,6 +329,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -356,7 +381,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -401,11 +426,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -508,17 +532,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -660,7 +673,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -730,7 +743,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-
 #####################################################################
 # Loaders
 #####################################################################
@@ -777,14 +789,14 @@ fpc_units: $(UNITPPUFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -930,6 +942,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1055,6 +1074,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1066,6 +1088,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 77 - 47
tests/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: info
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -123,46 +145,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -187,6 +183,27 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -210,8 +227,23 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
+#####################################################################
+# Redirection
+#####################################################################
 
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
 
 #####################################################################
 # Default extensions
@@ -262,7 +294,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -306,16 +338,6 @@ endif
 #####################################################################
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -327,7 +349,15 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 121 - 97
utils/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -213,6 +209,31 @@ endif
 ifeq ($(OS_TARGET),os2)
 override PACKAGES+=paszlib
 endif
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -257,11 +278,11 @@ endif
 ifdef UNITDIR_FCL
 override NEEDUNITDIR+=$(UNITDIR_FCL)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/zlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/zlib/$(OS_TARGET)),)
-PACKAGEDIR_ZLIB=$(PACKAGEDIR)/zlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/zlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/zlib/$(OS_TARGET)),)
+PACKAGEDIR_ZLIB=$(PACKAGESDIR)/zlib/$(OS_TARGET)
 else
-PACKAGEDIR_ZLIB=$(PACKAGEDIR)/zlib
+PACKAGEDIR_ZLIB=$(PACKAGESDIR)/zlib
 endif
 UNITDIR_ZLIB=$(PACKAGEDIR_ZLIB)
 else
@@ -279,11 +300,11 @@ endif
 ifdef UNITDIR_ZLIB
 override NEEDUNITDIR+=$(UNITDIR_ZLIB)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib/$(OS_TARGET)),)
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib/$(OS_TARGET)),)
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib/$(OS_TARGET)
 else
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib
 endif
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
 else
@@ -301,11 +322,11 @@ endif
 ifdef UNITDIR_PASZLIB
 override NEEDUNITDIR+=$(UNITDIR_PASZLIB)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib/$(OS_TARGET)),)
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib/$(OS_TARGET)),)
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib/$(OS_TARGET)
 else
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib
 endif
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
 else
@@ -323,11 +344,11 @@ endif
 ifdef UNITDIR_PASZLIB
 override NEEDUNITDIR+=$(UNITDIR_PASZLIB)
 endif
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib),)
-ifneq ($(wildcard $(PACKAGEDIR)/paszlib/$(OS_TARGET)),)
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib/$(OS_TARGET)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib),)
+ifneq ($(wildcard $(PACKAGESDIR)/paszlib/$(OS_TARGET)),)
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib/$(OS_TARGET)
 else
-PACKAGEDIR_PASZLIB=$(PACKAGEDIR)/paszlib
+PACKAGEDIR_PASZLIB=$(PACKAGESDIR)/paszlib
 endif
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
 else
@@ -346,24 +367,10 @@ ifdef UNITDIR_PASZLIB
 override NEEDUNITDIR+=$(UNITDIR_PASZLIB)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -436,6 +443,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -469,7 +494,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -514,11 +539,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -621,17 +645,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -784,7 +797,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -860,16 +873,6 @@ info: fpc_info
 .PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall require info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 PACKAGEFCL=1
 ifeq ($(OS_TARGET),linux)
@@ -921,7 +924,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package fcl_package zlib_package paszlib_package
+.PHONY:  rtl_package fcl_package zlib_package paszlib_package
 
 #####################################################################
 # Exes
@@ -942,14 +945,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -1095,6 +1098,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1220,6 +1230,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1231,6 +1244,9 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
 
 
 # Target Dirs
@@ -1340,6 +1356,14 @@ h2pas_info:
 	$(MAKE) -C h2pas info
 endif
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+
 #####################################################################
 # Users rules
 #####################################################################

+ 236 - 133
utils/fprcp/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 2000/01/10 16:42
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -52,13 +52,31 @@ else
 EXEEXT=.exe
 endif
 
-# The path which is search separated by spaces
+# The path which is searched separated by spaces
 ifdef inlinux
 SEARCHPATH=$(subst :, ,$(PATH))
 else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -67,66 +85,86 @@ endif
 ifndef FPC
 # Compatibility with old makefiles
 ifdef PP
-export FPC=$(PP)
+FPC=$(PP)
 else
 ifdef inOS2
-export FPC=ppos2$(EXEEXT)
+FPC=ppos2$(EXEEXT)
 else
-export FPC=ppc386$(EXEEXT)
+FPC=ppc386$(EXEEXT)
 endif
 endif
 endif
 
 # Target OS
 ifndef OS_TARGET
-export OS_TARGET:=$(shell $(FPC) -iTO)
+OS_TARGET:=$(shell $(FPC) -iTO)
 endif
 
 # Source OS
 ifndef OS_SOURCE
-export OS_SOURCE:=$(shell $(FPC) -iSO)
+OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 
 # Target CPU
 ifndef CPU_TARGET
-export CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 
 # Source CPU
 ifndef CPU_SOURCE
-export CPU_SOURCE:=$(shell $(FPC) -iSP)
+CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 
 # FPC version
 ifndef FPC_VERSION
-export FPC_VERSION:=$(shell $(FPC) -iV)
+FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 
+export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
+
 #####################################################################
-# Default Settings
+# FPCDIR Setting
 #####################################################################
 
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
+# Default FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR=../..
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=wrong
+endif
 endif
 
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
+# Detect FPCDIR
+ifeq ($(FPCDIR),wrong)
+ifdef inlinux
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
 endif
 
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
+endif
+# Create units dir
+ifneq ($(FPCDIR),.)
+UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
 #####################################################################
@@ -151,18 +189,10 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef FPCDIR
-FPCDIR=../..
-endif
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
-endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
-endif
 
 # Packages
 
+override PACKAGES+=rtl
 
 # Libraries
 
@@ -171,40 +201,59 @@ endif
 
 INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
-#####################################################################
-# Default Directories
-#####################################################################
 
-# Base dir
-ifdef PWD
-BASEDIR:=$(shell $(PWD))
-else
-BASEDIR=.
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
 endif
 
-# this can be set to 'rtl' when the RTL units are installed
-ifndef UNITPREFIX
-UNITPREFIX=units
+ifneq ($(wildcard $(FPCDIR)/rtl),)
+ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+else
+PACKAGEDIR_RTL=$(FPCDIR)/rtl
 endif
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+else
+PACKAGEDIR_RTL=
+ifneq ($(wildcard $(UNITSDIR)/rtl),)
+ifneq ($(wildcard $(UNITSDIR)/rtl/$(OS_TARGET)),)
+UNITDIR_RTL=$(UNITSDIR)/rtl/$(OS_TARGET)
+else
+UNITDIR_RTL=$(UNITSDIR)/rtl
+endif
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override NEEDUNITDIR+=$(UNITDIR_RTL)
+endif
+
+#####################################################################
+# Default Directories
+#####################################################################
 
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
-export PREFIXINSTALLDIR=/usr
+PREFIXINSTALLDIR=/usr
 else
-export PREFIXINSTALLDIR=/pp
-endif
-endif
-
-# create fcldir,rtldir,unitdir
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-ifneq ($(FPCDIR),.)
-override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
-override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+PREFIXINSTALLDIR=/pp
 endif
 endif
+export PREFIXINSTALLDIR
 
 #####################################################################
 # Install Directories
@@ -230,7 +279,10 @@ endif
 
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
-UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)
+ifdef UNITSUBDIR
+UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
+endif
 endif
 
 # Where to install shared libraries
@@ -254,15 +306,33 @@ endif
 # Where the doc files will be stored
 ifndef DOCINSTALLDIR
 ifdef inlinux
-DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
 else
 DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
 endif
 endif
 
 # Where the some extra (data)files will be stored
-ifndef EXTRAINSTALLDIR
-EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+ifndef DATAINSTALLDIR
+DATAINSTALLDIR=$(BASEINSTALLDIR)
+endif
+
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
 endif
 
 
@@ -278,8 +348,8 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef RTLDIR
-override FPCOPT+=-Fu$(RTLDIR)
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
 endif
 
 ifdef UNITSDIR
@@ -293,7 +363,17 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
+endif
+
+# Release mode (strip, optimize and don't load ppc386.cfg)
+ifdef RELEASE
+override FPCOPT+=-Xs -OG2p3 -n
+endif
+
+# Verbose settings (warning,note,info)
+ifdef VERBOSE
+override FPCOPT+=-vwni
 endif
 
 # Add commandline options
@@ -328,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -344,65 +423,62 @@ override COMPILER:=$(FPC) $(FPCOPT)
 
 # To copy pograms
 ifndef COPY
-export COPY:=cp -fp
+COPY:=cp -fp
 endif
 
 # Copy a whole tree
 ifndef COPYTREE
-export COPYTREE:=cp -rfp
+COPYTREE:=cp -rfp
 endif
 
 # To move pograms
 ifndef MOVE
-export MOVE:=mv -f
+MOVE:=mv -f
 endif
 
 # Check delete program
 ifndef DEL
-export DEL:=rm -f
+DEL:=rm -f
 endif
 
 # Check deltree program
 ifndef DELTREE
-export DELTREE:=rm -rf
+DELTREE:=rm -rf
 endif
 
 # To install files
 ifndef INSTALL
 ifdef inlinux
-export INSTALL:=install -m 644
+INSTALL:=install -m 644
 else
-export INSTALL:=$(COPY)
+INSTALL:=$(COPY)
 endif
 endif
 
 # To install programs
 ifndef INSTALLEXE
 ifdef inlinux
-export INSTALLEXE:=install -m 755
+INSTALLEXE:=install -m 755
 else
-export INSTALLEXE:=$(COPY)
+INSTALLEXE:=$(COPY)
 endif
 endif
 
 # To make a directory.
 ifndef MKDIR
 ifdef inlinux
-export MKDIR:=install -m 755 -d
+MKDIR:=install -m 755 -d
 else
-export MKDIR:=ginstall -m 755 -d
+MKDIR:=ginstall -m 755 -d
 endif
 endif
 
+export COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+
 #####################################################################
 # Default Tools
 #####################################################################
 
-# file used to check if a package is compiled
-ifndef FPCMAKED
-FPCMAKED=fpcmaked
-endif
-
 # assembler, redefine it if cross compiling
 ifndef AS
 AS=as
@@ -438,25 +514,16 @@ 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
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(PPDEP),)
 PPDEP=
 else
-export PPDEP:=$(firstword $(PPDEP))
+PPDEP:=$(firstword $(PPDEP))
 endif
 endif
+export PPDEP
 
 # ppumove
 ifndef PPUMOVE
@@ -464,9 +531,10 @@ PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUMOVE),)
 PPUMOVE=
 else
-export PPUMOVE:=$(firstword $(PPUMOVE))
+PPUMOVE:=$(firstword $(PPUMOVE))
 endif
 endif
+export PPUMOVE
 
 # ppufiles
 ifndef PPUFILES
@@ -474,9 +542,10 @@ PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(PPUFILES),)
 PPUFILES=
 else
-export PPUFILES:=$(firstword $(PPUFILES))
+PPUFILES:=$(firstword $(PPUFILES))
 endif
 endif
+export PPUFILES
 
 # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
 # upx uses that one itself (PFV)
@@ -492,12 +561,13 @@ UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(UPXPROG),)
 UPXPROG=
 else
-export UPXPROG:=$(firstword $(UPXPROG))
+UPXPROG:=$(firstword $(UPXPROG))
 endif
 else
 UPXPROG=
 endif
 endif
+export UPXPROG
 
 # gdate/date
 ifndef DATE
@@ -507,12 +577,13 @@ DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
 ifeq ($(DATE),)
 DATE=
 else
-export DATE:=$(firstword $(DATE))
+DATE:=$(firstword $(DATE))
 endif
 else
-export DATE:=$(firstword $(DATE))
+DATE:=$(firstword $(DATE))
 endif
 endif
+export DATE
 
 ifdef DATE
 DATESTR:=$(shell $(DATE) +%Y%m%d)
@@ -526,9 +597,10 @@ ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ZIPPROG),)
 ZIPPROG=
 else
-export ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
+ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
 endif
 endif
+export ZIPPROG
 
 ifndef ZIPEXT
 ZIPEXT=.zip
@@ -547,7 +619,9 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
+FPCMADE=fpcmade
 
 # Go32v1
 ifeq ($(OS_TARGET),go32v1)
@@ -558,16 +632,19 @@ SMARTEXT=.sl1
 STATICLIBEXT=.a1
 SHAREDLIBEXT=.so1
 PACKAGESUFFIX=v1
+FPCMADE=fpcmade.v1
 endif
 
 # Go32v2
 ifeq ($(OS_TARGET),go32v2)
 PACKAGESUFFIX=go32
+FPCMADE=fpcmade.dos
 endif
 
 # Linux
 ifeq ($(OS_TARGET),linux)
 PACKAGESUFFIX=linux
+FPCMADE=fpcmade.lnx
 endif
 
 # Win32
@@ -578,7 +655,8 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
+FPCMADE=fpcmade.w32
 endif
 
 # OS/2
@@ -590,6 +668,7 @@ SMARTEXT=.so
 STATICLIBEXT=.ao2
 SHAREDLIBEXT=.dll
 PACKAGESUFFIX=os2
+FPCMADE=fpcmade.os2
 endif
 
 # library prefix
@@ -645,15 +724,15 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
-#####################################################################
-# Package depends
-#####################################################################
 
-ifneq ($(wildcard $(RTLDIR)),)
-ifeq ($(wildcard $(RTLDIR)/$(FPCMAKED)),)
+PACKAGERTL=1
+ifdef PACKAGERTL
+ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
+ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
 override COMPILEPACKAGES+=rtl
 rtl_package:
-	$(MAKE) -C $(RTLDIR) all
+	$(MAKE) -C $(PACKAGEDIR_RTL) all
+endif
 endif
 endif
 
@@ -678,14 +757,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMAKED):
-	@$(ECHO) Compiled > $(FPCMAKED)
+$(FPCMADE): $(ALLTARGET)
+	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMAKED)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -727,12 +806,12 @@ fpc_smart:
 fpc_shared: all
 ifdef inlinux
 ifndef LIBNAME
-	@$(ECHO) LIBNAME not set
+	@$(ECHO) "LIBNAME not set"
 else
 	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
 endif
 else
-	@$(ECHO) Shared Libraries not supported
+	@$(ECHO) "Shared Libraries not supported"
 endif
 
 #####################################################################
@@ -754,25 +833,25 @@ else
 INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
 endif
 else
-INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES))
+INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
 endif
 endif
 
 fpc_showinstall: $(SHOWINSTALLTARGET)
 ifdef INSTALLEXEFILES
-	@$(ECHO) $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+	@$(ECHO) -e $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
 endif
 ifdef INSTALLPPUFILES
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
 ifneq ($(INSTALLPPULINKFILES),)
-	@$(ECHO) $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
 endif
 ifneq ($(INSTALLPPULIBFILES),)
-	@$(ECHO) $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
+	@$(ECHO) -e $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	@$(ECHO) $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+	@$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -797,8 +876,8 @@ ifneq ($(INSTALLPPULIBFILES),)
 endif
 endif
 ifdef EXTRAINSTALLFILES
-	$(MKDIR) $(EXTRAINSTALLDIR)
-	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+	$(MKDIR) $(DATAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
 endif
 
 #####################################################################
@@ -831,6 +910,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -841,8 +927,8 @@ endif
 # Note: This will not remove the zipfile first
 fpc_zipinstalladd:
 ifndef ZIPNAME
-	@$(ECHO) Please specify ZIPNAME!
-	@exit
+	@$(ECHO) "Please specify ZIPNAME!"
+	@exit 1
 else
 	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
 ifdef inlinux
@@ -858,8 +944,8 @@ endif
 # First remove the zip and then install
 fpc_zipinstall:
 ifndef ZIPNAME
-	@$(ECHO) Please specify ZIPNAME!
-	@exit
+	@$(ECHO) "Please specify ZIPNAME!"
+	@exit 1
 else
 	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)
 	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
@@ -885,7 +971,7 @@ ifdef CLEANPPUFILES
 ifdef PPUFILES
 CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
 else
-CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES))
+CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
 endif
 endif
 
@@ -899,18 +985,21 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
-	-$(DEL) $(FPCMAKED) $(PPAS) link.res $(REDIRFILE)
+	-$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
 
 fpc_cleanall: $(CLEANTARGET)
 ifdef CLEANEXEFILES
 	-$(DEL) $(CLEANEXEFILES)
 endif
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMAKED) $(PPAS) link.res $(REDIRFILE)
+	-$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
 
 #####################################################################
 # Info rules
@@ -953,6 +1042,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -962,9 +1054,20 @@ endif
 	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
 	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
-	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
+	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
 	@$(ECHO)
 
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+
 #####################################################################
 # Users rules
 #####################################################################

+ 105 - 81
utils/h2pas/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -198,6 +194,31 @@ override NEEDOPT=-Sg
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -221,24 +242,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -311,6 +318,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -343,7 +368,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -388,11 +413,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -495,17 +519,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -647,7 +660,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -717,16 +730,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -738,7 +741,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -759,14 +762,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -912,6 +915,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1037,6 +1047,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1048,6 +1061,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules

+ 105 - 81
utils/simulator/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,46 +153,20 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
+endif
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
@@ -197,6 +193,31 @@ ZIPTARGET=install
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -220,24 +241,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -310,6 +317,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -338,7 +363,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -383,11 +408,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -490,17 +514,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -642,7 +655,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -712,16 +725,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -733,7 +736,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -754,14 +757,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -907,6 +910,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1032,6 +1042,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1043,4 +1056,15 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 

+ 114 - 89
utils/tply/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/06]
+# Makefile generated by fpcmake v0.99.13 [2000/01/10]
 #
 
 defaultrule: all
@@ -59,6 +59,24 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -104,6 +122,19 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+#####################################################################
+# Pre Settings
+#####################################################################
+
+ifdef inlinux
+CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
+else
+CODPATH=$(BININSTALLDIR)
+endif
+#####################################################################
+# FPCDIR Setting
+#####################################################################
+
 # Test FPCDIR to look if the RTL dir exists
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -131,59 +162,25 @@ override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(adds
 endif
 endif
 
-ifndef PACKAGEDIR
-PACKAGEDIR=$(FPCDIR)/packages
+ifndef PACKAGESDIR
+PACKAGESDIR=$(FPCDIR)/packages
 endif
-ifndef COMPONENTDIR
-COMPONENTDIR=$(FPCDIR)/components
+ifndef TOOLKITSDIR
+TOOLKITSDIR=
+endif
+ifndef COMPONENTSDIR
+COMPONENTSDIR=
 endif
 # Create units dir
 ifneq ($(FPCDIR),.)
 UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
-# Check if the dirs really exists, else turn it off
-ifeq ($(wildcard $(UNITSDIR)),)
-UNITSDIR=
-endif
-ifeq ($(wildcard $(PACKAGEDIR)),)
-PACKAGEDIR=
-endif
-ifeq ($(wildcard $(COMPONENTDIR)),)
-COMPONENTDIR=
-endif
-
-#####################################################################
-# Default Settings
-#####################################################################
-
-# Release ? Then force OPT and don't use extra opts via commandline
-ifndef REDIRFILE
-REDIRFILE=log
-endif
-
-ifdef REDIR
-ifndef inlinux
-override FPC=redir -eo $(FPC)
-endif
-# set the verbosity to max
-override OPT+=-va
-override REDIR:= >> $(REDIRFILE)
-endif
-
 #####################################################################
 # User Settings
 #####################################################################
 
 
-# Pre Settings
-
-ifdef inlinux
-CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
-else
-CODPATH=$(BININSTALLDIR)
-endif
-
 # Targets
 
 override UNITOBJECTS+=lexlib yacclib
@@ -209,6 +206,31 @@ override NEEDOPT=-Sg
 # Packages
 
 override PACKAGES+=rtl
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+
+# Package/component dirs
+
+# Check if the dirs really exists, else turn it off
+ifeq ($(wildcard $(UNITSDIR)),)
+UNITSDIR=
+endif
+ifeq ($(wildcard $(TOOLKITSDIR)),)
+TOOLKITSDIR=
+endif
+ifeq ($(wildcard $(PACKAGESDIR)),)
+PACKAGESDIR=
+endif
+ifeq ($(wildcard $(COMPONENTSDIR)),)
+COMPONENTSDIR=
+endif
+
 ifneq ($(wildcard $(FPCDIR)/rtl),)
 ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
@@ -232,24 +254,10 @@ ifdef UNITDIR_RTL
 override NEEDUNITDIR+=$(UNITDIR_RTL)
 endif
 
-# Libraries
-
-
-# Info
-
-INFOTARGET=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
@@ -322,6 +330,24 @@ ifndef DATAINSTALLDIR
 DATAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
+#####################################################################
+# Redirection
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override FPCOPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
 
 #####################################################################
 # Compiler Command Line
@@ -354,7 +380,7 @@ endif
 
 # Debug
 ifdef DEBUG
-override FPCOPT+=-g
+override FPCOPT+=-g -dDEBUG
 endif
 
 # Release mode (strip, optimize and don't load ppc386.cfg)
@@ -399,11 +425,10 @@ ifdef CFGFILE
 override FPCOPT+=@$(CFGFILE)
 endif
 
-# For win32 the options are passed using the environment variable FPCEXTCMD
+# For win32 the options are passed using the file fpcext.cmd
 ifeq ($(OS_SOURCE),win32)
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
+override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
+override FPCOPT:[email protected]
 endif
 
 # Compiler commandline
@@ -506,17 +531,6 @@ else
 LDCONFIG=
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # ppdep
 ifndef PPDEP
 PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
@@ -658,7 +672,7 @@ ASMEXT=.sw
 SMARTEXT=.slw
 STATICLIBEXT=.aw
 SHAREDLIBEXT=.dll
-PACKAGESUFFIX=win32
+PACKAGESUFFIX=w32
 FPCMADE=fpcmade.w32
 endif
 
@@ -728,16 +742,6 @@ info: fpc_info
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
-ifdef PACKAGERTL
-ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=rtl
-rtl_package:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
-endif
-endif
-
 PACKAGERTL=1
 ifdef PACKAGERTL
 ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
@@ -749,7 +753,7 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package rtl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -784,14 +788,14 @@ fpc_exes: $(EXEFILES)
 # General compile rules
 #####################################################################
 
-.PHONY: fpc_all fpc_debug
+.PHONY: fpc_packages fpc_all fpc_debug
 
-$(FPCMADE):
+$(FPCMADE): $(ALLTARGET)
 	@$(ECHO) Compiled > $(FPCMADE)
 
-fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
-	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
-	 $(ALLTARGET) $(FPCMADE)
+fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES))
+
+fpc_all: fpc_packages $(FPCMADE)
 
 fpc_debug:
 	$(MAKE) all DEBUG=1
@@ -937,6 +941,13 @@ ifndef DESTZIPDIR
 DESTZIPDIR:=$(BASEDIR)
 endif
 
+# Maybe create default zipname from packagename
+ifndef ZIPNAME
+ifdef PACKAGENAME
+ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)
+endif
+endif
+
 # Add .zip/.tar.gz extension
 ifdef ZIPNAME
 ifndef inlinux
@@ -1062,6 +1073,9 @@ fpc_infoinstall:
 	@$(ECHO)
 ifdef DATE
 	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+ifdef PACKAGENAME
+	@$(ECHO)  PackageName.......... $(PACKAGENAME)
 endif
 	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
 	@$(ECHO)
@@ -1073,6 +1087,17 @@ endif
 	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
 	@$(ECHO)  DataInstallDir....... $(DATAINSTALLDIR)
 	@$(ECHO)
+	@$(ECHO)  DestZipDir........... $(DESTZIPDIR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)
+
+#####################################################################
+# Local Makefile
+#####################################################################
+
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
 
 #####################################################################
 # Users rules