1 2while getopts "o:i:t:h" arg 3do 4 case "${arg}" in 5 "o") 6 OUT_DIR=${OPTARG} 7 ;; 8 "i") 9 SOURCE_DIR=${OPTARG} 10 ;; 11 "t") 12 TARGET_ARCH=${OPTARG} 13 ;; 14 "h") 15 echo "help" 16 ;; 17 ?) 18 echo "unkonw argument" 19 exit 1 20 ;; 21 esac 22done 23 24if [ ! -d "${OUT_DIR}" ];then 25 mkdir -p ${OUT_DIR} 26fi 27cp -r ${SOURCE_DIR}/* ${OUT_DIR} 28 29if [ ${TARGET_ARCH} = "arm" ]; then 30 mv ${OUT_DIR}/asm-arm/asm ${OUT_DIR}/asm 31 rm -rf ${OUT_DIR}/asm-arm64 32 rm -rf ${OUT_DIR}/asm-arm 33elif [ ${TARGET_ARCH} = "aarch64" ]; then 34 mv ${OUT_DIR}/asm-arm64/asm ${OUT_DIR}/asm 35 rm -rf ${OUT_DIR}/asm-arm64 36 rm -rf ${OUT_DIR}/asm-arm 37elif [ ${TARGET_ARCH} = "x86_64" ]; then 38 mv ${OUT_DIR}/asm-arm64/asm ${OUT_DIR}/asm 39 rm -rf ${OUT_DIR}/asm-arm64 40 rm -rf ${OUT_DIR}/asm-arm 41fi 42 43