blob: 431aab54f980c8d8cb766a0b6bbe3c5e41c666f8 [file] [log] [blame]
#!/bin/sh
# Copyright 2016 The Fuchsia Authors
if [ ! -e build-magenta-pc-x86-64/tools/sysgen ]; then
echo "sysgen binary not found. did you build magenta tools?"
echo "(ie., 'make tools')"
exit $?
fi
# remove any existing output.
rm -f generated.arm64.S
rm -f generated.kernel.h
rm -f generated.kernel.inc
rm -f generated.kernel-del.h
rm -f generated.kernel-del.inc
rm -f generated.user.h
rm -f generated.x86-64.S
rm -f generated.syscall-numbers.h
rm -f generated.trace.inc
# generate again
if ! ./build-magenta-pc-x86-64/tools/sysgen system/public/magenta/syscalls.sysgen; then
echo $0 "failed"
exit $?
fi
# copy to destination if changed (via rsync checksum option),
# and remove the original files.
rsync_options="-c --remove-source-files"
rsync $rsync_options generated.user.h \
system/public/magenta/gen-syscalls.h
rsync $rsync_options generated.x86-64.S \
system/ulib/magenta/gen-x86-64.S
rsync $rsync_options generated.arm64.S \
system/ulib/magenta/gen-arm64.S
rsync $rsync_options generated.syscall-numbers.h \
system/ulib/magenta/gen-syscall-numbers.h
rsync $rsync_options generated.kernel.h \
kernel/lib/magenta/include/magenta/gen-sysdefs.h
rsync $rsync_options generated.kernel.inc \
kernel/lib/magenta/include/magenta/gen-switch.inc
rsync $rsync_options generated.kernel-del.h \
kernel/lib/magenta/include/magenta/gen-del-sysdefs.h
rsync $rsync_options generated.kernel-del.inc \
kernel/lib/magenta/include/magenta/gen-del.inc
rsync $rsync_options generated.trace.inc \
kernel/lib/magenta/include/magenta/gen-trace.inc