freebsd-dev/usr.bin/truss/Makefile
Ed Schouten 808d980506 Properly format pointer size independent CloudABI system calls.
CloudABI has approximately 50 system calls that do not depend on the
pointer size of the system. As the ABI is pretty compact, it takes
little effort to each truss(8) the formatting rules for these system
calls. Start off by formatting pointer size independent system calls.

Changes:

- Make it possible to include the CloudABI system call definitions in
  FreeBSD userspace builds. Add ${root}/sys to the truss(8) Makefile so
  we can pull in <compat/cloudabi/cloudabi_syscalldefs.h>.
- Refactoring: patch up amd64-cloudabi64.c to use the CLOUDABI_*
  constants instead of rolling our own table.
- Add table entries for all of the system calls.
- Add new generic formatting types (UInt, IntArray) that we'll be using
  to format unsigned integers and arrays of integers.
- Add CloudABI specific formatting types.

Approved by:	jhb
Differential Revision:	https://reviews.freebsd.org/D3836
2015-10-08 05:27:45 +00:00

89 lines
2.6 KiB
Makefile

# $FreeBSD$
NO_WERROR=
PROG= truss
SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c
.if exists(${.CURDIR}/${MACHINE_ARCH}-fbsd.c)
SRCS+= ${MACHINE_ARCH}-fbsd.c
.else
SRCS+= ${MACHINE_CPUARCH}-fbsd.c
.endif
.PATH: ${.CURDIR:H}/kdump
SRCS+= utrace.c
CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys
CLEANFILES= syscalls.master syscalls.h ioctl.c
.SUFFIXES: .master
syscalls.master: ${.CURDIR}/../../sys/kern/syscalls.master
cat ${.ALLSRC} > syscalls.master
syscalls.h: syscalls.master
/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh syscalls.master \
${.CURDIR}/i386.conf
ioctl.c: ${.CURDIR}/../kdump/mkioctls
env MACHINE=${MACHINE} CPP="${CPP}" \
/bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= i386-linux.c linux_syscalls.h
CLEANFILES+=i386l-syscalls.master linux_syscalls.h
i386l-syscalls.master: ${.CURDIR}/../../sys/i386/linux/syscalls.master
cat ${.ALLSRC} > ${.TARGET}
linux_syscalls.h: i386l-syscalls.master
/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
${.CURDIR}/i386linux.conf
.endif
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= amd64-linux32.c linux32_syscalls.h
CLEANFILES+=amd64l32-syscalls.master linux32_syscalls.h
amd64l32-syscalls.master: ${.CURDIR}/../../sys/amd64/linux32/syscalls.master
cat ${.ALLSRC} > ${.TARGET}
linux32_syscalls.h: amd64l32-syscalls.master
/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
${.CURDIR}/amd64linux32.conf
SRCS+= amd64-fbsd32.c freebsd32_syscalls.h
CLEANFILES+=fbsd32-syscalls.master freebsd32_syscalls.h
fbsd32-syscalls.master: ${.CURDIR}/../../sys/compat/freebsd32/syscalls.master
cat ${.ALLSRC} > ${.TARGET}
freebsd32_syscalls.h: fbsd32-syscalls.master
/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
${.CURDIR}/fbsd32.conf
SRCS+= amd64-cloudabi64.c cloudabi64_syscalls.h
CLEANFILES+=amd64cloudabi64-syscalls.master cloudabi64_syscalls.h
amd64cloudabi64-syscalls.master: ${.CURDIR}/../../sys/compat/cloudabi64/syscalls.master
cat ${.ALLSRC} > ${.TARGET}
cloudabi64_syscalls.h: amd64cloudabi64-syscalls.master
/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
${.CURDIR}/amd64cloudabi64.conf
.endif
.if ${MACHINE_ARCH} == "powerpc64"
SRCS+= powerpc-fbsd.c freebsd32_syscalls.h
CLEANFILES+=fbsd32-syscalls.master freebsd32_syscalls.h
fbsd32-syscalls.master: ${.CURDIR}/../../sys/compat/freebsd32/syscalls.master
cat ${.ALLSRC} > ${.TARGET}
freebsd32_syscalls.h: fbsd32-syscalls.master
/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
${.CURDIR}/fbsd32.conf
.endif
.include <bsd.prog.mk>