xref: /freebsd/sys/modules/linux/Makefile (revision acd3428b7d3e94cef0e1881c868cb4b131d4ff41)
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_mac.h opt_compat.h opt_posix.h vnode_if.h \
17	device_if.h bus_if.h
18OBJS=	linux${SFX}_locore.o
19
20.if ${MACHINE_ARCH} == "i386"
21SRCS+=	linux_ptrace.c imgact_linux.c opt_cpu.h
22.endif
23
24EXPORT_SYMS=
25EXPORT_SYMS+=	linux_emul_path
26EXPORT_SYMS+=	linux_get_osname
27EXPORT_SYMS+=	linux_get_osrelease
28EXPORT_SYMS+=	linux_ifname
29EXPORT_SYMS+=	linux_ioctl_register_handler
30EXPORT_SYMS+=	linux_ioctl_unregister_handler
31
32CLEANFILES=	linux${SFX}_assym.h linux${SFX}_genassym.o
33
34linux${SFX}_assym.h: linux${SFX}_genassym.o
35.if exists(@)
36linux${SFX}_assym.h: @/kern/genassym.sh
37.endif
38	sh @/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
39
40linux${SFX}_locore.o: linux${SFX}_locore.s linux${SFX}_assym.h
41	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
42	    ${.IMPSRC} -o ${.TARGET}
43
44linux${SFX}_genassym.o: linux${SFX}_genassym.c linux.h @ machine
45	${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
46
47.if !defined(KERNBUILDDIR)
48opt_inet6.h:
49	echo "#define INET6 1" > opt_inet6.h
50.endif
51
52.include <bsd.kmod.mk>
53