summaryrefslogtreecommitdiff
path: root/Makefile.fpc
diff options
context:
space:
mode:
authoryury <yury@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-02-21 14:54:57 +0000
committeryury <yury@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-02-21 14:54:57 +0000
commite6ac072f5f2d06c62f86462061a844e64912baf2 (patch)
tree2a6d3ccbce2bede3ffcc1c64a819a2827f3d7508 /Makefile.fpc
parent819ef1c02777401735647443c4302f6f80407960 (diff)
downloadfpc-e6ac072f5f2d06c62f86462061a844e64912baf2.tar.gz
* Top level makefile: Fixed and simplified cross-building. It is now possible to perform cross builds when having only bootstrap compiler executable.
- Always use fresh native fpcmake executable. - Build fresh native fpcmake executable when cross-compiling. - Explicitly specify a compiler which is used to bootstrap fpmake and fpcmake. Always use fresh native compiler for that. * New bootstrap target for fpcmake to build native fpcmake regardless of CPU/OS settings. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23641 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'Makefile.fpc')
-rw-r--r--Makefile.fpc31
1 files changed, 21 insertions, 10 deletions
diff --git a/Makefile.fpc b/Makefile.fpc
index f4d854aeec..78d0e6978e 100644
--- a/Makefile.fpc
+++ b/Makefile.fpc
@@ -88,6 +88,18 @@ endif
PPNEW=$(BASEDIR)/compiler/$(PPPRE)$(PPSUF)$(SRCEXEEXT)
endif
+# Use FPCFPMAKENEW to explicitly specify FPCFPMAKE later.
+# Otherwise pmkunit build will use wrong (starting) compiler
+# if there has been no compiler binary available in the compiler
+# dir before running make.
+ifndef FPCFPMAKENEW
+ifdef CROSSCOMPILE
+FPCFPMAKENEW=$(BASEDIR)/compiler/ppc$(SRCEXEEXT)
+else
+FPCFPMAKENEW=$(PPNEW)
+endif
+endif
+
# Check if install/ subdir is available
ifneq ($(wildcard install),)
CVSINSTALL=install
@@ -151,20 +163,14 @@ endif
# Temporary path to pack a file
BASEPACKDIR=$(BASEDIR)/basepack
-# Newly created fpcmake
-ifndef FPCMAKE
-ifeq ($(FULL_SOURCE),$(FULL_TARGET))
-FPCMAKENEW=$(BASEDIR)/utils/fpcm/fpcmake$(EXEEXT)
-else
-FPCMAKENEW=fpcmake
-endif
-else
-FPCMAKENEW=$(FPCMAKE)
+# Always use newly created fpcmake
+ifndef FPCMAKENEW
+FPCMAKENEW=$(BASEDIR)/utils/fpcm/fpcmake$(SRCEXEEXT)
endif
# Build/install options
CLEANOPTS=FPC=$(PPNEW)
-BUILDOPTS=FPC=$(PPNEW) RELEASE=1
+BUILDOPTS=FPC=$(PPNEW) FPCFPMAKE=$(FPCFPMAKENEW) RELEASE=1
INSTALLOPTS=FPC=$(PPNEW) ZIPDESTDIR=$(BASEDIR) FPCMAKE=$(FPCMAKENEW)
# Compile also IDE (check for ide and fv dir)
@@ -268,6 +274,11 @@ build: $(BUILDSTAMP)
$(BUILDSTAMP):
# create new compiler
$(MAKE) compiler_cycle RELEASE=1
+ifdef CROSSCOMPILE
+# Buld a new native fpcmake when cross-compiling.
+# Fresh native compiler and RTL are ready at this stage.
+ $(MAKE) -C utils/fpcm bootstrap $(BUILDOPTS)
+endif
# clean
$(MAKE) rtl_clean $(CLEANOPTS)
$(MAKE) packages_clean $(CLEANOPTS)