From 60d7e9401e1a0d6b66ef4919570c6a9a192e1ac4 Mon Sep 17 00:00:00 2001 From: Milan Vancura Date: Fri, 2 Jun 2017 00:37:03 +0200 Subject: [PATCH 1/2] Document how to setup Makefile for 3rd party boards --- HISTORY.md | 1 + .../Makefile-3rd_party-board.mk | 56 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 examples/MakefileExample/Makefile-3rd_party-board.mk diff --git a/HISTORY.md b/HISTORY.md index a987231..c35d3f8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -12,6 +12,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Fix: Fixed sed expression to properly format show_submenu (issue #488) (https://github.com/cbosdo) - New: Add support for good old cu as monitor command (issue #492) (https://github.com/mwm) - Tweak: Removed tilde from documentation (issue #497). (https://github.com/sej7278) +- New: Add a documentation how to setup Makefile for 3rd party boards (issue #499). (https://github.com/MilanV) ### 1.5.2 (2017-01-11) diff --git a/examples/MakefileExample/Makefile-3rd_party-board.mk b/examples/MakefileExample/Makefile-3rd_party-board.mk new file mode 100644 index 0000000..483fe4c --- /dev/null +++ b/examples/MakefileExample/Makefile-3rd_party-board.mk @@ -0,0 +1,56 @@ +### DISCLAIMER +### This is an example Makefile and it MUST be configured to suit your needs. +### For detailed explanations about all of the available options, please refer +### to https://github.com/sudar/Arduino-Makefile/blob/master/arduino-mk-vars.md + +### How to setup a project using a board definition provided by the 3rd party +### ========================================================================= + +### Some vendors provide definitions/configuration of their boards separately, +### as so-called addon packages. Originally, they are supposed to be used in +### the Arduino IDE but they can be used with Arduino-Makefile as well: + +### 1. get the package from the vendor +### if they provide .json file, look into it and take the URL of the package +### archive from there +### +### 2. extract the package into your ARDUINO_SKETCHBOOK directory +### you have to end with the directory structure like this, in your +### ARDUINO_SKETCHBOOK directory (sparkfun is the vendor name): + +### hardware/ +### ├── sparkfun/ +### │ └── avr/ +### │ ├── boards.txt +### │ ├── bootloaders/ +### │ ├── driver/ +### │ ├── platform.txt +### │ ├── signed_driver/ +### │ └── variants/ + +### 3. Create this Makefile (use your vendor/package name) + +### ALTERNATE_CORE = sparkfun +### include ~/Arduino-Makefile/Arduino.mk + +### 4. run 'make show_boards' +### check that you can see (only) boards provided by this vendor + +### 5. select the name of your board +### and add a line "BOARD_TAG = ...." to your Makefile + +### 6. if your board has more cpu variants, run 'make show_submenu' +### to see them; select your one and add a line "BOARD_SUB = ...." +### to your Makefile + +##### + +### The basic configuration should be done now. +### The example follows: + +ARDUINO_SKETCHBOOK = $(HOME)/sketchbook +ALTERNATE_CORE = sparkfun +BOARD_TAG = promicro +BOARD_SUB = 8MHzatmega32U4 +include $(ARDMK_DIR)/Arduino.mk + From 1b5494f2625a49ac069683516e2f9f033070c8c4 Mon Sep 17 00:00:00 2001 From: Milan Vancura Date: Fri, 2 Jun 2017 09:54:35 +0200 Subject: [PATCH 2/2] Fix paths in the example Makefile --- examples/MakefileExample/Makefile-3rd_party-board.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/MakefileExample/Makefile-3rd_party-board.mk b/examples/MakefileExample/Makefile-3rd_party-board.mk index 483fe4c..96e972c 100644 --- a/examples/MakefileExample/Makefile-3rd_party-board.mk +++ b/examples/MakefileExample/Makefile-3rd_party-board.mk @@ -31,7 +31,7 @@ ### 3. Create this Makefile (use your vendor/package name) ### ALTERNATE_CORE = sparkfun -### include ~/Arduino-Makefile/Arduino.mk +### include $(HOME)/Arduino-Makefile/Arduino.mk ### 4. run 'make show_boards' ### check that you can see (only) boards provided by this vendor @@ -52,5 +52,5 @@ ARDUINO_SKETCHBOOK = $(HOME)/sketchbook ALTERNATE_CORE = sparkfun BOARD_TAG = promicro BOARD_SUB = 8MHzatmega32U4 -include $(ARDMK_DIR)/Arduino.mk +include /usr/share/arduino/Arduino.mk