diff --git a/config.mk b/config.mk index e8c4f46f4c51a47909fe6b3fcb9d26a6b951f962..17ec10a4f7ee68184c0900effad0ca2a6f4d9b06 100644 --- a/config.mk +++ b/config.mk @@ -16,6 +16,6 @@ CFLAGS += -std=c99 -D_GNU_SOURCE -Wall -fPIC -I$(abspath .) -I$(abspath lib/gene CFLAGS += -DPACKAGE_VERSION="\"$(MAJOR).$(MINOR)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\"" RM := rm -f LN := ln -s -XXD ?= hexdump -v -e '/1 "0x%02X, " " "' +XXD := ./scripts/embed.sh INSTALL := install PYTHON := python diff --git a/scripts/embed.sh b/scripts/embed.sh new file mode 100755 index 0000000000000000000000000000000000000000..1f57b8741a925d4e58e54f8a838ccd9292a1bfdc --- /dev/null +++ b/scripts/embed.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +alias strip="sed -e 's/^[ ]*//g; s/[ ][ ]*/ /g; /^--/d; /^$/d'" +if hash xxd 2>/dev/null; then + xxd -i - < $1 | strip +else + hexdump -v -e '/1 "0x%02X, " " "' < $1 | strip +fi