From patchwork Sat Jul 28 19:11:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dunrong huang X-Patchwork-Id: 173883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 196AC2C0092 for ; Sun, 29 Jul 2012 05:11:23 +1000 (EST) Received: from localhost ([::1]:36956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvCQ5-0006ys-2R for incoming@patchwork.ozlabs.org; Sat, 28 Jul 2012 15:11:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvCPy-0006yc-02 for qemu-devel@nongnu.org; Sat, 28 Jul 2012 15:11:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvCPw-0001UX-Kx for qemu-devel@nongnu.org; Sat, 28 Jul 2012 15:11:13 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:56366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvCPw-0001Tv-Bv for qemu-devel@nongnu.org; Sat, 28 Jul 2012 15:11:12 -0400 Received: by pbbro12 with SMTP id ro12so6887601pbb.4 for ; Sat, 28 Jul 2012 12:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=A5HvWBB64k9pLOF1S8D0aTg0YA9uIXu7XIZhzMZZT8M=; b=IKVho0CiyqNKXeB9hH1VCUI7QFkxxvjqlcxAUfzVayGII6/gfaB66ldOkZEV/7UnCt aa3Tqr5MrHjipc5lwuxeiOZ2LTZOKJdhf07/hNTlW/L0p89t8iGHwLTOIMYWNuhAC9AM zIRSyX4friyncEr1IbrXQ//YgO9sQCmt0m+00N1dzkj5xePfienEfuIRDmTHJ6gVqI6U NtUdbyY+dKP9yCPNSimlrpudPVgpEtZOm/nmMXaJjj8YDJNthJLzTYChKjznOf2ddX3x Ja0qOWUjycdOdHLkOxresMEa4RWj268PxcH+JphqK5DqRS4Sm8t6WDu6H20i37jqWp+n pvvg== Received: by 10.68.231.233 with SMTP id tj9mr23405404pbc.39.1343502670650; Sat, 28 Jul 2012 12:11:10 -0700 (PDT) Received: from localhost.localdomain ([221.217.189.221]) by mx.google.com with ESMTPS id pt2sm4417806pbb.58.2012.07.28.12.11.05 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 Jul 2012 12:11:09 -0700 (PDT) From: riegamaths@gmail.com To: qemu-devel Date: Sun, 29 Jul 2012 03:11:24 +0800 Message-Id: <1343502684-10098-1-git-send-email-riegamaths@gmail.com> X-Mailer: git-send-email 1.7.8.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Anthony Liguori , Stefan Hajnoczi , Michael Roth , Dunrong Huang , Luiz Capitulino , Blue Swirl , Paolo Bonzini Subject: [Qemu-devel] [PATCH] build: Fix linking failure for qemu-ga X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Dunrong Huang This patch will fix the following linking failed: LINK qemu-ga gcc: error: qga/../qapi-generated/qga-qapi-types.o: No such file or directory gcc: error: qga/../qapi-generated/qga-qapi-visit.o: No such file or directory gcc: error: qga/../qapi-generated/qga-qmp-marshal.o: No such file or directory make: *** [qemu-ga] Error 1 Commit cdc976b040f2760103ce2fb49f4d504093a7163f changes the dependencies of qemu-ga to depend "../qapi-generated/qga-qapi-types.o", which will be expanded to "qga/../qapi-generated/qga-qapi-types.o" when building qemu-ga. In top-level Makefile, we defined a target "qapi-generated/qga-qapi-types.o" which was not equal to "qga/../qapi-generated/qga-qapi-types" in the Makefile world. So "No such file" error happened when qemu-ga was linking. The easy approach to fix is to change the target name to "qga/../qapi-generated/qga-qapi-types.o", but it is weird. So, in order to solve it more graciously, I move those temporary files(qga-qapi-*.{c,h}) qemu-ga depends on to qemu-ga/qapi-generated, this makes dependencies more clearer. Signed-off-by: Dunrong Huang --- Makefile | 19 +++++++++---------- qga/Makefile.objs | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index a1195ff..621cb86 100644 --- a/Makefile +++ b/Makefile @@ -173,7 +173,7 @@ qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@") qemu-ga$(EXESUF): LIBS = $(LIBS_QGA) -qemu-ga$(EXESUF): QEMU_CFLAGS += -I qapi-generated +qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated gen-out-type = $(subst .,-,$(suffix $@)) @@ -181,15 +181,15 @@ ifneq ($(wildcard config-host.mak),) include $(SRC_PATH)/tests/Makefile endif -qapi-generated/qga-qapi-types.c qapi-generated/qga-qapi-types.h :\ +qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qapi-generated -p "qga-" < $<, " GEN $@") -qapi-generated/qga-qapi-visit.c qapi-generated/qga-qapi-visit.h :\ + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@") +qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\ $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qapi-generated -p "qga-" < $<, " GEN $@") -qapi-generated/qga-qmp-commands.h qapi-generated/qga-qmp-marshal.c :\ + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@") +qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\ $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qapi-generated -p "qga-" < $<, " GEN $@") + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@") qapi-types.c qapi-types.h :\ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py @@ -201,9 +201,7 @@ qmp-commands.h qmp-marshal.c :\ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, " GEN $@") -QGALIB_OBJ=$(addprefix qapi-generated/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o) -QGALIB_GEN=$(addprefix qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) -$(QGALIB_OBJ): $(QGALIB_GEN) +QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(tools-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) @@ -227,6 +225,7 @@ clean: rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp) rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp) rm -rf qapi-generated + rm -rf qga/qapi-generated $(MAKE) -C tests/tcg clean for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \ if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \ diff --git a/qga/Makefile.objs b/qga/Makefile.objs index b54b9b1..cd3e135 100644 --- a/qga/Makefile.objs +++ b/qga/Makefile.objs @@ -1,5 +1,5 @@ qga-obj-y = commands.o guest-agent-command-state.o qga-obj-$(CONFIG_POSIX) += commands-posix.o channel-posix.o qga-obj-$(CONFIG_WIN32) += commands-win32.o channel-win32.o service-win32.o -qga-obj-y += ../qapi-generated/qga-qapi-types.o ../qapi-generated/qga-qapi-visit.o -qga-obj-y += ../qapi-generated/qga-qmp-marshal.o +qga-obj-y += qapi-generated/qga-qapi-types.o qapi-generated/qga-qapi-visit.o +qga-obj-y += qapi-generated/qga-qmp-marshal.o