From 68358ac50635c1404efd8bd465dcc194f8f4c00b Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Sat, 9 Nov 2024 12:27:05 +0100 Subject: [PATCH] Makefile: propagate up the docs prerequisites --- Makefile | 17 +++++++++++------ default.nix | 2 +- doc/Makefile | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index c12af0a..8f48c83 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/default.nix b/default.nix index 56c4d05..25474b0 100644 --- a/default.nix +++ b/default.nix @@ -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; diff --git a/doc/Makefile b/doc/Makefile index e5d8c23..faa9bc2 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -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 '$@'