162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci# 
362306a36Sopenharmony_ci# Copyright (C) 2000, 2002, 2003 Jeff Dike (jdike@karaya.com)
462306a36Sopenharmony_ci#
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci# pcap is broken in 2.5 because kbuild doesn't allow pcap.a to be linked
762306a36Sopenharmony_ci# in to pcap.o
862306a36Sopenharmony_ci
962306a36Sopenharmony_cislip-objs := slip_kern.o slip_user.o
1062306a36Sopenharmony_cislirp-objs := slirp_kern.o slirp_user.o
1162306a36Sopenharmony_cidaemon-objs := daemon_kern.o daemon_user.o
1262306a36Sopenharmony_civector-objs := vector_kern.o vector_user.o vector_transports.o
1362306a36Sopenharmony_ciumcast-objs := umcast_kern.o umcast_user.o
1462306a36Sopenharmony_cinet-objs := net_kern.o net_user.o
1562306a36Sopenharmony_cimconsole-objs := mconsole_kern.o mconsole_user.o
1662306a36Sopenharmony_cihostaudio-objs := hostaudio_kern.o
1762306a36Sopenharmony_ciubd-objs := ubd_kern.o ubd_user.o
1862306a36Sopenharmony_ciport-objs := port_kern.o port_user.o
1962306a36Sopenharmony_ciharddog-objs := harddog_kern.o
2062306a36Sopenharmony_ciharddog-builtin-$(CONFIG_UML_WATCHDOG) := harddog_user.o harddog_user_exp.o
2162306a36Sopenharmony_cirtc-objs := rtc_kern.o rtc_user.o
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciLDFLAGS_pcap.o = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a)
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ciLDFLAGS_vde.o = $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_citargets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
3062306a36Sopenharmony_ci	$(LD) -r -dp -o $@ $^ $(ld_flags)
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci$(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o
3362306a36Sopenharmony_ci	$(LD) -r -dp -o $@ $^ $(ld_flags)
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci#XXX: The call below does not work because the flags are added before the
3662306a36Sopenharmony_ci# object name, so nothing from the library gets linked.
3762306a36Sopenharmony_ci#$(call if_changed,ld)
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci# When the above is fixed, don't forget to add this too!
4062306a36Sopenharmony_ci#targets += $(obj)/pcap.o
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciobj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o
4362306a36Sopenharmony_ciobj-$(CONFIG_SSL) += ssl.o
4462306a36Sopenharmony_ciobj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ciobj-$(CONFIG_UML_NET_SLIP) += slip.o slip_common.o
4762306a36Sopenharmony_ciobj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o
4862306a36Sopenharmony_ciobj-$(CONFIG_UML_NET_DAEMON) += daemon.o 
4962306a36Sopenharmony_ciobj-$(CONFIG_UML_NET_VECTOR) += vector.o
5062306a36Sopenharmony_ciobj-$(CONFIG_UML_NET_VDE) += vde.o
5162306a36Sopenharmony_ciobj-$(CONFIG_UML_NET_MCAST) += umcast.o
5262306a36Sopenharmony_ciobj-$(CONFIG_UML_NET_PCAP) += pcap.o
5362306a36Sopenharmony_ciobj-$(CONFIG_UML_NET) += net.o 
5462306a36Sopenharmony_ciobj-$(CONFIG_MCONSOLE) += mconsole.o
5562306a36Sopenharmony_ciobj-$(CONFIG_MMAPPER) += mmapper_kern.o 
5662306a36Sopenharmony_ciobj-$(CONFIG_BLK_DEV_UBD) += ubd.o 
5762306a36Sopenharmony_ciobj-$(CONFIG_UML_SOUND) += hostaudio.o
5862306a36Sopenharmony_ciobj-$(CONFIG_NULL_CHAN) += null.o 
5962306a36Sopenharmony_ciobj-$(CONFIG_PORT_CHAN) += port.o
6062306a36Sopenharmony_ciobj-$(CONFIG_PTY_CHAN) += pty.o
6162306a36Sopenharmony_ciobj-$(CONFIG_TTY_CHAN) += tty.o 
6262306a36Sopenharmony_ciobj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o
6362306a36Sopenharmony_ciobj-$(CONFIG_UML_WATCHDOG) += harddog.o
6462306a36Sopenharmony_ciobj-y += $(harddog-builtin-y) $(harddog-builtin-m)
6562306a36Sopenharmony_ciobj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
6662306a36Sopenharmony_ciobj-$(CONFIG_UML_RANDOM) += random.o
6762306a36Sopenharmony_ciobj-$(CONFIG_VIRTIO_UML) += virtio_uml.o
6862306a36Sopenharmony_ciobj-$(CONFIG_UML_RTC) += rtc.o
6962306a36Sopenharmony_ciobj-$(CONFIG_UML_PCI_OVER_VIRTIO) += virt-pci.o
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci# pcap_user.o must be added explicitly.
7262306a36Sopenharmony_ciUSER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o pcap_user.o vde_user.o vector_user.o
7362306a36Sopenharmony_ciCFLAGS_null.o = -DDEV_NULL=$(DEV_NULL_PATH)
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ciCFLAGS_xterm.o += '-DCONFIG_XTERM_CHAN_DEFAULT_EMULATOR="$(CONFIG_XTERM_CHAN_DEFAULT_EMULATOR)"'
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ciinclude $(srctree)/arch/um/scripts/Makefile.rules
78