Skip to content

Commit 201a2cc

Browse files
committed
make sure to pull in main.c for IDE builds
1 parent 9216817 commit 201a2cc

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

sduino/lib/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2:1.6.0+sduino
1+
2:1.8.7+sduino

sduino/stm8/platform.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ compiler.warning_flags.all=-Wp-Wall -V
3737
# Default "compiler.path" is correct, change only if you want to override the initial value
3838
compiler.path={runtime.tools.sdcc.path}/bin
3939
compiler.wrapper.path={runtime.tools.STM8Tools.path}/wrapper
40-
compiler.wrapper.path.windows={runtime.tools.STM8Tools.path}/win/busybox"
41-
ash "{runtime.tools.STM8Tools.path}/wrapper
40+
compiler.wrapper.path.windows={runtime.tools.STM8Tools.path}/win/busybox" ash "{runtime.tools.STM8Tools.path}/wrapper
4241
compiler.tools.path={runtime.tools.avr-gcc.path}/bin
4342

4443
compiler.c.cmd=sdcc

sduino/tools/wrapper/sdcc.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Differences:
66
# - if a .cpp files is given as input temporarly copy it to .c and compile it
7-
# as a c file. This will break the dependency check, as it expects the the
7+
# as a c file. This will break the dependency check, as it expects the
88
# full original filename, but as this happens only for the original .ino
99
# file it is not a big loss.
1010
# - generate .rel files, but copy them as .o files as well to satisfy the
@@ -87,7 +87,12 @@ case "$SRC" in
8787
# rename .cpp to .c and compile
8888
>&2 echo -e "${RED}cpp gefunden${OFF}";
8989
CSRC="${SRC%pp}"
90-
cp -a "$SRC" "$CSRC"
90+
(
91+
# add a reference to main to pull in main.c
92+
echo "void main(void); void (*dummy_variable) () = main;"
93+
cat "$SRC"
94+
) > "$CSRC"
95+
# cp -a "$SRC" "$CSRC"
9196
"$SDCC" "$@" "$CSRC" -o "$OBJ"
9297
ERR=$?
9398
rm -f "$CSRC"

0 commit comments

Comments
 (0)