guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 06/13] build: Generate man pages after compiling guile object


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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Bavier <address@hidden> 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= $(top_builddir)/pre-inst-env         \
>>> -     $(HELP2MAN) --output="$$@" "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= $(top_builddir)/pre-inst-env \
>>> +       $(HELP2MAN) --output="$$@" "guix $(1)" ;; \
>>> +     *) : ;; \
>>> +   esac
>>
>> IIUC, there is a problem with adding ‘make-go.stamp’ as a prerequisite
>> here.  Since building ‘.go’ 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 ‘make-go.stamp’ is for Delaying help2man
when building from Git, and the ‘case’ is for rebuilding the man pages
only when the corresponding ‘.scm’ 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]