For new libgcc rules; include generated makefiles first, then register ${LIB}

and on-the-fly source rules.

No changes against existing libgcc rules.
This commit is contained in:
uebayasi 2009-12-18 13:57:10 +00:00
parent 1d70400acb
commit 72c3db3e60
7 changed files with 41 additions and 20 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.18 2009/12/09 06:20:13 uebayasi Exp $
# $NetBSD: Makefile.inc,v 1.19 2009/12/18 13:57:10 uebayasi Exp $
.if ${MKGCC} != "no"
.if exists(${.CURDIR}/../arch/${MACHINE_ARCH}.mk)
@ -123,16 +123,6 @@ dp-bit.c: ${.CURDIR}/Makefile
# New style libgcc build procedure.
#
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/srcs.tmplsrcs.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/srcs.cppflags.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/srcs.copts.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/libs.lib${LIB}.srcs.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/libs.lib${LIB}.tmplsrcs.tmplsrcs.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/libs.lib${LIB}.tmplsrcs.tmplfpsrcs.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/libs.lib${LIB}.tmplsrcs.tmplasmsrcs.mk"
.include "${.CURDIR}/../Makefile.wrapper"
.endif # defined(MKNATIVE_LIBGCC_NEW)
#

View File

@ -0,0 +1,13 @@
# $NetBSD: Makefile.srcs,v 1.1 2009/12/18 13:57:10 uebayasi Exp $
#
# Generated makefiles.
#
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/srcs.tmplsrcs.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/srcs.cppflags.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/srcs.copts.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/libs.lib${LIB}.srcs.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/libs.lib${LIB}.tmplsrcs.tmplsrcs.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/libs.lib${LIB}.tmplsrcs.tmplfpsrcs.mk"
.include "${.CURDIR}/../arch/${MACHINE_ARCH}/libs.lib${LIB}.tmplsrcs.tmplasmsrcs.mk"

View File

@ -1,10 +1,10 @@
# $NetBSD: Makefile.wrapper,v 1.1 2009/11/30 11:47:06 uebayasi Exp $
# $NetBSD: Makefile.wrapper,v 1.2 2009/12/18 13:57:10 uebayasi Exp $
#
# libgcc function wrapper
#
.if !empty(SRCS:M*)
.if !empty(SRCS:M*.*)
${SRCS}: ${.CURDIR}/Makefile
${_MKTARGET_CREATE}
{ for i in ${_CPPFLAGS.${.TARGET}:C|-D||}; do \
@ -15,13 +15,15 @@ ${SRCS}: ${.CURDIR}/Makefile
DPSRCS+= ${SRCS}
CLEANFILES+= ${SRCS}
.else
.undef LIB
.endif
#
# libgcc functions that are built in a single file
#
.if !empty(TMPLSRCS:M*.c)
.if !empty(TMPLSRCS:M*)
${TMPLSRCS:C|^|tmplsrc_|}: ${.CURDIR}/Makefile
${_MKTARGET_CREATE}
printf '#include <${.TARGET:C|^tmplsrc_||}>\n' >${.TARGET}
@ -35,7 +37,7 @@ CLEANFILES+= ${TMPLSRCS:C|^|tmplsrc_|}
# soft float functions
#
.if !empty(TMPLFPSRCS)
.if !empty(TMPLFPSRCS:M*)
${TMPLFPSRCS:C|^|tmplsrc_|}: ${.CURDIR}/Makefile
${_MKTARGET_CREATE}
printf '#include "${GCCARCHLIBGCC}/${.TARGET:C|^tmplsrc_||}"\n' >${.TARGET}
@ -49,7 +51,7 @@ CLEANFILES+= ${TMPLFPSRCS:C|^|tmplsrc_|}
# functions written in an asm file
#
.if !empty(TMPLASMSRCS)
.if !empty(TMPLASMSRCS:M*.*)
${TMPLASMSRCS:C|^|tmplsrc_|:C|/|_|g}: ${.CURDIR}/Makefile
${_MKTARGET_CREATE}
printf '#include <${G_LIB1ASMSRC}>\n' >${.TARGET}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.9 2009/12/09 06:20:13 uebayasi Exp $
# $NetBSD: Makefile,v 1.10 2009/12/18 13:57:10 uebayasi Exp $
REQUIRETOOLS= yes
NOLINT= # defined
@ -21,12 +21,16 @@ SRCS+= ${LIB2_EH}
.else # defined(MKNATIVE_LIBGCC_NEW)
.include "../Makefile.srcs"
# New style.
TMPLSRCS= ${TMPLSRCS.libgcc.a}
TMPLFPSRCS= ${TMPLFPSRCS.libgcc.a}
TMPLASMSRCS= ${TMPLASMSRCS.libgcc.a}
SRCS= ${SRCS.libgcc.a}
.include "../Makefile.wrapper"
.endif # defined(MKNATIVE_LIBGCC_NEW)
.include <bsd.lib.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 2009/12/09 06:20:14 uebayasi Exp $
# $NetBSD: Makefile,v 1.8 2009/12/18 13:57:10 uebayasi Exp $
REQUIRETOOLS= yes
NOLINT= # defined
@ -18,12 +18,16 @@ COPTS.unwind-dw2.c = -Wno-stack-protector
.else # defined(MKNATIVE_LIBGCC_NEW)
.include "../Makefile.srcs"
# New style.
TMPLSRCS= ${TMPLSRCS.libgcc_eh.a}
TMPLFPSRCS= ${TMPLFPSRCS.libgcc_eh.a}
TMPLASMSRCS= ${TMPLASMSRCS.libgcc_eh.a}
SRCS= ${SRCS.libgcc_eh.a}
.include "../Makefile.wrapper"
.endif # defined(MKNATIVE_LIBGCC_NEW)
.include <bsd.lib.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.10 2009/12/09 06:20:14 uebayasi Exp $
# $NetBSD: Makefile,v 1.11 2009/12/18 13:57:10 uebayasi Exp $
USE_SHLIBDIR= yes
REQUIRETOOLS= yes
@ -28,12 +28,16 @@ SRCS+= ${LIB2FUNCS} ${LIB2DIVMOD} ${LIB2_EH} \
.else # defined(MKNATIVE_LIBGCC_NEW)
.include "../Makefile.srcs"
# New style.
TMPLSRCS= ${TMPLSRCS.libgcc_s.so}
TMPLFPSRCS= ${TMPLFPSRCS.libgcc_s.so}
TMPLASMSRCS= ${TMPLASMSRCS.libgcc_s.so}
SRCS= ${SRCS.libgcc_s.so}
.include "../Makefile.wrapper"
.endif # defined(MKNATIVE_LIBGCC_NEW)
COPTS.unwind-dw2.c = -Wno-stack-protector

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2009/12/18 12:48:16 uebayasi Exp $
# $NetBSD: Makefile,v 1.9 2009/12/18 13:57:10 uebayasi Exp $
REQUIRETOOLS= yes
NOPIC= # defined
@ -25,12 +25,16 @@ SRCS+= ${LIBGCOVSRCS}
.else # defined(MKNATIVE_LIBGCC_NEW)
.include "../Makefile.srcs"
# New style.
SRCS= ${SRCS.libgcov.a}
TMPLSRCS= ${TMPLSRCS.libgcov.a}
TMPLFPSRCS= ${TMPLFPSRCS.libgcov.a}
TMPLASMSRCS= ${TMPLASMSRCS.libgcov.a}
.include "../Makefile.wrapper"
.endif # defined(MKNATIVE_LIBGCC_NEW)
.if !defined(MKNATIVE_LIBGCC_NEW)