aboutsummaryrefslogtreecommitdiff
path: root/contrib/plugins
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-09-07 12:54:42 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2023-09-07 13:32:35 +0200
commitbafe78ad3bc4cef3a4d22e477c8940a7c955f1ea (patch)
treecb039717fdb3ae059cc158f8920f6eba6893f2ea /contrib/plugins
parent1d558c906eb6e9eb65d7bb94ed4d8aa5a0f2d423 (diff)
downloadqemu-bafe78ad3bc4cef3a4d22e477c8940a7c955f1ea.zip
qemu-bafe78ad3bc4cef3a4d22e477c8940a7c955f1ea.tar.gz
qemu-bafe78ad3bc4cef3a4d22e477c8940a7c955f1ea.tar.bz2
contrib/plugins: use an independent makefile
The initial reason to write this patch was to remove the last use of CONFIG_DEBUG_TCG from the makefiles; the flags to use to build TCG plugins are unrelated to --enable-debug-tcg, and instead they should be the same as those used to build emulators (the plugins are not build via meson for demonstration reasons only). However, since contrib/plugins/Makefile is also the last case of doing a compilation job using config-host.mak, go a step further and make it use a completely separate configuration file, removing all references to compilers from the toplevel config-host.mak. Clean up references to empty variables, and use .SECONDARY so that intermediate object files are not deleted. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'contrib/plugins')
-rw-r--r--contrib/plugins/Makefile16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
index c26fa08..8ba78c7 100644
--- a/contrib/plugins/Makefile
+++ b/contrib/plugins/Makefile
@@ -6,11 +6,11 @@
# programs that the main configure has already done for us.
#
-BUILD_DIR := $(CURDIR)/../..
+include config-host.mak
-include $(BUILD_DIR)/config-host.mak
+TOP_SRC_PATH = $(SRC_PATH)/../..
-VPATH += $(SRC_PATH)/contrib/plugins
+VPATH += $(SRC_PATH)
NAMES :=
NAMES += execlog
@@ -26,15 +26,14 @@ SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
# The main QEMU uses Glib extensively so it's perfectly fine to use it
# in plugins (which many example do).
-CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0)
-CFLAGS += -fPIC -Wall
-CFLAGS += $(if $(CONFIG_DEBUG_TCG), -ggdb -O0)
-CFLAGS += -I$(SRC_PATH)/include/qemu
+PLUGIN_CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0)
+PLUGIN_CFLAGS += -fPIC -Wall
+PLUGIN_CFLAGS += -I$(TOP_SRC_PATH)/include/qemu
all: $(SONAMES)
%.o: %.c
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(PLUGIN_CFLAGS) -c -o $@ $<
lib%.so: %.o
ifeq ($(CONFIG_DARWIN),y)
@@ -48,3 +47,4 @@ clean:
rm -Rf .libs
.PHONY: all clean
+.SECONDARY: