Skip to content

Commit 215c2cc

Browse files
authored
remove PIO file creation in copy-libs.sh
1 parent f91a657 commit 215c2cc

File tree

1 file changed

+0
-127
lines changed

1 file changed

+0
-127
lines changed

tools/copy-libs.sh

-127
Original file line numberDiff line numberDiff line change
@@ -284,83 +284,8 @@ done
284284

285285
mkdir -p "$AR_SDK"
286286

287-
# start generation of platformio-build.py
288-
AR_PLATFORMIO_PY="$AR_SDK/platformio-build.py"
289-
cat configs/pio_start.txt > "$AR_PLATFORMIO_PY"
290-
291-
echo " ASFLAGS=[" >> "$AR_PLATFORMIO_PY"
292-
if [ "$IS_XTENSA" = "y" ]; then
293-
echo " \"-mlongcalls\"" >> "$AR_PLATFORMIO_PY"
294-
else
295-
echo " \"-march=rv32imc\"" >> "$AR_PLATFORMIO_PY"
296-
fi
297-
echo " ]," >> "$AR_PLATFORMIO_PY"
298-
echo "" >> "$AR_PLATFORMIO_PY"
299-
300-
echo " ASPPFLAGS=[" >> "$AR_PLATFORMIO_PY"
301-
set -- $PIO_AS_FLAGS
302-
for item; do
303-
echo " \"$item\"," >> "$AR_PLATFORMIO_PY"
304-
done
305-
echo " \"-x\", \"assembler-with-cpp\"" >> "$AR_PLATFORMIO_PY"
306-
echo " ]," >> "$AR_PLATFORMIO_PY"
307-
echo "" >> "$AR_PLATFORMIO_PY"
308-
309-
echo " CFLAGS=[" >> "$AR_PLATFORMIO_PY"
310-
set -- $PIO_C_FLAGS
311-
last_item="${@: -1}"
312-
for item in "${@:0:${#@}}"; do
313-
if [ "${item:0:1}" != "/" ]; then
314-
echo " \"$item\"," >> "$AR_PLATFORMIO_PY"
315-
fi
316-
done
317-
echo " \"$last_item\"" >> "$AR_PLATFORMIO_PY"
318-
echo " ]," >> "$AR_PLATFORMIO_PY"
319-
echo "" >> "$AR_PLATFORMIO_PY"
320-
321-
echo " CXXFLAGS=[" >> "$AR_PLATFORMIO_PY"
322-
set -- $PIO_CXX_FLAGS
323-
last_item="${@: -1}"
324-
for item in "${@:0:${#@}}"; do
325-
if [ "${item:0:1}" != "/" ]; then
326-
echo " \"$item\"," >> "$AR_PLATFORMIO_PY"
327-
fi
328-
done
329-
echo " \"$last_item\"" >> "$AR_PLATFORMIO_PY"
330-
echo " ]," >> "$AR_PLATFORMIO_PY"
331-
echo "" >> "$AR_PLATFORMIO_PY"
332-
333-
echo " CCFLAGS=[" >> "$AR_PLATFORMIO_PY"
334-
set -- $PIO_CC_FLAGS
335-
for item; do
336-
echo " \"$item\"," >> "$AR_PLATFORMIO_PY"
337-
done
338-
echo " \"-MMD\"" >> "$AR_PLATFORMIO_PY"
339-
echo " ]," >> "$AR_PLATFORMIO_PY"
340-
echo "" >> "$AR_PLATFORMIO_PY"
341-
342-
echo " LINKFLAGS=[" >> "$AR_PLATFORMIO_PY"
343-
set -- $PIO_LD_FLAGS
344-
for item; do
345-
echo " \"$item\"," >> "$AR_PLATFORMIO_PY"
346-
done
347-
set -- $PIO_LD_SCRIPTS
348-
for item; do
349-
echo " \"-T\", \"$item\"," >> "$AR_PLATFORMIO_PY"
350-
done
351-
set -- $PIO_LD_FUNCS
352-
for item; do
353-
echo " \"-u\", \"$item\"," >> "$AR_PLATFORMIO_PY"
354-
done
355-
echo " '-Wl,-Map=\"%s\"' % join(\"\${BUILD_DIR}\", \"\${PROGNAME}.map\")" >> "$AR_PLATFORMIO_PY"
356-
357-
echo " ]," >> "$AR_PLATFORMIO_PY"
358-
echo "" >> "$AR_PLATFORMIO_PY"
359-
360287
# include dirs
361288
REL_INC=""
362-
echo " CPPPATH=[" >> "$AR_PLATFORMIO_PY"
363-
364289
set -- $INCLUDES
365290

366291
for item; do
@@ -386,13 +311,6 @@ for item; do
386311
out_sub="${item#*$ipath}"
387312
out_cpath="$AR_SDK/include/$fname$out_sub"
388313
REL_INC+="-iwithprefixbefore $fname$out_sub "
389-
if [ "$out_sub" = "" ]; then
390-
echo " join($PIO_SDK, \"include\", \"$fname\")," >> "$AR_PLATFORMIO_PY"
391-
else
392-
pio_sub="${out_sub:1}"
393-
pio_sub=`echo $pio_sub | sed 's/\//\\", \\"/g'`
394-
echo " join($PIO_SDK, \"include\", \"$fname\", \"$pio_sub\")," >> "$AR_PLATFORMIO_PY"
395-
fi
396314
for f in `find "$item" -name '*.h'`; do
397315
rel_f=${f#*$item}
398316
rel_p=${rel_f%/*}
@@ -418,58 +336,13 @@ for item; do
418336
fi
419337
fi
420338
done
421-
echo " join($PIO_SDK, board_config.get(\"build.arduino.memory_type\", (board_config.get(\"build.flash_mode\", \"dio\") + \"_$OCT_PSRAM\")), \"include\")," >> "$AR_PLATFORMIO_PY"
422-
echo " join(FRAMEWORK_DIR, \"cores\", board_config.get(\"build.core\"))" >> "$AR_PLATFORMIO_PY"
423-
echo " ]," >> "$AR_PLATFORMIO_PY"
424-
echo "" >> "$AR_PLATFORMIO_PY"
425339

426340
AR_LIBS="$LD_LIBS"
427-
PIO_LIBS=""
428-
set -- $LD_LIBS
429-
for item; do
430-
if [ "$PIO_LIBS" != "" ]; then
431-
PIO_LIBS+=", "
432-
fi
433-
PIO_LIBS+="\"$item\""
434-
done
435-
436341
set -- $LD_LIB_FILES
437342
for item; do
438343
cp "$item" "$AR_SDK/lib/"
439344
done
440345

441-
echo " LIBPATH=[" >> "$AR_PLATFORMIO_PY"
442-
echo " join($PIO_SDK, \"lib\")," >> "$AR_PLATFORMIO_PY"
443-
echo " join($PIO_SDK, \"ld\")," >> "$AR_PLATFORMIO_PY"
444-
echo " join($PIO_SDK, board_config.get(\"build.arduino.memory_type\", (board_config.get(\"build.flash_mode\", \"dio\") + \"_$OCT_PSRAM\")))" >> "$AR_PLATFORMIO_PY"
445-
echo " ]," >> "$AR_PLATFORMIO_PY"
446-
echo "" >> "$AR_PLATFORMIO_PY"
447-
448-
echo " LIBS=[" >> "$AR_PLATFORMIO_PY"
449-
echo " $PIO_LIBS" >> "$AR_PLATFORMIO_PY"
450-
echo " ]," >> "$AR_PLATFORMIO_PY"
451-
echo "" >> "$AR_PLATFORMIO_PY"
452-
453-
echo " CPPDEFINES=[" >> "$AR_PLATFORMIO_PY"
454-
set -- $DEFINES
455-
for item; do
456-
item="${item:2}" #remove -D
457-
if [[ $item == *"="* ]]; then
458-
item=(${item//=/ })
459-
re='^[+-]?[0-9]+([.][0-9]+)?$'
460-
if [[ ${item[1]} =~ $re ]]; then
461-
echo " (\"${item[0]}\", ${item[1]})," >> "$AR_PLATFORMIO_PY"
462-
else
463-
echo " (\"${item[0]}\", '${item[1]}')," >> "$AR_PLATFORMIO_PY"
464-
fi
465-
else
466-
echo " \"$item\"," >> "$AR_PLATFORMIO_PY"
467-
fi
468-
done
469-
470-
# end generation of platformio-build.py
471-
cat configs/pio_end.txt >> "$AR_PLATFORMIO_PY"
472-
473346
# replace double backslashes with single one
474347
DEFINES=`echo "$DEFINES" | tr -s '\'`
475348

0 commit comments

Comments
 (0)