[Top][All Lists]

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

Re: Starting a GNU Guile awesome list

From: Zelphir Kaltstahl
Subject: Re: Starting a GNU Guile awesome list
Date: Sat, 10 Oct 2020 14:31:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hello Dmitry!

I know this is kind of a late reply. I hope you do not mind me
unearthing this. : )

On 7/16/20 10:47 AM, Dmitry Alexandrov wrote:
> "Dr. Arne Babenhauserheide" <> wrote:
>>>> In the case you will stick with Org, there at least should be a runnable 
>>>> build recipe (i. e. a Makefile).
>> I’d like to cut this discussion short:
>>      all: readme.texi readme.html
>>      .INTERMEDIATE: .exported
>> readme.texi readme.html: .exported
>>      .exported:
>>              HOME=$$(dirname $$(realpath "$<")) emacs -Q --batch "$<" --exec 
>> "(require 'ox-md)" -f org-md-export-to-markdown -f org-html-export-to-html 
>> -f org-texinfo-export-to-texinfo -f kill-emacs
> Alternatively, without reliance on implicit behaviour (setting HOME in order 
> to get an expected filename??):
>       #!/usr/bin/make -f
>       SHELL := emacs
>       .SHELLFLAGS := --quick --batch --eval
>       orgs := $(wildcard *.org)
>       objs := $( $(
>       .PHONY: all
>       all: $(objs)
>       .ONESHELL:
> %.texi:
>               (with-temp-buffer
>                 (require 'ox-md)
>                 (require 'ox-texinfo)
>                 (when (insert-file-contents "$<")
>                   (org-mode)
>                   (org-export-to-file 'md "$*.md")
>                   (org-export-to-file 'texinfo "$*.texi")))

I'm not that proficient at GNU Make yet. I would like to add a way to
cleanup created md and texi files, so that, when I run `make` again, it
creates all files anew.

So I thought I could simply add a `make clean` as follows:

.PHONY: clean
        /bin/rm --verbose *.html *.md *.texi || true;

But then I would hardcode the location of `rm` and also it does not work:

/bin/rm --verbose *.html *.md *.texi || true;
Symbol’s value as variable is void: /bin/rm
make: *** [Makefile:17: clean] Error 255

I think this is, because we have `#!/usr/bin/make -f` at the top, so it
does not know what `/bin/rm/` is. How would you write the makefile to
either add a `make clean` step, or alternatively modify it so that
running `make` will always create the other formats anew?


reply via email to

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