5 SRCS= cloudabi.c main.c setup.c syscalls.c
9 CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys
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
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"
24 .if ${MACHINE_CPUARCH} == "i386"
27 .if ${MACHINE_CPUARCH} == "amd64"
32 .if ${MACHINE_ARCH} == "powerpc64"
37 # Find the right file to handle this ABI.
39 ABI_SRCS= ${abi}.c ${MACHINE_ARCH}-${abi}.c ${MACHINE_CPUARCH}-${abi}.c
41 .if exists(${.CURDIR}/${f}) && empty(abi_src)
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}
50 ${abi}_syscalls.master: ${.CURDIR:H:H}/${ABI_SYSPATH.${abi}}/syscalls.master
51 cp -f ${.ALLSRC} ${.TARGET}
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}
62 .include <bsd.prog.mk>