blob: 3e6a55b94fcfefa37c574c76f16f90c9ec987da3 [file] [log] [blame]
#!/bin/sh
set -e
# generate list of source files for use in Makefile.am
# if you add new source files, you must run ./bootstrap again
src_listvar () {
basedir=$1
suffix=$2
var=$3
find "${basedir}" -name "${suffix}" | LC_ALL=C sort | tr '\n' ' ' | (echo -n "${var} = " && cat)
echo ""
}
VARS_FILE=src_vars.mk
AUTORECONF=${AUTORECONF:-autoreconf}
echo "Generating file lists: ${VARS_FILE}"
(
src_listvar "sysapi/sysapi" "*.c" "SYSAPI_C"
src_listvar "sysapi/include" "*.h" "SYSAPI_H"
src_listvar "sysapi/sysapi_util" "*.c" "SYSAPIUTIL_C"
printf "SYSAPI_SRC = \$(SYSAPI_H) \$(SYSAPI_C) \$(SYSAPIUTIL_C)\n"
src_listvar "common" "*.c" "COMMON_C"
src_listvar "common" "*.h" "COMMON_H"
printf "COMMON_SRC = \$(COMMON_C) \$(COMMON_H)\n"
src_listvar "marshal" "*.c" "MARSHAL_C"
src_listvar "marshal" "*.h" "MARSHAL_H"
printf "MARSHAL_SRC = \$(MARSHAL_C) \$(MARSHAL_H)"
) > ${VARS_FILE}
${AUTORECONF} --install --sym