modules := $(wildcard ../plugins/modules/*.py) module_docs := $(modules:../plugins/modules/%.py=source/modules/%.rst) doc_fragments := $(wildcard ../plugins/doc_fragments/*.py) template := templates/module.rst.j2 export ANSIBLE_COLLECTIONS_PATHS ?= $(realpath $(CURDIR)/../../../..) .PHONY: all docs: $(module_docs) $(MAKE) html .PHONY: clean clean: rm -rf build source/modules source/modules/%.rst: ../plugins/modules/%.py $(doc_fragments) $(template) mkdir -p source/modules ansible-doc-extractor --template $(template) source/modules $<