From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Dion via General Guile related discussions Newsgroups: gmane.lisp.guile.user Subject: Re: [ANN] (potato make) - makefiles in scheme Date: Mon, 15 Feb 2021 13:03:38 -0500 Message-ID: <87mtw5us1x.fsf@clara> References: <20210215172651.GA3034884.ref@spikycactus.com> <20210215172651.GA3034884@spikycactus.com> Reply-To: Olivier Dion Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3862"; mail-complaints-to="usenet@ciao.gmane.io" To: Mike Gran , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Feb 15 19:03:30 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBiDa-0000rH-9W for guile-user@m.gmane-mx.org; Mon, 15 Feb 2021 19:03:30 +0100 Original-Received: from localhost ([::1]:46940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBiDZ-0006wG-CD for guile-user@m.gmane-mx.org; Mon, 15 Feb 2021 13:03:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBiDB-0006u0-59 for guile-user@gnu.org; Mon, 15 Feb 2021 13:03:05 -0500 Original-Received: from smtp.polymtl.ca ([132.207.4.11]:45628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBiD7-00056V-LG for guile-user@gnu.org; Mon, 15 Feb 2021 13:03:04 -0500 Original-Received: from localhost ([89.36.78.200]) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 11FI2ojV031497 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Feb 2021 13:02:54 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 11FI2ojV031497 In-Reply-To: <20210215172651.GA3034884@spikycactus.com> X-Poly-FromMTA: ([89.36.78.200]) at Mon, 15 Feb 2021 18:02:50 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17252 Archived-At: On Mon, 15 Feb 2021, Mike Gran 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