2008-10-26 10:22:50 +03:00
|
|
|
# $NetBSD: Makefile.inc,v 1.10 2008/10/26 07:22:50 mrg Exp $
|
2005-12-20 22:28:49 +03:00
|
|
|
|
|
|
|
COMMON_DIR:=${.PARSEDIR}
|
2008-06-16 00:35:11 +04:00
|
|
|
COMMON_CODEDIRS=atomic gen gmon inet md net quad stdlib string sys
|
2006-10-28 01:23:15 +04:00
|
|
|
COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160
|
2005-12-20 22:28:49 +03:00
|
|
|
|
2008-10-26 10:22:50 +03:00
|
|
|
.if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \
|
|
|
|
exists(${COMMON_DIR}/arch/${COMMON_MACHINE_ARCH})
|
|
|
|
COMMON_ARCHSUBDIR= ${COMMON_MACHINE_ARCH}
|
|
|
|
.elif defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \
|
2005-12-22 00:47:30 +03:00
|
|
|
exists(${KERNDIR}/arch/${LIBKERN_ARCH})
|
|
|
|
COMMON_ARCHSUBDIR= ${LIBKERN_ARCH}
|
|
|
|
.elif exists(${COMMON_DIR}/arch/${MACHINE_ARCH})
|
|
|
|
COMMON_ARCHSUBDIR= ${MACHINE_ARCH}
|
2005-12-20 22:28:49 +03:00
|
|
|
.elif exists(${COMMON_DIR}/arch/${MACHINE_CPU})
|
2005-12-22 00:47:30 +03:00
|
|
|
COMMON_ARCHSUBDIR= ${MACHINE_CPU}
|
2005-12-27 11:43:05 +03:00
|
|
|
.endif
|
2005-12-20 22:28:49 +03:00
|
|
|
|
|
|
|
COMMON_ARCHDIR=${COMMON_DIR}/arch/${COMMON_ARCHSUBDIR}
|
|
|
|
|
|
|
|
.for i in ${COMMON_CODEDIRS}
|
|
|
|
.if exists(${COMMON_DIR}/$i)
|
|
|
|
.PATH.c: ${COMMON_DIR}/$i
|
|
|
|
.endif
|
2008-01-22 15:34:58 +03:00
|
|
|
.if exists(${COMMON_ARCHDIR}/${i}/Makefile.inc)
|
|
|
|
.include "${COMMON_ARCHDIR}/${i}/Makefile.inc"
|
|
|
|
.endif
|
2005-12-20 22:28:49 +03:00
|
|
|
.if exists(${COMMON_ARCHDIR}/$i)
|
2007-11-28 18:25:44 +03:00
|
|
|
.PATH.c: ${COMMON_ARCHDIR}/$i
|
2005-12-20 22:28:49 +03:00
|
|
|
.PATH.S: ${COMMON_ARCHDIR}/$i
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2005-12-27 11:43:05 +03:00
|
|
|
CPPFLAGS+=-I${COMMON_DIR}/quad -I${COMMON_DIR}/string
|
|
|
|
.if defined(COMMON_ARCHSUBDIR)
|
|
|
|
CPPFLAGS+=-I${COMMON_ARCHDIR}/string
|
|
|
|
.endif
|