Implement prerequisites auto-update.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
@@ -308,14 +308,10 @@ clean:
|
|||||||
$(Q) rm -rf $(BUILD_DIR_PREFIX)* $(OUT_DIR)
|
$(Q) rm -rf $(BUILD_DIR_PREFIX)* $(OUT_DIR)
|
||||||
|
|
||||||
.PHONY: prerequisites
|
.PHONY: prerequisites
|
||||||
prerequisites: $(PREREQUISITES_STATE_DIR)/.prerequisites
|
prerequisites:
|
||||||
|
|
||||||
$(PREREQUISITES_STATE_DIR)/.prerequisites:
|
|
||||||
@ echo "Setting up prerequisites... (log file: $(PREREQUISITES_STATE_DIR)/prerequisites.log)"
|
|
||||||
$(Q) mkdir -p $(PREREQUISITES_STATE_DIR)
|
$(Q) mkdir -p $(PREREQUISITES_STATE_DIR)
|
||||||
$(Q) (./tools/prerequisites.sh $(PREREQUISITES_STATE_DIR)/.prerequisites 2>&1 | tee $(PREREQUISITES_STATE_DIR)/prerequisites.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
|
$(Q) (./tools/prerequisites.sh $(PREREQUISITES_STATE_DIR)/.prerequisites 2>&1 | tee $(PREREQUISITES_STATE_DIR)/prerequisites.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
|
||||||
(echo "Prerequisites setup failed. See $(PREREQUISITES_STATE_DIR)/prerequisites.log for details."; exit 1;)
|
(echo "Prerequisites setup failed. See $(PREREQUISITES_STATE_DIR)/prerequisites.log for details."; exit 1;)
|
||||||
@ echo "Prerequisites setup succeeded"
|
|
||||||
|
|
||||||
.PHONY: prerequisites_clean
|
.PHONY: prerequisites_clean
|
||||||
prerequisites_clean:
|
prerequisites_clean:
|
||||||
|
|||||||
+34
-4
@@ -14,11 +14,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
FLAG_FILE="$1"
|
PREREQUISITES_INSTALLED_LIST_FILE="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
rm -f $FLAG_FILE
|
|
||||||
|
|
||||||
if [ "$1" == "clean" ]
|
if [ "$1" == "clean" ]
|
||||||
then
|
then
|
||||||
CLEAN_MODE=yes
|
CLEAN_MODE=yes
|
||||||
@@ -66,6 +64,14 @@ function setup_from_zip() {
|
|||||||
|
|
||||||
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
||||||
|
|
||||||
|
if [ "$CLEAN_MODE" == "no" ]
|
||||||
|
then
|
||||||
|
echo "$CHECKSUM $NAME" >> $TMP_DIR/.prerequisites
|
||||||
|
grep -q "^$CHECKSUM $NAME\$" $TMP_DIR/.prerequisites.prev && return 0
|
||||||
|
|
||||||
|
echo "Setting up $NAME prerequisite"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -e "$DEST" ]
|
if [ -e "$DEST" ]
|
||||||
then
|
then
|
||||||
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
||||||
@@ -108,6 +114,14 @@ function setup_cppcheck() {
|
|||||||
|
|
||||||
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
||||||
|
|
||||||
|
if [ "$CLEAN_MODE" == "no" ]
|
||||||
|
then
|
||||||
|
echo "$CHECKSUM $NAME" >> $TMP_DIR/.prerequisites
|
||||||
|
grep -q "^$CHECKSUM $NAME\$" $TMP_DIR/.prerequisites.prev && return 0
|
||||||
|
|
||||||
|
echo "Setting up $NAME prerequisite"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -e "$DEST" ]
|
if [ -e "$DEST" ]
|
||||||
then
|
then
|
||||||
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
||||||
@@ -155,6 +169,14 @@ function setup_vera() {
|
|||||||
|
|
||||||
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
||||||
|
|
||||||
|
if [ "$CLEAN_MODE" == "no" ]
|
||||||
|
then
|
||||||
|
echo "$CHECKSUM $NAME" >> $TMP_DIR/.prerequisites
|
||||||
|
grep -q "^$CHECKSUM $NAME\$" $TMP_DIR/.prerequisites.prev && return 0
|
||||||
|
|
||||||
|
echo "Setting up $NAME prerequisite"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -e "$DEST" ]
|
if [ -e "$DEST" ]
|
||||||
then
|
then
|
||||||
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
||||||
@@ -187,6 +209,14 @@ function setup_vera() {
|
|||||||
|
|
||||||
TMP_DIR=`mktemp -d --tmpdir=./`
|
TMP_DIR=`mktemp -d --tmpdir=./`
|
||||||
|
|
||||||
|
if [ "$CLEAN_MODE" == "yes" ]
|
||||||
|
then
|
||||||
|
rm -f $PREREQUISITES_INSTALLED_LIST_FILE
|
||||||
|
else
|
||||||
|
touch $PREREQUISITES_INSTALLED_LIST_FILE || fail_msg "Failed to create '$PREREQUISITES_INSTALLED_LIST_FILE'."
|
||||||
|
mv $PREREQUISITES_INSTALLED_LIST_FILE $TMP_DIR/.prerequisites.prev
|
||||||
|
fi
|
||||||
|
|
||||||
setup_from_zip "stm32f3" \
|
setup_from_zip "stm32f3" \
|
||||||
"./third-party/STM32F3-Discovery_FW_V1.1.0" \
|
"./third-party/STM32F3-Discovery_FW_V1.1.0" \
|
||||||
"http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/firmware/stm32f3discovery_fw.zip" \
|
"http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/firmware/stm32f3discovery_fw.zip" \
|
||||||
@@ -211,7 +241,7 @@ setup_vera "vera++-1.2.1" \
|
|||||||
|
|
||||||
if [ "$CLEAN_MODE" == "no" ]
|
if [ "$CLEAN_MODE" == "no" ]
|
||||||
then
|
then
|
||||||
touch $FLAG_FILE || fail_msg "Failed to create flag file '$FLAG_FILE'."
|
mv $TMP_DIR/.prerequisites $PREREQUISITES_INSTALLED_LIST_FILE || fail_msg "Failed to write '$PREREQUISITES_INSTALLED_LIST_FILE'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean_on_exit "OK"
|
clean_on_exit "OK"
|
||||||
|
|||||||
Reference in New Issue
Block a user