2020-05-07 20:40:18 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script searches for ya.make.in files in repository and generates ya.make files from them.
|
|
|
|
# ya.make.in is a template with substitutions in form of <? command ?>
|
|
|
|
# command is interpreted by bash and output is put in place of substitution
|
|
|
|
|
|
|
|
ROOT_PATH=$(git rev-parse --show-toplevel)
|
|
|
|
EXCLUDE_DIRS='build/|integration/|widechar_width/|glibc-compatibility/|memcpy/|consistent-hashing'
|
|
|
|
|
2020-11-05 09:55:01 +00:00
|
|
|
# Otherwise 'sort' behaves differently on Mac OS and also depends on locale.
|
|
|
|
export LC_ALL=C
|
|
|
|
|
2020-05-07 20:40:18 +00:00
|
|
|
find "${ROOT_PATH}" -name 'ya.make.in' | while read path; do
|
2020-05-31 14:28:44 +00:00
|
|
|
echo "# This file is generated automatically, do not edit. See 'ya.make.in' and use 'utils/generate-ya-make' to regenerate it." > "${path/.in/}"
|
|
|
|
(cd $(dirname "${path}") && perl -pne 's/<\?(.+?)\?>/`$1`/e' < "${path}" >> "${path/.in/}")
|
2020-05-07 20:40:18 +00:00
|
|
|
done
|