unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guile-user@gnu.org
Subject: Re: [ANN] (potato make) - makefiles in scheme
Date: Fri, 26 Feb 2021 18:40:05 +0100	[thread overview]
Message-ID: <87tupywwwa.fsf@gnu.org> (raw)
In-Reply-To: 20210215172651.GA3034884@spikycactus.com

Hi Mike,

Mike Gran <spk121@yahoo.com> skribis:

> I wrote a pure scheme Guile library (potato make) that lets one write
> makefiles in scheme.  The code lives at
> https://github.com/spk121/potato-make.
>
> If you are familiar with the cryptic makefile syntax, and with scheme
> syntax, you may be able to decipher this makefile written in potato
> make.  Here ':=' is variable assignment, ':' is a target rule and '->'
> is a suffix rule.  The '~' syntax is a lazy concatenation operator
> that passes its output as a string to the system() procedure.
>
>   #!/usr/bin/env sh
>   exec guile -s "$0" "$@"
>   !#
>
>   (use-modules (potato make))
>   (initialize)
>
>   (:= CC "gcc")
>   (:= CFLAGS "-g -O2")
>
>   (: "all" '("foo"))
>   (: "foo" '("foo.o" "bar.o")
>     (~ ($ CC) "-o" $@ $^))
>   (-> ".c" ".o"
>     (~ ($ CC) "-c" $<))
>
>   (execute)

Nice!

As you may know, Guix is reducing its “binary seeds” (pre-built binaries
used to bootstrap the whole distribution) so that everything can be
built from source.

Part of the strategy revolves around doing more things in Scheme on top
of Guile or Mes, and that’s why people wrote Gash (POSIX shell + core
utilities).  With a makefile parser, (potato make) could be a useful
addition!

Also, we could imagine adding a Guix backend to (potato make), such that
each target is built as a Guix “derivation”.

Food for thought…

Ludo’.




  parent reply	other threads:[~2021-02-26 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210215172651.GA3034884.ref@spikycactus.com>
2021-02-15 17:26 ` [ANN] (potato make) - makefiles in scheme Mike Gran
2021-02-15 18:03   ` Olivier Dion via General Guile related discussions
2021-02-26 17:40   ` Ludovic Courtès [this message]
2021-04-02 15:44   ` Xinglu Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tupywwwa.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).