| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 | #!/bin/shset -eu# relative to the script's directoryTREE=..DEST=module# make sure we're running in our own directoryif [ -f create-module.sh ]; then :; else    cd $( dirname $0 )    if [ -f create-module.sh ]; then :; else        echo "Please run the script from is directory." >&2        exit 1    fifi# use a temporary directory to build the module, then rsync to DEST# this allows touching only new files, for more efficient re-buildsTMP=$DEST-tmprm -rf $TMPmkdir -p $TMP/mbedtls $TMP/sourcecp $TREE/include/mbedtls/*.h $TMP/mbedtlscp $TREE/library/*.c $TMP/source# temporary, should depend on external module latercp data/entropy_hardware_poll.c $TMP/sourcecp data/target_config.h $TMP/mbedtlsdata/adjust-config.sh $TREE/scripts/config.pl $TMP/mbedtls/config.hmkdir -p $TMP/testcp -r data/example-* $TMP/test# later we should have the generated test suites here toocp data/module.json $TMPcp data/README.md $TMPcp ../LICENSE $TMPif [ -f ../apache-2.0.txt ]; then cp ../apache-2.0.txt $TMP; fimkdir -p $DESTrsync -cr --delete --exclude build --exclude yotta_\* $TMP/ $DEST/rm -rf $TMPecho "mbed TLS yotta module created in '$PWD/$DEST'."
 |