From b23f1c9af8577c7026e742507d1012497ff0a16f Mon Sep 17 00:00:00 2001 From: Erik Strand <erik.strand@cba.mit.edu> Date: Sat, 8 Feb 2020 20:54:26 -0500 Subject: [PATCH] Add a README --- blink-cmake/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 blink-cmake/README.md diff --git a/blink-cmake/README.md b/blink-cmake/README.md new file mode 100644 index 0000000..aa063e7 --- /dev/null +++ b/blink-cmake/README.md @@ -0,0 +1,20 @@ +# Building with CMake + +This directory contains a `cmake` project for SAMD51, using `arm-none-eabi-gcc`. + +To compile, first make sure you have `cmake` version 3.13 or newer installed. You may need to +compile from source if your package manager is out of date. + +Next, create a build directory: `mkdir build`. All build artifacts will go here, so you won't end up +with a bunch of `.o` or `.elf` files hanging out next to your source code. + +Tell `cmake` to configure a build environment in your new directory: `cd build` then `cmake ..`. +This tells `cmake` to generate a `Makefile` for you. + +From here on out you can just use the `Makefile` like normal: `make` builds everything, or `make +<target>` builds a particular thing. The `Makefile` that `cmake` generates is even smart enough to +run the configuration step again automatically if it detects that you've modified any `cmake` config +files. + +Note that I haven't yet added targets that flash your board. The executable built by `cmake` is +`build/hello_world`; for now you need to load this manually. -- GitLab