不用做成makefile,写成./build_boot.sh脚本就行
时间: 2024-12-22 11:33:35 浏览: 16
如果你不想使用Makefile,你可以创建一个名为`build_boot.sh`的bash shell脚本来代替。以下是一个简单的shell脚本示例,包含了上述命令的功能:
```bash
#!/bin/bash
# 定义变量
CROSS_COMPILE_64="/home/jc/AM62x/ti-processor-sdk-linux-rt-am62xx-evm-09.02.01.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-"
SYSROOT_64="/home/jc/AM62x/ti-processor-sdk-linux-rt-am64xx-evm-09.02.01.09/linux-devkit/sysroots/aarch64-oe-linux"
CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
CROSS_COMPILE_32="/home/jc/AM62x/ti-processor-sdk-linux-rt-am62xx-evm-09.02.01.09/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-"
# 配置并构建64位版本
am62x_evm_a53_defconfig() {
export ARCH="arm"
export CROSS_COMPILE="$CROSS_COMPILE_64"
export CC="$CC_64"
make -C U-Boot-2023.04 "$@" OUTPUT_DIR=output-image/a53
}
# 构建BL31和BL32
build_bl31() {
export BL31="/home/jc/AM62x/ti-processor-sdk-linux-rt-am62xx-evm-09.02.01.09/board-support/prebuilt-images/am62xx-evm/bl31.bin"
export TEE="/home/jc/AM62x/ti-processor-sdk-linux-rt-am62xx-evm-09.02.01.09/board-support/prebuilt-images/am62xx-evm/bl32.bin"
am62x_evm_a53_defconfig O=./output-image/a53
}
# 执行构建
build_bl31
echo "Build completed."
# 清理
clean() {
make -2023.04 clean
rm -rf output-image/a53/*
}
clean
```
这个脚本首先定义了所需的变量,接着有函数分别对应于Makefile中的各个步骤,如配置、构建BL31等。最后调用`clean`函数进行清理工作。运行这个脚本只需在终端中输入`./build_boot.sh`即可。
阅读全文