MESSAGE
DATE | 2021-01-25 |
FROM | Nick Bowler
|
SUBJECT | Re: [Hangout - NYLXS] Future plans for Autotools
|
From hangout-bounces-at-nylxs.com Mon Jan 25 17:31:03 2021 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www2.mrbrklyn.com (www2.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id 044D916400D; Mon, 25 Jan 2021 17:31:03 -0500 (EST) X-Original-To: hangout-at-www2.mrbrklyn.com Delivered-To: hangout-at-www2.mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 1000) id 5BF74164041; Mon, 25 Jan 2021 17:30:26 -0500 (EST) Resent-From: Ruben Safir Resent-Date: Mon, 25 Jan 2021 17:30:26 -0500 Resent-Message-ID: <20210125223026.GF7019-at-www2.mrbrklyn.com> Resent-To: hangout-at-mrbrklyn.com X-Original-To: ruben-at-mrbrklyn.com Delivered-To: ruben-at-mrbrklyn.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mrbrklyn.com (Postfix) with ESMTP id 7A278163FEE for ; Mon, 25 Jan 2021 14:27:07 -0500 (EST) Received: from localhost ([::1]:45258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l47Vy-0006A9-EQ for ruben-at-mrbrklyn.com; Mon, 25 Jan 2021 14:27:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l47HV-0006o3-Me for autoconf-at-gnu.org; Mon, 25 Jan 2021 14:12:10 -0500 Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]:33221) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l47HR-0008A2-Tu for autoconf-at-gnu.org; Mon, 25 Jan 2021 14:12:08 -0500 Received: by mail-yb1-xb29.google.com with SMTP id i141so14411637yba.0 for ; Mon, 25 Jan 2021 11:12:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=draconx-ca.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=A6K8kDTj4YeS2ylDM9pPCgCE2wF0dv6XeeE0YmjZLWc=; b=0L4aHSrnd3k6p0vTn5LDDU0dimuRZ17ZAYBRItaMiffCaaYd2FsIUeXT6vB/EJKYZP zaR6fqUtSdENi33kBxfwclusd0RYcOpsCeB7l+jixzIlL3ZcRllHe/ltDPHZlE5YZ0x4 i9YMuVlvUhoaXAqnoJiY0hLhlSyj6l47IY613HKBsumuifvqkVKPBWMISyspseR2zy/2 ut41WVxcA8Mq3UdfZwd4EUV/S/yYRu7FFyxRAV73Ip1I+B81+9rfWzR0qRgyQTQq0ekg /ckZ69Oltk88Nj1bokY9f6+ptZnC+sQ2jQyHOIktBxlJAK8mSO3FlbJuGuWF/1XlirRD ADxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=A6K8kDTj4YeS2ylDM9pPCgCE2wF0dv6XeeE0YmjZLWc=; b=ALM8zSb82t5htgT6CuCyO766Apz9ilNHgLDSnHMdiQ7qmlelZW5plBhy19vXqCCTOd SaWsQ8uYDIs9eOBWEyL9dbugBY5/Xcm6Dfny73gPrMdWKyApR97U0i2CqheECdJf2SLH XYmOjLvW/PlWTdmDE9r16KBJk2lzl00gIgDqSvoaJj1j8qhW3oQNPeDKwJekkaKMgFQm LNWDZRMZJo1zNwrqk48WtIj+XSZBzGWXvKV/c7d5LhgrrOP+4PgpbZ27EKJQitqrjseH WVfsC6oOnI+tkaWXCt2Njj9Yr3af59Gu87u81n1EkC5nxOfnPhZinCcAiCkpMNlLiD6p Gc4w== X-Gm-Message-State: AOAM530cp1XJOBuzeiNvWpaZV8R9Xy0w3SVmbQPN5OUo8N1s96ZM2m5b 8cxeXji5j0JcjznmYnXw7jzLEBvbQo+Q3lwF0fWN0sHgbOH3yRHy X-Google-Smtp-Source: ABdhPJwO55GIPKBff2G+D9JCqbsPzi8flOzRDd8kHAayyxGG2vrxN9pCm3bFMwXRm6t4MOo6fKmTPQi0lFWlrmPQrRw= X-Received: by 2002:a25:23d5:: with SMTP id j204mr2730476ybj.509.1611601924821; Mon, 25 Jan 2021 11:12:04 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:b912:0:0:0:0:0 with HTTP; Mon, 25 Jan 2021 11:12:03 -0800 (PST) X-Originating-IP: [24.53.240.163] In-Reply-To: References: <87zh12osjk.fsf-at-tromey.com> <87eei97w7a.fsf-at-tromey.com> <25f02fe5254319a29cde8215893450fc0e0850f7.camel-at-gnu.org> From: Nick Bowler Date: Mon, 25 Jan 2021 14:12:03 -0500 Message-ID: To: Zack Weinberg Received-SPF: none client-ip=2607:f8b0:4864:20::b29; envelope-from=nbowler-at-draconx.ca; helo=mail-yb1-xb29.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: autoconf-at-gnu.org X-Mailman-Version: 2.1.23 Precedence: list Cc: Autoconf Subject: Re: [Hangout - NYLXS] Future plans for Autotools X-BeenThere: hangout-at-nylxs.com List-Id: NYLXS Tech Talk and Politics List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: hangout-bounces-at-nylxs.com Sender: "Hangout"
On 2021-01-25, Zack Weinberg wrote: > I'm not at all familiar with Automake's internals, but the reason I > suggested taking advantage of GNU make extensions was the potential > for _complexity_ reduction of the generated Makefile, not performance. > For instance, this generated rule from one of my other projects [...]
To be honest if Automake-generated Makefile.in files only worked for users with, say, sufficiently modern versions of GNU Make, I'm not sure there would be any point in using Automake.
GNU make is expressive enough to implement pretty much every useful feature of Automake directly as makefile rules. So for sure, it might be useful to have an includable snippet or something that makes it easier to correctly implement the various targets specified by the GNU Coding Standards, and it might be useful to keep things like the "compile" and "install-sh" scripts presently bundled with Automake, but I think the result would no longer really be Automake.
The whole reason I use Automake is because implementing conceptually simple things like per-target CFLAGS is a pain in the butt without make features such as target-specific variables. Automatic dependency generation is a pain without "-include". Maintaining separate lists of object and source files is a pain. Suffix rules are limited in their expressiveness.
All of that pain goes away if a package can depend on GNU make. Why would anyone bother with Automake then? In most cases it'd be easier, simpler and more flexible to just write compilation rules by hand, and I think the more involved cases would be better handled by copy+paste boilerplate examples or includable snippets than with a discrete build tool like Automake.
When I can assume every user is going to be using GNU make (unreleased stuff mostly), I never bother with Automake. As GNU Emacs was mentioned as a package requiring GNU make, I notice that they do not appear to use Automake either.
> Automake _does_ make heavy use of shell constructs embedded inside > frequently-executed rules, for instance > > .c.o: > $(AM_V_CC)depbase=`echo $-at- | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ > $(COMPILE) -MT $-at- -MD -MP -MF $$depbase.Tpo -c -o $-at- $< &&\ > $(am__mv) $$depbase.Tpo $$depbase.Po > > which looks like it could become > > %.o: %.c > $(AM_V_CC)$(COMPILE) -MT $-at- -MD -MP -MF $(-at-D)/$(DEPDIR)/$(*F).Tpo \ > -c -o $-at- $< > $(AM_V_at)$(am__mv) $(-at-D)/$(DEPDIR)/$(*F).Tpo $(-at-D)/$(DEPDIR)/$(*F).Po > > and enable Make to bypass the shell altogether. Might be worth > benchmarking on a big program. Has to be an executable, not a > library, though; for libraries, the overhead of the libtool script is > going to dominate.
I would like to mention that, if a change like this is a perfomance win, it is almost certainly possible to get the performance benefit without sacrificing correct operation on other makes.
In particular, the $(-at-D), $(-at-F), and $(*F) variables are specified by POSIX and are widely portable. The only portability problem I am aware of is this one related to the D-suffixed variables, involving a rather obscure make implementation, and is often not a significant problem in practice (for example, writing ./$(-at-D) instead is typically sufficient to avoid problems due to this issue).
% : >baz.c % cat >Makefile <<'EOF' foo.o: foo/bar.c baz.o -at-echo target=$-at- directory=$(-at-D) file=$(-at-F) foo/bar.c: -at-echo target=$-at- directory=$(-at-D) file=$(-at-F) .c.o: -at-echo stem=$* directory=$(*D) file=$(*F) EOF % gmake --version GNU Make 4.3 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2020 Free Software Foundation, Inc. [...]
% gmake target=foo/bar.c directory=foo file=bar.c stem=baz directory=. file=baz target=foo.o directory=. file=foo.o
% dmake -V dmake - Version 4.12 (x86_64-pc-linux-gnu) Copyright (c) 1990,...,1997 by WTI Corp.
% dmake target=foo/bar.c directory=foo/ file=bar.c stem=baz directory= file=baz target=foo.o directory= file=foo.o
Cheers, Nick _______________________________________________ Hangout mailing list Hangout-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/hangout
|
|