| #!/bin/bash |
| |
| if [ ${#} -ne 1 ]; then |
| echo "Usage: $(basename ${0}) ENVCFG_FILE" >&2 |
| exit 1 |
| fi |
| |
| . ${1} || exit 1 |
| |
| I='medmcu' |
| |
| if [ ${CREATE_PLATFORM} -eq 1 ]; then |
| echo "kernel: platform creation is not supported yet" >&2 |
| exit 1 |
| else # project creation |
| PROJECT_ROOT='project/RV33_A' |
| BASE_PATH="${PROJECT_ROOT}/${BASE_PLATFORM}/${BASE_PROJECT_NAME}" |
| [ ${BASE_IS_INTERNAL} -eq 1 ] && \ |
| BASE_PATH="${PROJECT_ROOT}/${BASE_PLATFORM}/internal/${BASE_PROJECT_NAME}" |
| |
| if [ ! -d "${BASE_PATH}" ]; then |
| echo "${I}: base project ${BASE_PATH} does not exist. No-op." |
| exit 0 |
| fi |
| |
| TARGET_PATH="${PROJECT_ROOT}/${TARGET_PLATFORM}/${TARGET_PROJECT_NAME}" |
| [ ${TARGET_IS_INTERNAL} -eq 1 ] && \ |
| TARGET_PATH="${PROJECT_ROOT}/${TARGET_PLATFORM}/internal/${TARGET_PROJECT_NAME}" |
| |
| CP_CMD="rsync -rlpgoDvc --delete --exclude .git ${BASE_PATH}/ ${TARGET_PATH}" |
| echo "${I}: clone project: ${CP_CMD}" |
| eval ${CP_CMD} || exit 1 |
| fi |
| |
| exit 0 |