Skip to content

Commit 248ecb5

Browse files
committed
tool path definition now works for automatic and manual installs
1 parent 4c588db commit 248ecb5

3 files changed

Lines changed: 28 additions & 26 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*~
2-
*.bak
2+
*bak
33
.*.swp
44
# ignore all kinds of binary files:
55
*.o

board-manager/minimize-sdcc.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,23 @@ fi
1212
FILE=$1
1313

1414
case "$FILE" in
15-
*.tar.bz2, *.tbz)
15+
*.tar.bz2 | *.tbz)
1616
TARFLAG=j
1717
;;
18-
*.tar.gz, *.tgz)
18+
*.tar.gz | *.tgz)
1919
TARFLAG=z
2020
esac
2121

22+
# set to v for verbose mode
23+
VERBOSE=
24+
2225
NAME=$(basename "$FILE")
2326
NAME=${NAME/snapshot/stm8}
2427

25-
tar xv${TARFLAG}f "$FILE" \
28+
TMP=$(mktemp -d sdcc-repack-XXXXXX --tmpdir)
29+
30+
echo "Unpacking into temp. directory $TMP..."
31+
tar x${VERBOSE}${TARFLAG}f "$FILE" -C "$TMP" \
2632
--exclude=doc --exclude=src --exclude=non-free \
2733
--exclude=stlcs --exclude=ds80c390.h \
2834
"--exclude=pic*" \
@@ -31,4 +37,10 @@ tar xv${TARFLAG}f "$FILE" \
3137
"--exclude=*gb" "--exclude=*ka" "--exclude=*.info" \
3238
"--exclude=large*" "--exclude=medium" "--exclude=small*"
3339

34-
tar cv${TARFLAG}f "$NAME" sdcc
40+
echo "Repacking into file $NAME"
41+
tar c${VERBOSE}${TARFLAG}f "$NAME" -C "$TMP" sdcc
42+
43+
echo "cleaning up temporary files"
44+
rm -rf "$TMP"
45+
46+
echo "done."

sduino/hardware/sduino/stm8/platform.txt

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@
55
# For more info:
66
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
77

8-
name=STM8 Testboards
8+
name=STM8S Boards
99
version=1.6.15
1010

11-
# AVR compile variables
11+
# General folder structure variables
12+
# ----------------------------------
13+
# For Board Manager installs this variable is already predefined and will
14+
# not be overwritten. This assignment is done only for manual installs.
15+
{runtime.tools.sdcc.path}="{runtime.hardware.path}/tools/sdcc"
16+
{runtime.tools.STM8Tools.path}="{runtime.hardware.path}/tools"
17+
18+
19+
# STM8 compile variables
1220
# ---------------------
1321

1422
compiler.warning_flags=
@@ -78,7 +86,7 @@ compiler.ar.extra_flags=
7886
compiler.objcopy.eep.extra_flags=
7987
compiler.elf2hex.extra_flags=
8088

81-
# AVR compile patterns
89+
# STM8 compile patterns
8290
# --------------------
8391

8492
## Compile c files (re1)
@@ -101,17 +109,6 @@ recipe.ar.pattern="{compiler.wrapper.path}/{compiler.ar.wrapper}" "{compiler.pat
101109
## Combine gc-sections, archives, and objects (re5)
102110
recipe.c.combine.pattern="{compiler.wrapper.path}/{compiler.c.elf.wrapper}" "{compiler.path}/{compiler.c.elf.cmd}" --nostdlib "-L{compiler.syslibs.spl.path}/lib" "-L{build.path}" "-L{compiler.syslibs.stdlib.path}/lib/stm8" {compiler.c.elf.flags} -mstm8 -D{build.mcu} {compiler.c.elf.extra_flags} {object_files} "{build.path}/{archive_file}" "{build.path}/core/main.c.rel" -l{build.mcu} -lstm8 --out-fmt-elf -o "{build.path}/{build.project_name}.elf"
103111

104-
# Soll-Wert:
105-
#/opt/sdcc/bin/sdcc
106-
# -L /home/mmayer/rsync/stm8/sduino/../STM8S_StdPeriph_Driver/lib
107-
# -L/opt/sdcc/share/sdcc/lib/stm8
108-
# -mstm8 -DSTM8S103
109-
# build-stm8sblue/Blink.c.rel build-stm8sblue/libcore.lib \
110-
# build-stm8sblue/core/main.c.rel \
111-
# -lSTM8S103 -lstm8 -o build-stm8sblue/Blink.ihx
112-
113-
114-
115112
## Create output files (.eep and .hex)
116113
#recipe.objcopy.eep.pattern="{compiler.path}/{compiler.objcopy.cmd}" re6 {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
117114
#recipe.objcopy.eep.pattern="{compiler.tools.path}/{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
@@ -131,16 +128,9 @@ recipe.size.regex.data=^(?:DATA|INITIALIZED)\s+([0-9]+).*
131128
recipe.size.regex.eeprom=^(?:EEPROM)\s+([0-9]+).*
132129

133130
## Preprocessor (re11, re12)
134-
#preproc.includes.flags=-w -x c++ -M -MG -MP
135131
preproc.includes.flags=-M -MG -MP
136132
recipe.preproc.includes="{compiler.path.wrapper}/{compiler.cpp.wrapper}" "{compiler.path}/{compiler.cpp.cmd}" re11 {compiler.cpp.flags} {preproc.includes.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}"
137-
138-
#preproc.macros.flags=-w -x c++ -E -CC
139133
preproc.macros.flags=-E -MC
140-
#recipe.preproc.macros="{compiler.path}/{compiler.cpp.cmd}" re12 {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}"
141-
#recipe.preproc.macros="avr-g++" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}"
142-
#recipe.preproc.macros="{compiler.path}/{compiler.cpp.cmd}" re12 {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}"
143-
#recipe.preproc.macros="{compiler.path.emu}/{compiler.cpp.cmd}" "{source_file}" "{preprocessed_file_path}" re12 {compiler.cpp.flags} {preproc.macros.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
144134
recipe.preproc.macros="{compiler.wrapper.path}/{compiler.cpp.cmd}.sh" "{compiler.path}/{compiler.cpp.cmd}" "{source_file}" "{preprocessed_file_path}" re12 {compiler.cpp.flags} {preproc.macros.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
145135

146136

0 commit comments

Comments
 (0)