Re: [dev] requirements of build systems

From: Petros Pateros <>
Date: Mon, 31 Jan 2022 22:52:36 +0200

On Mon, Jan 31, 2022 at 09:34:52AM -0500, LM wrote:
Dear Laura,

> This looks like a very interesting project. I've been looking for some
> alternatives to GNU make.

I hope you find something to fit your needs.

> I do use a few GNU make features that I'm not sure about porting to other
> alternatives. I use wildcards a lot for specifying files. I use the
> substitute features. I also use static pattern rules a lot:
> Was
> wondering if redo has functionality to replace those features. How hard
> would it be to target .po files and generate .mo files with the proper
> naming conventions using redo? So, en.po generates
> en/LC_MESSAGES/ I currently use GNU make and wildcards to
> figure out what .po files there are and generate the .mo files placed in
> applicably named directories.

By default, /bin/sh is called to interpret the .do files, like
/bin/sh -e /path/to/ args.., unless they are executables, in which
case they are just executed. So expanding a wildcard is trivial. (contents of
        redo listofmo # always (re)generate it
        redo-ifchange $(cat listofmo) # IFS is relevant here
        # create/update the list of .mo's
        # stdout is captured and will atomically (re)place listofmo,
        # unless an error occurs

        ls *.po |
                while read -r po
                        printf '%s\n' "${po%.po}/LC_MESSAGES/"
        # $1: the name of the file this .do file is called to produce,
              as a path relative to $0 ($0 is /path/to/
        # $2: $1 but without the .mo suffix
        # $3: see below

        redo-ifchange "$po" # declare that $1 depends on $po

        # now generate .mo from .po, either by creating $3 or by writing
        # to stdout. Doing both is or affecting $1 directly is an error.
        #po2mo "$po" > "$3"
        #po2mo "$po" -o "$3"
        #po2mo "$po" # if po2mo writes to stdout

With the above, running
        $ redo all
will generate listofmo and the */LC_MESSAGES/ files
from the *.po files.

With this approach, however, listofmo is generated every time so that they are
up to date (in case of adding/removing a .po file).

Some redo implementations, like goredo [0], also store a hash of the created
file so nothing that depends on them gets rebuild when its content hasn't changed.

> Any pointers to documentation on how to use
> redo in a project in place of GNU make?

You can find a lot in:

I also plan to write manual pages for baredo.


Received on Mon Jan 31 2022 - 21:52:36 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 01 2022 - 11:36:07 CET