On 05/03/2018 02:51 PM, Michael S. Tsirkin wrote:
Each target is currently built with a different set of include
directories, this is what makes it possible to pull in a separate copy
of header files depending on the target.

Replace with per-target ifdefs which are easier to understand.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
---
  include/target-dir.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 63 insertions(+)
  create mode 100644 include/target-dir.h

Ah, now we get to the file mentioned in a couple of previous patches.

+#ifndef QEMU_TARGET_DIR_H
+#define QEMU_TARGET_DIR_H
+
+#if defined(TARGET_ALPHA)
+#define TARGET_DIR_PREFIX ../target/alpha
+#elif defined(TARGET_ARM)
+#define TARGET_DIR_PREFIX ../target/arm

+#elif defined(TARGET_XTENSA)
+#define TARGET_DIR_PREFIX ../target/xtensa
+#else
+#error "Target-specific directory include missing"
+#endif
+
+#define TARGET_DIR_HASH(file) #file
+#define TARGET_DIR_STRING(file) TARGET_DIR_HASH(file)
+#define TARGET_DIR(file) TARGET_DIR_STRING(TARGET_DIR_PREFIX/file)

Cool trick!  It seems pretty reasonable to me.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to