diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 54 |
1 files changed, 53 insertions, 1 deletions
@@ -14,6 +14,27 @@ ifneq ($(wildcard config-host.mak),) all: include config-host.mak +git-submodule-update: + +.PHONY: git-submodule-update + +ifeq (0,$(MAKELEVEL)) + git_module_status := $(shell \ + cd '$(SRC_PATH)' && \ + ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \ + echo $$?; \ + ) + +ifeq (1,$(git_module_status)) +git-submodule-update: + $(call quiet-command, \ + (cd $(SRC_PATH) && ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \ + "GIT","$(GIT_SUBMODULES)") +endif +endif + +.git-submodule-status: git-submodule-update config-host.mak + # Check that we're not trying to do an out-of-tree build from # a tree that's been used for an in-tree build. ifneq ($(realpath $(SRC_PATH)),$(realpath .)) @@ -84,6 +105,7 @@ endif GENERATED_FILES += $(TRACE_HEADERS) GENERATED_FILES += $(TRACE_SOURCES) GENERATED_FILES += $(BUILD_DIR)/trace-events-all +GENERATED_FILES += .git-submodule-status trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g') @@ -191,6 +213,31 @@ trace-dtrace-root.h: trace-dtrace-root.dtrace trace-dtrace-root.o: trace-dtrace-root.dtrace +KEYCODEMAP_GEN = $(SRC_PATH)/ui/keycodemapdb/tools/keymap-gen +KEYCODEMAP_CSV = $(SRC_PATH)/ui/keycodemapdb/data/keymaps.csv + +KEYCODEMAP_FILES = \ + ui/input-keymap-linux-to-qcode.c \ + ui/input-keymap-qcode-to-qnum.c \ + ui/input-keymap-qnum-to-qcode.c \ + $(NULL) + +GENERATED_FILES += $(KEYCODEMAP_FILES) + +ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs + $(call quiet-command,\ + src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \ + dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \ + test -e $(KEYCODEMAP_GEN) && \ + $(PYTHON) $(KEYCODEMAP_GEN) \ + --lang glib2 \ + --varname qemu_input_map_$${src}_to_$${dst} \ + code-map $(KEYCODEMAP_CSV) $${src} $${dst} \ + > $@ || rm -f $@, "GEN", "$@") + +$(KEYCODEMAP_GEN): .git-submodule-status +$(KEYCODEMAP_CSV): .git-submodule-status + # Don't try to regenerate Makefile or configure # We don't generate any of them Makefile: ; @@ -330,7 +377,7 @@ DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_src DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS) DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt -subdir-dtc:dtc/libfdt dtc/tests +subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,) dtc/%: @@ -371,6 +418,8 @@ qemu-io$(EXESUF): qemu-io.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS) +qemu-keymap$(EXESUF): qemu-keymap.o ui/input-keymap.o $(COMMON_LDADDS) + fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o $(COMMON_LDADDS) fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap @@ -385,6 +434,9 @@ qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool qemu-ga$(EXESUF): LIBS = $(LIBS_QGA) qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated +qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS) +qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS) + gen-out-type = $(subst .,-,$(suffix $@)) qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py |