Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros for documentation #2216

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Makefile for rst files
  • Loading branch information
albinahlback committed Jan 29, 2025
commit dd4ef7990f2f2f7f1a39af775316fc89e69192a8
20 changes: 15 additions & 5 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ SPHINXPROJ = flint
SOURCEDIR = source
BUILDDIR = build

M4 := m4

SRCS := $(wildcard $(SOURCEDIR)/*.rst.pp)
OBJS := $(patsubst %.pp,%,$(SRCS))

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile
preprocess: $(OBJS)

%.rst: %.rst.pp
@$(M4) -I $(SOURCEDIR) $< > $@

.PHONY: help Makefile preprocess

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# # Catch-all target: route all unknown targets to Sphinx using the new
# # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
# %: Makefile preprocess
# @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)