xref: /openbmc/linux/arch/um/drivers/Makefile (revision 479965a2)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Copyright (C) 2000, 2002, 2003 Jeff Dike (jdike@karaya.com)
4#
5
6# pcap is broken in 2.5 because kbuild doesn't allow pcap.a to be linked
7# in to pcap.o
8
9slip-objs := slip_kern.o slip_user.o
10slirp-objs := slirp_kern.o slirp_user.o
11daemon-objs := daemon_kern.o daemon_user.o
12vector-objs := vector_kern.o vector_user.o vector_transports.o
13umcast-objs := umcast_kern.o umcast_user.o
14net-objs := net_kern.o net_user.o
15mconsole-objs := mconsole_kern.o mconsole_user.o
16hostaudio-objs := hostaudio_kern.o
17ubd-objs := ubd_kern.o ubd_user.o
18port-objs := port_kern.o port_user.o
19harddog-objs := harddog_kern.o
20harddog-builtin-$(CONFIG_UML_WATCHDOG) := harddog_user.o harddog_user_exp.o
21rtc-objs := rtc_kern.o rtc_user.o
22
23LDFLAGS_pcap.o = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a)
24
25LDFLAGS_vde.o = $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
26
27targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
28
29$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
30	$(LD) -r -dp -o $@ $^ $(ld_flags)
31
32$(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o
33	$(LD) -r -dp -o $@ $^ $(ld_flags)
34
35#XXX: The call below does not work because the flags are added before the
36# object name, so nothing from the library gets linked.
37#$(call if_changed,ld)
38
39# When the above is fixed, don't forget to add this too!
40#targets += $(obj)/pcap.o
41
42obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o
43obj-$(CONFIG_SSL) += ssl.o
44obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o
45
46obj-$(CONFIG_UML_NET_SLIP) += slip.o slip_common.o
47obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o
48obj-$(CONFIG_UML_NET_DAEMON) += daemon.o
49obj-$(CONFIG_UML_NET_VECTOR) += vector.o
50obj-$(CONFIG_UML_NET_VDE) += vde.o
51obj-$(CONFIG_UML_NET_MCAST) += umcast.o
52obj-$(CONFIG_UML_NET_PCAP) += pcap.o
53obj-$(CONFIG_UML_NET) += net.o
54obj-$(CONFIG_MCONSOLE) += mconsole.o
55obj-$(CONFIG_MMAPPER) += mmapper_kern.o
56obj-$(CONFIG_BLK_DEV_UBD) += ubd.o
57obj-$(CONFIG_UML_SOUND) += hostaudio.o
58obj-$(CONFIG_NULL_CHAN) += null.o
59obj-$(CONFIG_PORT_CHAN) += port.o
60obj-$(CONFIG_PTY_CHAN) += pty.o
61obj-$(CONFIG_TTY_CHAN) += tty.o
62obj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o
63obj-$(CONFIG_UML_WATCHDOG) += harddog.o
64obj-y += $(harddog-builtin-y) $(harddog-builtin-m)
65obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
66obj-$(CONFIG_UML_RANDOM) += random.o
67obj-$(CONFIG_VIRTIO_UML) += virtio_uml.o
68obj-$(CONFIG_UML_RTC) += rtc.o
69obj-$(CONFIG_UML_PCI_OVER_VIRTIO) += virt-pci.o
70
71# pcap_user.o must be added explicitly.
72USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o pcap_user.o vde_user.o vector_user.o
73CFLAGS_null.o = -DDEV_NULL=$(DEV_NULL_PATH)
74
75CFLAGS_xterm.o += '-DCONFIG_XTERM_CHAN_DEFAULT_EMULATOR="$(CONFIG_XTERM_CHAN_DEFAULT_EMULATOR)"'
76
77include $(srctree)/arch/um/scripts/Makefile.rules
78