#!/bin/sh

set -eu

cd '@TOP_SOURCE_DIR@'

# api-files.txt
find src/share/api -type f -name '[a-z]*.json' | sort -V > "@srcdir@/api-files.txt"

# mes-files.txt
find . -type f -name '*.mes' | sort -V | sed 's#^./##g' > "@srcdir@/mes-files.txt"

# debug-messages.rst
@PYTHON@ ./tools/check-messages.py --generate-debug-messages-page

# kea-messages.rst
cd '@srcdir@'
@PYTHON@ ./mes2doc.py -o kea-messages.rst
