unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Olivier Dion via General Guile related discussions <guile-user@gnu.org>
To: Mike Gran <spk121@yahoo.com>, guile-user@gnu.org
Subject: Re: [ANN] (potato make) - makefiles in scheme
Date: Mon, 15 Feb 2021 13:03:38 -0500	[thread overview]
Message-ID: <87mtw5us1x.fsf@clara> (raw)
In-Reply-To: <20210215172651.GA3034884@spikycactus.com>

On Mon, 15 Feb 2021, Mike Gran <spk121@yahoo.com> wrote:
> Hello All-
>
> 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.

Interesting project!  I'm currently working on a small utility that
takes Scheme definition of a C project and generates a Makefile for it.
potato-make could make things easier to emit Makefile text from s-exp
templates.

>
> 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)
>
> There is quite a bit of flexibility here.  You can write your recipes
> in shell, in scheme, or in scheme that returns a string that gets
> passed to the shell.
>
> I'll probably rename the ':' syntax for the sake of SRFI-119 wisp
> compatibility.  Translated to wisp, this really would look like a
> dialect of makefile.
>
> No official tarball yet. I'll do that soonish after I get better
> coverage in the test suite.  I was just a bit proud of this silly
> hack, and wanted to show it off.  Thanks for reading.
>
> Regards,
> Mike Gran
>
-- 
Olivier Dion
PolyMtl



  reply	other threads:[~2021-02-15 18:03 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 [this message]
2021-02-26 17:40   ` Ludovic Courtès
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=87mtw5us1x.fsf@clara \
    --to=guile-user@gnu.org \
    --cc=olivier.dion@polymtl.ca \
    --cc=spk121@yahoo.com \
    /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).