xref: /freebsd/usr.bin/truss/Makefile (revision 656f49f8e2b0656824a5f10aeb760a00fdd3753f)
1# $FreeBSD$
2
3NO_WERROR=
4PROG=	truss
5SRCS=	main.c setup.c syscalls.c syscalls.h ioctl.c
6
7.if exists(${.CURDIR}/${MACHINE_ARCH}-fbsd.c)
8SRCS+= ${MACHINE_ARCH}-fbsd.c
9.else
10SRCS+= ${MACHINE_CPUARCH}-fbsd.c
11.endif
12
13.PATH:	${.CURDIR:H}/kdump
14SRCS+=	utrace.c
15
16CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys
17CLEANFILES= syscalls.master syscalls.h ioctl.c
18
19.SUFFIXES: .master
20
21syscalls.master:	${.CURDIR}/../../sys/kern/syscalls.master
22	cat ${.ALLSRC} > syscalls.master
23
24syscalls.h:	syscalls.master
25	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh syscalls.master \
26		${.CURDIR}/i386.conf
27
28ioctl.c: ${.CURDIR}/../kdump/mkioctls
29	env MACHINE=${MACHINE} CPP="${CPP}" \
30		/bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
31
32.if ${MACHINE_CPUARCH} == "i386"
33SRCS+=	i386-linux.c linux_syscalls.h
34CLEANFILES+=i386l-syscalls.master linux_syscalls.h
35
36i386l-syscalls.master:	${.CURDIR}/../../sys/i386/linux/syscalls.master
37	cat ${.ALLSRC} > ${.TARGET}
38
39linux_syscalls.h:	i386l-syscalls.master
40	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
41		${.CURDIR}/i386linux.conf
42.endif
43
44.if ${MACHINE_CPUARCH} == "amd64"
45SRCS+=	amd64-linux32.c linux32_syscalls.h
46CLEANFILES+=amd64l32-syscalls.master linux32_syscalls.h
47
48amd64l32-syscalls.master: ${.CURDIR}/../../sys/amd64/linux32/syscalls.master
49	cat ${.ALLSRC} > ${.TARGET}
50
51linux32_syscalls.h:	amd64l32-syscalls.master
52	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
53		${.CURDIR}/amd64linux32.conf
54
55SRCS+=	amd64-fbsd32.c freebsd32_syscalls.h
56CLEANFILES+=fbsd32-syscalls.master freebsd32_syscalls.h
57
58fbsd32-syscalls.master: ${.CURDIR}/../../sys/compat/freebsd32/syscalls.master
59	cat ${.ALLSRC} > ${.TARGET}
60
61freebsd32_syscalls.h:	fbsd32-syscalls.master
62	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
63		${.CURDIR}/fbsd32.conf
64
65SRCS+=	amd64-cloudabi64.c cloudabi64_syscalls.h
66CLEANFILES+=amd64cloudabi64-syscalls.master cloudabi64_syscalls.h
67
68amd64cloudabi64-syscalls.master: ${.CURDIR}/../../sys/compat/cloudabi64/syscalls.master
69	cat ${.ALLSRC} > ${.TARGET}
70
71cloudabi64_syscalls.h:	amd64cloudabi64-syscalls.master
72	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
73		${.CURDIR}/amd64cloudabi64.conf
74.endif
75
76.if ${MACHINE_ARCH} == "powerpc64"
77SRCS+=	powerpc-fbsd.c freebsd32_syscalls.h
78CLEANFILES+=fbsd32-syscalls.master freebsd32_syscalls.h
79
80fbsd32-syscalls.master: ${.CURDIR}/../../sys/compat/freebsd32/syscalls.master
81	cat ${.ALLSRC} > ${.TARGET}
82
83freebsd32_syscalls.h:	fbsd32-syscalls.master
84	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
85		${.CURDIR}/fbsd32.conf
86.endif
87
88.include <bsd.prog.mk>
89