]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - sys/modules/linux/Makefile
- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
[FreeBSD/releng/10.3.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 VDSO=   linux${SFX}_vdso
11
12 KMOD=   linux
13 SRCS=   linux_fork.c linux${SFX}_dummy.c linux_file.c linux_event.c \
14         linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
15         linux${SFX}_machdep.c linux_misc.c linux_signal.c \
16         linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \
17         linux${SFX}_sysvec.c linux_uid16.c linux_time.c \
18         linux_timer.c linux_vdso.c \
19         opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \
20         vnode_if.h device_if.h bus_if.h assym.s \
21         linux${SFX}_support.s
22 DPSRCS= linux${SFX}_genassym.c
23
24 # XXX: for assym.s
25 SRCS+=  opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h
26 .if ${MACHINE_CPUARCH} == "i386"
27 SRCS+=  opt_apic.h
28 .endif
29
30 OBJS=   ${VDSO}.so
31
32 .if ${MACHINE_CPUARCH} == "i386"
33 SRCS+=  linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c \
34         linux_emul.c opt_cpu.h linux.c
35 .endif
36
37 .if ${MACHINE_CPUARCH} == "i386"
38 EXPORT_SYMS=
39 EXPORT_SYMS+=   linux_emul_path
40 EXPORT_SYMS+=   linux_get_osname
41 EXPORT_SYMS+=   linux_get_osrelease
42 EXPORT_SYMS+=   linux_ioctl_register_handler
43 EXPORT_SYMS+=   linux_ioctl_unregister_handler
44 .endif
45
46 CLEANFILES=     linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_locore.o
47
48 linux${SFX}_assym.h: linux${SFX}_genassym.o
49         sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
50
51 linux${SFX}_locore.o: linux${SFX}_assym.h assym.s
52         ${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s                    \
53         -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -nostdinc -nostdlib     \
54         -fno-omit-frame-pointer                                                 \
55         -Wl,-T${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}/${VDSO}.lds.s     \
56         -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-fPIC,-warn-common              \
57             ${.IMPSRC} -o ${.TARGET}
58
59 linux${SFX}_support.o: linux${SFX}_assym.h assym.s
60         ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
61             ${.IMPSRC} -o ${.TARGET}
62
63 .if ${MACHINE_CPUARCH} == "amd64"
64 ${VDSO}.so: linux${SFX}_locore.o
65         ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd                   \
66             --binary-architecture i386 linux${SFX}_locore.o ${.TARGET}
67 .else
68 ${VDSO}.so: linux${SFX}_locore.o
69         ${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd                     \
70             --binary-architecture i386 linux${SFX}_locore.o ${.TARGET}
71 .endif
72
73 linux${SFX}_genassym.o:
74         ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
75
76 .if !defined(KERNBUILDDIR)
77 opt_inet6.h:
78         echo "#define INET6 1" > ${.TARGET}
79 .if defined(KTR)
80 CFLAGS+=        -DKTR
81 .endif
82 .if defined(DEBUG)
83 CFLAGS+=        -DDEBUG
84 .endif
85 .endif
86
87 .include <bsd.kmod.mk>