]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
build-sys: use a separate slirp-obj-y && slirp.mo
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 21 Nov 2018 22:06:30 +0000 (02:06 +0400)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 14 Jan 2019 22:36:32 +0000 (23:36 +0100)
This will allow to have cflags for the whole slirp.mo -objs.
It makes it possible to build tests that links only with
slirp-obj-y (and not the whole common-obj).

It is also a step towards building slirp as a shared library, although
this requires a bit more thoughts to build with
net/slirp.o (CONFIG_SLIRP would need to be 'm') and other build issues.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Makefile
Makefile.objs
Makefile.target
slirp/Makefile.objs

index a9ac16d94e8ff00b033f9c98301a5510d97b9c89..dccba1dca27ffe80be59ee7d8e2407a53bd1e422 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -379,7 +379,8 @@ dummy := $(call unnest-vars,, \
                 ui-obj-m \
                 audio-obj-y \
                 audio-obj-m \
-                trace-obj-y)
+                trace-obj-y \
+                slirp-obj-y)
 
 include $(SRC_PATH)/tests/Makefile.include
 
@@ -452,7 +453,7 @@ CAP_CFLAGS += -DCAPSTONE_HAS_X86
 subdir-capstone: .git-submodule-status
        $(call quiet-command,$(MAKE) -C $(SRC_PATH)/capstone CAPSTONE_SHARED=no BUILDDIR="$(BUILD_DIR)/capstone" CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" CFLAGS="$(CAP_CFLAGS)" $(SUBDIR_MAKEFLAGS) $(BUILD_DIR)/capstone/$(LIBCAPSTONE))
 
-$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \
+$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) $(slirp-obj-y) \
        $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
index 2121120492904d5b88793ba0fc250bb2e5bd7cfb..67a054b08af5143bd1f7c11d39686b076232dd0e 100644 (file)
@@ -17,6 +17,7 @@ util-obj-y += $(QAPI_MODULES:%=qapi/qapi-events-%.o)
 util-obj-y += qapi/qapi-introspect.o
 
 chardev-obj-y = chardev/
+slirp-obj-$(CONFIG_SLIRP) = slirp/
 
 #######################################################################
 # block-obj-y is code used by both qemu system emulation and qemu-img
@@ -79,8 +80,6 @@ common-obj-y += vl.o
 vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS)
 common-obj-$(CONFIG_TPM) += tpm.o
 
-common-obj-$(CONFIG_SLIRP) += slirp/
-
 common-obj-y += backends/
 common-obj-y += chardev/
 
index 44ec4b630cf633a52afd33ac456189629e328fd4..39f72e81be048529f677e906de237c70ff5fc1e7 100644 (file)
@@ -165,6 +165,7 @@ target-obj-y :=
 block-obj-y :=
 common-obj-y :=
 chardev-obj-y :=
+slirp-obj-y :=
 include $(SRC_PATH)/Makefile.objs
 dummy := $(call unnest-vars,,target-obj-y)
 target-obj-y-save := $(target-obj-y)
@@ -177,7 +178,8 @@ dummy := $(call unnest-vars,.., \
                qom-obj-y \
                io-obj-y \
                common-obj-y \
-               common-obj-m)
+               common-obj-m \
+               slirp-obj-y)
 target-obj-y := $(target-obj-y-save)
 all-obj-y += $(common-obj-y)
 all-obj-y += $(target-obj-y)
@@ -186,6 +188,7 @@ all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) $(chardev-obj-y)
 all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
+all-obj-$(CONFIG_SOFTMMU) += $(slirp-obj-y)
 
 $(QEMU_PROG_BUILD): config-devices.mak
 
index 28049b03cddcffbc313a7920cb1319a0345bb220..21653f69e940168a17f4faa354cdad117eddc367 100644 (file)
@@ -1,5 +1,30 @@
-common-obj-y = cksum.o if.o ip_icmp.o ip6_icmp.o ip6_input.o ip6_output.o \
-               ip_input.o ip_output.o dnssearch.o dhcpv6.o
-common-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
-common-obj-y += tcp_subr.o tcp_timer.o udp.o udp6.o bootp.o tftp.o arp_table.o \
-                ndp_table.o ncsi.o
+slirp-obj-y = slirp.mo
+
+slirp.mo-objs = \
+       arp_table.o \
+       bootp.o \
+       cksum.o \
+       dhcpv6.o \
+       dnssearch.o \
+       if.o \
+       ip6_icmp.o \
+       ip6_input.o \
+       ip6_output.o \
+       ip_icmp.o \
+       ip_input.o \
+       ip_output.o \
+       mbuf.o \
+       misc.o \
+       ncsi.o \
+       ndp_table.o \
+       sbuf.o \
+       slirp.o \
+       socket.o \
+       tcp_input.o \
+       tcp_output.o \
+       tcp_subr.o \
+       tcp_timer.o \
+       tftp.o \
+       udp.o \
+       udp6.o \
+       $(NULL)