Sfoglia il codice sorgente

* Makefile updates again

peter 25 anni fa
parent
commit
e3c8963279
70 ha cambiato i file con 1952 aggiunte e 1260 eliminazioni
  1. 22 17
      base/Makefile
  2. 37 17
      compiler/Makefile
  3. 2 2
      compiler/Makefile.fpc
  4. 37 17
      compiler/new/Makefile
  5. 2 2
      compiler/new/Makefile.fpc
  6. 13 14
      ide/Makefile
  7. 13 14
      ide/fake/Makefile
  8. 23 20
      ide/fake/compiler/Makefile
  9. 23 20
      ide/fake/gdb/Makefile
  10. 88 18
      ide/text/Makefile
  11. 2 4
      ide/text/Makefile.fpc
  12. 32 17
      install/Makefile
  13. 51 18
      install/demo/Makefile
  14. 1 2
      install/demo/Makefile.fpc
  15. 46 77
      install/fpinst/Makefile
  16. 5 31
      install/fpinst/Makefile.fpc
  17. 13 14
      packages/Makefile
  18. 55 18
      packages/forms/Makefile
  19. 1 1
      packages/forms/Makefile.fpc
  20. 71 18
      packages/forms/demo/Makefile
  21. 1 1
      packages/forms/demo/Makefile.fpc
  22. 32 17
      packages/gdbint/Makefile
  23. 0 3
      packages/gdbint/Makefile.fpc
  24. 13 14
      packages/gdbint/libgdb/Makefile
  25. 32 17
      packages/ggi/Makefile
  26. 32 17
      packages/gtk/Makefile
  27. 0 3
      packages/gtk/Makefile.fpc
  28. 32 17
      packages/gtk/examples/Makefile
  29. 32 17
      packages/gtk/tutorial/Makefile
  30. 32 17
      packages/ibase/Makefile
  31. 32 17
      packages/inet/Makefile
  32. 32 17
      packages/mysql/Makefile
  33. 32 17
      packages/ncurses/Makefile
  34. 13 14
      packages/opengl/Makefile
  35. 123 71
      packages/opengl/build/Makefile
  36. 71 18
      packages/opengl/examples/Makefile
  37. 1 1
      packages/opengl/examples/Makefile.fpc
  38. 55 18
      packages/opengl/linux/Makefile
  39. 1 1
      packages/opengl/linux/Makefile.fpc
  40. 37 17
      packages/paszlib/Makefile
  41. 3 3
      packages/paszlib/Makefile.fpc
  42. 32 17
      packages/postgres/Makefile
  43. 32 17
      packages/svgalib/Makefile
  44. 32 17
      packages/uncgi/Makefile
  45. 32 17
      packages/utmp/Makefile
  46. 32 17
      packages/x11/Makefile
  47. 37 26
      packages/zlib/Makefile
  48. 4 14
      packages/zlib/Makefile.fpc
  49. 13 14
      rtl/Makefile
  50. 32 30
      rtl/go32v1/Makefile
  51. 1 1
      rtl/go32v1/Makefile.fpc
  52. 32 30
      rtl/go32v2/Makefile
  53. 1 1
      rtl/go32v2/Makefile.fpc
  54. 32 30
      rtl/linux/Makefile
  55. 1 1
      rtl/linux/Makefile.fpc
  56. 32 30
      rtl/os2/Makefile
  57. 1 1
      rtl/os2/Makefile.fpc
  58. 32 30
      rtl/win32/Makefile
  59. 1 1
      rtl/win32/Makefile.fpc
  60. 13 14
      tests/Makefile
  61. 55 18
      utils/Makefile
  62. 2 2
      utils/Makefile.fpc
  63. 204 192
      utils/fpcmake.inc
  64. 24 16
      utils/fpcmake.ini
  65. 22 11
      utils/fpcmake.pp
  66. 37 17
      utils/h2pas/Makefile
  67. 2 2
      utils/h2pas/Makefile.fpc
  68. 32 17
      utils/simulator/Makefile
  69. 37 17
      utils/tply/Makefile
  70. 2 2
      utils/tply/Makefile.fpc

+ 22 - 17
base/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: info
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=$(BASEDIR)
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -205,15 +216,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 

+ 37 - 17
compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -200,6 +211,7 @@ ZIPTARGET=install
 
 # Defaults
 
+override NEEDOPT=-Sg
 
 # Directories
 
@@ -277,15 +289,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -364,6 +370,10 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
+ifdef NEEDOPT
+override FPCOPT+=$(NEEDOPT)
+endif
+
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -387,6 +397,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 2 - 2
compiler/Makefile.fpc

@@ -6,8 +6,8 @@
 fpcdir=..
 targetdir=.
 
-[defaults]
-defaultoptions=-Sg
+[require]
+options=-Sg
 
 [tools]
 tooldiff=1

+ 37 - 17
compiler/new/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -215,6 +226,7 @@ ZIPTARGET=install
 
 # Defaults
 
+override NEEDOPT=-Sg
 
 # Directories
 
@@ -294,15 +306,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -381,6 +387,10 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
+ifdef NEEDOPT
+override FPCOPT+=$(NEEDOPT)
+endif
+
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -413,6 +423,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 2 - 2
compiler/new/Makefile.fpc

@@ -8,8 +8,8 @@ unitdir=$(CPU_TARGET) . $(OLDDIR)
 incdir=$(OLDDIR)
 targetdir=.
 
-[defaults]
-defaultoptions=-Sg
+[require]
+options=-Sg
 
 [tools]
 tooldiff=1

+ 13 - 14
ide/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)

+ 13 - 14
ide/fake/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)

+ 23 - 20
ide/fake/compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -212,15 +211,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -309,6 +302,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 23 - 20
ide/fake/gdb/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -212,15 +211,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -309,6 +302,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 88 - 18
ide/text/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -180,6 +191,7 @@ ZIPTARGET=install
 
 # Defaults
 
+override NEEDOPT=-Sg
 
 # Directories
 
@@ -201,6 +213,25 @@ override NEEDOBJDIR=$(GDBOBJDIR)
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+override PACKAGES+=api fv gdbint
+ifneq ($(wildcard $(PACKAGEDIR)/api/$(OS_TARGET)),)
+PACKAGEDIR_API=$(PACKAGEDIR)/api/$(OS_TARGET)
+else
+PACKAGEDIR_API=$(PACKAGEDIR)/api
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_API)
+ifneq ($(wildcard $(PACKAGEDIR)/fv/$(OS_TARGET)),)
+PACKAGEDIR_FV=$(PACKAGEDIR)/fv/$(OS_TARGET)
+else
+PACKAGEDIR_FV=$(PACKAGEDIR)/fv
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_FV)
+ifneq ($(wildcard $(PACKAGEDIR)/gdbint/$(OS_TARGET)),)
+PACKAGEDIR_GDBINT=$(PACKAGEDIR)/gdbint/$(OS_TARGET)
+else
+PACKAGEDIR_GDBINT=$(PACKAGEDIR)/gdbint
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_GDBINT)
 
 # Libraries
 
@@ -242,15 +273,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -337,6 +362,10 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
+ifdef NEEDOPT
+override FPCOPT+=$(NEEDOPT)
+endif
+
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -372,6 +401,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -739,7 +778,38 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package
+PACKAGEAPI=1
+PACKAGEFV=1
+PACKAGEGDBINT=1
+ifdef PACKAGEAPI
+ifneq ($(wildcard $(PACKAGEDIR_API)),)
+ifeq ($(wildcard $(PACKAGEDIR_API)/$(FPCMADE)),)
+override COMPILEPACKAGES+=api
+api_package:
+	$(MAKE) -C $(PACKAGEDIR_API) all
+endif
+endif
+endif
+ifdef PACKAGEFV
+ifneq ($(wildcard $(PACKAGEDIR_FV)),)
+ifeq ($(wildcard $(PACKAGEDIR_FV)/$(FPCMADE)),)
+override COMPILEPACKAGES+=fv
+fv_package:
+	$(MAKE) -C $(PACKAGEDIR_FV) all
+endif
+endif
+endif
+ifdef PACKAGEGDBINT
+ifneq ($(wildcard $(PACKAGEDIR_GDBINT)),)
+ifeq ($(wildcard $(PACKAGEDIR_GDBINT)/$(FPCMADE)),)
+override COMPILEPACKAGES+=gdbint
+gdbint_package:
+	$(MAKE) -C $(PACKAGEDIR_GDBINT) all
+endif
+endif
+endif
+
+.PHONY:  rtl_package api_package fv_package gdbint_package
 
 #####################################################################
 # Exes

+ 2 - 4
ide/text/Makefile.fpc

@@ -11,15 +11,13 @@ unitdir=$(COMPUNITDIR) $(GDBUNITDIR)
 objdir=$(GDBOBJDIR)
 libdir=$(GDBLIBDIR)
 
-[packages]
+[require]
+options=-Sg
 packages=api fv gdbint
 
 [libs]
 libgcc=1
 
-[defaults]
-defaultoptions=-Sg
-
 
 [presettings]
 # when making a full version include the compiler

+ 32 - 17
install/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: help
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -228,15 +239,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -333,6 +338,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 51 - 18
install/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: both
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -185,6 +196,13 @@ endif
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+override PACKAGES+=api
+ifneq ($(wildcard $(PACKAGEDIR)/api/$(OS_TARGET)),)
+PACKAGEDIR_API=$(PACKAGEDIR)/api/$(OS_TARGET)
+else
+PACKAGEDIR_API=$(PACKAGEDIR)/api
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_API)
 
 # Libraries
 
@@ -225,15 +243,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -339,6 +351,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -708,7 +730,18 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package
+PACKAGEAPI=1
+ifdef PACKAGEAPI
+ifneq ($(wildcard $(PACKAGEDIR_API)),)
+ifeq ($(wildcard $(PACKAGEDIR_API)/$(FPCMADE)),)
+override COMPILEPACKAGES+=api
+api_package:
+	$(MAKE) -C $(PACKAGEDIR_API) all
+endif
+endif
+endif
+
+.PHONY:  rtl_package api_package
 
 #####################################################################
 # Units

+ 1 - 2
install/demo/Makefile.fpc

@@ -9,9 +9,8 @@ programs_win32=winhello menu mandel dlltest testdll
 programs_linux=mandel samegame quad maze gravwars
 programs_go32v2=mandel samegame quad maze gravwars voxel
 
+[require]
 # Not always necessary, but saves a lot of trouble
-
-[packages]
 packages=api
 
 [defaults]

+ 46 - 77
install/fpinst/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -59,12 +59,6 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
-#####################################################################
-# Default target
-#####################################################################
-
-override OS_TARGET:=win32
-
 #####################################################################
 # FPC version/target Detection
 #####################################################################
@@ -110,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -123,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -146,23 +151,16 @@ endif
 #####################################################################
 
 
-# Pre Settings
-
-INC=../inc
-
-# Override defaults
-override PASEXT=.pas
-
-include ../test/Makefile.api
-include $(INC)/Makefile.api
-
 # Targets
 
-override UNITOBJECTS+=event $(APIOBJECTS)
-override EXAMPLEOBJECTS+=$(TESTOBJECTS)
+override EXEOBJECTS+=install
 
 # Clean
 
+override EXTRACLEANUNITS+=ziptypes unzip
+ifeq ($(OS_TARGET),os2)
+override EXTRACLEANUNITS+=unzipdll
+endif
 
 # Install
 
@@ -173,7 +171,6 @@ ZIPTARGET=install
 
 # Directories
 
-vpath %$(PASEXT) $(INC)
 ifndef PACKAGEDIR
 ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
@@ -195,7 +192,6 @@ PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
-LIBNAME=fpapi
 
 # Info
 
@@ -227,15 +223,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -337,6 +327,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -675,10 +675,6 @@ all: fpc_all
 
 debug: fpc_debug
 
-examples: fpc_examples
-
-test: fpc_test
-
 smart: fpc_smart
 
 shared: fpc_shared
@@ -699,7 +695,7 @@ cleanall: fpc_cleanall
 
 info: fpc_info
 
-.PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
+.PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
 
 ifdef PACKAGERTL
@@ -715,33 +711,19 @@ endif
 .PHONY:  rtl_package
 
 #####################################################################
-# Units
-#####################################################################
-
-.PHONY: fpc_units
-
-override ALLTARGET+=fpc_units
-
-override UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
-override INSTALLPPUFILES+=$(UNITPPUFILES)
-override CLEANPPUFILES+=$(UNITPPUFILES)
-
-fpc_units: $(UNITPPUFILES)
-
-#####################################################################
-# Examples
+# Exes
 #####################################################################
 
-.PHONY: fpc_examples fpc_test
-
-override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
-override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))
+.PHONY: fpc_exes
 
-override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+override EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
+override EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
 
-fpc_examples: all $(EXAMPLEFILES)
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
 
-fpc_test: examples
+fpc_exes: $(EXEFILES)
 
 #####################################################################
 # General compile rules
@@ -1037,16 +1019,3 @@ endif
 	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
-#####################################################################
-# Users rules
-#####################################################################
-
-video$(PPUEXT): $(INC)/video.pas video.inc event$(PPUEXT)
-
-keyboard$(PPUEXT): $(INC)/keyboard.pas keyboard.inc event$(PPUEXT)
-
-mouse$(PPUEXT): $(INC)/mouse.pas mouse.inc event$(PPUEXT)
-
-filectrl$(PPUEXT): $(INC)/filectrl.pas filectrl.inc
-
-event$(PPUEXT): event.pas

+ 5 - 31
install/fpinst/Makefile.fpc

@@ -2,39 +2,13 @@
 #   Makefile.fpc for Free Pascal API (used by Free Vision) for win32
 #
 
-[defaults]
-defaulttarget=win32
-
 [targets]
-units=event $(APIOBJECTS)
-examples=$(TESTOBJECTS)
+programs=install
+
+[clean]
+units=ziptypes unzip
+units_os2=unzipdll
 
 [dirs]
 fpcdir=../../..
 targetdir=.
-sourcesdir=$(INC)
-
-[libs]
-libname=fpapi
-
-
-[presettings]
-INC=../inc
-
-# Override defaults
-override PASEXT=.pas
-
-include ../test/Makefile.api
-include $(INC)/Makefile.api
-
-
-[rules]
-video$(PPUEXT): $(INC)/video.pas video.inc event$(PPUEXT)
-
-keyboard$(PPUEXT): $(INC)/keyboard.pas keyboard.inc event$(PPUEXT)
-
-mouse$(PPUEXT): $(INC)/mouse.pas mouse.inc event$(PPUEXT)
-
-filectrl$(PPUEXT): $(INC)/filectrl.pas filectrl.inc
-
-event$(PPUEXT): event.pas

+ 13 - 14
packages/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)

+ 55 - 18
packages/forms/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -172,6 +183,13 @@ endif
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+override PACKAGES+=x11
+ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
+PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
+else
+PACKAGEDIR_X11=$(PACKAGEDIR)/x11
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_X11)
 
 # Libraries
 
@@ -206,15 +224,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -301,6 +313,10 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -311,6 +327,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -682,7 +708,18 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package
+PACKAGEX11=1
+ifdef PACKAGEX11
+ifneq ($(wildcard $(PACKAGEDIR_X11)),)
+ifeq ($(wildcard $(PACKAGEDIR_X11)/$(FPCMADE)),)
+override COMPILEPACKAGES+=x11
+x11_package:
+	$(MAKE) -C $(PACKAGEDIR_X11) all
+endif
+endif
+endif
+
+.PHONY:  rtl_package x11_package
 
 #####################################################################
 # Units

+ 1 - 1
packages/forms/Makefile.fpc

@@ -6,7 +6,7 @@
 units=forms
 programs=fd2pascal
 
-[packages]
+[require]
 packages=x11
 
 [dirs]

+ 71 - 18
packages/forms/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -171,6 +182,19 @@ endif
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+override PACKAGES+=forms x11
+ifneq ($(wildcard $(PACKAGEDIR)/forms/$(OS_TARGET)),)
+PACKAGEDIR_FORMS=$(PACKAGEDIR)/forms/$(OS_TARGET)
+else
+PACKAGEDIR_FORMS=$(PACKAGEDIR)/forms
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_FORMS)
+ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
+PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
+else
+PACKAGEDIR_X11=$(PACKAGEDIR)/x11
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_X11)
 
 # Libraries
 
@@ -206,15 +230,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -309,6 +327,10 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
+endif
+
 # Add Other dirs path if asked
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
@@ -324,6 +346,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -695,7 +727,28 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package
+PACKAGEFORMS=1
+PACKAGEX11=1
+ifdef PACKAGEFORMS
+ifneq ($(wildcard $(PACKAGEDIR_FORMS)),)
+ifeq ($(wildcard $(PACKAGEDIR_FORMS)/$(FPCMADE)),)
+override COMPILEPACKAGES+=forms
+forms_package:
+	$(MAKE) -C $(PACKAGEDIR_FORMS) all
+endif
+endif
+endif
+ifdef PACKAGEX11
+ifneq ($(wildcard $(PACKAGEDIR_X11)),)
+ifeq ($(wildcard $(PACKAGEDIR_X11)/$(FPCMADE)),)
+override COMPILEPACKAGES+=x11
+x11_package:
+	$(MAKE) -C $(PACKAGEDIR_X11) all
+endif
+endif
+endif
+
+.PHONY:  rtl_package forms_package x11_package
 
 #####################################################################
 # Exes

+ 1 - 1
packages/forms/demo/Makefile.fpc

@@ -10,7 +10,7 @@ programs=pushme yesno pushbutton touchbutton minput inputall choice butttypes \
          fbrowse1 fbrowse flclock fonts goodies lalign ll longlabel menu \
          objinactive objpos newbutton multilabel objreturn
 
-[packages]
+[require]
 packages=forms x11
 
 [libs]

+ 32 - 17
packages/gdbint/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -212,15 +223,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -343,6 +348,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 0 - 3
packages/gdbint/Makefile.fpc

@@ -6,9 +6,6 @@
 units=gdbint gdbcon
 examples=testgdb symify
 
-[defaults]
-defaultunits=1
-
 [dirs]
 fpcdir=..
 targetdir=.

+ 13 - 14
packages/gdbint/libgdb/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)

+ 32 - 17
packages/ggi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/gtk/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -210,15 +221,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -320,6 +325,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 0 - 3
packages/gtk/Makefile.fpc

@@ -13,9 +13,6 @@ targetdir=.
 [libs]
 libname=fpgtk
 
-[defaults]
-defaultunits=1
-
 
 [rules]
 clean: fpc_clean

+ 32 - 17
packages/gtk/examples/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -212,15 +223,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -352,6 +357,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/gtk/tutorial/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -211,15 +222,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -351,6 +356,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/ibase/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/inet/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/mysql/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/ncurses/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 13 - 14
packages/opengl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)

+ 123 - 71
packages/opengl/build/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-23 14:38
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -52,7 +52,7 @@ 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
@@ -67,39 +67,65 @@ 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 FPCDIR
+ifndef FPCDIR
+FPCDIR=../../..
+endif
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
 endif
 
 #####################################################################
@@ -111,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -151,11 +168,12 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef FPCDIR
-FPCDIR=../../..
-endif
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -163,7 +181,15 @@ endif
 
 # Packages
 
-override NEEDUNITDIR+=$(FPCDIR)/fcl/$(OS_TARGET)
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+override PACKAGES+=fcl
+ifneq ($(wildcard $(PACKAGEDIR)/fcl/$(OS_TARGET)),)
+PACKAGEDIR_FCL=$(PACKAGEDIR)/fcl/$(OS_TARGET)
+else
+PACKAGEDIR_FCL=$(PACKAGEDIR)/fcl
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_FCL)
 
 # Libraries
 
@@ -191,21 +217,18 @@ endif
 # set the prefix directory where to install everything
 ifndef PREFIXINSTALLDIR
 ifdef inlinux
-export PREFIXINSTALLDIR=/usr
+PREFIXINSTALLDIR=/usr
 else
-export PREFIXINSTALLDIR=/pp
+PREFIXINSTALLDIR=/pp
 endif
 endif
+export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
+# Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
-endif
 
 #####################################################################
 # Install Directories
@@ -232,6 +255,9 @@ endif
 # set the directory where to install the units.
 ifndef UNITINSTALLDIR
 UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+ifdef UNITSUBDIR
+UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)
+endif
 endif
 
 # Where to install shared libraries
@@ -301,6 +327,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -349,56 +385,58 @@ 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
 #####################################################################
@@ -442,11 +480,12 @@ endif
 ifndef ECHO
 ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
 ifeq ($(ECHO),)
-export ECHO:=echo
+ECHO:=echo
 else
-export ECHO:=$(firstword $(ECHO))
+ECHO:=$(firstword $(ECHO))
 endif
 endif
+export ECHO
 
 # ppdep
 ifndef PPDEP
@@ -454,9 +493,10 @@ 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 +504,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 +515,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 +534,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 +550,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 +570,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,6 +592,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -651,22 +697,25 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
-#####################################################################
-# Package depends
-#####################################################################
 
-ifneq ($(wildcard $(RTLDIR)),)
-ifeq ($(wildcard $(RTLDIR)/$(FPCMADE)),)
+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
-ifneq ($(wildcard $(FCLDIR)),)
-ifeq ($(wildcard $(FCLDIR)/$(FPCMADE)),)
+endif
+
+PACKAGEFCL=1
+ifdef PACKAGEFCL
+ifneq ($(wildcard $(PACKAGEDIR_FCL)),)
+ifeq ($(wildcard $(PACKAGEDIR_FCL)/$(FPCMADE)),)
 override COMPILEPACKAGES+=fcl
 fcl_package:
-	$(MAKE) -C $(FCLDIR) all
+	$(MAKE) -C $(PACKAGEDIR_FCL) all
+endif
 endif
 endif
 
@@ -754,12 +803,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
 
 #####################################################################
@@ -787,19 +836,19 @@ 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"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
 endif
 
 fpc_install: $(INSTALLTARGET)
@@ -868,8 +917,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
@@ -885,8 +934,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)
@@ -926,6 +975,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -935,7 +987,7 @@ 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) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
 

+ 71 - 18
packages/opengl/examples/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -171,6 +182,19 @@ endif
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+override PACKAGES+=opengl x11
+ifneq ($(wildcard $(PACKAGEDIR)/opengl/$(OS_TARGET)),)
+PACKAGEDIR_OPENGL=$(PACKAGEDIR)/opengl/$(OS_TARGET)
+else
+PACKAGEDIR_OPENGL=$(PACKAGEDIR)/opengl
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_OPENGL)
+ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
+PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
+else
+PACKAGEDIR_X11=$(PACKAGEDIR)/x11
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_X11)
 
 # Libraries
 
@@ -206,15 +230,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -309,6 +327,10 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
+endif
+
 # Add Other dirs path if asked
 ifdef OTHERLIBDIR
 override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
@@ -324,6 +346,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -695,7 +727,28 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package
+PACKAGEOPENGL=1
+PACKAGEX11=1
+ifdef PACKAGEOPENGL
+ifneq ($(wildcard $(PACKAGEDIR_OPENGL)),)
+ifeq ($(wildcard $(PACKAGEDIR_OPENGL)/$(FPCMADE)),)
+override COMPILEPACKAGES+=opengl
+opengl_package:
+	$(MAKE) -C $(PACKAGEDIR_OPENGL) all
+endif
+endif
+endif
+ifdef PACKAGEX11
+ifneq ($(wildcard $(PACKAGEDIR_X11)),)
+ifeq ($(wildcard $(PACKAGEDIR_X11)/$(FPCMADE)),)
+override COMPILEPACKAGES+=x11
+x11_package:
+	$(MAKE) -C $(PACKAGEDIR_X11) all
+endif
+endif
+endif
+
+.PHONY:  rtl_package opengl_package x11_package
 
 #####################################################################
 # Exes

+ 1 - 1
packages/opengl/examples/Makefile.fpc

@@ -5,7 +5,7 @@
 [targets]
 programs=glutdemo
 
-[packages]
+[require]
 packages=opengl x11
 
 [dirs]

+ 55 - 18
packages/opengl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -110,10 +110,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -123,15 +143,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -177,6 +188,13 @@ endif
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+override PACKAGES+=x11
+ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
+PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
+else
+PACKAGEDIR_X11=$(PACKAGEDIR)/x11
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_X11)
 
 # Libraries
 
@@ -211,15 +229,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -306,6 +318,10 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
+endif
+
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -316,6 +332,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -687,7 +713,18 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package
+PACKAGEX11=1
+ifdef PACKAGEX11
+ifneq ($(wildcard $(PACKAGEDIR_X11)),)
+ifeq ($(wildcard $(PACKAGEDIR_X11)/$(FPCMADE)),)
+override COMPILEPACKAGES+=x11
+x11_package:
+	$(MAKE) -C $(PACKAGEDIR_X11) all
+endif
+endif
+endif
+
+.PHONY:  rtl_package x11_package
 
 #####################################################################
 # Units

+ 1 - 1
packages/opengl/linux/Makefile.fpc

@@ -8,7 +8,7 @@ defaulttarget=linux
 [targets]
 units=gl glut
 
-[packages]
+[require]
 packages=x11
 
 [dirs]

+ 37 - 17
packages/paszlib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -154,6 +165,7 @@ ZIPTARGET=install
 
 # Defaults
 
+override NEEDOPT=-Sm
 
 # Directories
 
@@ -206,15 +218,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -293,6 +299,10 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
+ifdef NEEDOPT
+override FPCOPT+=$(NEEDOPT)
+endif
+
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -311,6 +321,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 3 - 3
packages/paszlib/Makefile.fpc

@@ -6,8 +6,8 @@
 units=adler crc crcasm gzio infblock infcodes inffast inftrees infutil strutils trees zcompres zdeflate zinflate zlib zuncompr zutil
 examples=example minigzip
 
+[require]
+options=-Sm
+
 [dirs]
 fpcdir=../..
-
-[defaults]
-defaultoptions=-Sm

+ 32 - 17
packages/postgres/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/svgalib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/uncgi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/utmp/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 32 - 17
packages/x11/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -205,15 +216,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -310,6 +315,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 37 - 26
packages/zlib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -153,6 +164,7 @@ ZIPTARGET=install
 
 # Defaults
 
+override NEEDOPT=-Sm
 
 # Directories
 
@@ -205,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -292,6 +298,10 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
+ifdef NEEDOPT
+override FPCOPT+=$(NEEDOPT)
+endif
+
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -310,6 +320,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -991,12 +1011,3 @@ endif
 	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
 	@$(ECHO)
 
-#####################################################################
-# Users rules
-#####################################################################
-
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes

+ 4 - 14
packages/zlib/Makefile.fpc

@@ -1,22 +1,12 @@
 #
-#   Makefile.fpc for GL Units
+#   Makefile.fpc for ZLib (LibC version)
 #
 
 [targets]
-units= zlib
-programs=
+units=zlib
 
 [dirs]
 fpcdir=../..
 
-[defaults]
-defaultunits=1
-defaultoptions=-Sm
-
-
-[rules]
-.PHONY: test examples
-
-test: fpc_exes
-
-examples: fpc_exes
+[require]
+options=-Sm

+ 13 - 14
rtl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)

+ 32 - 30
rtl/go32v1/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -111,10 +111,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=.
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +144,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -196,8 +207,6 @@ endif
 
 # Packages
 
-override PACKAGES=rtl
-PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -251,15 +260,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -366,6 +369,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -727,17 +740,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
-
-.PHONY:  rtl_package
 
 #####################################################################
 # Loaders

+ 1 - 1
rtl/go32v1/Makefile.fpc

@@ -11,7 +11,7 @@ units=$(SYSTEMUNIT) objpas strings \
       cpu mmx getopts heaptrc \
       msmouse
 
-[packages]
+[require]
 rtl=0
 
 [defaults]

+ 32 - 30
rtl/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -111,10 +111,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=.
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +144,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -196,8 +207,6 @@ endif
 
 # Packages
 
-override PACKAGES=rtl
-PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -251,15 +260,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -366,6 +369,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -727,17 +740,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
-
-.PHONY:  rtl_package
 
 #####################################################################
 # Loaders

+ 1 - 1
rtl/go32v2/Makefile.fpc

@@ -11,7 +11,7 @@ units=$(SYSTEMUNIT) objpas strings \
       cpu mmx getopts heaptrc \
       msmouse ports
 
-[packages]
+[require]
 rtl=0
 
 [defaults]

+ 32 - 30
rtl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -111,10 +111,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=.
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +144,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -205,8 +216,6 @@ endif
 
 # Packages
 
-override PACKAGES=rtl
-PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -262,15 +271,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -377,6 +380,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -738,17 +751,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
-
-.PHONY:  rtl_package
 
 #####################################################################
 # Loaders

+ 1 - 1
rtl/linux/Makefile.fpc

@@ -11,7 +11,7 @@ units=$(SYSTEMUNIT) objpas strings \
       cpu mmx getopts heaptrc \
       errors sockets gpm ipc
 
-[packages]
+[require]
 rtl=0
 
 [defaults]

+ 32 - 30
rtl/os2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -111,10 +111,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=.
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +144,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -196,8 +207,6 @@ endif
 
 # Packages
 
-override PACKAGES=rtl
-PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -251,15 +260,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -366,6 +369,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -727,17 +740,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
-
-.PHONY:  rtl_package
 
 #####################################################################
 # Loaders

+ 1 - 1
rtl/os2/Makefile.fpc

@@ -10,7 +10,7 @@ units=$(SYSTEMUNIT) objpas strings \
       sysutils math typinfo \
       cpu mmx getopts heaptrc
 
-[packages]
+[require]
 rtl=0
 
 [defaults]

+ 32 - 30
rtl/win32/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -111,10 +111,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=.
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +144,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -201,8 +212,6 @@ endif
 
 # Packages
 
-override PACKAGES=rtl
-PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -256,15 +265,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -371,6 +374,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -732,17 +745,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
-
-.PHONY:  rtl_package
 
 #####################################################################
 # Loaders

+ 1 - 1
rtl/win32/Makefile.fpc

@@ -11,7 +11,7 @@ units=$(SYSTEMUNIT) objpas strings \
       sysutils typinfo math \
       cpu mmx getopts heaptrc wincrt winmouse
 
-[packages]
+[require]
 rtl=0
 
 [defaults]

+ 13 - 14
tests/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: info
@@ -104,17 +104,25 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
-ifndef FPCDIR
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
-
 endif
-export FPCDIR
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -124,15 +132,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)

+ 55 - 18
utils/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -176,6 +187,13 @@ endif
 
 override PACKAGES=rtl
 PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+override PACKAGES+=fcl
+ifneq ($(wildcard $(PACKAGEDIR)/fcl/$(OS_TARGET)),)
+PACKAGEDIR_FCL=$(PACKAGEDIR)/fcl/$(OS_TARGET)
+else
+PACKAGEDIR_FCL=$(PACKAGEDIR)/fcl
+endif
+override NEEDUNITDIR+=$(PACKAGEDIR_FCL)
 
 # Libraries
 
@@ -210,15 +228,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -305,6 +317,10 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
+ifdef NEEDUNITDIR
+override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
+endif
+
 # Target dirs
 ifdef TARGETDIR
 override FPCOPT+=-FE$(TARGETDIR)
@@ -320,6 +336,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)
@@ -708,7 +734,18 @@ endif
 endif
 endif
 
-.PHONY:  rtl_package
+PACKAGEFCL=1
+ifdef PACKAGEFCL
+ifneq ($(wildcard $(PACKAGEDIR_FCL)),)
+ifeq ($(wildcard $(PACKAGEDIR_FCL)/$(FPCMADE)),)
+override COMPILEPACKAGES+=fcl
+fcl_package:
+	$(MAKE) -C $(PACKAGEDIR_FCL) all
+endif
+endif
+endif
+
+.PHONY:  rtl_package fcl_package
 
 #####################################################################
 # Exes

+ 2 - 2
utils/Makefile.fpc

@@ -9,8 +9,8 @@ programs=ppufiles ppudump ppumove ppdep ptop rstconv data2inc fpcmake delp
 [clean]
 units=ppu ptopu
 
-[packages]
-fcl=1
+[require]
+packages=fcl
 
 [tools]
 tooldata2inc=1

File diff suppressed because it is too large
+ 204 - 192
utils/fpcmake.inc


+ 24 - 16
utils/fpcmake.ini

@@ -111,13 +111,24 @@ export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
 
 [fpcdirdetect]
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
 # Detect FPCDIR
+ifeq ($(FPCDIR),)
 ifdef inlinux
 FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
 else
 FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
 endif
-export FPCDIR
+endif
 
 
 [defaultsettings]
@@ -130,15 +141,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -148,6 +150,7 @@ override OPT+=-va
 override REDIR:= >> $(REDIRFILE)
 endif
 
+
 [usersettings]
 #####################################################################
 # User Settings
@@ -181,15 +184,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -296,6 +293,7 @@ ifdef NEEDOPT
 override FPCOPT+=$(NEEDOPT)
 endif
 
+
 [command_rtldir]
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
@@ -361,6 +359,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 22 - 11
utils/fpcmake.pp

@@ -145,6 +145,7 @@ type
     DirUnitTarget,
     DirSources,
     DirInc         : string;
+    RequireRTL      : boolean;
     RequireOptions  : string;
     RequirePackages,
     RequireComponents : TTargetsString;
@@ -311,7 +312,8 @@ begin
      DefaultRule:=ReadString(ini_defaults,'defaultrule','all');
      DefaultTarget:=ReadString(ini_defaults,'defaulttarget','');
      DefaultCPU:=ReadString(ini_defaults,'defaultcpu','');
-   { packages }
+   { require }
+     RequireRTL:=ReadBool(ini_require,'rtl',true);
      RequireOptions:=ReadString(ini_require,'options','');
      ReadTargetsString(requireComponents,ini_require,'components','');
      ReadTargetsString(requirePackages,ini_require,'packages','');
@@ -694,13 +696,15 @@ begin
      AddSection(true,'fpcdetect');
 
    { fpc dir }
-     Add('ifndef FPCDIR');
      if userini.dirfpc<>'' then
-      Add('FPCDIR='+userini.dirfpc)
-     else
-      AddSection(true,'fpcdirdetect');
-     Add('endif');
-     Add('export FPCDIR');
+      begin
+        Add('# Default FPCDIR');
+        Add('ifndef FPCDIR');
+        Add('FPCDIR='+userini.dirfpc);
+        Add('endif');
+        Add('');
+      end;
+     AddSection(true,'fpcdirdetect');
 
    { write the default & user settings }
      AddSection(true,'defaultsettings');
@@ -790,10 +794,13 @@ begin
 
    { Packages }
      AddHead('Packages');
-     Add('override PACKAGES=rtl');
+     if userini.RequireRTL then
+      begin
+        Add('override PACKAGES=rtl');
+        Add('PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)');
+      end;
      AddTargets('PACKAGES',userini.Requirepackages,false);
      AddTargets('COMPONENTS',userini.Requirecomponents,false);
-     Add('PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)');
      AddTargetsUnitDir('$(PACKAGEDIR)',userini.Requirepackages);
      AddTargetsUnitDir('$(COMPONENTDIR)',userini.Requirecomponents);
 
@@ -901,7 +908,8 @@ begin
    { Package requirements, must be before the other rules so it's done first }
      AddSection(true,'packagerequirerules');
      Phony:='';
-     AddPackageDep('rtl');
+     if userini.RequireRTL then
+      AddPackageDep('rtl');
      Add('');
      if not TargetStringEmpty(userini.RequirePackages) then
       begin
@@ -1049,7 +1057,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.16  2000-01-03 19:42:41  peter
+  Revision 1.17  2000-01-04 00:00:23  peter
+    * Makefile updates again
+
+  Revision 1.16  2000/01/03 19:42:41  peter
     * regenerated
 
   Revision 1.15  1999/12/23 19:32:28  peter

+ 37 - 17
utils/h2pas/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -154,6 +165,7 @@ ZIPTARGET=install
 
 # Defaults
 
+override NEEDOPT=-Sg
 
 # Directories
 
@@ -206,15 +218,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -293,6 +299,10 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
+ifdef NEEDOPT
+override FPCOPT+=$(NEEDOPT)
+endif
+
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -311,6 +321,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 2 - 2
utils/h2pas/Makefile.fpc

@@ -11,8 +11,8 @@ units=options lexlib scan yacclib converu
 [dirs]
 fpcdir=../..
 
-[defaults]
-defaultoptions=-Sg
+[require]
+options=-Sg
 
 
 [rules]

+ 32 - 17
utils/simulator/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -206,15 +217,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -311,6 +316,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 37 - 17
utils/tply/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 [2000/01/03]
+# Makefile generated by fpcmake v0.99.13 [2000/01/04]
 #
 
 defaultrule: all
@@ -104,10 +104,30 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+# Default FPCDIR
 ifndef FPCDIR
 FPCDIR=../..
 endif
-export FPCDIR
+
+# Test FPCDIR to look if the RTL dir exists
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(FPCDIR)/rtl),)
+override FPCDIR=
+endif
+else
+override FPCDIR=
+endif
+
+# Detect FPCDIR
+ifeq ($(FPCDIR),)
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+endif
+
 #####################################################################
 # Default Settings
 #####################################################################
@@ -117,15 +137,6 @@ ifndef REDIRFILE
 REDIRFILE=log
 endif
 
-ifdef RELEASE
-override OPT:=-Xs -OG2p3 -n
-endif
-
-# Verbose settings (warning,note,info)
-ifdef VERBOSE
-override OPT+=-vwni
-endif
-
 ifdef REDIR
 ifndef inlinux
 override FPC=redir -eo $(FPC)
@@ -164,6 +175,7 @@ ZIPTARGET=install
 
 # Defaults
 
+override NEEDOPT=-Sg
 
 # Directories
 
@@ -216,15 +228,9 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# Fix FPCDIR to only use /
-ifdef FPCDIR
-override FPCDIR:=$(subst \,/,$(FPCDIR))
-endif
-
 # Create rtl,fcl,units dir
 ifneq ($(FPCDIR),.)
 override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
-override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
 override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
 endif
 
@@ -303,6 +309,10 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
+ifdef NEEDOPT
+override FPCOPT+=$(NEEDOPT)
+endif
+
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -321,6 +331,16 @@ ifdef DEBUG
 override FPCOPT+=-g
 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
 ifdef OPT
 override FPCOPT+=$(OPT)

+ 2 - 2
utils/tply/Makefile.fpc

@@ -17,8 +17,8 @@ files=yylex.cod yyparse.cod
 fpcdir=../..
 extrainstalldir=$(CODPATH)
 
-[defaults]
-defaultoptions=-Sg
+[require]
+options=-Sg
 
 
 [presettings]

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