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 e85c0fdb90
commit 92a6d319a7

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 $@"