summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-02-24 15:37:59 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-02-24 15:38:00 +0000
commit6dedf0522c3fdeb10fe27d4aef35f4c57f3d0806 (patch)
treee1177c7fd43a8165c8f697ff0aa5a5e6fcdd7766 /Makefile
parent98b21dcdb331798709edafcd65b5b7a1e07302db (diff)
parentf966f9ddd175bdf82f12650c3b7b5a93cc421d88 (diff)
downloadqemu-6dedf0522c3fdeb10fe27d4aef35f4c57f3d0806.tar.gz
Merge remote-tracking branch 'remotes/bonzini/configure' into staging
* remotes/bonzini/configure: build: softmmu targets do not have a "main.o" file configure: Disable libtool if -fPIE does not work with it (bug #1257099) block: convert block drivers linked with libs to modules Makefile: introduce common-obj-m and block-obj-m for DSO Makefile: install modules with "make install" module: implement module loading rules.mak: introduce DSO rules darwin: do not use -mdynamic-no-pic block: use per-object cflags and libs rules.mak: allow per object cflags and libs rules.mak: fix $(obj) to a real relative path util: Split out exec_dir from os_find_datadir Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 28 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a443cd4976..a28a3c8d49 100644
--- a/Makefile
+++ b/Makefile
@@ -127,13 +127,29 @@ defconfig:
ifneq ($(wildcard config-host.mak),)
include $(SRC_PATH)/Makefile.objs
+endif
+
+dummy := $(call unnest-vars,, \
+ stub-obj-y \
+ util-obj-y \
+ qga-obj-y \
+ block-obj-y \
+ block-obj-m \
+ common-obj-y \
+ common-obj-m)
+
+ifneq ($(wildcard config-host.mak),)
include $(SRC_PATH)/tests/Makefile
endif
ifeq ($(CONFIG_SMARTCARD_NSS),y)
include $(SRC_PATH)/libcacard/Makefile
endif
-all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
+all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
+
+vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
+
+vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
config-host.h: config-host.h-timestamp
config-host.h-timestamp: config-host.mak
@@ -192,6 +208,9 @@ Makefile: $(version-obj-y) $(version-lobj-y)
libqemustub.a: $(stub-obj-y)
libqemuutil.a: $(util-obj-y) qapi-types.o qapi-visit.o
+block-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL
+util/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
+
######################################################################
qemu-img.o: qemu-img-cmds.h
@@ -247,6 +266,8 @@ clean:
rm -f qemu-options.def
find . -name '*.[oda]' -type f -exec rm -f {} +
find . -name '*.l[oa]' -type f -exec rm -f {} +
+ find . -name '*$(DSOSUF)' -type f -exec rm -f {} +
+ find . -name '*.mo' -type f -exec rm -f {} +
rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
rm -f fsdev/*.pod
rm -rf .libs */.libs
@@ -354,6 +375,12 @@ install-datadir install-localstatedir
ifneq ($(TOOLS),)
$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
endif
+ifneq ($(CONFIG_MODULES),)
+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
+ for s in $(patsubst %.mo,%$(DSOSUF),$(modules-m)); do \
+ $(INSTALL_PROG) $(STRIP_OPT) $$s "$(DESTDIR)$(qemu_moddir)/$${s//\//-}"; \
+ done
+endif
ifneq ($(HELPERS-y),)
$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"