1999-11-14 13:54:44 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2004-10-24 15:33:08 +00:00
|
|
|
NO_WERROR=
|
1997-12-06 05:23:12 +00:00
|
|
|
PROG= truss
|
2015-10-30 08:11:37 +00:00
|
|
|
SRCS= cloudabi.c ioctl.c main.c setup.c syscalls.c
|
1998-10-03 00:43:05 +00:00
|
|
|
|
2015-10-06 21:58:38 +00:00
|
|
|
.PATH: ${.CURDIR:H}/kdump
|
|
|
|
SRCS+= utrace.c
|
|
|
|
|
2015-10-08 05:27:45 +00:00
|
|
|
CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys
|
2015-10-13 18:23:51 +00:00
|
|
|
CLEANFILES= ioctl.c
|
1997-12-06 05:23:12 +00:00
|
|
|
|
2002-04-11 14:49:32 +00:00
|
|
|
ioctl.c: ${.CURDIR}/../kdump/mkioctls
|
2012-04-09 15:34:22 +00:00
|
|
|
env MACHINE=${MACHINE} CPP="${CPP}" \
|
2015-06-11 14:25:53 +00:00
|
|
|
/bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
|
1997-12-06 06:51:14 +00:00
|
|
|
|
2015-10-13 18:23:51 +00:00
|
|
|
# Define where to generate syscalls for each ABI.
|
|
|
|
ABI_SYSPATH.freebsd= sys/kern
|
|
|
|
ABI_SYSPATH.freebsd32= sys/compat/freebsd32
|
|
|
|
ABI_SYSPATH.cloudabi64= sys/compat/cloudabi64
|
|
|
|
ABI_SYSPATH.i386-linux= sys/i386/linux
|
|
|
|
ABI_SYSPATH.amd64-linux32= sys/amd64/linux32
|
2008-05-16 15:34:06 +00:00
|
|
|
|
2015-10-13 18:23:51 +00:00
|
|
|
ABIS+= freebsd
|
|
|
|
# Each ABI is expected to have an ABI.c, MACHINE_ARCH-ABI.c or
|
|
|
|
# MACHINE_CPUARCH-ABI.c file that will be used to map the syscall arguments.
|
2015-10-30 08:11:37 +00:00
|
|
|
.if ${MACHINE_ARCH} == "aarch64"
|
|
|
|
ABIS+= cloudabi64
|
|
|
|
.endif
|
2015-10-13 18:23:51 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "i386"
|
|
|
|
ABIS+= i386-linux
|
2008-05-16 15:34:06 +00:00
|
|
|
.endif
|
2010-08-23 22:24:11 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "amd64"
|
2015-10-13 18:23:51 +00:00
|
|
|
ABIS+= amd64-linux32
|
|
|
|
ABIS+= freebsd32
|
|
|
|
ABIS+= cloudabi64
|
2008-05-16 15:34:06 +00:00
|
|
|
.endif
|
2010-08-28 15:04:53 +00:00
|
|
|
.if ${MACHINE_ARCH} == "powerpc64"
|
2015-10-13 18:23:51 +00:00
|
|
|
ABIS+= freebsd32
|
|
|
|
.endif
|
2010-08-28 15:04:53 +00:00
|
|
|
|
2015-10-13 18:23:51 +00:00
|
|
|
.for abi in ${ABIS}
|
|
|
|
# Find the right file to handle this ABI.
|
|
|
|
abi_src=
|
|
|
|
ABI_SRCS= ${abi}.c ${MACHINE_ARCH}-${abi}.c ${MACHINE_CPUARCH}-${abi}.c
|
|
|
|
.for f in ${ABI_SRCS}
|
|
|
|
.if exists(${.CURDIR}/${f}) && empty(abi_src)
|
|
|
|
abi_src= ${f}
|
2010-08-28 15:04:53 +00:00
|
|
|
.endif
|
2015-10-13 18:23:51 +00:00
|
|
|
.endfor
|
|
|
|
SRCS:= ${SRCS} ${abi_src} ${abi}_syscalls.h
|
|
|
|
CLEANFILES+= ${abi}_syscalls.conf ${abi}_syscalls.master ${abi}_syscalls.h
|
|
|
|
${abi}_syscalls.conf: ${.CURDIR}/makesyscallsconf.sh
|
|
|
|
/bin/sh ${.CURDIR}/makesyscallsconf.sh ${abi} ${.TARGET}
|
|
|
|
|
|
|
|
${abi}_syscalls.master: ${.CURDIR:H:H}/${ABI_SYSPATH.${abi}}/syscalls.master
|
|
|
|
cp -f ${.ALLSRC} ${.TARGET}
|
|
|
|
|
|
|
|
${abi}_syscalls.h: ${abi}_syscalls.master ${abi}_syscalls.conf \
|
|
|
|
${.CURDIR:H:H}/sys/kern/makesyscalls.sh
|
|
|
|
/bin/sh ${.CURDIR:H:H}/sys/kern/makesyscalls.sh \
|
|
|
|
${abi}_syscalls.master ${abi}_syscalls.conf
|
|
|
|
# Eliminate compiler warning about non-static global.
|
|
|
|
sed -i '' '/^const char \*/s/^/static /' ${.TARGET}.tmp
|
|
|
|
mv ${.TARGET}.tmp ${.TARGET}
|
|
|
|
.endfor
|
2010-08-28 15:04:53 +00:00
|
|
|
|
1997-12-06 05:23:12 +00:00
|
|
|
.include <bsd.prog.mk>
|