Browse Source

* lcl updates
* small optimizes for package check

peter 23 years ago
parent
commit
3175676917
5 changed files with 411 additions and 262 deletions
  1. 66 53
      utils/fpcm/Makefile
  2. 182 161
      utils/fpcm/fpcmake.inc
  3. 104 17
      utils/fpcm/fpcmake.ini
  4. 25 6
      utils/fpcm/fpcmmain.pp
  5. 34 25
      utils/fpcm/fpcmwr.pp

+ 66 - 53
utils/fpcm/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2001/12/13]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2002/01/06]
 #
 #
 default: all
 default: all
 override PATH:=$(subst \,/,$(PATH))
 override PATH:=$(subst \,/,$(PATH))
@@ -70,6 +70,7 @@ endif
 else
 else
 BASEDIR=.
 BASEDIR=.
 endif
 endif
+override DEFAULT_FPCDIR=../..
 ifndef FPC
 ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
@@ -119,10 +120,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 +198,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
@@ -750,14 +756,11 @@ REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_FCL=1
 REQUIRE_PACKAGES_FCL=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:
+override COMPILEPACKAGES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
+$(PACKAGEDIR_RTL)/$(FPCMADE):
 	$(MAKE) -C $(PACKAGEDIR_RTL) all
 	$(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
@@ -777,14 +780,11 @@ override COMPILER_UNITDIR+=$(UNITDIR_RTL)
 endif
 endif
 endif
 endif
 ifdef REQUIRE_PACKAGES_PASZLIB
 ifdef REQUIRE_PACKAGES_PASZLIB
-PACKAGEDIR_PASZLIB:=$(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),)
-PACKAGEDIR_PASZLIB:=$(firstword $(PACKAGEDIR_PASZLIB))
-ifeq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_paszlib
-package_paszlib:
+override COMPILEPACKAGES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
+$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
 	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
 	$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
-endif
 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
@@ -804,14 +804,11 @@ override COMPILER_UNITDIR+=$(UNITDIR_PASZLIB)
 endif
 endif
 endif
 endif
 ifdef REQUIRE_PACKAGES_INET
 ifdef REQUIRE_PACKAGES_INET
-PACKAGEDIR_INET:=$(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),)
-PACKAGEDIR_INET:=$(firstword $(PACKAGEDIR_INET))
-ifeq ($(wildcard $(PACKAGEDIR_INET)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_inet
-package_inet:
+override COMPILEPACKAGES+=$(PACKAGEDIR_INET)/$(FPCMADE)
+$(PACKAGEDIR_INET)/$(FPCMADE):
 	$(MAKE) -C $(PACKAGEDIR_INET) all
 	$(MAKE) -C $(PACKAGEDIR_INET) all
-endif
 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
@@ -831,14 +828,11 @@ override COMPILER_UNITDIR+=$(UNITDIR_INET)
 endif
 endif
 endif
 endif
 ifdef REQUIRE_PACKAGES_FCL
 ifdef REQUIRE_PACKAGES_FCL
-PACKAGEDIR_FCL:=$(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),)
-PACKAGEDIR_FCL:=$(firstword $(PACKAGEDIR_FCL))
-ifeq ($(wildcard $(PACKAGEDIR_FCL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_fcl
-package_fcl:
+override COMPILEPACKAGES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
+$(PACKAGEDIR_FCL)/$(FPCMADE):
 	$(MAKE) -C $(PACKAGEDIR_FCL) all
 	$(MAKE) -C $(PACKAGEDIR_FCL) all
-endif
 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
@@ -858,14 +852,11 @@ override COMPILER_UNITDIR+=$(UNITDIR_FCL)
 endif
 endif
 endif
 endif
 ifdef REQUIRE_PACKAGES_MYSQL
 ifdef REQUIRE_PACKAGES_MYSQL
-PACKAGEDIR_MYSQL:=$(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),)
-PACKAGEDIR_MYSQL:=$(firstword $(PACKAGEDIR_MYSQL))
-ifeq ($(wildcard $(PACKAGEDIR_MYSQL)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_mysql
-package_mysql:
+override COMPILEPACKAGES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
+$(PACKAGEDIR_MYSQL)/$(FPCMADE):
 	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
 	$(MAKE) -C $(PACKAGEDIR_MYSQL) all
-endif
 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
@@ -885,14 +876,11 @@ override COMPILER_UNITDIR+=$(UNITDIR_MYSQL)
 endif
 endif
 endif
 endif
 ifdef REQUIRE_PACKAGES_IBASE
 ifdef REQUIRE_PACKAGES_IBASE
-PACKAGEDIR_IBASE:=$(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),)
-PACKAGEDIR_IBASE:=$(firstword $(PACKAGEDIR_IBASE))
-ifeq ($(wildcard $(PACKAGEDIR_IBASE)/$(FPCMADE)),)
-override COMPILEPACKAGES+=package_ibase
-package_ibase:
+override COMPILEPACKAGES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
+$(PACKAGEDIR_IBASE)/$(FPCMADE):
 	$(MAKE) -C $(PACKAGEDIR_IBASE) all
 	$(MAKE) -C $(PACKAGEDIR_IBASE) all
-endif
 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
@@ -911,7 +899,6 @@ ifdef UNITDIR_IBASE
 override COMPILER_UNITDIR+=$(UNITDIR_IBASE)
 override COMPILER_UNITDIR+=$(UNITDIR_IBASE)
 endif
 endif
 endif
 endif
-.PHONY: package_rtl package_paszlib package_inet package_fcl package_mysql package_ibase
 ifndef NOCPUDEF
 ifndef NOCPUDEF
 override FPCOPTDEF=$(CPU_TARGET)
 override FPCOPTDEF=$(CPU_TARGET)
 endif
 endif
@@ -1052,7 +1039,7 @@ 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
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(COMPILER) $<
 	$(EXECPPAS)
 	$(EXECPPAS)
@@ -1065,6 +1052,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)
@@ -1072,6 +1061,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))
@@ -1173,12 +1165,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)
@@ -1212,7 +1205,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)
@@ -1226,12 +1219,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)
@@ -1258,6 +1252,22 @@ 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 Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w $(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
 ifndef DATA2INC
 ifndef DATA2INC
 DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(SRCEXEEXT),$(SEARCHPATH))))
 DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(DATA2INC),)
 ifeq ($(DATA2INC),)
@@ -1284,7 +1294,10 @@ 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
+makefile: fpc_makefile
+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
 ifneq ($(wildcard fpcmake.loc),)
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif

File diff suppressed because it is too large
+ 182 - 161
utils/fpcm/fpcmake.inc


+ 104 - 17
utils/fpcm/fpcmake.ini

@@ -198,6 +198,15 @@ else
 override FPCDIR=wrong
 override FPCDIR=wrong
 endif
 endif
 
 
+# Default FPCDIR from Makefile.fpc
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
 
 
 [fpcdirdetect]
 [fpcdirdetect]
 # Detect FPCDIR
 # Detect FPCDIR
@@ -353,6 +362,13 @@ UNIXINSTALLDIR=1
 endif
 endif
 endif
 endif
 
 
+# When install prefix is not set try to use prefix
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+
 # set the prefix directory where to install everything
 # set the prefix directory where to install everything
 ifndef INSTALL_PREFIX
 ifndef INSTALL_PREFIX
 ifdef UNIXINSTALLDIR
 ifdef UNIXINSTALLDIR
@@ -1012,8 +1028,9 @@ 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)
@@ -1100,7 +1117,7 @@ fpc_debug:
 
 
 # General compile rules, available for both possible .pp and .pas extensions
 # General compile rules, available for both possible .pp and .pas extensions
 
 
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
 
 
 %$(PPUEXT): %.pp
 %$(PPUEXT): %.pp
         $(COMPILER) $<
         $(COMPILER) $<
@@ -1118,6 +1135,9 @@ fpc_debug:
         $(COMPILER) $<
         $(COMPILER) $<
         $(EXECPPAS)
         $(EXECPPAS)
 
 
+%.res: %.rc
+        windres -i $< -o $@
+
 # Search paths for .ppu and .pp and .pas
 # Search paths for .ppu and .pp and .pas
 vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
@@ -1163,6 +1183,10 @@ 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))
@@ -1402,20 +1426,22 @@ 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
 
 
 
 
-[inforules]
+[baseinforules]
 #####################################################################
 #####################################################################
-# Info rules
+# Base info rules
 #####################################################################
 #####################################################################
 
 
-.PHONY: fpc_info
+.PHONY: fpc_baseinfo
+
+override INFORULES+=fpc_baseinfo
 
 
-fpc_info:
+fpc_baseinfo:
         @$(ECHO)
         @$(ECHO)
         @$(ECHO)  == Package info ==
         @$(ECHO)  == Package info ==
         @$(ECHO)  Package Name..... $(PACKAGE_NAME)
         @$(ECHO)  Package Name..... $(PACKAGE_NAME)
@@ -1463,12 +1489,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)
@@ -1496,6 +1523,40 @@ fpc_info:
         @$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
         @$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
         @$(ECHO)
         @$(ECHO)
 
 
+[inforules]
+#####################################################################
+# Info rules
+#####################################################################
+
+.PHONY: fpc_info
+
+fpc_info: $(INFORULES)
+
+[makefilerules]
+#####################################################################
+# Rebuild Makefile
+#####################################################################
+
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+        fpc_makefile_dirs
+
+fpc_makefile:
+        $(FPCMAKE) -w Makefile.fpc
+
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+        $(FPCMAKE) -w $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+        $(FPCMAKE) -w $(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
+
 [localmakefile]
 [localmakefile]
 #####################################################################
 #####################################################################
 # Local Makefile
 # Local Makefile
@@ -1505,12 +1566,13 @@ ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 include fpcmake.loc
 endif
 endif
 
 
+
 [userrules]
 [userrules]
 #####################################################################
 #####################################################################
 # Users rules
 # Users rules
 #####################################################################
 #####################################################################
 
 
-[lclprerules]
+[lclrules]
 #####################################################################
 #####################################################################
 # LCL Rules
 # LCL Rules
 #####################################################################
 #####################################################################
@@ -1524,13 +1586,21 @@ export LCL_PLATFORM
 # Check if the specified LCLDIR is correct
 # Check if the specified LCLDIR is correct
 ifdef LCLDIR
 ifdef LCLDIR
 override LCLDIR:=$(subst \,/,$(LCLDIR))
 override LCLDIR:=$(subst \,/,$(LCLDIR))
-ifeq ($(wildcard $(LCLDIR)/units/$(LCL_PLATFORM),)
+ifeq ($(wildcard $(LCLDIR)/units/$(LCL_PLATFORM)),)
 override LCLDIR=wrong
 override LCLDIR=wrong
 endif
 endif
 else
 else
 override LCLDIR=wrong
 override LCLDIR=wrong
 endif
 endif
 
 
+# Check if the default LCLDIR is correct
+ifdef DEFAULT_LCLDIR
+override LCLDIR:=$(subst \,/,$(DEFAULT_LCLDIR))
+ifeq ($(wildcard $(LCLDIR)/units/$(LCL_PLATFORM)),)
+override LCLDIR=wrong
+endif
+endif
+
 # Check for development version
 # Check for development version
 ifeq ($(LCLDIR),wrong)
 ifeq ($(LCLDIR),wrong)
 override LCLDIR=$(subst /units/$(LCL_PLATFORM),,$(firstword $(wildcard $(addsuffix /units/$(LCL_PLATFORM),$(BASEDIR)/lcl $(BASEDIR)))))
 override LCLDIR=$(subst /units/$(LCL_PLATFORM),,$(firstword $(wildcard $(addsuffix /units/$(LCL_PLATFORM),$(BASEDIR)/lcl $(BASEDIR)))))
@@ -1553,5 +1623,22 @@ override LCLCOMPONENTDIR:=$(wildcard $(LCLDIR)/.. $(LCLDIR)/../components $(LCLD
 export LCLDIR LCLUNITDIR LCLCOMPONENTDIR
 export LCLDIR LCLUNITDIR LCLCOMPONENTDIR
 
 
 # Add LCL dirs to paths
 # Add LCL dirs to paths
-override REQUIRE_PACKAGEDIR+=$(LCLCOMPONENTDIR)
+override REQUIRE_PACKAGESDIR+=$(LCLCOMPONENTDIR)
 override COMPILER_UNITDIR+=$(LCLUNITDIR)
 override COMPILER_UNITDIR+=$(LCLUNITDIR)
+
+[lclinforules]
+#####################################################################
+# LCL Info rules
+#####################################################################
+override INFORULES+=lclinfo
+
+.PHONY: lclinfo
+
+lclinfo:
+        @$(ECHO)  == LCL info ==
+        @$(ECHO)
+        @$(ECHO)  Platform............. $(LCL_PLATFORM)
+        @$(ECHO)  LCLDIR............... $(LCLDIR)
+        @$(ECHO)  LCL Unit dir......... $(LCLUNITDIR)
+        @$(ECHO)  LCL Component dir.... $(LCLCOMPONENTDIR)
+        @$(ECHO)

+ 25 - 6
utils/fpcm/fpcmmain.pp

@@ -117,6 +117,7 @@ interface
         FSections       : TDictionary;
         FSections       : TDictionary;
         FPackageSec,
         FPackageSec,
         FExportSec      : TFPCMakeSection;
         FExportSec      : TFPCMakeSection;
+        FUsesLCL,
         FIsPackage      : boolean;
         FIsPackage      : boolean;
         FPackageName,
         FPackageName,
         FPackageVersion,
         FPackageVersion,
@@ -157,6 +158,7 @@ interface
         property Section[const s:string]:TDictionaryItem read GetSec;default;
         property Section[const s:string]:TDictionaryItem read GetSec;default;
         property RequireList:TTargetRequireList read FRequireList;
         property RequireList:TTargetRequireList read FRequireList;
         property Variables:TKeyValue read FVariables;
         property Variables:TKeyValue read FVariables;
+        property UsesLCL:boolean read FUsesLCL;
         property IsPackage:boolean read FIsPackage;
         property IsPackage:boolean read FIsPackage;
         property PackageName:string read FPackageName;
         property PackageName:string read FPackageName;
         property PackageVersion:string read FPackageVersion;
         property PackageVersion:string read FPackageVersion;
@@ -512,6 +514,7 @@ implementation
         FExportSec:=nil;
         FExportSec:=nil;
         FIncludeTargets:=[low(TTarget)..high(TTarget)];
         FIncludeTargets:=[low(TTarget)..high(TTarget)];
         VerboseIdent:='';
         VerboseIdent:='';
+        FUsesLCL:=false;
       end;
       end;
 
 
 
 
@@ -606,7 +609,10 @@ implementation
         { Load LCL code ? }
         { Load LCL code ? }
         s:=GetVariable('require_packages',true);
         s:=GetVariable('require_packages',true);
         if pos('lcl',s)>0 then
         if pos('lcl',s)>0 then
-         AddLCLDefaultVariables;
+         begin
+           FUsesLCL:=true;
+           AddLCLDefaultVariables;
+         end;
         { Show globals }
         { Show globals }
         Verbose(FPCMakeDebug,s_globals);
         Verbose(FPCMakeDebug,s_globals);
         Variables.Foreach(@PrintDic);
         Variables.Foreach(@PrintDic);
@@ -765,13 +771,13 @@ implementation
         SetVariable('TARGET',TargetStr[t],false);
         SetVariable('TARGET',TargetStr[t],false);
         { Check for Makefile.fpc }
         { Check for Makefile.fpc }
         s:=SubstVariables('$(addsuffix /'+ReqName+'/Makefile.fpc,$(FPCDIR)) $(addsuffix /'+ReqName+'/Makefile.fpc,$(PACKAGESDIR)) $(addsuffix /'+ReqName+'/Makefile.fpc,$(REQUIRE_PACKAGESDIR))');
         s:=SubstVariables('$(addsuffix /'+ReqName+'/Makefile.fpc,$(FPCDIR)) $(addsuffix /'+ReqName+'/Makefile.fpc,$(PACKAGESDIR)) $(addsuffix /'+ReqName+'/Makefile.fpc,$(REQUIRE_PACKAGESDIR))');
-        Verbose(FPCMakeDebug,'Looking for Makefile.fpc: "'+s+'"');
+        Verbose(FPCMakeDebug,'Package "'+ReqName+'": Looking for Makefile.fpc: "'+s+'"');
         s:=SubstVariables('$(firstword $(wildcard '+s+'))');
         s:=SubstVariables('$(firstword $(wildcard '+s+'))');
         if TryFile(s) then
         if TryFile(s) then
          exit;
          exit;
         { Check for Package.fpc }
         { Check for Package.fpc }
         s:=SubstVariables('$(addsuffix /'+ReqName+'/Package.fpc,$(FPCDIR)) $(addsuffix /'+ReqName+'/Package.fpc,$(UNITSDIR)) $(addsuffix /'+ReqName+'/Package.fpc,$(REQUIRE_UNITSDIR))');
         s:=SubstVariables('$(addsuffix /'+ReqName+'/Package.fpc,$(FPCDIR)) $(addsuffix /'+ReqName+'/Package.fpc,$(UNITSDIR)) $(addsuffix /'+ReqName+'/Package.fpc,$(REQUIRE_UNITSDIR))');
-        Verbose(FPCMakeDebug,'Looking for Package.fpc: "'+s+'"');
+        Verbose(FPCMakeDebug,'Package "'+ReqName+'": Looking for Package.fpc: "'+s+'"');
         s:=SubstVariables('$(firstword $(wildcard '+s+'))');
         s:=SubstVariables('$(firstword $(wildcard '+s+'))');
         if TryFile(s) then
         if TryFile(s) then
          exit;
          exit;
@@ -1335,7 +1341,7 @@ implementation
         Sec : TFPCMakeSection;
         Sec : TFPCMakeSection;
         P   : TKeyValueItem;
         P   : TKeyValueItem;
         i   : integer;
         i   : integer;
-        key : string;
+        tempval,key : string;
       begin
       begin
         Result:='';
         Result:='';
         i:=Pos('_',inivar);
         i:=Pos('_',inivar);
@@ -1357,7 +1363,16 @@ implementation
             TKeyValue(Sec.Dictionary).Add(key,value);
             TKeyValue(Sec.Dictionary).Add(key,value);
          end
          end
         else
         else
-         Variables[IniVar]:=value;
+         begin
+           if Add then
+            begin
+              tempval:=Variables[IniVar];
+              AddToken(tempval,Value,' ');
+              Variables[IniVar]:=tempval;
+            end
+           else
+            Variables[IniVar]:=Value;
+         end;
       end;
       end;
 
 
 
 
@@ -1419,7 +1434,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.18  2001-12-26 21:02:00  peter
+  Revision 1.19  2002-01-06 21:50:04  peter
+    * lcl updates
+    * small optimizes for package check
+
+  Revision 1.18  2001/12/26 21:02:00  peter
     * little support for lcl and lazarus, but not yet working
     * little support for lcl and lazarus, but not yet working
 
 
   Revision 1.17  2001/12/15 04:16:57  carl
   Revision 1.17  2001/12/15 04:16:57  carl

+ 34 - 25
utils/fpcm/fpcmwr.pp

@@ -26,7 +26,7 @@ interface
         sec_units,sec_exes,sec_loaders,sec_examples,sec_rsts,
         sec_units,sec_exes,sec_loaders,sec_examples,sec_rsts,
         sec_compile,sec_install,
         sec_compile,sec_install,
         sec_distinstall,sec_zipinstall,sec_clean,sec_libs,
         sec_distinstall,sec_zipinstall,sec_clean,sec_libs,
-        sec_command,sec_exts,sec_dirs,sec_tools,sec_info
+        sec_command,sec_exts,sec_dirs,sec_tools,sec_info,sec_makefile
       );
       );
 
 
       trules=(
       trules=(
@@ -36,7 +36,7 @@ interface
         r_install,r_sourceinstall,r_exampleinstall,r_distinstall,
         r_install,r_sourceinstall,r_exampleinstall,r_distinstall,
         r_zipinstall,r_zipsourceinstall,r_zipexampleinstall,r_zipdistinstall,
         r_zipinstall,r_zipsourceinstall,r_zipexampleinstall,r_zipdistinstall,
         r_clean,r_distclean,r_cleanall,
         r_clean,r_distclean,r_cleanall,
-        r_info
+        r_info,r_makefile,r_makefiles,r_makefile_dirs
       );
       );
 
 
 
 
@@ -48,7 +48,7 @@ interface
         'install','sourceinstall','exampleinstall','distinstall',
         'install','sourceinstall','exampleinstall','distinstall',
         'zipinstall','zipsourceinstall','zipexampleinstall','zipdistinstall',
         'zipinstall','zipsourceinstall','zipexampleinstall','zipdistinstall',
         'clean','distclean','cleanall',
         'clean','distclean','cleanall',
-        'info'
+        'info','makefile','makefiles','makefile_dirs'
       );
       );
 
 
       rule2sec : array[trules] of tsections=(
       rule2sec : array[trules] of tsections=(
@@ -58,7 +58,7 @@ interface
         sec_install,sec_install,sec_install,sec_distinstall,
         sec_install,sec_install,sec_install,sec_distinstall,
         sec_zipinstall,sec_zipinstall,sec_zipinstall,sec_zipinstall,
         sec_zipinstall,sec_zipinstall,sec_zipinstall,sec_zipinstall,
         sec_clean,sec_clean,sec_clean,
         sec_clean,sec_clean,sec_clean,
-        sec_info
+        sec_info,sec_makefile,sec_makefile,sec_makefile
       );
       );
 
 
 
 
@@ -505,7 +505,8 @@ implementation
              if CheckVariable('default_dir') then
              if CheckVariable('default_dir') then
               hs:=hs+' $(addsuffix _'+rule2str[rule]+',$(DEFAULT_DIR))'
               hs:=hs+' $(addsuffix _'+rule2str[rule]+',$(DEFAULT_DIR))'
              else
              else
-              if not(rule in [r_sourceinstall,r_zipinstall,r_zipsourceinstall]) or
+              if not(rule in [r_sourceinstall,r_zipinstall,r_zipsourceinstall,
+                              r_makefile,r_makefiles,r_makefile_dirs]) or
                  not(CheckVariable('package_name')) then
                  not(CheckVariable('package_name')) then
                hs:=hs+' $(addsuffix _'+rule2str[rule]+',$(TARGET_DIRS))';
                hs:=hs+' $(addsuffix _'+rule2str[rule]+',$(TARGET_DIRS))';
            end;
            end;
@@ -587,17 +588,17 @@ implementation
           { create needed variables }
           { create needed variables }
           packdirvar:='PACKAGEDIR_'+VarName(pack);
           packdirvar:='PACKAGEDIR_'+VarName(pack);
           unitdirvar:='UNITDIR_'+VarName(pack);
           unitdirvar:='UNITDIR_'+VarName(pack);
-          { Search packagedir by looking for Makefile.fpc }
-          FOutput.Add(packdirvar+':=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /'+pack+'/Makefile.fpc,$(PACKAGESDIR)))))');
+          { Search packagedir by looking for Makefile.fpc, for the RTL look
+            direct in the corresponding target directory }
+          if pack='rtl' then
+           FOutput.Add(packdirvar+':=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /'+pack+'/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))')
+          else 
+           FOutput.Add(packdirvar+':=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /'+pack+'/Makefile.fpc,$(PACKAGESDIR))))))');
           FOutput.Add('ifneq ($('+packdirvar+'),)');
           FOutput.Add('ifneq ($('+packdirvar+'),)');
-          FOutput.Add(packdirvar+':=$(firstword $('+packdirvar+'))');
           { If Packagedir found look for FPCMade }
           { If Packagedir found look for FPCMade }
-          FOutput.Add('ifeq ($(wildcard $('+packdirvar+')/$(FPCMADE)),)');
-          FOutput.Add('override COMPILEPACKAGES+=package_'+pack);
-          AddPhony('package_'+pack);
-          FOutput.Add('package_'+pack+':');
+          FOutput.Add('override COMPILEPACKAGES+=$('+packdirvar+')/$(FPCMADE)');
+          FOutput.Add('$('+packdirvar+')/$(FPCMADE):');
           FOutput.Add(#9'$(MAKE) -C $('+packdirvar+') all');
           FOutput.Add(#9'$(MAKE) -C $('+packdirvar+') all');
-          FOutput.Add('endif');
           { Create unit dir, check if os dependent dir exists }
           { Create unit dir, check if os dependent dir exists }
           FOutput.Add('ifneq ($(wildcard $('+packdirvar+')/$(OS_TARGET)),)');
           FOutput.Add('ifneq ($(wildcard $('+packdirvar+')/$(OS_TARGET)),)');
           FOutput.Add(unitdirvar+'=$('+packdirvar+')/$(OS_TARGET)');
           FOutput.Add(unitdirvar+'=$('+packdirvar+')/$(OS_TARGET)');
@@ -758,24 +759,21 @@ implementation
            else if CheckVariable('default_cpu') then
            else if CheckVariable('default_cpu') then
             Add('CPU_TARGET='+FInput.GetVariable('default_cpu',false));
             Add('CPU_TARGET='+FInput.GetVariable('default_cpu',false));
            { FPC Detection }
            { FPC Detection }
+           AddVariable('default_fpcdir');
            AddIniSection('fpcdetect');
            AddIniSection('fpcdetect');
            AddIniSection('fpcdircheckenv');
            AddIniSection('fpcdircheckenv');
-           if CheckVariable('default_fpcdir') then
-            begin
-              Add('ifeq ($(FPCDIR),wrong)');
-              Add('override FPCDIR='+FInput.GetVariable('default_fpcdir',false));
-              Add('ifeq ($(wildcard $(FPCDIR)/rtl),)');
-              Add('ifeq ($(wildcard $(FPCDIR)/units),)');
-              Add('override FPCDIR=wrong');
-              Add('endif');
-              Add('endif');
-              Add('endif');
-            end;
            AddIniSection('fpcdirdetect');
            AddIniSection('fpcdirdetect');
            { Package }
            { Package }
            AddVariable('package_name');
            AddVariable('package_name');
            AddVariable('package_version');
            AddVariable('package_version');
            AddVariable('package_targets');
            AddVariable('package_targets');
+           { LCL rules }
+           if FInput.UsesLCL then
+            begin
+              AddVariable('default_lcldir');
+              AddVariable('lcl_platform');
+              AddIniSection('lclrules');
+            end;
            { First add the required packages sections }
            { First add the required packages sections }
 //           for i:=0 to FInput.RequireList.Count-1 do
 //           for i:=0 to FInput.RequireList.Count-1 do
 //            AddCustomSection(FInput.Requirelist[i]);
 //            AddCustomSection(FInput.Requirelist[i]);
@@ -788,6 +786,7 @@ implementation
            AddTargetVariable('target_dirs');
            AddTargetVariable('target_dirs');
            AddTargetVariable('target_programs');
            AddTargetVariable('target_programs');
            AddTargetVariable('target_units');
            AddTargetVariable('target_units');
+           AddTargetVariable('target_implicitunits');
            AddTargetVariable('target_loaders');
            AddTargetVariable('target_loaders');
            AddTargetVariable('target_rsts');
            AddTargetVariable('target_rsts');
            AddTargetVariable('target_examples');
            AddTargetVariable('target_examples');
@@ -798,6 +797,7 @@ implementation
            { Install }
            { Install }
            AddTargetVariable('install_units');
            AddTargetVariable('install_units');
            AddTargetVariable('install_files');
            AddTargetVariable('install_files');
+           AddVariable('install_buildunit');
            AddVariable('install_prefix');
            AddVariable('install_prefix');
            AddVariable('install_basedir');
            AddVariable('install_basedir');
            AddVariable('install_datadir');
            AddVariable('install_datadir');
@@ -856,7 +856,12 @@ implementation
            { clean }
            { clean }
            AddIniSection('cleanrules');
            AddIniSection('cleanrules');
            { info }
            { info }
+           AddIniSection('baseinforules');
+           if FInput.UsesLCL then
+            AddIniSection('lclinforules');
            AddIniSection('inforules');
            AddIniSection('inforules');
+           { info }
+           AddIniSection('makefilerules');
            { Subdirs }
            { Subdirs }
            AddTargetDirs('target_dirs');
            AddTargetDirs('target_dirs');
            AddTargetDirs('target_exampledirs');
            AddTargetDirs('target_exampledirs');
@@ -879,7 +884,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.18  2001-10-14 21:38:33  peter
+  Revision 1.19  2002-01-06 21:50:05  peter
+    * lcl updates
+    * small optimizes for package check
+
+  Revision 1.18  2001/10/14 21:38:33  peter
     * cross compiling support
     * cross compiling support
 
 
   Revision 1.17  2001/09/11 11:04:51  pierre
   Revision 1.17  2001/09/11 11:04:51  pierre

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