1# $FreeBSD$ 2 3.if ${MACHINE_ARCH} == "amd64" 4SFX= 32 5CFLAGS+=-DCOMPAT_IA32 -DCOMPAT_LINUX32 6.endif 7 8.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX} 9 10KMOD= linux 11SRCS= linux${SFX}_dummy.c linux_emul.c linux_file.c \ 12 linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ 13 linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ 14 linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ 15 linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ 16 opt_inet6.h opt_route.h opt_mac.h opt_compat.h opt_posix.h vnode_if.h \ 17 device_if.h bus_if.h assym.s 18 19# XXX: for assym.s 20SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h 21 22OBJS= linux${SFX}_locore.o linux${SFX}_support.o 23 24.if ${MACHINE_ARCH} == "i386" 25SRCS+= linux_ptrace.c imgact_linux.c opt_cpu.h 26.endif 27 28EXPORT_SYMS= 29EXPORT_SYMS+= linux_emul_path 30EXPORT_SYMS+= linux_get_osname 31EXPORT_SYMS+= linux_get_osrelease 32EXPORT_SYMS+= linux_ifname 33EXPORT_SYMS+= linux_ioctl_register_handler 34EXPORT_SYMS+= linux_ioctl_unregister_handler 35 36CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o 37 38linux${SFX}_assym.h: linux${SFX}_genassym.o 39.if exists(@) 40linux${SFX}_assym.h: @/kern/genassym.sh 41.endif 42 sh @/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET} 43 44linux${SFX}_locore.o: linux${SFX}_locore.s linux${SFX}_assym.h 45 ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ 46 ${.IMPSRC} -o ${.TARGET} 47 48linux${SFX}_support.o: linux${SFX}_support.s assym.s linux${SFX}_assym.h 49 ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ 50 ${.IMPSRC} -o ${.TARGET} 51 52linux${SFX}_genassym.o: linux${SFX}_genassym.c linux.h @ machine 53 ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC} 54 55.if !defined(KERNBUILDDIR) 56opt_inet6.h: 57 echo "#define INET6 1" > ${.TARGET} 58.endif 59 60.include <bsd.kmod.mk> 61