aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormartianh <martianh@noreply.codeberg.org>2023-03-20 17:17:38 +0000
committermartianh <martianh@noreply.codeberg.org>2023-03-20 17:17:38 +0000
commitbc5a77a34bae248a6fe73d362e361700a4edc581 (patch)
treee724f38e66874acaead85bb080b6f3ccf7bfec84 /Makefile
parent8af34c2983073f1effa2623bfa20fae35ea78129 (diff)
parent781a0f97e318e6d0e2e0c9a5bf355b268a696348 (diff)
Merge pull request 'info update for Issue #399' (#400) from DavidMasterson/mastodon.el:info into develop
Reviewed-on: https://codeberg.org/martianh/mastodon.el/pulls/400
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d41aa35
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+PKG = mastodon
+
+CP = cp
+LN = ln
+
+EMACS = emacs
+MAKEINFO = makeinfo
+INSTALL-INFO = install-info
+ORG_DIR = $(word 1,$(wildcard $(HOME)/.emacs.d/elpa/org-9*))
+ORG_PATH = -L $(ORG_DIR)
+ORG_ARGS = --batch $(ORG_PATH) -l org -l ol-man
+ORG_EVAL1 = --funcall org-texinfo-export-to-texinfo
+ORG_EVAL2 = --funcall org-texinfo-export-to-info
+
+## ################################################################
+
+.PHONY: clean
+
+all: $(PKG).info dir
+
+clean:
+ rm -f $(PKG).org $(PKG).texi $(PKG).info dir
+
+## ################################################################
+
+# May look at this in the future
+#
+# %.info: %.texi
+# @printf "Generating $@\n"
+# $(MAKEINFO) --no-split $< -o $@
+#
+# %.texi: %.org
+# @printf "Generating $@\n"
+# $(EMACS) $(ORG_ARGS) $@ $(ORG_EVAL1)
+
+%.info: %.org
+ @printf "Generating $@\n"
+ $(EMACS) $(ORG_ARGS) $< $(ORG_EVAL2)
+
+dir: $(PKG).info
+ printf "Generating $@\n"
+ echo $^ | xargs -n 1 $(INSTALL-INFO) --dir=$@
+
+$(PKG).org: README.org
+ $(CP) $< $@