MG: old Makefile for 1.0.5 compilers

git-svn-id: trunk@1563 -
This commit is contained in:
lazarus 2002-03-29 12:03:39 +00:00
parent f8ec3dfdf6
commit 94d422e5fa
5 changed files with 309 additions and 278 deletions

View File

@ -1,8 +1,7 @@
#
# Don't edit, this file is generated by FPCMake Version 1.1 [2002/03/28]
# Don't edit, this file is generated by FPCMake Version 1.1 [2001/12/31]
#
default: all
MAKEFILETARGETS=linux
override PATH:=$(subst \,/,$(PATH))
ifeq ($(findstring ;,$(PATH)),)
inUnix=1
@ -14,7 +13,10 @@ PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
ifeq ($(PWD),)
PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
ifeq ($(PWD),)
$(error You need the GNU utils package to use this Makefile)
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
else
PWD:=$(firstword $(PWD))
SRCEXEEXT=
@ -68,22 +70,6 @@ endif
else
BASEDIR=.
endif
ifdef inOS2
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO=echo
else
ECHO:=$(firstword $(ECHO))
endif
else
ECHO:=$(firstword $(ECHO))
endif
endif
export ECHO
endif
ifndef FPC
ifdef PP
FPC=$(PP)
@ -107,45 +93,23 @@ ifndef FPC_VERSION
FPC_VERSION:=$(shell $(FPC) -iV)
endif
export FPC FPC_VERSION
unexport CHECKDEPEND ALLDEPENDENCIES
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
CPU_TARGET:=$(word 2,$(COMPILERINFO))
endif
ifndef OS_SOURCE
OS_SOURCE:=$(word 3,$(COMPILERINFO))
endif
ifndef OS_TARGET
OS_TARGET:=$(word 4,$(COMPILERINFO))
endif
else
ifndef CPU_SOURCE
CPU_SOURCE:=$(shell $(FPC) -iSP)
endif
ifndef CPU_TARGET
CPU_TARGET:=$(shell $(FPC) -iTP)
endif
ifndef OS_SOURCE
OS_SOURCE:=$(shell $(FPC) -iSO)
ifndef CPU_SOURCE
CPU_SOURCE:=$(shell $(FPC) -iSP)
endif
ifndef OS_TARGET
OS_TARGET:=$(shell $(FPC) -iTO)
endif
ifndef OS_SOURCE
OS_SOURCE:=$(shell $(FPC) -iSO)
endif
FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
ifneq ($(FULL_TARGET),$(FULL_SOURCE))
CROSSCOMPILE=1
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
ifdef FPCDIR
override FPCDIR:=$(subst \,/,$(FPCDIR))
@ -155,14 +119,6 @@ endif
else
override FPCDIR=wrong
endif
ifdef DEFAULT_FPCDIR
ifeq ($(FPCDIR),wrong)
override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
override FPCDIR=wrong
endif
endif
endif
ifeq ($(FPCDIR),wrong)
ifdef inUnix
override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
@ -194,11 +150,10 @@ endif
else
UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
endif
PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
override PACKAGE_NAME=codetools
override PACKAGE_VERSION=0.8a
override TARGET_UNITS+=allcodetoolunits
override TARGET_IMPLICITUNITS+=codetoolsstrconsts avl_tree basiccodetools codecache sourcelog customcodetool pascalparsertool finddeclarationtool stdcodetools methodjumptool eventcodetool codecompletiontool codeatom codetree definetemplates expreval keywordfunclists linkscanner sourcechanger fileprocs
override COMPILER_OPTIONS+=-gl
override COMPILER_UNITDIR+=.
override COMPILER_UNITTARGETDIR+=../units
@ -236,11 +191,6 @@ UNIXINSTALLDIR=1
endif
endif
ifndef INSTALL_PREFIX
ifdef PREFIX
INSTALL_PREFIX=$(PREFIX)
endif
endif
ifndef INSTALL_PREFIX
ifdef UNIXINSTALLDIR
INSTALL_PREFIX=/usr/local
else
@ -252,9 +202,6 @@ endif
endif
endif
export INSTALL_PREFIX
ifdef INSTALL_FPCSUBDIR
export INSTALL_FPCSUBDIR
endif
ifndef DIST_DESTDIR
DIST_DESTDIR:=$(BASEDIR)
endif
@ -301,43 +248,41 @@ endif
endif
ifndef INSTALL_SOURCEDIR
ifdef UNIXINSTALLDIR
ifdef INSTALL_FPCPACKAGE
ifdef BSDhier
SRCPREFIXDIR=share/src
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/share/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
else
SRCPREFIXDIR=src
endif
ifdef INSTALL_FPCPACKAGE
ifdef INSTALL_FPCSUBDIR
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
else
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
endif
else
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
ifdef BSDhier
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/share/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
else
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
endif
endif
else
ifdef INSTALL_FPCPACKAGE
ifdef INSTALL_FPCSUBDIR
INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
else
INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
endif
else
INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source
endif
endif
endif
ifndef INSTALL_DOCDIR
ifdef UNIXINSTALLDIR
ifdef BSDhier
DOCPREFIXDIR=share/doc
else
DOCPREFIXDIR=doc
endif
ifdef INSTALL_FPCPACKAGE
INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
ifdef BSDhier
INSTALL_DOCDIR:=$(INSTALL_PREFIX)/share/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
else
INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
endif
else
ifdef BSDhier
INSTALL_DOCDIR:=$(INSTALL_PREFIX)/share/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
else
INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
endif
endif
else
ifdef INSTALL_FPCPACKAGE
@ -458,13 +403,11 @@ PPUEXT=.ppo
ASMEXT=.so2
OEXT=.oo2
AOUTEXT=.out
SMARTEXT=.sl2
STATICLIBPREFIX=
SMARTEXT=.so
STATICLIBEXT=.ao2
SHAREDLIBEXT=.dll
FPCMADE=fpcmade.os2
ZIPSUFFIX=emx
ECHO=echo
endif
ifeq ($(OS_TARGET),amiga)
EXEEXT=
@ -736,7 +679,6 @@ else
TAROPT=vz
TAREXT=.tar.gz
endif
override REQUIRE_PACKAGES=rtl fcl
ifeq ($(OS_TARGET),linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
@ -745,19 +687,76 @@ REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_MYSQL=1
REQUIRE_PACKAGES_IBASE=1
endif
ifeq ($(OS_TARGET),go32v2)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
endif
ifeq ($(OS_TARGET),win32)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_MYSQL=1
REQUIRE_PACKAGES_IBASE=1
endif
ifeq ($(OS_TARGET),os2)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
endif
ifeq ($(OS_TARGET),freebsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_INET=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_MYSQL=1
REQUIRE_PACKAGES_IBASE=1
endif
ifeq ($(OS_TARGET),beos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
endif
ifeq ($(OS_TARGET),netbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_INET=1
REQUIRE_PACKAGES_FCL=1
endif
ifeq ($(OS_TARGET),amiga)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
endif
ifeq ($(OS_TARGET),atari)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
endif
ifeq ($(OS_TARGET),sunos)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
endif
ifeq ($(OS_TARGET),qnx)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
PACKAGEDIR_RTL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR)))))
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)),)
UNITDIR_RTL=$(PACKAGEDIR_RTL)/$(OS_TARGET)
else
UNITDIR_RTL=$(PACKAGEDIR_RTL)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_RTL)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
endif
else
PACKAGEDIR_RTL=
UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
@ -772,18 +771,19 @@ override COMPILER_UNITDIR+=$(UNITDIR_RTL)
endif
endif
ifdef REQUIRE_PACKAGES_PASZLIB
PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
PACKAGEDIR_PASZLIB:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR)))))
ifneq ($(PACKAGEDIR_PASZLIB),)
PACKAGEDIR_PASZLIB:=$(firstword $(PACKAGEDIR_PASZLIB))
ifeq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(FPCMADE)),)
override COMPILEPACKAGES+=package_paszlib
package_paszlib:
$(MAKE) -C $(PACKAGEDIR_PASZLIB) all
endif
ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/$(OS_TARGET)),)
UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/$(OS_TARGET)
else
UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_PASZLIB) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
endif
else
PACKAGEDIR_PASZLIB=
UNITDIR_PASZLIB:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Package.fpc,$(UNITSDIR)))))
@ -798,18 +798,19 @@ override COMPILER_UNITDIR+=$(UNITDIR_PASZLIB)
endif
endif
ifdef REQUIRE_PACKAGES_INET
PACKAGEDIR_INET:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR))))))
PACKAGEDIR_INET:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /inet/Makefile.fpc,$(PACKAGESDIR)))))
ifneq ($(PACKAGEDIR_INET),)
PACKAGEDIR_INET:=$(firstword $(PACKAGEDIR_INET))
ifeq ($(wildcard $(PACKAGEDIR_INET)/$(FPCMADE)),)
override COMPILEPACKAGES+=package_inet
package_inet:
$(MAKE) -C $(PACKAGEDIR_INET) all
endif
ifneq ($(wildcard $(PACKAGEDIR_INET)/$(OS_TARGET)),)
UNITDIR_INET=$(PACKAGEDIR_INET)/$(OS_TARGET)
else
UNITDIR_INET=$(PACKAGEDIR_INET)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_INET)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_INET) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_INET)/$(FPCMADE)
endif
else
PACKAGEDIR_INET=
UNITDIR_INET:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /inet/Package.fpc,$(UNITSDIR)))))
@ -824,18 +825,19 @@ override COMPILER_UNITDIR+=$(UNITDIR_INET)
endif
endif
ifdef REQUIRE_PACKAGES_FCL
PACKAGEDIR_FCL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
PACKAGEDIR_FCL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR)))))
ifneq ($(PACKAGEDIR_FCL),)
PACKAGEDIR_FCL:=$(firstword $(PACKAGEDIR_FCL))
ifeq ($(wildcard $(PACKAGEDIR_FCL)/$(FPCMADE)),)
override COMPILEPACKAGES+=package_fcl
package_fcl:
$(MAKE) -C $(PACKAGEDIR_FCL) all
endif
ifneq ($(wildcard $(PACKAGEDIR_FCL)/$(OS_TARGET)),)
UNITDIR_FCL=$(PACKAGEDIR_FCL)/$(OS_TARGET)
else
UNITDIR_FCL=$(PACKAGEDIR_FCL)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_FCL)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_FCL) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_FCL)/$(FPCMADE)
endif
else
PACKAGEDIR_FCL=
UNITDIR_FCL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fcl/Package.fpc,$(UNITSDIR)))))
@ -850,18 +852,19 @@ override COMPILER_UNITDIR+=$(UNITDIR_FCL)
endif
endif
ifdef REQUIRE_PACKAGES_MYSQL
PACKAGEDIR_MYSQL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR))))))
PACKAGEDIR_MYSQL:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /mysql/Makefile.fpc,$(PACKAGESDIR)))))
ifneq ($(PACKAGEDIR_MYSQL),)
PACKAGEDIR_MYSQL:=$(firstword $(PACKAGEDIR_MYSQL))
ifeq ($(wildcard $(PACKAGEDIR_MYSQL)/$(FPCMADE)),)
override COMPILEPACKAGES+=package_mysql
package_mysql:
$(MAKE) -C $(PACKAGEDIR_MYSQL) all
endif
ifneq ($(wildcard $(PACKAGEDIR_MYSQL)/$(OS_TARGET)),)
UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)/$(OS_TARGET)
else
UNITDIR_MYSQL=$(PACKAGEDIR_MYSQL)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_MYSQL)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_MYSQL) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_MYSQL)/$(FPCMADE)
endif
else
PACKAGEDIR_MYSQL=
UNITDIR_MYSQL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /mysql/Package.fpc,$(UNITSDIR)))))
@ -876,18 +879,19 @@ override COMPILER_UNITDIR+=$(UNITDIR_MYSQL)
endif
endif
ifdef REQUIRE_PACKAGES_IBASE
PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
PACKAGEDIR_IBASE:=$(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR)))))
ifneq ($(PACKAGEDIR_IBASE),)
PACKAGEDIR_IBASE:=$(firstword $(PACKAGEDIR_IBASE))
ifeq ($(wildcard $(PACKAGEDIR_IBASE)/$(FPCMADE)),)
override COMPILEPACKAGES+=package_ibase
package_ibase:
$(MAKE) -C $(PACKAGEDIR_IBASE) all
endif
ifneq ($(wildcard $(PACKAGEDIR_IBASE)/$(OS_TARGET)),)
UNITDIR_IBASE=$(PACKAGEDIR_IBASE)/$(OS_TARGET)
else
UNITDIR_IBASE=$(PACKAGEDIR_IBASE)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_IBASE)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_IBASE) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_IBASE)/$(FPCMADE)
endif
else
PACKAGEDIR_IBASE=
UNITDIR_IBASE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /ibase/Package.fpc,$(UNITSDIR)))))
@ -901,6 +905,7 @@ ifdef UNITDIR_IBASE
override COMPILER_UNITDIR+=$(UNITDIR_IBASE)
endif
endif
.PHONY: package_rtl package_paszlib package_inet package_fcl package_mysql package_ibase
ifndef NOCPUDEF
override FPCOPTDEF=$(CPU_TARGET)
endif
@ -1020,26 +1025,24 @@ endif
ifdef TARGET_UNITS
override ALLTARGET+=fpc_units
override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
override INSTALLPPUFILES+=$(UNITPPUFILES)
override CLEANPPUFILES+=$(UNITPPUFILES)
endif
fpc_units: $(UNITPPUFILES)
ifdef TARGET_RSTS
override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
override CLEANRSTFILES+=$(RSTFILES)
endif
.PHONY: fpc_all fpc_smart fpc_debug fpc_release
$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
.PHONY: fpc_packages fpc_all fpc_smart fpc_debug
$(FPCMADE): $(ALLTARGET)
@$(ECHOREDIR) Compiled > $(FPCMADE)
fpc_all: $(FPCMADE)
fpc_packages: $(COMPILEPACKAGES)
fpc_all: fpc_packages $(FPCMADE)
fpc_smart:
$(MAKE) all LINKSMART=1 CREATESMART=1
fpc_debug:
$(MAKE) all DEBUG=1
fpc_release:
$(MAKE) all RELEASE=1
.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
%$(PPUEXT): %.pp
$(COMPILER) $<
$(EXECPPAS)
@ -1052,8 +1055,6 @@ fpc_release:
%$(EXEEXT): %.pas
$(COMPILER) $<
$(EXECPPAS)
%.res: %.rc
windres -i $< -o $@
vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
@ -1061,9 +1062,6 @@ vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
ifdef INSTALL_UNITS
override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
endif
ifdef INSTALL_BUILDUNIT
override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
endif
ifdef INSTALLPPUFILES
override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
@ -1112,7 +1110,7 @@ ifdef INSTALL_FILES
endif
fpc_sourceinstall: distclean
$(MKDIR) $(INSTALL_SOURCEDIR)
$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
$(COPYTREE) $(BASEDIR) $(INSTALL_SOURCEDIR)
fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
ifdef HASEXAMPLES
$(MKDIR) $(INSTALL_EXAMPLEDIR)
@ -1244,13 +1242,12 @@ ifdef CLEANEXEFILES
endif
-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-$(DELTREE) *$(SMARTEXT)
-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
-$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)
ifdef AOUTEXT
-$(DEL) *$(AOUTEXT)
endif
.PHONY: fpc_baseinfo
override INFORULES+=fpc_baseinfo
fpc_baseinfo:
.PHONY: fpc_info
fpc_info:
@$(ECHO)
@$(ECHO) == Package info ==
@$(ECHO) Package Name..... $(PACKAGE_NAME)
@ -1264,13 +1261,11 @@ fpc_baseinfo:
@$(ECHO) Target CPU... $(CPU_TARGET)
@$(ECHO) Source OS.... $(OS_SOURCE)
@$(ECHO) Target OS.... $(OS_TARGET)
@$(ECHO) Full Source.. $(FULL_SOURCE)
@$(ECHO) Full Target.. $(FULL_TARGET)
@$(ECHO) Full Target.. $(FULL_SOURCE)
@$(ECHO) Full Source.. $(FULL_TARGET)
@$(ECHO)
@$(ECHO) == Directory info ==
@$(ECHO)
@$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
@$(ECHO)
@$(ECHO) Basedir......... $(BASEDIR)
@$(ECHO) FPCDir.......... $(FPCDIR)
@$(ECHO) CrossBinDir..... $(CROSSBINDIR)
@ -1300,13 +1295,12 @@ fpc_baseinfo:
@$(ECHO)
@$(ECHO) == Object info ==
@$(ECHO)
@$(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) 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)
@$(ECHO) Clean Units......... $(CLEAN_UNITS)
@$(ECHO) Clean Files......... $(CLEAN_FILES)
@ -1333,25 +1327,8 @@ fpc_baseinfo:
@$(ECHO) Dist destination dir. $(DIST_DESTDIR)
@$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
@$(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
debug: fpc_debug
smart: fpc_smart
release: fpc_release
examples:
shared:
install: fpc_install
@ -1366,8 +1343,7 @@ clean: fpc_clean
distclean: fpc_distclean
cleanall: fpc_cleanall
info: fpc_info
makefiles: fpc_makefiles
.PHONY: debug smart release examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
.PHONY: debug smart examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info
ifneq ($(wildcard fpcmake.loc),)
include fpcmake.loc
endif

View File

@ -469,7 +469,7 @@ writeln('[TCodeCompletionCodeTool.CompleteProperty] CleanAccessFunc ',CleanAcces
{$IFDEF CTDEBUG}
writeln('[TCodeCompletionCodeTool.CompleteProperty] Error reading param list');
{$ENDIF}
RaiseException('error in parameter list');
RaiseException(ctsErrorInParamList);
end;
ParamList:=GetExtraction;
if (Parts[ppIndexWord].StartPos<1) then begin
@ -582,7 +582,7 @@ writeln('[TCodeCompletionCodeTool.CompleteProperty] write specifier needed');
phpWithoutBrackets,phpWithVarModifiers,
phpWithComments])
then
RaiseException('error in param list');
RaiseException(ctsErrorInParamList);
ParamList:=GetExtraction;
if (Parts[ppIndexWord].StartPos<1) then begin
// param list, no index
@ -1149,7 +1149,7 @@ writeln('TCodeCompletionCodeTool.CreateMissingProcBodies Starting class in imple
// -> insert at the end of the implementation section
ImplementationNode:=FindImplementationNode;
if ImplementationNode=nil then
RaiseException('implementation node not found');
RaiseException(ctsImplementationNodeNotFound);
Indent:=GetLineIndent(Src,ImplementationNode.StartPos);
if (ImplementationNode.LastChild=nil)
or (ImplementationNode.LastChild.Desc<>ctnBeginBlock) then
@ -1163,11 +1163,11 @@ writeln('TCodeCompletionCodeTool.CreateMissingProcBodies Starting class in imple
// -> insert at the end of the type section
ANode:=ClassNode.Parent; // type definition
if ANode=nil then
RaiseException('class node without parent node');
RaiseException(ctsClassNodeWithoutParentNode);
if ANode.Parent.Desc=ctnTypeSection then
ANode:=ANode.Parent; // type section
if ANode=nil then
RaiseException('type section of class section not found');
RaiseException(ctsTypeSectionOfClassNotFound);
Indent:=GetLineIndent(Src,ANode.StartPos);
InsertPos:=ANode.EndPos;
end;
@ -1397,7 +1397,7 @@ writeln('TCodeCompletionCodeTool.CompleteCode Complete Properties ... ');
if ANode.Desc=ctnProperty then begin
// check if property is complete
if not CompleteProperty(ANode) then
RaiseException('unable to complete property');
RaiseException(ctsUnableToCompleteProperty);
end;
ANode:=ANode.NextBrother;
end;
@ -1409,21 +1409,21 @@ writeln('TCodeCompletionCodeTool.CompleteCode Insert new variables and methods .
{$ENDIF}
// insert all new variables and procs definitions
if not InsertAllNewClassParts then
RaiseException('error during inserting new class parts');
RaiseException(ctsErrorDuringInsertingNewClassParts);
{$IFDEF CTDEBUG}
writeln('TCodeCompletionCodeTool.CompleteCode Insert new method bodies ... ');
{$ENDIF}
// insert all missing proc bodies
if not CreateMissingProcBodies then
RaiseException('error during creation of new proc bodies');
RaiseException(ctsErrorDuringCreationOfNewProcBodies);
{$IFDEF CTDEBUG}
writeln('TCodeCompletionCodeTool.CompleteCode Apply ... ');
{$ENDIF}
// apply the changes and jump to first new proc body
if not SourceChangeCache.Apply then
RaiseException('unable to apply changes');
RaiseException(ctsUnableToApplyChanges);
if JumpToProcName<>'' then begin
{$IFDEF CTDEBUG}
@ -1435,11 +1435,11 @@ writeln('TCodeCompletionCodeTool.CompleteCode Jump to new proc body ... ');
// reparse code
BuildTree(false);
if not EndOfSourceFound then
RaiseException('End of source not found');
RaiseException(ctsEndOfSourceNotFound);
// find the CursorPos in cleaned source
Dummy:=CaretToCleanPos(CursorPos, CleanCursorPos);
if (Dummy<>0) and (Dummy<>-1) then
RaiseException('cursor pos outside of code');
RaiseException(ctsCursorPosOutsideOfCode);
// find CodeTreeNode at cursor
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
@ -1447,16 +1447,16 @@ writeln('TCodeCompletionCodeTool.CompleteCode Jump to new proc body ... ');
while (ClassNode<>nil) and (ClassNode.Desc<>ctnClass) do
ClassNode:=ClassNode.Parent;
if ClassNode=nil then
RaiseException('oops, I loosed your class');
RaiseException('oops, I loose your class');
ANode:=ClassNode.Parent;
if ANode=nil then
RaiseException('class without parent node');
RaiseException(ctsClassNodeWithoutParentNode);
if (ANode.Parent<>nil) and (ANode.Parent.Desc=ctnTypeSection) then
ANode:=ANode.Parent;
ProcNode:=FindProcNode(ANode,JumpToProcName,
[phpInUpperCase,phpIgnoreForwards]);
if ProcNode=nil then
RaiseException('new proc body not found');
RaiseException(ctsNewProcBodyNotFound);
Result:=FindJumpPointInProcNode(ProcNode,NewPos,NewTopLine);
exit;
end else begin

View File

@ -39,9 +39,9 @@ uses
{$IFDEF MEM_CHECK}
MemCheck,
{$ENDIF}
Classes, SysUtils, EventCodeTool, CodeTree, CodeAtom, SourceChanger,
DefineTemplates, CodeCache, ExprEval, LinkScanner, KeywordFuncLists, TypInfo,
AVL_Tree, CustomCodeTool, FindDeclarationTool;
Classes, SysUtils, CodeToolsStrConsts, EventCodeTool, CodeTree, CodeAtom,
SourceChanger, DefineTemplates, CodeCache, ExprEval, LinkScanner,
KeywordFuncLists, TypInfo, AVL_Tree, CustomCodeTool, FindDeclarationTool;
type
TCodeToolManager = class;
@ -502,8 +502,7 @@ begin
exit;
end;
if MainCode.Scanner=nil then begin
FErrorMsg:='No scanner found for "'+MainCode.Filename+'".'
+' If this is an include file, please open the main source first.';
FErrorMsg:=Format(ctsNoScannerFound,[MainCode.Filename]);
exit;
end;
FCurCodeTool:=TCodeTool(GetCodeToolForSource(MainCode,true));
@ -514,14 +513,13 @@ writeln('[TCodeToolManager.InitCurCodeTool] ',Code.Filename,' ',Code.SourceLengt
Result:=(FCurCodeTool.Scanner<>nil);
if not Result then begin
fErrorCode:=MainCode;
fErrorMsg:='No scanner available';
fErrorMsg:=ctsNoScannerAvailable;
end;
end;
function TCodeToolManager.HandleException(AnException: Exception): boolean;
var ErrorSrcTool: TCustomCodeTool;
begin
writeln(' BBB ');
fErrorMsg:=AnException.Message;
if not ((AnException is ELinkScannerError) or (AnException is ECodeToolError))
then begin
@ -1419,14 +1417,14 @@ begin
MainCode:=GetMainCode(Code); // create a scanner
if (MainCode<>Code) then begin
if ExceptionOnError then
raise Exception.Create('the source "'+Code.Filename+'"'
raise Exception.Create('[TCodeToolManager.GetCodeToolForSource]'
+' the source "'+Code.Filename+'"'
+' is an include file of "'+MainCode.Filename+'"');
exit;
end;
if Code.Scanner=nil then begin
if ExceptionOnError then
raise Exception.Create('No scanner found for "'+Code.Filename+'".'
+' If this is an include file, please open the main source first.');
raise Exception.CreateFmt(ctsNoScannerFound,[Code.Filename]);
exit;
end;
Result:=TCodeTool.Create;

View File

@ -34,14 +34,15 @@ uses
Classes, SysUtils;
ResourceString
// codetree
ctsUnknownSubDescriptor = '(unknown subdescriptor %s)';
ctsForward = 'Forward';
ctsUnparsed = 'Unparsed';
// customcodetool
ctsIdentExpectedButAtomFound = 'identifier expected, but %s found';
ctsIdentExpectedButKeyWordFound = 'identifier expected, but keyword %s found';
ctsCharExpectedButAtomFound = '%s expected, but %s found';
ctsIdentExpectedButEOFFound = 'unexpected end of file (identifier expected)';
ctsBracketOpenExpectedButAtomFound = 'bracket open expected, but %s found';
ctsBracketCloseExpectedButAtomFound = 'bracket close expected, but %s found';
@ -49,6 +50,7 @@ ResourceString
ctsNoNodeFoundAtCursor = 'no node found at cursor';
ctsUnknownMainFilename = '(unknown mainfilename)';
// codecompletion
ctsPropertySpecifierAlreadyDefined = 'property specifier already defined: %s';
ctsErrorInParamList = 'error in paramlist';
ctsPropertTypeExpectedButAtomFound = 'property type expected, but %s found';
@ -57,7 +59,52 @@ ResourceString
ctsDefaultSpecifierRedefined = 'default specifier redefined';
ctsDefaultParameterExpectedButAtomFound = 'default parameter expected, but %s found';
ctsNodefaultSpecifierDefinedTwice = 'nodefault specifier defined twice';
ctsImplementationNodeNotFound = 'implementation node not found';
ctsClassNodeWithoutParentNode = 'class node without parent node';
ctsTypeSectionOfClassNotFound = 'type section of class not found';
ctsUnableToCompleteProperty = 'unable to complete property';
ctsErrorDuringInsertingNewClassParts = 'error during inserting new class parts';
ctsErrorDuringCreationOfNewProcBodies = 'error during creation of new proc bodies';
ctsUnableToApplyChanges = 'unable to apply changes';
ctsEndOfSourceNotFound = 'End of source not found';
ctsCursorPosOutsideOfCode = 'cursor pos outside of code';
ctsNewProcBodyNotFound = 'new proc body not found';
// codetoolsmanager
ctsNoScannerFound = 'No scanner found for "%s".'
+' If this is an include file, please open the main source first.';
ctsNoScannerAvailable = 'No scanner available';
// definetemplates
ctsUnknownFunction = 'Unknown function %s';
ctsSyntaxErrorInExpr = 'Syntax Error in expression "%s"';
ctsDefaultppc386Macro = 'Default ppc386 macro';
ctsDefaultppc386TargetOperatingSystem = 'Default ppc386 target Operating System';
ctsDefaultppc386SourceOperatingSystem = 'Default ppc386 source Operating System';
ctsDefaultppc386TargetProcessor = 'Default ppc386 target processor';
ctsFreePascalCompilerInitialMacros = 'Free Pascal Compiler initial makros';
ctsFreePascalSourcesPlusDesc = 'Free Pascal Sources, %s';
ctsSourceFilenamesForStandardFPCUnits =
'Source filenames for the standard fpc units';
ctsFreePascalSourceDir = 'Free Pascal Source Directory';
ctsSrcPathInitialization = 'SrcPath Initialization';
ctsCompiler = 'Compiler';
ctsRuntimeLibrary = 'Runtime library';
ctsProcessorSpecific = 'processor specific';
ctsFreePascalComponentLibrary = 'Free Pascal Component Library';
ctsIncludeDirectoriesPlusDirs = 'include directories: %s';
ctsPackageDirectories = 'Package directories';
ctsDefsForLazarusSources = 'Definitions for the Lazarus Sources';
ctsAddsDirToSourcePath = 'adds %s to SrcPath';
ctsLazMainDirIncludePath = 'sets IncPath to %s';
ctsNamedDirectory = '%s Directory';
ctsAbstractWidgetPath = 'abstract widget path';
ctsWidgetDirectory = 'Widget Directory';
ctsComponentsDirectory = 'Components Directory';
ctsToolsDirectory = 'Tools Directory';
ctsDesignerDirectory = 'Designer Directory';
ctsLazarusMainDirectory = 'lazarus main directory';
ctsDebuggerDirectory = 'Debugger Directory';
implementation

View File

@ -50,7 +50,8 @@ unit DefineTemplates;
interface
uses
Classes, SysUtils, ExprEval{$ifdef FPC}, XMLCfg{$endif}, AVL_Tree, Process,
Classes, SysUtils, CodeToolsStrConsts, ExprEval
{$ifdef FPC}, XMLCfg{$endif}, AVL_Tree, Process,
KeywordFuncLists, FileProcs;
const
@ -64,7 +65,7 @@ const
{$define CaseInsensitiveFilenames}
{$endif}
// Standard Template Names
// Standard Template Names (do not translate them)
StdDefTemplFPC = 'Free Pascal Compiler';
StdDefTemplFPCSrc = 'Free Pascal Sources';
StdDefTemplLazarusSources = 'Lazarus Sources';
@ -368,7 +369,7 @@ function FilenameIsMatching(const Mask, Filename: string;
}
var DirStartMask, DirEndMask, DirStartFile, DirEndFile, AsteriskPos: integer;
begin
//writeln('[FilenameIsMatching] Mask="',Mask,'" Filename="',Filename,'" MatchExactly=',MatchExactly);
//writeln('[FilenameIsMatching] Mask="',Mask,'" Filename="',Filename,'" MatchExactly=',MatchExactly);
Result:=false;
if (Filename='') then exit;
if (Mask='') then begin
@ -404,8 +405,8 @@ begin
else
inc(DirEndFile);
end;
// writeln(' Compare "',copy(Mask,DirStartMask,DirEndMask-DirStartMask),'"',
// ' "',copy(Filename,DirStartFile,DirEndFile-DirStartFile),'"');
// writeln(' Compare "',copy(Mask,DirStartMask,DirEndMask-DirStartMask),'"',
// ' "',copy(Filename,DirStartFile,DirEndFile-DirStartFile),'"');
// compare directories
AsteriskPos:=0;
while (DirStartMask<DirEndMask) and (DirStartFile<DirEndFile) do begin
@ -456,7 +457,7 @@ begin
inc(DirStartFile);
Result:=(Result and (DirStartFile>length(Filename)));
end;
//writeln(' [FilenameIsMatching] Result=',Result,' ',DirStartMask,',',length(Mask),' ',DirStartFile,',',length(Filename));
//writeln(' [FilenameIsMatching] Result=',Result,' ',DirStartMask,',',length(Mask),' ',DirStartFile,',',length(Filename));
end;
@ -567,7 +568,6 @@ begin
while ANode<>nil do begin
NextNode:=ANode.Next;
if ANode.FMarked then begin
writeln(' REMOVING ',ANode.Name);
ANode.Unbind;
ANode.Free;
end else begin
@ -605,8 +605,9 @@ begin
if FParent<>nil then begin
ANode:=Self;
while ANode<>nil do begin
if ANode=APrior then raise Exception.Create('internal error: '
+'TDefineTemplate.InsertBehind: APrior=ANode');
if ANode=APrior then
raise Exception.Create('internal error: '
+'TDefineTemplate.InsertBehind: APrior=ANode');
dec(FParent.FChildCount);
ANode.FParent:=nil;
ANode:=ANode.Next;
@ -638,8 +639,9 @@ begin
if FParent<>nil then begin
ANode:=Self;
while ANode<>nil do begin
if ANode=ANext then raise Exception.Create('internal error: '
+'TDefineTemplate.InsertInFront: ANext=ANode');
if ANode=ANext then
raise Exception.Create('internal error: '
+'TDefineTemplate.InsertInFront: ANext=ANode');
dec(FParent.FChildCount);
ANode.FParent:=nil;
ANode:=ANode.Next;
@ -737,7 +739,6 @@ end;
function TDefineTemplate.CreateCopy(OnlyMarked: boolean): TDefineTemplate;
var LastNewNode, NewNode, ANode: TDefineTemplate;
begin
//writeln('TDefineTemplate.CreateCopy A ',ConsistencyCheck);
Result:=nil;
LastNewNode:=nil;
ANode:=Self;
@ -760,7 +761,6 @@ begin
end;
ANode:=ANode.Next;
end;
//writeln('TDefineTemplate.CreateCopy B ',ConsistencyCheck);
end;
function TDefineTemplate.FindRoot: TDefineTemplate;
@ -1342,7 +1342,7 @@ function TDefineTree.GetDefinesForDirectory(
var ExpPath: string;
DirDef: TDirectoryDefines;
begin
//writeln('[TDefineTree.GetDefinesForDirectory] "',Path,'"');
//writeln('[TDefineTree.GetDefinesForDirectory] "',Path,'"');
ExpPath:=Path;
if (ExpPath<>'') and (ExpPath[length(ExpPath)]<>PathDelim) then
ExpPath:=ExpPath+PathDelim;
@ -1352,7 +1352,7 @@ begin
end else begin
DirDef:=TDirectoryDefines.Create;
DirDef.Path:=ExpPath;
//writeln('[TDefineTree.GetDefinesForDirectory] B ',ExpPath,' ');
//writeln('[TDefineTree.GetDefinesForDirectory] B ',ExpPath,' ');
if Calculate(DirDef) then begin
FCache.Add(DirDef);
Result:=DirDef.Values;
@ -1368,12 +1368,12 @@ begin
if FVirtualDirCache<>nil then
Result:=FVirtualDirCache.Values
else begin
//writeln('################ TDefineTree.GetDefinesForVirtualDirectory');
//writeln('################ TDefineTree.GetDefinesForVirtualDirectory');
FVirtualDirCache:=TDirectoryDefines.Create;
FVirtualDirCache.Path:=VirtualDirectory;
if Calculate(FVirtualDirCache) then begin
Result:=FVirtualDirCache.Values;
//writeln(TDefineTree.GetDefinesForVirtualDirectory Result.AsString);
//writeln(TDefineTree.GetDefinesForVirtualDirectory Result.AsString);
end else begin
FVirtualDirCache.Free;
FVirtualDirCache:=nil;
@ -1423,14 +1423,14 @@ var
Ext:=ExtractFileExt(Result);
Result:=copy(Result,1,length(Result)-length(Ext));
end else
Result:='<Unknown function '+FuncName+'>';
Result:='<'+Format(ctsUnknownFunction,[FuncName])+'>';
end;
// function ReadValue(const PreValue, CurDefinePath: string): string;
var MacroStart,MacroEnd: integer;
MacroFuncName, MacroStr, MacroParam: string;
begin
// writeln(' [ReadValue] A "',PreValue,'"');
// writeln(' [ReadValue] A "',PreValue,'"');
Result:=PreValue;
MacroStart:=1;
while MacroStart<=length(Result) do begin
@ -1462,8 +1462,8 @@ var
end else begin
// Macro variable
MacroStr:=copy(Result,MacroStart+2,MacroEnd-MacroStart-3);
//writeln('**** MacroStr=',MacroStr);
//writeln('DirDef.Values=',DirDef.Values.AsString);
//writeln('**** MacroStr=',MacroStr);
//writeln('DirDef.Values=',DirDef.Values.AsString);
if MacroStr=DefinePathMacroName then begin
MacroStr:=CurDefinePath;
end else begin
@ -1476,7 +1476,7 @@ var
end else
MacroStr:='';
end;
//writeln('**** Result MacroStr=',MacroStr);
//writeln('**** Result MacroStr=',MacroStr);
end;
Result:=copy(Result,1,MacroStart-1)+MacroStr
+copy(Result,MacroEnd,length(Result)-MacroEnd+1);
@ -1484,7 +1484,7 @@ var
end;
MacroStart:=MacroEnd;
end;
//writeln(' [ReadValue] END "',Result,'"');
//writeln(' [ReadValue] END "',Result,'"');
end;
procedure CalculateTemplate(DefTempl: TDefineTemplate; const CurPath: string);
@ -1505,7 +1505,7 @@ var
var SubPath: string;
begin
while DefTempl<>nil do begin
//writeln(' [CalculateTemplate] CurPath="',CurPath,'" DefTempl.Name="',DefTempl.Name,'"');
//writeln(' [CalculateTemplate] CurPath="',CurPath,'" DefTempl.Name="',DefTempl.Name,'"');
case DefTempl.Action of
da_Block:
// calculate children
@ -1546,8 +1546,8 @@ var
if EvalResult='1' then
CalculateIfChilds
else if EvalResult='0' then begin
FErrorDescription:='Syntax Error in expression '
+'"'+ReadValue(DefTempl.Value,CurPath)+'"';
FErrorDescription:=Format(ctsSyntaxErrorInExpr,
[ReadValue(DefTempl.Value,CurPath)]);
FErrorTemplate:=DefTempl;
exit;
end;
@ -1589,7 +1589,7 @@ var
// function TDefineTree.Calculate(DirDef: TDirectoryDefines): boolean;
begin
//writeln('[TDefineTree.Calculate] "',DirDef.Path,'"');
//writeln('[TDefineTree.Calculate] "',DirDef.Path,'"');
Result:=true;
FErrorTemplate:=nil;
if DirDef.Path<>VirtualDirectory then
@ -1848,7 +1848,7 @@ function TDefinePool.CreateFPCTemplate(
if copy(UpLine,1,15)='MACRO DEFINED: ' then begin
MacroName:=copy(UpLine,16,length(Line)-15);
NewDefTempl:=TDefineTemplate.Create('Define '+MacroName,
'Default ppc386 macro',MacroName,'',da_DefineRecurse);
ctsDefaultppc386Macro,MacroName,'',da_DefineRecurse);
end else if copy(UpLine,1,6)='MACRO ' then begin
System.Delete(Line,1,6);
System.Delete(UpLine,1,6);
@ -1861,7 +1861,7 @@ function TDefinePool.CreateFPCTemplate(
if copy(UpLine,1,7)='SET TO ' then begin
MacroValue:=copy(Line,8,length(Line)-7);
NewDefTempl:=TDefineTemplate.Create('Define '+MacroName,
'Default ppc386 macro',MacroName,MacroValue,da_DefineRecurse);
ctsDefaultppc386Macro,MacroName,MacroValue,da_DefineRecurse);
end;
end else if copy(UpLine,1,17)='USING UNIT PATH: ' then begin
UnitSearchPath:=UnitSearchPath+copy(Line,18,length(Line)-17)+#13;
@ -1947,7 +1947,7 @@ begin
if Buf[i] in [#10,#13] then begin
TargetOS:=copy(Buf,1,i-1);
NewDefTempl:=TDefineTemplate.Create('Define TargetOS',
'Default ppc386 target Operating System',
ctsDefaultppc386TargetOperatingSystem,
ExternalMacroStart+'TargetOS',TargetOS,da_DefineRecurse);
if DefTempl<>nil then
NewDefTempl.InsertBehind(DefTempl);
@ -1957,7 +1957,7 @@ begin
else
SrcOS:=TargetOS;
NewDefTempl:=TDefineTemplate.Create('Define SrcOS',
'Default ppc386 source Operating System',
ctsDefaultppc386SourceOperatingSystem,
ExternalMacroStart+'SrcOS',SrcOS,da_DefineRecurse);
if DefTempl<>nil then
NewDefTempl.InsertBehind(DefTempl);
@ -1987,8 +1987,9 @@ begin
if Buf[i] in [#10,#13] then begin
TargetProcessor:=copy(Buf,1,i-1);
NewDefTempl:=TDefineTemplate.Create('Define TargetProcessor',
'Default ppc386 target Operating System',
ExternalMacroStart+'TargetProcessor',TargetProcessor,da_DefineRecurse);
ctsDefaultppc386TargetProcessor,
ExternalMacroStart+'TargetProcessor',TargetProcessor,
da_DefineRecurse);
if DefTempl<>nil then
NewDefTempl.InsertBehind(DefTempl);
DefTempl:=NewDefTempl;
@ -2005,7 +2006,7 @@ begin
if (DefTempl<>nil) then begin
while (DefTempl.Prior<>nil) do DefTempl:=DefTempl.Prior;
Result:=TDefineTemplate.Create('Free Pascal Compiler',
'Free Pascal Compiler initial makros','','',da_Block);
ctsFreePascalCompilerInitialMacros,'','',da_Block);
Result.AddChild(DefTempl);
Result.Flags:=[dtfAutoGenerated];
end;
@ -2135,7 +2136,7 @@ var
SrcOSMakroUsed: boolean;
i: integer;
begin
// writeln('%%%Browse ',ADirPath);
// writeln('%%%Browse ',ADirPath);
if ADirPath='' then exit;
if not (ADirPath[length(ADirPath)]=PathDelim) then
ADirPath:=ADirPath+PathDelim;
@ -2219,7 +2220,7 @@ var
// search
if AnUnitName='' then exit;
UnitLink:=FindUnitLink(AnUnitName);
//writeln('AddFPCSourceLinkForUnit ',AnUnitName,' ',UnitLink<>nil);
//writeln('AddFPCSourceLinkForUnit ',AnUnitName,' ',UnitLink<>nil);
if UnitLink=nil then exit;
s:=AnUnitName+' '+UnitLink.Filename+EndOfLine;
UnitLinkList:=UnitLinkList+s;
@ -2244,13 +2245,13 @@ var
inc(PathEnd);
if PathEnd>PathStart then begin
ADirPath:=copy(UnitSearchPath,PathStart,PathEnd-PathStart);
//writeln('&&& FindStandardPPUSources ',ADirPath);
//writeln('&&& FindStandardPPUSources ',ADirPath);
// search all ppu files in this directory
if FindFirst(ADirPath+'*.ppu',faAnyFile,FileInfo)=0 then begin
repeat
UnitName:=ExtractFileName(FileInfo.Name);
UnitName:=copy(UnitName,1,length(UnitName)-4);
//writeln('&&& FindStandardPPUSources B ',UnitName);
//writeln('&&& FindStandardPPUSources B ',UnitName);
AddFPCSourceLinkForUnit(UnitName);
until FindNext(FileInfo)<>0;
end;
@ -2279,34 +2280,33 @@ begin
UnitTree:=nil;
Result:=TDefineTemplate.Create(StdDefTemplFPCSrc,
'Free Pascal Sources, RTL, FCL, Packages, Compiler','','',da_Block);
Format(ctsFreePascalSourcesPlusDesc,['RTL, FCL, Packages, Compiler']),
'','',da_Block);
Result.Flags:=[dtfAutoGenerated];
// try to find for every reachable ppu file the unit file in the FPC sources
FindStandardPPUSources;
DefTempl:=TDefineTemplate.Create('FPC Unit Links',
'Source filenames for the standard fpc units',
ctsSourceFilenamesForStandardFPCUnits,
UnitLinks,UnitLinkList,da_DefineRecurse);
Result.AddChild(DefTempl);
// The free pascal sources build a world of their own,
// reset source search path
MainDir:=TDefineTemplate.Create('Free Pascal Source Directory',
'Free Pascal Source Directory',
'',FPCSrcDir,da_Directory);
ctsFreePascalSourceDir,'',FPCSrcDir,da_Directory);
Result.AddChild(MainDir);
DefTempl:=TDefineTemplate.Create('Reset SrcPath',
'SrcPath Init',
ExternalMacroStart+'SrcPath','',da_DefineRecurse);
ctsSrcPathInitialization,ExternalMacroStart+'SrcPath','',da_DefineRecurse);
MainDir.AddChild(DefTempl);
// compiler
CompilerDir:=TDefineTemplate.Create('Compiler','Compiler','','compiler',
CompilerDir:=TDefineTemplate.Create('Compiler',ctsCompiler,'','compiler',
da_Directory);
MainDir.AddChild(CompilerDir);
// rtl
RTLDir:=TDefineTemplate.Create('RTL','Runtime library','','rtl',da_Directory);
RTLDir:=TDefineTemplate.Create('RTL',ctsRuntimeLibrary,'','rtl',da_Directory);
MainDir.AddChild(RTLDir);
s:=IncPathMacro
+';'+Dir+'rtl'+DS+'objpas'+DS
@ -2316,22 +2316,23 @@ begin
if (TargetOS<>'') and (TargetOS<>SrcOS) then
s:=s+';'+Dir+'rtl'+DS+TargetOS+DS;
RTLDir.AddChild(TDefineTemplate.Create('Include Path',
'include directory objpas, inc, processor specific',
Format(ctsIncludeDirectoriesPlusDirs,
['objpas, inc,'+TargetProcessor+','+SrcOS]),
ExternalMacroStart+'IncPath',s,da_DefineRecurse));
// fcl
FCLDir:=TDefineTemplate.Create('FCL','Free Pascal Component Library','','fcl',
FCLDir:=TDefineTemplate.Create('FCL',ctsFreePascalComponentLibrary,'','fcl',
da_Directory);
MainDir.AddChild(FCLDir);
FCLDir.AddChild(TDefineTemplate.Create('Include Path',
'include directory inc',
Format(ctsIncludeDirectoriesPlusDirs,['inc']),
ExternalMacroStart+'IncPath',
IncPathMacro
+';'+Dir+'fcl/inc/'
,da_DefineRecurse));
// packages
PackagesDir:=TDefineTemplate.Create('Packages','Package directories','',
PackagesDir:=TDefineTemplate.Create('Packages',ctsPackageDirectories,'',
'packages',da_Directory);
MainDir.AddChild(PackagesDir);
@ -2354,58 +2355,65 @@ begin
SrcPath:='$('+ExternalMacroStart+'SrcPath)';
// <LazarusSrcDir>
MainDir:=TDefineTemplate.Create('Lazarus Source Directory',
'Definitions for the Lazarus Sources','',LazarusSrcDir,da_Directory);
MainDir.AddChild(TDefineTemplate.Create('LCL path addition',
'adds lcl to SrcPath',ExternalMacroStart+'SrcPath',
MainDir:=TDefineTemplate.Create(
'Lazarus Source Directory',
ctsDefsForLazarusSources,'',LazarusSrcDir,da_Directory);
MainDir.AddChild(TDefineTemplate.Create(
'LCL path addition',
Format(ctsAddsDirToSourcePath,['lcl']),ExternalMacroStart+'SrcPath',
'lcl;lcl'+ds+'interfaces'+ds+WidgetType+';'+SrcPath
,da_Define));
MainDir.AddChild(TDefineTemplate.Create('Component path addition',
'adds designer, debugger, synedit and codetools to SrcPath',
MainDir.AddChild(TDefineTemplate.Create(
'Component path addition',
Format(ctsAddsDirToSourcePath,['designer, debugger, synedit,codetools']),
ExternalMacroStart+'SrcPath',
'components'+ds+'synedit;components'+ds+'codetools;designer;debugger;'
+SrcPath
,da_Define));
MainDir.AddChild(TDefineTemplate.Create('includepath addition',
'adds include to IncPath',ExternalMacroStart+'IncPath',
Format(ctsLazMainDirIncludePath,['include, include/TargetOS']),
ExternalMacroStart+'IncPath',
'include;include'+ds+TargetOS,
da_Define));
// examples
DirTempl:=TDefineTemplate.Create('Examples','Examples Directory',
DirTempl:=TDefineTemplate.Create('Examples',
Format(ctsNamedDirectory,['Examples']),
'','examples',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
'adds lcl to SrcPath',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl;..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType+';'+SrcPath
,da_Define));
MainDir.AddChild(DirTempl);
// lcl
DirTempl:=TDefineTemplate.Create('LCL','LCL Directory',
DirTempl:=TDefineTemplate.Create('LCL',Format(ctsNamedDirectory,['LCL']),
'','lcl',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('WidgetPath',
'adds abstract widget path to SrcPath'
,ExternalMacroStart+'SrcPath',
'interfaces'+ds+'abstract'+ds+';'+SrcPath
,da_Define));
Format(ctsAddsDirToSourcePath,[ctsAbstractWidgetPath]),
ExternalMacroStart+'SrcPath',
'interfaces'+ds+'abstract'+ds+';'+SrcPath,
da_Define));
DirTempl.AddChild(TDefineTemplate.Create('IncludePath',
'adds include to IncPaty',ExternalMacroStart+'IncPath',
+'include',da_Define));
Format(ctsIncludeDirectoriesPlusDirs,['include']),
ExternalMacroStart+'IncPath',
'include',da_Define));
MainDir.AddChild(DirTempl);
// lcl/interfaces
SubDirTempl:=TDefineTemplate.Create('Widget Directory','Widget Directory',
'','interfaces',da_Directory);
SubDirTempl:=TDefineTemplate.Create('Widget Directory',
ctsWidgetDirectory,'','interfaces',da_Directory);
SubDirTempl.AddChild(TDefineTemplate.Create('LCL Path',
'adds lcl to SrcPath',ExternalMacroStart+'SrcPath',
Format(ctsAddsDirToSourcePath,['lcl']),ExternalMacroStart+'SrcPath',
LazarusSrcDir+ds+'lcl;'+SrcPath,da_DefineRecurse));
DirTempl.AddChild(SubDirTempl);
// components
DirTempl:=TDefineTemplate.Create('Components','Components Directory',
DirTempl:=TDefineTemplate.Create('Components',ctsComponentsDirectory,
'','components',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL Path','adds lcl to SrcPath',
DirTempl.AddChild(TDefineTemplate.Create('LCL Path',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
LazarusSrcDir+ds+'lcl'
+';'+LazarusSrcDir+ds+'lcl'+ds+'interfaces'+ds+WidgetType
@ -2414,10 +2422,11 @@ begin
MainDir.AddChild(DirTempl);
// tools
DirTempl:=TDefineTemplate.Create('Tools','Tools Directory',
DirTempl:=TDefineTemplate.Create('Tools',
ctsToolsDirectory,
'','tools',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
'adds lcl to SrcPath',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl;..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType+';'+SrcPath
,da_Define));
@ -2426,28 +2435,29 @@ begin
// include
// designer
DirTempl:=TDefineTemplate.Create('Designer','Designer Directory',
DirTempl:=TDefineTemplate.Create('Designer',ctsDesignerDirectory,
'','designer',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
'adds lcl to SrcPath',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl'
+';..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType
+';'+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('main path addition',
'adds lazarus source directory to SrcPath',
Format(ctsAddsDirToSourcePath,[ctsLazarusMainDirectory]),
ExternalMacroStart+'SrcPath',
'..;'+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('components path addition',
'adds synedit directory to SrcPath',
Format(ctsAddsDirToSourcePath,['synedit']),
ExternalMacroStart+'SrcPath',
'..'+ds+'components'+ds+'synedit;'+'..'+ds+'components'+ds+'codetools;'
+SrcPath
,da_Define));
DirTempl.AddChild(TDefineTemplate.Create('includepath addition',
'adds include to IncPath',ExternalMacroStart+'IncPath',
Format(ctsIncludeDirectoriesPlusDirs,['include']),
ExternalMacroStart+'IncPath',
'..'+ds+'include;..'+ds+'include'+ds+TargetOS,
da_Define));
MainDir.AddChild(DirTempl);
@ -2455,10 +2465,10 @@ begin
// images
// debugger
DirTempl:=TDefineTemplate.Create('Debugger','Debugger Directory',
DirTempl:=TDefineTemplate.Create('Debugger',ctsDebuggerDirectory,
'','debugger',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
'adds lcl to SrcPath',
Format(ctsAddsDirToSourcePath,['lcl']),
ExternalMacroStart+'SrcPath',
'..'+ds+'lcl'
+';..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType