From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Lirzin Subject: Re: [PATCH 06/13] build: Generate man pages after compiling guile objects. Date: Thu, 28 Jan 2016 18:00:35 +0100 Message-ID: <87k2mtk5ak.fsf@gnu.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> <7bfbfb841466c6889effbd21d089d616@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOpw8-0003jr-3a for guix-devel@gnu.org; Thu, 28 Jan 2016 12:00:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOpw5-00057P-6Q for guix-devel@gnu.org; Thu, 28 Jan 2016 12:00:46 -0500 In-Reply-To: <7bfbfb841466c6889effbd21d089d616@openmailbox.org> (Eric Bavier's message of "Thu, 28 Jan 2016 09:59:43 -0600") 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: Eric Bavier Cc: guix-devel@gnu.org Eric Bavier writes: >>> 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 >>> >>> define subcommand-manual-target >>> >>> -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 made only >>> +# after all guile modules have been compiled, so that they are not >>> compiled >>> +# during this rule. But we only want to actually generate the >>> 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 >> >> 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 > help2man if the script source was not among the dependents updated. A > 'touch' could be run on $@ in that case, rather than just exiting, so > that the rule in not run repeatedly. Oh, I overlooked that. So the =E2=80=98make-go.stamp=E2=80=99 is for Delay= ing help2man when building from Git, and the =E2=80=98case=E2=80=99 is for rebuilding th= e man pages only when the corresponding =E2=80=98.scm=E2=80=99 script file has changed.= That's smart and seems to fix the problem perfectly. OTOH I must admit that for maintainability reasons I would prefer avoiding complexity in Makefiles as much as possible. This means using Automake's abstract concepts as much as possible, having a simple dependency graph on top of that, and put things that don't fit well in this scheme in individual "build-aux/" scripts. For that reason I still prefer the embed help2man solution. but otherwise it looks nice. :) Thanks. -- Mathieu Lirzin