summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2017-09-28 09:01:23 -0700
committerRichard Henderson <richard.henderson@linaro.org>2017-10-26 11:56:20 +0200
commite219c499e9f5d4fa0e25dc07682f75531ee84d86 (patch)
tree27b6c4a77e0cd48264f79ed40749fcd78434d5fa /Makefile
parentb8d8720892f7912e8a2621b30ebac0e9a48e89e3 (diff)
downloadqemu-e219c499e9f5d4fa0e25dc07682f75531ee84d86.tar.gz
disas: Add capstone as submodule
Do not require the submodule, but use it if present. Allow the command-line to override system or git submodule either way. Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 9372742f86..ec73acfa9a 100644
--- a/Makefile
+++ b/Makefile
@@ -383,6 +383,21 @@ subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests
dtc/%: .git-submodule-status
mkdir -p $@
+# Overriding CFLAGS causes us to lose defines added in the sub-makefile.
+# Not overriding CFLAGS leads to mis-matches between compilation modes.
+# Therefore we replicate some of the logic in the sub-makefile.
+# Remove all the extra -Warning flags that QEMU uses that Capstone doesn't;
+# no need to annoy QEMU developers with such things.
+CAP_CFLAGS = $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS))
+CAP_CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
+CAP_CFLAGS += -DCAPSTONE_HAS_ARM
+CAP_CFLAGS += -DCAPSTONE_HAS_ARM64
+CAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
+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)" CFLAGS="$(CAP_CFLAGS)" $(SUBDIR_MAKEFLAGS) $(BUILD_DIR)/capstone/$(LIBCAPSTONE))
+
$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \
$(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))