zephyr/scripts/Makefile.gen
Kumar Gala bc6c262122 build: Makefile.gen: reorder make rules to deal with greedy rule match
Some versions of make seem to more greedy about how they match
$(notdir %).inc vs $(notdir %).gz.inc.  If we put the gz.inc rule first
that seems to deal with the issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-09-28 09:29:34 -07:00

35 lines
1.1 KiB
Makefile

# vim: filetype=make
#
# Special rules to generate a file that can be included into a source file.
# ---------------------------------------------------------------------------
generated_inc_files = $(foreach f,$(generate_inc_file),$(notdir $(f)).inc)
generated_inc_gz_files = \
$(foreach f,$(generate_inc_gz_file),$(notdir $(f)).gz.inc)
$(notdir %).gz.inc: $(generate_inc_gz_file)
$(Q)${ZEPHYR_BASE}/scripts/file2hex.py --gzip --file $* > $@
$(notdir %).inc: $(generate_inc_file)
$(Q)${ZEPHYR_BASE}/scripts/file2hex.py --file $* > $@
PHONY += embed_inc_files
embed_inc_files: $(generated_inc_files)
PHONY += embed_inc_gz_files
embed_inc_gz_files: $(generated_inc_gz_files)
_embed_inc_files:
$(Q)$(MAKE) -C $(SRC) embed_inc_files Q=$(Q)
_embed_inc_gz_files:
$(Q)$(MAKE) -C $(SRC) embed_inc_gz_files Q=$(Q)
_remove_gen_files:
$(Q)rm -f $(SRC)/*.inc
PHONY += _embed_inc_files _embed_inc_gz_files _remove_gen_files
all: _embed_inc_files _embed_inc_gz_files
flash: _embed_inc_files _embed_inc_gz_files
run: _embed_inc_files _embed_inc_gz_files
pristine: _remove_gen_files