Add rule to generate raw.h file to test Makefile

This commit is contained in:
langerhans 2018-10-07 08:42:08 -07:00 committed by Ross Nicoll
parent 3e6fdbc076
commit 8c8ceb7dc1
1 changed files with 9 additions and 0 deletions

View File

@ -221,3 +221,12 @@ endif
echo "};};"; \
} > "$@.new" && mv -f "$@.new" "$@"
@echo "Generated $@"
%.raw.h: %.raw
@$(MKDIR_P) $(@D)
@{ \
echo "static unsigned const char $(*F)[] = {" && \
$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
echo "};"; \
} > "$@.new" && mv -f "$@.new" "$@"
@echo "Generated $@"