21 lines
762 B
Bash
Executable File
21 lines
762 B
Bash
Executable File
#!/bin/bash
|
|
|
|
source_dir=$1
|
|
build_dir=$2
|
|
platform=$3
|
|
machine=$4
|
|
|
|
echo "Building $machine-$platform sysroot"
|
|
mkdir -p $build_dir/sysroot/usr/include/{sys,machine}
|
|
|
|
cp $source_dir/photon/libc/include/*.h $build_dir/sysroot/usr/include
|
|
|
|
platform_headers=$(find $source_dir/photon/libc/sys/$platform -type f \( -iname "*.h" ! -iname "__*" \))
|
|
cp -t $build_dir/sysroot/usr/include/sys $platform_headers
|
|
|
|
machine_arch_headers=$(find $source_dir/photon/libc/machine/$machine/ \
|
|
-type f \( -iname "*.h" ! -iname "__*" \))
|
|
machine_generic_headers=$(find $source_dir/photon/libc/include/machine/ \
|
|
-type f \( -iname "*.h" ! -iname "__*" \))
|
|
cp -t $build_dir/sysroot/usr/include/machine $machine_generic_headers $machine_arch_headers
|