3 # This file is part of mbed TLS (https://tls.mbed.org)
5 # Copyright (c) 2018, ARM Limited, All Rights Reserved
9 # Check if generated files are up-to-date.
13 if [ -d library -a -d include -a -d tests ]; then :; else
14 echo "Must be run from mbed TLS root" >&2
25 if [ -d $TO_CHECK ]; then
26 for FILE in $TO_CHECK/*; do
33 for FILE in $FILES; do
39 # Compare the script output to the old files and remove backups
40 for FILE in $FILES; do
41 if ! diff $FILE $FILE.bak >/dev/null 2>&1; then
42 echo "'$FILE' was either modified or deleted by '$SCRIPT'"
47 if [ -d $TO_CHECK ]; then
48 # Create a grep regular expression that we can check against the
49 # directory contents to test whether new files have been created
50 if [ -z $PATTERN ]; then
51 PATTERN="$(basename $FILE)"
53 PATTERN="$PATTERN\|$(basename $FILE)"
58 if [ -d $TO_CHECK ]; then
59 # Check if there are any new files
60 if ls -1 $TO_CHECK | grep -v "$PATTERN" >/dev/null 2>&1; then
61 echo "Files were created by '$SCRIPT'"
67 check scripts/generate_errors.pl library/error.c
68 check scripts/generate_query_config.pl programs/ssl/query_config.c
69 check scripts/generate_features.pl library/version_features.c
70 check scripts/generate_visualc_files.pl visualc/VS2010