# Builds the top-level broctl.rst from its parts.
#
# Note: It's not great to build this here and commit to the repository
# (as opposed to in build/). However, otherwise it would get hard
# to put the final document online www.bro-ids.org.

all: generate-docs

generate-docs:
	@python ../BroControl/options.py >options.rst
	@python ../BroControl/doc.py >plugins.rst
	@python ../bin/broctl.in --print-doc >commands.rst

	( echo ".. Autogenerated. Do not edit."; echo; cat main.rst ) | awk -f include.awk >broctl.rst
	chmod -w broctl.rst

	make clean

clean:
	rm -f options.rst plugins.rst commands.rst
