b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | DECONFIG_FILE=defconfig_asr1803p401 |
| 4 | |
| 5 | help() |
| 6 | { |
| 7 | echo "./asr_build.sh 1803/1806/1903/clean" |
| 8 | } |
| 9 | |
| 10 | build_init() |
| 11 | { |
| 12 | if [ ! -d "feeds/" ]; then |
| 13 | echo "Start build inti..." |
| 14 | ./scripts/feeds update -a |
| 15 | ./scripts/feeds install -a |
| 16 | fi |
| 17 | } |
| 18 | |
| 19 | build_code() |
| 20 | { |
| 21 | echo "$DECONFIG_FILE" |
| 22 | make $DECONFIG_FILE |
| 23 | make -j8 V=99 2>&1 | tee build.log |
| 24 | } |
| 25 | |
| 26 | if [ -n "$1" ] ;then #有参数 |
| 27 | case "$1" in |
| 28 | clean) |
| 29 | make distclean |
| 30 | ;; |
| 31 | 1806) |
| 32 | build_init |
| 33 | |
| 34 | DECONFIG_FILE=defconfig_asr1806p301 |
| 35 | |
| 36 | build_code |
| 37 | ;; |
| 38 | 1803) |
| 39 | build_init |
| 40 | |
| 41 | DECONFIG_FILE=defconfig_asr1803p401 |
| 42 | |
| 43 | build_code |
| 44 | ;; |
| 45 | 1903) |
| 46 | build_init |
| 47 | |
| 48 | DECONFIG_FILE=defconfig_asr1903p501 |
| 49 | |
| 50 | build_code |
| 51 | ;; |
| 52 | *) |
| 53 | help |
| 54 | ;; |
| 55 | esac |
| 56 | else # 全编 |
| 57 | help |
| 58 | fi |