Browse Source

* regenerated

peter 23 years ago
parent
commit
5f2e0cc5e3
84 changed files with 3488 additions and 2198 deletions
  1. 55 49
      Makefile
  2. 38 22
      compiler/Makefile
  3. 35 17
      compiler/new/Makefile
  4. 39 20
      compiler/utils/Makefile
  5. 52 44
      demo/Makefile
  6. 39 20
      demo/graph/Makefile
  7. 39 20
      demo/linux/Makefile
  8. 39 20
      demo/modex/Makefile
  9. 39 20
      demo/os2/Makefile
  10. 39 20
      demo/text/Makefile
  11. 39 20
      demo/win32/Makefile
  12. 51 52
      fcl/Makefile
  13. 51 46
      fcl/db/Makefile
  14. 39 20
      fcl/db/dbase/Makefile
  15. 39 23
      fcl/db/interbase/Makefile
  16. 39 23
      fcl/db/mysql/Makefile
  17. 39 35
      fcl/db/tests/Makefile
  18. 42 25
      fcl/shedit/Makefile
  19. 39 44
      fcl/shedit/gtk/Makefile
  20. 39 35
      fcl/tests/Makefile
  21. 39 20
      fcl/xml/Makefile
  22. 42 25
      fv/Makefile
  23. 39 23
      fv/test/Makefile
  24. 42 25
      fvision/Makefile
  25. 39 23
      fvision/test/Makefile
  26. 45 39
      ide/Makefile
  27. 39 20
      ide/compiler/Makefile
  28. 39 20
      ide/fakegdb/Makefile
  29. 39 23
      install/fpinst/Makefile
  30. 115 149
      packages/Makefile
  31. 40 24
      packages/asyncio/Makefile
  32. 39 35
      packages/asyncio/fpasync/Makefile
  33. 39 20
      packages/asyncio/libasync/Makefile
  34. 39 20
      packages/cmem/Makefile
  35. 42 28
      packages/forms/Makefile
  36. 39 26
      packages/forms/demo/Makefile
  37. 39 20
      packages/gdbint/Makefile
  38. 34 14
      packages/gdbint/libgdb/Makefile
  39. 39 20
      packages/gdbm/Makefile
  40. 39 20
      packages/ggi/Makefile
  41. 45 36
      packages/gtk/Makefile
  42. 42 34
      packages/gtk/examples/Makefile
  43. 35 23
      packages/gtk/examples/tutorial/Makefile
  44. 39 26
      packages/gtk/gtkgl/Makefile
  45. 39 20
      packages/ibase/Makefile
  46. 39 20
      packages/inet/Makefile
  47. 39 20
      packages/libgd/Makefile
  48. 39 23
      packages/libpng/Makefile
  49. 39 20
      packages/mmsystem/Makefile
  50. 39 20
      packages/mysql/Makefile
  51. 39 20
      packages/ncurses/Makefile
  52. 84 36
      packages/numlib/Makefile
  53. 42 28
      packages/opengl/Makefile
  54. 39 35
      packages/opengl/build/Makefile
  55. 39 26
      packages/opengl/examples/Makefile
  56. 42 25
      packages/oracle/Makefile
  57. 39 38
      packages/oracle/example/Makefile
  58. 39 20
      packages/paszlib/Makefile
  59. 39 20
      packages/postgres/Makefile
  60. 39 20
      packages/regexpr/Makefile
  61. 39 20
      packages/svgalib/Makefile
  62. 39 20
      packages/syslog/Makefile
  63. 39 20
      packages/uncgi/Makefile
  64. 39 20
      packages/unzip/Makefile
  65. 39 20
      packages/utmp/Makefile
  66. 39 20
      packages/x11/Makefile
  67. 39 20
      packages/zlib/Makefile
  68. 55 49
      rtl/Makefile
  69. 38 17
      rtl/amiga/Makefile
  70. 38 17
      rtl/beos/Makefile
  71. 38 17
      rtl/freebsd/Makefile
  72. 38 17
      rtl/go32v1/Makefile
  73. 38 17
      rtl/go32v2/Makefile
  74. 38 17
      rtl/linux/Makefile
  75. 38 17
      rtl/os2/Makefile
  76. 38 17
      rtl/win32/Makefile
  77. 34 14
      tests/Makefile
  78. 39 20
      tests/units/Makefile
  79. 54 60
      utils/Makefile
  80. 39 20
      utils/dxegen/Makefile
  81. 39 20
      utils/fprcp/Makefile
  82. 39 20
      utils/h2pas/Makefile
  83. 39 20
      utils/simulator/Makefile
  84. 39 20
      utils/tply/Makefile

+ 55 - 49
Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/19]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: help
 default: help
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
 endif
 endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -1033,6 +1052,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1100,13 +1121,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1125,6 +1146,8 @@ compiler_debug:
 	$(MAKE) -C compiler debug
 	$(MAKE) -C compiler debug
 compiler_smart:
 compiler_smart:
 	$(MAKE) -C compiler smart
 	$(MAKE) -C compiler smart
+compiler_release:
+	$(MAKE) -C compiler release
 compiler_examples:
 compiler_examples:
 	$(MAKE) -C compiler examples
 	$(MAKE) -C compiler examples
 compiler_shared:
 compiler_shared:
@@ -1153,15 +1176,11 @@ compiler_cleanall:
 	$(MAKE) -C compiler cleanall
 	$(MAKE) -C compiler cleanall
 compiler_info:
 compiler_info:
 	$(MAKE) -C compiler info
 	$(MAKE) -C compiler info
-compiler_makefile:
-	$(MAKE) -C compiler makefile
 compiler_makefiles:
 compiler_makefiles:
 	$(MAKE) -C compiler makefiles
 	$(MAKE) -C compiler makefiles
-compiler_makefile_dirs:
-	$(MAKE) -C compiler makefile_dirs
 compiler:
 compiler:
 	$(MAKE) -C compiler all
 	$(MAKE) -C compiler all
-.PHONY: compiler_all compiler_debug compiler_smart compiler_examples compiler_shared compiler_install compiler_sourceinstall compiler_exampleinstall compiler_distinstall compiler_zipinstall compiler_zipsourceinstall compiler_zipexampleinstall compiler_zipdistinstall compiler_clean compiler_distclean compiler_cleanall compiler_info compiler_makefile compiler_makefiles compiler_makefile_dirs compiler
+.PHONY: compiler_all compiler_debug compiler_smart compiler_release compiler_examples compiler_shared compiler_install compiler_sourceinstall compiler_exampleinstall compiler_distinstall compiler_zipinstall compiler_zipsourceinstall compiler_zipexampleinstall compiler_zipdistinstall compiler_clean compiler_distclean compiler_cleanall compiler_info compiler_makefiles compiler
 endif
 endif
 ifdef TARGET_DIRS_RTL
 ifdef TARGET_DIRS_RTL
 rtl_all:
 rtl_all:
@@ -1170,6 +1189,8 @@ rtl_debug:
 	$(MAKE) -C rtl debug
 	$(MAKE) -C rtl debug
 rtl_smart:
 rtl_smart:
 	$(MAKE) -C rtl smart
 	$(MAKE) -C rtl smart
+rtl_release:
+	$(MAKE) -C rtl release
 rtl_examples:
 rtl_examples:
 	$(MAKE) -C rtl examples
 	$(MAKE) -C rtl examples
 rtl_shared:
 rtl_shared:
@@ -1198,15 +1219,11 @@ rtl_cleanall:
 	$(MAKE) -C rtl cleanall
 	$(MAKE) -C rtl cleanall
 rtl_info:
 rtl_info:
 	$(MAKE) -C rtl info
 	$(MAKE) -C rtl info
-rtl_makefile:
-	$(MAKE) -C rtl makefile
 rtl_makefiles:
 rtl_makefiles:
 	$(MAKE) -C rtl makefiles
 	$(MAKE) -C rtl makefiles
-rtl_makefile_dirs:
-	$(MAKE) -C rtl makefile_dirs
 rtl:
 rtl:
 	$(MAKE) -C rtl all
 	$(MAKE) -C rtl all
-.PHONY: rtl_all rtl_debug rtl_smart rtl_examples rtl_shared rtl_install rtl_sourceinstall rtl_exampleinstall rtl_distinstall rtl_zipinstall rtl_zipsourceinstall rtl_zipexampleinstall rtl_zipdistinstall rtl_clean rtl_distclean rtl_cleanall rtl_info rtl_makefile rtl_makefiles rtl_makefile_dirs rtl
+.PHONY: rtl_all rtl_debug rtl_smart rtl_release rtl_examples rtl_shared rtl_install rtl_sourceinstall rtl_exampleinstall rtl_distinstall rtl_zipinstall rtl_zipsourceinstall rtl_zipexampleinstall rtl_zipdistinstall rtl_clean rtl_distclean rtl_cleanall rtl_info rtl_makefiles rtl
 endif
 endif
 ifdef TARGET_DIRS_UTILS
 ifdef TARGET_DIRS_UTILS
 utils_all:
 utils_all:
@@ -1215,6 +1232,8 @@ utils_debug:
 	$(MAKE) -C utils debug
 	$(MAKE) -C utils debug
 utils_smart:
 utils_smart:
 	$(MAKE) -C utils smart
 	$(MAKE) -C utils smart
+utils_release:
+	$(MAKE) -C utils release
 utils_examples:
 utils_examples:
 	$(MAKE) -C utils examples
 	$(MAKE) -C utils examples
 utils_shared:
 utils_shared:
@@ -1243,15 +1262,11 @@ utils_cleanall:
 	$(MAKE) -C utils cleanall
 	$(MAKE) -C utils cleanall
 utils_info:
 utils_info:
 	$(MAKE) -C utils info
 	$(MAKE) -C utils info
-utils_makefile:
-	$(MAKE) -C utils makefile
 utils_makefiles:
 utils_makefiles:
 	$(MAKE) -C utils makefiles
 	$(MAKE) -C utils makefiles
-utils_makefile_dirs:
-	$(MAKE) -C utils makefile_dirs
 utils:
 utils:
 	$(MAKE) -C utils all
 	$(MAKE) -C utils all
-.PHONY: utils_all utils_debug utils_smart utils_examples utils_shared utils_install utils_sourceinstall utils_exampleinstall utils_distinstall utils_zipinstall utils_zipsourceinstall utils_zipexampleinstall utils_zipdistinstall utils_clean utils_distclean utils_cleanall utils_info utils_makefile utils_makefiles utils_makefile_dirs utils
+.PHONY: utils_all utils_debug utils_smart utils_release utils_examples utils_shared utils_install utils_sourceinstall utils_exampleinstall utils_distinstall utils_zipinstall utils_zipsourceinstall utils_zipexampleinstall utils_zipdistinstall utils_clean utils_distclean utils_cleanall utils_info utils_makefiles utils
 endif
 endif
 ifdef TARGET_DIRS_FCL
 ifdef TARGET_DIRS_FCL
 fcl_all:
 fcl_all:
@@ -1260,6 +1275,8 @@ fcl_debug:
 	$(MAKE) -C fcl debug
 	$(MAKE) -C fcl debug
 fcl_smart:
 fcl_smart:
 	$(MAKE) -C fcl smart
 	$(MAKE) -C fcl smart
+fcl_release:
+	$(MAKE) -C fcl release
 fcl_examples:
 fcl_examples:
 	$(MAKE) -C fcl examples
 	$(MAKE) -C fcl examples
 fcl_shared:
 fcl_shared:
@@ -1288,15 +1305,11 @@ fcl_cleanall:
 	$(MAKE) -C fcl cleanall
 	$(MAKE) -C fcl cleanall
 fcl_info:
 fcl_info:
 	$(MAKE) -C fcl info
 	$(MAKE) -C fcl info
-fcl_makefile:
-	$(MAKE) -C fcl makefile
 fcl_makefiles:
 fcl_makefiles:
 	$(MAKE) -C fcl makefiles
 	$(MAKE) -C fcl makefiles
-fcl_makefile_dirs:
-	$(MAKE) -C fcl makefile_dirs
 fcl:
 fcl:
 	$(MAKE) -C fcl all
 	$(MAKE) -C fcl all
-.PHONY: fcl_all fcl_debug fcl_smart fcl_examples fcl_shared fcl_install fcl_sourceinstall fcl_exampleinstall fcl_distinstall fcl_zipinstall fcl_zipsourceinstall fcl_zipexampleinstall fcl_zipdistinstall fcl_clean fcl_distclean fcl_cleanall fcl_info fcl_makefile fcl_makefiles fcl_makefile_dirs fcl
+.PHONY: fcl_all fcl_debug fcl_smart fcl_release fcl_examples fcl_shared fcl_install fcl_sourceinstall fcl_exampleinstall fcl_distinstall fcl_zipinstall fcl_zipsourceinstall fcl_zipexampleinstall fcl_zipdistinstall fcl_clean fcl_distclean fcl_cleanall fcl_info fcl_makefiles fcl
 endif
 endif
 ifdef TARGET_DIRS_FV
 ifdef TARGET_DIRS_FV
 fv_all:
 fv_all:
@@ -1305,6 +1318,8 @@ fv_debug:
 	$(MAKE) -C fv debug
 	$(MAKE) -C fv debug
 fv_smart:
 fv_smart:
 	$(MAKE) -C fv smart
 	$(MAKE) -C fv smart
+fv_release:
+	$(MAKE) -C fv release
 fv_examples:
 fv_examples:
 	$(MAKE) -C fv examples
 	$(MAKE) -C fv examples
 fv_shared:
 fv_shared:
@@ -1333,15 +1348,11 @@ fv_cleanall:
 	$(MAKE) -C fv cleanall
 	$(MAKE) -C fv cleanall
 fv_info:
 fv_info:
 	$(MAKE) -C fv info
 	$(MAKE) -C fv info
-fv_makefile:
-	$(MAKE) -C fv makefile
 fv_makefiles:
 fv_makefiles:
 	$(MAKE) -C fv makefiles
 	$(MAKE) -C fv makefiles
-fv_makefile_dirs:
-	$(MAKE) -C fv makefile_dirs
 fv:
 fv:
 	$(MAKE) -C fv all
 	$(MAKE) -C fv all
-.PHONY: fv_all fv_debug fv_smart fv_examples fv_shared fv_install fv_sourceinstall fv_exampleinstall fv_distinstall fv_zipinstall fv_zipsourceinstall fv_zipexampleinstall fv_zipdistinstall fv_clean fv_distclean fv_cleanall fv_info fv_makefile fv_makefiles fv_makefile_dirs fv
+.PHONY: fv_all fv_debug fv_smart fv_release fv_examples fv_shared fv_install fv_sourceinstall fv_exampleinstall fv_distinstall fv_zipinstall fv_zipsourceinstall fv_zipexampleinstall fv_zipdistinstall fv_clean fv_distclean fv_cleanall fv_info fv_makefiles fv
 endif
 endif
 ifdef TARGET_DIRS_PACKAGES
 ifdef TARGET_DIRS_PACKAGES
 packages_all:
 packages_all:
@@ -1350,6 +1361,8 @@ packages_debug:
 	$(MAKE) -C packages debug
 	$(MAKE) -C packages debug
 packages_smart:
 packages_smart:
 	$(MAKE) -C packages smart
 	$(MAKE) -C packages smart
+packages_release:
+	$(MAKE) -C packages release
 packages_examples:
 packages_examples:
 	$(MAKE) -C packages examples
 	$(MAKE) -C packages examples
 packages_shared:
 packages_shared:
@@ -1378,15 +1391,11 @@ packages_cleanall:
 	$(MAKE) -C packages cleanall
 	$(MAKE) -C packages cleanall
 packages_info:
 packages_info:
 	$(MAKE) -C packages info
 	$(MAKE) -C packages info
-packages_makefile:
-	$(MAKE) -C packages makefile
 packages_makefiles:
 packages_makefiles:
 	$(MAKE) -C packages makefiles
 	$(MAKE) -C packages makefiles
-packages_makefile_dirs:
-	$(MAKE) -C packages makefile_dirs
 packages:
 packages:
 	$(MAKE) -C packages all
 	$(MAKE) -C packages all
-.PHONY: packages_all packages_debug packages_smart packages_examples packages_shared packages_install packages_sourceinstall packages_exampleinstall packages_distinstall packages_zipinstall packages_zipsourceinstall packages_zipexampleinstall packages_zipdistinstall packages_clean packages_distclean packages_cleanall packages_info packages_makefile packages_makefiles packages_makefile_dirs packages
+.PHONY: packages_all packages_debug packages_smart packages_release packages_examples packages_shared packages_install packages_sourceinstall packages_exampleinstall packages_distinstall packages_zipinstall packages_zipsourceinstall packages_zipexampleinstall packages_zipdistinstall packages_clean packages_distclean packages_cleanall packages_info packages_makefiles packages
 endif
 endif
 ifdef TARGET_DIRS_IDE
 ifdef TARGET_DIRS_IDE
 ide_all:
 ide_all:
@@ -1395,6 +1404,8 @@ ide_debug:
 	$(MAKE) -C ide debug
 	$(MAKE) -C ide debug
 ide_smart:
 ide_smart:
 	$(MAKE) -C ide smart
 	$(MAKE) -C ide smart
+ide_release:
+	$(MAKE) -C ide release
 ide_examples:
 ide_examples:
 	$(MAKE) -C ide examples
 	$(MAKE) -C ide examples
 ide_shared:
 ide_shared:
@@ -1423,18 +1434,15 @@ ide_cleanall:
 	$(MAKE) -C ide cleanall
 	$(MAKE) -C ide cleanall
 ide_info:
 ide_info:
 	$(MAKE) -C ide info
 	$(MAKE) -C ide info
-ide_makefile:
-	$(MAKE) -C ide makefile
 ide_makefiles:
 ide_makefiles:
 	$(MAKE) -C ide makefiles
 	$(MAKE) -C ide makefiles
-ide_makefile_dirs:
-	$(MAKE) -C ide makefile_dirs
 ide:
 ide:
 	$(MAKE) -C ide all
 	$(MAKE) -C ide all
-.PHONY: ide_all ide_debug ide_smart ide_examples ide_shared ide_install ide_sourceinstall ide_exampleinstall ide_distinstall ide_zipinstall ide_zipsourceinstall ide_zipexampleinstall ide_zipdistinstall ide_clean ide_distclean ide_cleanall ide_info ide_makefile ide_makefiles ide_makefile_dirs ide
+.PHONY: ide_all ide_debug ide_smart ide_release ide_examples ide_shared ide_install ide_sourceinstall ide_exampleinstall ide_distinstall ide_zipinstall ide_zipsourceinstall ide_zipexampleinstall ide_zipdistinstall ide_clean ide_distclean ide_cleanall ide_info ide_makefiles ide
 endif
 endif
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
+release: $(addsuffix _release,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 sourceinstall:
 sourceinstall:
@@ -1445,10 +1453,8 @@ zipexampleinstall: fpc_zipexampleinstall $(addsuffix _zipexampleinstall,$(TARGET
 zipdistinstall: fpc_zipdistinstall $(addsuffix _zipdistinstall,$(TARGET_DIRS))
 zipdistinstall: fpc_zipdistinstall $(addsuffix _zipdistinstall,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: debug smart examples shared sourceinstall exampleinstall distinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefile makefiles makefile_dirs
+.PHONY: debug smart release examples shared sourceinstall exampleinstall distinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 22
compiler/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -749,6 +768,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -785,9 +805,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -1065,6 +1082,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1132,13 +1151,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1151,6 +1170,8 @@ utils_debug:
 	$(MAKE) -C utils debug
 	$(MAKE) -C utils debug
 utils_smart:
 utils_smart:
 	$(MAKE) -C utils smart
 	$(MAKE) -C utils smart
+utils_release:
+	$(MAKE) -C utils release
 utils_examples:
 utils_examples:
 	$(MAKE) -C utils examples
 	$(MAKE) -C utils examples
 utils_shared:
 utils_shared:
@@ -1179,15 +1200,11 @@ utils_cleanall:
 	$(MAKE) -C utils cleanall
 	$(MAKE) -C utils cleanall
 utils_info:
 utils_info:
 	$(MAKE) -C utils info
 	$(MAKE) -C utils info
-utils_makefile:
-	$(MAKE) -C utils makefile
 utils_makefiles:
 utils_makefiles:
 	$(MAKE) -C utils makefiles
 	$(MAKE) -C utils makefiles
-utils_makefile_dirs:
-	$(MAKE) -C utils makefile_dirs
 utils:
 utils:
 	$(MAKE) -C utils all
 	$(MAKE) -C utils all
-.PHONY: utils_all utils_debug utils_smart utils_examples utils_shared utils_install utils_sourceinstall utils_exampleinstall utils_distinstall utils_zipinstall utils_zipsourceinstall utils_zipexampleinstall utils_zipdistinstall utils_clean utils_distclean utils_cleanall utils_info utils_makefile utils_makefiles utils_makefile_dirs utils
+.PHONY: utils_all utils_debug utils_smart utils_release utils_examples utils_shared utils_install utils_sourceinstall utils_exampleinstall utils_distinstall utils_zipinstall utils_zipsourceinstall utils_zipexampleinstall utils_zipdistinstall utils_clean utils_distclean utils_cleanall utils_info utils_makefiles utils
 endif
 endif
 ifndef DIFF
 ifndef DIFF
 DIFF:=$(strip $(wildcard $(addsuffix /diff$(SRCEXEEXT),$(SEARCHPATH))))
 DIFF:=$(strip $(wildcard $(addsuffix /diff$(SRCEXEEXT),$(SEARCHPATH))))
@@ -1209,6 +1226,7 @@ endif
 export CMP
 export CMP
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
+release: $(addsuffix _release,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 sourceinstall:
 sourceinstall:
@@ -1220,10 +1238,8 @@ zipexampleinstall: fpc_zipexampleinstall $(addsuffix _zipexampleinstall,$(TARGET
 zipdistinstall: fpc_zipdistinstall $(addsuffix _zipdistinstall,$(TARGET_DIRS))
 zipdistinstall: fpc_zipdistinstall $(addsuffix _zipdistinstall,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: debug smart examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefile makefiles makefile_dirs
+.PHONY: debug smart release examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 35 - 17
compiler/new/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -736,6 +755,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -772,9 +792,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -1052,6 +1069,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1119,13 +1138,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1150,6 +1169,7 @@ endif
 export CMP
 export CMP
 debug:
 debug:
 smart:
 smart:
+release:
 examples:
 examples:
 shared:
 shared:
 sourceinstall:
 sourceinstall:
@@ -1161,10 +1181,8 @@ zipexampleinstall: fpc_zipexampleinstall
 zipdistinstall: fpc_zipdistinstall
 zipdistinstall: fpc_zipdistinstall
 cleanall:
 cleanall:
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: debug smart examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefile makefiles makefile_dirs
+.PHONY: debug smart release examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
compiler/utils/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -679,6 +698,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -715,9 +735,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -861,15 +878,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1021,6 +1039,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1088,13 +1108,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1102,6 +1122,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1116,10 +1137,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 52 - 44
demo/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -93,23 +91,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -946,6 +965,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1013,13 +1034,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1045,6 +1066,8 @@ text_debug:
 	$(MAKE) -C text debug
 	$(MAKE) -C text debug
 text_smart:
 text_smart:
 	$(MAKE) -C text smart
 	$(MAKE) -C text smart
+text_release:
+	$(MAKE) -C text release
 text_examples:
 text_examples:
 	$(MAKE) -C text examples
 	$(MAKE) -C text examples
 text_shared:
 text_shared:
@@ -1073,15 +1096,11 @@ text_cleanall:
 	$(MAKE) -C text cleanall
 	$(MAKE) -C text cleanall
 text_info:
 text_info:
 	$(MAKE) -C text info
 	$(MAKE) -C text info
-text_makefile:
-	$(MAKE) -C text makefile
 text_makefiles:
 text_makefiles:
 	$(MAKE) -C text makefiles
 	$(MAKE) -C text makefiles
-text_makefile_dirs:
-	$(MAKE) -C text makefile_dirs
 text:
 text:
 	$(MAKE) -C text all
 	$(MAKE) -C text all
-.PHONY: text_all text_debug text_smart text_examples text_shared text_install text_sourceinstall text_exampleinstall text_distinstall text_zipinstall text_zipsourceinstall text_zipexampleinstall text_zipdistinstall text_clean text_distclean text_cleanall text_info text_makefile text_makefiles text_makefile_dirs text
+.PHONY: text_all text_debug text_smart text_release text_examples text_shared text_install text_sourceinstall text_exampleinstall text_distinstall text_zipinstall text_zipsourceinstall text_zipexampleinstall text_zipdistinstall text_clean text_distclean text_cleanall text_info text_makefiles text
 endif
 endif
 ifdef TARGET_DIRS_GRAPH
 ifdef TARGET_DIRS_GRAPH
 graph_all:
 graph_all:
@@ -1090,6 +1109,8 @@ graph_debug:
 	$(MAKE) -C graph debug
 	$(MAKE) -C graph debug
 graph_smart:
 graph_smart:
 	$(MAKE) -C graph smart
 	$(MAKE) -C graph smart
+graph_release:
+	$(MAKE) -C graph release
 graph_examples:
 graph_examples:
 	$(MAKE) -C graph examples
 	$(MAKE) -C graph examples
 graph_shared:
 graph_shared:
@@ -1118,15 +1139,11 @@ graph_cleanall:
 	$(MAKE) -C graph cleanall
 	$(MAKE) -C graph cleanall
 graph_info:
 graph_info:
 	$(MAKE) -C graph info
 	$(MAKE) -C graph info
-graph_makefile:
-	$(MAKE) -C graph makefile
 graph_makefiles:
 graph_makefiles:
 	$(MAKE) -C graph makefiles
 	$(MAKE) -C graph makefiles
-graph_makefile_dirs:
-	$(MAKE) -C graph makefile_dirs
 graph:
 graph:
 	$(MAKE) -C graph all
 	$(MAKE) -C graph all
-.PHONY: graph_all graph_debug graph_smart graph_examples graph_shared graph_install graph_sourceinstall graph_exampleinstall graph_distinstall graph_zipinstall graph_zipsourceinstall graph_zipexampleinstall graph_zipdistinstall graph_clean graph_distclean graph_cleanall graph_info graph_makefile graph_makefiles graph_makefile_dirs graph
+.PHONY: graph_all graph_debug graph_smart graph_release graph_examples graph_shared graph_install graph_sourceinstall graph_exampleinstall graph_distinstall graph_zipinstall graph_zipsourceinstall graph_zipexampleinstall graph_zipdistinstall graph_clean graph_distclean graph_cleanall graph_info graph_makefiles graph
 endif
 endif
 ifdef TARGET_DIRS_LINUX
 ifdef TARGET_DIRS_LINUX
 linux_all:
 linux_all:
@@ -1135,6 +1152,8 @@ linux_debug:
 	$(MAKE) -C linux debug
 	$(MAKE) -C linux debug
 linux_smart:
 linux_smart:
 	$(MAKE) -C linux smart
 	$(MAKE) -C linux smart
+linux_release:
+	$(MAKE) -C linux release
 linux_examples:
 linux_examples:
 	$(MAKE) -C linux examples
 	$(MAKE) -C linux examples
 linux_shared:
 linux_shared:
@@ -1163,15 +1182,11 @@ linux_cleanall:
 	$(MAKE) -C linux cleanall
 	$(MAKE) -C linux cleanall
 linux_info:
 linux_info:
 	$(MAKE) -C linux info
 	$(MAKE) -C linux info
-linux_makefile:
-	$(MAKE) -C linux makefile
 linux_makefiles:
 linux_makefiles:
 	$(MAKE) -C linux makefiles
 	$(MAKE) -C linux makefiles
-linux_makefile_dirs:
-	$(MAKE) -C linux makefile_dirs
 linux:
 linux:
 	$(MAKE) -C linux all
 	$(MAKE) -C linux all
-.PHONY: linux_all linux_debug linux_smart linux_examples linux_shared linux_install linux_sourceinstall linux_exampleinstall linux_distinstall linux_zipinstall linux_zipsourceinstall linux_zipexampleinstall linux_zipdistinstall linux_clean linux_distclean linux_cleanall linux_info linux_makefile linux_makefiles linux_makefile_dirs linux
+.PHONY: linux_all linux_debug linux_smart linux_release linux_examples linux_shared linux_install linux_sourceinstall linux_exampleinstall linux_distinstall linux_zipinstall linux_zipsourceinstall linux_zipexampleinstall linux_zipdistinstall linux_clean linux_distclean linux_cleanall linux_info linux_makefiles linux
 endif
 endif
 ifdef TARGET_DIRS_MODEX
 ifdef TARGET_DIRS_MODEX
 modex_all:
 modex_all:
@@ -1180,6 +1195,8 @@ modex_debug:
 	$(MAKE) -C modex debug
 	$(MAKE) -C modex debug
 modex_smart:
 modex_smart:
 	$(MAKE) -C modex smart
 	$(MAKE) -C modex smart
+modex_release:
+	$(MAKE) -C modex release
 modex_examples:
 modex_examples:
 	$(MAKE) -C modex examples
 	$(MAKE) -C modex examples
 modex_shared:
 modex_shared:
@@ -1208,15 +1225,11 @@ modex_cleanall:
 	$(MAKE) -C modex cleanall
 	$(MAKE) -C modex cleanall
 modex_info:
 modex_info:
 	$(MAKE) -C modex info
 	$(MAKE) -C modex info
-modex_makefile:
-	$(MAKE) -C modex makefile
 modex_makefiles:
 modex_makefiles:
 	$(MAKE) -C modex makefiles
 	$(MAKE) -C modex makefiles
-modex_makefile_dirs:
-	$(MAKE) -C modex makefile_dirs
 modex:
 modex:
 	$(MAKE) -C modex all
 	$(MAKE) -C modex all
-.PHONY: modex_all modex_debug modex_smart modex_examples modex_shared modex_install modex_sourceinstall modex_exampleinstall modex_distinstall modex_zipinstall modex_zipsourceinstall modex_zipexampleinstall modex_zipdistinstall modex_clean modex_distclean modex_cleanall modex_info modex_makefile modex_makefiles modex_makefile_dirs modex
+.PHONY: modex_all modex_debug modex_smart modex_release modex_examples modex_shared modex_install modex_sourceinstall modex_exampleinstall modex_distinstall modex_zipinstall modex_zipsourceinstall modex_zipexampleinstall modex_zipdistinstall modex_clean modex_distclean modex_cleanall modex_info modex_makefiles modex
 endif
 endif
 ifdef TARGET_DIRS_WIN32
 ifdef TARGET_DIRS_WIN32
 win32_all:
 win32_all:
@@ -1225,6 +1238,8 @@ win32_debug:
 	$(MAKE) -C win32 debug
 	$(MAKE) -C win32 debug
 win32_smart:
 win32_smart:
 	$(MAKE) -C win32 smart
 	$(MAKE) -C win32 smart
+win32_release:
+	$(MAKE) -C win32 release
 win32_examples:
 win32_examples:
 	$(MAKE) -C win32 examples
 	$(MAKE) -C win32 examples
 win32_shared:
 win32_shared:
@@ -1253,15 +1268,11 @@ win32_cleanall:
 	$(MAKE) -C win32 cleanall
 	$(MAKE) -C win32 cleanall
 win32_info:
 win32_info:
 	$(MAKE) -C win32 info
 	$(MAKE) -C win32 info
-win32_makefile:
-	$(MAKE) -C win32 makefile
 win32_makefiles:
 win32_makefiles:
 	$(MAKE) -C win32 makefiles
 	$(MAKE) -C win32 makefiles
-win32_makefile_dirs:
-	$(MAKE) -C win32 makefile_dirs
 win32:
 win32:
 	$(MAKE) -C win32 all
 	$(MAKE) -C win32 all
-.PHONY: win32_all win32_debug win32_smart win32_examples win32_shared win32_install win32_sourceinstall win32_exampleinstall win32_distinstall win32_zipinstall win32_zipsourceinstall win32_zipexampleinstall win32_zipdistinstall win32_clean win32_distclean win32_cleanall win32_info win32_makefile win32_makefiles win32_makefile_dirs win32
+.PHONY: win32_all win32_debug win32_smart win32_release win32_examples win32_shared win32_install win32_sourceinstall win32_exampleinstall win32_distinstall win32_zipinstall win32_zipsourceinstall win32_zipexampleinstall win32_zipdistinstall win32_clean win32_distclean win32_cleanall win32_info win32_makefiles win32
 endif
 endif
 ifdef TARGET_DIRS_OS2
 ifdef TARGET_DIRS_OS2
 os2_all:
 os2_all:
@@ -1270,6 +1281,8 @@ os2_debug:
 	$(MAKE) -C os2 debug
 	$(MAKE) -C os2 debug
 os2_smart:
 os2_smart:
 	$(MAKE) -C os2 smart
 	$(MAKE) -C os2 smart
+os2_release:
+	$(MAKE) -C os2 release
 os2_examples:
 os2_examples:
 	$(MAKE) -C os2 examples
 	$(MAKE) -C os2 examples
 os2_shared:
 os2_shared:
@@ -1298,19 +1311,16 @@ os2_cleanall:
 	$(MAKE) -C os2 cleanall
 	$(MAKE) -C os2 cleanall
 os2_info:
 os2_info:
 	$(MAKE) -C os2 info
 	$(MAKE) -C os2 info
-os2_makefile:
-	$(MAKE) -C os2 makefile
 os2_makefiles:
 os2_makefiles:
 	$(MAKE) -C os2 makefiles
 	$(MAKE) -C os2 makefiles
-os2_makefile_dirs:
-	$(MAKE) -C os2 makefile_dirs
 os2:
 os2:
 	$(MAKE) -C os2 all
 	$(MAKE) -C os2 all
-.PHONY: os2_all os2_debug os2_smart os2_examples os2_shared os2_install os2_sourceinstall os2_exampleinstall os2_distinstall os2_zipinstall os2_zipsourceinstall os2_zipexampleinstall os2_zipdistinstall os2_clean os2_distclean os2_cleanall os2_info os2_makefile os2_makefiles os2_makefile_dirs os2
+.PHONY: os2_all os2_debug os2_smart os2_release os2_examples os2_shared os2_install os2_sourceinstall os2_exampleinstall os2_distinstall os2_zipinstall os2_zipsourceinstall os2_zipexampleinstall os2_zipdistinstall os2_clean os2_distclean os2_cleanall os2_info os2_makefiles os2
 endif
 endif
 all: $(addsuffix _all,$(TARGET_DIRS))
 all: $(addsuffix _all,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
+release: $(addsuffix _release,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: $(addsuffix _install,$(TARGET_DIRS))
 install: $(addsuffix _install,$(TARGET_DIRS))
@@ -1325,10 +1335,8 @@ clean: $(addsuffix _clean,$(TARGET_DIRS))
 distclean: $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
demo/graph/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -869,15 +886,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1029,6 +1047,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1096,19 +1116,20 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1122,10 +1143,8 @@ zipdistinstall:
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
demo/linux/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -676,6 +695,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -712,9 +732,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -858,15 +875,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1018,6 +1036,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1085,13 +1105,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1099,6 +1119,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1113,10 +1134,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
demo/modex/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -676,6 +695,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -712,9 +732,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -858,15 +875,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1018,6 +1036,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1085,13 +1105,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1099,6 +1119,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1113,10 +1134,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
demo/os2/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -676,6 +695,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -712,9 +732,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -858,15 +875,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1018,6 +1036,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1085,13 +1105,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1099,6 +1119,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1113,10 +1134,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
demo/text/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -674,6 +693,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -710,9 +730,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -856,15 +873,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1016,6 +1034,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1083,13 +1103,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1097,6 +1117,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1111,10 +1132,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
demo/win32/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -676,6 +695,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -712,9 +732,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -858,15 +875,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1018,6 +1036,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1085,13 +1105,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1099,6 +1119,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1113,10 +1134,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 51 - 52
fcl/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -725,6 +744,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl paszlib
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -781,9 +801,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -805,9 +822,6 @@ endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_PASZLIB),)
 ifneq ($(PACKAGEDIR_PASZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
-$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 else
 else
@@ -829,9 +843,6 @@ endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_INET),)
 ifneq ($(PACKAGEDIR_INET),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
-$(PACKAGEDIR_INET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_INET) all
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 else
 else
@@ -853,9 +864,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -877,9 +885,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -1041,15 +1046,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1280,6 +1286,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1347,13 +1355,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1368,6 +1376,8 @@ xml_debug:
 	$(MAKE) -C xml debug
 	$(MAKE) -C xml debug
 xml_smart:
 xml_smart:
 	$(MAKE) -C xml smart
 	$(MAKE) -C xml smart
+xml_release:
+	$(MAKE) -C xml release
 xml_examples:
 xml_examples:
 	$(MAKE) -C xml examples
 	$(MAKE) -C xml examples
 xml_shared:
 xml_shared:
@@ -1396,15 +1406,11 @@ xml_cleanall:
 	$(MAKE) -C xml cleanall
 	$(MAKE) -C xml cleanall
 xml_info:
 xml_info:
 	$(MAKE) -C xml info
 	$(MAKE) -C xml info
-xml_makefile:
-	$(MAKE) -C xml makefile
 xml_makefiles:
 xml_makefiles:
 	$(MAKE) -C xml makefiles
 	$(MAKE) -C xml makefiles
-xml_makefile_dirs:
-	$(MAKE) -C xml makefile_dirs
 xml:
 xml:
 	$(MAKE) -C xml all
 	$(MAKE) -C xml all
-.PHONY: xml_all xml_debug xml_smart xml_examples xml_shared xml_install xml_sourceinstall xml_exampleinstall xml_distinstall xml_zipinstall xml_zipsourceinstall xml_zipexampleinstall xml_zipdistinstall xml_clean xml_distclean xml_cleanall xml_info xml_makefile xml_makefiles xml_makefile_dirs xml
+.PHONY: xml_all xml_debug xml_smart xml_release xml_examples xml_shared xml_install xml_sourceinstall xml_exampleinstall xml_distinstall xml_zipinstall xml_zipsourceinstall xml_zipexampleinstall xml_zipdistinstall xml_clean xml_distclean xml_cleanall xml_info xml_makefiles xml
 endif
 endif
 ifdef TARGET_DIRS_DB
 ifdef TARGET_DIRS_DB
 db_all:
 db_all:
@@ -1413,6 +1419,8 @@ db_debug:
 	$(MAKE) -C db debug
 	$(MAKE) -C db debug
 db_smart:
 db_smart:
 	$(MAKE) -C db smart
 	$(MAKE) -C db smart
+db_release:
+	$(MAKE) -C db release
 db_examples:
 db_examples:
 	$(MAKE) -C db examples
 	$(MAKE) -C db examples
 db_shared:
 db_shared:
@@ -1441,15 +1449,11 @@ db_cleanall:
 	$(MAKE) -C db cleanall
 	$(MAKE) -C db cleanall
 db_info:
 db_info:
 	$(MAKE) -C db info
 	$(MAKE) -C db info
-db_makefile:
-	$(MAKE) -C db makefile
 db_makefiles:
 db_makefiles:
 	$(MAKE) -C db makefiles
 	$(MAKE) -C db makefiles
-db_makefile_dirs:
-	$(MAKE) -C db makefile_dirs
 db:
 db:
 	$(MAKE) -C db all
 	$(MAKE) -C db all
-.PHONY: db_all db_debug db_smart db_examples db_shared db_install db_sourceinstall db_exampleinstall db_distinstall db_zipinstall db_zipsourceinstall db_zipexampleinstall db_zipdistinstall db_clean db_distclean db_cleanall db_info db_makefile db_makefiles db_makefile_dirs db
+.PHONY: db_all db_debug db_smart db_release db_examples db_shared db_install db_sourceinstall db_exampleinstall db_distinstall db_zipinstall db_zipsourceinstall db_zipexampleinstall db_zipdistinstall db_clean db_distclean db_cleanall db_info db_makefiles db
 endif
 endif
 ifdef TARGET_DIRS_SHEDIT
 ifdef TARGET_DIRS_SHEDIT
 shedit_all:
 shedit_all:
@@ -1458,6 +1462,8 @@ shedit_debug:
 	$(MAKE) -C shedit debug
 	$(MAKE) -C shedit debug
 shedit_smart:
 shedit_smart:
 	$(MAKE) -C shedit smart
 	$(MAKE) -C shedit smart
+shedit_release:
+	$(MAKE) -C shedit release
 shedit_examples:
 shedit_examples:
 	$(MAKE) -C shedit examples
 	$(MAKE) -C shedit examples
 shedit_shared:
 shedit_shared:
@@ -1486,15 +1492,11 @@ shedit_cleanall:
 	$(MAKE) -C shedit cleanall
 	$(MAKE) -C shedit cleanall
 shedit_info:
 shedit_info:
 	$(MAKE) -C shedit info
 	$(MAKE) -C shedit info
-shedit_makefile:
-	$(MAKE) -C shedit makefile
 shedit_makefiles:
 shedit_makefiles:
 	$(MAKE) -C shedit makefiles
 	$(MAKE) -C shedit makefiles
-shedit_makefile_dirs:
-	$(MAKE) -C shedit makefile_dirs
 shedit:
 shedit:
 	$(MAKE) -C shedit all
 	$(MAKE) -C shedit all
-.PHONY: shedit_all shedit_debug shedit_smart shedit_examples shedit_shared shedit_install shedit_sourceinstall shedit_exampleinstall shedit_distinstall shedit_zipinstall shedit_zipsourceinstall shedit_zipexampleinstall shedit_zipdistinstall shedit_clean shedit_distclean shedit_cleanall shedit_info shedit_makefile shedit_makefiles shedit_makefile_dirs shedit
+.PHONY: shedit_all shedit_debug shedit_smart shedit_release shedit_examples shedit_shared shedit_install shedit_sourceinstall shedit_exampleinstall shedit_distinstall shedit_zipinstall shedit_zipsourceinstall shedit_zipexampleinstall shedit_zipdistinstall shedit_clean shedit_distclean shedit_cleanall shedit_info shedit_makefiles shedit
 endif
 endif
 TARGET_EXAMPLEDIRS_TESTS=1
 TARGET_EXAMPLEDIRS_TESTS=1
 ifdef TARGET_EXAMPLEDIRS_TESTS
 ifdef TARGET_EXAMPLEDIRS_TESTS
@@ -1504,6 +1506,8 @@ tests_debug:
 	$(MAKE) -C tests debug
 	$(MAKE) -C tests debug
 tests_smart:
 tests_smart:
 	$(MAKE) -C tests smart
 	$(MAKE) -C tests smart
+tests_release:
+	$(MAKE) -C tests release
 tests_examples:
 tests_examples:
 	$(MAKE) -C tests examples
 	$(MAKE) -C tests examples
 tests_shared:
 tests_shared:
@@ -1532,19 +1536,16 @@ tests_cleanall:
 	$(MAKE) -C tests cleanall
 	$(MAKE) -C tests cleanall
 tests_info:
 tests_info:
 	$(MAKE) -C tests info
 	$(MAKE) -C tests info
-tests_makefile:
-	$(MAKE) -C tests makefile
 tests_makefiles:
 tests_makefiles:
 	$(MAKE) -C tests makefiles
 	$(MAKE) -C tests makefiles
-tests_makefile_dirs:
-	$(MAKE) -C tests makefile_dirs
 tests:
 tests:
 	$(MAKE) -C tests all
 	$(MAKE) -C tests all
-.PHONY: tests_all tests_debug tests_smart tests_examples tests_shared tests_install tests_sourceinstall tests_exampleinstall tests_distinstall tests_zipinstall tests_zipsourceinstall tests_zipexampleinstall tests_zipdistinstall tests_clean tests_distclean tests_cleanall tests_info tests_makefile tests_makefiles tests_makefile_dirs tests
+.PHONY: tests_all tests_debug tests_smart tests_release tests_examples tests_shared tests_install tests_sourceinstall tests_exampleinstall tests_distinstall tests_zipinstall tests_zipsourceinstall tests_zipexampleinstall tests_zipdistinstall tests_clean tests_distclean tests_cleanall tests_info tests_makefiles tests
 endif
 endif
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples $(addsuffix _examples,$(TARGET_DIRS))
 examples: fpc_examples $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
@@ -1559,10 +1560,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_DIRS)) $(addsuffix _clean,$(TARGET_
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 51 - 46
fcl/db/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -703,6 +722,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_MYSQL=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -745,9 +765,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -769,9 +786,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -793,9 +807,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -957,15 +968,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1117,6 +1129,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1184,13 +1198,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1215,6 +1229,8 @@ dbase_debug:
 	$(MAKE) -C dbase debug
 	$(MAKE) -C dbase debug
 dbase_smart:
 dbase_smart:
 	$(MAKE) -C dbase smart
 	$(MAKE) -C dbase smart
+dbase_release:
+	$(MAKE) -C dbase release
 dbase_examples:
 dbase_examples:
 	$(MAKE) -C dbase examples
 	$(MAKE) -C dbase examples
 dbase_shared:
 dbase_shared:
@@ -1243,15 +1259,11 @@ dbase_cleanall:
 	$(MAKE) -C dbase cleanall
 	$(MAKE) -C dbase cleanall
 dbase_info:
 dbase_info:
 	$(MAKE) -C dbase info
 	$(MAKE) -C dbase info
-dbase_makefile:
-	$(MAKE) -C dbase makefile
 dbase_makefiles:
 dbase_makefiles:
 	$(MAKE) -C dbase makefiles
 	$(MAKE) -C dbase makefiles
-dbase_makefile_dirs:
-	$(MAKE) -C dbase makefile_dirs
 dbase:
 dbase:
 	$(MAKE) -C dbase all
 	$(MAKE) -C dbase all
-.PHONY: dbase_all dbase_debug dbase_smart dbase_examples dbase_shared dbase_install dbase_sourceinstall dbase_exampleinstall dbase_distinstall dbase_zipinstall dbase_zipsourceinstall dbase_zipexampleinstall dbase_zipdistinstall dbase_clean dbase_distclean dbase_cleanall dbase_info dbase_makefile dbase_makefiles dbase_makefile_dirs dbase
+.PHONY: dbase_all dbase_debug dbase_smart dbase_release dbase_examples dbase_shared dbase_install dbase_sourceinstall dbase_exampleinstall dbase_distinstall dbase_zipinstall dbase_zipsourceinstall dbase_zipexampleinstall dbase_zipdistinstall dbase_clean dbase_distclean dbase_cleanall dbase_info dbase_makefiles dbase
 endif
 endif
 ifdef TARGET_DIRS_MYSQL
 ifdef TARGET_DIRS_MYSQL
 mysql_all:
 mysql_all:
@@ -1260,6 +1272,8 @@ mysql_debug:
 	$(MAKE) -C mysql debug
 	$(MAKE) -C mysql debug
 mysql_smart:
 mysql_smart:
 	$(MAKE) -C mysql smart
 	$(MAKE) -C mysql smart
+mysql_release:
+	$(MAKE) -C mysql release
 mysql_examples:
 mysql_examples:
 	$(MAKE) -C mysql examples
 	$(MAKE) -C mysql examples
 mysql_shared:
 mysql_shared:
@@ -1288,15 +1302,11 @@ mysql_cleanall:
 	$(MAKE) -C mysql cleanall
 	$(MAKE) -C mysql cleanall
 mysql_info:
 mysql_info:
 	$(MAKE) -C mysql info
 	$(MAKE) -C mysql info
-mysql_makefile:
-	$(MAKE) -C mysql makefile
 mysql_makefiles:
 mysql_makefiles:
 	$(MAKE) -C mysql makefiles
 	$(MAKE) -C mysql makefiles
-mysql_makefile_dirs:
-	$(MAKE) -C mysql makefile_dirs
 mysql:
 mysql:
 	$(MAKE) -C mysql all
 	$(MAKE) -C mysql all
-.PHONY: mysql_all mysql_debug mysql_smart mysql_examples mysql_shared mysql_install mysql_sourceinstall mysql_exampleinstall mysql_distinstall mysql_zipinstall mysql_zipsourceinstall mysql_zipexampleinstall mysql_zipdistinstall mysql_clean mysql_distclean mysql_cleanall mysql_info mysql_makefile mysql_makefiles mysql_makefile_dirs mysql
+.PHONY: mysql_all mysql_debug mysql_smart mysql_release mysql_examples mysql_shared mysql_install mysql_sourceinstall mysql_exampleinstall mysql_distinstall mysql_zipinstall mysql_zipsourceinstall mysql_zipexampleinstall mysql_zipdistinstall mysql_clean mysql_distclean mysql_cleanall mysql_info mysql_makefiles mysql
 endif
 endif
 ifdef TARGET_DIRS_INTERBASE
 ifdef TARGET_DIRS_INTERBASE
 interbase_all:
 interbase_all:
@@ -1305,6 +1315,8 @@ interbase_debug:
 	$(MAKE) -C interbase debug
 	$(MAKE) -C interbase debug
 interbase_smart:
 interbase_smart:
 	$(MAKE) -C interbase smart
 	$(MAKE) -C interbase smart
+interbase_release:
+	$(MAKE) -C interbase release
 interbase_examples:
 interbase_examples:
 	$(MAKE) -C interbase examples
 	$(MAKE) -C interbase examples
 interbase_shared:
 interbase_shared:
@@ -1333,15 +1345,11 @@ interbase_cleanall:
 	$(MAKE) -C interbase cleanall
 	$(MAKE) -C interbase cleanall
 interbase_info:
 interbase_info:
 	$(MAKE) -C interbase info
 	$(MAKE) -C interbase info
-interbase_makefile:
-	$(MAKE) -C interbase makefile
 interbase_makefiles:
 interbase_makefiles:
 	$(MAKE) -C interbase makefiles
 	$(MAKE) -C interbase makefiles
-interbase_makefile_dirs:
-	$(MAKE) -C interbase makefile_dirs
 interbase:
 interbase:
 	$(MAKE) -C interbase all
 	$(MAKE) -C interbase all
-.PHONY: interbase_all interbase_debug interbase_smart interbase_examples interbase_shared interbase_install interbase_sourceinstall interbase_exampleinstall interbase_distinstall interbase_zipinstall interbase_zipsourceinstall interbase_zipexampleinstall interbase_zipdistinstall interbase_clean interbase_distclean interbase_cleanall interbase_info interbase_makefile interbase_makefiles interbase_makefile_dirs interbase
+.PHONY: interbase_all interbase_debug interbase_smart interbase_release interbase_examples interbase_shared interbase_install interbase_sourceinstall interbase_exampleinstall interbase_distinstall interbase_zipinstall interbase_zipsourceinstall interbase_zipexampleinstall interbase_zipdistinstall interbase_clean interbase_distclean interbase_cleanall interbase_info interbase_makefiles interbase
 endif
 endif
 TARGET_EXAMPLEDIRS_TESTS=1
 TARGET_EXAMPLEDIRS_TESTS=1
 ifdef TARGET_EXAMPLEDIRS_TESTS
 ifdef TARGET_EXAMPLEDIRS_TESTS
@@ -1351,6 +1359,8 @@ tests_debug:
 	$(MAKE) -C tests debug
 	$(MAKE) -C tests debug
 tests_smart:
 tests_smart:
 	$(MAKE) -C tests smart
 	$(MAKE) -C tests smart
+tests_release:
+	$(MAKE) -C tests release
 tests_examples:
 tests_examples:
 	$(MAKE) -C tests examples
 	$(MAKE) -C tests examples
 tests_shared:
 tests_shared:
@@ -1379,19 +1389,16 @@ tests_cleanall:
 	$(MAKE) -C tests cleanall
 	$(MAKE) -C tests cleanall
 tests_info:
 tests_info:
 	$(MAKE) -C tests info
 	$(MAKE) -C tests info
-tests_makefile:
-	$(MAKE) -C tests makefile
 tests_makefiles:
 tests_makefiles:
 	$(MAKE) -C tests makefiles
 	$(MAKE) -C tests makefiles
-tests_makefile_dirs:
-	$(MAKE) -C tests makefile_dirs
 tests:
 tests:
 	$(MAKE) -C tests all
 	$(MAKE) -C tests all
-.PHONY: tests_all tests_debug tests_smart tests_examples tests_shared tests_install tests_sourceinstall tests_exampleinstall tests_distinstall tests_zipinstall tests_zipsourceinstall tests_zipexampleinstall tests_zipdistinstall tests_clean tests_distclean tests_cleanall tests_info tests_makefile tests_makefiles tests_makefile_dirs tests
+.PHONY: tests_all tests_debug tests_smart tests_release tests_examples tests_shared tests_install tests_sourceinstall tests_exampleinstall tests_distinstall tests_zipinstall tests_zipsourceinstall tests_zipexampleinstall tests_zipdistinstall tests_clean tests_distclean tests_cleanall tests_info tests_makefiles tests
 endif
 endif
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples $(addsuffix _examples,$(TARGET_DIRS))
 examples: fpc_examples $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
@@ -1406,10 +1413,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_DIRS)) $(addsuffix _clean,$(TARGET_
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
fcl/db/dbase/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -679,6 +698,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -715,9 +735,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -873,15 +890,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1033,6 +1051,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1100,13 +1120,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1114,6 +1134,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1128,10 +1149,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 23
fcl/db/interbase/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -693,6 +712,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl ibase
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_IBASE=1
@@ -740,9 +760,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -764,9 +781,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -928,15 +942,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1088,6 +1103,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1155,13 +1172,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1169,6 +1186,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1183,10 +1201,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 23
fcl/db/mysql/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -693,6 +712,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl mysql
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_MYSQL=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -740,9 +760,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -764,9 +781,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -928,15 +942,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1088,6 +1103,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1155,13 +1172,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1169,6 +1186,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1183,10 +1201,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 35
fcl/db/tests/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -690,6 +709,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fcl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -757,9 +777,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -781,9 +798,6 @@ endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_PASZLIB),)
 ifneq ($(PACKAGEDIR_PASZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
-$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 else
 else
@@ -805,9 +819,6 @@ endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_INET),)
 ifneq ($(PACKAGEDIR_INET),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
-$(PACKAGEDIR_INET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_INET) all
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 else
 else
@@ -829,9 +840,6 @@ endif
 ifdef REQUIRE_PACKAGES_FCL
 ifdef REQUIRE_PACKAGES_FCL
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FCL),)
 ifneq ($(PACKAGEDIR_FCL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
-$(PACKAGEDIR_FCL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FCL) all
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 else
 else
@@ -853,9 +861,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -877,9 +882,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -1029,15 +1031,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1189,6 +1192,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1256,13 +1261,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1270,6 +1275,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1284,10 +1290,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 42 - 25
fcl/shedit/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -679,6 +698,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -715,9 +735,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -873,15 +890,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1033,6 +1051,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1100,13 +1120,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1119,6 +1139,8 @@ gtk_debug:
 	$(MAKE) -C gtk debug
 	$(MAKE) -C gtk debug
 gtk_smart:
 gtk_smart:
 	$(MAKE) -C gtk smart
 	$(MAKE) -C gtk smart
+gtk_release:
+	$(MAKE) -C gtk release
 gtk_examples:
 gtk_examples:
 	$(MAKE) -C gtk examples
 	$(MAKE) -C gtk examples
 gtk_shared:
 gtk_shared:
@@ -1147,19 +1169,16 @@ gtk_cleanall:
 	$(MAKE) -C gtk cleanall
 	$(MAKE) -C gtk cleanall
 gtk_info:
 gtk_info:
 	$(MAKE) -C gtk info
 	$(MAKE) -C gtk info
-gtk_makefile:
-	$(MAKE) -C gtk makefile
 gtk_makefiles:
 gtk_makefiles:
 	$(MAKE) -C gtk makefiles
 	$(MAKE) -C gtk makefiles
-gtk_makefile_dirs:
-	$(MAKE) -C gtk makefile_dirs
 gtk:
 gtk:
 	$(MAKE) -C gtk all
 	$(MAKE) -C gtk all
-.PHONY: gtk_all gtk_debug gtk_smart gtk_examples gtk_shared gtk_install gtk_sourceinstall gtk_exampleinstall gtk_distinstall gtk_zipinstall gtk_zipsourceinstall gtk_zipexampleinstall gtk_zipdistinstall gtk_clean gtk_distclean gtk_cleanall gtk_info gtk_makefile gtk_makefiles gtk_makefile_dirs gtk
+.PHONY: gtk_all gtk_debug gtk_smart gtk_release gtk_examples gtk_shared gtk_install gtk_sourceinstall gtk_exampleinstall gtk_distinstall gtk_zipinstall gtk_zipsourceinstall gtk_zipexampleinstall gtk_zipdistinstall gtk_clean gtk_distclean gtk_cleanall gtk_info gtk_makefiles gtk
 endif
 endif
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1174,10 +1193,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 44
fcl/shedit/gtk/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -690,6 +709,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fcl gtk
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -782,9 +802,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -806,9 +823,6 @@ endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_PASZLIB),)
 ifneq ($(PACKAGEDIR_PASZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
-$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 else
 else
@@ -830,9 +844,6 @@ endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_INET),)
 ifneq ($(PACKAGEDIR_INET),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
-$(PACKAGEDIR_INET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_INET) all
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 else
 else
@@ -854,9 +865,6 @@ endif
 ifdef REQUIRE_PACKAGES_FCL
 ifdef REQUIRE_PACKAGES_FCL
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FCL),)
 ifneq ($(PACKAGEDIR_FCL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
-$(PACKAGEDIR_FCL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FCL) all
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 else
 else
@@ -878,9 +886,6 @@ endif
 ifdef REQUIRE_PACKAGES_GTK
 ifdef REQUIRE_PACKAGES_GTK
 PACKAGEDIR_GTK:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gtk/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_GTK:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gtk/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_GTK),)
 ifneq ($(PACKAGEDIR_GTK),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_GTK)/$(FPCMADE)
-$(PACKAGEDIR_GTK)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_GTK) all
 ifneq ($(wildcard $(PACKAGEDIR_GTK)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_GTK)/$(OS_TARGET)),)
 UNITDIR_GTK=$(PACKAGEDIR_GTK)/$(OS_TARGET)
 UNITDIR_GTK=$(PACKAGEDIR_GTK)/$(OS_TARGET)
 else
 else
@@ -902,9 +907,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -926,9 +928,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -950,9 +949,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -974,9 +970,6 @@ endif
 ifdef REQUIRE_PACKAGES_OPENGL
 ifdef REQUIRE_PACKAGES_OPENGL
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_OPENGL),)
 ifneq ($(PACKAGEDIR_OPENGL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE)
-$(PACKAGEDIR_OPENGL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_OPENGL) all
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 else
 else
@@ -1135,15 +1128,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1295,6 +1289,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1362,13 +1358,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1376,6 +1372,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1390,10 +1387,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 35
fcl/tests/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -696,6 +715,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fcl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -763,9 +783,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -787,9 +804,6 @@ endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_PASZLIB),)
 ifneq ($(PACKAGEDIR_PASZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
-$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 else
 else
@@ -811,9 +825,6 @@ endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_INET),)
 ifneq ($(PACKAGEDIR_INET),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
-$(PACKAGEDIR_INET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_INET) all
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 else
 else
@@ -835,9 +846,6 @@ endif
 ifdef REQUIRE_PACKAGES_FCL
 ifdef REQUIRE_PACKAGES_FCL
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FCL),)
 ifneq ($(PACKAGEDIR_FCL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
-$(PACKAGEDIR_FCL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FCL) all
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 else
 else
@@ -859,9 +867,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -883,9 +888,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -1035,15 +1037,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1195,6 +1198,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1262,13 +1267,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1276,6 +1281,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1290,10 +1296,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
fcl/xml/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -857,15 +874,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1017,6 +1035,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1084,13 +1104,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1098,6 +1118,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1112,10 +1133,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 42 - 25
fv/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -681,6 +700,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -717,9 +737,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -875,15 +892,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1114,6 +1132,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1181,13 +1201,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1200,6 +1220,8 @@ test_debug:
 	$(MAKE) -C test debug
 	$(MAKE) -C test debug
 test_smart:
 test_smart:
 	$(MAKE) -C test smart
 	$(MAKE) -C test smart
+test_release:
+	$(MAKE) -C test release
 test_examples:
 test_examples:
 	$(MAKE) -C test examples
 	$(MAKE) -C test examples
 test_shared:
 test_shared:
@@ -1228,19 +1250,16 @@ test_cleanall:
 	$(MAKE) -C test cleanall
 	$(MAKE) -C test cleanall
 test_info:
 test_info:
 	$(MAKE) -C test info
 	$(MAKE) -C test info
-test_makefile:
-	$(MAKE) -C test makefile
 test_makefiles:
 test_makefiles:
 	$(MAKE) -C test makefiles
 	$(MAKE) -C test makefiles
-test_makefile_dirs:
-	$(MAKE) -C test makefile_dirs
 test:
 test:
 	$(MAKE) -C test all
 	$(MAKE) -C test all
-.PHONY: test_all test_debug test_smart test_examples test_shared test_install test_sourceinstall test_exampleinstall test_distinstall test_zipinstall test_zipsourceinstall test_zipexampleinstall test_zipdistinstall test_clean test_distclean test_cleanall test_info test_makefile test_makefiles test_makefile_dirs test
+.PHONY: test_all test_debug test_smart test_release test_examples test_shared test_install test_sourceinstall test_exampleinstall test_distinstall test_zipinstall test_zipsourceinstall test_zipexampleinstall test_zipdistinstall test_clean test_distclean test_cleanall test_info test_makefiles test
 endif
 endif
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1255,10 +1274,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 23
fv/test/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -674,6 +693,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fvision
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FVISION=1
 REQUIRE_PACKAGES_FVISION=1
@@ -721,9 +741,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -745,9 +762,6 @@ endif
 ifdef REQUIRE_PACKAGES_FVISION
 ifdef REQUIRE_PACKAGES_FVISION
 PACKAGEDIR_FVISION:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fvision/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FVISION:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fvision/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FVISION),)
 ifneq ($(PACKAGEDIR_FVISION),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FVISION)/$(FPCMADE)
-$(PACKAGEDIR_FVISION)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FVISION) all
 ifneq ($(wildcard $(PACKAGEDIR_FVISION)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FVISION)/$(OS_TARGET)),)
 UNITDIR_FVISION=$(PACKAGEDIR_FVISION)/$(OS_TARGET)
 UNITDIR_FVISION=$(PACKAGEDIR_FVISION)/$(OS_TARGET)
 else
 else
@@ -891,15 +905,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1051,6 +1066,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1118,13 +1135,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1132,6 +1149,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1146,10 +1164,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 42 - 25
fvision/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -681,6 +700,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -717,9 +737,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -875,15 +892,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1114,6 +1132,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1181,13 +1201,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1200,6 +1220,8 @@ test_debug:
 	$(MAKE) -C test debug
 	$(MAKE) -C test debug
 test_smart:
 test_smart:
 	$(MAKE) -C test smart
 	$(MAKE) -C test smart
+test_release:
+	$(MAKE) -C test release
 test_examples:
 test_examples:
 	$(MAKE) -C test examples
 	$(MAKE) -C test examples
 test_shared:
 test_shared:
@@ -1228,19 +1250,16 @@ test_cleanall:
 	$(MAKE) -C test cleanall
 	$(MAKE) -C test cleanall
 test_info:
 test_info:
 	$(MAKE) -C test info
 	$(MAKE) -C test info
-test_makefile:
-	$(MAKE) -C test makefile
 test_makefiles:
 test_makefiles:
 	$(MAKE) -C test makefiles
 	$(MAKE) -C test makefiles
-test_makefile_dirs:
-	$(MAKE) -C test makefile_dirs
 test:
 test:
 	$(MAKE) -C test all
 	$(MAKE) -C test all
-.PHONY: test_all test_debug test_smart test_examples test_shared test_install test_sourceinstall test_exampleinstall test_distinstall test_zipinstall test_zipsourceinstall test_zipexampleinstall test_zipdistinstall test_clean test_distclean test_cleanall test_info test_makefile test_makefiles test_makefile_dirs test
+.PHONY: test_all test_debug test_smart test_release test_examples test_shared test_install test_sourceinstall test_exampleinstall test_distinstall test_zipinstall test_zipsourceinstall test_zipexampleinstall test_zipdistinstall test_clean test_distclean test_cleanall test_info test_makefiles test
 endif
 endif
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1255,10 +1274,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 23
fvision/test/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -674,6 +693,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fvision
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FVISION=1
 REQUIRE_PACKAGES_FVISION=1
@@ -721,9 +741,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -745,9 +762,6 @@ endif
 ifdef REQUIRE_PACKAGES_FVISION
 ifdef REQUIRE_PACKAGES_FVISION
 PACKAGEDIR_FVISION:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fvision/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FVISION:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fvision/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FVISION),)
 ifneq ($(PACKAGEDIR_FVISION),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FVISION)/$(FPCMADE)
-$(PACKAGEDIR_FVISION)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FVISION) all
 ifneq ($(wildcard $(PACKAGEDIR_FVISION)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FVISION)/$(OS_TARGET)),)
 UNITDIR_FVISION=$(PACKAGEDIR_FVISION)/$(OS_TARGET)
 UNITDIR_FVISION=$(PACKAGEDIR_FVISION)/$(OS_TARGET)
 else
 else
@@ -891,15 +905,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1051,6 +1066,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1118,13 +1135,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1132,6 +1149,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1146,10 +1164,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 45 - 39
ide/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -742,6 +761,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fv gdbint regexpr
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_FV=1
@@ -811,9 +831,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -835,9 +852,6 @@ endif
 ifdef REQUIRE_PACKAGES_FV
 ifdef REQUIRE_PACKAGES_FV
 PACKAGEDIR_FV:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fv/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FV:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fv/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FV),)
 ifneq ($(PACKAGEDIR_FV),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FV)/$(FPCMADE)
-$(PACKAGEDIR_FV)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FV) all
 ifneq ($(wildcard $(PACKAGEDIR_FV)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FV)/$(OS_TARGET)),)
 UNITDIR_FV=$(PACKAGEDIR_FV)/$(OS_TARGET)
 UNITDIR_FV=$(PACKAGEDIR_FV)/$(OS_TARGET)
 else
 else
@@ -859,9 +873,6 @@ endif
 ifdef REQUIRE_PACKAGES_GDBINT
 ifdef REQUIRE_PACKAGES_GDBINT
 PACKAGEDIR_GDBINT:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gdbint/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_GDBINT:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gdbint/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_GDBINT),)
 ifneq ($(PACKAGEDIR_GDBINT),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_GDBINT)/$(FPCMADE)
-$(PACKAGEDIR_GDBINT)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_GDBINT) all
 ifneq ($(wildcard $(PACKAGEDIR_GDBINT)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_GDBINT)/$(OS_TARGET)),)
 UNITDIR_GDBINT=$(PACKAGEDIR_GDBINT)/$(OS_TARGET)
 UNITDIR_GDBINT=$(PACKAGEDIR_GDBINT)/$(OS_TARGET)
 else
 else
@@ -883,9 +894,6 @@ endif
 ifdef REQUIRE_PACKAGES_REGEXPR
 ifdef REQUIRE_PACKAGES_REGEXPR
 PACKAGEDIR_REGEXPR:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /regexpr/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_REGEXPR:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /regexpr/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_REGEXPR),)
 ifneq ($(PACKAGEDIR_REGEXPR),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_REGEXPR)/$(FPCMADE)
-$(PACKAGEDIR_REGEXPR)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_REGEXPR) all
 ifneq ($(wildcard $(PACKAGEDIR_REGEXPR)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_REGEXPR)/$(OS_TARGET)),)
 UNITDIR_REGEXPR=$(PACKAGEDIR_REGEXPR)/$(OS_TARGET)
 UNITDIR_REGEXPR=$(PACKAGEDIR_REGEXPR)/$(OS_TARGET)
 else
 else
@@ -1035,15 +1043,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1274,6 +1283,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1341,13 +1352,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1361,6 +1372,8 @@ compiler_debug:
 	$(MAKE) -C compiler debug
 	$(MAKE) -C compiler debug
 compiler_smart:
 compiler_smart:
 	$(MAKE) -C compiler smart
 	$(MAKE) -C compiler smart
+compiler_release:
+	$(MAKE) -C compiler release
 compiler_examples:
 compiler_examples:
 	$(MAKE) -C compiler examples
 	$(MAKE) -C compiler examples
 compiler_shared:
 compiler_shared:
@@ -1389,15 +1402,11 @@ compiler_cleanall:
 	$(MAKE) -C compiler cleanall
 	$(MAKE) -C compiler cleanall
 compiler_info:
 compiler_info:
 	$(MAKE) -C compiler info
 	$(MAKE) -C compiler info
-compiler_makefile:
-	$(MAKE) -C compiler makefile
 compiler_makefiles:
 compiler_makefiles:
 	$(MAKE) -C compiler makefiles
 	$(MAKE) -C compiler makefiles
-compiler_makefile_dirs:
-	$(MAKE) -C compiler makefile_dirs
 compiler:
 compiler:
 	$(MAKE) -C compiler all
 	$(MAKE) -C compiler all
-.PHONY: compiler_all compiler_debug compiler_smart compiler_examples compiler_shared compiler_install compiler_sourceinstall compiler_exampleinstall compiler_distinstall compiler_zipinstall compiler_zipsourceinstall compiler_zipexampleinstall compiler_zipdistinstall compiler_clean compiler_distclean compiler_cleanall compiler_info compiler_makefile compiler_makefiles compiler_makefile_dirs compiler
+.PHONY: compiler_all compiler_debug compiler_smart compiler_release compiler_examples compiler_shared compiler_install compiler_sourceinstall compiler_exampleinstall compiler_distinstall compiler_zipinstall compiler_zipsourceinstall compiler_zipexampleinstall compiler_zipdistinstall compiler_clean compiler_distclean compiler_cleanall compiler_info compiler_makefiles compiler
 endif
 endif
 ifdef TARGET_DIRS_FAKEGDB
 ifdef TARGET_DIRS_FAKEGDB
 fakegdb_all:
 fakegdb_all:
@@ -1406,6 +1415,8 @@ fakegdb_debug:
 	$(MAKE) -C fakegdb debug
 	$(MAKE) -C fakegdb debug
 fakegdb_smart:
 fakegdb_smart:
 	$(MAKE) -C fakegdb smart
 	$(MAKE) -C fakegdb smart
+fakegdb_release:
+	$(MAKE) -C fakegdb release
 fakegdb_examples:
 fakegdb_examples:
 	$(MAKE) -C fakegdb examples
 	$(MAKE) -C fakegdb examples
 fakegdb_shared:
 fakegdb_shared:
@@ -1434,18 +1445,15 @@ fakegdb_cleanall:
 	$(MAKE) -C fakegdb cleanall
 	$(MAKE) -C fakegdb cleanall
 fakegdb_info:
 fakegdb_info:
 	$(MAKE) -C fakegdb info
 	$(MAKE) -C fakegdb info
-fakegdb_makefile:
-	$(MAKE) -C fakegdb makefile
 fakegdb_makefiles:
 fakegdb_makefiles:
 	$(MAKE) -C fakegdb makefiles
 	$(MAKE) -C fakegdb makefiles
-fakegdb_makefile_dirs:
-	$(MAKE) -C fakegdb makefile_dirs
 fakegdb:
 fakegdb:
 	$(MAKE) -C fakegdb all
 	$(MAKE) -C fakegdb all
-.PHONY: fakegdb_all fakegdb_debug fakegdb_smart fakegdb_examples fakegdb_shared fakegdb_install fakegdb_sourceinstall fakegdb_exampleinstall fakegdb_distinstall fakegdb_zipinstall fakegdb_zipsourceinstall fakegdb_zipexampleinstall fakegdb_zipdistinstall fakegdb_clean fakegdb_distclean fakegdb_cleanall fakegdb_info fakegdb_makefile fakegdb_makefiles fakegdb_makefile_dirs fakegdb
+.PHONY: fakegdb_all fakegdb_debug fakegdb_smart fakegdb_release fakegdb_examples fakegdb_shared fakegdb_install fakegdb_sourceinstall fakegdb_exampleinstall fakegdb_distinstall fakegdb_zipinstall fakegdb_zipsourceinstall fakegdb_zipexampleinstall fakegdb_zipdistinstall fakegdb_clean fakegdb_distclean fakegdb_cleanall fakegdb_info fakegdb_makefiles fakegdb
 endif
 endif
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
@@ -1457,10 +1465,8 @@ zipexampleinstall: fpc_zipexampleinstall $(addsuffix _zipexampleinstall,$(TARGET
 zipdistinstall: fpc_zipdistinstall $(addsuffix _zipdistinstall,$(TARGET_DIRS))
 zipdistinstall: fpc_zipdistinstall $(addsuffix _zipdistinstall,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: debug smart examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefile makefiles makefile_dirs
+.PHONY: debug smart release examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
ide/compiler/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -689,6 +708,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -725,9 +745,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -868,15 +885,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1028,6 +1046,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1095,19 +1115,20 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
@@ -1120,10 +1141,8 @@ zipdistinstall:
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: debug smart examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: debug smart release examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
ide/fakegdb/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -675,6 +694,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -711,9 +731,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -854,15 +871,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1014,6 +1032,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1081,13 +1101,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1095,6 +1115,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1109,10 +1130,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 23
install/fpinst/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -696,6 +715,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fv
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_FV=1
@@ -743,9 +763,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -767,9 +784,6 @@ endif
 ifdef REQUIRE_PACKAGES_FV
 ifdef REQUIRE_PACKAGES_FV
 PACKAGEDIR_FV:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fv/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FV:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fv/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FV),)
 ifneq ($(PACKAGEDIR_FV),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FV)/$(FPCMADE)
-$(PACKAGEDIR_FV)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FV) all
 ifneq ($(wildcard $(PACKAGEDIR_FV)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FV)/$(OS_TARGET)),)
 UNITDIR_FV=$(PACKAGEDIR_FV)/$(OS_TARGET)
 UNITDIR_FV=$(PACKAGEDIR_FV)/$(OS_TARGET)
 else
 else
@@ -913,15 +927,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1152,6 +1167,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1219,13 +1236,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1233,6 +1250,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1247,10 +1265,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 115 - 149
packages/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -881,6 +900,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -948,13 +969,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1085,6 +1106,8 @@ zlib_debug:
 	$(MAKE) -C zlib debug
 	$(MAKE) -C zlib debug
 zlib_smart:
 zlib_smart:
 	$(MAKE) -C zlib smart
 	$(MAKE) -C zlib smart
+zlib_release:
+	$(MAKE) -C zlib release
 zlib_examples:
 zlib_examples:
 	$(MAKE) -C zlib examples
 	$(MAKE) -C zlib examples
 zlib_shared:
 zlib_shared:
@@ -1113,15 +1136,11 @@ zlib_cleanall:
 	$(MAKE) -C zlib cleanall
 	$(MAKE) -C zlib cleanall
 zlib_info:
 zlib_info:
 	$(MAKE) -C zlib info
 	$(MAKE) -C zlib info
-zlib_makefile:
-	$(MAKE) -C zlib makefile
 zlib_makefiles:
 zlib_makefiles:
 	$(MAKE) -C zlib makefiles
 	$(MAKE) -C zlib makefiles
-zlib_makefile_dirs:
-	$(MAKE) -C zlib makefile_dirs
 zlib:
 zlib:
 	$(MAKE) -C zlib all
 	$(MAKE) -C zlib all
-.PHONY: zlib_all zlib_debug zlib_smart zlib_examples zlib_shared zlib_install zlib_sourceinstall zlib_exampleinstall zlib_distinstall zlib_zipinstall zlib_zipsourceinstall zlib_zipexampleinstall zlib_zipdistinstall zlib_clean zlib_distclean zlib_cleanall zlib_info zlib_makefile zlib_makefiles zlib_makefile_dirs zlib
+.PHONY: zlib_all zlib_debug zlib_smart zlib_release zlib_examples zlib_shared zlib_install zlib_sourceinstall zlib_exampleinstall zlib_distinstall zlib_zipinstall zlib_zipsourceinstall zlib_zipexampleinstall zlib_zipdistinstall zlib_clean zlib_distclean zlib_cleanall zlib_info zlib_makefiles zlib
 endif
 endif
 ifdef TARGET_DIRS_NCURSES
 ifdef TARGET_DIRS_NCURSES
 ncurses_all:
 ncurses_all:
@@ -1130,6 +1149,8 @@ ncurses_debug:
 	$(MAKE) -C ncurses debug
 	$(MAKE) -C ncurses debug
 ncurses_smart:
 ncurses_smart:
 	$(MAKE) -C ncurses smart
 	$(MAKE) -C ncurses smart
+ncurses_release:
+	$(MAKE) -C ncurses release
 ncurses_examples:
 ncurses_examples:
 	$(MAKE) -C ncurses examples
 	$(MAKE) -C ncurses examples
 ncurses_shared:
 ncurses_shared:
@@ -1158,15 +1179,11 @@ ncurses_cleanall:
 	$(MAKE) -C ncurses cleanall
 	$(MAKE) -C ncurses cleanall
 ncurses_info:
 ncurses_info:
 	$(MAKE) -C ncurses info
 	$(MAKE) -C ncurses info
-ncurses_makefile:
-	$(MAKE) -C ncurses makefile
 ncurses_makefiles:
 ncurses_makefiles:
 	$(MAKE) -C ncurses makefiles
 	$(MAKE) -C ncurses makefiles
-ncurses_makefile_dirs:
-	$(MAKE) -C ncurses makefile_dirs
 ncurses:
 ncurses:
 	$(MAKE) -C ncurses all
 	$(MAKE) -C ncurses all
-.PHONY: ncurses_all ncurses_debug ncurses_smart ncurses_examples ncurses_shared ncurses_install ncurses_sourceinstall ncurses_exampleinstall ncurses_distinstall ncurses_zipinstall ncurses_zipsourceinstall ncurses_zipexampleinstall ncurses_zipdistinstall ncurses_clean ncurses_distclean ncurses_cleanall ncurses_info ncurses_makefile ncurses_makefiles ncurses_makefile_dirs ncurses
+.PHONY: ncurses_all ncurses_debug ncurses_smart ncurses_release ncurses_examples ncurses_shared ncurses_install ncurses_sourceinstall ncurses_exampleinstall ncurses_distinstall ncurses_zipinstall ncurses_zipsourceinstall ncurses_zipexampleinstall ncurses_zipdistinstall ncurses_clean ncurses_distclean ncurses_cleanall ncurses_info ncurses_makefiles ncurses
 endif
 endif
 ifdef TARGET_DIRS_X11
 ifdef TARGET_DIRS_X11
 x11_all:
 x11_all:
@@ -1175,6 +1192,8 @@ x11_debug:
 	$(MAKE) -C x11 debug
 	$(MAKE) -C x11 debug
 x11_smart:
 x11_smart:
 	$(MAKE) -C x11 smart
 	$(MAKE) -C x11 smart
+x11_release:
+	$(MAKE) -C x11 release
 x11_examples:
 x11_examples:
 	$(MAKE) -C x11 examples
 	$(MAKE) -C x11 examples
 x11_shared:
 x11_shared:
@@ -1203,15 +1222,11 @@ x11_cleanall:
 	$(MAKE) -C x11 cleanall
 	$(MAKE) -C x11 cleanall
 x11_info:
 x11_info:
 	$(MAKE) -C x11 info
 	$(MAKE) -C x11 info
-x11_makefile:
-	$(MAKE) -C x11 makefile
 x11_makefiles:
 x11_makefiles:
 	$(MAKE) -C x11 makefiles
 	$(MAKE) -C x11 makefiles
-x11_makefile_dirs:
-	$(MAKE) -C x11 makefile_dirs
 x11:
 x11:
 	$(MAKE) -C x11 all
 	$(MAKE) -C x11 all
-.PHONY: x11_all x11_debug x11_smart x11_examples x11_shared x11_install x11_sourceinstall x11_exampleinstall x11_distinstall x11_zipinstall x11_zipsourceinstall x11_zipexampleinstall x11_zipdistinstall x11_clean x11_distclean x11_cleanall x11_info x11_makefile x11_makefiles x11_makefile_dirs x11
+.PHONY: x11_all x11_debug x11_smart x11_release x11_examples x11_shared x11_install x11_sourceinstall x11_exampleinstall x11_distinstall x11_zipinstall x11_zipsourceinstall x11_zipexampleinstall x11_zipdistinstall x11_clean x11_distclean x11_cleanall x11_info x11_makefiles x11
 endif
 endif
 ifdef TARGET_DIRS_GTK
 ifdef TARGET_DIRS_GTK
 gtk_all:
 gtk_all:
@@ -1220,6 +1235,8 @@ gtk_debug:
 	$(MAKE) -C gtk debug
 	$(MAKE) -C gtk debug
 gtk_smart:
 gtk_smart:
 	$(MAKE) -C gtk smart
 	$(MAKE) -C gtk smart
+gtk_release:
+	$(MAKE) -C gtk release
 gtk_examples:
 gtk_examples:
 	$(MAKE) -C gtk examples
 	$(MAKE) -C gtk examples
 gtk_shared:
 gtk_shared:
@@ -1248,15 +1265,11 @@ gtk_cleanall:
 	$(MAKE) -C gtk cleanall
 	$(MAKE) -C gtk cleanall
 gtk_info:
 gtk_info:
 	$(MAKE) -C gtk info
 	$(MAKE) -C gtk info
-gtk_makefile:
-	$(MAKE) -C gtk makefile
 gtk_makefiles:
 gtk_makefiles:
 	$(MAKE) -C gtk makefiles
 	$(MAKE) -C gtk makefiles
-gtk_makefile_dirs:
-	$(MAKE) -C gtk makefile_dirs
 gtk:
 gtk:
 	$(MAKE) -C gtk all
 	$(MAKE) -C gtk all
-.PHONY: gtk_all gtk_debug gtk_smart gtk_examples gtk_shared gtk_install gtk_sourceinstall gtk_exampleinstall gtk_distinstall gtk_zipinstall gtk_zipsourceinstall gtk_zipexampleinstall gtk_zipdistinstall gtk_clean gtk_distclean gtk_cleanall gtk_info gtk_makefile gtk_makefiles gtk_makefile_dirs gtk
+.PHONY: gtk_all gtk_debug gtk_smart gtk_release gtk_examples gtk_shared gtk_install gtk_sourceinstall gtk_exampleinstall gtk_distinstall gtk_zipinstall gtk_zipsourceinstall gtk_zipexampleinstall gtk_zipdistinstall gtk_clean gtk_distclean gtk_cleanall gtk_info gtk_makefiles gtk
 endif
 endif
 ifdef TARGET_DIRS_SYSLOG
 ifdef TARGET_DIRS_SYSLOG
 syslog_all:
 syslog_all:
@@ -1265,6 +1278,8 @@ syslog_debug:
 	$(MAKE) -C syslog debug
 	$(MAKE) -C syslog debug
 syslog_smart:
 syslog_smart:
 	$(MAKE) -C syslog smart
 	$(MAKE) -C syslog smart
+syslog_release:
+	$(MAKE) -C syslog release
 syslog_examples:
 syslog_examples:
 	$(MAKE) -C syslog examples
 	$(MAKE) -C syslog examples
 syslog_shared:
 syslog_shared:
@@ -1293,15 +1308,11 @@ syslog_cleanall:
 	$(MAKE) -C syslog cleanall
 	$(MAKE) -C syslog cleanall
 syslog_info:
 syslog_info:
 	$(MAKE) -C syslog info
 	$(MAKE) -C syslog info
-syslog_makefile:
-	$(MAKE) -C syslog makefile
 syslog_makefiles:
 syslog_makefiles:
 	$(MAKE) -C syslog makefiles
 	$(MAKE) -C syslog makefiles
-syslog_makefile_dirs:
-	$(MAKE) -C syslog makefile_dirs
 syslog:
 syslog:
 	$(MAKE) -C syslog all
 	$(MAKE) -C syslog all
-.PHONY: syslog_all syslog_debug syslog_smart syslog_examples syslog_shared syslog_install syslog_sourceinstall syslog_exampleinstall syslog_distinstall syslog_zipinstall syslog_zipsourceinstall syslog_zipexampleinstall syslog_zipdistinstall syslog_clean syslog_distclean syslog_cleanall syslog_info syslog_makefile syslog_makefiles syslog_makefile_dirs syslog
+.PHONY: syslog_all syslog_debug syslog_smart syslog_release syslog_examples syslog_shared syslog_install syslog_sourceinstall syslog_exampleinstall syslog_distinstall syslog_zipinstall syslog_zipsourceinstall syslog_zipexampleinstall syslog_zipdistinstall syslog_clean syslog_distclean syslog_cleanall syslog_info syslog_makefiles syslog
 endif
 endif
 ifdef TARGET_DIRS_INET
 ifdef TARGET_DIRS_INET
 inet_all:
 inet_all:
@@ -1310,6 +1321,8 @@ inet_debug:
 	$(MAKE) -C inet debug
 	$(MAKE) -C inet debug
 inet_smart:
 inet_smart:
 	$(MAKE) -C inet smart
 	$(MAKE) -C inet smart
+inet_release:
+	$(MAKE) -C inet release
 inet_examples:
 inet_examples:
 	$(MAKE) -C inet examples
 	$(MAKE) -C inet examples
 inet_shared:
 inet_shared:
@@ -1338,15 +1351,11 @@ inet_cleanall:
 	$(MAKE) -C inet cleanall
 	$(MAKE) -C inet cleanall
 inet_info:
 inet_info:
 	$(MAKE) -C inet info
 	$(MAKE) -C inet info
-inet_makefile:
-	$(MAKE) -C inet makefile
 inet_makefiles:
 inet_makefiles:
 	$(MAKE) -C inet makefiles
 	$(MAKE) -C inet makefiles
-inet_makefile_dirs:
-	$(MAKE) -C inet makefile_dirs
 inet:
 inet:
 	$(MAKE) -C inet all
 	$(MAKE) -C inet all
-.PHONY: inet_all inet_debug inet_smart inet_examples inet_shared inet_install inet_sourceinstall inet_exampleinstall inet_distinstall inet_zipinstall inet_zipsourceinstall inet_zipexampleinstall inet_zipdistinstall inet_clean inet_distclean inet_cleanall inet_info inet_makefile inet_makefiles inet_makefile_dirs inet
+.PHONY: inet_all inet_debug inet_smart inet_release inet_examples inet_shared inet_install inet_sourceinstall inet_exampleinstall inet_distinstall inet_zipinstall inet_zipsourceinstall inet_zipexampleinstall inet_zipdistinstall inet_clean inet_distclean inet_cleanall inet_info inet_makefiles inet
 endif
 endif
 ifdef TARGET_DIRS_UNCGI
 ifdef TARGET_DIRS_UNCGI
 uncgi_all:
 uncgi_all:
@@ -1355,6 +1364,8 @@ uncgi_debug:
 	$(MAKE) -C uncgi debug
 	$(MAKE) -C uncgi debug
 uncgi_smart:
 uncgi_smart:
 	$(MAKE) -C uncgi smart
 	$(MAKE) -C uncgi smart
+uncgi_release:
+	$(MAKE) -C uncgi release
 uncgi_examples:
 uncgi_examples:
 	$(MAKE) -C uncgi examples
 	$(MAKE) -C uncgi examples
 uncgi_shared:
 uncgi_shared:
@@ -1383,15 +1394,11 @@ uncgi_cleanall:
 	$(MAKE) -C uncgi cleanall
 	$(MAKE) -C uncgi cleanall
 uncgi_info:
 uncgi_info:
 	$(MAKE) -C uncgi info
 	$(MAKE) -C uncgi info
-uncgi_makefile:
-	$(MAKE) -C uncgi makefile
 uncgi_makefiles:
 uncgi_makefiles:
 	$(MAKE) -C uncgi makefiles
 	$(MAKE) -C uncgi makefiles
-uncgi_makefile_dirs:
-	$(MAKE) -C uncgi makefile_dirs
 uncgi:
 uncgi:
 	$(MAKE) -C uncgi all
 	$(MAKE) -C uncgi all
-.PHONY: uncgi_all uncgi_debug uncgi_smart uncgi_examples uncgi_shared uncgi_install uncgi_sourceinstall uncgi_exampleinstall uncgi_distinstall uncgi_zipinstall uncgi_zipsourceinstall uncgi_zipexampleinstall uncgi_zipdistinstall uncgi_clean uncgi_distclean uncgi_cleanall uncgi_info uncgi_makefile uncgi_makefiles uncgi_makefile_dirs uncgi
+.PHONY: uncgi_all uncgi_debug uncgi_smart uncgi_release uncgi_examples uncgi_shared uncgi_install uncgi_sourceinstall uncgi_exampleinstall uncgi_distinstall uncgi_zipinstall uncgi_zipsourceinstall uncgi_zipexampleinstall uncgi_zipdistinstall uncgi_clean uncgi_distclean uncgi_cleanall uncgi_info uncgi_makefiles uncgi
 endif
 endif
 ifdef TARGET_DIRS_MYSQL
 ifdef TARGET_DIRS_MYSQL
 mysql_all:
 mysql_all:
@@ -1400,6 +1407,8 @@ mysql_debug:
 	$(MAKE) -C mysql debug
 	$(MAKE) -C mysql debug
 mysql_smart:
 mysql_smart:
 	$(MAKE) -C mysql smart
 	$(MAKE) -C mysql smart
+mysql_release:
+	$(MAKE) -C mysql release
 mysql_examples:
 mysql_examples:
 	$(MAKE) -C mysql examples
 	$(MAKE) -C mysql examples
 mysql_shared:
 mysql_shared:
@@ -1428,15 +1437,11 @@ mysql_cleanall:
 	$(MAKE) -C mysql cleanall
 	$(MAKE) -C mysql cleanall
 mysql_info:
 mysql_info:
 	$(MAKE) -C mysql info
 	$(MAKE) -C mysql info
-mysql_makefile:
-	$(MAKE) -C mysql makefile
 mysql_makefiles:
 mysql_makefiles:
 	$(MAKE) -C mysql makefiles
 	$(MAKE) -C mysql makefiles
-mysql_makefile_dirs:
-	$(MAKE) -C mysql makefile_dirs
 mysql:
 mysql:
 	$(MAKE) -C mysql all
 	$(MAKE) -C mysql all
-.PHONY: mysql_all mysql_debug mysql_smart mysql_examples mysql_shared mysql_install mysql_sourceinstall mysql_exampleinstall mysql_distinstall mysql_zipinstall mysql_zipsourceinstall mysql_zipexampleinstall mysql_zipdistinstall mysql_clean mysql_distclean mysql_cleanall mysql_info mysql_makefile mysql_makefiles mysql_makefile_dirs mysql
+.PHONY: mysql_all mysql_debug mysql_smart mysql_release mysql_examples mysql_shared mysql_install mysql_sourceinstall mysql_exampleinstall mysql_distinstall mysql_zipinstall mysql_zipsourceinstall mysql_zipexampleinstall mysql_zipdistinstall mysql_clean mysql_distclean mysql_cleanall mysql_info mysql_makefiles mysql
 endif
 endif
 ifdef TARGET_DIRS_IBASE
 ifdef TARGET_DIRS_IBASE
 ibase_all:
 ibase_all:
@@ -1445,6 +1450,8 @@ ibase_debug:
 	$(MAKE) -C ibase debug
 	$(MAKE) -C ibase debug
 ibase_smart:
 ibase_smart:
 	$(MAKE) -C ibase smart
 	$(MAKE) -C ibase smart
+ibase_release:
+	$(MAKE) -C ibase release
 ibase_examples:
 ibase_examples:
 	$(MAKE) -C ibase examples
 	$(MAKE) -C ibase examples
 ibase_shared:
 ibase_shared:
@@ -1473,15 +1480,11 @@ ibase_cleanall:
 	$(MAKE) -C ibase cleanall
 	$(MAKE) -C ibase cleanall
 ibase_info:
 ibase_info:
 	$(MAKE) -C ibase info
 	$(MAKE) -C ibase info
-ibase_makefile:
-	$(MAKE) -C ibase makefile
 ibase_makefiles:
 ibase_makefiles:
 	$(MAKE) -C ibase makefiles
 	$(MAKE) -C ibase makefiles
-ibase_makefile_dirs:
-	$(MAKE) -C ibase makefile_dirs
 ibase:
 ibase:
 	$(MAKE) -C ibase all
 	$(MAKE) -C ibase all
-.PHONY: ibase_all ibase_debug ibase_smart ibase_examples ibase_shared ibase_install ibase_sourceinstall ibase_exampleinstall ibase_distinstall ibase_zipinstall ibase_zipsourceinstall ibase_zipexampleinstall ibase_zipdistinstall ibase_clean ibase_distclean ibase_cleanall ibase_info ibase_makefile ibase_makefiles ibase_makefile_dirs ibase
+.PHONY: ibase_all ibase_debug ibase_smart ibase_release ibase_examples ibase_shared ibase_install ibase_sourceinstall ibase_exampleinstall ibase_distinstall ibase_zipinstall ibase_zipsourceinstall ibase_zipexampleinstall ibase_zipdistinstall ibase_clean ibase_distclean ibase_cleanall ibase_info ibase_makefiles ibase
 endif
 endif
 ifdef TARGET_DIRS_POSTGRES
 ifdef TARGET_DIRS_POSTGRES
 postgres_all:
 postgres_all:
@@ -1490,6 +1493,8 @@ postgres_debug:
 	$(MAKE) -C postgres debug
 	$(MAKE) -C postgres debug
 postgres_smart:
 postgres_smart:
 	$(MAKE) -C postgres smart
 	$(MAKE) -C postgres smart
+postgres_release:
+	$(MAKE) -C postgres release
 postgres_examples:
 postgres_examples:
 	$(MAKE) -C postgres examples
 	$(MAKE) -C postgres examples
 postgres_shared:
 postgres_shared:
@@ -1518,15 +1523,11 @@ postgres_cleanall:
 	$(MAKE) -C postgres cleanall
 	$(MAKE) -C postgres cleanall
 postgres_info:
 postgres_info:
 	$(MAKE) -C postgres info
 	$(MAKE) -C postgres info
-postgres_makefile:
-	$(MAKE) -C postgres makefile
 postgres_makefiles:
 postgres_makefiles:
 	$(MAKE) -C postgres makefiles
 	$(MAKE) -C postgres makefiles
-postgres_makefile_dirs:
-	$(MAKE) -C postgres makefile_dirs
 postgres:
 postgres:
 	$(MAKE) -C postgres all
 	$(MAKE) -C postgres all
-.PHONY: postgres_all postgres_debug postgres_smart postgres_examples postgres_shared postgres_install postgres_sourceinstall postgres_exampleinstall postgres_distinstall postgres_zipinstall postgres_zipsourceinstall postgres_zipexampleinstall postgres_zipdistinstall postgres_clean postgres_distclean postgres_cleanall postgres_info postgres_makefile postgres_makefiles postgres_makefile_dirs postgres
+.PHONY: postgres_all postgres_debug postgres_smart postgres_release postgres_examples postgres_shared postgres_install postgres_sourceinstall postgres_exampleinstall postgres_distinstall postgres_zipinstall postgres_zipsourceinstall postgres_zipexampleinstall postgres_zipdistinstall postgres_clean postgres_distclean postgres_cleanall postgres_info postgres_makefiles postgres
 endif
 endif
 ifdef TARGET_DIRS_ORACLE
 ifdef TARGET_DIRS_ORACLE
 oracle_all:
 oracle_all:
@@ -1535,6 +1536,8 @@ oracle_debug:
 	$(MAKE) -C oracle debug
 	$(MAKE) -C oracle debug
 oracle_smart:
 oracle_smart:
 	$(MAKE) -C oracle smart
 	$(MAKE) -C oracle smart
+oracle_release:
+	$(MAKE) -C oracle release
 oracle_examples:
 oracle_examples:
 	$(MAKE) -C oracle examples
 	$(MAKE) -C oracle examples
 oracle_shared:
 oracle_shared:
@@ -1563,15 +1566,11 @@ oracle_cleanall:
 	$(MAKE) -C oracle cleanall
 	$(MAKE) -C oracle cleanall
 oracle_info:
 oracle_info:
 	$(MAKE) -C oracle info
 	$(MAKE) -C oracle info
-oracle_makefile:
-	$(MAKE) -C oracle makefile
 oracle_makefiles:
 oracle_makefiles:
 	$(MAKE) -C oracle makefiles
 	$(MAKE) -C oracle makefiles
-oracle_makefile_dirs:
-	$(MAKE) -C oracle makefile_dirs
 oracle:
 oracle:
 	$(MAKE) -C oracle all
 	$(MAKE) -C oracle all
-.PHONY: oracle_all oracle_debug oracle_smart oracle_examples oracle_shared oracle_install oracle_sourceinstall oracle_exampleinstall oracle_distinstall oracle_zipinstall oracle_zipsourceinstall oracle_zipexampleinstall oracle_zipdistinstall oracle_clean oracle_distclean oracle_cleanall oracle_info oracle_makefile oracle_makefiles oracle_makefile_dirs oracle
+.PHONY: oracle_all oracle_debug oracle_smart oracle_release oracle_examples oracle_shared oracle_install oracle_sourceinstall oracle_exampleinstall oracle_distinstall oracle_zipinstall oracle_zipsourceinstall oracle_zipexampleinstall oracle_zipdistinstall oracle_clean oracle_distclean oracle_cleanall oracle_info oracle_makefiles oracle
 endif
 endif
 ifdef TARGET_DIRS_OPENGL
 ifdef TARGET_DIRS_OPENGL
 opengl_all:
 opengl_all:
@@ -1580,6 +1579,8 @@ opengl_debug:
 	$(MAKE) -C opengl debug
 	$(MAKE) -C opengl debug
 opengl_smart:
 opengl_smart:
 	$(MAKE) -C opengl smart
 	$(MAKE) -C opengl smart
+opengl_release:
+	$(MAKE) -C opengl release
 opengl_examples:
 opengl_examples:
 	$(MAKE) -C opengl examples
 	$(MAKE) -C opengl examples
 opengl_shared:
 opengl_shared:
@@ -1608,15 +1609,11 @@ opengl_cleanall:
 	$(MAKE) -C opengl cleanall
 	$(MAKE) -C opengl cleanall
 opengl_info:
 opengl_info:
 	$(MAKE) -C opengl info
 	$(MAKE) -C opengl info
-opengl_makefile:
-	$(MAKE) -C opengl makefile
 opengl_makefiles:
 opengl_makefiles:
 	$(MAKE) -C opengl makefiles
 	$(MAKE) -C opengl makefiles
-opengl_makefile_dirs:
-	$(MAKE) -C opengl makefile_dirs
 opengl:
 opengl:
 	$(MAKE) -C opengl all
 	$(MAKE) -C opengl all
-.PHONY: opengl_all opengl_debug opengl_smart opengl_examples opengl_shared opengl_install opengl_sourceinstall opengl_exampleinstall opengl_distinstall opengl_zipinstall opengl_zipsourceinstall opengl_zipexampleinstall opengl_zipdistinstall opengl_clean opengl_distclean opengl_cleanall opengl_info opengl_makefile opengl_makefiles opengl_makefile_dirs opengl
+.PHONY: opengl_all opengl_debug opengl_smart opengl_release opengl_examples opengl_shared opengl_install opengl_sourceinstall opengl_exampleinstall opengl_distinstall opengl_zipinstall opengl_zipsourceinstall opengl_zipexampleinstall opengl_zipdistinstall opengl_clean opengl_distclean opengl_cleanall opengl_info opengl_makefiles opengl
 endif
 endif
 ifdef TARGET_DIRS_FORMS
 ifdef TARGET_DIRS_FORMS
 forms_all:
 forms_all:
@@ -1625,6 +1622,8 @@ forms_debug:
 	$(MAKE) -C forms debug
 	$(MAKE) -C forms debug
 forms_smart:
 forms_smart:
 	$(MAKE) -C forms smart
 	$(MAKE) -C forms smart
+forms_release:
+	$(MAKE) -C forms release
 forms_examples:
 forms_examples:
 	$(MAKE) -C forms examples
 	$(MAKE) -C forms examples
 forms_shared:
 forms_shared:
@@ -1653,15 +1652,11 @@ forms_cleanall:
 	$(MAKE) -C forms cleanall
 	$(MAKE) -C forms cleanall
 forms_info:
 forms_info:
 	$(MAKE) -C forms info
 	$(MAKE) -C forms info
-forms_makefile:
-	$(MAKE) -C forms makefile
 forms_makefiles:
 forms_makefiles:
 	$(MAKE) -C forms makefiles
 	$(MAKE) -C forms makefiles
-forms_makefile_dirs:
-	$(MAKE) -C forms makefile_dirs
 forms:
 forms:
 	$(MAKE) -C forms all
 	$(MAKE) -C forms all
-.PHONY: forms_all forms_debug forms_smart forms_examples forms_shared forms_install forms_sourceinstall forms_exampleinstall forms_distinstall forms_zipinstall forms_zipsourceinstall forms_zipexampleinstall forms_zipdistinstall forms_clean forms_distclean forms_cleanall forms_info forms_makefile forms_makefiles forms_makefile_dirs forms
+.PHONY: forms_all forms_debug forms_smart forms_release forms_examples forms_shared forms_install forms_sourceinstall forms_exampleinstall forms_distinstall forms_zipinstall forms_zipsourceinstall forms_zipexampleinstall forms_zipdistinstall forms_clean forms_distclean forms_cleanall forms_info forms_makefiles forms
 endif
 endif
 ifdef TARGET_DIRS_SVGALIB
 ifdef TARGET_DIRS_SVGALIB
 svgalib_all:
 svgalib_all:
@@ -1670,6 +1665,8 @@ svgalib_debug:
 	$(MAKE) -C svgalib debug
 	$(MAKE) -C svgalib debug
 svgalib_smart:
 svgalib_smart:
 	$(MAKE) -C svgalib smart
 	$(MAKE) -C svgalib smart
+svgalib_release:
+	$(MAKE) -C svgalib release
 svgalib_examples:
 svgalib_examples:
 	$(MAKE) -C svgalib examples
 	$(MAKE) -C svgalib examples
 svgalib_shared:
 svgalib_shared:
@@ -1698,15 +1695,11 @@ svgalib_cleanall:
 	$(MAKE) -C svgalib cleanall
 	$(MAKE) -C svgalib cleanall
 svgalib_info:
 svgalib_info:
 	$(MAKE) -C svgalib info
 	$(MAKE) -C svgalib info
-svgalib_makefile:
-	$(MAKE) -C svgalib makefile
 svgalib_makefiles:
 svgalib_makefiles:
 	$(MAKE) -C svgalib makefiles
 	$(MAKE) -C svgalib makefiles
-svgalib_makefile_dirs:
-	$(MAKE) -C svgalib makefile_dirs
 svgalib:
 svgalib:
 	$(MAKE) -C svgalib all
 	$(MAKE) -C svgalib all
-.PHONY: svgalib_all svgalib_debug svgalib_smart svgalib_examples svgalib_shared svgalib_install svgalib_sourceinstall svgalib_exampleinstall svgalib_distinstall svgalib_zipinstall svgalib_zipsourceinstall svgalib_zipexampleinstall svgalib_zipdistinstall svgalib_clean svgalib_distclean svgalib_cleanall svgalib_info svgalib_makefile svgalib_makefiles svgalib_makefile_dirs svgalib
+.PHONY: svgalib_all svgalib_debug svgalib_smart svgalib_release svgalib_examples svgalib_shared svgalib_install svgalib_sourceinstall svgalib_exampleinstall svgalib_distinstall svgalib_zipinstall svgalib_zipsourceinstall svgalib_zipexampleinstall svgalib_zipdistinstall svgalib_clean svgalib_distclean svgalib_cleanall svgalib_info svgalib_makefiles svgalib
 endif
 endif
 ifdef TARGET_DIRS_GGI
 ifdef TARGET_DIRS_GGI
 ggi_all:
 ggi_all:
@@ -1715,6 +1708,8 @@ ggi_debug:
 	$(MAKE) -C ggi debug
 	$(MAKE) -C ggi debug
 ggi_smart:
 ggi_smart:
 	$(MAKE) -C ggi smart
 	$(MAKE) -C ggi smart
+ggi_release:
+	$(MAKE) -C ggi release
 ggi_examples:
 ggi_examples:
 	$(MAKE) -C ggi examples
 	$(MAKE) -C ggi examples
 ggi_shared:
 ggi_shared:
@@ -1743,15 +1738,11 @@ ggi_cleanall:
 	$(MAKE) -C ggi cleanall
 	$(MAKE) -C ggi cleanall
 ggi_info:
 ggi_info:
 	$(MAKE) -C ggi info
 	$(MAKE) -C ggi info
-ggi_makefile:
-	$(MAKE) -C ggi makefile
 ggi_makefiles:
 ggi_makefiles:
 	$(MAKE) -C ggi makefiles
 	$(MAKE) -C ggi makefiles
-ggi_makefile_dirs:
-	$(MAKE) -C ggi makefile_dirs
 ggi:
 ggi:
 	$(MAKE) -C ggi all
 	$(MAKE) -C ggi all
-.PHONY: ggi_all ggi_debug ggi_smart ggi_examples ggi_shared ggi_install ggi_sourceinstall ggi_exampleinstall ggi_distinstall ggi_zipinstall ggi_zipsourceinstall ggi_zipexampleinstall ggi_zipdistinstall ggi_clean ggi_distclean ggi_cleanall ggi_info ggi_makefile ggi_makefiles ggi_makefile_dirs ggi
+.PHONY: ggi_all ggi_debug ggi_smart ggi_release ggi_examples ggi_shared ggi_install ggi_sourceinstall ggi_exampleinstall ggi_distinstall ggi_zipinstall ggi_zipsourceinstall ggi_zipexampleinstall ggi_zipdistinstall ggi_clean ggi_distclean ggi_cleanall ggi_info ggi_makefiles ggi
 endif
 endif
 ifdef TARGET_DIRS_LIBPNG
 ifdef TARGET_DIRS_LIBPNG
 libpng_all:
 libpng_all:
@@ -1760,6 +1751,8 @@ libpng_debug:
 	$(MAKE) -C libpng debug
 	$(MAKE) -C libpng debug
 libpng_smart:
 libpng_smart:
 	$(MAKE) -C libpng smart
 	$(MAKE) -C libpng smart
+libpng_release:
+	$(MAKE) -C libpng release
 libpng_examples:
 libpng_examples:
 	$(MAKE) -C libpng examples
 	$(MAKE) -C libpng examples
 libpng_shared:
 libpng_shared:
@@ -1788,15 +1781,11 @@ libpng_cleanall:
 	$(MAKE) -C libpng cleanall
 	$(MAKE) -C libpng cleanall
 libpng_info:
 libpng_info:
 	$(MAKE) -C libpng info
 	$(MAKE) -C libpng info
-libpng_makefile:
-	$(MAKE) -C libpng makefile
 libpng_makefiles:
 libpng_makefiles:
 	$(MAKE) -C libpng makefiles
 	$(MAKE) -C libpng makefiles
-libpng_makefile_dirs:
-	$(MAKE) -C libpng makefile_dirs
 libpng:
 libpng:
 	$(MAKE) -C libpng all
 	$(MAKE) -C libpng all
-.PHONY: libpng_all libpng_debug libpng_smart libpng_examples libpng_shared libpng_install libpng_sourceinstall libpng_exampleinstall libpng_distinstall libpng_zipinstall libpng_zipsourceinstall libpng_zipexampleinstall libpng_zipdistinstall libpng_clean libpng_distclean libpng_cleanall libpng_info libpng_makefile libpng_makefiles libpng_makefile_dirs libpng
+.PHONY: libpng_all libpng_debug libpng_smart libpng_release libpng_examples libpng_shared libpng_install libpng_sourceinstall libpng_exampleinstall libpng_distinstall libpng_zipinstall libpng_zipsourceinstall libpng_zipexampleinstall libpng_zipdistinstall libpng_clean libpng_distclean libpng_cleanall libpng_info libpng_makefiles libpng
 endif
 endif
 ifdef TARGET_DIRS_LIBGD
 ifdef TARGET_DIRS_LIBGD
 libgd_all:
 libgd_all:
@@ -1805,6 +1794,8 @@ libgd_debug:
 	$(MAKE) -C libgd debug
 	$(MAKE) -C libgd debug
 libgd_smart:
 libgd_smart:
 	$(MAKE) -C libgd smart
 	$(MAKE) -C libgd smart
+libgd_release:
+	$(MAKE) -C libgd release
 libgd_examples:
 libgd_examples:
 	$(MAKE) -C libgd examples
 	$(MAKE) -C libgd examples
 libgd_shared:
 libgd_shared:
@@ -1833,15 +1824,11 @@ libgd_cleanall:
 	$(MAKE) -C libgd cleanall
 	$(MAKE) -C libgd cleanall
 libgd_info:
 libgd_info:
 	$(MAKE) -C libgd info
 	$(MAKE) -C libgd info
-libgd_makefile:
-	$(MAKE) -C libgd makefile
 libgd_makefiles:
 libgd_makefiles:
 	$(MAKE) -C libgd makefiles
 	$(MAKE) -C libgd makefiles
-libgd_makefile_dirs:
-	$(MAKE) -C libgd makefile_dirs
 libgd:
 libgd:
 	$(MAKE) -C libgd all
 	$(MAKE) -C libgd all
-.PHONY: libgd_all libgd_debug libgd_smart libgd_examples libgd_shared libgd_install libgd_sourceinstall libgd_exampleinstall libgd_distinstall libgd_zipinstall libgd_zipsourceinstall libgd_zipexampleinstall libgd_zipdistinstall libgd_clean libgd_distclean libgd_cleanall libgd_info libgd_makefile libgd_makefiles libgd_makefile_dirs libgd
+.PHONY: libgd_all libgd_debug libgd_smart libgd_release libgd_examples libgd_shared libgd_install libgd_sourceinstall libgd_exampleinstall libgd_distinstall libgd_zipinstall libgd_zipsourceinstall libgd_zipexampleinstall libgd_zipdistinstall libgd_clean libgd_distclean libgd_cleanall libgd_info libgd_makefiles libgd
 endif
 endif
 ifdef TARGET_DIRS_UTMP
 ifdef TARGET_DIRS_UTMP
 utmp_all:
 utmp_all:
@@ -1850,6 +1837,8 @@ utmp_debug:
 	$(MAKE) -C utmp debug
 	$(MAKE) -C utmp debug
 utmp_smart:
 utmp_smart:
 	$(MAKE) -C utmp smart
 	$(MAKE) -C utmp smart
+utmp_release:
+	$(MAKE) -C utmp release
 utmp_examples:
 utmp_examples:
 	$(MAKE) -C utmp examples
 	$(MAKE) -C utmp examples
 utmp_shared:
 utmp_shared:
@@ -1878,15 +1867,11 @@ utmp_cleanall:
 	$(MAKE) -C utmp cleanall
 	$(MAKE) -C utmp cleanall
 utmp_info:
 utmp_info:
 	$(MAKE) -C utmp info
 	$(MAKE) -C utmp info
-utmp_makefile:
-	$(MAKE) -C utmp makefile
 utmp_makefiles:
 utmp_makefiles:
 	$(MAKE) -C utmp makefiles
 	$(MAKE) -C utmp makefiles
-utmp_makefile_dirs:
-	$(MAKE) -C utmp makefile_dirs
 utmp:
 utmp:
 	$(MAKE) -C utmp all
 	$(MAKE) -C utmp all
-.PHONY: utmp_all utmp_debug utmp_smart utmp_examples utmp_shared utmp_install utmp_sourceinstall utmp_exampleinstall utmp_distinstall utmp_zipinstall utmp_zipsourceinstall utmp_zipexampleinstall utmp_zipdistinstall utmp_clean utmp_distclean utmp_cleanall utmp_info utmp_makefile utmp_makefiles utmp_makefile_dirs utmp
+.PHONY: utmp_all utmp_debug utmp_smart utmp_release utmp_examples utmp_shared utmp_install utmp_sourceinstall utmp_exampleinstall utmp_distinstall utmp_zipinstall utmp_zipsourceinstall utmp_zipexampleinstall utmp_zipdistinstall utmp_clean utmp_distclean utmp_cleanall utmp_info utmp_makefiles utmp
 endif
 endif
 ifdef TARGET_DIRS_PASZLIB
 ifdef TARGET_DIRS_PASZLIB
 paszlib_all:
 paszlib_all:
@@ -1895,6 +1880,8 @@ paszlib_debug:
 	$(MAKE) -C paszlib debug
 	$(MAKE) -C paszlib debug
 paszlib_smart:
 paszlib_smart:
 	$(MAKE) -C paszlib smart
 	$(MAKE) -C paszlib smart
+paszlib_release:
+	$(MAKE) -C paszlib release
 paszlib_examples:
 paszlib_examples:
 	$(MAKE) -C paszlib examples
 	$(MAKE) -C paszlib examples
 paszlib_shared:
 paszlib_shared:
@@ -1923,15 +1910,11 @@ paszlib_cleanall:
 	$(MAKE) -C paszlib cleanall
 	$(MAKE) -C paszlib cleanall
 paszlib_info:
 paszlib_info:
 	$(MAKE) -C paszlib info
 	$(MAKE) -C paszlib info
-paszlib_makefile:
-	$(MAKE) -C paszlib makefile
 paszlib_makefiles:
 paszlib_makefiles:
 	$(MAKE) -C paszlib makefiles
 	$(MAKE) -C paszlib makefiles
-paszlib_makefile_dirs:
-	$(MAKE) -C paszlib makefile_dirs
 paszlib:
 paszlib:
 	$(MAKE) -C paszlib all
 	$(MAKE) -C paszlib all
-.PHONY: paszlib_all paszlib_debug paszlib_smart paszlib_examples paszlib_shared paszlib_install paszlib_sourceinstall paszlib_exampleinstall paszlib_distinstall paszlib_zipinstall paszlib_zipsourceinstall paszlib_zipexampleinstall paszlib_zipdistinstall paszlib_clean paszlib_distclean paszlib_cleanall paszlib_info paszlib_makefile paszlib_makefiles paszlib_makefile_dirs paszlib
+.PHONY: paszlib_all paszlib_debug paszlib_smart paszlib_release paszlib_examples paszlib_shared paszlib_install paszlib_sourceinstall paszlib_exampleinstall paszlib_distinstall paszlib_zipinstall paszlib_zipsourceinstall paszlib_zipexampleinstall paszlib_zipdistinstall paszlib_clean paszlib_distclean paszlib_cleanall paszlib_info paszlib_makefiles paszlib
 endif
 endif
 ifdef TARGET_DIRS_GDBINT
 ifdef TARGET_DIRS_GDBINT
 gdbint_all:
 gdbint_all:
@@ -1940,6 +1923,8 @@ gdbint_debug:
 	$(MAKE) -C gdbint debug
 	$(MAKE) -C gdbint debug
 gdbint_smart:
 gdbint_smart:
 	$(MAKE) -C gdbint smart
 	$(MAKE) -C gdbint smart
+gdbint_release:
+	$(MAKE) -C gdbint release
 gdbint_examples:
 gdbint_examples:
 	$(MAKE) -C gdbint examples
 	$(MAKE) -C gdbint examples
 gdbint_shared:
 gdbint_shared:
@@ -1968,15 +1953,11 @@ gdbint_cleanall:
 	$(MAKE) -C gdbint cleanall
 	$(MAKE) -C gdbint cleanall
 gdbint_info:
 gdbint_info:
 	$(MAKE) -C gdbint info
 	$(MAKE) -C gdbint info
-gdbint_makefile:
-	$(MAKE) -C gdbint makefile
 gdbint_makefiles:
 gdbint_makefiles:
 	$(MAKE) -C gdbint makefiles
 	$(MAKE) -C gdbint makefiles
-gdbint_makefile_dirs:
-	$(MAKE) -C gdbint makefile_dirs
 gdbint:
 gdbint:
 	$(MAKE) -C gdbint all
 	$(MAKE) -C gdbint all
-.PHONY: gdbint_all gdbint_debug gdbint_smart gdbint_examples gdbint_shared gdbint_install gdbint_sourceinstall gdbint_exampleinstall gdbint_distinstall gdbint_zipinstall gdbint_zipsourceinstall gdbint_zipexampleinstall gdbint_zipdistinstall gdbint_clean gdbint_distclean gdbint_cleanall gdbint_info gdbint_makefile gdbint_makefiles gdbint_makefile_dirs gdbint
+.PHONY: gdbint_all gdbint_debug gdbint_smart gdbint_release gdbint_examples gdbint_shared gdbint_install gdbint_sourceinstall gdbint_exampleinstall gdbint_distinstall gdbint_zipinstall gdbint_zipsourceinstall gdbint_zipexampleinstall gdbint_zipdistinstall gdbint_clean gdbint_distclean gdbint_cleanall gdbint_info gdbint_makefiles gdbint
 endif
 endif
 ifdef TARGET_DIRS_CMEM
 ifdef TARGET_DIRS_CMEM
 cmem_all:
 cmem_all:
@@ -1985,6 +1966,8 @@ cmem_debug:
 	$(MAKE) -C cmem debug
 	$(MAKE) -C cmem debug
 cmem_smart:
 cmem_smart:
 	$(MAKE) -C cmem smart
 	$(MAKE) -C cmem smart
+cmem_release:
+	$(MAKE) -C cmem release
 cmem_examples:
 cmem_examples:
 	$(MAKE) -C cmem examples
 	$(MAKE) -C cmem examples
 cmem_shared:
 cmem_shared:
@@ -2013,15 +1996,11 @@ cmem_cleanall:
 	$(MAKE) -C cmem cleanall
 	$(MAKE) -C cmem cleanall
 cmem_info:
 cmem_info:
 	$(MAKE) -C cmem info
 	$(MAKE) -C cmem info
-cmem_makefile:
-	$(MAKE) -C cmem makefile
 cmem_makefiles:
 cmem_makefiles:
 	$(MAKE) -C cmem makefiles
 	$(MAKE) -C cmem makefiles
-cmem_makefile_dirs:
-	$(MAKE) -C cmem makefile_dirs
 cmem:
 cmem:
 	$(MAKE) -C cmem all
 	$(MAKE) -C cmem all
-.PHONY: cmem_all cmem_debug cmem_smart cmem_examples cmem_shared cmem_install cmem_sourceinstall cmem_exampleinstall cmem_distinstall cmem_zipinstall cmem_zipsourceinstall cmem_zipexampleinstall cmem_zipdistinstall cmem_clean cmem_distclean cmem_cleanall cmem_info cmem_makefile cmem_makefiles cmem_makefile_dirs cmem
+.PHONY: cmem_all cmem_debug cmem_smart cmem_release cmem_examples cmem_shared cmem_install cmem_sourceinstall cmem_exampleinstall cmem_distinstall cmem_zipinstall cmem_zipsourceinstall cmem_zipexampleinstall cmem_zipdistinstall cmem_clean cmem_distclean cmem_cleanall cmem_info cmem_makefiles cmem
 endif
 endif
 ifdef TARGET_DIRS_REGEXPR
 ifdef TARGET_DIRS_REGEXPR
 regexpr_all:
 regexpr_all:
@@ -2030,6 +2009,8 @@ regexpr_debug:
 	$(MAKE) -C regexpr debug
 	$(MAKE) -C regexpr debug
 regexpr_smart:
 regexpr_smart:
 	$(MAKE) -C regexpr smart
 	$(MAKE) -C regexpr smart
+regexpr_release:
+	$(MAKE) -C regexpr release
 regexpr_examples:
 regexpr_examples:
 	$(MAKE) -C regexpr examples
 	$(MAKE) -C regexpr examples
 regexpr_shared:
 regexpr_shared:
@@ -2058,15 +2039,11 @@ regexpr_cleanall:
 	$(MAKE) -C regexpr cleanall
 	$(MAKE) -C regexpr cleanall
 regexpr_info:
 regexpr_info:
 	$(MAKE) -C regexpr info
 	$(MAKE) -C regexpr info
-regexpr_makefile:
-	$(MAKE) -C regexpr makefile
 regexpr_makefiles:
 regexpr_makefiles:
 	$(MAKE) -C regexpr makefiles
 	$(MAKE) -C regexpr makefiles
-regexpr_makefile_dirs:
-	$(MAKE) -C regexpr makefile_dirs
 regexpr:
 regexpr:
 	$(MAKE) -C regexpr all
 	$(MAKE) -C regexpr all
-.PHONY: regexpr_all regexpr_debug regexpr_smart regexpr_examples regexpr_shared regexpr_install regexpr_sourceinstall regexpr_exampleinstall regexpr_distinstall regexpr_zipinstall regexpr_zipsourceinstall regexpr_zipexampleinstall regexpr_zipdistinstall regexpr_clean regexpr_distclean regexpr_cleanall regexpr_info regexpr_makefile regexpr_makefiles regexpr_makefile_dirs regexpr
+.PHONY: regexpr_all regexpr_debug regexpr_smart regexpr_release regexpr_examples regexpr_shared regexpr_install regexpr_sourceinstall regexpr_exampleinstall regexpr_distinstall regexpr_zipinstall regexpr_zipsourceinstall regexpr_zipexampleinstall regexpr_zipdistinstall regexpr_clean regexpr_distclean regexpr_cleanall regexpr_info regexpr_makefiles regexpr
 endif
 endif
 ifdef TARGET_DIRS_UNZIP
 ifdef TARGET_DIRS_UNZIP
 unzip_all:
 unzip_all:
@@ -2075,6 +2052,8 @@ unzip_debug:
 	$(MAKE) -C unzip debug
 	$(MAKE) -C unzip debug
 unzip_smart:
 unzip_smart:
 	$(MAKE) -C unzip smart
 	$(MAKE) -C unzip smart
+unzip_release:
+	$(MAKE) -C unzip release
 unzip_examples:
 unzip_examples:
 	$(MAKE) -C unzip examples
 	$(MAKE) -C unzip examples
 unzip_shared:
 unzip_shared:
@@ -2103,15 +2082,11 @@ unzip_cleanall:
 	$(MAKE) -C unzip cleanall
 	$(MAKE) -C unzip cleanall
 unzip_info:
 unzip_info:
 	$(MAKE) -C unzip info
 	$(MAKE) -C unzip info
-unzip_makefile:
-	$(MAKE) -C unzip makefile
 unzip_makefiles:
 unzip_makefiles:
 	$(MAKE) -C unzip makefiles
 	$(MAKE) -C unzip makefiles
-unzip_makefile_dirs:
-	$(MAKE) -C unzip makefile_dirs
 unzip:
 unzip:
 	$(MAKE) -C unzip all
 	$(MAKE) -C unzip all
-.PHONY: unzip_all unzip_debug unzip_smart unzip_examples unzip_shared unzip_install unzip_sourceinstall unzip_exampleinstall unzip_distinstall unzip_zipinstall unzip_zipsourceinstall unzip_zipexampleinstall unzip_zipdistinstall unzip_clean unzip_distclean unzip_cleanall unzip_info unzip_makefile unzip_makefiles unzip_makefile_dirs unzip
+.PHONY: unzip_all unzip_debug unzip_smart unzip_release unzip_examples unzip_shared unzip_install unzip_sourceinstall unzip_exampleinstall unzip_distinstall unzip_zipinstall unzip_zipsourceinstall unzip_zipexampleinstall unzip_zipdistinstall unzip_clean unzip_distclean unzip_cleanall unzip_info unzip_makefiles unzip
 endif
 endif
 ifdef TARGET_DIRS_MMSYSTEM
 ifdef TARGET_DIRS_MMSYSTEM
 mmsystem_all:
 mmsystem_all:
@@ -2120,6 +2095,8 @@ mmsystem_debug:
 	$(MAKE) -C mmsystem debug
 	$(MAKE) -C mmsystem debug
 mmsystem_smart:
 mmsystem_smart:
 	$(MAKE) -C mmsystem smart
 	$(MAKE) -C mmsystem smart
+mmsystem_release:
+	$(MAKE) -C mmsystem release
 mmsystem_examples:
 mmsystem_examples:
 	$(MAKE) -C mmsystem examples
 	$(MAKE) -C mmsystem examples
 mmsystem_shared:
 mmsystem_shared:
@@ -2148,15 +2125,11 @@ mmsystem_cleanall:
 	$(MAKE) -C mmsystem cleanall
 	$(MAKE) -C mmsystem cleanall
 mmsystem_info:
 mmsystem_info:
 	$(MAKE) -C mmsystem info
 	$(MAKE) -C mmsystem info
-mmsystem_makefile:
-	$(MAKE) -C mmsystem makefile
 mmsystem_makefiles:
 mmsystem_makefiles:
 	$(MAKE) -C mmsystem makefiles
 	$(MAKE) -C mmsystem makefiles
-mmsystem_makefile_dirs:
-	$(MAKE) -C mmsystem makefile_dirs
 mmsystem:
 mmsystem:
 	$(MAKE) -C mmsystem all
 	$(MAKE) -C mmsystem all
-.PHONY: mmsystem_all mmsystem_debug mmsystem_smart mmsystem_examples mmsystem_shared mmsystem_install mmsystem_sourceinstall mmsystem_exampleinstall mmsystem_distinstall mmsystem_zipinstall mmsystem_zipsourceinstall mmsystem_zipexampleinstall mmsystem_zipdistinstall mmsystem_clean mmsystem_distclean mmsystem_cleanall mmsystem_info mmsystem_makefile mmsystem_makefiles mmsystem_makefile_dirs mmsystem
+.PHONY: mmsystem_all mmsystem_debug mmsystem_smart mmsystem_release mmsystem_examples mmsystem_shared mmsystem_install mmsystem_sourceinstall mmsystem_exampleinstall mmsystem_distinstall mmsystem_zipinstall mmsystem_zipsourceinstall mmsystem_zipexampleinstall mmsystem_zipdistinstall mmsystem_clean mmsystem_distclean mmsystem_cleanall mmsystem_info mmsystem_makefiles mmsystem
 endif
 endif
 ifdef TARGET_DIRS_ASYNCIO
 ifdef TARGET_DIRS_ASYNCIO
 asyncio_all:
 asyncio_all:
@@ -2165,6 +2138,8 @@ asyncio_debug:
 	$(MAKE) -C asyncio debug
 	$(MAKE) -C asyncio debug
 asyncio_smart:
 asyncio_smart:
 	$(MAKE) -C asyncio smart
 	$(MAKE) -C asyncio smart
+asyncio_release:
+	$(MAKE) -C asyncio release
 asyncio_examples:
 asyncio_examples:
 	$(MAKE) -C asyncio examples
 	$(MAKE) -C asyncio examples
 asyncio_shared:
 asyncio_shared:
@@ -2193,15 +2168,11 @@ asyncio_cleanall:
 	$(MAKE) -C asyncio cleanall
 	$(MAKE) -C asyncio cleanall
 asyncio_info:
 asyncio_info:
 	$(MAKE) -C asyncio info
 	$(MAKE) -C asyncio info
-asyncio_makefile:
-	$(MAKE) -C asyncio makefile
 asyncio_makefiles:
 asyncio_makefiles:
 	$(MAKE) -C asyncio makefiles
 	$(MAKE) -C asyncio makefiles
-asyncio_makefile_dirs:
-	$(MAKE) -C asyncio makefile_dirs
 asyncio:
 asyncio:
 	$(MAKE) -C asyncio all
 	$(MAKE) -C asyncio all
-.PHONY: asyncio_all asyncio_debug asyncio_smart asyncio_examples asyncio_shared asyncio_install asyncio_sourceinstall asyncio_exampleinstall asyncio_distinstall asyncio_zipinstall asyncio_zipsourceinstall asyncio_zipexampleinstall asyncio_zipdistinstall asyncio_clean asyncio_distclean asyncio_cleanall asyncio_info asyncio_makefile asyncio_makefiles asyncio_makefile_dirs asyncio
+.PHONY: asyncio_all asyncio_debug asyncio_smart asyncio_release asyncio_examples asyncio_shared asyncio_install asyncio_sourceinstall asyncio_exampleinstall asyncio_distinstall asyncio_zipinstall asyncio_zipsourceinstall asyncio_zipexampleinstall asyncio_zipdistinstall asyncio_clean asyncio_distclean asyncio_cleanall asyncio_info asyncio_makefiles asyncio
 endif
 endif
 ifdef TARGET_DIRS_BFD
 ifdef TARGET_DIRS_BFD
 bfd_all:
 bfd_all:
@@ -2210,6 +2181,8 @@ bfd_debug:
 	$(MAKE) -C bfd debug
 	$(MAKE) -C bfd debug
 bfd_smart:
 bfd_smart:
 	$(MAKE) -C bfd smart
 	$(MAKE) -C bfd smart
+bfd_release:
+	$(MAKE) -C bfd release
 bfd_examples:
 bfd_examples:
 	$(MAKE) -C bfd examples
 	$(MAKE) -C bfd examples
 bfd_shared:
 bfd_shared:
@@ -2238,15 +2211,11 @@ bfd_cleanall:
 	$(MAKE) -C bfd cleanall
 	$(MAKE) -C bfd cleanall
 bfd_info:
 bfd_info:
 	$(MAKE) -C bfd info
 	$(MAKE) -C bfd info
-bfd_makefile:
-	$(MAKE) -C bfd makefile
 bfd_makefiles:
 bfd_makefiles:
 	$(MAKE) -C bfd makefiles
 	$(MAKE) -C bfd makefiles
-bfd_makefile_dirs:
-	$(MAKE) -C bfd makefile_dirs
 bfd:
 bfd:
 	$(MAKE) -C bfd all
 	$(MAKE) -C bfd all
-.PHONY: bfd_all bfd_debug bfd_smart bfd_examples bfd_shared bfd_install bfd_sourceinstall bfd_exampleinstall bfd_distinstall bfd_zipinstall bfd_zipsourceinstall bfd_zipexampleinstall bfd_zipdistinstall bfd_clean bfd_distclean bfd_cleanall bfd_info bfd_makefile bfd_makefiles bfd_makefile_dirs bfd
+.PHONY: bfd_all bfd_debug bfd_smart bfd_release bfd_examples bfd_shared bfd_install bfd_sourceinstall bfd_exampleinstall bfd_distinstall bfd_zipinstall bfd_zipsourceinstall bfd_zipexampleinstall bfd_zipdistinstall bfd_clean bfd_distclean bfd_cleanall bfd_info bfd_makefiles bfd
 endif
 endif
 ifdef TARGET_DIRS_GDBM
 ifdef TARGET_DIRS_GDBM
 gdbm_all:
 gdbm_all:
@@ -2255,6 +2224,8 @@ gdbm_debug:
 	$(MAKE) -C gdbm debug
 	$(MAKE) -C gdbm debug
 gdbm_smart:
 gdbm_smart:
 	$(MAKE) -C gdbm smart
 	$(MAKE) -C gdbm smart
+gdbm_release:
+	$(MAKE) -C gdbm release
 gdbm_examples:
 gdbm_examples:
 	$(MAKE) -C gdbm examples
 	$(MAKE) -C gdbm examples
 gdbm_shared:
 gdbm_shared:
@@ -2283,19 +2254,16 @@ gdbm_cleanall:
 	$(MAKE) -C gdbm cleanall
 	$(MAKE) -C gdbm cleanall
 gdbm_info:
 gdbm_info:
 	$(MAKE) -C gdbm info
 	$(MAKE) -C gdbm info
-gdbm_makefile:
-	$(MAKE) -C gdbm makefile
 gdbm_makefiles:
 gdbm_makefiles:
 	$(MAKE) -C gdbm makefiles
 	$(MAKE) -C gdbm makefiles
-gdbm_makefile_dirs:
-	$(MAKE) -C gdbm makefile_dirs
 gdbm:
 gdbm:
 	$(MAKE) -C gdbm all
 	$(MAKE) -C gdbm all
-.PHONY: gdbm_all gdbm_debug gdbm_smart gdbm_examples gdbm_shared gdbm_install gdbm_sourceinstall gdbm_exampleinstall gdbm_distinstall gdbm_zipinstall gdbm_zipsourceinstall gdbm_zipexampleinstall gdbm_zipdistinstall gdbm_clean gdbm_distclean gdbm_cleanall gdbm_info gdbm_makefile gdbm_makefiles gdbm_makefile_dirs gdbm
+.PHONY: gdbm_all gdbm_debug gdbm_smart gdbm_release gdbm_examples gdbm_shared gdbm_install gdbm_sourceinstall gdbm_exampleinstall gdbm_distinstall gdbm_zipinstall gdbm_zipsourceinstall gdbm_zipexampleinstall gdbm_zipdistinstall gdbm_clean gdbm_distclean gdbm_cleanall gdbm_info gdbm_makefiles gdbm
 endif
 endif
 all: $(addsuffix _all,$(TARGET_DIRS))
 all: $(addsuffix _all,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
+release: $(addsuffix _release,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: $(addsuffix _install,$(TARGET_DIRS))
 install: $(addsuffix _install,$(TARGET_DIRS))
@@ -2310,10 +2278,8 @@ clean: $(addsuffix _clean,$(TARGET_DIRS))
 distclean: $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile $(addsuffix _makefile,$(TARGET_DIRS))
 makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS))
 makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS))
-makefile_dirs: fpc_makefile_dirs $(addsuffix _makefile_dirs,$(TARGET_DIRS))
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 40 - 24
packages/asyncio/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -93,23 +91,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -858,6 +877,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -925,13 +946,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -951,6 +972,8 @@ libasync_debug:
 	$(MAKE) -C libasync debug
 	$(MAKE) -C libasync debug
 libasync_smart:
 libasync_smart:
 	$(MAKE) -C libasync smart
 	$(MAKE) -C libasync smart
+libasync_release:
+	$(MAKE) -C libasync release
 libasync_examples:
 libasync_examples:
 	$(MAKE) -C libasync examples
 	$(MAKE) -C libasync examples
 libasync_shared:
 libasync_shared:
@@ -979,15 +1002,11 @@ libasync_cleanall:
 	$(MAKE) -C libasync cleanall
 	$(MAKE) -C libasync cleanall
 libasync_info:
 libasync_info:
 	$(MAKE) -C libasync info
 	$(MAKE) -C libasync info
-libasync_makefile:
-	$(MAKE) -C libasync makefile
 libasync_makefiles:
 libasync_makefiles:
 	$(MAKE) -C libasync makefiles
 	$(MAKE) -C libasync makefiles
-libasync_makefile_dirs:
-	$(MAKE) -C libasync makefile_dirs
 libasync:
 libasync:
 	$(MAKE) -C libasync all
 	$(MAKE) -C libasync all
-.PHONY: libasync_all libasync_debug libasync_smart libasync_examples libasync_shared libasync_install libasync_sourceinstall libasync_exampleinstall libasync_distinstall libasync_zipinstall libasync_zipsourceinstall libasync_zipexampleinstall libasync_zipdistinstall libasync_clean libasync_distclean libasync_cleanall libasync_info libasync_makefile libasync_makefiles libasync_makefile_dirs libasync
+.PHONY: libasync_all libasync_debug libasync_smart libasync_release libasync_examples libasync_shared libasync_install libasync_sourceinstall libasync_exampleinstall libasync_distinstall libasync_zipinstall libasync_zipsourceinstall libasync_zipexampleinstall libasync_zipdistinstall libasync_clean libasync_distclean libasync_cleanall libasync_info libasync_makefiles libasync
 endif
 endif
 ifdef TARGET_DIRS_FPASYNC
 ifdef TARGET_DIRS_FPASYNC
 fpasync_all:
 fpasync_all:
@@ -996,6 +1015,8 @@ fpasync_debug:
 	$(MAKE) -C fpasync debug
 	$(MAKE) -C fpasync debug
 fpasync_smart:
 fpasync_smart:
 	$(MAKE) -C fpasync smart
 	$(MAKE) -C fpasync smart
+fpasync_release:
+	$(MAKE) -C fpasync release
 fpasync_examples:
 fpasync_examples:
 	$(MAKE) -C fpasync examples
 	$(MAKE) -C fpasync examples
 fpasync_shared:
 fpasync_shared:
@@ -1024,19 +1045,16 @@ fpasync_cleanall:
 	$(MAKE) -C fpasync cleanall
 	$(MAKE) -C fpasync cleanall
 fpasync_info:
 fpasync_info:
 	$(MAKE) -C fpasync info
 	$(MAKE) -C fpasync info
-fpasync_makefile:
-	$(MAKE) -C fpasync makefile
 fpasync_makefiles:
 fpasync_makefiles:
 	$(MAKE) -C fpasync makefiles
 	$(MAKE) -C fpasync makefiles
-fpasync_makefile_dirs:
-	$(MAKE) -C fpasync makefile_dirs
 fpasync:
 fpasync:
 	$(MAKE) -C fpasync all
 	$(MAKE) -C fpasync all
-.PHONY: fpasync_all fpasync_debug fpasync_smart fpasync_examples fpasync_shared fpasync_install fpasync_sourceinstall fpasync_exampleinstall fpasync_distinstall fpasync_zipinstall fpasync_zipsourceinstall fpasync_zipexampleinstall fpasync_zipdistinstall fpasync_clean fpasync_distclean fpasync_cleanall fpasync_info fpasync_makefile fpasync_makefiles fpasync_makefile_dirs fpasync
+.PHONY: fpasync_all fpasync_debug fpasync_smart fpasync_release fpasync_examples fpasync_shared fpasync_install fpasync_sourceinstall fpasync_exampleinstall fpasync_distinstall fpasync_zipinstall fpasync_zipsourceinstall fpasync_zipexampleinstall fpasync_zipdistinstall fpasync_clean fpasync_distclean fpasync_cleanall fpasync_info fpasync_makefiles fpasync
 endif
 endif
 all: $(addsuffix _all,$(TARGET_DIRS))
 all: $(addsuffix _all,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
+release: $(addsuffix _release,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: $(addsuffix _install,$(TARGET_DIRS))
 install: $(addsuffix _install,$(TARGET_DIRS))
@@ -1051,10 +1069,8 @@ clean: $(addsuffix _clean,$(TARGET_DIRS))
 distclean: $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile $(addsuffix _makefile,$(TARGET_DIRS))
 makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS))
 makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS))
-makefile_dirs: fpc_makefile_dirs $(addsuffix _makefile_dirs,$(TARGET_DIRS))
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 35
packages/asyncio/fpasync/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -700,6 +719,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl rtl fcl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -767,9 +787,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -791,9 +808,6 @@ endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_PASZLIB),)
 ifneq ($(PACKAGEDIR_PASZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
-$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 else
 else
@@ -815,9 +829,6 @@ endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_INET),)
 ifneq ($(PACKAGEDIR_INET),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
-$(PACKAGEDIR_INET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_INET) all
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 else
 else
@@ -839,9 +850,6 @@ endif
 ifdef REQUIRE_PACKAGES_FCL
 ifdef REQUIRE_PACKAGES_FCL
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FCL),)
 ifneq ($(PACKAGEDIR_FCL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
-$(PACKAGEDIR_FCL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FCL) all
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 else
 else
@@ -863,9 +871,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -887,9 +892,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -1036,15 +1038,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1275,6 +1278,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1342,13 +1347,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1356,6 +1361,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1370,10 +1376,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/asyncio/libasync/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -685,6 +704,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl rtl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -721,9 +741,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -864,15 +881,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1103,6 +1121,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1170,13 +1190,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1184,6 +1204,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1198,10 +1219,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/cmem/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -872,15 +889,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1111,6 +1129,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1178,13 +1198,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1192,6 +1212,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1206,10 +1227,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 42 - 28
packages/forms/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -693,6 +712,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl x11
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_X11=1
 REQUIRE_PACKAGES_X11=1
@@ -740,9 +760,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -764,9 +781,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -940,15 +954,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1179,6 +1194,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1246,13 +1263,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1265,6 +1282,8 @@ demo_debug:
 	$(MAKE) -C demo debug
 	$(MAKE) -C demo debug
 demo_smart:
 demo_smart:
 	$(MAKE) -C demo smart
 	$(MAKE) -C demo smart
+demo_release:
+	$(MAKE) -C demo release
 demo_examples:
 demo_examples:
 	$(MAKE) -C demo examples
 	$(MAKE) -C demo examples
 demo_shared:
 demo_shared:
@@ -1293,19 +1312,16 @@ demo_cleanall:
 	$(MAKE) -C demo cleanall
 	$(MAKE) -C demo cleanall
 demo_info:
 demo_info:
 	$(MAKE) -C demo info
 	$(MAKE) -C demo info
-demo_makefile:
-	$(MAKE) -C demo makefile
 demo_makefiles:
 demo_makefiles:
 	$(MAKE) -C demo makefiles
 	$(MAKE) -C demo makefiles
-demo_makefile_dirs:
-	$(MAKE) -C demo makefile_dirs
 demo:
 demo:
 	$(MAKE) -C demo all
 	$(MAKE) -C demo all
-.PHONY: demo_all demo_debug demo_smart demo_examples demo_shared demo_install demo_sourceinstall demo_exampleinstall demo_distinstall demo_zipinstall demo_zipsourceinstall demo_zipexampleinstall demo_zipdistinstall demo_clean demo_distclean demo_cleanall demo_info demo_makefile demo_makefiles demo_makefile_dirs demo
+.PHONY: demo_all demo_debug demo_smart demo_release demo_examples demo_shared demo_install demo_sourceinstall demo_exampleinstall demo_distinstall demo_zipinstall demo_zipsourceinstall demo_zipexampleinstall demo_zipdistinstall demo_clean demo_distclean demo_cleanall demo_info demo_makefiles demo
 endif
 endif
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1320,10 +1336,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 26
packages/forms/demo/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -689,6 +708,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl forms
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_X11=1
 REQUIRE_PACKAGES_X11=1
@@ -747,9 +767,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -771,9 +788,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -795,9 +809,6 @@ endif
 ifdef REQUIRE_PACKAGES_FORMS
 ifdef REQUIRE_PACKAGES_FORMS
 PACKAGEDIR_FORMS:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /forms/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FORMS:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /forms/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FORMS),)
 ifneq ($(PACKAGEDIR_FORMS),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FORMS)/$(FPCMADE)
-$(PACKAGEDIR_FORMS)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FORMS) all
 ifneq ($(wildcard $(PACKAGEDIR_FORMS)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FORMS)/$(OS_TARGET)),)
 UNITDIR_FORMS=$(PACKAGEDIR_FORMS)/$(OS_TARGET)
 UNITDIR_FORMS=$(PACKAGEDIR_FORMS)/$(OS_TARGET)
 else
 else
@@ -947,15 +958,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1107,6 +1119,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1174,13 +1188,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1188,6 +1202,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1202,10 +1217,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/gdbint/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -694,6 +713,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -730,9 +750,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -894,15 +911,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1133,6 +1151,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1200,13 +1220,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1214,6 +1234,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1227,10 +1248,8 @@ zipdistinstall: fpc_zipdistinstall
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 34 - 14
packages/gdbint/libgdb/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -93,23 +91,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -852,6 +871,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -919,19 +940,20 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 debug:
 debug:
 smart:
 smart:
+release:
 examples:
 examples:
 shared:
 shared:
 install:
 install:
@@ -946,10 +968,8 @@ clean:
 distclean:
 distclean:
 cleanall:
 cleanall:
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/gdbm/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -872,15 +889,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1111,6 +1129,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1178,13 +1198,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1192,6 +1212,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1206,10 +1227,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/ggi/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1212,6 +1232,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1226,10 +1247,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 45 - 36
packages/gtk/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -695,6 +714,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_X11=1
 REQUIRE_PACKAGES_X11=1
@@ -745,9 +765,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -769,9 +786,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -793,9 +807,6 @@ endif
 ifdef REQUIRE_PACKAGES_OPENGL
 ifdef REQUIRE_PACKAGES_OPENGL
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_OPENGL),)
 ifneq ($(PACKAGEDIR_OPENGL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE)
-$(PACKAGEDIR_OPENGL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_OPENGL) all
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 else
 else
@@ -957,15 +968,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1196,6 +1208,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1263,13 +1277,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1282,6 +1296,8 @@ gtkgl_debug:
 	$(MAKE) -C gtkgl debug
 	$(MAKE) -C gtkgl debug
 gtkgl_smart:
 gtkgl_smart:
 	$(MAKE) -C gtkgl smart
 	$(MAKE) -C gtkgl smart
+gtkgl_release:
+	$(MAKE) -C gtkgl release
 gtkgl_examples:
 gtkgl_examples:
 	$(MAKE) -C gtkgl examples
 	$(MAKE) -C gtkgl examples
 gtkgl_shared:
 gtkgl_shared:
@@ -1310,15 +1326,11 @@ gtkgl_cleanall:
 	$(MAKE) -C gtkgl cleanall
 	$(MAKE) -C gtkgl cleanall
 gtkgl_info:
 gtkgl_info:
 	$(MAKE) -C gtkgl info
 	$(MAKE) -C gtkgl info
-gtkgl_makefile:
-	$(MAKE) -C gtkgl makefile
 gtkgl_makefiles:
 gtkgl_makefiles:
 	$(MAKE) -C gtkgl makefiles
 	$(MAKE) -C gtkgl makefiles
-gtkgl_makefile_dirs:
-	$(MAKE) -C gtkgl makefile_dirs
 gtkgl:
 gtkgl:
 	$(MAKE) -C gtkgl all
 	$(MAKE) -C gtkgl all
-.PHONY: gtkgl_all gtkgl_debug gtkgl_smart gtkgl_examples gtkgl_shared gtkgl_install gtkgl_sourceinstall gtkgl_exampleinstall gtkgl_distinstall gtkgl_zipinstall gtkgl_zipsourceinstall gtkgl_zipexampleinstall gtkgl_zipdistinstall gtkgl_clean gtkgl_distclean gtkgl_cleanall gtkgl_info gtkgl_makefile gtkgl_makefiles gtkgl_makefile_dirs gtkgl
+.PHONY: gtkgl_all gtkgl_debug gtkgl_smart gtkgl_release gtkgl_examples gtkgl_shared gtkgl_install gtkgl_sourceinstall gtkgl_exampleinstall gtkgl_distinstall gtkgl_zipinstall gtkgl_zipsourceinstall gtkgl_zipexampleinstall gtkgl_zipdistinstall gtkgl_clean gtkgl_distclean gtkgl_cleanall gtkgl_info gtkgl_makefiles gtkgl
 endif
 endif
 TARGET_EXAMPLEDIRS_EXAMPLES=1
 TARGET_EXAMPLEDIRS_EXAMPLES=1
 ifdef TARGET_EXAMPLEDIRS_EXAMPLES
 ifdef TARGET_EXAMPLEDIRS_EXAMPLES
@@ -1328,6 +1340,8 @@ examples_debug:
 	$(MAKE) -C examples debug
 	$(MAKE) -C examples debug
 examples_smart:
 examples_smart:
 	$(MAKE) -C examples smart
 	$(MAKE) -C examples smart
+examples_release:
+	$(MAKE) -C examples release
 examples_examples:
 examples_examples:
 	$(MAKE) -C examples examples
 	$(MAKE) -C examples examples
 examples_shared:
 examples_shared:
@@ -1356,19 +1370,16 @@ examples_cleanall:
 	$(MAKE) -C examples cleanall
 	$(MAKE) -C examples cleanall
 examples_info:
 examples_info:
 	$(MAKE) -C examples info
 	$(MAKE) -C examples info
-examples_makefile:
-	$(MAKE) -C examples makefile
 examples_makefiles:
 examples_makefiles:
 	$(MAKE) -C examples makefiles
 	$(MAKE) -C examples makefiles
-examples_makefile_dirs:
-	$(MAKE) -C examples makefile_dirs
 examples:
 examples:
 	$(MAKE) -C examples all
 	$(MAKE) -C examples all
-.PHONY: examples_all examples_debug examples_smart examples_examples examples_shared examples_install examples_sourceinstall examples_exampleinstall examples_distinstall examples_zipinstall examples_zipsourceinstall examples_zipexampleinstall examples_zipdistinstall examples_clean examples_distclean examples_cleanall examples_info examples_makefile examples_makefiles examples_makefile_dirs examples
+.PHONY: examples_all examples_debug examples_smart examples_release examples_examples examples_shared examples_install examples_sourceinstall examples_exampleinstall examples_distinstall examples_zipinstall examples_zipsourceinstall examples_zipexampleinstall examples_zipdistinstall examples_clean examples_distclean examples_cleanall examples_info examples_makefiles examples
 endif
 endif
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples $(addsuffix _examples,$(TARGET_DIRS))
 examples: fpc_examples $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
@@ -1383,10 +1394,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_DIRS)) $(addsuffix _clean,$(TARGET_
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 42 - 34
packages/gtk/examples/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -691,6 +710,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl gtk
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_GTK=1
 REQUIRE_PACKAGES_GTK=1
@@ -752,9 +772,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -776,9 +793,6 @@ endif
 ifdef REQUIRE_PACKAGES_GTK
 ifdef REQUIRE_PACKAGES_GTK
 PACKAGEDIR_GTK:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gtk/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_GTK:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gtk/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_GTK),)
 ifneq ($(PACKAGEDIR_GTK),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_GTK)/$(FPCMADE)
-$(PACKAGEDIR_GTK)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_GTK) all
 ifneq ($(wildcard $(PACKAGEDIR_GTK)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_GTK)/$(OS_TARGET)),)
 UNITDIR_GTK=$(PACKAGEDIR_GTK)/$(OS_TARGET)
 UNITDIR_GTK=$(PACKAGEDIR_GTK)/$(OS_TARGET)
 else
 else
@@ -800,9 +814,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -824,9 +835,6 @@ endif
 ifdef REQUIRE_PACKAGES_OPENGL
 ifdef REQUIRE_PACKAGES_OPENGL
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_OPENGL),)
 ifneq ($(PACKAGEDIR_OPENGL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE)
-$(PACKAGEDIR_OPENGL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_OPENGL) all
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 else
 else
@@ -976,15 +984,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1136,6 +1145,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1203,13 +1214,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1222,6 +1233,8 @@ tutorial_debug:
 	$(MAKE) -C tutorial debug
 	$(MAKE) -C tutorial debug
 tutorial_smart:
 tutorial_smart:
 	$(MAKE) -C tutorial smart
 	$(MAKE) -C tutorial smart
+tutorial_release:
+	$(MAKE) -C tutorial release
 tutorial_examples:
 tutorial_examples:
 	$(MAKE) -C tutorial examples
 	$(MAKE) -C tutorial examples
 tutorial_shared:
 tutorial_shared:
@@ -1250,19 +1263,16 @@ tutorial_cleanall:
 	$(MAKE) -C tutorial cleanall
 	$(MAKE) -C tutorial cleanall
 tutorial_info:
 tutorial_info:
 	$(MAKE) -C tutorial info
 	$(MAKE) -C tutorial info
-tutorial_makefile:
-	$(MAKE) -C tutorial makefile
 tutorial_makefiles:
 tutorial_makefiles:
 	$(MAKE) -C tutorial makefiles
 	$(MAKE) -C tutorial makefiles
-tutorial_makefile_dirs:
-	$(MAKE) -C tutorial makefile_dirs
 tutorial:
 tutorial:
 	$(MAKE) -C tutorial all
 	$(MAKE) -C tutorial all
-.PHONY: tutorial_all tutorial_debug tutorial_smart tutorial_examples tutorial_shared tutorial_install tutorial_sourceinstall tutorial_exampleinstall tutorial_distinstall tutorial_zipinstall tutorial_zipsourceinstall tutorial_zipexampleinstall tutorial_zipdistinstall tutorial_clean tutorial_distclean tutorial_cleanall tutorial_info tutorial_makefile tutorial_makefiles tutorial_makefile_dirs tutorial
+.PHONY: tutorial_all tutorial_debug tutorial_smart tutorial_release tutorial_examples tutorial_shared tutorial_install tutorial_sourceinstall tutorial_exampleinstall tutorial_distinstall tutorial_zipinstall tutorial_zipsourceinstall tutorial_zipexampleinstall tutorial_zipdistinstall tutorial_clean tutorial_distclean tutorial_cleanall tutorial_info tutorial_makefiles tutorial
 endif
 endif
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
@@ -1277,10 +1287,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile $(addsuffix _makefile,$(TARGET_DIRS))
 makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS))
 makefiles: fpc_makefiles $(addsuffix _makefiles,$(TARGET_DIRS))
-makefile_dirs: fpc_makefile_dirs $(addsuffix _makefile_dirs,$(TARGET_DIRS))
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 35 - 23
packages/gtk/examples/tutorial/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -688,6 +707,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=gtk
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_GTK=1
 REQUIRE_PACKAGES_GTK=1
 REQUIRE_PACKAGES_X11=1
 REQUIRE_PACKAGES_X11=1
@@ -738,9 +758,6 @@ endif
 ifdef REQUIRE_PACKAGES_GTK
 ifdef REQUIRE_PACKAGES_GTK
 PACKAGEDIR_GTK:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gtk/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_GTK:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /gtk/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_GTK),)
 ifneq ($(PACKAGEDIR_GTK),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_GTK)/$(FPCMADE)
-$(PACKAGEDIR_GTK)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_GTK) all
 ifneq ($(wildcard $(PACKAGEDIR_GTK)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_GTK)/$(OS_TARGET)),)
 UNITDIR_GTK=$(PACKAGEDIR_GTK)/$(OS_TARGET)
 UNITDIR_GTK=$(PACKAGEDIR_GTK)/$(OS_TARGET)
 else
 else
@@ -762,9 +779,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -786,9 +800,6 @@ endif
 ifdef REQUIRE_PACKAGES_OPENGL
 ifdef REQUIRE_PACKAGES_OPENGL
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_OPENGL),)
 ifneq ($(PACKAGEDIR_OPENGL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE)
-$(PACKAGEDIR_OPENGL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_OPENGL) all
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 else
 else
@@ -993,6 +1004,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1060,13 +1073,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1074,6 +1087,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all:
 all:
 debug:
 debug:
 smart:
 smart:
+release:
 examples:
 examples:
 shared:
 shared:
 install:
 install:
@@ -1088,10 +1102,8 @@ clean:
 distclean:
 distclean:
 cleanall:
 cleanall:
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 26
packages/gtk/gtkgl/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl opengl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_X11=1
 REQUIRE_PACKAGES_X11=1
@@ -742,9 +762,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -766,9 +783,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -790,9 +804,6 @@ endif
 ifdef REQUIRE_PACKAGES_OPENGL
 ifdef REQUIRE_PACKAGES_OPENGL
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_OPENGL),)
 ifneq ($(PACKAGEDIR_OPENGL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE)
-$(PACKAGEDIR_OPENGL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_OPENGL) all
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 else
 else
@@ -954,15 +965,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1114,6 +1126,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1181,13 +1195,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1195,6 +1209,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1209,10 +1224,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/ibase/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1212,6 +1232,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1226,10 +1247,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/inet/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -872,15 +889,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1111,6 +1129,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1178,13 +1198,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1192,6 +1212,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1206,10 +1227,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/libgd/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1212,6 +1232,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1226,10 +1247,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 23
packages/libpng/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -691,6 +710,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl zlib
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_ZLIB=1
 REQUIRE_PACKAGES_ZLIB=1
@@ -738,9 +758,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -762,9 +779,6 @@ endif
 ifdef REQUIRE_PACKAGES_ZLIB
 ifdef REQUIRE_PACKAGES_ZLIB
 PACKAGEDIR_ZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /zlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_ZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /zlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_ZLIB),)
 ifneq ($(PACKAGEDIR_ZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_ZLIB)/$(FPCMADE)
-$(PACKAGEDIR_ZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_ZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_ZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_ZLIB)/$(OS_TARGET)),)
 UNITDIR_ZLIB=$(PACKAGEDIR_ZLIB)/$(OS_TARGET)
 UNITDIR_ZLIB=$(PACKAGEDIR_ZLIB)/$(OS_TARGET)
 else
 else
@@ -911,15 +925,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1150,6 +1165,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1217,13 +1234,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1231,6 +1248,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1245,10 +1263,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/mmsystem/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -677,6 +696,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -713,9 +733,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -856,15 +873,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1095,6 +1113,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1162,13 +1182,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1176,6 +1196,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1190,10 +1211,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/mysql/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1212,6 +1232,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1226,10 +1247,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/ncurses/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1212,6 +1232,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1226,10 +1247,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 84 - 36
packages/numlib/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2001/12/18]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -70,6 +68,7 @@ endif
 else
 else
 BASEDIR=.
 BASEDIR=.
 endif
 endif
+override DEFAULT_FPCDIR=../..
 ifndef FPC
 ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
@@ -93,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -119,10 +139,10 @@ endif
 else
 else
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
+ifdef DEFAULT_FPCDIR
 ifeq ($(FPCDIR),wrong)
 ifeq ($(FPCDIR),wrong)
-override FPCDIR=../..
-ifeq ($(wildcard $(FPCDIR)/rtl),)
-ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
 endif
 endif
@@ -197,6 +217,11 @@ UNIXINSTALLDIR=1
 endif
 endif
 endif
 endif
 ifndef INSTALL_PREFIX
 ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
 ifdef UNIXINSTALLDIR
 ifdef UNIXINSTALLDIR
 INSTALL_PREFIX=/usr/local
 INSTALL_PREFIX=/usr/local
 else
 else
@@ -671,6 +696,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -705,14 +731,8 @@ ifeq ($(OS_TARGET),qnx)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
-PACKAGEDIR_RTL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-PACKAGEDIR_RTL:=$(firstword $(PACKAGEDIR_RTL))
-ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_rtl
-package_rtl:
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
-endif
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -731,7 +751,6 @@ ifdef UNITDIR_RTL
 override COMPILER_UNITDIR+=$(UNITDIR_RTL)
 override COMPILER_UNITDIR+=$(UNITDIR_RTL)
 endif
 endif
 endif
 endif
-.PHONY: package_rtl
 ifndef NOCPUDEF
 ifndef NOCPUDEF
 override FPCOPTDEF=$(CPU_TARGET)
 override FPCOPTDEF=$(CPU_TARGET)
 endif
 endif
@@ -845,24 +864,26 @@ endif
 ifdef TARGET_UNITS
 ifdef TARGET_UNITS
 override ALLTARGET+=fpc_units
 override ALLTARGET+=fpc_units
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
-override INSTALLPPUFILES+=$(UNITPPUFILES)
-override CLEANPPUFILES+=$(UNITPPUFILES)
+override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
+override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
 endif
 endif
 fpc_units: $(UNITPPUFILES)
 fpc_units: $(UNITPPUFILES)
 ifdef TARGET_RSTS
 ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
 	$(EXECPPAS)
 	$(EXECPPAS)
@@ -875,6 +896,8 @@ fpc_debug:
 %$(EXEEXT): %.pas
 %$(EXEEXT): %.pas
 	$(COMPILER) $<
 	$(COMPILER) $<
 	$(EXECPPAS)
 	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
 vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
@@ -882,6 +905,9 @@ vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
 ifdef INSTALL_UNITS
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
 endif
 endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT),$(INSTALLPPUFILES))
+endif
 ifdef INSTALLPPUFILES
 ifdef INSTALLPPUFILES
 override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
 override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
 override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
 override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
@@ -1062,12 +1088,13 @@ ifdef CLEANEXEFILES
 endif
 endif
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 	-$(DELTREE) *$(SMARTEXT)
 	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
 ifdef AOUTEXT
 ifdef AOUTEXT
 	-$(DEL) *$(AOUTEXT)
 	-$(DEL) *$(AOUTEXT)
 endif
 endif
-.PHONY: fpc_info
-fpc_info:
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Package info ==
 	@$(ECHO)  == Package info ==
 	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
 	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
@@ -1086,6 +1113,8 @@ fpc_info:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1101,7 +1130,7 @@ fpc_info:
 	@$(ECHO)  Ld........ $(LD)
 	@$(ECHO)  Ld........ $(LD)
 	@$(ECHO)  Ar........ $(AR)
 	@$(ECHO)  Ar........ $(AR)
 	@$(ECHO)  Rc........ $(RC)
 	@$(ECHO)  Rc........ $(RC)
-	@$(ECHO)  
+	@$(ECHO)
 	@$(ECHO)  Mv........ $(MVPROG)
 	@$(ECHO)  Mv........ $(MVPROG)
 	@$(ECHO)  Cp........ $(CPPROG)
 	@$(ECHO)  Cp........ $(CPPROG)
 	@$(ECHO)  Rm........ $(RMPROG)
 	@$(ECHO)  Rm........ $(RMPROG)
@@ -1115,12 +1144,13 @@ fpc_info:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Object info ==
 	@$(ECHO)  == Object info ==
 	@$(ECHO)
 	@$(ECHO)
-	@$(ECHO)  Target Loaders...... $(TARGET_LOADERS)
-	@$(ECHO)  Target Units........ $(TARGET_UNITS)
-	@$(ECHO)  Target Programs..... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs......... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples..... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
 	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
 	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
 	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
@@ -1147,9 +1177,26 @@ fpc_info:
 	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
 	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
 	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
 	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
 	@$(ECHO)
 	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1164,7 +1211,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info
+makefiles: fpc_makefiles
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 42 - 28
packages/opengl/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -715,6 +734,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_X11=1
 REQUIRE_PACKAGES_X11=1
@@ -754,9 +774,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -778,9 +795,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -942,15 +956,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1181,6 +1196,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1248,13 +1265,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1267,6 +1284,8 @@ examples_debug:
 	$(MAKE) -C examples debug
 	$(MAKE) -C examples debug
 examples_smart:
 examples_smart:
 	$(MAKE) -C examples smart
 	$(MAKE) -C examples smart
+examples_release:
+	$(MAKE) -C examples release
 examples_examples:
 examples_examples:
 	$(MAKE) -C examples examples
 	$(MAKE) -C examples examples
 examples_shared:
 examples_shared:
@@ -1295,19 +1314,16 @@ examples_cleanall:
 	$(MAKE) -C examples cleanall
 	$(MAKE) -C examples cleanall
 examples_info:
 examples_info:
 	$(MAKE) -C examples info
 	$(MAKE) -C examples info
-examples_makefile:
-	$(MAKE) -C examples makefile
 examples_makefiles:
 examples_makefiles:
 	$(MAKE) -C examples makefiles
 	$(MAKE) -C examples makefiles
-examples_makefile_dirs:
-	$(MAKE) -C examples makefile_dirs
 examples:
 examples:
 	$(MAKE) -C examples all
 	$(MAKE) -C examples all
-.PHONY: examples_all examples_debug examples_smart examples_examples examples_shared examples_install examples_sourceinstall examples_exampleinstall examples_distinstall examples_zipinstall examples_zipsourceinstall examples_zipexampleinstall examples_zipdistinstall examples_clean examples_distclean examples_cleanall examples_info examples_makefile examples_makefiles examples_makefile_dirs examples
+.PHONY: examples_all examples_debug examples_smart examples_release examples_examples examples_shared examples_install examples_sourceinstall examples_exampleinstall examples_distinstall examples_zipinstall examples_zipsourceinstall examples_zipexampleinstall examples_zipdistinstall examples_clean examples_distclean examples_cleanall examples_info examples_makefiles examples
 endif
 endif
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1322,10 +1338,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 35
packages/opengl/build/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all_units
 default: all_units
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -690,6 +709,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fcl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -757,9 +777,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -781,9 +798,6 @@ endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_PASZLIB),)
 ifneq ($(PACKAGEDIR_PASZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
-$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 else
 else
@@ -805,9 +819,6 @@ endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_INET),)
 ifneq ($(PACKAGEDIR_INET),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
-$(PACKAGEDIR_INET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_INET) all
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 else
 else
@@ -829,9 +840,6 @@ endif
 ifdef REQUIRE_PACKAGES_FCL
 ifdef REQUIRE_PACKAGES_FCL
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FCL),)
 ifneq ($(PACKAGEDIR_FCL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
-$(PACKAGEDIR_FCL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FCL) all
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 else
 else
@@ -853,9 +861,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -877,9 +882,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -1038,15 +1040,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1198,6 +1201,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1265,13 +1270,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1279,6 +1284,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1293,10 +1299,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 26
packages/opengl/examples/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -689,6 +708,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl opengl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_X11=1
 REQUIRE_PACKAGES_X11=1
@@ -739,9 +759,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -763,9 +780,6 @@ endif
 ifdef REQUIRE_PACKAGES_X11
 ifdef REQUIRE_PACKAGES_X11
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_X11:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /x11/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_X11),)
 ifneq ($(PACKAGEDIR_X11),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_X11)/$(FPCMADE)
-$(PACKAGEDIR_X11)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_X11) all
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_X11)/$(OS_TARGET)),)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 UNITDIR_X11=$(PACKAGEDIR_X11)/$(OS_TARGET)
 else
 else
@@ -787,9 +801,6 @@ endif
 ifdef REQUIRE_PACKAGES_OPENGL
 ifdef REQUIRE_PACKAGES_OPENGL
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_OPENGL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /opengl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_OPENGL),)
 ifneq ($(PACKAGEDIR_OPENGL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_OPENGL)/$(FPCMADE)
-$(PACKAGEDIR_OPENGL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_OPENGL) all
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_OPENGL)/$(OS_TARGET)),)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 UNITDIR_OPENGL=$(PACKAGEDIR_OPENGL)/$(OS_TARGET)
 else
 else
@@ -939,15 +950,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1099,6 +1111,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1166,13 +1180,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1180,6 +1194,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1194,10 +1209,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 42 - 25
packages/oracle/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1217,6 +1237,8 @@ example_debug:
 	$(MAKE) -C example debug
 	$(MAKE) -C example debug
 example_smart:
 example_smart:
 	$(MAKE) -C example smart
 	$(MAKE) -C example smart
+example_release:
+	$(MAKE) -C example release
 example_examples:
 example_examples:
 	$(MAKE) -C example examples
 	$(MAKE) -C example examples
 example_shared:
 example_shared:
@@ -1245,19 +1267,16 @@ example_cleanall:
 	$(MAKE) -C example cleanall
 	$(MAKE) -C example cleanall
 example_info:
 example_info:
 	$(MAKE) -C example info
 	$(MAKE) -C example info
-example_makefile:
-	$(MAKE) -C example makefile
 example_makefiles:
 example_makefiles:
 	$(MAKE) -C example makefiles
 	$(MAKE) -C example makefiles
-example_makefile_dirs:
-	$(MAKE) -C example makefile_dirs
 example:
 example:
 	$(MAKE) -C example all
 	$(MAKE) -C example all
-.PHONY: example_all example_debug example_smart example_examples example_shared example_install example_sourceinstall example_exampleinstall example_distinstall example_zipinstall example_zipsourceinstall example_zipexampleinstall example_zipdistinstall example_clean example_distclean example_cleanall example_info example_makefile example_makefiles example_makefile_dirs example
+.PHONY: example_all example_debug example_smart example_release example_examples example_shared example_install example_sourceinstall example_exampleinstall example_distinstall example_zipinstall example_zipsourceinstall example_zipexampleinstall example_zipdistinstall example_clean example_distclean example_cleanall example_info example_makefiles example
 endif
 endif
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1272,10 +1291,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 38
packages/oracle/example/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -690,6 +709,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl oracle fcl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_ORACLE=1
 REQUIRE_PACKAGES_ORACLE=1
@@ -768,9 +788,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -792,9 +809,6 @@ endif
 ifdef REQUIRE_PACKAGES_ORACLE
 ifdef REQUIRE_PACKAGES_ORACLE
 PACKAGEDIR_ORACLE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /oracle/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_ORACLE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /oracle/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_ORACLE),)
 ifneq ($(PACKAGEDIR_ORACLE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_ORACLE)/$(FPCMADE)
-$(PACKAGEDIR_ORACLE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_ORACLE) all
 ifneq ($(wildcard $(PACKAGEDIR_ORACLE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_ORACLE)/$(OS_TARGET)),)
 UNITDIR_ORACLE=$(PACKAGEDIR_ORACLE)/$(OS_TARGET)
 UNITDIR_ORACLE=$(PACKAGEDIR_ORACLE)/$(OS_TARGET)
 else
 else
@@ -816,9 +830,6 @@ endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_PASZLIB),)
 ifneq ($(PACKAGEDIR_PASZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
-$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 else
 else
@@ -840,9 +851,6 @@ endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_INET),)
 ifneq ($(PACKAGEDIR_INET),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
-$(PACKAGEDIR_INET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_INET) all
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 else
 else
@@ -864,9 +872,6 @@ endif
 ifdef REQUIRE_PACKAGES_FCL
 ifdef REQUIRE_PACKAGES_FCL
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FCL),)
 ifneq ($(PACKAGEDIR_FCL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
-$(PACKAGEDIR_FCL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FCL) all
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 else
 else
@@ -888,9 +893,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -912,9 +914,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -1076,15 +1075,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1236,6 +1236,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1303,13 +1305,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1317,6 +1319,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1331,10 +1334,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/paszlib/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -872,15 +889,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1111,6 +1129,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1178,13 +1198,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1192,6 +1212,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1206,10 +1227,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/postgres/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1212,6 +1232,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1226,10 +1247,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/regexpr/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -679,6 +698,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -715,9 +735,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -873,15 +890,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1112,6 +1130,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1179,13 +1199,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1193,6 +1213,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1207,10 +1228,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/svgalib/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1212,6 +1232,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1226,10 +1247,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/syslog/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -692,6 +711,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -728,9 +748,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -892,15 +909,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1131,6 +1149,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1198,13 +1218,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1212,6 +1232,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1226,10 +1247,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/uncgi/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -872,15 +889,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1111,6 +1129,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1178,13 +1198,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1192,6 +1212,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1205,10 +1226,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/unzip/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -680,6 +699,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -716,9 +736,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -859,15 +876,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1098,6 +1116,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1165,13 +1185,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1179,6 +1199,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1193,10 +1214,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/utmp/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -872,15 +889,16 @@ ifdef TARGET_EXAMPLEDIRS
 HASEXAMPLES=1
 HASEXAMPLES=1
 endif
 endif
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1111,6 +1129,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1178,13 +1198,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1192,6 +1212,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: fpc_examples
 examples: fpc_examples
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1206,10 +1227,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/x11/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -691,6 +710,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -727,9 +747,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -876,15 +893,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1115,6 +1133,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1182,13 +1202,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1196,6 +1216,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1210,10 +1231,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
packages/zlib/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -691,6 +710,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -727,9 +747,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -876,15 +893,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1115,6 +1133,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1182,13 +1202,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1196,6 +1216,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1210,10 +1231,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 55 - 49
rtl/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -1023,6 +1042,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1090,13 +1111,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1129,6 +1150,8 @@ linux_debug:
 	$(MAKE) -C linux debug
 	$(MAKE) -C linux debug
 linux_smart:
 linux_smart:
 	$(MAKE) -C linux smart
 	$(MAKE) -C linux smart
+linux_release:
+	$(MAKE) -C linux release
 linux_examples:
 linux_examples:
 	$(MAKE) -C linux examples
 	$(MAKE) -C linux examples
 linux_shared:
 linux_shared:
@@ -1157,15 +1180,11 @@ linux_cleanall:
 	$(MAKE) -C linux cleanall
 	$(MAKE) -C linux cleanall
 linux_info:
 linux_info:
 	$(MAKE) -C linux info
 	$(MAKE) -C linux info
-linux_makefile:
-	$(MAKE) -C linux makefile
 linux_makefiles:
 linux_makefiles:
 	$(MAKE) -C linux makefiles
 	$(MAKE) -C linux makefiles
-linux_makefile_dirs:
-	$(MAKE) -C linux makefile_dirs
 linux:
 linux:
 	$(MAKE) -C linux all
 	$(MAKE) -C linux all
-.PHONY: linux_all linux_debug linux_smart linux_examples linux_shared linux_install linux_sourceinstall linux_exampleinstall linux_distinstall linux_zipinstall linux_zipsourceinstall linux_zipexampleinstall linux_zipdistinstall linux_clean linux_distclean linux_cleanall linux_info linux_makefile linux_makefiles linux_makefile_dirs linux
+.PHONY: linux_all linux_debug linux_smart linux_release linux_examples linux_shared linux_install linux_sourceinstall linux_exampleinstall linux_distinstall linux_zipinstall linux_zipsourceinstall linux_zipexampleinstall linux_zipdistinstall linux_clean linux_distclean linux_cleanall linux_info linux_makefiles linux
 endif
 endif
 ifdef TARGET_DIRS_GO32V2
 ifdef TARGET_DIRS_GO32V2
 go32v2_all:
 go32v2_all:
@@ -1174,6 +1193,8 @@ go32v2_debug:
 	$(MAKE) -C go32v2 debug
 	$(MAKE) -C go32v2 debug
 go32v2_smart:
 go32v2_smart:
 	$(MAKE) -C go32v2 smart
 	$(MAKE) -C go32v2 smart
+go32v2_release:
+	$(MAKE) -C go32v2 release
 go32v2_examples:
 go32v2_examples:
 	$(MAKE) -C go32v2 examples
 	$(MAKE) -C go32v2 examples
 go32v2_shared:
 go32v2_shared:
@@ -1202,15 +1223,11 @@ go32v2_cleanall:
 	$(MAKE) -C go32v2 cleanall
 	$(MAKE) -C go32v2 cleanall
 go32v2_info:
 go32v2_info:
 	$(MAKE) -C go32v2 info
 	$(MAKE) -C go32v2 info
-go32v2_makefile:
-	$(MAKE) -C go32v2 makefile
 go32v2_makefiles:
 go32v2_makefiles:
 	$(MAKE) -C go32v2 makefiles
 	$(MAKE) -C go32v2 makefiles
-go32v2_makefile_dirs:
-	$(MAKE) -C go32v2 makefile_dirs
 go32v2:
 go32v2:
 	$(MAKE) -C go32v2 all
 	$(MAKE) -C go32v2 all
-.PHONY: go32v2_all go32v2_debug go32v2_smart go32v2_examples go32v2_shared go32v2_install go32v2_sourceinstall go32v2_exampleinstall go32v2_distinstall go32v2_zipinstall go32v2_zipsourceinstall go32v2_zipexampleinstall go32v2_zipdistinstall go32v2_clean go32v2_distclean go32v2_cleanall go32v2_info go32v2_makefile go32v2_makefiles go32v2_makefile_dirs go32v2
+.PHONY: go32v2_all go32v2_debug go32v2_smart go32v2_release go32v2_examples go32v2_shared go32v2_install go32v2_sourceinstall go32v2_exampleinstall go32v2_distinstall go32v2_zipinstall go32v2_zipsourceinstall go32v2_zipexampleinstall go32v2_zipdistinstall go32v2_clean go32v2_distclean go32v2_cleanall go32v2_info go32v2_makefiles go32v2
 endif
 endif
 ifdef TARGET_DIRS_WIN32
 ifdef TARGET_DIRS_WIN32
 win32_all:
 win32_all:
@@ -1219,6 +1236,8 @@ win32_debug:
 	$(MAKE) -C win32 debug
 	$(MAKE) -C win32 debug
 win32_smart:
 win32_smart:
 	$(MAKE) -C win32 smart
 	$(MAKE) -C win32 smart
+win32_release:
+	$(MAKE) -C win32 release
 win32_examples:
 win32_examples:
 	$(MAKE) -C win32 examples
 	$(MAKE) -C win32 examples
 win32_shared:
 win32_shared:
@@ -1247,15 +1266,11 @@ win32_cleanall:
 	$(MAKE) -C win32 cleanall
 	$(MAKE) -C win32 cleanall
 win32_info:
 win32_info:
 	$(MAKE) -C win32 info
 	$(MAKE) -C win32 info
-win32_makefile:
-	$(MAKE) -C win32 makefile
 win32_makefiles:
 win32_makefiles:
 	$(MAKE) -C win32 makefiles
 	$(MAKE) -C win32 makefiles
-win32_makefile_dirs:
-	$(MAKE) -C win32 makefile_dirs
 win32:
 win32:
 	$(MAKE) -C win32 all
 	$(MAKE) -C win32 all
-.PHONY: win32_all win32_debug win32_smart win32_examples win32_shared win32_install win32_sourceinstall win32_exampleinstall win32_distinstall win32_zipinstall win32_zipsourceinstall win32_zipexampleinstall win32_zipdistinstall win32_clean win32_distclean win32_cleanall win32_info win32_makefile win32_makefiles win32_makefile_dirs win32
+.PHONY: win32_all win32_debug win32_smart win32_release win32_examples win32_shared win32_install win32_sourceinstall win32_exampleinstall win32_distinstall win32_zipinstall win32_zipsourceinstall win32_zipexampleinstall win32_zipdistinstall win32_clean win32_distclean win32_cleanall win32_info win32_makefiles win32
 endif
 endif
 ifdef TARGET_DIRS_OS2
 ifdef TARGET_DIRS_OS2
 os2_all:
 os2_all:
@@ -1264,6 +1279,8 @@ os2_debug:
 	$(MAKE) -C os2 debug
 	$(MAKE) -C os2 debug
 os2_smart:
 os2_smart:
 	$(MAKE) -C os2 smart
 	$(MAKE) -C os2 smart
+os2_release:
+	$(MAKE) -C os2 release
 os2_examples:
 os2_examples:
 	$(MAKE) -C os2 examples
 	$(MAKE) -C os2 examples
 os2_shared:
 os2_shared:
@@ -1292,15 +1309,11 @@ os2_cleanall:
 	$(MAKE) -C os2 cleanall
 	$(MAKE) -C os2 cleanall
 os2_info:
 os2_info:
 	$(MAKE) -C os2 info
 	$(MAKE) -C os2 info
-os2_makefile:
-	$(MAKE) -C os2 makefile
 os2_makefiles:
 os2_makefiles:
 	$(MAKE) -C os2 makefiles
 	$(MAKE) -C os2 makefiles
-os2_makefile_dirs:
-	$(MAKE) -C os2 makefile_dirs
 os2:
 os2:
 	$(MAKE) -C os2 all
 	$(MAKE) -C os2 all
-.PHONY: os2_all os2_debug os2_smart os2_examples os2_shared os2_install os2_sourceinstall os2_exampleinstall os2_distinstall os2_zipinstall os2_zipsourceinstall os2_zipexampleinstall os2_zipdistinstall os2_clean os2_distclean os2_cleanall os2_info os2_makefile os2_makefiles os2_makefile_dirs os2
+.PHONY: os2_all os2_debug os2_smart os2_release os2_examples os2_shared os2_install os2_sourceinstall os2_exampleinstall os2_distinstall os2_zipinstall os2_zipsourceinstall os2_zipexampleinstall os2_zipdistinstall os2_clean os2_distclean os2_cleanall os2_info os2_makefiles os2
 endif
 endif
 ifdef TARGET_DIRS_FREEBSD
 ifdef TARGET_DIRS_FREEBSD
 freebsd_all:
 freebsd_all:
@@ -1309,6 +1322,8 @@ freebsd_debug:
 	$(MAKE) -C freebsd debug
 	$(MAKE) -C freebsd debug
 freebsd_smart:
 freebsd_smart:
 	$(MAKE) -C freebsd smart
 	$(MAKE) -C freebsd smart
+freebsd_release:
+	$(MAKE) -C freebsd release
 freebsd_examples:
 freebsd_examples:
 	$(MAKE) -C freebsd examples
 	$(MAKE) -C freebsd examples
 freebsd_shared:
 freebsd_shared:
@@ -1337,15 +1352,11 @@ freebsd_cleanall:
 	$(MAKE) -C freebsd cleanall
 	$(MAKE) -C freebsd cleanall
 freebsd_info:
 freebsd_info:
 	$(MAKE) -C freebsd info
 	$(MAKE) -C freebsd info
-freebsd_makefile:
-	$(MAKE) -C freebsd makefile
 freebsd_makefiles:
 freebsd_makefiles:
 	$(MAKE) -C freebsd makefiles
 	$(MAKE) -C freebsd makefiles
-freebsd_makefile_dirs:
-	$(MAKE) -C freebsd makefile_dirs
 freebsd:
 freebsd:
 	$(MAKE) -C freebsd all
 	$(MAKE) -C freebsd all
-.PHONY: freebsd_all freebsd_debug freebsd_smart freebsd_examples freebsd_shared freebsd_install freebsd_sourceinstall freebsd_exampleinstall freebsd_distinstall freebsd_zipinstall freebsd_zipsourceinstall freebsd_zipexampleinstall freebsd_zipdistinstall freebsd_clean freebsd_distclean freebsd_cleanall freebsd_info freebsd_makefile freebsd_makefiles freebsd_makefile_dirs freebsd
+.PHONY: freebsd_all freebsd_debug freebsd_smart freebsd_release freebsd_examples freebsd_shared freebsd_install freebsd_sourceinstall freebsd_exampleinstall freebsd_distinstall freebsd_zipinstall freebsd_zipsourceinstall freebsd_zipexampleinstall freebsd_zipdistinstall freebsd_clean freebsd_distclean freebsd_cleanall freebsd_info freebsd_makefiles freebsd
 endif
 endif
 ifdef TARGET_DIRS_BEOS
 ifdef TARGET_DIRS_BEOS
 beos_all:
 beos_all:
@@ -1354,6 +1365,8 @@ beos_debug:
 	$(MAKE) -C beos debug
 	$(MAKE) -C beos debug
 beos_smart:
 beos_smart:
 	$(MAKE) -C beos smart
 	$(MAKE) -C beos smart
+beos_release:
+	$(MAKE) -C beos release
 beos_examples:
 beos_examples:
 	$(MAKE) -C beos examples
 	$(MAKE) -C beos examples
 beos_shared:
 beos_shared:
@@ -1382,15 +1395,11 @@ beos_cleanall:
 	$(MAKE) -C beos cleanall
 	$(MAKE) -C beos cleanall
 beos_info:
 beos_info:
 	$(MAKE) -C beos info
 	$(MAKE) -C beos info
-beos_makefile:
-	$(MAKE) -C beos makefile
 beos_makefiles:
 beos_makefiles:
 	$(MAKE) -C beos makefiles
 	$(MAKE) -C beos makefiles
-beos_makefile_dirs:
-	$(MAKE) -C beos makefile_dirs
 beos:
 beos:
 	$(MAKE) -C beos all
 	$(MAKE) -C beos all
-.PHONY: beos_all beos_debug beos_smart beos_examples beos_shared beos_install beos_sourceinstall beos_exampleinstall beos_distinstall beos_zipinstall beos_zipsourceinstall beos_zipexampleinstall beos_zipdistinstall beos_clean beos_distclean beos_cleanall beos_info beos_makefile beos_makefiles beos_makefile_dirs beos
+.PHONY: beos_all beos_debug beos_smart beos_release beos_examples beos_shared beos_install beos_sourceinstall beos_exampleinstall beos_distinstall beos_zipinstall beos_zipsourceinstall beos_zipexampleinstall beos_zipdistinstall beos_clean beos_distclean beos_cleanall beos_info beos_makefiles beos
 endif
 endif
 ifdef TARGET_DIRS_AMIGA
 ifdef TARGET_DIRS_AMIGA
 amiga_all:
 amiga_all:
@@ -1399,6 +1408,8 @@ amiga_debug:
 	$(MAKE) -C amiga debug
 	$(MAKE) -C amiga debug
 amiga_smart:
 amiga_smart:
 	$(MAKE) -C amiga smart
 	$(MAKE) -C amiga smart
+amiga_release:
+	$(MAKE) -C amiga release
 amiga_examples:
 amiga_examples:
 	$(MAKE) -C amiga examples
 	$(MAKE) -C amiga examples
 amiga_shared:
 amiga_shared:
@@ -1427,19 +1438,16 @@ amiga_cleanall:
 	$(MAKE) -C amiga cleanall
 	$(MAKE) -C amiga cleanall
 amiga_info:
 amiga_info:
 	$(MAKE) -C amiga info
 	$(MAKE) -C amiga info
-amiga_makefile:
-	$(MAKE) -C amiga makefile
 amiga_makefiles:
 amiga_makefiles:
 	$(MAKE) -C amiga makefiles
 	$(MAKE) -C amiga makefiles
-amiga_makefile_dirs:
-	$(MAKE) -C amiga makefile_dirs
 amiga:
 amiga:
 	$(MAKE) -C amiga all
 	$(MAKE) -C amiga all
-.PHONY: amiga_all amiga_debug amiga_smart amiga_examples amiga_shared amiga_install amiga_sourceinstall amiga_exampleinstall amiga_distinstall amiga_zipinstall amiga_zipsourceinstall amiga_zipexampleinstall amiga_zipdistinstall amiga_clean amiga_distclean amiga_cleanall amiga_info amiga_makefile amiga_makefiles amiga_makefile_dirs amiga
+.PHONY: amiga_all amiga_debug amiga_smart amiga_release amiga_examples amiga_shared amiga_install amiga_sourceinstall amiga_exampleinstall amiga_distinstall amiga_zipinstall amiga_zipsourceinstall amiga_zipexampleinstall amiga_zipdistinstall amiga_clean amiga_distclean amiga_cleanall amiga_info amiga_makefiles amiga
 endif
 endif
 all: $(addsuffix _all,$(TARGET_DIRS))
 all: $(addsuffix _all,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
+release: $(addsuffix _release,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
@@ -1454,10 +1462,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 17
rtl/amiga/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -96,23 +94,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -835,15 +854,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -995,6 +1015,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1062,13 +1084,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1076,6 +1098,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1090,10 +1113,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 17
rtl/beos/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -96,23 +94,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -830,15 +849,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -990,6 +1010,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1057,13 +1079,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1071,6 +1093,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1085,10 +1108,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 17
rtl/freebsd/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -95,23 +93,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
 endif
 endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -842,15 +861,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1002,6 +1022,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1069,13 +1091,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1083,6 +1105,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1097,10 +1120,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 17
rtl/go32v1/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -96,23 +94,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -828,15 +847,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -988,6 +1008,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1055,13 +1077,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1069,6 +1091,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1083,10 +1106,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 17
rtl/go32v2/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -96,23 +94,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -835,15 +854,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -995,6 +1015,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1062,13 +1084,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1076,6 +1098,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1090,10 +1113,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 17
rtl/linux/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -95,23 +93,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
 endif
 endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -848,15 +867,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1008,6 +1028,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1075,13 +1097,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1089,6 +1111,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1103,10 +1126,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 17
rtl/os2/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -96,23 +94,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
 endif
 endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -834,15 +853,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -994,6 +1014,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1061,13 +1083,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1075,6 +1097,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1089,10 +1112,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 38 - 17
rtl/win32/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -95,23 +93,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
 endif
 endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -838,15 +857,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -998,6 +1018,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1065,13 +1087,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1079,6 +1101,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1093,10 +1116,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 34 - 14
tests/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: allexectests
 default: allexectests
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -854,6 +873,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -921,19 +942,20 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 debug:
 debug:
 smart:
 smart:
+release:
 examples:
 examples:
 shared:
 shared:
 install:
 install:
@@ -945,10 +967,8 @@ zipsourceinstall:
 zipexampleinstall:
 zipexampleinstall:
 zipdistinstall:
 zipdistinstall:
 cleanall:
 cleanall:
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall makefile makefiles makefile_dirs
+.PHONY: debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall cleanall makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
tests/units/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -675,6 +694,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -711,9 +731,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -854,15 +871,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1014,6 +1032,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1081,13 +1101,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1095,6 +1115,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1108,10 +1129,8 @@ zipdistinstall:
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 54 - 60
utils/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -693,6 +712,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl fcl
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -760,9 +780,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -784,9 +801,6 @@ endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_PASZLIB),)
 ifneq ($(PACKAGEDIR_PASZLIB),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
-$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
 else
 else
@@ -808,9 +822,6 @@ endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_INET),)
 ifneq ($(PACKAGEDIR_INET),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
-$(PACKAGEDIR_INET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_INET) all
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
 else
 else
@@ -832,9 +843,6 @@ endif
 ifdef REQUIRE_PACKAGES_FCL
 ifdef REQUIRE_PACKAGES_FCL
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_FCL),)
 ifneq ($(PACKAGEDIR_FCL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
-$(PACKAGEDIR_FCL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_FCL) all
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
 else
 else
@@ -856,9 +864,6 @@ endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_MYSQL),)
 ifneq ($(PACKAGEDIR_MYSQL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
-$(PACKAGEDIR_MYSQL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
 else
 else
@@ -880,9 +885,6 @@ endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)
 ifneq ($(PACKAGEDIR_IBASE),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
-$(PACKAGEDIR_IBASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
 else
 else
@@ -1032,15 +1034,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1271,6 +1274,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1338,13 +1343,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1361,6 +1366,8 @@ fpcm_debug:
 	$(MAKE) -C fpcm debug
 	$(MAKE) -C fpcm debug
 fpcm_smart:
 fpcm_smart:
 	$(MAKE) -C fpcm smart
 	$(MAKE) -C fpcm smart
+fpcm_release:
+	$(MAKE) -C fpcm release
 fpcm_examples:
 fpcm_examples:
 	$(MAKE) -C fpcm examples
 	$(MAKE) -C fpcm examples
 fpcm_shared:
 fpcm_shared:
@@ -1389,15 +1396,11 @@ fpcm_cleanall:
 	$(MAKE) -C fpcm cleanall
 	$(MAKE) -C fpcm cleanall
 fpcm_info:
 fpcm_info:
 	$(MAKE) -C fpcm info
 	$(MAKE) -C fpcm info
-fpcm_makefile:
-	$(MAKE) -C fpcm makefile
 fpcm_makefiles:
 fpcm_makefiles:
 	$(MAKE) -C fpcm makefiles
 	$(MAKE) -C fpcm makefiles
-fpcm_makefile_dirs:
-	$(MAKE) -C fpcm makefile_dirs
 fpcm:
 fpcm:
 	$(MAKE) -C fpcm all
 	$(MAKE) -C fpcm all
-.PHONY: fpcm_all fpcm_debug fpcm_smart fpcm_examples fpcm_shared fpcm_install fpcm_sourceinstall fpcm_exampleinstall fpcm_distinstall fpcm_zipinstall fpcm_zipsourceinstall fpcm_zipexampleinstall fpcm_zipdistinstall fpcm_clean fpcm_distclean fpcm_cleanall fpcm_info fpcm_makefile fpcm_makefiles fpcm_makefile_dirs fpcm
+.PHONY: fpcm_all fpcm_debug fpcm_smart fpcm_release fpcm_examples fpcm_shared fpcm_install fpcm_sourceinstall fpcm_exampleinstall fpcm_distinstall fpcm_zipinstall fpcm_zipsourceinstall fpcm_zipexampleinstall fpcm_zipdistinstall fpcm_clean fpcm_distclean fpcm_cleanall fpcm_info fpcm_makefiles fpcm
 endif
 endif
 ifdef TARGET_DIRS_TPLY
 ifdef TARGET_DIRS_TPLY
 tply_all:
 tply_all:
@@ -1406,6 +1409,8 @@ tply_debug:
 	$(MAKE) -C tply debug
 	$(MAKE) -C tply debug
 tply_smart:
 tply_smart:
 	$(MAKE) -C tply smart
 	$(MAKE) -C tply smart
+tply_release:
+	$(MAKE) -C tply release
 tply_examples:
 tply_examples:
 	$(MAKE) -C tply examples
 	$(MAKE) -C tply examples
 tply_shared:
 tply_shared:
@@ -1434,15 +1439,11 @@ tply_cleanall:
 	$(MAKE) -C tply cleanall
 	$(MAKE) -C tply cleanall
 tply_info:
 tply_info:
 	$(MAKE) -C tply info
 	$(MAKE) -C tply info
-tply_makefile:
-	$(MAKE) -C tply makefile
 tply_makefiles:
 tply_makefiles:
 	$(MAKE) -C tply makefiles
 	$(MAKE) -C tply makefiles
-tply_makefile_dirs:
-	$(MAKE) -C tply makefile_dirs
 tply:
 tply:
 	$(MAKE) -C tply all
 	$(MAKE) -C tply all
-.PHONY: tply_all tply_debug tply_smart tply_examples tply_shared tply_install tply_sourceinstall tply_exampleinstall tply_distinstall tply_zipinstall tply_zipsourceinstall tply_zipexampleinstall tply_zipdistinstall tply_clean tply_distclean tply_cleanall tply_info tply_makefile tply_makefiles tply_makefile_dirs tply
+.PHONY: tply_all tply_debug tply_smart tply_release tply_examples tply_shared tply_install tply_sourceinstall tply_exampleinstall tply_distinstall tply_zipinstall tply_zipsourceinstall tply_zipexampleinstall tply_zipdistinstall tply_clean tply_distclean tply_cleanall tply_info tply_makefiles tply
 endif
 endif
 ifdef TARGET_DIRS_H2PAS
 ifdef TARGET_DIRS_H2PAS
 h2pas_all:
 h2pas_all:
@@ -1451,6 +1452,8 @@ h2pas_debug:
 	$(MAKE) -C h2pas debug
 	$(MAKE) -C h2pas debug
 h2pas_smart:
 h2pas_smart:
 	$(MAKE) -C h2pas smart
 	$(MAKE) -C h2pas smart
+h2pas_release:
+	$(MAKE) -C h2pas release
 h2pas_examples:
 h2pas_examples:
 	$(MAKE) -C h2pas examples
 	$(MAKE) -C h2pas examples
 h2pas_shared:
 h2pas_shared:
@@ -1479,15 +1482,11 @@ h2pas_cleanall:
 	$(MAKE) -C h2pas cleanall
 	$(MAKE) -C h2pas cleanall
 h2pas_info:
 h2pas_info:
 	$(MAKE) -C h2pas info
 	$(MAKE) -C h2pas info
-h2pas_makefile:
-	$(MAKE) -C h2pas makefile
 h2pas_makefiles:
 h2pas_makefiles:
 	$(MAKE) -C h2pas makefiles
 	$(MAKE) -C h2pas makefiles
-h2pas_makefile_dirs:
-	$(MAKE) -C h2pas makefile_dirs
 h2pas:
 h2pas:
 	$(MAKE) -C h2pas all
 	$(MAKE) -C h2pas all
-.PHONY: h2pas_all h2pas_debug h2pas_smart h2pas_examples h2pas_shared h2pas_install h2pas_sourceinstall h2pas_exampleinstall h2pas_distinstall h2pas_zipinstall h2pas_zipsourceinstall h2pas_zipexampleinstall h2pas_zipdistinstall h2pas_clean h2pas_distclean h2pas_cleanall h2pas_info h2pas_makefile h2pas_makefiles h2pas_makefile_dirs h2pas
+.PHONY: h2pas_all h2pas_debug h2pas_smart h2pas_release h2pas_examples h2pas_shared h2pas_install h2pas_sourceinstall h2pas_exampleinstall h2pas_distinstall h2pas_zipinstall h2pas_zipsourceinstall h2pas_zipexampleinstall h2pas_zipdistinstall h2pas_clean h2pas_distclean h2pas_cleanall h2pas_info h2pas_makefiles h2pas
 endif
 endif
 ifdef TARGET_DIRS_FPRCP
 ifdef TARGET_DIRS_FPRCP
 fprcp_all:
 fprcp_all:
@@ -1496,6 +1495,8 @@ fprcp_debug:
 	$(MAKE) -C fprcp debug
 	$(MAKE) -C fprcp debug
 fprcp_smart:
 fprcp_smart:
 	$(MAKE) -C fprcp smart
 	$(MAKE) -C fprcp smart
+fprcp_release:
+	$(MAKE) -C fprcp release
 fprcp_examples:
 fprcp_examples:
 	$(MAKE) -C fprcp examples
 	$(MAKE) -C fprcp examples
 fprcp_shared:
 fprcp_shared:
@@ -1524,15 +1525,11 @@ fprcp_cleanall:
 	$(MAKE) -C fprcp cleanall
 	$(MAKE) -C fprcp cleanall
 fprcp_info:
 fprcp_info:
 	$(MAKE) -C fprcp info
 	$(MAKE) -C fprcp info
-fprcp_makefile:
-	$(MAKE) -C fprcp makefile
 fprcp_makefiles:
 fprcp_makefiles:
 	$(MAKE) -C fprcp makefiles
 	$(MAKE) -C fprcp makefiles
-fprcp_makefile_dirs:
-	$(MAKE) -C fprcp makefile_dirs
 fprcp:
 fprcp:
 	$(MAKE) -C fprcp all
 	$(MAKE) -C fprcp all
-.PHONY: fprcp_all fprcp_debug fprcp_smart fprcp_examples fprcp_shared fprcp_install fprcp_sourceinstall fprcp_exampleinstall fprcp_distinstall fprcp_zipinstall fprcp_zipsourceinstall fprcp_zipexampleinstall fprcp_zipdistinstall fprcp_clean fprcp_distclean fprcp_cleanall fprcp_info fprcp_makefile fprcp_makefiles fprcp_makefile_dirs fprcp
+.PHONY: fprcp_all fprcp_debug fprcp_smart fprcp_release fprcp_examples fprcp_shared fprcp_install fprcp_sourceinstall fprcp_exampleinstall fprcp_distinstall fprcp_zipinstall fprcp_zipsourceinstall fprcp_zipexampleinstall fprcp_zipdistinstall fprcp_clean fprcp_distclean fprcp_cleanall fprcp_info fprcp_makefiles fprcp
 endif
 endif
 ifdef TARGET_DIRS_DXEGEN
 ifdef TARGET_DIRS_DXEGEN
 dxegen_all:
 dxegen_all:
@@ -1541,6 +1538,8 @@ dxegen_debug:
 	$(MAKE) -C dxegen debug
 	$(MAKE) -C dxegen debug
 dxegen_smart:
 dxegen_smart:
 	$(MAKE) -C dxegen smart
 	$(MAKE) -C dxegen smart
+dxegen_release:
+	$(MAKE) -C dxegen release
 dxegen_examples:
 dxegen_examples:
 	$(MAKE) -C dxegen examples
 	$(MAKE) -C dxegen examples
 dxegen_shared:
 dxegen_shared:
@@ -1569,19 +1568,16 @@ dxegen_cleanall:
 	$(MAKE) -C dxegen cleanall
 	$(MAKE) -C dxegen cleanall
 dxegen_info:
 dxegen_info:
 	$(MAKE) -C dxegen info
 	$(MAKE) -C dxegen info
-dxegen_makefile:
-	$(MAKE) -C dxegen makefile
 dxegen_makefiles:
 dxegen_makefiles:
 	$(MAKE) -C dxegen makefiles
 	$(MAKE) -C dxegen makefiles
-dxegen_makefile_dirs:
-	$(MAKE) -C dxegen makefile_dirs
 dxegen:
 dxegen:
 	$(MAKE) -C dxegen all
 	$(MAKE) -C dxegen all
-.PHONY: dxegen_all dxegen_debug dxegen_smart dxegen_examples dxegen_shared dxegen_install dxegen_sourceinstall dxegen_exampleinstall dxegen_distinstall dxegen_zipinstall dxegen_zipsourceinstall dxegen_zipexampleinstall dxegen_zipdistinstall dxegen_clean dxegen_distclean dxegen_cleanall dxegen_info dxegen_makefile dxegen_makefiles dxegen_makefile_dirs dxegen
+.PHONY: dxegen_all dxegen_debug dxegen_smart dxegen_release dxegen_examples dxegen_shared dxegen_install dxegen_sourceinstall dxegen_exampleinstall dxegen_distinstall dxegen_zipinstall dxegen_zipsourceinstall dxegen_zipexampleinstall dxegen_zipdistinstall dxegen_clean dxegen_distclean dxegen_cleanall dxegen_info dxegen_makefiles dxegen
 endif
 endif
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 all: fpc_all $(addsuffix _all,$(TARGET_DIRS))
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 shared: $(addsuffix _shared,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
@@ -1596,10 +1592,8 @@ clean: fpc_clean $(addsuffix _clean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 distclean: fpc_distclean $(addsuffix _distclean,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 cleanall: fpc_cleanall $(addsuffix _cleanall,$(TARGET_DIRS))
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
utils/dxegen/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -860,15 +877,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1020,6 +1038,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1087,13 +1107,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1101,6 +1121,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1115,10 +1136,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
utils/fprcp/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -676,6 +695,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -712,9 +732,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -858,15 +875,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1018,6 +1036,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1085,13 +1105,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1099,6 +1119,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1113,10 +1134,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
utils/h2pas/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -677,6 +696,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -713,9 +733,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -859,15 +876,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1019,6 +1037,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1086,13 +1106,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1100,6 +1120,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1114,10 +1135,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
utils/simulator/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -676,6 +695,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -712,9 +732,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -858,15 +875,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1018,6 +1036,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1085,13 +1105,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1099,6 +1119,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 install: fpc_install
 install: fpc_install
@@ -1113,10 +1134,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

+ 39 - 20
utils/tply/Makefile

@@ -1,7 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/27]
 #
 #
 default: all
 default: all
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
 inUnix=1
@@ -13,10 +14,7 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
 ifeq ($(PWD),)
 ifeq ($(PWD),)
-nopwd:
-	@echo You need the GNU utils package to use this Makefile!
-	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
-	@exit
+$(error You need the GNU utils package to use this Makefile)
 else
 else
 PWD:=$(firstword $(PWD))
 PWD:=$(firstword $(PWD))
 SRCEXEEXT=
 SRCEXEEXT=
@@ -94,23 +92,44 @@ ifndef FPC_VERSION
 FPC_VERSION:=$(shell $(FPC) -iV)
 FPC_VERSION:=$(shell $(FPC) -iV)
 endif
 endif
 export FPC FPC_VERSION
 export FPC FPC_VERSION
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 1,$(COMPILERINFO))
+endif
 ifndef CPU_TARGET
 ifndef CPU_TARGET
-CPU_TARGET:=$(shell $(FPC) -iTP)
+CPU_TARGET:=$(word 2,$(COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 3,$(COMPILERINFO))
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 4,$(COMPILERINFO))
+endif
+else
 ifndef CPU_SOURCE
 ifndef CPU_SOURCE
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 CPU_SOURCE:=$(shell $(FPC) -iSP)
 endif
 endif
-ifndef OS_TARGET
-OS_TARGET:=$(shell $(FPC) -iTO)
+ifndef CPU_TARGET
+CPU_TARGET:=$(shell $(FPC) -iTP)
 endif
 endif
 ifndef OS_SOURCE
 ifndef OS_SOURCE
 OS_SOURCE:=$(shell $(FPC) -iSO)
 OS_SOURCE:=$(shell $(FPC) -iSO)
 endif
 endif
+ifndef OS_TARGET
+OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+endif
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 ifneq ($(FULL_TARGET),$(FULL_SOURCE))
 CROSSCOMPILE=1
 CROSSCOMPILE=1
 endif
 endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(OS_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(OS_TARGET), please run fpcmake first)
+endif
+endif
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE CROSSCOMPILE
 ifdef FPCDIR
 ifdef FPCDIR
 override FPCDIR:=$(subst \,/,$(FPCDIR))
 override FPCDIR:=$(subst \,/,$(FPCDIR))
@@ -678,6 +697,7 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
+override REQUIRE_PACKAGES=rtl 
 ifeq ($(OS_TARGET),linux)
 ifeq ($(OS_TARGET),linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -714,9 +734,6 @@ endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
 ifneq ($(PACKAGEDIR_RTL),)
-override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
-$(PACKAGEDIR_RTL)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL) all
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 ifneq ($(wildcard $(PACKAGEDIR_RTL)/$(OS_TARGET)),)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
 else
 else
@@ -869,15 +886,16 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLTARGET)
 $(FPCMADE): $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_packages: $(COMPILEPACKAGES)
-fpc_all: fpc_packages $(FPCMADE)
+fpc_all: $(FPCMADE)
 fpc_smart:
 fpc_smart:
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 	$(MAKE) all LINKSMART=1 CREATESMART=1
 fpc_debug:
 fpc_debug:
 	$(MAKE) all DEBUG=1
 	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
@@ -1029,6 +1047,8 @@ fpc_baseinfo:
 	@$(ECHO)
 	@$(ECHO)
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)  == Directory info ==
 	@$(ECHO)
 	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  Basedir......... $(BASEDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  FPCDir.......... $(FPCDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
 	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
@@ -1096,13 +1116,13 @@ fpc_info: $(INFORULES)
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 .PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
 	fpc_makefile_dirs
 	fpc_makefile_dirs
 fpc_makefile:
 fpc_makefile:
-	$(FPCMAKE) -w Makefile.fpc
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
 fpc_makefile_sub1:
 fpc_makefile_sub1:
 ifdef TARGET_DIRS
 ifdef TARGET_DIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
 endif
 endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
 endif
 endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
@@ -1110,6 +1130,7 @@ fpc_makefiles: fpc_makefile fpc_makefile_dirs
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
+release: fpc_release
 examples:
 examples:
 shared:
 shared:
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
@@ -1123,10 +1144,8 @@ clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info
-makefile: fpc_makefile
 makefiles: fpc_makefiles
 makefiles: fpc_makefiles
-makefile_dirs: fpc_makefile_dirs
-.PHONY: all debug smart examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefile makefiles makefile_dirs
+.PHONY: all debug smart release examples shared sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif