summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss/Makefile
blob: a5eff14e5d504a7fb26528f5811e66e4f0436929 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# $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

CFLAGS+= -I${.CURDIR} -I.
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}/usr/include > ${.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
.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>
OpenPOWER on IntegriCloud