Merge pull request #8911 from iNavFlight/dzikuvx-speedybeef405wing
[inav.git] / cmake / docker.sh
blob3c10ebc8e1dc8e2e2bbcb5e976eb82f48c7c5efc
1 #!/bin/bash
2 set -e
4 LAST_CMAKE_AT_REV_FILE="docker_cmake.rev"
5 CURR_REV="$(git rev-parse HEAD)"
7 initialize_cmake() {
8 echo -e "*** CMake was not initialized yet, doing it now.\n"
9 cmake ..
10 echo "$CURR_REV" > "$LAST_CMAKE_AT_REV_FILE"
13 # Check if CMake has never been initialized
14 if [ ! -f Makefile ]; then
15 initialize_cmake
18 # Check if CMake was initialized for a different Git revision (new targets may have been added)
19 if [ -f "$LAST_CMAKE_AT_REV_FILE" ]; then
20 LAST_CMAKE_AT_REV="$(cat $LAST_CMAKE_AT_REV_FILE)"
21 if [[ "$LAST_CMAKE_AT_REV" != "SKIP" ]] && [[ "$LAST_CMAKE_AT_REV" != "$CURR_REV" ]]; then
22 initialize_cmake
24 else
25 initialize_cmake
28 # Let Make handle the arguments coming from the build script
29 make "$@"