Module Name: src
Committed By: joerg
Date: Sat Jun 16 18:19:39 UTC 2012
Modified Files:
src/lib/csu: Makefile
Log Message:
Allow USE_COMPILERCRTSTUFF=yes for platforms that use MACHINE_CPU !=
MACHINE_ARCH.
To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/csu/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/csu/Makefile
diff -u src/lib/csu/Makefile:1.29 src/lib/csu/Makefile:1.30
--- src/lib/csu/Makefile:1.29 Mon Jan 31 17:54:20 2011
+++ src/lib/csu/Makefile Sat Jun 16 18:19:39 2012
@@ -1,12 +1,17 @@
-# $NetBSD: Makefile,v 1.29 2011/01/31 17:54:20 drochner Exp $
+# $NetBSD: Makefile,v 1.30 2012/06/16 18:19:39 joerg Exp $
.include <bsd.own.mk>
-CSU_MACHINE_ARCH?= ${MACHINE_ARCH}
-
.if ${USE_COMPILERCRTSTUFF} != "yes"
-ARCHDIR:= ${.CURDIR}/arch/${CSU_MACHINE_ARCH}
+.if exists(${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc)
+ARCHDIR:= ${.CURDIR}/arch/${MACHINE_ARCH}
+.elif exists(${.CURDIR}/arch/${MACHINE_CPU}/Makefile.inc)
+ARCHDIR:= ${.CURDIR}/arch/${MACHINE_CPU}
+.else
+.error Architecture (${MACHINE_ARCH} or ${MACHINE_CPU}) unsupported
+.endif
+
.PATH: ${ARCHDIR}
. include "${ARCHDIR}/Makefile.inc"
@@ -14,6 +19,8 @@ ARCHDIR:= ${.CURDIR}/arch/${CSU_MACHINE_
.else
+CSU_MACHINE_ARCH?= ${MACHINE_ARCH}
+
. if exists(${CSU_MACHINE_ARCH}_elf/Makefile)
SUBDIR= ${CSU_MACHINE_ARCH}_elf
. elif exists(${CSU_MACHINE_ARCH}/Makefile)