mirror of
https://github.com/org-roam/org-roam
synced 2025-09-02 14:53:31 -05:00
Jethro wrote the original docs build based on Magit’s docs build. Jonas has updated it in the half-decade since. He deprecated ox-texinfo+ since Org 9.6 includes enough of its features. Org-roam is simpler than Magit and has less available maintainers. Remove some of the unused features inherited from Magit: - remove AUTHORS.md which was not kept updated past the initial implementation - remove epub and pdf targets which were not deployed - remove Elisp-related variables since Org-roam uses Eldev The result is simple enough to consolidate default.mk into doc/Makefile.
95 lines
2.4 KiB
Makefile
95 lines
2.4 KiB
Makefile
-include ../config.mk
|
||
|
||
## User options ######################################################
|
||
#
|
||
# You can override these settings in "config.mk" or on the command
|
||
# line.
|
||
|
||
sharedir ?= $(HOME)/.local/share
|
||
infodir ?= $(sharedir)/info
|
||
|
||
EMACS ?= emacs
|
||
BATCH = $(EMACS) -Q --batch
|
||
|
||
INSTALL_INFO ?= $(shell command -v ginstall-info || printf install-info)
|
||
MAKEINFO ?= makeinfo
|
||
MANUAL_HTML_ARGS ?= --css-ref assets/page.css
|
||
|
||
## Files #############################################################
|
||
|
||
PKG = org-roam
|
||
PACKAGES = org-roam
|
||
|
||
INFOPAGES = $(addsuffix .info,$(PACKAGES))
|
||
HTMLFILES = $(addsuffix .html,$(PACKAGES))
|
||
|
||
## Versions ##########################################################
|
||
|
||
EMACS_VERSION = 26.1
|
||
|
||
EMACSOLD := $(shell $(BATCH) --eval \
|
||
"(and (version< emacs-version \"$(EMACS_VERSION)\") (princ \"true\"))")
|
||
ifeq "$(EMACSOLD)" "true"
|
||
$(error At least version $(EMACS_VERSION) of Emacs is required)
|
||
endif
|
||
|
||
######################################################################
|
||
|
||
.PHONY: default
|
||
default: info
|
||
|
||
## Build #############################################################
|
||
|
||
.PHONY: info
|
||
info: dir
|
||
|
||
dir: $(INFOPAGES)
|
||
@printf "Generating dir\n"
|
||
@echo $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@
|
||
|
||
%.info: %.texi
|
||
@printf "Generating $@\n"
|
||
@$(MAKEINFO) --no-split $< -o $@
|
||
|
||
.PHONY: html
|
||
html: $(HTMLFILES)
|
||
mv $(PKG).html manual.html
|
||
|
||
%.html: %.texi
|
||
@printf "Generating $@\n"
|
||
@$(MAKEINFO) --html --no-split $(MANUAL_HTML_ARGS) $<
|
||
|
||
ORG_EVAL += --eval "(setq indent-tabs-mode nil)"
|
||
ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)"
|
||
ORG_EVAL += --funcall org-texinfo-export-to-texinfo
|
||
|
||
# NOTE: %.org is not a prerequisite since package archives can’t generate texi
|
||
# from org. texi is generated on org save and committed to repo
|
||
%.texi:
|
||
@echo "Generating $@"
|
||
@$(BATCH) $*.org $(ORG_EVAL)
|
||
|
||
## Install ###########################################################
|
||
|
||
.PHONY: install
|
||
install: install-info
|
||
|
||
.PHONY: install-info
|
||
install-info: info
|
||
install -p -m 755 -d $(DESTDIR)$(infodir)
|
||
install -p -m 644 $(INFOPAGES) $(DESTDIR)$(infodir)
|
||
|
||
## Clean #############################################################
|
||
|
||
.PHONY: clean
|
||
clean:
|
||
@echo "Cleaning doc/*..."
|
||
@rm -rf dir $(INFOPAGES) $(HTMLFILES)
|
||
|
||
## Release management ################################################
|
||
|
||
# Run VERSION=N make -C doc release-texi to explicitly set version when releasing
|
||
.PHONY: release-texi
|
||
release-texi:
|
||
VERSION=$(VERSION) $(MAKE) -B $(PKG).texi
|