From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81DCAC433EF for ; Fri, 8 Apr 2022 15:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232438AbiDHP51 (ORCPT ); Fri, 8 Apr 2022 11:57:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237290AbiDHP50 (ORCPT ); Fri, 8 Apr 2022 11:57:26 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD7521B2 for ; Fri, 8 Apr 2022 08:55:22 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id k2so10523979edj.9 for ; Fri, 08 Apr 2022 08:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=Tdb/CocaM5f4x61uY9ItFBS9LHHOzJCfonCHodX44uk=; b=cO2WXnNZgXCk7JgR4pC8DrLX89tSxNfZgPyYZ/7slshcHGqYpexdTiAnlaRY+S70b4 ezxM3KjvdWl2GIQHYcKvNUoaU+GIAYhblVU4VSh2ovwCMOSTQ0I0EY1XNv1lGfs7xu6x NWpn3DIIqykS7Lfq4e0s1DOsgcyjPdrS2W2k1ap5RYE54GF268VzPaP4k1v8/vzZKY4z ESeOylI2m0sdHFTS9XKRREHHv9IR0M87qkvCTwXB0VyMTFPXHo5G4gK/SYt546b7toTB TSa150Vg/+IHM8v96dED/gTCj7pR0FqYBo9BMffX2l+CKKdnZ0D2WW7xgOtuFJK+YgHG 4PTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version; bh=Tdb/CocaM5f4x61uY9ItFBS9LHHOzJCfonCHodX44uk=; b=R4MsZyWF/0yVs8v7/vFHaIz6keafvS81uDnNArBH/cCf6sVv8vquLUzQCMTdT06LNc jGCF6yOHlVpUMOIjazRWyvuIZKkZxVsu2L27bkBMwuX/Ue1F1163rBOf+txDwPb100uV /NObN9TEZK1YFAh/5f7WgGA/6oGX/LQsHcu1xpaKKeZh52ZRgnPY1+DAZtl4E/XyEedK nzWbhUOrS97rnf15pc9t6LpzPvCbVO++3pnmzf27LOwPOb8tWtOuVDPDbMTRQcD2BzDL 2CqP+IQIUCFWUvN9+fnZAYP/YyilOQFoCKHMKX8x4sQzUoDluUdCDRsJ4bi+dm32vjr9 CTWA== X-Gm-Message-State: AOAM533gqpJtkqrrFxUjadloAL32SqRf9Gmykr/1KIMwES7suLbvlJ5L ugLVAuG8meXvKorOYw6ouec= X-Google-Smtp-Source: ABdhPJwfS5AHDEjL0ORoqLVerlDJ+4iW3o8BEBOHvBpq1/31B1bnVV6T7ElbwxOFXeyTy54pLW/1lg== X-Received: by 2002:a05:6402:26c7:b0:41b:7aef:bdf6 with SMTP id x7-20020a05640226c700b0041b7aefbdf6mr20392283edd.210.1649433320507; Fri, 08 Apr 2022 08:55:20 -0700 (PDT) Received: from gmgdl (j120189.upc-j.chello.nl. [24.132.120.189]) by smtp.gmail.com with ESMTPSA id w14-20020a509d8e000000b0041cd217726dsm7027239ede.4.2022.04.08.08.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 08:55:20 -0700 (PDT) Received: from avar by gmgdl with local (Exim 4.95) (envelope-from ) id 1ncqxD-001Phv-Hv; Fri, 08 Apr 2022 17:55:19 +0200 From: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason To: Taylor Blau Cc: Elia Pinto , git@vger.kernel.org Subject: Re: [PATCH] Makefile: add help target Date: Fri, 08 Apr 2022 17:44:44 +0200 References: <20220408074524.156165-1-gitter.spiros@gmail.com> User-agent: Debian GNU/Linux bookworm/sid; Emacs 27.1; mu4e 1.7.12 In-reply-to: Message-ID: <220408.86a6cvbme0.gmgdl@evledraar.gmail.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Apr 08 2022, Taylor Blau wrote: > On Fri, Apr 08, 2022 at 07:45:24AM +0000, Elia Pinto wrote: >> Add a help target to the Makefile to be able to run make help, in the same way >> does the Makefiles self-generated by some build systems. >> >> The target list has been statically extracted from the git Makefile with a >> script and the results have been filtered in an essentially arbitrary way to >> leave the ones that i imagines most interesting and frequent for a developer. > > I could definitely see something like "make help" being helpful, since > make itself doesn't have a convenient way to list all of a Makefile's > targets. > > I worry about this list getting stale, though. If we add a new target, > will we remember to update the "help" list here? It would be nice if we > could dynamically generate this list, but I think that loses out on the > filtering you've done here. There's some nice suggestions at: https://stackoverflow.com/questions/4219255/how-do-you-get-the-list-of-targets-in-a-makefile I managed to get pretty close to this by massaging the various parsers that were suggested there. But I wonder if defining help as we go along wouldn't be the best and least likely to break, and most likely to be kept up-to-date. I.e. some variant of the comments added there. Or better (maybe it's discussed in that SO thing, I didn't skim it all), something like: HELP_all = the default target all:: [...] We could then even print a heading showing what target(s) we're running by looking at MAKECMDGOALS. Also, Elia's ad-hoc script here copied from StackOverflow looks awfully similar to what I have in /usr/share/bash-completion/completions/make installed with my OS. Available here: https://github.com/scop/bash-completion/blob/master/completions/make So maybe we could just make this an optional target that depended on that widely-available bash completion? That would also have the nice benefit that to the extent that the output sucked we could maybe massage our Makefile a bit to make it better, and then we'd not only benefit "make help" users, but anyone doing "make ".