]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - sys/modules/linux/Makefile
MFC r271743:
[FreeBSD/stable/10.git] / sys / modules / linux / Makefile
1 # $FreeBSD$
2
3 .if ${MACHINE_CPUARCH} == "amd64"
4 SFX= 32
5 CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32
6 .endif
7
8 .PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}
9
10 KMOD=   linux
11 SRCS=   linux_fork.c 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         linux_timer.c \
17         opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \
18         vnode_if.h device_if.h bus_if.h assym.s
19
20 # XXX: for assym.s
21 SRCS+=  opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h
22 .if ${MACHINE_CPUARCH} == "i386"
23 SRCS+=  opt_apic.h
24 .endif
25
26 OBJS=   linux${SFX}_locore.o linux${SFX}_support.o
27
28 .if ${MACHINE_CPUARCH} == "i386"
29 SRCS+=  linux_ptrace.c imgact_linux.c opt_cpu.h
30 .endif
31
32 EXPORT_SYMS=
33 EXPORT_SYMS+=   linux_emul_path
34 EXPORT_SYMS+=   linux_get_osname
35 EXPORT_SYMS+=   linux_get_osrelease
36 EXPORT_SYMS+=   linux_ifname
37 EXPORT_SYMS+=   linux_ioctl_register_handler
38 EXPORT_SYMS+=   linux_ioctl_unregister_handler
39
40 CLEANFILES=     linux${SFX}_assym.h linux${SFX}_genassym.o
41
42 linux${SFX}_assym.h: linux${SFX}_genassym.o
43 .if exists(@)
44 linux${SFX}_assym.h: @/kern/genassym.sh
45 .endif
46         sh @/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
47
48 linux${SFX}_locore.o: linux${SFX}_locore.s linux${SFX}_assym.h
49         ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
50             ${.IMPSRC} -o ${.TARGET}
51
52 linux${SFX}_support.o: linux${SFX}_support.s assym.s linux${SFX}_assym.h
53         ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
54             ${.IMPSRC} -o ${.TARGET}
55
56 linux${SFX}_genassym.o: linux${SFX}_genassym.c linux.h @ machine x86
57         ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
58
59 .if !defined(KERNBUILDDIR)
60 opt_inet6.h:
61         echo "#define INET6 1" > ${.TARGET}
62 .if defined(KTR)
63 CFLAGS+=        -DKTR
64 .endif
65 .endif
66
67 .include <bsd.kmod.mk>