xref: /freebsd/sys/modules/linux/Makefile (revision 3680a41902e44fbd0129e3c00045daeec8e1a1e5)
1c3aac50fSPeter Wemm# $FreeBSD$
2c21dee17SSøren Schmidt
3adfa0adeSAlexander Leidinger.if ${MACHINE_ARCH} == "amd64"
4adfa0adeSAlexander LeidingerSFX= 32
5adfa0adeSAlexander LeidingerCFLAGS+=-DCOMPAT_IA32 -DCOMPAT_LINUX32
6adfa0adeSAlexander Leidinger.endif
7adfa0adeSAlexander Leidinger
8adfa0adeSAlexander Leidinger.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX}
9c68159a6SDavid E. O'Brien
10a654d072SPeter WemmKMOD=	linux
113680a419SAlexander LeidingerSRCS=	linux${SFX}_dummy.c linux_emul.c linux_file.c \
126a1162d4SAlexander Leidinger	linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
136a1162d4SAlexander Leidinger	linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
146a1162d4SAlexander Leidinger	linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \
156a1162d4SAlexander Leidinger	linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \
166a1162d4SAlexander Leidinger	opt_inet6.h opt_mac.h opt_compat.h opt_posix.h vnode_if.h \
176a1162d4SAlexander Leidinger	device_if.h bus_if.h
18adfa0adeSAlexander LeidingerOBJS=	linux${SFX}_locore.o
19785d64c4SPeter Wemm
20e4b36f7dSPeter Wemm.if ${MACHINE_ARCH} == "i386"
21adfa0adeSAlexander LeidingerSRCS+=	linux_ptrace.c imgact_linux.c opt_cpu.h
22849baab8SDavid E. O'Brien.endif
23849baab8SDavid E. O'Brien
24bea8bf95SDag-Erling SmørgravEXPORT_SYMS=
25bea8bf95SDag-Erling SmørgravEXPORT_SYMS+=	linux_emul_path
26bea8bf95SDag-Erling SmørgravEXPORT_SYMS+=	linux_get_osname
27bea8bf95SDag-Erling SmørgravEXPORT_SYMS+=	linux_get_osrelease
28bea8bf95SDag-Erling SmørgravEXPORT_SYMS+=	linux_ifname
29bea8bf95SDag-Erling SmørgravEXPORT_SYMS+=	linux_ioctl_register_handler
30bea8bf95SDag-Erling SmørgravEXPORT_SYMS+=	linux_ioctl_unregister_handler
31bea8bf95SDag-Erling Smørgrav
32adfa0adeSAlexander LeidingerCLEANFILES=	linux${SFX}_assym.h linux${SFX}_genassym.o
33785d64c4SPeter Wemm
34adfa0adeSAlexander Leidingerlinux${SFX}_assym.h: linux${SFX}_genassym.o
3527d33931SBruce Evans.if exists(@)
36adfa0adeSAlexander Leidingerlinux${SFX}_assym.h: @/kern/genassym.sh
3727d33931SBruce Evans.endif
38adfa0adeSAlexander Leidinger	sh @/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
39785d64c4SPeter Wemm
40adfa0adeSAlexander Leidingerlinux${SFX}_locore.o: linux${SFX}_locore.s linux${SFX}_assym.h
4127e2d53cSBruce Evans	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
42c11bd941SBruce Evans	    ${.IMPSRC} -o ${.TARGET}
43785d64c4SPeter Wemm
44adfa0adeSAlexander Leidingerlinux${SFX}_genassym.o: linux${SFX}_genassym.c linux.h @ machine
45ee3c29ebSMike Smith	${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
46785d64c4SPeter Wemm
4782292344SYaroslav Tykhiy.if !defined(KERNBUILDDIR)
48ca26842eSHajimu UMEMOTOopt_inet6.h:
49ca26842eSHajimu UMEMOTO	echo "#define INET6 1" > opt_inet6.h
5082292344SYaroslav Tykhiy.endif
51ca26842eSHajimu UMEMOTO
5264db83a8SPeter Wemm.include <bsd.kmod.mk>
53