Skip to content

Commit 7e01782

Browse files
committed
Add Faust library doc index generator
1 parent 2080940 commit 7e01782

3 files changed

Lines changed: 820 additions & 2 deletions

File tree

Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# `make bench` - use faustbench-llvm to benchmark all test specs.
77
# `make build` - build the documentation.
88
# `make serve` - serve the documentation.
9+
# `make doc-index` - build the Faust library documentation JSON index.
10+
# `make doc-index-split` - build a compact index plus one detailed JSON per module.
911

1012
FAUST ?= faust
1113
FAUST_OPT ?= -double -t 0
@@ -17,6 +19,10 @@ SAMPLE_RATE ?= 48000
1719

1820
FLOAT_TOL ?= 1e-4
1921
FLOATDIFF ?= ./scripts/floatdiff.py
22+
PYTHON ?= python3
23+
DOC_INDEX_SCRIPT ?= ./scripts/build_faust_doc_index.py
24+
DOC_INDEX_OUTPUT ?= tests/faust-doc-index.json
25+
DOC_INDEX_SPLIT_DIR ?= tests/faust-doc
2026

2127
ARCH := arch/print_arch.cpp
2228
BUILD_DIR := tests/build
@@ -26,7 +32,7 @@ DSP_TEST_DIR := tests
2632
DSP_FILES := $(shell find $(DSP_TEST_DIR) -maxdepth 1 -name '*.dsp' | sort)
2733
BENCH_LOG := tests/bench.log
2834

29-
.PHONY: reference check clean help bench
35+
.PHONY: reference check clean help bench doc-index doc-index-split
3036

3137
help: ## Show available targets and descriptions
3238
@printf "Usage:\n make \033[36m<target>\033[0m\n\n"
@@ -120,6 +126,16 @@ bench: ## Run faustbench-llvm on all test specs and capture memory/CPU stats
120126
printf '[bench] no results generated\n' >&2; \
121127
fi
122128

129+
doc-index: ## Build the Faust library documentation JSON index
130+
@set -e; \
131+
printf '[doc-index] writing %s\n' '$(DOC_INDEX_OUTPUT)'; \
132+
$(PYTHON) $(DOC_INDEX_SCRIPT) --repo-root . --output $(DOC_INDEX_OUTPUT) --pretty
133+
134+
doc-index-split: ## Build a compact JSON index and one detailed JSON per library module
135+
@set -e; \
136+
printf '[doc-index-split] writing %s and %s\n' '$(DOC_INDEX_OUTPUT)' '$(DOC_INDEX_SPLIT_DIR)'; \
137+
$(PYTHON) $(DOC_INDEX_SCRIPT) --repo-root . --output $(DOC_INDEX_OUTPUT) --split-output-dir $(DOC_INDEX_SPLIT_DIR) --pretty
138+
123139
build: ## Build the documentation
124140
$(MAKE) -C doc build
125141

@@ -130,7 +146,7 @@ pdf: ## Create the PDF documentation
130146
$(MAKE) -C doc pdf
131147

132148
clean: ## Remove build artefacts and generated outputs
133-
rm -rf $(BUILD_DIR) $(REFERENCE_DIR) $(OUTPUT_DIR)
149+
rm -rf $(BUILD_DIR) $(REFERENCE_DIR) $(OUTPUT_DIR) $(DOC_INDEX_OUTPUT) $(DOC_INDEX_SPLIT_DIR)
134150

135151
$(BUILD_DIR) $(REFERENCE_DIR) $(OUTPUT_DIR):
136152
@mkdir -p $@

0 commit comments

Comments
 (0)