freebsd-dev/usr.bin/truss/Makefile
John Baldwin d6fb489498 Start on a new library (libsysdecode) that provides routines for decoding
system call information such as system call arguments.  Initially this
will consist of pulling duplicated code out of truss and kdump though it
may prove useful for other utilities in the future.

This commit moves the shared utrace(2) record parser out of kdump into
the library and updates kdump and truss to use it.  One difference from
the previous version is that the library version treats unknown events
that start with the "RTLD" signature as unknown events.  This simplifies
the interface and allows the consumer to decide how to handle all
non-recognized events.  Instead, this function only generates a string
description for known malloc() and RTLD records.

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D4537
2015-12-15 00:05:07 +00:00

68 lines
1.9 KiB
Makefile

# $FreeBSD$
NO_WERROR=
PROG= truss
SRCS= cloudabi.c ioctl.c main.c setup.c syscalls.c
LIBADD= sysdecode
CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys
CLEANFILES= ioctl.c
ioctl.c: ${.CURDIR}/../kdump/mkioctls
env MACHINE=${MACHINE} CPP="${CPP}" \
/bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
# 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
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.
.if ${MACHINE_ARCH} == "aarch64"
ABIS+= cloudabi64
.endif
.if ${MACHINE_CPUARCH} == "i386"
ABIS+= i386-linux
.endif
.if ${MACHINE_CPUARCH} == "amd64"
ABIS+= amd64-linux32
ABIS+= freebsd32
ABIS+= cloudabi64
.endif
.if ${MACHINE_ARCH} == "powerpc64"
ABIS+= freebsd32
.endif
.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}
.endif
.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
.include <bsd.prog.mk>