1 # $NetBSD: Makefile.inc,v 1.16 2014/08/10 23:25:49 matt Exp $
5 COMMON_DIR:=${.PARSEDIR}
7 COMMON_CODEDIRS=atomic gen inet md net stdlib string
9 COMMON_CODEDIRS=atomic gen gmon inet md net stdlib string sys
11 COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160 hash/murmurhash
13 .if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \
14 exists(${COMMON_DIR}/arch/${COMMON_MACHINE_ARCH})
15 COMMON_ARCHSUBDIR= ${COMMON_MACHINE_ARCH}
16 .elif defined(COMMON_MACHINE_CPU) && !empty(COMMON_MACHINE_CPU) && \
17 exists(${COMMON_DIR}/arch/${COMMON_MACHINE_CPU})
18 COMMON_ARCHSUBDIR= ${COMMON_MACHINE_CPU}
19 .elif defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \
20 exists(${KERNDIR}/arch/${LIBKERN_ARCH})
21 COMMON_ARCHSUBDIR= ${LIBKERN_ARCH}
22 .elif exists(${COMMON_DIR}/arch/${MACHINE_ARCH})
23 COMMON_ARCHSUBDIR= ${MACHINE_ARCH}
24 .elif exists(${COMMON_DIR}/arch/${MACHINE_CPU})
25 COMMON_ARCHSUBDIR= ${MACHINE_CPU}
28 COMMON_ARCHDIR=${COMMON_DIR}/arch/${COMMON_ARCHSUBDIR}
30 .for i in ${COMMON_CODEDIRS}
31 .if exists(${COMMON_DIR}/$i)
32 .PATH.c: ${COMMON_DIR}/$i
34 .if exists(${COMMON_ARCHDIR}/${i}/Makefile.inc)
35 .include "${COMMON_ARCHDIR}/${i}/Makefile.inc"
37 .if !empty(CPPFLAGS:M-DLIBKERN_OPTIMISE_SPACE) && \
38 exists(${COMMON_ARCHDIR}/$i/small)
39 .PATH.S: ${COMMON_ARCHDIR}/$i/small
42 .if exists(${COMMON_ARCHDIR}/$i)
43 .PATH.c: ${COMMON_ARCHDIR}/$i
44 .PATH.S: ${COMMON_ARCHDIR}/$i
48 CPPFLAGS+=-I${COMMON_DIR}/quad -I${COMMON_DIR}/string
49 .if defined(COMMON_ARCHSUBDIR)
50 CPPFLAGS+=-I${COMMON_ARCHDIR}/string