qemu/tests/migration/Makefile
Wei Huang d54927efdc tests/migration: Support cross compilation in generating boot header file
Recently a new configure option, CROSS_CC_GUEST, was added to
$(TARGET)-softmmu/config-target.mak to support TCG-related tests. This
patch tries to leverage this option to support cross compilation when the
migration boot block file is being re-generated:

 * The x86 related files are moved to a new sub-dir (named ./i386).
 * A new top-layer Makefile is created in tests/migration/ directory.
   This Makefile searches and parses CROSS_CC_GUEST to generate CROSS_PREFIX.
   The CROSS_PREFIX, if available, is then passed to migration/$ARCH/Makefile.

Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Wei Huang <wei@redhat.com>
Message-Id: <1536174934-26022-3-git-send-email-wei@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2018-09-26 13:19:03 +01:00

36 lines
1.1 KiB
Makefile

#
# Copyright (c) 2018 Red Hat, Inc. and/or its affiliates
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
#
TARGET_LIST = i386
SRC_PATH = ../..
override define __note
/* This file is automatically generated from the assembly file in
* tests/migration/$@. Edit that file and then run "make all"
* inside tests/migration to update, and then remember to send both
* the header and the assembler differences in your patch submission.
*/
endef
export __note
find-arch-cross-cc = $(lastword $(shell grep -h "CROSS_CC_GUEST=" $(wildcard $(SRC_PATH)/$(patsubst i386,*86*,$(1))-softmmu/config-target.mak) /dev/null))
parse-cross-prefix = $(subst gcc,,$(patsubst cc,gcc,$(patsubst CROSS_CC_GUEST="%",%,$(call find-arch-cross-cc,$(1)))))
gen-cross-prefix = $(patsubst %-,CROSS_PREFIX=%-,$(call parse-cross-prefix,$(1)))
.PHONY: all $(TARGET_LIST)
all: $(TARGET_LIST)
$(TARGET_LIST):
$(MAKE) -C $@ $(call gen-cross-prefix,$@)
clean:
for target in $(TARGET_LIST); do \
$(MAKE) -C $$target clean; \
done