1# $NetBSD: Makefile.inc,v 1.10 2008/10/26 07:22:50 mrg Exp $ 2 3COMMON_DIR:=${.PARSEDIR} 4COMMON_CODEDIRS=atomic gen gmon inet md net quad stdlib string sys 5COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160 6 7.if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \ 8 exists(${COMMON_DIR}/arch/${COMMON_MACHINE_ARCH}) 9COMMON_ARCHSUBDIR= ${COMMON_MACHINE_ARCH} 10.elif defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \ 11 exists(${KERNDIR}/arch/${LIBKERN_ARCH}) 12COMMON_ARCHSUBDIR= ${LIBKERN_ARCH} 13.elif exists(${COMMON_DIR}/arch/${MACHINE_ARCH}) 14COMMON_ARCHSUBDIR= ${MACHINE_ARCH} 15.elif exists(${COMMON_DIR}/arch/${MACHINE_CPU}) 16COMMON_ARCHSUBDIR= ${MACHINE_CPU} 17.endif 18 19COMMON_ARCHDIR=${COMMON_DIR}/arch/${COMMON_ARCHSUBDIR} 20 21.for i in ${COMMON_CODEDIRS} 22.if exists(${COMMON_DIR}/$i) 23.PATH.c: ${COMMON_DIR}/$i 24.endif 25.if exists(${COMMON_ARCHDIR}/${i}/Makefile.inc) 26.include "${COMMON_ARCHDIR}/${i}/Makefile.inc" 27.endif 28.if exists(${COMMON_ARCHDIR}/$i) 29.PATH.c: ${COMMON_ARCHDIR}/$i 30.PATH.S: ${COMMON_ARCHDIR}/$i 31.endif 32.endfor 33 34CPPFLAGS+=-I${COMMON_DIR}/quad -I${COMMON_DIR}/string 35.if defined(COMMON_ARCHSUBDIR) 36CPPFLAGS+=-I${COMMON_ARCHDIR}/string 37.endif 38