1 # $NetBSD: Makefile.inc,v 1.12 2012/07/08 01:21:12 rmind Exp $
3 COMMON_DIR:=${.PARSEDIR}
5 COMMON_CODEDIRS=atomic gen inet md net quad stdlib string
6 COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160
8 COMMON_CODEDIRS=atomic gen gmon inet md net quad stdlib string sys
9 COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160 hash/murmurhash
12 .if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \
13 exists(${COMMON_DIR}/arch/${COMMON_MACHINE_ARCH})
14 COMMON_ARCHSUBDIR= ${COMMON_MACHINE_ARCH}
15 .elif defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \
16 exists(${KERNDIR}/arch/${LIBKERN_ARCH})
17 COMMON_ARCHSUBDIR= ${LIBKERN_ARCH}
18 .elif exists(${COMMON_DIR}/arch/${MACHINE_ARCH})
19 COMMON_ARCHSUBDIR= ${MACHINE_ARCH}
20 .elif exists(${COMMON_DIR}/arch/${MACHINE_CPU})
21 COMMON_ARCHSUBDIR= ${MACHINE_CPU}
24 COMMON_ARCHDIR=${COMMON_DIR}/arch/${COMMON_ARCHSUBDIR}
26 .for i in ${COMMON_CODEDIRS}
27 .if exists(${COMMON_DIR}/$i)
28 .PATH.c: ${COMMON_DIR}/$i
30 .if exists(${COMMON_ARCHDIR}/${i}/Makefile.inc)
31 .include "${COMMON_ARCHDIR}/${i}/Makefile.inc"
33 .if !empty(CPPFLAGS:M-DLIBKERN_OPTIMISE_SPACE) && \
34 exists(${COMMON_ARCHDIR}/$i/small)
35 .PATH.S: ${COMMON_ARCHDIR}/$i/small
38 .if exists(${COMMON_ARCHDIR}/$i)
39 .PATH.c: ${COMMON_ARCHDIR}/$i
40 .PATH.S: ${COMMON_ARCHDIR}/$i
44 CPPFLAGS+=-I${COMMON_DIR}/quad -I${COMMON_DIR}/string
45 .if defined(COMMON_ARCHSUBDIR)
46 CPPFLAGS+=-I${COMMON_ARCHDIR}/string