toolchain: add a program for compiling ipc interface definitions
ifc can be used to compile .if files into self-contained header-only C libraries, which can be used to send/receive messages that conform to the described interface.
This commit is contained in:
@@ -10,7 +10,7 @@ fi
|
||||
|
||||
build_type=Debug
|
||||
source_dir=$(realpath $(dirname "$0"))
|
||||
native_build_dir=$source_dir/build-native
|
||||
toolchain_build_dir=$source_dir/build/toolchain
|
||||
target_build_dir=$source_dir/build
|
||||
sysroot_dir=$target_build_dir/sysroot
|
||||
|
||||
@@ -19,25 +19,35 @@ if [ ! -d "$source_dir/arch/$target_arch" ]; then
|
||||
exit -1
|
||||
fi
|
||||
|
||||
rm -rf $native_build_dir $target_build_dir
|
||||
mkdir -p $native_build_dir $target_build_dir
|
||||
rm -rf $toolchain_build_dir $target_build_dir
|
||||
mkdir -p $toolchain_build_dir $target_build_dir
|
||||
|
||||
pushd $native_build_dir > /dev/null
|
||||
pushd $toolchain_build_dir > /dev/null
|
||||
|
||||
cmake \
|
||||
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY="$native_build_dir/bin" \
|
||||
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY="$native_build_dir/lib" \
|
||||
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY="$native_build_dir/lib" \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DCMAKE_BUILD_TYPE=$build_type \
|
||||
$source_dir/kernel/tools
|
||||
$source_dir/toolchain
|
||||
|
||||
case $CMAKE_GENERATOR in
|
||||
Ninja)
|
||||
ninja
|
||||
;;
|
||||
"Unix Makefiles")
|
||||
make
|
||||
;;
|
||||
|
||||
*)
|
||||
make
|
||||
;;
|
||||
esac
|
||||
|
||||
popd
|
||||
|
||||
pushd $target_build_dir > /dev/null
|
||||
|
||||
cmake \
|
||||
-DBUILD_TOOLS_DIR=$native_build_dir/bin \
|
||||
-DBUILD_TOOLS_DIR=$toolchain_build_dir/bin \
|
||||
-DCMAKE_INSTALL_PREFIX=$sysroot_dir \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DTARGET_ARCH=$target_arch \
|
||||
|
||||
Reference in New Issue
Block a user