xref: /freebsd-12.1/sys/modules/linux/Makefile (revision 04f9b2d5)
1# $FreeBSD$
2
3.PATH:	${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux
4
5MAINTAINER=	marcel@FreeBSD.org
6
7KMOD=	linux
8SRCS=	linux_file.c linux_ioctl.c linux_ipc.c linux_machdep.c linux_misc.c \
9	linux_signal.c linux_socket.c linux_stats.c linux_mib.c \
10	linux_dummy.c linux_sysvec.c linux_util.c \
11	opt_compat.h opt_linux.h opt_vmpage.h vnode_if.h
12OBJS=	linux_locore.o
13
14.if ${MACHINE_ARCH} != "alpha"
15SRCS+=  imgact_linux.c
16.endif
17
18EXPORT_SYMS=_linux_mod
19CLEANFILES= linux_assym.h linux_genassym.o
20
21linux_assym.h:	linux_genassym.o
22.if exists(@)
23linux_assym.h:	@/kern/genassym.sh
24.endif
25	sh @/kern/genassym.sh linux_genassym.o > ${.TARGET}
26
27linux_locore.o:	linux_locore.s linux_assym.h
28	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
29		${.IMPSRC} -o ${.TARGET}
30
31linux_genassym.o:	linux_genassym.c linux.h @ machine
32	${CC} -c ${CFLAGS} ${.IMPSRC}
33
34opt_compat.h:
35	echo "#define COMPAT_43 1" > opt_compat.h
36
37GENSYSCALL=	linux_sysent.c linux_syscall.h linux_proto.h
38SRCS+= ${GENSYSCALL}
39CLEANFILES+= ${GENSYSCALL}
40
41.ORDER: ${GENSYSCALL}
42${GENSYSCALL}: @/kern/makesyscalls.sh \
43	    @/${MACHINE_ARCH}/linux/syscalls.master \
44		@/${MACHINE_ARCH}/linux/syscalls.conf
45	sh @/kern/makesyscalls.sh @/${MACHINE_ARCH}/linux/syscalls.master \
46		@/${MACHINE_ARCH}/linux/syscalls.conf
47	sed -e 's|${MACHINE_ARCH}/linux/linux_proto\.h|linux_proto.h|g' \
48	    linux_sysent.c > linux_sysent.c.fixup
49	    mv -f linux_sysent.c.fixup linux_sysent.c
50
51.include <bsd.kmod.mk>
52