|
@@ -1282,6 +1282,7 @@ endif
|
|
|
ifeq ($(OS_SOURCE),openbsd)
|
|
|
override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
|
|
|
override FPCMAKEOPT+=-FD$(NEW_BINUTILS_PATH)
|
|
|
+override FPMAKE_BUILD_OPT+=-FD$(NEW_BINUTILS_PATH)
|
|
|
endif
|
|
|
|
|
|
ifndef CROSSBOOTSTRAP
|
|
@@ -1299,6 +1300,7 @@ endif
|
|
|
ifndef CROSSCOMPILE
|
|
|
ifneq ($(BINUTILSPREFIX),)
|
|
|
override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
|
|
|
+override FPMAKE_BUILD_OPT+=-XP$(BINUTILSPREFIX)
|
|
|
endif
|
|
|
endif
|
|
|
|
|
@@ -1445,6 +1447,11 @@ ifdef OPT
|
|
|
override FPCOPT+=$(OPT)
|
|
|
endif
|
|
|
|
|
|
+# Override options to compile the fpmake-binary with command-line options provided in FPMAKEBUILDOPT
|
|
|
+ifdef FPMAKEBUILDOPT
|
|
|
+override FPMAKE_BUILD_OPT+=$(FPMAKEBUILDOPT)
|
|
|
+endif
|
|
|
+
|
|
|
# Add defines from FPCOPTDEF to FPCOPT
|
|
|
ifdef FPCOPTDEF
|
|
|
override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
|
|
@@ -1814,7 +1821,7 @@ fpc_sourceinstall: distclean
|
|
|
$(MKDIR) $(INSTALL_SOURCEDIR)
|
|
|
$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
|
|
|
|
|
|
-fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
|
|
|
+fpc_exampleinstall: $(EXAMPLEINSTALLTARGET) $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
|
|
|
ifdef HASEXAMPLES
|
|
|
$(MKDIR) $(INSTALL_EXAMPLEDIR)
|
|
|
endif
|
|
@@ -2036,6 +2043,10 @@ endif
|
|
|
ifdef DEBUGSYMEXT
|
|
|
-$(DEL) *$(DEBUGSYMEXT)
|
|
|
endif
|
|
|
+ifdef LOCALFPMAKEBIN
|
|
|
+ -$(DEL) $(LOCALFPMAKEBIN)
|
|
|
+ -$(DEL) $(FPMAKEBINOBJ)
|
|
|
+endif
|
|
|
|
|
|
fpc_distclean: cleanall
|
|
|
|
|
@@ -2262,3 +2273,91 @@ lclinfo:
|
|
|
@$(ECHO) LCL Unit dir......... $(LCLUNITDIR)
|
|
|
@$(ECHO) LCL Component dir.... $(LCLCOMPONENTDIR)
|
|
|
@$(ECHO)
|
|
|
+
|
|
|
+[fpmakeprerules]
|
|
|
+#####################################################################
|
|
|
+# fpmake prerules
|
|
|
+#####################################################################
|
|
|
+FPMAKEBIN=fpmake$(SRCEXEEXT)
|
|
|
+FPMAKEBINOBJ=fpmake$(OEXT)
|
|
|
+LOCALFPMAKEBIN=.$(PATHSEP)$(FPMAKEBIN)
|
|
|
+
|
|
|
+# Convert the OS_TARGET and CPU_TARGET options to fpmake's --os and --cpu parameters
|
|
|
+ifdef OS_TARGET
|
|
|
+FPC_TARGETOPT+=--os=$(OS_TARGET)
|
|
|
+endif
|
|
|
+ifdef CPU_TARGET
|
|
|
+FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
|
|
|
+endif
|
|
|
+
|
|
|
+# Get the location of the bootstrap-fpmkunit units
|
|
|
+PACKAGEDIR_FPMKUNIT:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fpmkunit/Makefile.fpc,$(PACKAGESDIR))))))
|
|
|
+ifneq ($(PACKAGEDIR_FPMKUNIT),)
|
|
|
+UNITDIR_FPMAKE_FPMKUNIT=$(PACKAGEDIR_FPMKUNIT)/units_bs/$(SOURCESUFFIX)
|
|
|
+override COMPILER_FPMAKE_UNITDIR=$(UNITDIR_FPMAKE_FPMKUNIT)
|
|
|
+FPMKUNIT_SRC=$(PACKAGEDIR_FPMKUNIT)/src/fpmkunit.pp
|
|
|
+FPMKUNIT_PPU=$(UNITDIR_FPMAKE_FPMKUNIT)/fpmkunit.ppu
|
|
|
+endif
|
|
|
+
|
|
|
+ifdef FPMAKE_SKIP_CONFIG
|
|
|
+override FPMAKE_BUILD_OPT+=$(FPMAKE_SKIP_CONFIG)
|
|
|
+endif
|
|
|
+
|
|
|
+[fpmakerules]
|
|
|
+#####################################################################
|
|
|
+# fpmake rules
|
|
|
+#####################################################################
|
|
|
+.PHONY: fpc_fpmake fpc_fpmake_clean fpc_fpmake_install fpc_fpmake_exampleinstall
|
|
|
+
|
|
|
+# Do not pass the Makefile's unit and binary target locations. fpmake uses it's own.
|
|
|
+override FPCOPT:=$(filter-out -FU%,$(FPCOPT))
|
|
|
+override FPCOPT:=$(filter-out -FE%,$(FPCOPT))
|
|
|
+# Compose general fpmake-parameters
|
|
|
+ifdef FPMAKEOPT
|
|
|
+FPMAKE_OPT+=$(FPMAKEOPT)
|
|
|
+endif
|
|
|
+FPMAKE_OPT+=--localunitdir=$(FPCDIR)
|
|
|
+FPMAKE_OPT+=--globalunitdir=$(FPCDIR)/packages
|
|
|
+FPMAKE_OPT+=$(FPC_TARGETOPT)
|
|
|
+FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT))
|
|
|
+FPMAKE_OPT+=--compiler=$(FPC)
|
|
|
+FPMAKE_OPT+=-bu
|
|
|
+
|
|
|
+FPMAKE_INSTALL_OPT+=--unitinstalldir=$(INSTALL_UNITDIR)
|
|
|
+ifdef UNIXHier
|
|
|
+FPMAKE_INSTALL_OPT+=--prefix=$(INSTALL_PREFIX)
|
|
|
+FPMAKE_INSTALL_OPT+=--baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION)
|
|
|
+else
|
|
|
+FPMAKE_INSTALL_OPT+=--prefix=$(INSTALL_BASEDIR)
|
|
|
+endif
|
|
|
+
|
|
|
+override ALLTARGET+=fpc_fpmake
|
|
|
+override INSTALLTARGET+=fpc_fpmake_install
|
|
|
+override EXAMPLEINSTALLTARGET+=fpc_fpmake_exampleinstall
|
|
|
+# If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
|
|
|
+# most often fail because the dependencies are cleared.
|
|
|
+# In case of a clean, simply do nothing
|
|
|
+ifneq ($(wildcard $(LOCALFPMAKEBIN)),)
|
|
|
+override CLEANTARGET+=fpc_fpmake_clean
|
|
|
+endif
|
|
|
+
|
|
|
+$(FPMKUNIT_PPU): $(FPMKUNIT_SRC)
|
|
|
+ $(MAKE) -C $(PACKAGEDIR_FPMKUNIT) bootstrap $(addprefix OPT=,$(FPMAKE_BUILD_OPT))
|
|
|
+
|
|
|
+$(FPMAKEBIN): fpmake.pp $(FPMKUNIT_PPU)
|
|
|
+ $(FPCFPMAKE) fpmake.pp $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPMAKE_BUILD_OPT)
|
|
|
+
|
|
|
+fpc_fpmake: $(FPMAKEBIN)
|
|
|
+ $(LOCALFPMAKEBIN) compile $(FPMAKE_OPT)
|
|
|
+
|
|
|
+fpc_fpmake_clean: $(FPMAKEBIN)
|
|
|
+ $(LOCALFPMAKEBIN) clean $(FPMAKE_OPT)
|
|
|
+
|
|
|
+fpc_fpmake_install: $(FPMAKEBIN)
|
|
|
+ $(LOCALFPMAKEBIN) install $(FPMAKE_OPT) $(FPMAKE_INSTALL_OPT)
|
|
|
+
|
|
|
+# This is not completely valid. Exampleinstall should only install the examples, while
|
|
|
+# fpmake -ie installs everything, including the examples. This also means that on
|
|
|
+# a distinstall fpmake install wil be called twice.
|
|
|
+fpc_fpmake_exampleinstall: $(FPMAKEBIN)
|
|
|
+ $(LOCALFPMAKEBIN) install -ie $(FPMAKE_OPT) $(FPMAKE_INSTALL_OPT)
|