From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id C0FCC1F8C6 for ; Thu, 1 Jul 2021 22:23:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236904AbhGAW0Y (ORCPT ); Thu, 1 Jul 2021 18:26:24 -0400 Received: from cloud.peff.net ([104.130.231.41]:39362 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234270AbhGAW0Y (ORCPT ); Thu, 1 Jul 2021 18:26:24 -0400 Received: (qmail 29142 invoked by uid 109); 1 Jul 2021 22:23:53 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 01 Jul 2021 22:23:53 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 19789 invoked by uid 111); 1 Jul 2021 22:23:54 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 01 Jul 2021 18:23:54 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 1 Jul 2021 18:23:52 -0400 From: Jeff King To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Junio C Hamano , Denton Liu , Felipe Contreras , Kristof Provost , Taylor Blau Subject: Re: [PATCH v2 3/5] Makefile: fix "cscope" target to refer to cscope.out Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Jun 29, 2021 at 01:12:57PM +0200, Ævar Arnfjörð Bjarmason wrote: > diff --git a/Makefile b/Makefile > index faa8900097..2e3b257164 100644 > --- a/Makefile > +++ b/Makefile > @@ -2737,10 +2737,12 @@ tags: FORCE > $(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \ > mv tags+ tags > > +cscope.out: > + $(QUIET_GEN)$(RM) cscope.out && \ > + $(FIND_SOURCE_FILES) | xargs cscope -f$@ -b > + > .PHONY: cscope > -cscope: > - $(QUIET_GEN)$(RM) cscope* && \ > - $(FIND_SOURCE_FILES) | xargs cscope -b > +cscope: cscope.out Doesn't this break subsequent runs after the first generation? With a phony "cscope" target, "make cscope" will always run the command, even if it's not necessary. But with a real "cscope.out" target but not dependencies, it will _never_ run it, even if one of the files changed. E.g., with your patch: $ make cscope.out GEN cscope.out $ make cscope.out make: 'cscope.out' is up to date. $ echo 'void foo(void) { }' >>git.c $ make cscope.out GIT_VERSION = 2.32.0.96.g5daee1b7bb.dirty make: 'cscope.out' is up to date. -Peff