consolidate unwind.h and other hacks into a new Makefile.hacks that

everyone else can use
This commit is contained in:
mrg 2011-07-01 01:24:53 +00:00
parent 6a5d3863fb
commit 0b1fbc4c4d
4 changed files with 37 additions and 34 deletions

26
external/gpl3/gcc/lib/Makefile.hacks vendored Normal file
View File

@ -0,0 +1,26 @@
# $NetBSD: Makefile.hacks,v 1.1 2011/07/01 01:24:53 mrg Exp $
# some random crap we need in a few places
# these aren't necessary but are #include'd
FAKEHEADERS= ${EXTRA_FAKEHEADERS} insn-flags.h insn-constants.h
${FAKEHEADERS}:
${_MKTARGET_CREATE}
touch ${.TARGET}
tm.h ${SRCS}: ${FAKEHEADERS}
CLEANFILES+= ${FAKEHEADERS}
# arm.h wants MACHMODE aka "enum machine_mode" so we provide a hackful
# one here to help build libs before gcc itself is built.
# XXX arm hack
.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "armeb"
${OBJS}: insn-modes.h
# XXX XXX
${__DPSRCS.d}: insn-modes.h
insn-modes.h:
${_MKTARGET_CREATE}
echo "enum machine_mode { X };" > ${.TARGET}
DPSRCS+= insn-modes.h
CLEANFILES+= insn-modes.h
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2011/06/29 01:56:57 mrg Exp $
# $NetBSD: Makefile,v 1.4 2011/07/01 01:24:53 mrg Exp $
REQUIRETOOLS= yes
NOLINT= # defined
@ -51,14 +51,7 @@ FILESDIR=${LIBDIR}
.PATH: ${DIST}/gcc ${DIST}/gcc/config ${G_CONFIGDIR}
.include "../Makefile.tconfigh"
# these aren't necessary but are #include'd
FAKEHEADERS=options.h insn-flags.h insn-constants.h
${FAKEHEADERS}:
${_MKTARGET_CREATE}
touch ${.TARGET}
DPSRCS+= ${FAKEHEADERS}
CLEANFILES+= ${FAKEHEADERS}
.include "../Makefile.hacks"
${OBJS}: ${DPSRCS}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.5 2011/06/29 08:05:52 mrg Exp $
# $NetBSD: Makefile.inc,v 1.6 2011/07/01 01:24:53 mrg Exp $
.if ${MKGCC} != "no"
.if exists(${.CURDIR}/../arch/${MACHINE_ARCH}.mk)
@ -82,7 +82,7 @@ CLEANFILES+= ${LIB2FUNCS} ${LIB2FUNCS_ST} ${LIB2DIVMOD} cs-tconfig.h
CLEANFILES+= ${LIB1ASMFUNCS}
.endif
.for file in ${G_LIB2ADD:M${GNUHOSTDIST}*}
.for file in ${G_LIB2ADD:M${GNUHOSTDIST}*:N*.c}
BUILDSYMLINKS+= ${file} ${file:T:S/.asm$/.S/}
.endfor
@ -150,13 +150,8 @@ dp-bit.c: ${.CURDIR}/Makefile
.include "../Makefile.tconfigh"
DPSRCS+= tconfig.h
${SRCS}: unwind.h
BUILDSYMLINKS+= ${G_UNWIND_H} unwind.h
DPSRCS+= unwind.h
# these aren't necessary but are #include'd
FAKEHEADERS=options.h insn-flags.h insn-constants.h
${FAKEHEADERS}:
${_MKTARGET_CREATE}
touch ${.TARGET}
DPSRCS+= ${FAKEHEADERS}
CLEANFILES+= ${FAKEHEADERS}
.include "../../Makefile.hacks"

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2011/06/29 01:56:58 mrg Exp $
# $NetBSD: Makefile,v 1.4 2011/07/01 01:24:53 mrg Exp $
REQUIRETOOLS= yes
NOLINT= # defined
@ -73,24 +73,13 @@ runtime-info.h:
${OBJS} ${POBJS} ${SOBJS}: runtime-info.h
# these aren't necessary but are #include'd
FAKEHEADERS= ${EXTRA_FAKEHEADERS} insn-flags.h insn-constants.h
${FAKEHEADERS}:
${_MKTARGET_CREATE}
touch ${.TARGET}
tm.h ${SRCS}: ${FAKEHEADERS}
CLEANFILES+= ${FAKEHEADERS}
${SRCS}: tconfig.h unwind.h options.h
BUILDSYMLINKS+= ${G_UNWIND_H} unwind.h
DPSRCS+= unwind.h
.include "../Makefile.tconfigh"
unwind.h: ${G_UNWIND_H}
${_MKTARGET_CREATE}
rm -f ${.TARGET}
ln -s ${G_UNWIND_H} ${.TARGET}
CLEANFILES+= unwind.h
.include "../Makefile.hacks"
# XXX just while all platforms defs.mk are updated..
.if exists(${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk)