opendir change: refinement
[minix.git] / lib / csu / Makefile
blob149742fca843d4f0e979eee037b915d185112342
1 # $NetBSD: Makefile,v 1.31 2012/06/16 19:19:14 joerg Exp $
3 .include <bsd.own.mk>
5 .if ${USE_COMPILERCRTSTUFF} != "yes"
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
19 ARCHDIR:= ${.CURDIR}/arch/${CSU_MACHINE_ARCH}
21 .PATH: ${ARCHDIR}
22 . include "${ARCHDIR}/Makefile.inc"
24 . include "${.CURDIR}/common/Makefile.inc"
26 .else
28 CSU_MACHINE_ARCH?= ${MACHINE_ARCH}
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
45 . include <bsd.subdir.mk>
46 .endif