NetBSD/sys/lkm/compat/Makefile.inc
jdolecek a24e94e460 Move the compat_util.c handling to lkm/compat/Makefile.inc. The users
are expected to set COMPAT_UTIL_OVERRIDE to preferred emulation name
prefix.
Use this for compat_freebsd and compat_linux LKMs.
2001-10-27 12:09:34 +00:00

37 lines
1.1 KiB
Makefile

# $NetBSD: Makefile.inc,v 1.6 2001/10/27 12:09:34 jdolecek Exp $
.if !target(assym.h)
S!= cd ${.CURDIR}/../../..;pwd
DPSRCS+= assym.h
.if exists($S/arch/${MACHINE}/${MACHINE}/genassym.cf)
GENASSYM_DIR?= $S/arch/${MACHINE}/${MACHINE}
.elif exists($S/arch/${MACHINE_ARCH}/${MACHINE_ARCH}/genassym.cf)
GENASSYM_DIR?= $S/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
.else
GENASSYM_DIR?=
.endif
assym.h: ${S}/kern/genassym.sh ${GENASSYM_DIR}/genassym.cf
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
< ${GENASSYM_DIR}/genassym.cf > assym.h.tmp && \
mv -f assym.h.tmp assym.h
.if defined(COMPAT_UTIL_OVERRIDE) && !empty(COMPAT_UTIL_OVERRIDE)
# compat_util.c symbol redifinitions
CPPFLAGS+= -Demul_find=${COMPAT_UTIL_OVERRIDE}_emul_find \
-Dstackgap_init=${COMPAT_UTIL_OVERRIDE}_stackgap_init \
-Demul_flags_translate=${COMPAT_UTIL_OVERRIDE}_emul_flags_translate \
-Dstackgap_alloc=${COMPAT_UTIL_OVERRIDE}_stackgap_alloc \
-Dcompat_offseterr=${COMPAT_UTIL_OVERRIDE}_compat_offseterr
# get emul_find() and friends
.PATH: $S/compat/common
SRCS+= compat_util.c
.endif
.include "../Makefile.inc"
.endif