summaryrefslogtreecommitdiffstats
path: root/build/embed.sh
blob: 8d7d0f14347bd6040ad1e81480c1266a619eb957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

# Copyright © Tavian Barnes <tavianator@tavianator.com>
# SPDX-License-Identifier: 0BSD

# Convert data into a C array like #embed

set -eu

{ cat; printf '\0'; } \
    | od -An -tx1 \
    | sed 's/\([^ ][^ ]*\)/0x\1,/g'