summaryrefslogtreecommitdiff
path: root/gnu/lib/libgcc4
diff options
context:
space:
mode:
authoruebayasi <uebayasi@NetBSD.org>2009-11-30 11:47:06 +0000
committeruebayasi <uebayasi@NetBSD.org>2009-11-30 11:47:06 +0000
commitf6ebb00c831f697dc785fb02b6f85f1feafdbbc8 (patch)
tree38e876b2a2364ceb4b78c4e111a461adbb60bd22 /gnu/lib/libgcc4
parent051b421f3fa932394948391a0f9ee5605c0113da (diff)
Wrapper generation rule for the new style libgcc reach-over.
Diffstat (limited to 'gnu/lib/libgcc4')
-rw-r--r--gnu/lib/libgcc4/Makefile.wrapper60
1 files changed, 60 insertions, 0 deletions
diff --git a/gnu/lib/libgcc4/Makefile.wrapper b/gnu/lib/libgcc4/Makefile.wrapper
new file mode 100644
index 00000000000..601dad41e66
--- /dev/null
+++ b/gnu/lib/libgcc4/Makefile.wrapper
@@ -0,0 +1,60 @@
+# $NetBSD: Makefile.wrapper,v 1.1 2009/11/30 11:47:06 uebayasi Exp $
+
+#
+# libgcc function wrapper
+#
+
+.if !empty(SRCS:M*)
+${SRCS}: ${.CURDIR}/Makefile
+ ${_MKTARGET_CREATE}
+ { for i in ${_CPPFLAGS.${.TARGET}:C|-D||}; do \
+ printf "#define "; echo $$i | sed -e 's,=, ,g'; \
+ done; \
+ printf '#include <tmplsrc_${SRCS.${.TARGET}:C|/|_|g}>\n'; \
+ } >${.TARGET}
+
+DPSRCS+= ${SRCS}
+CLEANFILES+= ${SRCS}
+.endif
+
+#
+# libgcc functions that are built in a single file
+#
+
+.if !empty(TMPLSRCS:M*.c)
+${TMPLSRCS:C|^|tmplsrc_|}: ${.CURDIR}/Makefile
+ ${_MKTARGET_CREATE}
+ printf '#include <${.TARGET:C|^tmplsrc_||}>\n' >${.TARGET}
+
+${SRCS}: ${TMPLSRCS:C|^|tmplsrc_|}
+DPSRCS+= ${TMPLSRCS:C|^|tmplsrc_|}
+CLEANFILES+= ${TMPLSRCS:C|^|tmplsrc_|}
+.endif
+
+#
+# soft float functions
+#
+
+.if !empty(TMPLFPSRCS)
+${TMPLFPSRCS:C|^|tmplsrc_|}: ${.CURDIR}/Makefile
+ ${_MKTARGET_CREATE}
+ printf '#include "${GCCARCHLIBGCC}/${.TARGET:C|^tmplsrc_||}"\n' >${.TARGET}
+
+${SRCS}: ${TMPLFPSRCS:C|^|tmplsrc_|}
+DPSRCS+= ${TMPLFPSRCS:C|^|tmplsrc_|}
+CLEANFILES+= ${TMPLFPSRCS:C|^|tmplsrc_|}
+.endif
+
+#
+# functions written in an asm file
+#
+
+.if !empty(TMPLASMSRCS)
+${TMPLASMSRCS:C|^|tmplsrc_|:C|/|_|g}: ${.CURDIR}/Makefile
+ ${_MKTARGET_CREATE}
+ printf '#include <${G_LIB1ASMSRC}>\n' >${.TARGET}
+
+${SRCS}: ${TMPLASMSRCS:C|^|tmplsrc_|:C|/|_|g}
+DPSRCS+= ${TMPLASMSRCS:C|^|tmplsrc_|:C|/|_|g}
+CLEANFILES+= ${TMPLASMSRCS:C|^|tmplsrc_|:C|/|_|g}
+.endif