From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: Re: [PATCH 06/13] build: Generate man pages after compiling guile objects. Date: Thu, 28 Jan 2016 09:59:43 -0600 Message-ID: <7bfbfb841466c6889effbd21d089d616@openmailbox.org> References: <1453666771-16869-1-git-send-email-mthl@gnu.org> <1453666771-16869-7-git-send-email-mthl@gnu.org> <87d1somgfd.fsf@gnu.org> <87zivs2jej.fsf@gnu.org> <20160127203742.52245ef3@openmailbox.org> <87oac5k8sp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOozG-0005uL-IH for guix-devel@gnu.org; Thu, 28 Jan 2016 10:59:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOozC-0002pT-Gy for guix-devel@gnu.org; Thu, 28 Jan 2016 10:59:58 -0500 Received: from smtp5.openmailbox.org ([62.4.1.39]:40574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOozC-0002ov-Bg for guix-devel@gnu.org; Thu, 28 Jan 2016 10:59:54 -0500 In-Reply-To: <87oac5k8sp.fsf@gnu.org> 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+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mathieu Lirzin Cc: guix-devel@gnu.org On 2016-01-28 09:44, Mathieu Lirzin wrote: > Hi Eric, >=20 > Eric Bavier writes: >=20 >> Here's my rough first take at this. It uses the status 77 convention >> to update a sentinel file and selectively run help2man. >>=20 >> I realize the silent rule output isn't yet polished. >=20 > I have pushed the reviewed patches. So now it is polished. :) >=20 >> From 038645a3d14cd10fdb37f94703e463d8f7a3241a Mon Sep 17 00:00:00 2001 >> From: Eric Bavier >> Date: Wed, 27 Jan 2016 20:31:04 -0600 >> Subject: [PATCH] doc: Generate manpages after .go are compiled. >>=20 >> * build-aux/compile-all.scm: Exit 77 if no files to compile. >> * Makefile.am (make-go): Rename target to make-go.stamp. Update if=20 >> any >> files were successfully compiled. >> * doc.am (subcommand-manual-target): Add dependency on make-go.stamp. >> Run help2man only if script input is changed. >> --- >> Makefile.am | 12 +++++++++--- >> build-aux/compile-all.scm | 1 + >> doc.am | 15 ++++++++++++--- >> 3 files changed, 22 insertions(+), 6 deletions(-) >>=20 > [...] >> diff --git a/doc.am b/doc.am >> index f15efcc..b3996d1 100644 >> --- a/doc.am >> +++ b/doc.am >> @@ -106,9 +106,18 @@ doc/guix-daemon.1: nix/nix-daemon/guix-daemon.cc >>=20 >> define subcommand-manual-target >>=20 >> -doc/guix-$(1).1: guix/scripts/$(1).scm >> - -LANGUAGE=3D $(top_builddir)/pre-inst-env \ >> - $(HELP2MAN) --output=3D"$$@" "guix $(1)" >> +# Note: The dependency on make-go.stamp is to force these docs to be=20 >> made only >> +# after all guile modules have been compiled, so that they are not=20 >> compiled >> +# during this rule. But we only want to actually generate the=20 >> manpages if the >> +# corresponding script source has been changed. >> +doc/guix-$(1).1: guix/scripts/$(1).scm make-go.stamp >> + -$(AM_V_at)case '$$?' in \ >> + *$$<*) \ >> + echo " GEN $$@"; \ >> + LANGUAGE=3D $(top_builddir)/pre-inst-env \ >> + $(HELP2MAN) --output=3D"$$@" "guix $(1)" ;; \ >> + *) : ;; \ >> + esac >=20 > IIUC, there is a problem with adding =E2=80=98make-go.stamp=E2=80=99 as= a prerequisite > here. Since building =E2=80=98.go=E2=80=99 files from the tarball will= trigger the > rebuild of man pages. That's what the case statement is for, it skips the invocation of=20 help2man if the script source was not among the dependents updated. A=20 'touch' could be run on $@ in that case, rather than just exiting, so=20 that the rule in not run repeatedly. --=20 `~Eric