153152Smarcel# $FreeBSD$
253152Smarcel
3136910SruNO_WERROR=
431567SsefPROG=	truss
5211935SnwhitehornSRCS=	main.c setup.c syscalls.c syscalls.h ioctl.c
639908Ssef
7211935Snwhitehorn.if exists(${.CURDIR}/${MACHINE_ARCH}-fbsd.c)
8211935SnwhitehornSRCS+= ${MACHINE_ARCH}-fbsd.c
9211935Snwhitehorn.else
10211935SnwhitehornSRCS+= ${MACHINE_CPUARCH}-fbsd.c
11211935Snwhitehorn.endif
12211935Snwhitehorn
1332367SsefCFLAGS+= -I${.CURDIR} -I.
14179051SjhbCLEANFILES= syscalls.master syscalls.h ioctl.c
1531567Ssef
1631567Ssef.SUFFIXES: .master
1731567Ssef
1831567Ssefsyscalls.master:	${.CURDIR}/../../sys/kern/syscalls.master
19115886Smarcel	cat ${.ALLSRC} > syscalls.master
2031567Ssef
2131567Ssefsyscalls.h:	syscalls.master
2231567Ssef	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh syscalls.master \
2331567Ssef		${.CURDIR}/i386.conf
2431567Ssef
2594432Sruioctl.c: ${.CURDIR}/../kdump/mkioctls
26234060Sdim	env MACHINE=${MACHINE} CPP="${CPP}" \
27226608Sdes		/bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}/usr/include > ${.TARGET}
2831571Ssef
29211725Simp.if ${MACHINE_CPUARCH} == "i386"
30179051SjhbSRCS+=	i386-linux.c linux_syscalls.h
31179051SjhbCLEANFILES+=i386l-syscalls.master linux_syscalls.h
32179051Sjhb
33179051Sjhbi386l-syscalls.master:	${.CURDIR}/../../sys/i386/linux/syscalls.master
34179051Sjhb	cat ${.ALLSRC} > ${.TARGET}
35179051Sjhb
36179051Sjhblinux_syscalls.h:	i386l-syscalls.master
37179051Sjhb	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
38179051Sjhb		${.CURDIR}/i386linux.conf
39179051Sjhb.endif
40179051Sjhb
41211725Simp.if ${MACHINE_CPUARCH} == "amd64"
42179051SjhbSRCS+=	amd64-linux32.c linux32_syscalls.h
43179051SjhbCLEANFILES+=amd64l32-syscalls.master linux32_syscalls.h
44179051Sjhb
45179051Sjhbamd64l32-syscalls.master: ${.CURDIR}/../../sys/amd64/linux32/syscalls.master
46179051Sjhb	cat ${.ALLSRC} > ${.TARGET}
47179051Sjhb
48179051Sjhblinux32_syscalls.h:	amd64l32-syscalls.master
49179051Sjhb	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
50179051Sjhb		${.CURDIR}/amd64linux32.conf
51179051Sjhb
52179051SjhbSRCS+=	amd64-fbsd32.c freebsd32_syscalls.h
53179051SjhbCLEANFILES+=fbsd32-syscalls.master freebsd32_syscalls.h
54179051Sjhb
55179051Sjhbfbsd32-syscalls.master: ${.CURDIR}/../../sys/compat/freebsd32/syscalls.master
56179051Sjhb	cat ${.ALLSRC} > ${.TARGET}
57179051Sjhb
58179051Sjhbfreebsd32_syscalls.h:	fbsd32-syscalls.master
59179051Sjhb	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
60179051Sjhb		${.CURDIR}/fbsd32.conf
61179051Sjhb.endif
62179051Sjhb
63211935Snwhitehorn.if ${MACHINE_ARCH} == "powerpc64"
64211935SnwhitehornSRCS+=	powerpc-fbsd.c freebsd32_syscalls.h
65211935SnwhitehornCLEANFILES+=fbsd32-syscalls.master freebsd32_syscalls.h
66211935Snwhitehorn
67211935Snwhitehornfbsd32-syscalls.master: ${.CURDIR}/../../sys/compat/freebsd32/syscalls.master
68211935Snwhitehorn	cat ${.ALLSRC} > ${.TARGET}
69211935Snwhitehorn
70211935Snwhitehornfreebsd32_syscalls.h:	fbsd32-syscalls.master
71211935Snwhitehorn	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh ${.ALLSRC} \
72211935Snwhitehorn		${.CURDIR}/fbsd32.conf
73211935Snwhitehorn.endif
74211935Snwhitehorn
7531567Ssef.include <bsd.prog.mk>
76