From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KPAcB+iV5V4iXgAA0tVLHw (envelope-from ) for ; Sun, 14 Jun 2020 03:13:44 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YGfvAuiV5V6sDwAAB5/wlQ (envelope-from ) for ; Sun, 14 Jun 2020 03:13:44 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A34E4940058 for ; Sun, 14 Jun 2020 03:13:43 +0000 (UTC) Received: from localhost ([::1]:49574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkJ5a-0007Da-Hg for larch@yhetil.org; Sat, 13 Jun 2020 23:13:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkJ5R-0007DQ-Er for guix-devel@gnu.org; Sat, 13 Jun 2020 23:13:33 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:49670) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkJ5O-0006sM-Se; Sat, 13 Jun 2020 23:13:33 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id e44502c3; Sun, 14 Jun 2020 03:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date :in-reply-to:references:mime-version:content-type :content-transfer-encoding:subject:to:from:message-id; s=dkim; bh=n6o7Vl8dHjD3KWdlEBEMAdVBNYgd4V7o1T3p+f0rkFQ=; b=NoeU/Gi827EK 3X5AfUPCvj20s8lA3Xhdvweu3kuqr9ZmmDQ5c+kHfYxr8BRdm/ODBE6uNDGBzwlq XbveUbPK/Adk0UlDIVS7/wxlblMlaRC/BraRdEF2JrTRaBD8JnhpT6nY7BqMWfqR tzYnEOG/6C/eGUK4sytOyGYbgxhCoI7DIU9aNxFt/7XyyyD2I3vnCE6Y4RoG4T4X GUmmTmPn/6LjeuOIaFk30WhFAfWjtw8y9Fy3ZQBjLhtymv3gVtfHqg8xfk4o2S9i pTsCYQUTHrMrZBRjIsk9fOSgYVzOY7Yy2baJUkeTLwAmtTkCU4neYeNDI2VQs94V gebTjS2zAA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 2a96eccd (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sun, 14 Jun 2020 03:13:22 +0000 (UTC) Date: Sat, 13 Jun 2020 23:12:47 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <87lfkqtqui.fsf@gmail.com> References: <87lfkqtqui.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Makefile logic to create Guix documentation To: guix-devel@gnu.org, Chris Marusich , =?ISO-8859-1?Q?Ludovic_Court=E8s?= From: Julien Lepiller Message-ID: Received-SPF: none client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=lepiller.eu header.s=dkim header.b=NoeU/Gi8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: t7lViFl9MFZl Le 13 juin 2020 20:48:21 GMT-04:00, Chris Marusich = a =C3=A9crit : >Hi Ludo, > >I was reading through the Makefile that creates the documentation, and >I >came across some parts I couldn't understand, even though I spent a few >hours trying to figure it out=2E I thought you might know the answers to >my questions off the top of your head, since I think you wrote it=2E > >First, consider this snippet from doc/local=2Emk: > >--8<---------------cut here---------------start------------->8--- ># We cannot add new dependencies to `%D%/guix=2Epdf' & co=2E (info >"(automake) ># Extending")=2E Using the `-local' rules is imperfect, because they may >be ># triggered after the main rule=2E Oh, well=2E >pdf-local: $(DOT_FILES=3D%=2Edot=3D$(top_srcdir)/%=2Epdf) >info-local: $(DOT_FILES=3D%=2Edot=3D$(top_srcdir)/%=2Epng) >ps-local: $(DOT_FILES=3D%=2Edot=3D$(top_srcdir)/%=2Eeps) \ > $(top_srcdir)/%D%/images/coreutils-size-map=2Eeps >dvi-local: ps-local >--8<---------------cut here---------------end--------------->8--- > >What is this syntax called? I checked the Make, Automake, and Autoconf >manuals, but I couldn't find anything=2E I'm talking about this syntax: > > info-local: $(DOT_FILES=3D%=2Edot=3D$(top_srcdir)/%=2Epng) > >It looks like when you added this, you intended to add a *=2Epng >prerequisite to the info-local target for every equivalent *=2Edot file >that exists=2E My guess is you want to ensure that the PNG files are >generated before the info page gets created, since the PNG files are >required in order to build the info page=2E However, is it possible you >meant to write it like the following instead? (The first "=3D" has been >replaced with a ":"=2E) > > info-local: $(DOT_FILES:%=2Edot=3D$(top_srcdir)/%=2Epng) > =20 >When using ":", I recognize this syntax as a "substitution reference" >(see: (make) Substitution Refs)=2E However, I do not know what it is >supposed to be when the ":" is replaced with a "=3D"=2E Is it a typo? > >I experimented by adding a snippet like the following to the generated >Makefile=2E=2E=2E > >--8<---------------cut here---------------start------------->8--- >marucustom: $(DOT_FILES=3D%=2Edot=3D$(top_srcdir)/%=2Eeps) > @echo XXXXX expansion is: _$(DOT_FILES=3D%=2Edot=3D$(top_srcdir)/%=2Eeps= )_ > @echo XXXXX prerequisite: $< > @echo XXXXX target: $@ >--8<---------------cut here---------------end--------------->8--- > >=2E=2E=2Eand it seems to cause make to substitute an empty string: > >--8<---------------cut here---------------start------------->8--- >$ make marucustom >XXXXX expansion is: __ >XXXXX prerequisite: >XXXXX target: marucustom >--8<---------------cut here---------------end--------------->8--- > >Second, I noticed some rules like the following: > >--8<---------------cut here---------------start------------->8--- >=2Edot=2Eeps: > $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@=2Etmp"; \ > mv "$(srcdir)/$@=2Etmp" "$(srcdir)/$@" >--8<---------------cut here---------------end--------------->8--- > >What I do understand is that AM_V_DOT and DOT are set in Makefile=2Eam >and >configure=2Eac, and that they are used to invoke the "dot" program=2E >However, I couldn't quite understand the rest of this rule=2E > >Why are there no prerequisites? It looks like the rule doesn't declare >any prerequisites, so I'm confused about why the recipe includes >references to the name of the first prerequisite ("$<")=2E > >What causes this rule to be run? I tried adding echo commands in the >recipe like so=2E=2E=2E > >--8<---------------cut here---------------start------------->8--- >=2Edot=2Eeps: > @echo YYYYY =2Edot=2Eeps is running > @echo YYYYY target: %@ > @echo YYYYY prerequisite: _$<_ > $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@=2Etmp"; \ > mv "$(srcdir)/$@=2Etmp" "$(srcdir)/$@" >--8<---------------cut here---------------end--------------->8--- > >=2E=2E=2Ebut I didn't see new messages when I ran "make" (from a clean >checkout)=2E Maybe I didn't invoke make correctly=2E > >If you or anyone else could point out if I'm missing something, that'd >be really helpful=2E Thank you in advance! Not sure for the rest, but =2Edot=2Eeps: is similar to: %=2Eeps: %=2Edot You often find =2Ec=2Eo in Makefiles for instance=2E