# This file is in the public domain
#
# Hand-written makefile: this used to be a Makefile.am processed by automake,
# but the build was migrated to Meson.  It is invoked by
# scripts/doxygen.meson.sh (the 'doxygen' run_target), and can also be run
# directly from this directory.
#
# PROJECT_NUMBER is appended to the config so the version does not have to be
# kept up to date by hand in anastasis.doxy.

DOXYFILE = anastasis.doxy
# get_version.sh looks for ./.version and ./.git, so it must run from the
# top of the source tree.
PACKAGE_VERSION ?= $(shell cd ../.. && ./scripts/get_version.sh)

.PHONY: all full fast clean help

all: full

help:
	@echo "Generate documentation:"
	@echo "  make full  - full documentation with dependency graphs (slow)"
	@echo "  make fast  - fast mode without dependency graphs"

full: $(DOXYFILE)
	{ cat $(DOXYFILE); echo "PROJECT_NUMBER = $(PACKAGE_VERSION)"; } | doxygen -

fast: $(DOXYFILE)
	{ sed 's/\(HAVE_DOT.*=\).*/\1 NO/' $(DOXYFILE); \
	  echo "PROJECT_NUMBER = $(PACKAGE_VERSION)"; } | doxygen -

clean:
	rm -rf html version.doxy
