[build] allow specify build date time (#6856)

This commit adds a macro for specifying OpenThread build date time,
which can be empty so that this field can be omitted.
This commit is contained in:
Yakun Xu
2021-07-27 18:18:57 -07:00
committed by GitHub
parent 2f7f3bf5d9
commit e40c01d355
2 changed files with 28 additions and 4 deletions
+18
View File
@@ -45,8 +45,26 @@ check_targets()
done
}
check_datetime()
{
local datetime
datetime="$(date)"
cat >openthread-config-datetime.h <<EOF
#include <openthread-config-android.h>
#define OPENTHREAD_BUILD_DATETIME "$datetime"
EOF
OPENTHREAD_PROJECT_CFLAGS="-I$PWD -DOPENTHREAD_CONFIG_FILE=\\\"openthread-config-datetime.h\\\" \
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\\\"openthread-core-posix-config.h\\\"" \
make showcommands ot-cli
grep "$datetime" -ao "out/target/product/generic/system/bin/ot-cli"
make clean-ot-cli
}
main()
{
OPENTHREAD_ENABLE_ANDROID_MK=1 ANDROID_NDK=1 check_datetime
OPENTHREAD_ENABLE_ANDROID_MK=1 ANDROID_NDK=1 USE_OTBR_DAEMON=1 check_targets ot-cli ot-ctl
OPENTHREAD_ENABLE_ANDROID_MK=1 ANDROID_NDK=1 check_targets ot-cli spi-hdlc-adapter
}