minix/external/gpl3/gcc/usr.bin/Makefile.inc
Lionel Sambuc 0cdf705cc6 Enable optional GCC install and GCC improvements
-By adding MKGCC=yes and MKGCCCMDS=yes on the make commandline
   it is now possible to compile and install GCC on the system.

   Before doing this, if you are not using the build.sh script,
   you will need to call the fetch scripts in order to retrieve
   the sources of GCC and its dependencies.

 -Reduce difference with NetBSD share/mk

   Move Minix-specific parameters from bsd.gcc.mk to bsd.own.mk,
   which is anyway patched, so that bsd.gcc.mk is now aligned
   on the NetBSD version.

 -Clean libraries dependencies, compiles stdc++ only if gcc is
   also compiled (it is part of the gcc sources)

 -Correct minix.h header sequence, cleanup spec headers.

 -Fix cross-compilation from a 32bit host targeting MINIX/arm

Change-Id: I1b234af18eed4ab5675188244e931b2a2b7bd943
2013-07-12 14:22:03 +02:00

105 lines
3 KiB
Makefile

# $NetBSD: Makefile.inc,v 1.11 2012/09/18 07:05:15 skrll Exp $
.ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_
_EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_=1
.include <bsd.own.mk>
TOP= ${NETBSDSRCDIR}
DIST= ${TOP}/external/gpl3/gcc/dist
GCCARCH= ${.CURDIR}/../gcc/arch/${MACHINE_ARCH}
CPPFLAGS+= -DLOCALEDIR=\"/usr/share/locale\"
HOST_CPPFLAGS+= -I${.CURDIR}/..
# Link in the GMP/MPFR/MPC headers since we don't install them
BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl3/gmp/lib/libgmp/arch/${MACHINE_ARCH}/gmp.h gmp.h
BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl3/mpfr/dist/mpfr.h mpfr.h
BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl3/mpfr/dist/mpf2mpfr.h mpf2mpfr.h
BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl2/mpc/dist/src/mpc.h mpc.h
BUILDSYMLINKS+= ${NETBSDSRCDIR}/external/lgpl2/mpc/dist/src/mpc-log.h mpc-log.h
CPPFLAGS+= -I.
# XXX
DPSRCS+= gmp.h mpfr.h mpf2mpfr.h mpc.h mpc-log.h
.if ${USETOOLS} == "yes"
COMPATOBJDIR!= cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
NBCOMPATLIB= -L${COMPATOBJDIR} -lnbcompat
.endif
GNUHOSTDIST= ${DIST}
BUILD_PREFIX= ${C_BUILD_PREFIX}
LIBIBERTYOBJ!= cd ${.CURDIR}/../../lib/libiberty && ${PRINTOBJDIR}
FRONTENDOBJ!= cd ${.CURDIR}/../frontend && ${PRINTOBJDIR}
BACKENDOBJ!= cd ${.CURDIR}/../backend && ${PRINTOBJDIR}
LIBCPPOBJ!= cd ${.CURDIR}/../libcpp && ${PRINTOBJDIR}
LIBDECNUMBEROBJ!= cd ${.CURDIR}/../libdecnumber && ${PRINTOBJDIR}
HOSTLIBIBERTYOBJ!= cd ${.CURDIR}/../host-libiberty && ${PRINTOBJDIR}
HOSTLIBIBERTY= ${HOSTLIBIBERTYOBJ}/libiberty/libiberty.a
BASEVER!= cat ${GNUHOSTDIST}/gcc/BASE-VER
# XXX
#DEVPHASE!= cat ${GNUHOSTDIST}/gcc/DEV-PHASE
DEVPHASE=
.if ${DEVPHASE} == "release" || ${DEVPHASE} == ""
DATESTAMP=
.else
DATESTAMP!= cat ${GNUHOSTDIST}/gcc/DATESTAMP
.endif
BASEVERSTR= "\"$(BASEVER)\""
.if !empty(DEVPHASE)
DEVPHASESTR= "\" $(DEVPHASE)\""
.else
DEVPHASESTR= "\"\""
.endif
.if !empty(DATESTAMP)
DATESTAMPSTR= "\" $(DATESTAMP)\""
.else
DATESTAMPSTR= "\"\""
.endif
# XXX pull this out of our configs
G_BUGURL=<http://www.NetBSD.org/Misc/send-pr.html>
G_BUGURL_s="\"${G_BUG_URL}\""
G_PKGVERSION=(NetBSD nb1 20120916)
G_PKGVERSION_s="\"${G_PKGVERSION} \""
VER_CPPFLAGS= -DBUGURL=${G_BUGURL_s} \
-DPKGVERSION=${G_PKGVERSION_s} \
-DBASEVER="\"${BASEVER}"\" \
-DDATESTAMP=${DATESTAMPSTR} \
-DDEVPHASE=${DEVPHASE} \
-DREVISION=${REVISION}
CPPFLAGS.version.c= ${VER_CPPFLAGS}
.include "${GCCARCH}/defs.mk"
.if ${MKPIC} != "no"
.if ${G_ENABLE_SHARED} == "yes" && ${G_SHLIB_LINK} != ""
CPPFLAGS+= -DENABLE_SHARED_LIBGCC
.endif
.if empty(G_SHLIB_MULTILIB)
CPPFLAGS+= -DNO_SHARED_LIBGCC_MULTILIB
.endif
.endif
# This depends on the "extern inline" mess, so downgrade to something safe.
# CPPFLAGS is applied after CFLAGS, which gets the -std=gnu99
CPPFLAGS+= -std=gnu89
NOCLANGERROR= # defined
.if defined(__MINIX)
CPPFLAGS+= -DSTANDARD_EXEC_PREFIX=\"/usr/lib/gcc\"
CPPFLAGS+= -DSTANDARD_LIBEXEC_PREFIX=\"/usr/bin\"
CPPFLAGS+= -DSTANDARD_BINDIR_PREFIX=\"/usr/bin/\"
CPPFLAGS+= -DTOOLDIR_BASE_PREFIX=\"../../../../\"
.endif # defined(__MINIX)
.endif