summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-07-13 21:19:59 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-07-13 21:19:59 +0000
commitb59278b060eea0f9c84107504ff2601341c47ad8 (patch)
treeed7c2cb0ffe6db92587cc33e0db77ed8bb7190c1 /Makefile.inc1
parentced2e01a1cf11d3b1e36b90814a9fba5215f200e (diff)
downloadFreeBSD-src-b59278b060eea0f9c84107504ff2601341c47ad8.zip
FreeBSD-src-b59278b060eea0f9c84107504ff2601341c47ad8.tar.gz
Connect powerpc64 to the build. It is not presently part of make universe,
which will be added soon. Reviewed by: imp
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc153
1 files changed, 37 insertions, 16 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index d292ea9..d939280 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -128,7 +128,7 @@ TARGET= ${TARGET_ARCH}
TARGET?= ${MACHINE}
TARGET_ARCH?= ${MACHINE_ARCH}
-KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc sparc64 sparc64/sun4v
+KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc powerpc64/powerpc sparc64 sparc64/sun4v
.if ${TARGET} == ${TARGET_ARCH}
_t= ${TARGET}
.else
@@ -262,34 +262,47 @@ WMAKEENV+= NO_CTF=1
.endif
WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
-.if ${TARGET_ARCH} == "amd64"
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
# 32 bit world
LIB32TMP= ${OBJTREE}${.CURDIR}/lib32
+.if ${TARGET_ARCH} == "amd64"
.if empty(TARGET_CPUTYPE)
LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
.else
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
.endif
-LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -mfancy-math-387 -DCOMPAT_32BIT \
+LIB32CPUFLAGS+= -mfancy-math-387
+LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
+ MACHINE_CPU="i686 mmx sse sse2" \
+ LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
+ AS="${AS} --32"
+
+.elif ${TARGET_ARCH} == "powerpc64"
+.if empty(TARGET_CPUTYPE)
+LIB32CPUFLAGS= -mcpu=powerpc
+.else
+LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE}
+.endif
+LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc \
+ LD="${LD} -m elf32ppc"
+.endif
+
+
+LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \
-isystem ${LIB32TMP}/usr/include/ \
-L${LIB32TMP}/usr/lib32 \
-B${LIB32TMP}/usr/lib32
# Yes, the flags are redundant.
-LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
+LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
_SHLIBDIRPREFIX=${LIB32TMP} \
VERSION="${VERSION}" \
- MACHINE=i386 \
- MACHINE_ARCH=i386 \
- MACHINE_CPU="i686 mmx sse sse2" \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${TMPPATH} \
CC="${CC} ${LIB32FLAGS}" \
CXX="${CXX} ${LIB32FLAGS}" \
OBJC="${OBJC} ${LIB32FLAGS}" \
- LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
- AS="${AS} --32" \
LIBDIR=/usr/lib32 \
SHLIBDIR=/usr/lib32
@@ -336,7 +349,7 @@ _worldtmp:
@echo "--------------------------------------------------------------"
.if !defined(NO_CLEAN)
rm -rf ${WORLDTMP}
-.if ${TARGET_ARCH} == "amd64"
+.if defined(LIB32TMP)
rm -rf ${LIB32TMP}
.endif
.else
@@ -380,7 +393,7 @@ _cleanobj:
@echo ">>> stage 2.1: cleaning up the object tree"
@echo "--------------------------------------------------------------"
${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
-.if ${TARGET_ARCH} == "amd64"
+.if defined(LIB32TMP)
${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
.endif
.endif
@@ -428,7 +441,7 @@ everything:
@echo ">>> stage 4.4: building everything"
@echo "--------------------------------------------------------------"
${_+_}cd ${.CURDIR}; ${WMAKE} par-all
-.if ${TARGET_ARCH} == "amd64"
+.if defined(LIB32TMP)
build32:
@echo
@echo "--------------------------------------------------------------"
@@ -510,7 +523,7 @@ WMAKE_TGTS+= _cleanobj _obj _build-tools
WMAKE_TGTS+= _cross-tools
.endif
WMAKE_TGTS+= _includes _libraries _depend everything
-.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
+.if defined(LIB32TMP) && ${MK_LIB32} != "no"
WMAKE_TGTS+= build32
.endif
@@ -660,7 +673,7 @@ reinstall:
@echo ">>> Installing everything"
@echo "--------------------------------------------------------------"
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
-.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
+.if defined(LIB32TMP) && ${MK_LIB32} != "no"
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
.endif
@@ -669,7 +682,7 @@ redistribute:
@echo ">>> Distributing everything"
@echo "--------------------------------------------------------------"
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
-.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
+.if defined(LIB32TMP) && ${MK_LIB32} != "no"
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \
DISTRIBUTION=lib32
.endif
@@ -705,8 +718,12 @@ KERNCONF=${KERNFAST}
KERNCONF= ${KERNEL}
KERNWARN=
.else
+.if ${TARGET_ARCH} == "powerpc64"
+KERNCONF?= GENERIC64
+.else
KERNCONF?= GENERIC
.endif
+.endif
INSTKERNNAME?= kernel
KERNSRCDIR?= ${.CURDIR}/sys
@@ -1108,8 +1125,12 @@ _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc
# all shared libraries for ELF.
#
_startup_libs= gnu/lib/csu
-.if exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf)
+.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
+_startup_libs+= lib/csu/${MACHINE_ARCH}-elf
+.elif exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf)
_startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf
+.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
+_startup_libs+= lib/csu/${MACHINE_ARCH}
.else
_startup_libs+= lib/csu/${MACHINE_CPUARCH}
.endif
OpenPOWER on IntegriCloud