From patchwork Mon Apr 18 23:04:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bandan Das X-Patchwork-Id: 8876041 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A845E9F441 for ; Mon, 18 Apr 2016 23:05:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC615201ED for ; Mon, 18 Apr 2016 23:05:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92B02201FA for ; Mon, 18 Apr 2016 23:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbcDRXE6 (ORCPT ); Mon, 18 Apr 2016 19:04:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33052 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbcDRXE5 (ORCPT ); Mon, 18 Apr 2016 19:04:57 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16B6A81110 for ; Mon, 18 Apr 2016 23:04:57 +0000 (UTC) Received: from gigantic.usersys.redhat.com (dhcp-17-169.bos.redhat.com [10.18.17.169]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3IN4uhH002761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Apr 2016 19:04:56 -0400 From: Bandan Das To: KVM Cc: Paolo Bonzini Subject: [PATCH kvm-unit-tests] cscope: fix database generation Date: Mon, 18 Apr 2016 19:04:55 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The cscope.files that we generate doesn't include all source files that are potentially interesting. We should include all $(ARCH)es and not the just the one configure finds. Moreover, $(ARCH) expands to x86_64 which is not the correct path for x86 sources. Generate cscope.files by searching for all files starting from root. While we are there, remove the unnecessary sed substitution and modify find to include a few other file name extensions. Signed-off-by: Bandan Das --- Makefile | 9 +++------ configure | 2 ++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5d7506e..458d0f0 100644 --- a/Makefile +++ b/Makefile @@ -92,11 +92,8 @@ distclean: clean libfdt_clean $(RM) lib/asm config.mak $(TEST_DIR)-run test.log msr.out cscope.* $(RM) -r tests -cscope: cscope_dirs = lib lib/libfdt lib/linux -cscope: cscope_dirs += lib/$(ARCH)/asm lib/$(TEST_DIR)/asm lib/asm-generic -cscope: cscope_dirs += $(TEST_DIR) lib/$(TEST_DIR) lib/$(ARCH) cscope: - $(RM) ./cscope.* - find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -print | sed 's,^\./,,' | sort -u > ./cscope.files + $(RM) $(SRCDIR)/cscope.* + find -L $(SRCDIR) -maxdepth 3 \ + -regex '.*\.\(c\|h\|cc\|S\|sh\|bash\|s\)$$' -print | sort -u > ./cscope.files cscope -bk diff --git a/configure b/configure index ba6c55b..3153fb9 100755 --- a/configure +++ b/configure @@ -12,6 +12,7 @@ host=$arch cross_prefix= endian="" pretty_print_stacks=yes +srcdir=`pwd` usage() { cat <<-EOF @@ -159,4 +160,5 @@ TEST_DIR=$testdir FIRMWARE=$firmware ENDIAN=$endian PRETTY_PRINT_STACKS=$pretty_print_stacks +SRCDIR=$srcdir EOF