3 .PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE}/linux
8 SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \
9 linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
10 linux_machdep.c linux_misc.c linux_ptrace.c linux_signal.c \
11 linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \
12 linux_sysvec.c linux_time.c linux_vdso.c linux_timer.c \
13 opt_compat.h opt_inet6.h opt_posix.h opt_usb.h \
14 vnode_if.h device_if.h bus_if.h \
16 DPSRCS= assym.inc linux_genassym.c
19 SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
20 .if ${MACHINE_CPUARCH} == "i386"
24 CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o \
29 linux_assym.h: linux_genassym.o
30 sh ${SYSDIR}/kern/genassym.sh linux_genassym.o > ${.TARGET}
32 linux_locore.o: linux_locore.asm linux_assym.h
33 ${CC} -x assembler-with-cpp -DLOCORE -shared -mcmodel=small \
34 -pipe -I. -I${SYSDIR} ${WERROR} -Wall -fno-common -fPIC -nostdinc \
35 -Wl,-T${SRCTOP}/sys/${MACHINE}/linux/${VDSO}.lds.s \
36 -Wl,-soname=${VDSO}.so.1,-warn-common -nostdlib \
37 ${.IMPSRC} -o ${.TARGET}
39 .if ${MACHINE_CPUARCH} == "aarch64"
40 OBJCOPY_TARGET=--output-target elf64-littleaarch64 --binary-architecture aarch64
41 .elif ${MACHINE_CPUARCH} == "amd64"
42 OBJCOPY_TARGET=--output-target elf64-x86-64 --binary-architecture i386:x86-64
44 .error ${MACHINE_CPUARCH} not yet supported by linux64
46 ${VDSO}.so: linux_locore.o
47 ${OBJCOPY} --input-target binary ${OBJCOPY_TARGET} -S -g \
48 linux_locore.o ${.TARGET}
49 ${STRIPBIN} -N _binary_linux_locore_o_size ${.TARGET}
51 linux_support.o: assym.inc linux_assym.h
52 ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
53 ${.IMPSRC} -o ${.TARGET}
55 linux_genassym.o: offset.inc
56 ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
58 .if !defined(KERNBUILDDIR)
59 .warning Building Linuxulator outside of a kernel does not make sense
62 .include <bsd.kmod.mk>