]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - sys/modules/linux/Makefile
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.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 .if ${CC:T:Mclang} == "clang"
9 # XXX: clang integrated-as doesn't grok .codeNN directives yet
10 CFLAGS+=        ${.IMPSRC:T:Mlinux32_locore.s:C/^.+$/-no-integrated-as/}
11 .endif
12
13 .PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}
14
15 KMOD=   linux
16 SRCS=   linux_fork.c linux${SFX}_dummy.c linux_emul.c linux_file.c \
17         linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
18         linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
19         linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \
20         linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \
21         opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \
22         device_if.h bus_if.h assym.s
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=   linux${SFX}_locore.o linux${SFX}_support.o
31
32 .if ${MACHINE_CPUARCH} == "i386"
33 SRCS+=  linux_ptrace.c imgact_linux.c opt_cpu.h
34 .endif
35
36 EXPORT_SYMS=
37 EXPORT_SYMS+=   linux_emul_path
38 EXPORT_SYMS+=   linux_get_osname
39 EXPORT_SYMS+=   linux_get_osrelease
40 EXPORT_SYMS+=   linux_ifname
41 EXPORT_SYMS+=   linux_ioctl_register_handler
42 EXPORT_SYMS+=   linux_ioctl_unregister_handler
43
44 CLEANFILES=     linux${SFX}_assym.h linux${SFX}_genassym.o
45
46 linux${SFX}_assym.h: linux${SFX}_genassym.o
47 .if exists(@)
48 linux${SFX}_assym.h: @/kern/genassym.sh
49 .endif
50         sh @/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
51
52 linux${SFX}_locore.o: linux${SFX}_locore.s linux${SFX}_assym.h
53         ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
54             ${.IMPSRC} -o ${.TARGET}
55
56 linux${SFX}_support.o: linux${SFX}_support.s assym.s linux${SFX}_assym.h
57         ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
58             ${.IMPSRC} -o ${.TARGET}
59
60 linux${SFX}_genassym.o: linux${SFX}_genassym.c linux.h @ machine
61         ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
62
63 .if !defined(KERNBUILDDIR)
64 opt_inet6.h:
65         echo "#define INET6 1" > ${.TARGET}
66 .if defined(KTR)
67 CFLAGS+=        -DKTR
68 .endif
69 .endif
70
71 .include <bsd.kmod.mk>