diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/build_azure_iot.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_crypto.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_mqtt.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_mqtt_interoperability.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_nxd.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_nxd64.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_nxd_fast.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_ptp.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_secure.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_secure_interoperability.sh | 5 | ||||
| -rwxr-xr-x | scripts/build_web.sh | 5 | ||||
| -rw-r--r-- | scripts/func_build.sh | 15 |
12 files changed, 59 insertions, 11 deletions
diff --git a/scripts/build_azure_iot.sh b/scripts/build_azure_iot.sh index 3b7bec71..f90ad57e 100755 --- a/scripts/build_azure_iot.sh +++ b/scripts/build_azure_iot.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/azure_iot/run.sh build all
\ No newline at end of file +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/azure_iot/run.sh" + +. ./func_build.sh diff --git a/scripts/build_crypto.sh b/scripts/build_crypto.sh index 451194ad..2c6f3ea8 100755 --- a/scripts/build_crypto.sh +++ b/scripts/build_crypto.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/crypto/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/crypto/run.sh" + +. ./func_build.sh diff --git a/scripts/build_mqtt.sh b/scripts/build_mqtt.sh index 25014531..775562bd 100755 --- a/scripts/build_mqtt.sh +++ b/scripts/build_mqtt.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/mqtt/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/mqtt/run.sh" + +. ./func_build.sh diff --git a/scripts/build_mqtt_interoperability.sh b/scripts/build_mqtt_interoperability.sh index 573c8e6d..51955788 100755 --- a/scripts/build_mqtt_interoperability.sh +++ b/scripts/build_mqtt_interoperability.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/mqtt_interoperability/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/mqtt_interoperability/run.sh" + +. ./func_build.sh diff --git a/scripts/build_nxd.sh b/scripts/build_nxd.sh index 2512fb67..b63c1a48 100755 --- a/scripts/build_nxd.sh +++ b/scripts/build_nxd.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/netxduo/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/netxduo/run.sh" + +. ./func_build.sh diff --git a/scripts/build_nxd64.sh b/scripts/build_nxd64.sh index 93fc15c1..847d9f66 100755 --- a/scripts/build_nxd64.sh +++ b/scripts/build_nxd64.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/netxduo64/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/netxduo64/run.sh" + +. ./func_build.sh diff --git a/scripts/build_nxd_fast.sh b/scripts/build_nxd_fast.sh index cf9ba54d..6eadddc1 100755 --- a/scripts/build_nxd_fast.sh +++ b/scripts/build_nxd_fast.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/netxduo_fast/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/netxduo_fast/run.sh" + +. ./func_build.sh diff --git a/scripts/build_ptp.sh b/scripts/build_ptp.sh index 6f715749..857812a8 100755 --- a/scripts/build_ptp.sh +++ b/scripts/build_ptp.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/ptp/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/ptp/run.sh" + +. ./func_build.sh diff --git a/scripts/build_secure.sh b/scripts/build_secure.sh index d1c77c02..2e7e494b 100755 --- a/scripts/build_secure.sh +++ b/scripts/build_secure.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/nx_secure/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/nx_secure/run.sh" + +. ./func_build.sh diff --git a/scripts/build_secure_interoperability.sh b/scripts/build_secure_interoperability.sh index a1ada03b..d1fa6ea0 100755 --- a/scripts/build_secure_interoperability.sh +++ b/scripts/build_secure_interoperability.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/nx_secure_interoperability/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/nx_secure_interoperability/run.sh" + +. ./func_build.sh diff --git a/scripts/build_web.sh b/scripts/build_web.sh index a8bee025..bce2ebab 100755 --- a/scripts/build_web.sh +++ b/scripts/build_web.sh @@ -1,3 +1,6 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/web/run.sh build all +SCRIPT_DIR=$(dirname "$(realpath "$0")") +RUN_SCRIPT="$SCRIPT_DIR/../test/cmake/web/run.sh" + +. ./func_build.sh diff --git a/scripts/func_build.sh b/scripts/func_build.sh new file mode 100644 index 00000000..d6f0d9ce --- /dev/null +++ b/scripts/func_build.sh @@ -0,0 +1,15 @@ +#! /bin/bash + +"$RUN_SCRIPT" build all + +# Common error condition is that a user clones the netxduo repo without --recursive option. +# This results in a 127 error code (run.sh file not found). +# Try to fix this under-the-hood and attempt the script again. +status=$? +if [[ $status -eq 127 ]]; then + # Get the submodules (not fetched if --recursive option was missed during clone) + (cd "$SCRIPT_DIR/.." && git submodule update --init --recursive) + # Try again to invoke the script + "$RUN_SCRIPT" build all +fi + |
