aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2015-02-03 20:27:51 +0100
committerLorenz Meier <lm@inf.ethz.ch>2015-02-03 20:27:51 +0100
commit37ec1ec8defd67a76e476944123ed43006516dad (patch)
tree50b2efa847ea8a88382cc2a0bd95c929e5bc92de
parentdc46736eadac43527f875b281cc1f50032d36066 (diff)
downloadpx4-firmware-37ec1ec8defd67a76e476944123ed43006516dad.tar.gz
px4-firmware-37ec1ec8defd67a76e476944123ed43006516dad.tar.bz2
px4-firmware-37ec1ec8defd67a76e476944123ed43006516dad.zip
Improve submodule checking
-rw-r--r--Makefile7
-rwxr-xr-xTools/check_submodules.sh59
2 files changed, 53 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index af93504ee..05e0d90a2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
+# Copyright (c) 2012-2015 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -161,7 +161,7 @@ $(foreach config,$(FMU_CONFIGS),$(eval $(call FMU_DEP,$(config))))
#
NUTTX_ARCHIVES = $(foreach board,$(BOARDS),$(ARCHIVE_DIR)$(board).export)
.PHONY: archives
-archives: $(NUTTX_ARCHIVES)
+archives: checksubmodules $(NUTTX_ARCHIVES)
# We cannot build these parallel; note that we also force -j1 for the
# sub-make invocations.
@@ -211,8 +211,7 @@ menuconfig:
@$(ECHO) ""
endif
-$(NUTTX_SRC):
- $(Q) ($(PX4_BASE)/Tools/check_submodules.sh)
+$(NUTTX_SRC): checksubmodules
$(UAVCAN_DIR):
$(Q) (./Tools/check_submodules.sh)
diff --git a/Tools/check_submodules.sh b/Tools/check_submodules.sh
index 3904a2775..5e6e57164 100755
--- a/Tools/check_submodules.sh
+++ b/Tools/check_submodules.sh
@@ -14,15 +14,14 @@ if [ -d NuttX/nuttx ];
else
echo ""
echo ""
+ echo "New commits required:"
+ echo "$(git submodule summary)"
+ echo ""
+ echo ""
echo " NuttX sub repo not at correct version. Try 'git submodule update'"
echo " or follow instructions on http://pixhawk.org/dev/git/submodules"
echo ""
echo " DO NOT FORGET TO RUN 'make distclean && make archives' AFTER EACH NUTTX UPDATE!"
- echo ""
- echo ""
- echo "New commits required:"
- echo "$(git submodule summary)"
- echo ""
exit 1
fi
else
@@ -39,13 +38,12 @@ if [ -d mavlink/include/mavlink/v1.0 ];
else
echo ""
echo ""
- echo "mavlink sub repo not at correct version. Try 'git submodule update'"
- echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
- echo ""
- echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
+ echo ""
+ echo "mavlink sub repo not at correct version. Try 'git submodule update'"
+ echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
@@ -63,13 +61,56 @@ then
else
echo ""
echo ""
+ echo "New commits required:"
+ echo "$(git submodule summary)"
+ echo ""
+ echo ""
echo "uavcan sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
+ exit 1
+ fi
+else
+ git submodule init;
+ git submodule update;
+fi
+
+if [ -d Tools/gencpp ]
+then
+ STATUSRETVAL=$(git submodule summary | grep -A20 -i gencpp | grep "<")
+ if [ -z "$STATUSRETVAL" ]
+ then
+ echo "Checked gencpp submodule, correct version found"
+ else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
+ echo ""
+ echo "gencpp sub repo not at correct version. Try 'git submodule update'"
+ echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
+ exit 1
+ fi
+else
+ git submodule init;
+ git submodule update;
+fi
+
+if [ -d Tools/genmsg ]
+then
+ STATUSRETVAL=$(git submodule summary | grep -A20 -i genmsg | grep "<")
+ if [ -z "$STATUSRETVAL" ]
+ then
+ echo "Checked genmsg submodule, correct version found"
+ else
+ echo ""
+ echo ""
+ echo "New commits required:"
+ echo "$(git submodule summary)"
+ echo ""
+ echo ""
+ echo "genmsg sub repo not at correct version. Try 'git submodule update'"
+ echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else