1 # $NetBSD: Makefile,v 1.31 2012/06/16 19:19:14 joerg Exp $ 2 3 .include <bsd.own.mk> 4 5 .if ${USE_COMPILERCRTSTUFF} != "yes" 6 7 .if defined(CSU_MACHINE_ARCH) 8 . if !exists(${.CURDIR}/arch/${CSU_MACHINE_ARCH}/Makefile.inc) 9 . error CSU_MACHINE_ARCH (${CSU_MACHINE_ARCH}) is unsupported 10 . endif 11 .elif exists(${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc) 12 CSU_MACHINE_ARCH= ${MACHINE_ARCH} 13 .elif exists(${.CURDIR}/arch/${MACHINE_CPU}/Makefile.inc) 14 CSU_MACHINE_ARCH= ${MACHINE_CPU} 15 .else 16 .error Architecture (${MACHINE_ARCH} or ${MACHINE_CPU}) unsupported 17 .endif 18 19 ARCHDIR:= ${.CURDIR}/arch/${CSU_MACHINE_ARCH} 20 21 .PATH: ${ARCHDIR} 22 . include "${ARCHDIR}/Makefile.inc" 23 24 . include "${.CURDIR}/common/Makefile.inc" 25 26 .else 27 28 CSU_MACHINE_ARCH?= ${MACHINE_ARCH} 29 30 . if exists(${CSU_MACHINE_ARCH}_elf/Makefile) 31 SUBDIR= ${CSU_MACHINE_ARCH}_elf 32 . elif exists(${CSU_MACHINE_ARCH}/Makefile) 33 SUBDIR= ${CSU_MACHINE_ARCH} 34 . elif exists(${MACHINE_CPU}_elf/Makefile) 35 SUBDIR= ${MACHINE_CPU}_elf 36 . elif exists(${MACHINE_CPU}/Makefile) 37 SUBDIR= ${MACHINE_CPU} 38 . else 39 .BEGIN: 40 @echo no SUBDIR for ${MACHINE_ARCH}_elf, ${MACHINE_ARCH} nor \ 41 ${MACHINE_CPU} 42 @false 43 . endif 44 45 . include <bsd.subdir.mk> 46 .endif 47