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