zephyr/scripts
Jukka Rissanen 0ff4c25958 build: Add rules in Makefile.gen to generate a hex file
This commit is useful if there is a need to generate a file
that can be included into the application at build time.
The file can also be compressed automatically when embedding it.

Files to be generated are listed in
     generate_inc_file
     generate_inc_gz_file
variables.

How to use this commit in your application:

1. Add this to your application Makefile

   SRC = $(ZEPHYR_BASE)/<your-app-dir>/src
   include $(ZEPHYR_BASE)/scripts/Makefile.gen

2. Add needed binary/other embedded files into src/Makefile
   to "generate_inc_file" or "generate_inc_gz_file" variables:

   # List of files that are used to generate a file that can be
   # included into .c file.
   generate_inc_file += \
           echo-apps-cert.der \
           echo-apps-key.der \
           file.bin

   generate_inc_gz_file += \
           index.html

   include $(ZEPHYR_BASE)/scripts/Makefile.gen

3. In the application, do something with the embedded file

   static const unsigned char inc_file[] = {
   #include "file.bin.inc"
   };

   static const unsigned char gz_inc_file[] = {
   #include "index.html.gz.inc"
   };

The generated files in ${SRC}/*.inc are automatically removed
when you do "make pristine"

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-18 14:56:16 -04:00
..
basic
checkpatch scripts: move checkpatch scripts to checkpatch/ 2017-09-11 08:53:56 -07:00
ci ci: compliance script should use python3 2017-09-12 19:01:58 -04:00
cross_compiler xtools: add new configurations for xtools 1.23 2017-05-31 14:54:34 -04:00
dts scripts/dts/extract_dts_includes.py: allow multiple fixup files 2017-09-17 17:34:38 -04:00
footprint scripts: move footprint scripts to footprint/ 2017-09-11 08:53:56 -07:00
gitlint gitlint: ignore titles prefixed with Revert 2017-08-08 09:04:25 -04:00
kconfig scripts: move kconfig related scripts to scripts/kconfig 2017-09-11 08:53:56 -07:00
sanity_chk cleanup: remove lots of references to unified kernel 2017-09-12 12:37:11 -04:00
support scripts: Run JLinkGDBServer in silent mode 2017-08-11 11:21:46 -04:00
.gitignore
check_link_map.py check_link_map: fix check for app memory 2017-06-29 07:46:58 -04:00
checkpatch.pl misc: remove MAINTAINERS file 2017-09-08 15:08:18 -04:00
checkstack.pl
file2hex.py build: Add rules in Makefile.gen to generate a hex file 2017-09-18 14:56:16 -04:00
filter-known-issues.py scripts: Fix string pattern on byte like objects error 2017-07-26 06:54:12 -04:00
gcc-version.sh
gen_gdt.py x86: implement userspace APIs 2017-09-12 12:46:36 -07:00
gen_idt.py scripts: add version check for pyelftools 2017-07-25 13:41:16 -04:00
gen_kobject_list.py kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
gen_mmu.py gen_mmu.py: Ignore 0-sized regions 2017-09-07 16:35:59 -07:00
gen_offset_header.py scripts: fix offset.h header guard 2017-08-01 15:05:13 -04:00
headerdep.pl
Kbuild.include Kbuild.include: add function for unquoting strings 2017-05-18 07:18:36 -04:00
make-ll
Makefile build: Fix distclean for gen_idt 2017-08-01 22:10:22 -04:00
Makefile.build
Makefile.clean
Makefile.extrawarn
Makefile.gen build: Add rules in Makefile.gen to generate a hex file 2017-09-18 14:56:16 -04:00
Makefile.headersinst
Makefile.help
Makefile.host
Makefile.lib build: allow user to specify DTC_OVERLAY_FILE directly 2017-07-31 09:21:46 -05:00
Makefile.modbuiltin
Makefile.qemu samples: net Documented QEMU_INSTANCE usage 2017-06-29 07:20:46 -04:00
Makefile.toolchain.espressif Support for Espressif SDK (ESP32, etc) 2017-06-21 12:35:49 -04:00
Makefile.toolchain.gccarmemb toolchain.gccarmemb: Fix support for where to find newlib 2017-06-08 14:52:49 -04:00
Makefile.toolchain.issm toolchains: add DTC to environment 2017-06-23 13:10:52 -05:00
Makefile.toolchain.riscv32
Makefile.toolchain.xcc xtensa: fix 'make debug' for xt-sim targets 2017-06-12 18:01:13 -04:00
Makefile.toolchain.xtools toolchains: add DTC to environment 2017-06-23 13:10:52 -05:00
Makefile.toolchain.zephyr Makefile.toolchain.zephyr: fix C++ on Xtensa 2017-06-06 20:37:11 -04:00
Makefile.xt-run emulation: fix path of ELF binary when running with xt-sim 2017-05-11 16:51:56 -04:00
Makefile.xtsc-run
mkmakefile
mksysmap
process_gperf.py kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
qemu-machine-hack.py
requirements.txt doc: add python pip requirements.txt 2017-07-22 14:04:20 -04:00
sanitycheck sanitycheck: save/load lists of filterd tests 2017-09-12 18:13:46 -04:00
spelling.txt scripts: updated spelling.txt file 2017-07-14 12:57:40 +03:00
tags.sh
timestamp
uncrustify.cfg
vercomp
waitpid