ladybird/Meta/generate-embedded-resource-assembly.sh
William Marlow 39364bdda4 Build: Embed application icons directly in the executables.
New serenity_app() targets can be defined which allows application
icons to be emedded directly into the executable. The embedded
icons will then be used when creating an icon for that file in
LibGUI.
2020-12-21 00:12:59 +01:00

27 lines
481 B
Bash
Executable file

#!/bin/bash
set -e
if [ -z "$1" ]; then
echo "ERROR: No output file specified"
exit 1
fi
OUTPUT_FILE="$1"
shift
rm -f "${OUTPUT_FILE}"
while (( "$#" >= 2)); do
SECTION_NAME="$1"
INPUT_FILE="$2"
{
printf ' .section %s\n' "${SECTION_NAME}"
printf ' .type %s, @object\n' "${SECTION_NAME}"
printf ' .align 4\n'
printf ' .incbin "%s"\n' "${INPUT_FILE}"
printf '\n'
} >> "${OUTPUT_FILE}"
shift 2
done