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" <arne_...@web.de> 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: >> >> https://notabug.org/ZelphirKaltstahl/awesome-guile/pulls/1/files >> all: readme.md readme.texi readme.html >> .INTERMEDIATE: .exported >> readme.md readme.texi readme.html: .exported >> .exported: readme.org >> 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 := $(orgs:.org=.md) $(orgs:.org=.texi) > > .PHONY: all > all: $(objs) > > .ONESHELL: > %.md %.texi: %.org > (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 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? Regards, Zelphir