Example command line build environment for Gamebuino-classic projects without needing the Arduino IDE when using Linux or MacOS.
This git repo uses submodules, so to clone a copy use...
git clone --recurse-submodules https://github.com/AnotherJohnH/HelloGamebuino.git
- gcc-avr
- libc-avr
- cmake (at least v3.11.4)
-
The
gcc-avr
andlibc-avr
dependencies can be satisfied by an install of the Arduino IDE. If this approach is taken then theARDUINO_ROOT
path needs to be set in Makefile so that$(ARDUINO_ROOT)/tools/avr/bin
can be added to$PATH
. -
The Makefile should also be edited to contain the expected path for the SD card when mounted.
To build HELLO.HEX
from hello.cpp
...
make
To clean away the build directory...
make clean
To copy HELLO.HEX
to an SD card...
make send
- In Makefile change
<NAME>
in the lineEXECUTABLE = <NAME>
- In CMakeLists.txt change
<NAME>
and<source>
in the lineadd_executable(<NAME> <source> ${GB_SRC})
NOTE: In an attempt to make C/C++ easier to use the Arduino IDE supports .ino
files. These are
similar to normal C/C++ files but are pre-processed to auto-generate the declarations that would normally
be necessary when splitting a project across multiple source files. .ino
files are not supported by this
build framework so .cpp
, .c
and .h
files must be used and will be treated in the normal way.
See the Wiki