mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
28 lines
481 B
Bash
28 lines
481 B
Bash
|
#!/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
|