]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/truss/Makefile
Update clang to trunk r256945.
[FreeBSD/FreeBSD.git] / usr.bin / truss / Makefile
1 # $FreeBSD$
2
3 NO_WERROR=
4 PROG=   truss
5 SRCS=   cloudabi.c main.c setup.c syscalls.c
6
7 LIBADD= sysdecode
8
9 CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys
10
11 # Define where to generate syscalls for each ABI.
12 ABI_SYSPATH.freebsd=            sys/kern
13 ABI_SYSPATH.freebsd32=          sys/compat/freebsd32
14 ABI_SYSPATH.cloudabi64=         sys/compat/cloudabi64
15 ABI_SYSPATH.i386-linux=         sys/i386/linux
16 ABI_SYSPATH.amd64-linux32=      sys/amd64/linux32
17
18 ABIS+=          freebsd
19 # Each ABI is expected to have an ABI.c, MACHINE_ARCH-ABI.c or
20 # MACHINE_CPUARCH-ABI.c file that will be used to map the syscall arguments.
21 .if ${MACHINE_ARCH} == "aarch64"
22 ABIS+=          cloudabi64
23 .endif
24 .if ${MACHINE_CPUARCH} == "i386"
25 ABIS+=          i386-linux
26 .endif
27 .if ${MACHINE_CPUARCH} == "amd64"
28 ABIS+=          amd64-linux32
29 ABIS+=          freebsd32
30 ABIS+=          cloudabi64
31 .endif
32 .if ${MACHINE_ARCH} == "powerpc64"
33 ABIS+=          freebsd32
34 .endif
35
36 .for abi in ${ABIS}
37 # Find the right file to handle this ABI.
38 abi_src=
39 ABI_SRCS=       ${abi}.c ${MACHINE_ARCH}-${abi}.c ${MACHINE_CPUARCH}-${abi}.c
40 .for f in ${ABI_SRCS}
41 .if exists(${.CURDIR}/${f}) && empty(abi_src)
42 abi_src=        ${f}
43 .endif
44 .endfor
45 SRCS:=          ${SRCS} ${abi_src} ${abi}_syscalls.h
46 CLEANFILES+=    ${abi}_syscalls.conf ${abi}_syscalls.master ${abi}_syscalls.h
47 ${abi}_syscalls.conf: ${.CURDIR}/makesyscallsconf.sh
48         /bin/sh ${.CURDIR}/makesyscallsconf.sh ${abi} ${.TARGET}
49
50 ${abi}_syscalls.master: ${.CURDIR:H:H}/${ABI_SYSPATH.${abi}}/syscalls.master
51         cp -f ${.ALLSRC} ${.TARGET}
52
53 ${abi}_syscalls.h:      ${abi}_syscalls.master ${abi}_syscalls.conf \
54                         ${.CURDIR:H:H}/sys/kern/makesyscalls.sh
55         /bin/sh ${.CURDIR:H:H}/sys/kern/makesyscalls.sh \
56             ${abi}_syscalls.master ${abi}_syscalls.conf
57 # Eliminate compiler warning about non-static global.
58         sed -i '' '/^const char \*/s/^/static /' ${.TARGET}.tmp
59         mv ${.TARGET}.tmp ${.TARGET}
60 .endfor
61
62 .include <bsd.prog.mk>