1 # $NetBSD: Makefile,v 1.32 2013/04/28 06:09:52 matt 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 !empty(MACHINE_ARCH:Mearm*) 12 CSU_MACHINE_ARCH= earm 13 .elif exists(${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc) 14 CSU_MACHINE_ARCH= ${MACHINE_ARCH} 15 .elif exists(${.CURDIR}/arch/${MACHINE_CPU}/Makefile.inc) 16 CSU_MACHINE_ARCH= ${MACHINE_CPU} 17 .else 18 .error Architecture (${MACHINE_ARCH} or ${MACHINE_CPU}) unsupported 19 .endif 20 21 ARCHDIR:= ${.CURDIR}/arch/${CSU_MACHINE_ARCH} 22 23 .PATH: ${ARCHDIR} 24 . include "${ARCHDIR}/Makefile.inc" 25 26 . include "${.CURDIR}/common/Makefile.inc" 27 28 .else 29 30 CSU_MACHINE_ARCH?= ${MACHINE_ARCH} 31 32 . if exists(${CSU_MACHINE_ARCH}_elf/Makefile) 33 SUBDIR= ${CSU_MACHINE_ARCH}_elf 34 . elif exists(${CSU_MACHINE_ARCH}/Makefile) 35 SUBDIR= ${CSU_MACHINE_ARCH} 36 . elif exists(${MACHINE_CPU}_elf/Makefile) 37 SUBDIR= ${MACHINE_CPU}_elf 38 . elif exists(${MACHINE_CPU}/Makefile) 39 SUBDIR= ${MACHINE_CPU} 40 . else 41 .BEGIN: 42 @echo no SUBDIR for ${MACHINE_ARCH}_elf, ${MACHINE_ARCH} nor \ 43 ${MACHINE_CPU} 44 @false 45 . endif 46 47 . include <bsd.subdir.mk> 48 .endif 49