2021-04-02 02:53:19 +00:00
|
|
|
#
|
|
|
|
# Marlin Firmware
|
|
|
|
# PlatformIO Configuration File
|
|
|
|
#
|
|
|
|
|
|
|
|
#################################
|
|
|
|
# #
|
|
|
|
# Native / Simulation #
|
|
|
|
# #
|
|
|
|
#################################
|
|
|
|
|
|
|
|
#
|
|
|
|
# No supported Arduino libraries, base Marlin only
|
|
|
|
#
|
|
|
|
[env:linux_native]
|
2022-05-19 14:15:57 +00:00
|
|
|
platform = native
|
|
|
|
framework =
|
|
|
|
build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined
|
|
|
|
build_src_flags = -Wall -IMarlin/src/HAL/LINUX/include
|
|
|
|
build_unflags = -Wall
|
|
|
|
lib_ldf_mode = off
|
|
|
|
lib_deps =
|
|
|
|
build_src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
|
2021-07-22 00:01:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Native Simulation
|
|
|
|
# Builds with a small subset of available features
|
|
|
|
# Required system libraries: SDL2, SDL2-net, OpenGL, GLM
|
2023-01-08 05:03:29 +00:00
|
|
|
# sudo apt-get install python3-venv build-essential libsdl2-dev libsdl2-net-dev libglm-dev
|
2023-01-07 10:42:21 +00:00
|
|
|
# See https://docs.platformio.org/en/latest/platforms/native.html for more information
|
2021-07-22 00:01:23 +00:00
|
|
|
#
|
|
|
|
# Tested with Linux (Mint 20) : gcc [9.3.0, 10.2.0]: libsdl2-dev[2.0.10], libsdl2-net-dev[2.0.1], libglm-dev[0.9.9.7, 0.9.9.8]
|
|
|
|
#
|
2021-10-31 04:43:19 +00:00
|
|
|
# For VSCode debugging see buildroot/share/PlatformIO/debugging/launch.json
|
2021-07-22 00:01:23 +00:00
|
|
|
#
|
|
|
|
[simulator_common]
|
|
|
|
platform = native
|
|
|
|
framework =
|
2023-12-16 00:47:34 +00:00
|
|
|
build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS
|
|
|
|
-I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g
|
2023-02-12 03:29:32 +00:00
|
|
|
build_src_flags = -Wall -Wno-expansion-to-defined -Wno-deprecated-declarations -Wcast-align
|
2021-07-22 00:01:23 +00:00
|
|
|
release_flags = -g0 -O3 -flto
|
|
|
|
debug_build_flags = -fstack-protector-strong -g -g3 -ggdb
|
|
|
|
lib_compat_mode = off
|
2022-05-19 14:15:57 +00:00
|
|
|
build_src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
|
2021-07-22 00:01:23 +00:00
|
|
|
lib_deps = ${common.lib_deps}
|
2023-12-09 03:31:07 +00:00
|
|
|
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/8791f3ff43.zip
|
|
|
|
Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/c6b319f447.zip
|
|
|
|
LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/322fb5fc23.zip
|
2021-07-22 00:01:23 +00:00
|
|
|
extra_scripts = ${common.extra_scripts}
|
|
|
|
pre:buildroot/share/PlatformIO/scripts/simulator.py
|
|
|
|
|
|
|
|
[simulator_linux]
|
|
|
|
extends = simulator_common
|
|
|
|
build_flags = ${simulator_common.build_flags} -ldl -lpthread -lSDL2 -lSDL2_net -lGL
|
|
|
|
|
|
|
|
[env:simulator_linux_debug]
|
|
|
|
extends = simulator_linux
|
|
|
|
build_type = debug
|
|
|
|
|
|
|
|
[env:simulator_linux_release]
|
|
|
|
extends = simulator_linux
|
|
|
|
build_type = release
|
|
|
|
build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Simulator for macOS (MacPorts)
|
|
|
|
#
|
2022-07-12 18:25:36 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# MacPorts:
|
2022-10-21 20:41:51 +00:00
|
|
|
# sudo port install gcc12 glm libsdl2 libsdl2_net
|
2021-10-06 02:35:31 +00:00
|
|
|
#
|
2021-07-22 00:01:23 +00:00
|
|
|
# cd /opt/local/bin
|
2023-12-09 03:31:07 +00:00
|
|
|
# sudo rm gcc g++ cc ld
|
2022-10-21 20:41:51 +00:00
|
|
|
# sudo ln -s gcc-mp-12 gcc ; sudo ln -s g++-mp-12 g++ ; sudo ln -s g++ cc
|
2023-12-09 03:31:07 +00:00
|
|
|
# sudo ln -s ld-classic ld
|
2022-07-12 18:25:36 +00:00
|
|
|
# cd -
|
|
|
|
# rehash
|
2021-07-22 00:01:23 +00:00
|
|
|
#
|
|
|
|
# Use 'sudo port install mesa' to get a <GL/gl.h> if no Xcode is installed.
|
|
|
|
# If Xcode is installed be sure to run `xcode-select --install` first.
|
|
|
|
#
|
2022-07-12 18:25:36 +00:00
|
|
|
#==================================================================================
|
|
|
|
#
|
|
|
|
# Homebrew:
|
|
|
|
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
|
|
#
|
|
|
|
# brew install gcc@12 glm sdl2 sdl2_net
|
|
|
|
#
|
|
|
|
# cd /opt/homebrew/bin
|
|
|
|
# sudo rm -f gcc g++ cc
|
|
|
|
# sudo ln -s gcc-12 gcc ; sudo ln -s g++-12 g++ ; sudo ln -s g++ cc
|
|
|
|
# cd -
|
|
|
|
#
|
|
|
|
# Use 'brew install mesa' to get a <GL/gl.h> if no Xcode is installed.
|
|
|
|
# If Xcode is installed be sure to run `xcode-select --install` first.
|
|
|
|
#
|
|
|
|
|
2021-07-22 00:01:23 +00:00
|
|
|
[simulator_macos]
|
2022-07-03 00:31:27 +00:00
|
|
|
build_unflags = -lGL -fstack-protector-strong
|
2021-07-22 00:01:23 +00:00
|
|
|
build_flags =
|
|
|
|
-I/opt/local/include
|
|
|
|
-I/opt/local/include/freetype2
|
|
|
|
-I/opt/local/include/SDL2/
|
|
|
|
-L/opt/local/lib
|
|
|
|
-Wl,-framework,OpenGl
|
|
|
|
-Wl,-framework,CoreFoundation
|
|
|
|
-lSDL2
|
2022-07-03 00:31:27 +00:00
|
|
|
-fno-stack-protector
|
2021-07-22 00:01:23 +00:00
|
|
|
|
|
|
|
[env:simulator_macos_debug]
|
|
|
|
extends = env:simulator_linux_debug
|
|
|
|
build_flags = ${env:simulator_linux_debug.build_flags} ${simulator_macos.build_flags} -ggdb -Og -D_THREAD_SAFE
|
|
|
|
build_unflags = ${simulator_macos.build_unflags}
|
2022-05-06 00:11:59 +00:00
|
|
|
custom_verbose = 0
|
|
|
|
custom_gcc = g++
|
2021-07-22 00:01:23 +00:00
|
|
|
|
|
|
|
[env:simulator_macos_release]
|
|
|
|
extends = env:simulator_linux_release
|
|
|
|
build_flags = ${env:simulator_linux_release.build_flags} ${simulator_macos.build_flags}
|
|
|
|
build_unflags = ${simulator_macos.build_unflags}
|
2022-05-06 00:11:59 +00:00
|
|
|
custom_verbose = 0
|
|
|
|
custom_gcc = g++
|
2021-07-22 00:01:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Simulator for Windows 10
|
|
|
|
#
|
|
|
|
# MSYS2 mingw-w64-x86_64 with these packages:
|
2023-01-07 10:42:21 +00:00
|
|
|
# pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-glm mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-dlfcn
|
2021-07-22 00:01:23 +00:00
|
|
|
#
|
2023-01-07 10:42:21 +00:00
|
|
|
# Ensure the following paths have been added to the PATH system environment variable:
|
|
|
|
# C:\msys64\mingw64\bin, C:\msys64\ucrt64\bin, C:\msys64\usr\bin
|
|
|
|
#
|
|
|
|
|
2021-07-22 00:01:23 +00:00
|
|
|
[env:simulator_windows]
|
2022-07-12 18:25:36 +00:00
|
|
|
extends = simulator_common
|
2022-05-19 14:15:57 +00:00
|
|
|
build_src_flags = ${simulator_common.build_src_flags} -fpermissive
|
2023-12-16 00:47:34 +00:00
|
|
|
build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags}
|
|
|
|
-IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows
|
|
|
|
-ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp
|
2022-07-12 18:25:36 +00:00
|
|
|
build_type = debug
|