blob: 5e6b3d665abcf4815aee1d9ddcef310ed364a2f2 [file] [log] [blame]
Kelvin Zhang14bca5e2021-12-15 19:19:35 +08001#!/bin/bash
yang.li09520922022-01-12 15:51:51 +08002#
yang.liffa60e52022-01-11 14:38:56 +08003# Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved.
yang.li09520922022-01-12 15:51:51 +08004#
yang.liffa60e52022-01-11 14:38:56 +08005# SPDX-License-Identifier: MIT
yang.li09520922022-01-12 15:51:51 +08006#
yang.liffa60e52022-01-11 14:38:56 +08007
Kelvin Zhang09786122022-02-11 15:56:08 +08008# usage:./scripts/build_all.sh at rtos sdk root dir
Kelvin Zhang14bca5e2021-12-15 19:19:35 +08009
Xiaohu.Huangb6ad9762022-02-11 17:49:09 +080010BUILD_COMBINATION="$PWD/scripts/build_combination.txt"
Kelvin Zhang14bca5e2021-12-15 19:19:35 +080011
Kelvin Zhang09786122022-02-11 15:56:08 +080012# Build and upload document
13if [[ "$SUBMIT_TYPE" == "daily" ]]; then
14 make docs
15 cd output/docs/html; find -type f -exec curl --ftp-create-dirs -T {} ftp://platform:platform@10.68.11.163:2222/Documents/Ecosystem/RTOS/rtos-sdk/{} \;; cd -
16fi
17
Kelvin Zhang0f465a02022-02-11 15:39:54 +080018# Build all projects
Kelvin Zhang14bca5e2021-12-15 19:19:35 +080019i=0
20while IFS= read -r LINE; do
21 [[ "$i" -ne 0 ]] && echo ""
22 i=$((i+1))
Kelvin Zhang14bca5e2021-12-15 19:19:35 +080023 source scripts/env.sh $LINE
Xiaohu.Huangb6ad9762022-02-11 17:49:09 +080024 [ "$?" -ne 0 ] && echo "Failed to source scripts/env.sh!" && exit 1
kelvin.zhang05852a72022-01-19 10:30:24 +080025 make distclean
Xiaohu.Huangb6ad9762022-02-11 17:49:09 +080026 [ "$?" -ne 0 ] && echo "Failed to make distclean!" && exit 2
bin.chene9875112022-01-18 15:00:50 +080027 make
Xiaohu.Huangb6ad9762022-02-11 17:49:09 +080028 [ "$?" -ne 0 ] && echo "Failed to make!" && exit 3
Xiaohu.Huang7dac8722022-01-18 16:21:29 +080029 if [[ "$SUBMIT_TYPE" == "daily" ]]; then
bin.chen439b9342022-01-18 13:35:42 +080030 source scripts/scp.sh
Xiaohu.Huangb6ad9762022-02-11 17:49:09 +080031 [ "$?" -ne 0 ] && echo "Failed to source scripts/scp.sh!" && exit 4
bin.chen439b9342022-01-18 13:35:42 +080032 fi
Kelvin Zhang14bca5e2021-12-15 19:19:35 +080033done < "$BUILD_COMBINATION"