From patchwork Thu Apr 6 19:07:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 9668155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8ADE9602B8 for ; Thu, 6 Apr 2017 19:09:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E548285C4 for ; Thu, 6 Apr 2017 19:09:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62DEF285D5; Thu, 6 Apr 2017 19:09:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E7552285C4 for ; Thu, 6 Apr 2017 19:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hVMKnw98rRgU0oZAptGIpznTCsQsoUPrNsuUz7CAmfw=; b=HMWQsZ15qP3JfL r/Dhs+FqycERVNR5wgVcL+KSNFn6L3agbSaxVRaZ3Yizbz1bnyrc5OANUUdeBbzeYDyiZ0zOglDYr iZ+4OdUCdWWCRbukN5YeUGd+X+9Eaw1fVwjrlralcEOMCuOcakQPvJA4mFjy/FnuMV7hSR/pGGvkn QWGVxCJtC7Gko8MSSeHKQ7ePNC/IY76TRfOiHy4y/YO2JskfPKkm0dQnmCGQZxYo8PSTvfubcqWED MsXYrfKTXUP006Zvl+aj7mMV9UiThGR/sN0iDEIL5BERLCgwGBdYPKQfK8jCHEUgbhGPhsYtekNax BaTSzf80Z5BqFE8CFaTg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cwCmi-0001Sm-NJ; Thu, 06 Apr 2017 19:09:32 +0000 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cwClF-0007uH-MB for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2017 19:08:05 +0000 Received: by mail-wr0-x235.google.com with SMTP id o21so48651829wrb.2 for ; Thu, 06 Apr 2017 12:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nNrY4KoFOKEt7IMFX1JzMRV1TWpUiD2e9xslN/ZS94A=; b=eJpxeeoRymkvdjl6+sddHWNJR2J7/qcwKiG9V7KjZzR0YMMjdrKVv3sxd2cMyvB8k4 NnRwVTmuKN8CjXunnPjNdb2qJX9d3YEcYClE5dhKLhJYLqGsuAE+UNuRTgdiCP8EVJRF hDY752zNP86+1REpsV/Iy9ZpeTbDdSCPErHiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nNrY4KoFOKEt7IMFX1JzMRV1TWpUiD2e9xslN/ZS94A=; b=Bqy+0hPT3wD/bo4NS+7G8OjM0B6sMRDUjOsD/VpOFReAa2uW1BA+NzFGar6ojlYtxP Uh+GoCnWvgtu9PuNyJTUxY0R2n4WaJ/W0FVEaiFj6b7N2l05Aojxr/FjHONYzos4Jqlj /8ofHXYF291h+bNU5rYm8oP4vsPQBzFn9WzXncwCLEPkeDYFvw5IJjmvD/2XcULtjWrH AHYFo8hkrRVYzEJXhPot5b81dldvvYnfYcwm5pUDklsMV+/NZDUMric7zEToo0UHiWP/ 3rSm/6vFfyLb4S4eCrtN5ByfIHRpvGXuEP2l9ZE8EsB1fLhoKhc+XclI/hhUQuAl4QAD ei0w== X-Gm-Message-State: AFeK/H3ZpOTZfy37iWbIEePgwUPFqtyEwMrLPh4NLtoT1H0NyVFPp6Fc bq8M7Ba9kwAWzxBf X-Received: by 10.28.111.151 with SMTP id c23mr25286017wmi.17.1491505659810; Thu, 06 Apr 2017 12:07:39 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h68sm850665wmd.19.2017.04.06.12.07.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Apr 2017 12:07:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A8C6C3E0CD9; Thu, 6 Apr 2017 20:07:37 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: drjones@redhat.com, pbonzini@redhat.com Subject: [RFC kvm-unit-tests PATCH 6/8] Makefiles: handle linking of scripts into build-tree Date: Thu, 6 Apr 2017 20:07:25 +0100 Message-Id: <20170406190727.5624-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170406190727.5624-1-alex.bennee@linaro.org> References: <20170406190727.5624-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170406_120802_077142_8C878283 X-CRM114-Status: GOOD ( 10.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When doing an out-of-src-tree build we still want access to the various bits of common script machinery to run. This is handled by the scripts-common list which sub-builds can add explicit extra stuff to. The final rule is conditional so we don't attempt to link files when we are doing an in-src-tree build. Signed-off-by: Alex Bennée --- Makefile | 13 +++++++++++++ x86/Makefile.common | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/Makefile b/Makefile index 56598df..c9fea88 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,10 @@ cflatobjs := \ lib/report.o \ lib/stack.o +# These are scripts we want linked from the source tree +scripts-common := run_tests.sh \ + scripts + # libfdt paths LIBFDT_objdir = $(SRCDIR)/lib/libfdt LIBFDT_srcdir = $(SRCDIR)/lib/libfdt @@ -86,8 +90,17 @@ $(LIBFDT_archive): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS)) mkdir -p $(dir $@) $(CC) $(CFLAGS) -c -o $@ $< +$(scripts-common): $(SRCDIR)/$@ + ln -sf $<$@ $@ + -include */.*.d */*/.*.d + +# We only need to link common scripts for out-of-src-tree builds +ifneq ($(CURDIR), $(SRCDIR)) +all: $(scripts-common) +endif + all: $(shell git -C $(SRCDIR) rev-parse --verify --short=8 HEAD >build-head 2>/dev/null) standalone: all diff --git a/x86/Makefile.common b/x86/Makefile.common index fbab82c..ef6e543 100644 --- a/x86/Makefile.common +++ b/x86/Makefile.common @@ -54,8 +54,12 @@ tests-common += api/dirty-log tests-common += api/dirty-log-perf endif +scripts-common += $(TEST_DIR)/run +scripts-common += $(TEST_DIR)/unittests.cfg + test_cases: $(tests-common) $(tests) + $(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I lib -I lib/x86 $(TEST_DIR)/realmode.elf: $(TEST_DIR)/realmode.o