Makefile: propagate up the docs prerequisites

This commit is contained in:
Michele Guerini Rocco 2024-11-09 12:27:05 +01:00
parent fd175ad0da
commit 68358ac506
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450
3 changed files with 14 additions and 9 deletions

View File

@ -130,18 +130,16 @@ endif
## Targets
##
.PHONY: all clean check install-bin install-doc install docs
# Don't update archives in parallel, it's unsupported
.NOTPARALLEL: $(LIBDIR)/libgray.a
.PHONY: all
all: $(BINARIES) $(LIBRARIES)
# Remove all generated files
.PHONY: clean
clean:
rm -r $(BUILDDIR)
# Run all tests
.PHONY: check
check: $(shell python -Bm tests --list-cases)
# Run a test case
@ -149,11 +147,13 @@ tests.%: $(GRAY)
python -Bm tests '$@' --binary '$(GRAY)' --buffer
# Install libraries, binaries and documentation
.PHONY: install-bin
install-bin: $(BINARIES) $(LIBRARIES)
mkdir -p $(PREFIX)/{bin,lib}
install -m555 -t $(PREFIX)/bin $(BINDIR)/*
install -m555 -t $(PREFIX)/lib $(LIBDIR)/*
.PHONY: install-doc
install-doc: $(SHAREDIR)/doc $(MANPAGES)
mkdir -p $(PREFIX)/share/{doc/res,man/man{1,5}}
install -m644 -t $(PREFIX)/share/doc $(SHAREDIR)/doc/manual.*
@ -161,6 +161,7 @@ install-doc: $(SHAREDIR)/doc $(MANPAGES)
install -m644 -t $(PREFIX)/share/man/man1 $(SHAREDIR)/*.1
install -m644 -t $(PREFIX)/share/man/man5 $(SHAREDIR)/*.5
.PHONY: install
install: install-bin install-doc
# dependencies
@ -182,6 +183,9 @@ $(LIBDIR)/libgray.so: $(MODULES) | $(LIBDIR)
$(LIBDIR)/libgray.a($(MODULES)): | $(LIBDIR)
$(LIBDIR)/libgray.a: $(LIBDIR)/libgray.a($(MODULES))
# Don't update archives in parallel, it's unsupported
.NOTPARALLEL: $(LIBDIR)/libgray.a
# GRAY static library when compiling from JETTO
-include ../include.mk
$(JLIBDIR)/libgray.a: $(LIBDIR)/libgray.a
@ -189,11 +193,12 @@ $(JLIBDIR)/libgray.a: $(LIBDIR)/libgray.a
install -m755 '$<' '$@'
# All documentation
.PHONY: doc
docs: $(SHAREDIR)/doc $(MANPAGES)
.PHONY: $(SHAREDIR)/doc
$(SHAREDIR)/doc: | $(SHAREDIR)
+make -C doc
cp -r doc/build/* $(SHAREDIR)
# Generated man pages
$(SHAREDIR)/gray.1: $(GRAY) doc/man/gray.1 | $(SHAREDIR)

View File

@ -56,7 +56,7 @@ in
# fonts needed for the PDF manual
FONTCONFIG_FILE = pkgs.makeFontsConf {
fontDirectories = with pkgs; [ fira-mono libertinus ];
fontDirectories = with pkgs; [ libertinus julia-mono ];
};
enableParallelBuilding = true;

View File

@ -14,7 +14,7 @@ HTML_FLAGS = --standalone --katex$(KATEX_URL) --lua-filter filters/add-anchors.l
.EXTRA_PREREQS += Makefile
# User manual
DOCDIR = build/doc
DOCDIR = ../build/share/doc
SECTIONS = $(wildcard [0-9].*.md)
MANUALS = $(addprefix $(DOCDIR)/,manual.html manual.pdf res)
@ -33,7 +33,7 @@ $(DOCDIR)/manual.html: $(SECTIONS) res | $(DOCDIR)
pandoc $(FLAGS) $(HTML_FLAGS) $(filter %.md, $^) -o '$@'
$(DOCDIR)/res: res | $(DOCDIR)
cp -r $^ '$@'
cp -Tfr $^ '$@'
$(DOCDIR)/manual.pdf: $(SECTIONS) | $(DOCDIR)
pandoc $(FLAGS) $(PDF_FLAGS) $^ -o '$@'