Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Commit a2d9268

Browse files
manchozfacchinm
authored andcommitted
Copy only relevant files
1 parent 5e404e8 commit a2d9268

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

mbed-os-to-arduino

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,15 @@ generate_libs () {
159159
}
160160

161161
copy_core_files () {
162-
echo -n "Copying files to core... "
163-
rsync -zar --include="*/" --include="*.h" --exclude="*" mbed-os/ "$ARDUINOCOREMBED"/
164-
rsync -zar --include="*/" --include="mstd_*" --exclude="*" mbed-os/ "$ARDUINOCOREMBED"/
162+
echo -n "Copying generic MbedOS headers to core... "
163+
rsync -zar --exclude="targets/" --exclude="*TEST*/" --include="*/" --include="*.h" --exclude="*" mbed-os/ "$ARDUINOCOREMBED"/
164+
rsync -zar --exclude="targets/" --exclude="*TEST*/" --include="*/" --include="mstd_*" --exclude="*" mbed-os/ "$ARDUINOCOREMBED"/
165+
echo " done."
166+
167+
TARGET=$(find mbed-os -type d -name TARGET_"$BOARDNAME" | cut -d'/' -f2-3)
168+
echo -n "Copying MbedOS headers for $TARGET ... "
169+
[ -d "$ARDUINOCOREMBED"/"$TARGET"/ ] || mkdir -p "$ARDUINOCOREMBED"/"$TARGET"/ && :;
170+
rsync -zar --include="*/" --include="*.h" --exclude="*" mbed-os/"$TARGET"/ "$ARDUINOCOREMBED"/"$TARGET"/
165171
echo " done."
166172
}
167173

@@ -246,12 +252,14 @@ export APPLY_PATCHES=${APPLY_PATCHES:-0}
246252
export LOCAL_REPO=${LOCAL_REPO:-""}
247253
export REMOTE_BRANCH=${REMOTE_BRANCH:-""}
248254

255+
echo
249256
echo MBED_CLEAN=$MBED_CLEAN
250257
echo MBED_UPDATE=$MBED_UPDATE
251258
echo APPLY_PATCHES=$APPLY_PATCHES
252259
echo LOCAL_REPO="$LOCAL_REPO"
253260
echo REMOTE_BRANCH="$REMOTE_BRANCH"
254261
echo MBED_CORE_LOCATION="$MBED_CORE_LOCATION"
262+
echo
255263

256264
for variant in ${!VARIANT_BOARDS[*]}; do
257265
echo "VARIANT=$variant BOARD=${VARIANT_BOARDS[$variant]}"

0 commit comments

Comments
 (0)