[riot-notifications] [RIOT-OS/RIOT] makefiles/blobs: Add rules for binary blob embedding. (#11497)

Juan I Carrano notifications at github.com
Tue May 7 16:22:28 CEST 2019


### Contribution description

This PR adds a new makefile module for embedding raw binary data intoexecutables. These is useful for including resources such as graphics (for UIs), certificates, crypto keys, scripts, etc.

Previously such a global rule did not exist and people had to resort to either provide a pre-generated C-file with an array or hand-craft a (header) file with xxd. The advantage of the new rules are:

- No additional tools required (uses only the toolchain's tools)
- Declared data types are easy to configure (no sed magic.)
- No arrays in headers.
- Output section is configurable (this makes it possible to include code, not only data.)

### Testing procedure

I migrated the two Lua examples to the new system. They should compile and run without problems.

### Issues/PRs references

Partial alternative to #9565.
See, for example, this file: https://github.com/RIOT-OS/RIOT/pull/10308/files#diff-09ce13303248a398e36e3febb371129a
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11497

-- Commit Summary --

  * makefiles: Add LD variable (for the linker).
  * makefiles/blobs: Add rules for binary blob embedding.
  * examples/lua*: Use the blob functionality for including scripts.

-- File Changes --

    M Makefile.include (2)
    M examples/lua_REPL/Makefile (26)
    M examples/lua_REPL/main.c (2)
    M examples/lua_basic/Makefile (26)
    M examples/lua_basic/main.c (2)
    A makefiles/blobs.inc.mk (154)
    M makefiles/toolchain/gnu.inc.mk (1)
    M makefiles/toolchain/llvm.inc.mk (1)
    M makefiles/vars.inc.mk (1)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11497.patch
https://github.com/RIOT-OS/RIOT/pull/11497.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11497
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190507/c0cedce6/attachment.html>


More information about the notifications mailing list