@@ -18,29 +18,27 @@ compiler.warning_flags.more=-Wall
1818compiler.warning_flags.all=-Wall -Wextra
1919
2020# Default "compiler.path" is correct, change only if you want to override the initial value
21- compiler.path={runtime.hardware.path}/tools/sdcc/bin/
21+ compiler.path=/opt/sdcc/bin/
22+ compiler.path.windows={runtime.hardware.path}/tools/sdcc/bin/
23+ compiler.wrapper.path={runtime.hardware.path}/tools/wrapper/
2224compiler.tools.path=/usr/bin/
23- #compiler.tools.path={runtime.hardware.path}/tools/bin/
24- compiler.path.emu={runtime.hardware.path}/tools/linux/
25- compiler.path.emu.windows={runtime.hardware.path}/tools/win/
26- compiler.path.emu.macos={runtime.hardware.path}/tools/macos/
27- #/home/mmayer/stm8/abuild/
28-
29- compiler.c.cmd=sdcc-pseudo-g++
30- compiler.c.cmd.windows=sdcc-pseudo-g++.bat
25+ compiler.tools.path.windows={runtime.hardware.path}/tools/bin/
26+
27+ compiler.c.cmd=sdcc
28+ compiler.c.wrapper=sdcc.sh
3129compiler.c.flags=-MMD -c -Ddouble=float -D__PROG_TYPES_COMPAT__ {compiler.warning_flags}
3230compiler.c.elf.flags=--code-size {upload.maximum_size} --iram-size {upload.maximum_data_size}
3331
34- compiler.c.elf.cmd=sdcc-link
35- compiler.c.elf.cmd.windows =sdcc-link.bat
32+ compiler.c.elf.cmd=sdcc
33+ compiler.c.elf.wrapper =sdcc-link.sh
3634compiler.S.flags=-c -g -x assembler-with-cpp -flto
3735
38- compiler.cpp.cmd=sdcc-pseudo-g++
39- compiler.cpp.cmd.windows =sdcc-pseudo-g++.bat
36+ compiler.cpp.cmd=sdcc
37+ compiler.cpp.wrapper =sdcc.sh
4038compiler.cpp.flags=-MMD -c -Ddouble=float -D__PROG_TYPES_COMPAT__ {compiler.warning_flags}
4139
4240compiler.ar.cmd=sdar
43- compiler.ar.cmd.windows =sdar.exe
41+ compiler.ar.wrapper =sdar.sh
4442compiler.ar.flags=rcs
4543
4644compiler.objcopy.cmd=objcopy
@@ -50,19 +48,15 @@ compiler.objcopy.cmd=objcopy
5048compiler.elf2hex.cmd=objcopy
5149compiler.elf2hex.flags=-O ihex -R DATA -R INITIALIZED -R SSEG
5250
53- compiler.syslibs.stdlib.path={runtime.hardware.path}/tools/sdcc/share/sdcc/
51+ compiler.syslibs.stdlib.path=/opt/sdcc/share/sdcc/
52+ compiler.syslibs.stdlib.path.windows={runtime.hardware.path}/tools/sdcc/share/sdcc/
5453compiler.syslibs.spl.path={runtime.platform.path}/STM8S_StdPeriph_Driver/
5554
5655compiler.ldflags=
57- #compiler.ld.stdlib=lib/stm8/
5856
5957compiler.size.cmd=size
6058compiler.size.cmd.windows=size.exe
6159
62- # Meine Ergänzungen, müssen irgendwie automatisiert werden:
63- #compiler.systemincludes=-I/home/mmayer/rsync/stm8/STM8S_StdPeriph_Driver/inc -I/opt/sdcc/share/sdcc/include
64- #compiler.systemincludes=-I/home/mmayer/rsync/stm8/STM8S_StdPeriph_Driver/inc "-I{runtime.hardware.path}/tools/sdcc/share/sdcc/include"
65- #compiler.systemincludes="-I{runtime.platform.path}/STM8S_StdPeriph_Driver/inc" "-I{runtime.hardware.path}/tools/sdcc/share/sdcc/include"
6660compiler.systemincludes="-I{compiler.syslibs.spl.path}inc" "-I{compiler.syslibs.stdlib.path}include"
6761
6862# This can be overridden in boards.txt
@@ -81,36 +75,24 @@ compiler.elf2hex.extra_flags=
8175# --------------------
8276
8377## Compile c files (re1)
84- recipe.c.o.pattern="{compiler.path.emu}{compiler.c.cmd}" "{source_file}" "{object_file}" re2 {compiler.c.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
78+ #recipe.c.o.pattern="{compiler.path.wrapper}{compiler.c.cmd}" "{source_file}" "{object_file}" re2 {compiler.c.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
79+ recipe.c.o.pattern="{compiler.wrapper.path}{compiler.c.wrapper}" "{compiler.path}{compiler.c.cmd}" "{source_file}" "{object_file}" re2 {compiler.c.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} {compiler.systemincludes}
8580
8681## Compile c++ files (re2)
87- recipe.cpp.o.pattern="{compiler.path.emu}{compiler.cpp.cmd}" "{source_file}" "{object_file}" re2 {compiler.cpp.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}
88-
89- # Soll-Aufruf .c.o:
90- #/opt/sdcc/bin/sdcc "-Wp-MMD build-stm8sblue/Blink.c.d" -c -Ddouble=float -I.
91- #-I/home/mmayer/rsync/stm8/sduino/../STM8S_StdPeriph_Driver/inc
92- #-I/opt/sdcc/share/sdcc/include/ -mstm8 -DSTM8S103 -DF_CPU=16000000L
93- #-DARDUINO=160 -DARDUINO_ARCH_STM8 -D__PROG_TYPES_COMPAT__
94- #-I/home/mmayer/rsync/stm8/sduino/hardware/sduino/stm8/cores/sduino
95- #-I/home/mmayer/rsync/stm8/sduino/hardware/sduino/stm8/variants/standard
96- #Blink.c -o build-stm8sblue/Blink.c.rel
97-
98- ##FIXME Compile S files
82+ #recipe.cpp.o.pattern="{compiler.path.wrapper}{compiler.cpp.cmd}" "{source_file}" "{object_file}" re2 {compiler.cpp.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}
83+ recipe.cpp.o.pattern="{compiler.wrapper.path}{compiler.cpp.wrapper}" "{compiler.path}{compiler.cpp.cmd}" "{source_file}" "{object_file}" re2 {compiler.cpp.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}
84+
85+ ##FIXME Compile S files (re3)
9986recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" re3 {compiler.S.flags} -mstm8 -D{build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
10087
10188## Create archives (re4)
10289# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
103- archive_file_path={build.path}/{archive_file}
90+ # archive_file_path={build.path}/{archive_file}
10491#recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
105- recipe.ar.pattern="{compiler.path.emu }{compiler.ar.cmd}" "{archive_file_path}" "{object_file}" re4 {compiler.ar.flags} {compiler.ar.extra_flags}
92+ recipe.ar.pattern="{compiler.wrapper. path}{compiler.ar.wrapper}" "{compiler.path }{compiler.ar.cmd}" "{archive_file_path}" "{object_file}" re4 {compiler.ar.flags} {compiler.ar.extra_flags}
10693
10794## Combine gc-sections, archives, and objects (re5)
108- #recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" re5 {compiler.c.elf.flags} -mstm8 -D{build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
109- # produziert ihx:
110- #recipe.c.combine.pattern="{compiler.path.emu}{compiler.c.elf.cmd}" "-L{runtime.platform.path}/STM8S_StdPeriph_Driver/lib" "-L{build.path}" "-L{compiler.ld.stdlib}" {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 -o "{build.path}/{build.project_name}.ihx"
111- # produziert elf:
112- #recipe.c.combine.pattern="{compiler.path.emu}{compiler.c.elf.cmd}" "-L{runtime.platform.path}/STM8S_StdPeriph_Driver/lib" "-L{build.path}" "-L{compiler.ld.stdlib}" {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"
113- recipe.c.combine.pattern="{compiler.path.emu}{compiler.c.elf.cmd}" "-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"
95+ recipe.c.combine.pattern="{compiler.wrapper.path}{compiler.c.elf.wrapper}" "{compiler.path}{compiler.c.elf.cmd}" "-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"
11496
11597# Soll-Wert:
11698#/opt/sdcc/bin/sdcc
@@ -145,17 +127,18 @@ recipe.size.regex=^(?:HOME|GSINIT|GSFINAL|CODE|INITIALIZER)\s+([0-9]+).*
145127recipe.size.regex.data=^(?:DATA|INITIALIZED)\s+([0-9]+).*
146128recipe.size.regex.eeprom=^(?:EEPROM)\s+([0-9]+).*
147129
148- ## Preprocessor
130+ ## Preprocessor (re11, re12)
149131#preproc.includes.flags=-w -x c++ -M -MG -MP
150132preproc.includes.flags=-M -MG -MP
151- recipe.preproc.includes="{compiler.path.emu }{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}"
133+ 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}"
152134
153135#preproc.macros.flags=-w -x c++ -E -CC
154136preproc.macros.flags=-E -MC
155137#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}"
156138#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}"
157139#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}"
158- 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}
140+ #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}
141+ 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}
159142
160143
161144# STlink/v2 Uploader
0 commit comments