Makefile.inc revision 1.15
1# $NetBSD: Makefile.inc,v 1.15 2014/01/29 23:37:18 joerg Exp $ 2 3.include <bsd.own.mk> 4 5COMMON_DIR:=${.PARSEDIR} 6COMMON_CODEDIRS=atomic gen gmon inet md net stdlib string sys 7COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160 hash/murmurhash 8 9.if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \ 10 exists(${COMMON_DIR}/arch/${COMMON_MACHINE_ARCH}) 11COMMON_ARCHSUBDIR= ${COMMON_MACHINE_ARCH} 12.elif defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \ 13 exists(${KERNDIR}/arch/${LIBKERN_ARCH}) 14COMMON_ARCHSUBDIR= ${LIBKERN_ARCH} 15.elif exists(${COMMON_DIR}/arch/${MACHINE_ARCH}) 16COMMON_ARCHSUBDIR= ${MACHINE_ARCH} 17.elif exists(${COMMON_DIR}/arch/${MACHINE_CPU}) 18COMMON_ARCHSUBDIR= ${MACHINE_CPU} 19.endif 20 21COMMON_ARCHDIR=${COMMON_DIR}/arch/${COMMON_ARCHSUBDIR} 22 23.for i in ${COMMON_CODEDIRS} 24.if exists(${COMMON_DIR}/$i) 25.PATH.c: ${COMMON_DIR}/$i 26.endif 27.if exists(${COMMON_ARCHDIR}/${i}/Makefile.inc) 28.include "${COMMON_ARCHDIR}/${i}/Makefile.inc" 29.endif 30.if !empty(CPPFLAGS:M-DLIBKERN_OPTIMISE_SPACE) && \ 31 exists(${COMMON_ARCHDIR}/$i/small) 32.PATH.S: ${COMMON_ARCHDIR}/$i/small 33.endif 34 35.if exists(${COMMON_ARCHDIR}/$i) 36.PATH.c: ${COMMON_ARCHDIR}/$i 37.PATH.S: ${COMMON_ARCHDIR}/$i 38.endif 39.endfor 40 41CPPFLAGS+=-I${COMMON_DIR}/quad -I${COMMON_DIR}/string 42.if defined(COMMON_ARCHSUBDIR) 43CPPFLAGS+=-I${COMMON_ARCHDIR}/string 44.endif 45