Browse Source

* regenerated

peter 25 years ago
parent
commit
2b4221b9b2
48 changed files with 1950 additions and 1234 deletions
  1. 45 33
      base/Makefile
  2. 29 19
      compiler/Makefile
  3. 29 19
      compiler/new/Makefile
  4. 32 16
      ide/Makefile
  5. 32 16
      ide/fake/Makefile
  6. 36 11
      ide/fake/compiler/Makefile
  7. 36 11
      ide/fake/gdb/Makefile
  8. 29 66
      ide/text/Makefile
  9. 29 14
      install/Makefile
  10. 141 53
      install/demo/Makefile
  11. 29 14
      install/fpinst/Makefile
  12. 133 65
      packages/Makefile
  13. 29 35
      packages/forms/Makefile
  14. 29 50
      packages/forms/demo/Makefile
  15. 30 31
      packages/gdbint/Makefile
  16. 24 8
      packages/gdbint/libgdb/Makefile
  17. 29 14
      packages/ggi/Makefile
  18. 29 14
      packages/gtk/Makefile
  19. 29 14
      packages/gtk/examples/Makefile
  20. 29 14
      packages/gtk/tutorial/Makefile
  21. 29 14
      packages/ibase/Makefile
  22. 29 14
      packages/inet/Makefile
  23. 29 14
      packages/mysql/Makefile
  24. 29 14
      packages/ncurses/Makefile
  25. 35 19
      packages/opengl/Makefile
  26. 29 50
      packages/opengl/examples/Makefile
  27. 29 35
      packages/opengl/linux/Makefile
  28. 29 19
      packages/paszlib/Makefile
  29. 29 14
      packages/postgres/Makefile
  30. 29 14
      packages/svgalib/Makefile
  31. 29 14
      packages/uncgi/Makefile
  32. 29 14
      packages/utmp/Makefile
  33. 29 14
      packages/x11/Makefile
  34. 29 19
      packages/zlib/Makefile
  35. 41 25
      rtl/Makefile
  36. 35 11
      rtl/go32v1/Makefile
  37. 35 11
      rtl/go32v2/Makefile
  38. 35 11
      rtl/linux/Makefile
  39. 35 11
      rtl/os2/Makefile
  40. 35 11
      rtl/win32/Makefile
  41. 25 8
      tests/Makefile
  42. 37 34
      utils/Makefile
  43. 217 176
      utils/fpcmake.inc
  44. 33 5
      utils/fpcmake.ini
  45. 95 94
      utils/fpcmake.pp
  46. 29 19
      utils/h2pas/Makefile
  47. 29 14
      utils/simulator/Makefile
  48. 29 19
      utils/tply/Makefile

+ 45 - 33
base/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 defaultrule: info
@@ -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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=$(BASEDIR)
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -152,11 +156,12 @@ ZIPTARGET=install
 
 # Directories
 
-ifndef FPCDIR
-FPCDIR=$(BASEDIR)
-endif
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -164,6 +169,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -198,15 +205,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -233,6 +242,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
@@ -480,6 +492,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -580,19 +593,18 @@ clean: $(addsuffix _clean,$(DIROBJECTS))
 
 cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
 
-depend: $(addsuffix _depend,$(DIROBJECTS))
+require: $(addsuffix _require,$(DIROBJECTS))
 
-.PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall depend
+.PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall require
 
-#####################################################################
-# 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
 endif
 
@@ -611,7 +623,7 @@ OBJECTDIRIDE=1
 # Dir compiler
 
 ifdef OBJECTDIRCOMPILER
-.PHONY:  compiler_all compiler_debug compiler_examples compiler_test compiler_smart compiler_shared compiler_showinstall compiler_install compiler_sourceinstall compiler_zipinstall compiler_zipinstalladd compiler_clean compiler_cleanall compiler_depend compiler_info
+.PHONY:  compiler_all compiler_debug compiler_examples compiler_test compiler_smart compiler_shared compiler_showinstall compiler_install compiler_sourceinstall compiler_zipinstall compiler_zipinstalladd compiler_clean compiler_cleanall compiler_require compiler_info
 
 compiler_all:
 	$(MAKE) -C compiler all
@@ -652,8 +664,8 @@ compiler_clean:
 compiler_cleanall:
 	$(MAKE) -C compiler cleanall
 
-compiler_depend:
-	$(MAKE) -C compiler depend
+compiler_require:
+	$(MAKE) -C compiler require
 
 compiler_info:
 	$(MAKE) -C compiler info
@@ -662,7 +674,7 @@ endif
 # Dir rtl
 
 ifdef OBJECTDIRRTL
-.PHONY:  rtl_all rtl_debug rtl_examples rtl_test rtl_smart rtl_shared rtl_showinstall rtl_install rtl_sourceinstall rtl_zipinstall rtl_zipinstalladd rtl_clean rtl_cleanall rtl_depend rtl_info
+.PHONY:  rtl_all rtl_debug rtl_examples rtl_test rtl_smart rtl_shared rtl_showinstall rtl_install rtl_sourceinstall rtl_zipinstall rtl_zipinstalladd rtl_clean rtl_cleanall rtl_require rtl_info
 
 rtl_all:
 	$(MAKE) -C rtl all
@@ -703,8 +715,8 @@ rtl_clean:
 rtl_cleanall:
 	$(MAKE) -C rtl cleanall
 
-rtl_depend:
-	$(MAKE) -C rtl depend
+rtl_require:
+	$(MAKE) -C rtl require
 
 rtl_info:
 	$(MAKE) -C rtl info
@@ -713,7 +725,7 @@ endif
 # Dir utils
 
 ifdef OBJECTDIRUTILS
-.PHONY:  utils_all utils_debug utils_examples utils_test utils_smart utils_shared utils_showinstall utils_install utils_sourceinstall utils_zipinstall utils_zipinstalladd utils_clean utils_cleanall utils_depend utils_info
+.PHONY:  utils_all utils_debug utils_examples utils_test utils_smart utils_shared utils_showinstall utils_install utils_sourceinstall utils_zipinstall utils_zipinstalladd utils_clean utils_cleanall utils_require utils_info
 
 utils_all:
 	$(MAKE) -C utils all
@@ -754,8 +766,8 @@ utils_clean:
 utils_cleanall:
 	$(MAKE) -C utils cleanall
 
-utils_depend:
-	$(MAKE) -C utils depend
+utils_require:
+	$(MAKE) -C utils require
 
 utils_info:
 	$(MAKE) -C utils info
@@ -764,7 +776,7 @@ endif
 # Dir packages
 
 ifdef OBJECTDIRPACKAGES
-.PHONY:  packages_all packages_debug packages_examples packages_test packages_smart packages_shared packages_showinstall packages_install packages_sourceinstall packages_zipinstall packages_zipinstalladd packages_clean packages_cleanall packages_depend packages_info
+.PHONY:  packages_all packages_debug packages_examples packages_test packages_smart packages_shared packages_showinstall packages_install packages_sourceinstall packages_zipinstall packages_zipinstalladd packages_clean packages_cleanall packages_require packages_info
 
 packages_all:
 	$(MAKE) -C packages all
@@ -805,8 +817,8 @@ packages_clean:
 packages_cleanall:
 	$(MAKE) -C packages cleanall
 
-packages_depend:
-	$(MAKE) -C packages depend
+packages_require:
+	$(MAKE) -C packages require
 
 packages_info:
 	$(MAKE) -C packages info
@@ -815,7 +827,7 @@ endif
 # Dir fcl
 
 ifdef OBJECTDIRFCL
-.PHONY:  fcl_all fcl_debug fcl_examples fcl_test fcl_smart fcl_shared fcl_showinstall fcl_install fcl_sourceinstall fcl_zipinstall fcl_zipinstalladd fcl_clean fcl_cleanall fcl_depend fcl_info
+.PHONY:  fcl_all fcl_debug fcl_examples fcl_test fcl_smart fcl_shared fcl_showinstall fcl_install fcl_sourceinstall fcl_zipinstall fcl_zipinstalladd fcl_clean fcl_cleanall fcl_require fcl_info
 
 fcl_all:
 	$(MAKE) -C fcl all
@@ -856,8 +868,8 @@ fcl_clean:
 fcl_cleanall:
 	$(MAKE) -C fcl cleanall
 
-fcl_depend:
-	$(MAKE) -C fcl depend
+fcl_require:
+	$(MAKE) -C fcl require
 
 fcl_info:
 	$(MAKE) -C fcl info
@@ -866,7 +878,7 @@ endif
 # Dir ide
 
 ifdef OBJECTDIRIDE
-.PHONY:  ide_all ide_debug ide_examples ide_test ide_smart ide_shared ide_showinstall ide_install ide_sourceinstall ide_zipinstall ide_zipinstalladd ide_clean ide_cleanall ide_depend ide_info
+.PHONY:  ide_all ide_debug ide_examples ide_test ide_smart ide_shared ide_showinstall ide_install ide_sourceinstall ide_zipinstall ide_zipinstalladd ide_clean ide_cleanall ide_require ide_info
 
 ide_all:
 	$(MAKE) -C ide all
@@ -907,8 +919,8 @@ ide_clean:
 ide_cleanall:
 	$(MAKE) -C ide cleanall
 
-ide_depend:
-	$(MAKE) -C ide depend
+ide_require:
+	$(MAKE) -C ide require
 
 ide_info:
 	$(MAKE) -C ide info

+ 29 - 19
compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -196,15 +200,15 @@ ZIPTARGET=install
 
 # Defaults
 
-override NEEDOPT=-Sg
 
 # 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
@@ -215,6 +219,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -271,15 +277,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -306,6 +314,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
@@ -353,10 +364,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -657,6 +664,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -755,15 +763,14 @@ info: fpc_info
 
 .PHONY:  debug smart shared showinstall sourceinstall zipinstall zipinstalladd 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
 endif
 
@@ -994,6 +1001,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -1003,7 +1013,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)
 

+ 29 - 19
compiler/new/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -211,15 +215,15 @@ ZIPTARGET=install
 
 # Defaults
 
-override NEEDOPT=-Sg
 
 # 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
@@ -232,6 +236,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -288,15 +294,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -323,6 +331,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
@@ -370,10 +381,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -683,6 +690,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -781,15 +789,14 @@ info: fpc_info
 
 .PHONY:  debug smart shared showinstall sourceinstall zipinstall zipinstalladd 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
 endif
 
@@ -1020,6 +1027,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -1029,7 +1039,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)
 

+ 32 - 16
ide/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -153,7 +164,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -161,6 +176,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -189,19 +206,18 @@ clean: $(addsuffix _clean,$(DIROBJECTS))
 
 cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
 
-depend: $(addsuffix _depend,$(DIROBJECTS))
+require: $(addsuffix _require,$(DIROBJECTS))
 
-.PHONY:  debug examples test smart shared showinstall install sourceinstall clean cleanall depend
+.PHONY:  debug examples test smart shared showinstall install sourceinstall clean cleanall require
 
-#####################################################################
-# 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
 endif
 
@@ -216,7 +232,7 @@ OBJECTDIRTEXT=1
 # Dir fake
 
 ifdef OBJECTDIRFAKE
-.PHONY:  fake_all fake_debug fake_examples fake_test fake_smart fake_shared fake_showinstall fake_install fake_sourceinstall fake_zipinstall fake_zipinstalladd fake_clean fake_cleanall fake_depend fake_info
+.PHONY:  fake_all fake_debug fake_examples fake_test fake_smart fake_shared fake_showinstall fake_install fake_sourceinstall fake_zipinstall fake_zipinstalladd fake_clean fake_cleanall fake_require fake_info
 
 fake_all:
 	$(MAKE) -C fake all
@@ -257,8 +273,8 @@ fake_clean:
 fake_cleanall:
 	$(MAKE) -C fake cleanall
 
-fake_depend:
-	$(MAKE) -C fake depend
+fake_require:
+	$(MAKE) -C fake require
 
 fake_info:
 	$(MAKE) -C fake info
@@ -267,7 +283,7 @@ endif
 # Dir text
 
 ifdef OBJECTDIRTEXT
-.PHONY:  text_all text_debug text_examples text_test text_smart text_shared text_showinstall text_install text_sourceinstall text_zipinstall text_zipinstalladd text_clean text_cleanall text_depend text_info
+.PHONY:  text_all text_debug text_examples text_test text_smart text_shared text_showinstall text_install text_sourceinstall text_zipinstall text_zipinstalladd text_clean text_cleanall text_require text_info
 
 text_all:
 	$(MAKE) -C text all
@@ -308,8 +324,8 @@ text_clean:
 text_cleanall:
 	$(MAKE) -C text cleanall
 
-text_depend:
-	$(MAKE) -C text depend
+text_require:
+	$(MAKE) -C text require
 
 text_info:
 	$(MAKE) -C text info

+ 32 - 16
ide/fake/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -153,7 +164,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -161,6 +176,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -191,19 +208,18 @@ clean: $(addsuffix _clean,$(DIROBJECTS))
 
 cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
 
-depend: $(addsuffix _depend,$(DIROBJECTS))
+require: $(addsuffix _require,$(DIROBJECTS))
 
-.PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall depend
+.PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall require
 
-#####################################################################
-# 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
 endif
 
@@ -218,7 +234,7 @@ OBJECTDIRGDB=1
 # Dir compiler
 
 ifdef OBJECTDIRCOMPILER
-.PHONY:  compiler_all compiler_debug compiler_examples compiler_test compiler_smart compiler_shared compiler_showinstall compiler_install compiler_sourceinstall compiler_zipinstall compiler_zipinstalladd compiler_clean compiler_cleanall compiler_depend compiler_info
+.PHONY:  compiler_all compiler_debug compiler_examples compiler_test compiler_smart compiler_shared compiler_showinstall compiler_install compiler_sourceinstall compiler_zipinstall compiler_zipinstalladd compiler_clean compiler_cleanall compiler_require compiler_info
 
 compiler_all:
 	$(MAKE) -C compiler all
@@ -259,8 +275,8 @@ compiler_clean:
 compiler_cleanall:
 	$(MAKE) -C compiler cleanall
 
-compiler_depend:
-	$(MAKE) -C compiler depend
+compiler_require:
+	$(MAKE) -C compiler require
 
 compiler_info:
 	$(MAKE) -C compiler info
@@ -269,7 +285,7 @@ endif
 # Dir gdb
 
 ifdef OBJECTDIRGDB
-.PHONY:  gdb_all gdb_debug gdb_examples gdb_test gdb_smart gdb_shared gdb_showinstall gdb_install gdb_sourceinstall gdb_zipinstall gdb_zipinstalladd gdb_clean gdb_cleanall gdb_depend gdb_info
+.PHONY:  gdb_all gdb_debug gdb_examples gdb_test gdb_smart gdb_shared gdb_showinstall gdb_install gdb_sourceinstall gdb_zipinstall gdb_zipinstalladd gdb_clean gdb_cleanall gdb_require gdb_info
 
 gdb_all:
 	$(MAKE) -C gdb all
@@ -310,8 +326,8 @@ gdb_clean:
 gdb_cleanall:
 	$(MAKE) -C gdb cleanall
 
-gdb_depend:
-	$(MAKE) -C gdb depend
+gdb_require:
+	$(MAKE) -C gdb require
 
 gdb_info:
 	$(MAKE) -C gdb info

+ 36 - 11
ide/fake/compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -153,7 +164,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -161,6 +176,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -195,15 +212,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -230,6 +249,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
@@ -542,6 +564,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -646,15 +669,14 @@ 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
 endif
 
@@ -899,6 +921,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -908,7 +933,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)
 

+ 36 - 11
ide/fake/gdb/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -153,7 +164,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -161,6 +176,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -195,15 +212,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -230,6 +249,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
@@ -542,6 +564,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -646,15 +669,14 @@ 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
 endif
 
@@ -899,6 +921,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -908,7 +933,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)
 

+ 29 - 66
ide/text/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -176,15 +180,15 @@ ZIPTARGET=install
 
 # Defaults
 
-override NEEDOPT=-Sg
 
 # 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
@@ -195,22 +199,8 @@ override NEEDOBJDIR=$(GDBOBJDIR)
 
 # Packages
 
-override PACKAGES+=api fv gdbint
-ifneq ($(wildcard $(PACKAGEDIR)/api/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/api/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/api
-endif
-ifneq ($(wildcard $(PACKAGEDIR)/fv/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/fv/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/fv
-endif
-ifneq ($(wildcard $(PACKAGEDIR)/gdbint/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/gdbint/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/gdbint
-endif
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -252,15 +242,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
@@ -295,6 +287,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
@@ -342,10 +337,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -636,6 +627,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -736,50 +728,18 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall sourceinstall zipinstall zipinstalladd 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
-endif
-endif
-
-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
+	$(MAKE) -C $(PACKAGEDIR_RTL) all
 endif
 endif
 endif
 
-.PHONY:  rtl_package api_package fv_package gdbint_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -1021,6 +981,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -1030,7 +993,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)
 

+ 29 - 14
install/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:09
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 defaultrule: help
@@ -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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -179,11 +183,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
@@ -191,6 +196,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -221,15 +228,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -256,6 +265,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
@@ -576,6 +588,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -678,15 +691,14 @@ cleanall: fpc_cleanall
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall
 
-#####################################################################
-# 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
 endif
 
@@ -917,6 +929,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -926,7 +941,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)
 

+ 141 - 53
install/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 2000-01-01 15:03
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 defaultrule: both
@@ -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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -138,16 +142,16 @@ endif
 
 # Targets
 
-UNITOBJECTS=gameunit
-EXEOBJECTS=eratos qsort hello blackbox magic lines fpctris
+override UNITOBJECTS+=gameunit
+override EXEOBJECTS+=eratos qsort hello blackbox magic lines fpctris
 ifeq ($(OS_TARGET),linux)
-EXEOBJECTS+=mandel samegame quad maze gravwars
+override EXEOBJECTS+=mandel samegame quad maze gravwars
 endif
 ifeq ($(OS_TARGET),go32v2)
-EXEOBJECTS+=mandel samegame quad maze gravwars voxel
+override EXEOBJECTS+=mandel samegame quad maze gravwars voxel
 endif
 ifeq ($(OS_TARGET),win32)
-EXEOBJECTS+=winhello menu mandel dlltest testdll
+override EXEOBJECTS+=winhello menu mandel dlltest testdll
 endif
 
 # Clean
@@ -155,26 +159,39 @@ endif
 
 # Install
 
+ZIPTARGET=install
 
 # Defaults
 
 
 # Directories
 
-ifndef FPCDIR
-FPCDIR=../..
+ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
+PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
 endif
 override NEEDUNITDIR=$(FPCDIR)/api
 ifndef TARGETDIR
 TARGETDIR=.
 endif
 
+# Packages
+
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
+
 # Libraries
 
 
 # Info
 
-FPCINFO=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
 
 # Post Settings
 
@@ -208,33 +225,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
-
-
-
-# On linux, try to find where libgcc.a is.
-ifdef inlinux
-ifndef GCCLIBDIR
-GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`)
-endif
-endif
-export GCCLIBDIR
-
-# Where to find other libraries
-ifdef inlinux
-ifndef OTHERLIBDIR
-OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
-endif
-endif
-export OTHERLIBDIR
 
 #####################################################################
 # Install Directories
@@ -261,6 +262,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
@@ -308,11 +312,13 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
 endif
 
+ifdef UNITSDIR
+override FPCOPT+=-Fu$(UNITSDIR)
+endif
 
 ifdef NEEDUNITDIR
 override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
@@ -323,7 +329,6 @@ ifdef TARGETDIR
 override FPCOPT+=-FE$(TARGETDIR)
 endif
 
-
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -484,6 +489,39 @@ endif
 endif
 export ECHO
 
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+export PPDEP
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+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)
 ifndef UPXPROG
@@ -556,6 +594,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -630,31 +669,76 @@ PASEXT=.pas
 endif
 endif
 
+#####################################################################
+# Standard rules
+#####################################################################
 
 all: fpc_all
 
-staticlib: fpc_staticlib
+debug: fpc_debug
 
-sharedlib: fpc_sharedlib
+smart: fpc_smart
 
-showinstall: fpc_showinstall
+shared: fpc_shared
 
-staticinstall: fpc_staticinstall
+showinstall: fpc_showinstall
 
-sharedinstall: fpc_sharedinstall
+install: fpc_install
 
-libinstall: fpc_libinstall
+sourceinstall: fpc_sourceinstall
 
 zipinstall: fpc_zipinstall
 
 zipinstalladd: fpc_zipinstalladd
 
-clean_all: fpc_clean_all
-
-depend: fpc_depend
+cleanall: fpc_cleanall
 
 info: fpc_info
 
+.PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd cleanall info
+
+
+ifdef PACKAGERTL
+ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
+ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
+override COMPILEPACKAGES+=rtl
+rtl_package:
+	$(MAKE) -C $(PACKAGEDIR_RTL) all
+endif
+endif
+endif
+
+.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)
+
+#####################################################################
+# Exes
+#####################################################################
+
+.PHONY: fpc_exes
+
+override EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
+override EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
+
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
+
+fpc_exes: $(EXEFILES)
+
 #####################################################################
 # General compile rules
 #####################################################################
@@ -782,6 +866,16 @@ ifdef EXTRAINSTALLFILES
 	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
 endif
 
+#####################################################################
+# Source install rules
+#####################################################################
+
+.PHONY: fpc_sourceinstall
+
+fpc_sourceinstall: clean
+	$(MKDIR) $(SOURCEINSTALLDIR)
+	$(COPYTREE) $(BASEDIR) $(SOURCEINSTALLDIR)
+
 #####################################################################
 # Zip
 #####################################################################
@@ -870,6 +964,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -879,19 +976,10 @@ 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)
 
-#####################################################################
-# Depend rules
-#####################################################################
-
-.PHONY: fpc_depend
-
-fpc_depend:
-	$(PPDEP) $(UNITOBJECTS)
-
 #####################################################################
 # Info rules
 #####################################################################

+ 29 - 14
install/fpinst/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -110,6 +110,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -170,11 +174,12 @@ ZIPTARGET=install
 # Directories
 
 vpath %$(PASEXT) $(INC)
-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
@@ -185,6 +190,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -220,15 +227,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -255,6 +264,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
@@ -580,6 +592,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -688,15 +701,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -956,6 +968,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -965,7 +980,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)
 

+ 133 - 65
packages/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -138,7 +149,7 @@ endif
 
 # Targets
 
-override DIROBJECTS+=$(wildcard ibase mysql uncgi gdbint api fv)
+override DIROBJECTS+=$(wildcard fcl ibase mysql uncgi gdbint api fv)
 ifeq ($(OS_TARGET),linux)
 override DIROBJECTS+=$(wildcard gtk opengl utmp inet postgres ncurses x11 forms svgalib ggi zlib)
 endif
@@ -165,7 +176,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -173,6 +188,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -203,19 +220,18 @@ clean: $(addsuffix _clean,$(DIROBJECTS))
 
 cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
 
-depend: $(addsuffix _depend,$(DIROBJECTS))
+require: $(addsuffix _require,$(DIROBJECTS))
 
-.PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall depend
+.PHONY:  all debug examples test smart shared showinstall install sourceinstall clean cleanall require
 
-#####################################################################
-# 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
 endif
 
@@ -224,6 +240,7 @@ endif
 
 # Target Dirs
 
+OBJECTDIRFCL=1
 OBJECTDIRIBASE=1
 OBJECTDIRMYSQL=1
 OBJECTDIRUNCGI=1
@@ -255,10 +272,61 @@ ifeq ($(OS_TARGET),os2)
 OBJECTDIRPASZLIB=1
 endif
 
+# Dir fcl
+
+ifdef OBJECTDIRFCL
+.PHONY:  fcl_all fcl_debug fcl_examples fcl_test fcl_smart fcl_shared fcl_showinstall fcl_install fcl_sourceinstall fcl_zipinstall fcl_zipinstalladd fcl_clean fcl_cleanall fcl_require fcl_info
+
+fcl_all:
+	$(MAKE) -C fcl all
+
+fcl_debug:
+	$(MAKE) -C fcl debug
+
+fcl_examples:
+	$(MAKE) -C fcl examples
+
+fcl_test:
+	$(MAKE) -C fcl test
+
+fcl_smart:
+	$(MAKE) -C fcl smart
+
+fcl_shared:
+	$(MAKE) -C fcl shared
+
+fcl_showinstall:
+	$(MAKE) -C fcl showinstall
+
+fcl_install:
+	$(MAKE) -C fcl install
+
+fcl_sourceinstall:
+	$(MAKE) -C fcl sourceinstall
+
+fcl_zipinstall:
+	$(MAKE) -C fcl zipinstall
+
+fcl_zipinstalladd:
+	$(MAKE) -C fcl zipinstalladd
+
+fcl_clean:
+	$(MAKE) -C fcl clean
+
+fcl_cleanall:
+	$(MAKE) -C fcl cleanall
+
+fcl_require:
+	$(MAKE) -C fcl require
+
+fcl_info:
+	$(MAKE) -C fcl info
+endif
+
 # Dir ibase
 
 ifdef OBJECTDIRIBASE
-.PHONY:  ibase_all ibase_debug ibase_examples ibase_test ibase_smart ibase_shared ibase_showinstall ibase_install ibase_sourceinstall ibase_zipinstall ibase_zipinstalladd ibase_clean ibase_cleanall ibase_depend ibase_info
+.PHONY:  ibase_all ibase_debug ibase_examples ibase_test ibase_smart ibase_shared ibase_showinstall ibase_install ibase_sourceinstall ibase_zipinstall ibase_zipinstalladd ibase_clean ibase_cleanall ibase_require ibase_info
 
 ibase_all:
 	$(MAKE) -C ibase all
@@ -299,8 +367,8 @@ ibase_clean:
 ibase_cleanall:
 	$(MAKE) -C ibase cleanall
 
-ibase_depend:
-	$(MAKE) -C ibase depend
+ibase_require:
+	$(MAKE) -C ibase require
 
 ibase_info:
 	$(MAKE) -C ibase info
@@ -309,7 +377,7 @@ endif
 # Dir mysql
 
 ifdef OBJECTDIRMYSQL
-.PHONY:  mysql_all mysql_debug mysql_examples mysql_test mysql_smart mysql_shared mysql_showinstall mysql_install mysql_sourceinstall mysql_zipinstall mysql_zipinstalladd mysql_clean mysql_cleanall mysql_depend mysql_info
+.PHONY:  mysql_all mysql_debug mysql_examples mysql_test mysql_smart mysql_shared mysql_showinstall mysql_install mysql_sourceinstall mysql_zipinstall mysql_zipinstalladd mysql_clean mysql_cleanall mysql_require mysql_info
 
 mysql_all:
 	$(MAKE) -C mysql all
@@ -350,8 +418,8 @@ mysql_clean:
 mysql_cleanall:
 	$(MAKE) -C mysql cleanall
 
-mysql_depend:
-	$(MAKE) -C mysql depend
+mysql_require:
+	$(MAKE) -C mysql require
 
 mysql_info:
 	$(MAKE) -C mysql info
@@ -360,7 +428,7 @@ endif
 # Dir uncgi
 
 ifdef OBJECTDIRUNCGI
-.PHONY:  uncgi_all uncgi_debug uncgi_examples uncgi_test uncgi_smart uncgi_shared uncgi_showinstall uncgi_install uncgi_sourceinstall uncgi_zipinstall uncgi_zipinstalladd uncgi_clean uncgi_cleanall uncgi_depend uncgi_info
+.PHONY:  uncgi_all uncgi_debug uncgi_examples uncgi_test uncgi_smart uncgi_shared uncgi_showinstall uncgi_install uncgi_sourceinstall uncgi_zipinstall uncgi_zipinstalladd uncgi_clean uncgi_cleanall uncgi_require uncgi_info
 
 uncgi_all:
 	$(MAKE) -C uncgi all
@@ -401,8 +469,8 @@ uncgi_clean:
 uncgi_cleanall:
 	$(MAKE) -C uncgi cleanall
 
-uncgi_depend:
-	$(MAKE) -C uncgi depend
+uncgi_require:
+	$(MAKE) -C uncgi require
 
 uncgi_info:
 	$(MAKE) -C uncgi info
@@ -411,7 +479,7 @@ endif
 # Dir gdbint
 
 ifdef OBJECTDIRGDBINT
-.PHONY:  gdbint_all gdbint_debug gdbint_examples gdbint_test gdbint_smart gdbint_shared gdbint_showinstall gdbint_install gdbint_sourceinstall gdbint_zipinstall gdbint_zipinstalladd gdbint_clean gdbint_cleanall gdbint_depend gdbint_info
+.PHONY:  gdbint_all gdbint_debug gdbint_examples gdbint_test gdbint_smart gdbint_shared gdbint_showinstall gdbint_install gdbint_sourceinstall gdbint_zipinstall gdbint_zipinstalladd gdbint_clean gdbint_cleanall gdbint_require gdbint_info
 
 gdbint_all:
 	$(MAKE) -C gdbint all
@@ -452,8 +520,8 @@ gdbint_clean:
 gdbint_cleanall:
 	$(MAKE) -C gdbint cleanall
 
-gdbint_depend:
-	$(MAKE) -C gdbint depend
+gdbint_require:
+	$(MAKE) -C gdbint require
 
 gdbint_info:
 	$(MAKE) -C gdbint info
@@ -462,7 +530,7 @@ endif
 # Dir api
 
 ifdef OBJECTDIRAPI
-.PHONY:  api_all api_debug api_examples api_test api_smart api_shared api_showinstall api_install api_sourceinstall api_zipinstall api_zipinstalladd api_clean api_cleanall api_depend api_info
+.PHONY:  api_all api_debug api_examples api_test api_smart api_shared api_showinstall api_install api_sourceinstall api_zipinstall api_zipinstalladd api_clean api_cleanall api_require api_info
 
 api_all:
 	$(MAKE) -C api all
@@ -503,8 +571,8 @@ api_clean:
 api_cleanall:
 	$(MAKE) -C api cleanall
 
-api_depend:
-	$(MAKE) -C api depend
+api_require:
+	$(MAKE) -C api require
 
 api_info:
 	$(MAKE) -C api info
@@ -513,7 +581,7 @@ endif
 # Dir fv
 
 ifdef OBJECTDIRFV
-.PHONY:  fv_all fv_debug fv_examples fv_test fv_smart fv_shared fv_showinstall fv_install fv_sourceinstall fv_zipinstall fv_zipinstalladd fv_clean fv_cleanall fv_depend fv_info
+.PHONY:  fv_all fv_debug fv_examples fv_test fv_smart fv_shared fv_showinstall fv_install fv_sourceinstall fv_zipinstall fv_zipinstalladd fv_clean fv_cleanall fv_require fv_info
 
 fv_all:
 	$(MAKE) -C fv all
@@ -554,8 +622,8 @@ fv_clean:
 fv_cleanall:
 	$(MAKE) -C fv cleanall
 
-fv_depend:
-	$(MAKE) -C fv depend
+fv_require:
+	$(MAKE) -C fv require
 
 fv_info:
 	$(MAKE) -C fv info
@@ -564,7 +632,7 @@ endif
 # Dir gtk
 
 ifdef OBJECTDIRGTK
-.PHONY:  gtk_all gtk_debug gtk_examples gtk_test gtk_smart gtk_shared gtk_showinstall gtk_install gtk_sourceinstall gtk_zipinstall gtk_zipinstalladd gtk_clean gtk_cleanall gtk_depend gtk_info
+.PHONY:  gtk_all gtk_debug gtk_examples gtk_test gtk_smart gtk_shared gtk_showinstall gtk_install gtk_sourceinstall gtk_zipinstall gtk_zipinstalladd gtk_clean gtk_cleanall gtk_require gtk_info
 
 gtk_all:
 	$(MAKE) -C gtk all
@@ -605,8 +673,8 @@ gtk_clean:
 gtk_cleanall:
 	$(MAKE) -C gtk cleanall
 
-gtk_depend:
-	$(MAKE) -C gtk depend
+gtk_require:
+	$(MAKE) -C gtk require
 
 gtk_info:
 	$(MAKE) -C gtk info
@@ -615,7 +683,7 @@ endif
 # Dir opengl
 
 ifdef OBJECTDIROPENGL
-.PHONY:  opengl_all opengl_debug opengl_examples opengl_test opengl_smart opengl_shared opengl_showinstall opengl_install opengl_sourceinstall opengl_zipinstall opengl_zipinstalladd opengl_clean opengl_cleanall opengl_depend opengl_info
+.PHONY:  opengl_all opengl_debug opengl_examples opengl_test opengl_smart opengl_shared opengl_showinstall opengl_install opengl_sourceinstall opengl_zipinstall opengl_zipinstalladd opengl_clean opengl_cleanall opengl_require opengl_info
 
 opengl_all:
 	$(MAKE) -C opengl all
@@ -656,8 +724,8 @@ opengl_clean:
 opengl_cleanall:
 	$(MAKE) -C opengl cleanall
 
-opengl_depend:
-	$(MAKE) -C opengl depend
+opengl_require:
+	$(MAKE) -C opengl require
 
 opengl_info:
 	$(MAKE) -C opengl info
@@ -666,7 +734,7 @@ endif
 # Dir utmp
 
 ifdef OBJECTDIRUTMP
-.PHONY:  utmp_all utmp_debug utmp_examples utmp_test utmp_smart utmp_shared utmp_showinstall utmp_install utmp_sourceinstall utmp_zipinstall utmp_zipinstalladd utmp_clean utmp_cleanall utmp_depend utmp_info
+.PHONY:  utmp_all utmp_debug utmp_examples utmp_test utmp_smart utmp_shared utmp_showinstall utmp_install utmp_sourceinstall utmp_zipinstall utmp_zipinstalladd utmp_clean utmp_cleanall utmp_require utmp_info
 
 utmp_all:
 	$(MAKE) -C utmp all
@@ -707,8 +775,8 @@ utmp_clean:
 utmp_cleanall:
 	$(MAKE) -C utmp cleanall
 
-utmp_depend:
-	$(MAKE) -C utmp depend
+utmp_require:
+	$(MAKE) -C utmp require
 
 utmp_info:
 	$(MAKE) -C utmp info
@@ -717,7 +785,7 @@ endif
 # Dir inet
 
 ifdef OBJECTDIRINET
-.PHONY:  inet_all inet_debug inet_examples inet_test inet_smart inet_shared inet_showinstall inet_install inet_sourceinstall inet_zipinstall inet_zipinstalladd inet_clean inet_cleanall inet_depend inet_info
+.PHONY:  inet_all inet_debug inet_examples inet_test inet_smart inet_shared inet_showinstall inet_install inet_sourceinstall inet_zipinstall inet_zipinstalladd inet_clean inet_cleanall inet_require inet_info
 
 inet_all:
 	$(MAKE) -C inet all
@@ -758,8 +826,8 @@ inet_clean:
 inet_cleanall:
 	$(MAKE) -C inet cleanall
 
-inet_depend:
-	$(MAKE) -C inet depend
+inet_require:
+	$(MAKE) -C inet require
 
 inet_info:
 	$(MAKE) -C inet info
@@ -768,7 +836,7 @@ endif
 # Dir postgres
 
 ifdef OBJECTDIRPOSTGRES
-.PHONY:  postgres_all postgres_debug postgres_examples postgres_test postgres_smart postgres_shared postgres_showinstall postgres_install postgres_sourceinstall postgres_zipinstall postgres_zipinstalladd postgres_clean postgres_cleanall postgres_depend postgres_info
+.PHONY:  postgres_all postgres_debug postgres_examples postgres_test postgres_smart postgres_shared postgres_showinstall postgres_install postgres_sourceinstall postgres_zipinstall postgres_zipinstalladd postgres_clean postgres_cleanall postgres_require postgres_info
 
 postgres_all:
 	$(MAKE) -C postgres all
@@ -809,8 +877,8 @@ postgres_clean:
 postgres_cleanall:
 	$(MAKE) -C postgres cleanall
 
-postgres_depend:
-	$(MAKE) -C postgres depend
+postgres_require:
+	$(MAKE) -C postgres require
 
 postgres_info:
 	$(MAKE) -C postgres info
@@ -819,7 +887,7 @@ endif
 # Dir ncurses
 
 ifdef OBJECTDIRNCURSES
-.PHONY:  ncurses_all ncurses_debug ncurses_examples ncurses_test ncurses_smart ncurses_shared ncurses_showinstall ncurses_install ncurses_sourceinstall ncurses_zipinstall ncurses_zipinstalladd ncurses_clean ncurses_cleanall ncurses_depend ncurses_info
+.PHONY:  ncurses_all ncurses_debug ncurses_examples ncurses_test ncurses_smart ncurses_shared ncurses_showinstall ncurses_install ncurses_sourceinstall ncurses_zipinstall ncurses_zipinstalladd ncurses_clean ncurses_cleanall ncurses_require ncurses_info
 
 ncurses_all:
 	$(MAKE) -C ncurses all
@@ -860,8 +928,8 @@ ncurses_clean:
 ncurses_cleanall:
 	$(MAKE) -C ncurses cleanall
 
-ncurses_depend:
-	$(MAKE) -C ncurses depend
+ncurses_require:
+	$(MAKE) -C ncurses require
 
 ncurses_info:
 	$(MAKE) -C ncurses info
@@ -870,7 +938,7 @@ endif
 # Dir x11
 
 ifdef OBJECTDIRX11
-.PHONY:  x11_all x11_debug x11_examples x11_test x11_smart x11_shared x11_showinstall x11_install x11_sourceinstall x11_zipinstall x11_zipinstalladd x11_clean x11_cleanall x11_depend x11_info
+.PHONY:  x11_all x11_debug x11_examples x11_test x11_smart x11_shared x11_showinstall x11_install x11_sourceinstall x11_zipinstall x11_zipinstalladd x11_clean x11_cleanall x11_require x11_info
 
 x11_all:
 	$(MAKE) -C x11 all
@@ -911,8 +979,8 @@ x11_clean:
 x11_cleanall:
 	$(MAKE) -C x11 cleanall
 
-x11_depend:
-	$(MAKE) -C x11 depend
+x11_require:
+	$(MAKE) -C x11 require
 
 x11_info:
 	$(MAKE) -C x11 info
@@ -921,7 +989,7 @@ endif
 # Dir forms
 
 ifdef OBJECTDIRFORMS
-.PHONY:  forms_all forms_debug forms_examples forms_test forms_smart forms_shared forms_showinstall forms_install forms_sourceinstall forms_zipinstall forms_zipinstalladd forms_clean forms_cleanall forms_depend forms_info
+.PHONY:  forms_all forms_debug forms_examples forms_test forms_smart forms_shared forms_showinstall forms_install forms_sourceinstall forms_zipinstall forms_zipinstalladd forms_clean forms_cleanall forms_require forms_info
 
 forms_all:
 	$(MAKE) -C forms all
@@ -962,8 +1030,8 @@ forms_clean:
 forms_cleanall:
 	$(MAKE) -C forms cleanall
 
-forms_depend:
-	$(MAKE) -C forms depend
+forms_require:
+	$(MAKE) -C forms require
 
 forms_info:
 	$(MAKE) -C forms info
@@ -972,7 +1040,7 @@ endif
 # Dir svgalib
 
 ifdef OBJECTDIRSVGALIB
-.PHONY:  svgalib_all svgalib_debug svgalib_examples svgalib_test svgalib_smart svgalib_shared svgalib_showinstall svgalib_install svgalib_sourceinstall svgalib_zipinstall svgalib_zipinstalladd svgalib_clean svgalib_cleanall svgalib_depend svgalib_info
+.PHONY:  svgalib_all svgalib_debug svgalib_examples svgalib_test svgalib_smart svgalib_shared svgalib_showinstall svgalib_install svgalib_sourceinstall svgalib_zipinstall svgalib_zipinstalladd svgalib_clean svgalib_cleanall svgalib_require svgalib_info
 
 svgalib_all:
 	$(MAKE) -C svgalib all
@@ -1013,8 +1081,8 @@ svgalib_clean:
 svgalib_cleanall:
 	$(MAKE) -C svgalib cleanall
 
-svgalib_depend:
-	$(MAKE) -C svgalib depend
+svgalib_require:
+	$(MAKE) -C svgalib require
 
 svgalib_info:
 	$(MAKE) -C svgalib info
@@ -1023,7 +1091,7 @@ endif
 # Dir ggi
 
 ifdef OBJECTDIRGGI
-.PHONY:  ggi_all ggi_debug ggi_examples ggi_test ggi_smart ggi_shared ggi_showinstall ggi_install ggi_sourceinstall ggi_zipinstall ggi_zipinstalladd ggi_clean ggi_cleanall ggi_depend ggi_info
+.PHONY:  ggi_all ggi_debug ggi_examples ggi_test ggi_smart ggi_shared ggi_showinstall ggi_install ggi_sourceinstall ggi_zipinstall ggi_zipinstalladd ggi_clean ggi_cleanall ggi_require ggi_info
 
 ggi_all:
 	$(MAKE) -C ggi all
@@ -1064,8 +1132,8 @@ ggi_clean:
 ggi_cleanall:
 	$(MAKE) -C ggi cleanall
 
-ggi_depend:
-	$(MAKE) -C ggi depend
+ggi_require:
+	$(MAKE) -C ggi require
 
 ggi_info:
 	$(MAKE) -C ggi info
@@ -1074,7 +1142,7 @@ endif
 # Dir zlib
 
 ifdef OBJECTDIRZLIB
-.PHONY:  zlib_all zlib_debug zlib_examples zlib_test zlib_smart zlib_shared zlib_showinstall zlib_install zlib_sourceinstall zlib_zipinstall zlib_zipinstalladd zlib_clean zlib_cleanall zlib_depend zlib_info
+.PHONY:  zlib_all zlib_debug zlib_examples zlib_test zlib_smart zlib_shared zlib_showinstall zlib_install zlib_sourceinstall zlib_zipinstall zlib_zipinstalladd zlib_clean zlib_cleanall zlib_require zlib_info
 
 zlib_all:
 	$(MAKE) -C zlib all
@@ -1115,8 +1183,8 @@ zlib_clean:
 zlib_cleanall:
 	$(MAKE) -C zlib cleanall
 
-zlib_depend:
-	$(MAKE) -C zlib depend
+zlib_require:
+	$(MAKE) -C zlib require
 
 zlib_info:
 	$(MAKE) -C zlib info
@@ -1125,7 +1193,7 @@ endif
 # Dir paszlib
 
 ifdef OBJECTDIRPASZLIB
-.PHONY:  paszlib_all paszlib_debug paszlib_examples paszlib_test paszlib_smart paszlib_shared paszlib_showinstall paszlib_install paszlib_sourceinstall paszlib_zipinstall paszlib_zipinstalladd paszlib_clean paszlib_cleanall paszlib_depend paszlib_info
+.PHONY:  paszlib_all paszlib_debug paszlib_examples paszlib_test paszlib_smart paszlib_shared paszlib_showinstall paszlib_install paszlib_sourceinstall paszlib_zipinstall paszlib_zipinstalladd paszlib_clean paszlib_cleanall paszlib_require paszlib_info
 
 paszlib_all:
 	$(MAKE) -C paszlib all
@@ -1166,8 +1234,8 @@ paszlib_clean:
 paszlib_cleanall:
 	$(MAKE) -C paszlib cleanall
 
-paszlib_depend:
-	$(MAKE) -C paszlib depend
+paszlib_require:
+	$(MAKE) -C paszlib require
 
 paszlib_info:
 	$(MAKE) -C paszlib info

+ 29 - 35
packages/forms/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,12 +170,8 @@ endif
 
 # Packages
 
-override PACKAGES+=x11
-ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/x11/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/x11
-endif
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -205,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -240,6 +243,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
@@ -295,10 +301,6 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
-ifdef NEEDUNITDIR
-override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
-endif
-
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -564,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -668,30 +671,18 @@ 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
-endif
-endif
-
-PACKAGEX11=1
-ifdef PACKAGEX11
-ifneq ($(wildcard $(PACKAGEDIR)/x11),)
-ifeq ($(wildcard $(PACKAGEDIR)/x11/$(FPCMADE)),)
-override COMPILEPACKAGES+=x11
-x11_package:
-	$(MAKE) -C $(PACKAGEDIR)/x11 all
+	$(MAKE) -C $(PACKAGEDIR_RTL) all
 endif
 endif
 endif
 
-.PHONY:  rtl_package x11_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -947,6 +938,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -956,7 +950,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)
 

+ 29 - 50
packages/forms/demo/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -152,11 +156,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
@@ -164,17 +169,8 @@ endif
 
 # Packages
 
-override PACKAGES+=forms x11
-ifneq ($(wildcard $(PACKAGEDIR)/forms/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/forms/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/forms
-endif
-ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/x11/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/x11
-endif
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -210,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 # Where to find other libraries
 ifdef inlinux
@@ -253,6 +251,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
@@ -308,10 +309,6 @@ 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))
@@ -582,6 +579,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -686,40 +684,18 @@ 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
-endif
-endif
-
-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
+	$(MAKE) -C $(PACKAGEDIR_RTL) all
 endif
 endif
 endif
 
-.PHONY:  rtl_package forms_package x11_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -961,6 +937,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -970,7 +949,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)
 

+ 30 - 31
packages/gdbint/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -139,8 +143,7 @@ endif
 # Targets
 
 override UNITOBJECTS+=gdbint gdbcon
-override EXEOBJECTS+=symify
-override EXAMPLEOBJECTS+=testgdb
+override EXAMPLEOBJECTS+=testgdb symify
 
 # Clean
 
@@ -154,11 +157,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
@@ -171,6 +175,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -206,15 +212,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
@@ -249,6 +257,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
@@ -587,6 +598,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -693,15 +705,14 @@ info: fpc_info
 
 .PHONY:  all debug examples 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
 endif
 
@@ -721,21 +732,6 @@ override CLEANPPUFILES+=$(UNITPPUFILES)
 
 fpc_units: $(UNITPPUFILES)
 
-#####################################################################
-# Exes
-#####################################################################
-
-.PHONY: fpc_exes
-
-override EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
-override EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
-
-override ALLTARGET+=fpc_exes
-override INSTALLEXEFILES+=$(EXEFILES)
-override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
-
-fpc_exes: $(EXEFILES)
-
 #####################################################################
 # Examples
 #####################################################################
@@ -976,6 +972,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -985,7 +984,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)
 

+ 24 - 8
packages/gdbint/libgdb/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -152,7 +163,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -160,6 +175,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -168,15 +185,14 @@ endif
 # Standard rules
 #####################################################################
 
-#####################################################################
-# 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
 endif
 

+ 29 - 14
packages/ggi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 29 - 14
packages/gtk/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,12 @@ ZIPTARGET=install
 # Directories
 
 vpath %$(PASEXT) glib gdk gtk
-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
@@ -168,6 +173,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -203,15 +210,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -238,6 +247,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
@@ -563,6 +575,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -665,15 +678,14 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd 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
 endif
 
@@ -918,6 +930,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -927,7 +942,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)
 

+ 29 - 14
packages/gtk/examples/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -169,6 +174,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -205,15 +212,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
@@ -256,6 +265,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
@@ -595,6 +607,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -699,15 +712,14 @@ 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
 endif
 
@@ -953,6 +965,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -962,7 +977,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)
 

+ 29 - 14
packages/gtk/tutorial/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -152,11 +156,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
@@ -168,6 +173,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -204,15 +211,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
@@ -255,6 +264,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
@@ -594,6 +606,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -698,15 +711,14 @@ 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
 endif
 
@@ -952,6 +964,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -961,7 +976,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)
 

+ 29 - 14
packages/ibase/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 29 - 14
packages/inet/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 29 - 14
packages/mysql/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 29 - 14
packages/ncurses/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 35 - 19
packages/opengl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -153,7 +164,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -161,6 +176,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -193,19 +210,18 @@ clean: $(addsuffix _clean,$(DIROBJECTS))
 
 cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
 
-depend: $(addsuffix _depend,$(DIROBJECTS))
+require: $(addsuffix _require,$(DIROBJECTS))
 
-.PHONY:  all debug test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall depend
+.PHONY:  all debug test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall require
 
-#####################################################################
-# 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
 endif
 
@@ -221,7 +237,7 @@ OBJECTDIRBUILD=1
 # Dir linux
 
 ifdef OBJECTDIRLINUX
-.PHONY:  linux_all linux_debug linux_examples linux_test linux_smart linux_shared linux_showinstall linux_install linux_sourceinstall linux_zipinstall linux_zipinstalladd linux_clean linux_cleanall linux_depend linux_info
+.PHONY:  linux_all linux_debug linux_examples linux_test linux_smart linux_shared linux_showinstall linux_install linux_sourceinstall linux_zipinstall linux_zipinstalladd linux_clean linux_cleanall linux_require linux_info
 
 linux_all:
 	$(MAKE) -C linux all
@@ -262,8 +278,8 @@ linux_clean:
 linux_cleanall:
 	$(MAKE) -C linux cleanall
 
-linux_depend:
-	$(MAKE) -C linux depend
+linux_require:
+	$(MAKE) -C linux require
 
 linux_info:
 	$(MAKE) -C linux info
@@ -272,7 +288,7 @@ endif
 # Dir examples
 
 ifdef OBJECTDIREXAMPLES
-.PHONY:  examples_all examples_debug examples_examples examples_test examples_smart examples_shared examples_showinstall examples_install examples_sourceinstall examples_zipinstall examples_zipinstalladd examples_clean examples_cleanall examples_depend examples_info
+.PHONY:  examples_all examples_debug examples_examples examples_test examples_smart examples_shared examples_showinstall examples_install examples_sourceinstall examples_zipinstall examples_zipinstalladd examples_clean examples_cleanall examples_require examples_info
 
 examples_all:
 	$(MAKE) -C examples all
@@ -313,8 +329,8 @@ examples_clean:
 examples_cleanall:
 	$(MAKE) -C examples cleanall
 
-examples_depend:
-	$(MAKE) -C examples depend
+examples_require:
+	$(MAKE) -C examples require
 
 examples_info:
 	$(MAKE) -C examples info
@@ -323,7 +339,7 @@ endif
 # Dir build
 
 ifdef OBJECTDIRBUILD
-.PHONY:  build_all build_debug build_examples build_test build_smart build_shared build_showinstall build_install build_sourceinstall build_zipinstall build_zipinstalladd build_clean build_cleanall build_depend build_info
+.PHONY:  build_all build_debug build_examples build_test build_smart build_shared build_showinstall build_install build_sourceinstall build_zipinstall build_zipinstalladd build_clean build_cleanall build_require build_info
 
 build_all:
 	$(MAKE) -C build all
@@ -364,8 +380,8 @@ build_clean:
 build_cleanall:
 	$(MAKE) -C build cleanall
 
-build_depend:
-	$(MAKE) -C build depend
+build_require:
+	$(MAKE) -C build require
 
 build_info:
 	$(MAKE) -C build info

+ 29 - 50
packages/opengl/examples/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -152,11 +156,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
@@ -164,17 +169,8 @@ endif
 
 # Packages
 
-override PACKAGES+=opengl x11
-ifneq ($(wildcard $(PACKAGEDIR)/opengl/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/opengl/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/opengl
-endif
-ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/x11/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/x11
-endif
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -210,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 # Where to find other libraries
 ifdef inlinux
@@ -253,6 +251,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
@@ -308,10 +309,6 @@ 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))
@@ -582,6 +579,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -686,40 +684,18 @@ 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
-endif
-endif
-
-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
+	$(MAKE) -C $(PACKAGEDIR_RTL) all
 endif
 endif
 endif
 
-.PHONY:  rtl_package opengl_package x11_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -961,6 +937,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -970,7 +949,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)
 

+ 29 - 35
packages/opengl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -110,6 +110,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -158,11 +162,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
@@ -170,12 +175,8 @@ endif
 
 # Packages
 
-override PACKAGES+=x11
-ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
-override NEEDUNITDIR+=$(PACKAGEDIR)/x11/$(OS_TARGET)
-else
-override NEEDUNITDIR+=$(PACKAGEDIR)/x11
-endif
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -210,15 +211,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -245,6 +248,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
@@ -300,10 +306,6 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
-ifdef NEEDUNITDIR
-override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
-endif
-
 # Smartlinking
 ifdef SMARTLINK
 override FPCOPT+=-CX
@@ -569,6 +571,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -673,30 +676,18 @@ 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
-endif
-endif
-
-PACKAGEX11=1
-ifdef PACKAGEX11
-ifneq ($(wildcard $(PACKAGEDIR)/x11),)
-ifeq ($(wildcard $(PACKAGEDIR)/x11/$(FPCMADE)),)
-override COMPILEPACKAGES+=x11
-x11_package:
-	$(MAKE) -C $(PACKAGEDIR)/x11 all
+	$(MAKE) -C $(PACKAGEDIR_RTL) all
 endif
 endif
 endif
 
-.PHONY:  rtl_package x11_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Units
@@ -937,6 +928,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -946,7 +940,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)
 

+ 29 - 19
packages/paszlib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -150,15 +154,15 @@ ZIPTARGET=install
 
 # Defaults
 
-override NEEDOPT=-Sm
 
 # 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
@@ -166,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -200,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -235,6 +243,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
@@ -282,10 +293,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -559,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -667,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -935,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -944,7 +954,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)
 

+ 29 - 14
packages/postgres/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 29 - 14
packages/svgalib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 29 - 14
packages/uncgi/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 29 - 14
packages/utmp/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +675,14 @@ info: fpc_info
 
 .PHONY:  all debug examples test 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
 endif
 
@@ -930,6 +942,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -939,7 +954,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)
 

+ 29 - 14
packages/x11/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -152,11 +156,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
@@ -164,6 +169,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -198,15 +205,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -233,6 +242,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
@@ -553,6 +565,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -657,15 +670,14 @@ 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
 endif
 
@@ -910,6 +922,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -919,7 +934,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)
 

+ 29 - 19
packages/zlib/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -149,15 +153,15 @@ ZIPTARGET=install
 
 # Defaults
 
-override NEEDOPT=-Sm
 
 # 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
@@ -165,6 +169,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +205,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +242,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
@@ -281,10 +292,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -558,6 +565,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -662,15 +670,14 @@ 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
 endif
 
@@ -915,6 +922,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -924,7 +934,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)
 

+ 41 - 25
rtl/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -153,7 +164,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -161,6 +176,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -195,21 +212,20 @@ clean: $(addsuffix _clean,$(OS_TARGET))
 
 cleanall: $(addsuffix _cleanall,$(OS_TARGET))
 
-depend: $(addsuffix _depend,$(OS_TARGET))
+require: $(addsuffix _require,$(OS_TARGET))
 
 info: $(addsuffix _info,$(OS_TARGET))
 
-.PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall depend info
+.PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall require 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
 endif
 
@@ -227,7 +243,7 @@ OBJECTDIRGO32V1=1
 # Dir go32v2
 
 ifdef OBJECTDIRGO32V2
-.PHONY:  go32v2_all go32v2_debug go32v2_examples go32v2_test go32v2_smart go32v2_shared go32v2_showinstall go32v2_install go32v2_sourceinstall go32v2_zipinstall go32v2_zipinstalladd go32v2_clean go32v2_cleanall go32v2_depend go32v2_info
+.PHONY:  go32v2_all go32v2_debug go32v2_examples go32v2_test go32v2_smart go32v2_shared go32v2_showinstall go32v2_install go32v2_sourceinstall go32v2_zipinstall go32v2_zipinstalladd go32v2_clean go32v2_cleanall go32v2_require go32v2_info
 
 go32v2_all:
 	$(MAKE) -C go32v2 all
@@ -268,8 +284,8 @@ go32v2_clean:
 go32v2_cleanall:
 	$(MAKE) -C go32v2 cleanall
 
-go32v2_depend:
-	$(MAKE) -C go32v2 depend
+go32v2_require:
+	$(MAKE) -C go32v2 require
 
 go32v2_info:
 	$(MAKE) -C go32v2 info
@@ -278,7 +294,7 @@ endif
 # Dir linux
 
 ifdef OBJECTDIRLINUX
-.PHONY:  linux_all linux_debug linux_examples linux_test linux_smart linux_shared linux_showinstall linux_install linux_sourceinstall linux_zipinstall linux_zipinstalladd linux_clean linux_cleanall linux_depend linux_info
+.PHONY:  linux_all linux_debug linux_examples linux_test linux_smart linux_shared linux_showinstall linux_install linux_sourceinstall linux_zipinstall linux_zipinstalladd linux_clean linux_cleanall linux_require linux_info
 
 linux_all:
 	$(MAKE) -C linux all
@@ -319,8 +335,8 @@ linux_clean:
 linux_cleanall:
 	$(MAKE) -C linux cleanall
 
-linux_depend:
-	$(MAKE) -C linux depend
+linux_require:
+	$(MAKE) -C linux require
 
 linux_info:
 	$(MAKE) -C linux info
@@ -329,7 +345,7 @@ endif
 # Dir win32
 
 ifdef OBJECTDIRWIN32
-.PHONY:  win32_all win32_debug win32_examples win32_test win32_smart win32_shared win32_showinstall win32_install win32_sourceinstall win32_zipinstall win32_zipinstalladd win32_clean win32_cleanall win32_depend win32_info
+.PHONY:  win32_all win32_debug win32_examples win32_test win32_smart win32_shared win32_showinstall win32_install win32_sourceinstall win32_zipinstall win32_zipinstalladd win32_clean win32_cleanall win32_require win32_info
 
 win32_all:
 	$(MAKE) -C win32 all
@@ -370,8 +386,8 @@ win32_clean:
 win32_cleanall:
 	$(MAKE) -C win32 cleanall
 
-win32_depend:
-	$(MAKE) -C win32 depend
+win32_require:
+	$(MAKE) -C win32 require
 
 win32_info:
 	$(MAKE) -C win32 info
@@ -380,7 +396,7 @@ endif
 # Dir os2
 
 ifdef OBJECTDIROS2
-.PHONY:  os2_all os2_debug os2_examples os2_test os2_smart os2_shared os2_showinstall os2_install os2_sourceinstall os2_zipinstall os2_zipinstalladd os2_clean os2_cleanall os2_depend os2_info
+.PHONY:  os2_all os2_debug os2_examples os2_test os2_smart os2_shared os2_showinstall os2_install os2_sourceinstall os2_zipinstall os2_zipinstalladd os2_clean os2_cleanall os2_require os2_info
 
 os2_all:
 	$(MAKE) -C os2 all
@@ -421,8 +437,8 @@ os2_clean:
 os2_cleanall:
 	$(MAKE) -C os2 cleanall
 
-os2_depend:
-	$(MAKE) -C os2 depend
+os2_require:
+	$(MAKE) -C os2 require
 
 os2_info:
 	$(MAKE) -C os2 info
@@ -431,7 +447,7 @@ endif
 # Dir go32v1
 
 ifdef OBJECTDIRGO32V1
-.PHONY:  go32v1_all go32v1_debug go32v1_examples go32v1_test go32v1_smart go32v1_shared go32v1_showinstall go32v1_install go32v1_sourceinstall go32v1_zipinstall go32v1_zipinstalladd go32v1_clean go32v1_cleanall go32v1_depend go32v1_info
+.PHONY:  go32v1_all go32v1_debug go32v1_examples go32v1_test go32v1_smart go32v1_shared go32v1_showinstall go32v1_install go32v1_sourceinstall go32v1_zipinstall go32v1_zipinstalladd go32v1_clean go32v1_cleanall go32v1_require go32v1_info
 
 go32v1_all:
 	$(MAKE) -C go32v1 all
@@ -472,8 +488,8 @@ go32v1_clean:
 go32v1_cleanall:
 	$(MAKE) -C go32v1 cleanall
 
-go32v1_depend:
-	$(MAKE) -C go32v1 depend
+go32v1_require:
+	$(MAKE) -C go32v1 require
 
 go32v1_info:
 	$(MAKE) -C go32v1 info

+ 35 - 11
rtl/go32v1/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -111,6 +111,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=.
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -175,11 +179,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
@@ -191,6 +196,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -244,15 +251,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -279,6 +288,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
@@ -609,6 +621,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -713,10 +726,18 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
-#####################################################################
-# Package depends
-#####################################################################
 
+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
@@ -985,6 +1006,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -994,7 +1018,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)
 

+ 35 - 11
rtl/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -111,6 +111,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=.
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -175,11 +179,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
@@ -191,6 +196,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -244,15 +251,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -279,6 +288,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
@@ -609,6 +621,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -713,10 +726,18 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
-#####################################################################
-# Package depends
-#####################################################################
 
+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
@@ -985,6 +1006,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -994,7 +1018,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)
 

+ 35 - 11
rtl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -111,6 +111,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=.
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -184,11 +188,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
@@ -200,6 +205,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -255,15 +262,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -290,6 +299,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
@@ -620,6 +632,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -724,10 +737,18 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
-#####################################################################
-# Package depends
-#####################################################################
 
+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
@@ -996,6 +1017,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -1005,7 +1029,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)
 

+ 35 - 11
rtl/os2/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -111,6 +111,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=.
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -175,11 +179,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
@@ -191,6 +196,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -244,15 +251,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -279,6 +288,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
@@ -609,6 +621,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -713,10 +726,18 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
-#####################################################################
-# Package depends
-#####################################################################
 
+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
@@ -985,6 +1006,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -994,7 +1018,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)
 

+ 35 - 11
rtl/win32/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -111,6 +111,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=.
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -180,11 +184,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
@@ -196,6 +201,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -249,15 +256,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -284,6 +293,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
@@ -614,6 +626,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -718,10 +731,18 @@ info: fpc_info
 
 .PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
 
-#####################################################################
-# Package depends
-#####################################################################
 
+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
@@ -990,6 +1011,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -999,7 +1023,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)
 

+ 25 - 8
tests/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 defaultrule: info
@@ -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
@@ -104,6 +104,17 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+# Detect 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
 #####################################################################
@@ -152,7 +163,11 @@ ZIPTARGET=install
 # Directories
 
 ifndef PACKAGEDIR
+ifneq ($(wildcard $(FPCDIR)/packages),)
 PACKAGEDIR=$(FPCDIR)/packages
+else
+PACKAGEDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
 endif
 ifndef COMPONENTDIR
 COMPONENTDIR=$(FPCDIR)/components
@@ -160,6 +175,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -177,6 +194,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -255,15 +273,14 @@ endif
 # Standard rules
 #####################################################################
 
-#####################################################################
-# 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
 endif
 

+ 37 - 34
utils/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -154,11 +158,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
@@ -169,7 +174,8 @@ endif
 
 # Packages
 
-override NEEDUNITDIR+=$(FPCDIR)/fcl/$(OS_TARGET)
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -204,15 +210,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -239,6 +247,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
@@ -294,10 +305,6 @@ ifdef UNITSDIR
 override FPCOPT+=-Fu$(UNITSDIR)
 endif
 
-ifdef NEEDUNITDIR
-override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
-endif
-
 # Target dirs
 ifdef TARGETDIR
 override FPCOPT+=-FE$(TARGETDIR)
@@ -579,6 +586,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -683,32 +691,24 @@ clean: fpc_clean $(addsuffix _clean,$(DIROBJECTS))
 
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(DIROBJECTS))
 
-depend: $(addsuffix _depend,$(DIROBJECTS))
+require: $(addsuffix _require,$(DIROBJECTS))
 
 info: fpc_info
 
-.PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall depend info
+.PHONY:  all debug examples test smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall require 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)),)
-override COMPILEPACKAGES+=fcl
-fcl_package:
-	$(MAKE) -C $(FCLDIR) all
-endif
 endif
 
-.PHONY:  rtl_package fcl_package
+.PHONY:  rtl_package
 
 #####################################################################
 # Exes
@@ -950,6 +950,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -959,7 +962,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)
 
@@ -1025,7 +1028,7 @@ OBJECTDIRH2PAS=1
 # Dir tply
 
 ifdef OBJECTDIRTPLY
-.PHONY:  tply_all tply_debug tply_examples tply_test tply_smart tply_shared tply_showinstall tply_install tply_sourceinstall tply_zipinstall tply_zipinstalladd tply_clean tply_cleanall tply_depend tply_info
+.PHONY:  tply_all tply_debug tply_examples tply_test tply_smart tply_shared tply_showinstall tply_install tply_sourceinstall tply_zipinstall tply_zipinstalladd tply_clean tply_cleanall tply_require tply_info
 
 tply_all:
 	$(MAKE) -C tply all
@@ -1066,8 +1069,8 @@ tply_clean:
 tply_cleanall:
 	$(MAKE) -C tply cleanall
 
-tply_depend:
-	$(MAKE) -C tply depend
+tply_require:
+	$(MAKE) -C tply require
 
 tply_info:
 	$(MAKE) -C tply info
@@ -1076,7 +1079,7 @@ endif
 # Dir h2pas
 
 ifdef OBJECTDIRH2PAS
-.PHONY:  h2pas_all h2pas_debug h2pas_examples h2pas_test h2pas_smart h2pas_shared h2pas_showinstall h2pas_install h2pas_sourceinstall h2pas_zipinstall h2pas_zipinstalladd h2pas_clean h2pas_cleanall h2pas_depend h2pas_info
+.PHONY:  h2pas_all h2pas_debug h2pas_examples h2pas_test h2pas_smart h2pas_shared h2pas_showinstall h2pas_install h2pas_sourceinstall h2pas_zipinstall h2pas_zipinstalladd h2pas_clean h2pas_cleanall h2pas_require h2pas_info
 
 h2pas_all:
 	$(MAKE) -C h2pas all
@@ -1117,8 +1120,8 @@ h2pas_clean:
 h2pas_cleanall:
 	$(MAKE) -C h2pas cleanall
 
-h2pas_depend:
-	$(MAKE) -C h2pas depend
+h2pas_require:
+	$(MAKE) -C h2pas require
 
 h2pas_info:
 	$(MAKE) -C h2pas info

File diff suppressed because it is too large
+ 217 - 176
utils/fpcmake.inc


+ 33 - 5
utils/fpcmake.ini

@@ -51,7 +51,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
@@ -110,6 +110,16 @@ endif
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
 
+[fpcdirdetect]
+# Detect FPCDIR
+ifdef inlinux
+FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+else
+FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
+endif
+export FPCDIR
+
+
 [defaultsettings]
 #####################################################################
 # Default Settings
@@ -171,15 +181,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 
 [dir_install]
@@ -208,6 +220,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
@@ -243,7 +258,6 @@ EXTRAINSTALLDIR=$(BASEINSTALLDIR)
 endif
 
 
-
 [dir_gcclib]
 # On linux, try to find where libgcc.a is.
 ifdef inlinux
@@ -662,6 +676,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -810,6 +825,16 @@ override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
 fpc_exes: $(EXEFILES)
 
 
+[rstrules]
+#####################################################################
+# Resource strings
+#####################################################################
+
+override RSTFILES=$(addsuffix $(RSTEXT),$(RSTOBJECTS))
+
+override CLEANRSTFILES+=$(RSTFILES)
+
+
 [examplerules]
 #####################################################################
 # Examples
@@ -1063,6 +1088,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
         -$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+        -$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
         -$(DEL) $(EXTRACLEANFILES)
 endif
@@ -1072,7 +1100,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)
 

+ 95 - 94
utils/fpcmake.pp

@@ -25,6 +25,7 @@ uses
 const
   Version='v0.99.13';
   Title='fpcmake '+Version;
+  TitleDate=Title+' ['+{$i %DATE}+']';
 
 { Include default fpcmake.ini }
 {$i fpcmake.inc}
@@ -32,7 +33,7 @@ const
 type
   tsections=(sec_none,
     sec_units,sec_exes,sec_loaders,sec_examples,sec_package,
-    sec_compile,sec_depend,sec_install,sec_sourceinstall,sec_zipinstall,
+    sec_compile,sec_require,sec_install,sec_sourceinstall,sec_zipinstall,
     sec_clean,sec_libs,sec_command,sec_exts,sec_dirs,sec_tools,sec_info
   );
 
@@ -44,7 +45,7 @@ const
 
   sectionstr : array[tsections] of string=('none',
     'units','exes','loaders','examples','package',
-    'compile','depend','install','sourceinstall','zipinstall',
+    'compile','require','install','sourceinstall','zipinstall',
     'clean','libs','command','exts','dirs','tools','info'
   );
 
@@ -66,7 +67,7 @@ const
     'smart','shared',
     'showinstall','install','sourceinstall','zipinstall','zipinstalladd',
     'clean','cleanall',
-    'depend','info'
+    'require','info'
   );
 
   rule2sec : array[1..rules] of tsections=(
@@ -75,7 +76,7 @@ const
     sec_libs,sec_libs,
     sec_install,sec_install,sec_sourceinstall,sec_zipinstall,sec_zipinstall,
     sec_clean,sec_clean,
-    sec_depend,sec_info
+    sec_require,sec_info
   );
 
   rule2bic : array[1..rules] of tbic=(
@@ -102,7 +103,7 @@ const
   ini_zip='zip';
   ini_clean='clean';
   ini_dirs='dirs';
-  ini_packages='packages';
+  ini_require='require';
   ini_libs='libs';
   ini_targets='targets';
   ini_info='info';
@@ -116,7 +117,9 @@ type
     TargetLoaders,
     TargetUnits,
     TargetPrograms,
-    TargetExamples : TTargetsString;
+    TargetExamples,
+    TargetRST      : TTargetsString;
+    InstallUnitSub,
     InstallPrefix,
     InstallBase    : string;
     InstallUnits,
@@ -131,8 +134,7 @@ type
     DefaultCleanDir,
     DefaultDir,
     DefaultTarget,
-    DefaultCPU,
-    DefaultOptions : string;
+    DefaultCPU     : string;
     DirFpc,
     DirPackage,
     DirComponent,
@@ -143,10 +145,9 @@ type
     DirUnitTarget,
     DirSources,
     DirInc         : string;
-    PackageRTL,
-    PackageFCL     : boolean;
-    Components,
-    Packages       : TTargetsString;
+    RequireOptions  : string;
+    RequirePackages,
+    RequireComponents : TTargetsString;
     LibName,
     LibUnits       : string;
     LibGCC,
@@ -289,12 +290,14 @@ begin
      ReadTargetsString(TargetUnits,ini_targets,'units','');
      ReadTargetsString(TargetPrograms,ini_targets,'programs','');
      ReadTargetsString(TargetExamples,ini_targets,'examples','');
+     ReadTargetsString(TargetRST,ini_targets,'rst','');
    { clean }
      ReadTargetsString(CleanUnits,ini_clean,'units','');
      ReadTargetsString(CleanFiles,ini_clean,'files','');
    { install }
      InstallPrefix:=ReadString(ini_install,'dirprefix','');
      InstallBase:=ReadString(ini_install,'dirbase','');
+     InstallUnitSub:=ReadString(ini_install,'unitsubdir','');
      ReadTargetsString(InstallUnits,ini_install,'units','');
      ReadTargetsString(InstallFiles,ini_install,'files','');
    { zip }
@@ -308,15 +311,13 @@ begin
      DefaultRule:=ReadString(ini_defaults,'defaultrule','all');
      DefaultTarget:=ReadString(ini_defaults,'defaulttarget','');
      DefaultCPU:=ReadString(ini_defaults,'defaultcpu','');
-     DefaultOptions:=ReadString(ini_defaults,'defaultoptions','');
    { packages }
-     ReadTargetsString(Components,ini_packages,'components','');
-     ReadTargetsString(Packages,ini_packages,'packages','');
-     PackageRTL:=ReadBool(ini_packages,'rtl',true);
-     PackageFCL:=ReadBool(ini_packages,'fcl',false);
+     RequireOptions:=ReadString(ini_require,'options','');
+     ReadTargetsString(requireComponents,ini_require,'components','');
+     ReadTargetsString(requirePackages,ini_require,'packages','');
    { dirs }
      DirFpc:=ReadString(ini_dirs,'fpcdir','');
-     DirPackage:=ReadString(ini_dirs,'packagedir','$(FPCDIR)/packages');
+     DirPackage:=ReadString(ini_dirs,'packagedir','');
      DirComponent:=ReadString(ini_dirs,'componentdir','$(FPCDIR)/components');
      DirUnit:=ReadString(ini_dirs,'unitdir','');
      DirLib:=ReadString(ini_dirs,'libdir','');
@@ -557,7 +558,7 @@ var
   procedure AddTargetsUnitDir(const pre:string;var t:TTargetsString);
   var
     i,j : integer;
-    hs,packdir : string;
+    hs,packdirvar,packdir : string;
   begin
     for i:=0 to targets do
      if (t[i]<>'') then
@@ -567,12 +568,14 @@ var
           j:=pos(' ',hs);
           if j=0 then
            j:=length(hs)+1;
+          packdirvar:='PACKAGEDIR_'+Uppercase(Copy(hs,1,j-1));
           packdir:=pre+'/'+Copy(hs,1,j-1);
           mf.Add('ifneq ($(wildcard '+packdir+'/$(OS_TARGET)),)');
-          mf.Add('override NEEDUNITDIR+='+packdir+'/$(OS_TARGET)');
+          mf.Add(packdirvar+'='+packdir+'/$(OS_TARGET)');
           mf.Add('else');
-          mf.Add('override NEEDUNITDIR+='+packdir);
+          mf.Add(packdirvar+'='+packdir);
           mf.Add('endif');
+          mf.Add('override NEEDUNITDIR+=$('+packdirvar+')');
           system.delete(hs,1,j);
         until hs='';
       end;
@@ -600,40 +603,33 @@ var
     mf.Add('endif');
   end;
 
-  procedure AddPackageDep(const packagedir,s,s2:string;ifdefneed:boolean);
-  var
-    s3 : string;
+  procedure AddDirDetect(const varname,checkdir,elsedir:string);
   begin
-    if s<>'' then
-     s3:='/'+s
-    else
-     s3:='';
-    if ifdefneed then
-     mf.Add('ifdef PACKAGE'+Uppercase(s));
-    mf.Add('ifneq ($(wildcard '+packagedir+s3+'),)');
-    mf.Add('ifeq ($(wildcard '+packagedir+s3+'/$(FPCMADE)),)');
-    mf.Add('override COMPILEPACKAGES+='+s2);
-    mf.Add(s2+'_package:');
-    mf.Add(#9'$(MAKE) -C '+packagedir+s3+' all');
-    mf.Add('endif');
+    mf.Add('ifneq ($(wildcard '+checkdir+'),)');
+    mf.Add(varname+'='+checkdir);
+    if elsedir<>'' then
+     begin
+       mf.Add('else');
+       mf.Add(varname+'='+elsedir);
+     end;
     mf.Add('endif');
-    if ifdefneed then
-     mf.Add('endif');
-    Phony:=Phony+' '+s2+'_package';
   end;
 
-  procedure AddComponentDep(const s:string);
+  procedure AddPackageDep(const s:string);
+  var
+    packagedir : string;
   begin
-    mf.Add('ifdef COMPONENT'+Uppercase(s));
-    mf.Add('ifneq ($(wildcard $(COMPONENTDIR)/'+s+'),)');
-    mf.Add('ifeq ($(wildcard $(COMPONENTDIR)/'+s+'/$(FPCMADE)),)');
-    mf.Add('override COMPILECOMPONENTS+='+s);
-    mf.Add(s+'_component:');
-    mf.Add(#9'$(MAKE) -C $(COMPONENTDIR)/'+s+' all');
+    packagedir:='$(PACKAGEDIR_'+Uppercase(s)+')';
+    mf.Add('ifdef PACKAGE'+Uppercase(s));
+    mf.Add('ifneq ($(wildcard '+packagedir+'),)');
+    mf.Add('ifeq ($(wildcard '+packagedir+'/$(FPCMADE)),)');
+    mf.Add('override COMPILEPACKAGES+='+s);
+    mf.Add(s+'_package:');
+    mf.Add(#9'$(MAKE) -C '+packagedir+' all');
     mf.Add('endif');
     mf.Add('endif');
     mf.Add('endif');
-    Phony:=Phony+' '+s+'_component';
+    Phony:=Phony+' '+s+'_package';
   end;
 
   function AddTargetDefines(const ts:TTargetsString;const prefix:string):string;
@@ -676,7 +672,7 @@ begin
    begin
    { write header & autodetection }
      Add('#');
-     Add('# Makefile generated by '+title+' on '+FormatDateTime(TimeFormat,Now));
+     Add('# Makefile generated by '+titledate);
      Add('#');
      Add('');
      Add('defaultrule: '+userini.defaultrule);
@@ -697,6 +693,15 @@ begin
    { fpc detection }
      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');
+
    { write the default & user settings }
      AddSection(true,'defaultsettings');
      AddSection(true,'usersettings');
@@ -715,6 +720,7 @@ begin
      AddTargets('UNITOBJECTS',userini.targetunits,false);
      AddTargets('EXEOBJECTS',userini.targetprograms,false);
      AddTargets('EXAMPLEOBJECTS',userini.targetexamples,false);
+     AddTargets('RSTOBJECTS',userini.targetrst,false);
 
    { Clean }
      AddHead('Clean');
@@ -729,6 +735,8 @@ begin
       Add('PREFIXINSTALLDIR='+userini.installprefix);
      if userini.installbase<>'' then
       Add('BASEINSTALLDIR='+userini.installbase);
+     if userini.InstallUnitSub>'' then
+      Add('UNITSUBDIR='+userini.InstallUnitSub);
 
    { Zip }
      if userini.zipname<>'' then
@@ -738,34 +746,27 @@ begin
 
    { Defaults }
      AddHead('Defaults');
-     if userini.defaultoptions<>'' then
-      Add('override NEEDOPT='+userini.defaultoptions);
+     if userini.Requireoptions<>'' then
+      Add('override NEEDOPT='+userini.Requireoptions);
 
    { Dirs }
      AddHead('Directories');
      if userini.dirsources<>'' then
       Add('vpath %$(PASEXT) '+userini.dirsources);
-     if userini.dirfpc<>'' then
-      begin
-        { this dir can be set in the environment, it's more a default }
-        Add('ifndef FPCDIR');
-        Add('FPCDIR='+userini.dirfpc);
-        Add('endif');
-      end;
+     { packages dir }
+     Add('ifndef PACKAGEDIR');
      if userini.dirpackage<>'' then
-      begin
-        { this dir can be set in the environment, it's more a default }
-        Add('ifndef PACKAGEDIR');
-        Add('PACKAGEDIR='+userini.dirpackage);
-        Add('endif');
-      end;
+      Add('PACKAGEDIR='+userini.dirpackage)
+     else
+      AddDirDetect('PACKAGEDIR','$(FPCDIR)/packages','$(FPCDIR)/units/$(OS_TARGET)');
+     Add('endif');
+     { component dir }
+     Add('ifndef COMPONENTDIR');
      if userini.dircomponent<>'' then
-      begin
-        { this dir can be set in the environment, it's more a default }
-        Add('ifndef COMPONENTDIR');
-        Add('COMPONENTDIR='+userini.dircomponent);
-        Add('endif');
-      end;
+      Add('COMPONENTDIR='+userini.dircomponent)
+     else
+      AddDirDetect('COMPONENTDIR','$(FPCDIR)/components','$(FPCDIR)/units/$(OS_TARGET)');
+     Add('endif');
      if userini.dirunit<>'' then
       Add('override NEEDUNITDIR='+userini.dirunit);
      if userini.dirlib<>'' then
@@ -789,12 +790,12 @@ begin
 
    { Packages }
      AddHead('Packages');
-     AddTargets('PACKAGES',userini.packages,false);
-     AddTargets('COMPONENTS',userini.components,false);
-     if userini.PackageFCL then
-      Add('override NEEDUNITDIR+=$(FPCDIR)/fcl/$(OS_TARGET)');
-     AddTargetsUnitDir('$(PACKAGEDIR)',userini.packages);
-     AddTargetsUnitDir('$(COMPONENTDIR)',userini.components);
+     Add('override PACKAGES=rtl');
+     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);
 
    { Libs }
      AddHead('Libraries');
@@ -847,13 +848,12 @@ begin
       begin
         Add('');
         AddSection(true,'command_begin');
-        AddSection((userini.defaultoptions<>''),'command_needopt');
+        AddSection((userini.Requireoptions<>''),'command_needopt');
         AddSection((userini.dirfpc<>''),'command_rtldir');
         AddSection((userini.dirfpc<>''),'command_unitsdir');
         AddSection((userini.dirunit<>'') or
-                   (userini.packagefcl) or
-                   (not TargetStringEmpty(userini.packages)) or
-                   (not TargetStringEmpty(userini.components))
+                   (not TargetStringEmpty(userini.Requirepackages)) or
+                   (not TargetStringEmpty(userini.Requirecomponents))
                    ,'command_needunit');
         AddSection((userini.dirlib<>''),'command_needlib');
         AddSection((userini.dirobj<>''),'command_needobj');
@@ -898,22 +898,19 @@ begin
         Add('');
       end;
 
-   { Package depends, must be before the other rules so it's done first! }
-     AddSection(true,'packagedependrules');
+   { Package requirements, must be before the other rules so it's done first }
+     AddSection(true,'packagerequirerules');
      Phony:='';
-     if userini.packagertl then
-      AddPackageDep('$(RTLDIR)','','rtl',false);
-     if userini.packagefcl then
-      AddPackageDep('$(FCLDIR)','','fcl',false);
+     AddPackageDep('rtl');
      Add('');
-     if not TargetStringEmpty(userini.Packages) then
+     if not TargetStringEmpty(userini.RequirePackages) then
       begin
-        hs:=AddTargetDefines(userini.Packages,'PACKAGE');
+        hs:=AddTargetDefines(userini.RequirePackages,'PACKAGE');
         repeat
           i:=pos(' ',hs);
           if i=0 then
            i:=length(hs)+1;
-          AddPackageDep('$(PACKAGEDIR)',Copy(hs,1,i-1),Copy(hs,1,i-1),true);
+          AddPackageDep(Copy(hs,1,i-1));
           system.delete(hs,1,i);
         until hs='';
         Add('');
@@ -926,14 +923,14 @@ begin
 
    { Components }
      Phony:='';
-     if not TargetStringEmpty(userini.Components) then
+     if not TargetStringEmpty(userini.RequireComponents) then
       begin
-        hs:=AddTargetDefines(userini.Components,'COMPONENT');
+        hs:=AddTargetDefines(userini.RequireComponents,'COMPONENT');
         repeat
           i:=pos(' ',hs);
           if i=0 then
            i:=length(hs)+1;
-          AddComponentDep(Copy(hs,1,i-1));
+          AddPackageDep(Copy(hs,1,i-1));
           system.delete(hs,1,i);
         until hs='';
         Add('');
@@ -949,6 +946,7 @@ begin
      AddSection(not TargetStringEmpty(userini.targetunits),'unitrules');
      AddSection(not TargetStringEmpty(userini.targetprograms),'exerules');
      AddSection(not TargetStringEmpty(userini.targetexamples),'examplerules');
+     AddSection(not TargetStringEmpty(userini.targetrst),'rstrules');
 
    { default fpc_ rules }
      AddSection(userini.Section[sec_Compile],'compilerules');
@@ -957,7 +955,7 @@ begin
      AddSection(userini.Section[sec_SourceInstall],'sourceinstallrules');
      AddSection(userini.Section[sec_ZipInstall],'zipinstallrules');
      AddSection(userini.Section[sec_Clean],'cleanrules');
-     AddSection(userini.Section[sec_Depend],'dependrules');
+     AddSection(userini.Section[sec_require],'requirerules');
      if userini.Section[sec_Info] then
       begin
         AddSection(true,'inforules');
@@ -1051,7 +1049,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.15  1999-12-23 19:32:28  peter
+  Revision 1.16  2000-01-03 19:42:41  peter
+    * regenerated
+
+  Revision 1.15  1999/12/23 19:32:28  peter
     * automatic support for package/target dir structure
 
   Revision 1.14  1999/12/23 13:52:23  peter
@@ -1071,7 +1072,7 @@ end.
     * fpcmake updated
 
   Revision 1.9  1999/11/25 20:23:01  peter
-    * package dependencies
+    * package requireencies
 
   Revision 1.8  1999/11/24 23:53:00  peter
     * packages

+ 29 - 19
utils/h2pas/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -150,15 +154,15 @@ ZIPTARGET=install
 
 # Defaults
 
-override NEEDOPT=-Sg
 
 # 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
@@ -166,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -200,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -235,6 +243,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
@@ -282,10 +293,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -559,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -663,15 +671,14 @@ 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
 endif
 
@@ -917,6 +924,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -926,7 +936,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)
 

+ 29 - 14
utils/simulator/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -153,11 +157,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
@@ -165,6 +170,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -199,15 +206,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -234,6 +243,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
@@ -554,6 +566,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -658,15 +671,14 @@ 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
 endif
 
@@ -912,6 +924,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -921,7 +936,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)
 

+ 29 - 19
utils/tply/Makefile

@@ -1,5 +1,5 @@
 #
-# Makefile generated by fpcmake v0.99.13 on 1999-12-24 16:08
+# Makefile generated by fpcmake v0.99.13 [2000/01/03]
 #
 
 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
@@ -104,6 +104,10 @@ endif
 
 export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
 
+ifndef FPCDIR
+FPCDIR=../..
+endif
+export FPCDIR
 #####################################################################
 # Default Settings
 #####################################################################
@@ -160,15 +164,15 @@ ZIPTARGET=install
 
 # Defaults
 
-override NEEDOPT=-Sg
 
 # 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
@@ -176,6 +180,8 @@ endif
 
 # Packages
 
+override PACKAGES=rtl
+PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
 
 # Libraries
 
@@ -210,15 +216,17 @@ endif
 endif
 export PREFIXINSTALLDIR
 
-# create fcldir,rtldir,unitdir
+# 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
-endif
 
 #####################################################################
 # Install Directories
@@ -245,6 +253,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
@@ -292,10 +303,6 @@ ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
 
-ifdef NEEDOPT
-override FPCOPT+=$(NEEDOPT)
-endif
-
 ifdef RTLDIR
 override FPCOPT+=-Fu$(RTLDIR)
 endif
@@ -569,6 +576,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+RSTEXT=.rst
 PACKAGESUFFIX=
 FPCMADE=fpcmade
 
@@ -673,15 +681,14 @@ 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
 endif
 
@@ -941,6 +948,9 @@ endif
 ifneq ($(CLEANPPULINKFILES),)
 	-$(DEL) $(CLEANPPULINKFILES)
 endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(CLEANRSTFILES)
+endif
 ifdef EXTRACLEANFILES
 	-$(DEL) $(EXTRACLEANFILES)
 endif
@@ -950,7 +960,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)
 

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