Init Commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export PATH=$PATH:"$HOME/beaglebone/<cross_compiler_path>/bin"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
export BBB_ROOTFS="${HOME}/raspberrypi/rootfs"
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/beagleboneblack"
|
||||
build_generator=""
|
||||
builddir="build-Debug-BBB"
|
||||
defines="LINUX_CROSS_COMPILE=ON"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
build_generator="MinGW Makefiles"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
build_generator="Unix Makefiles"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l "${builddir}" -d "${defines}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/beagleboneblack"
|
||||
build_generator=""
|
||||
builddir="build-Release-BBB"
|
||||
defines="LINUX_CROSS_COMPILE=ON"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
build_generator="MinGW Makefiles"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
build_generator="Unix Makefiles"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l "${builddir}" -d "${defines}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/beagleboneblack"
|
||||
build_generator=""
|
||||
builddir="build-Debug-BBB"
|
||||
defines="LINUX_CROSS_COMPILE=OFF"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
build_generator="MinGW Makefiles"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
build_generator="Unix Makefiles"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l "${builddir}" -d "${defines}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
Executable
+173
@@ -0,0 +1,173 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
@brief CMake configuration helper
|
||||
@details
|
||||
This script was written to have a portable way to perform the CMake configuration with various parameters on
|
||||
different OSes. It was first written for the FSFW Example, but could be adapted to be more generic
|
||||
in the future.
|
||||
|
||||
Run cmake_build_config.py --help to get more information.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
import shutil
|
||||
import stat
|
||||
|
||||
|
||||
def main():
|
||||
print("-- Python CMake build configurator utility --")
|
||||
|
||||
print("Parsing command line arguments..")
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Processing arguments for CMake build configuration."
|
||||
)
|
||||
parser.add_argument(
|
||||
"-o",
|
||||
"--osal",
|
||||
type=str,
|
||||
choices=["freertos", "linux", "rtems", "host"],
|
||||
help="FSFW OSAL. Valid arguments: host, linux, rtems, freertos",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-b",
|
||||
"--buildtype",
|
||||
type=str,
|
||||
choices=["debug", "release", "size", "reldeb"],
|
||||
help="CMake build type. Valid arguments: debug, release, size, reldeb (Release with Debug "
|
||||
"Information)",
|
||||
default="debug",
|
||||
)
|
||||
parser.add_argument("-l", "--builddir", type=str, help="Specify build directory.")
|
||||
parser.add_argument(
|
||||
"-g", "--generator", type=str, help="CMake Generator", choices=["make", "ninja"]
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--defines",
|
||||
help="Additional custom defines passed to CMake (supply without -D prefix!)",
|
||||
nargs="*",
|
||||
type=str,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-t",
|
||||
"--target-bsp",
|
||||
type=str,
|
||||
help="Target BSP, combination of architecture and machine",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
print("Determining source location..")
|
||||
source_location = determine_source_location()
|
||||
print(f"Determined source location: {source_location}")
|
||||
|
||||
print("Building cmake configuration command..")
|
||||
|
||||
if args.osal is None:
|
||||
print("No FSFW OSAL specified, setting to default (host)..")
|
||||
osal = "host"
|
||||
else:
|
||||
osal = args.osal
|
||||
|
||||
if args.generator is None:
|
||||
generator_cmake_arg = ""
|
||||
else:
|
||||
if args.generator == "make":
|
||||
if os.name == "nt":
|
||||
generator_cmake_arg = '-G "MinGW Makefiles"'
|
||||
else:
|
||||
generator_cmake_arg = '-G "Unix Makefiles"'
|
||||
elif args.generator == "ninja":
|
||||
generator_cmake_arg = "-G Ninja"
|
||||
else:
|
||||
generator_cmake_arg = args.generator
|
||||
|
||||
if args.buildtype == "debug":
|
||||
cmake_build_type = "Debug"
|
||||
elif args.buildtype == "release":
|
||||
cmake_build_type = "Release"
|
||||
elif args.buildtype == "size":
|
||||
cmake_build_type = "MinSizeRel"
|
||||
else:
|
||||
cmake_build_type = "RelWithDebInfo"
|
||||
|
||||
if args.target_bsp is not None:
|
||||
cmake_target_cfg_cmd = f'-DTGT_BSP="{args.target_bsp}"'
|
||||
else:
|
||||
cmake_target_cfg_cmd = ""
|
||||
|
||||
define_string = ""
|
||||
if args.defines is not None:
|
||||
define_list = args.defines[0].split()
|
||||
for define in define_list:
|
||||
define_string += f"-D{define} "
|
||||
|
||||
build_folder = cmake_build_type
|
||||
if args.builddir is not None:
|
||||
build_folder = args.builddir
|
||||
|
||||
build_path = source_location + os.path.sep + build_folder
|
||||
if os.path.isdir(build_path):
|
||||
remove_old_dir = input(
|
||||
f"{build_folder} folder already exists. Remove old directory? [y/n]: "
|
||||
)
|
||||
if str(remove_old_dir).lower() in ["yes", "y", 1]:
|
||||
remove_old_dir = True
|
||||
else:
|
||||
build_folder = determine_new_folder()
|
||||
build_path = source_location + os.path.sep + build_folder
|
||||
remove_old_dir = False
|
||||
if remove_old_dir:
|
||||
rm_build_dir(build_path)
|
||||
os.chdir(source_location)
|
||||
os.mkdir(build_folder)
|
||||
print(f"Navigating into build directory: {build_path}")
|
||||
os.chdir(build_folder)
|
||||
|
||||
cmake_command = (
|
||||
f'cmake {generator_cmake_arg} -DFSFW_OSAL="{osal}" '
|
||||
f'-DCMAKE_BUILD_TYPE="{cmake_build_type}" {cmake_target_cfg_cmd} '
|
||||
f"{define_string} {source_location}"
|
||||
)
|
||||
# Remove redundant spaces
|
||||
cmake_command = " ".join(cmake_command.split())
|
||||
print("Running CMake command: ")
|
||||
print(f'" {cmake_command} "')
|
||||
os.system(cmake_command)
|
||||
print("-- CMake configuration done. --")
|
||||
|
||||
|
||||
def rm_build_dir(path: str):
|
||||
# On windows the permissions of the build directory may have been set to read-only. If this
|
||||
# is the case the permissions are changed before trying to delete the directory.
|
||||
if not os.access(path, os.W_OK):
|
||||
os.chmod(path, stat.S_IWUSR)
|
||||
shutil.rmtree(path)
|
||||
|
||||
|
||||
def determine_source_location() -> str:
|
||||
index = 0
|
||||
while not os.path.isdir("fsfw"):
|
||||
index += 1
|
||||
os.chdir("..")
|
||||
if index >= 5:
|
||||
print(
|
||||
"Error: Could not find source directory (determined by looking for fsfw folder!)"
|
||||
)
|
||||
sys.exit(1)
|
||||
return os.getcwd()
|
||||
|
||||
|
||||
def determine_new_folder() -> str:
|
||||
new_folder = input(f"Use different folder name? [y/n]: ")
|
||||
if str(new_folder).lower() in ["yes", "y", 1]:
|
||||
new_folder_name = input("New folder name: ")
|
||||
return new_folder_name
|
||||
else:
|
||||
print("Aborting configuration.")
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Script to set path to raspberry pi toolchain
|
||||
# Run script with: source egse_path_helper_win.sh
|
||||
TOOLCHAIN_PATH="/c/SysGCC/raspberry/bin"
|
||||
if [ $# -eq 1 ];then
|
||||
export PATH=$PATH:"$1"
|
||||
else
|
||||
export PATH=$PATH:$TOOLCHAIN_PATH
|
||||
fi
|
||||
|
||||
echo "Path of toolchain set to $TOOLCHAIN_PATH"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
export RASPBERRY_VERSION="4"
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/egse"
|
||||
build_generator="make"
|
||||
build_dir="build-Debug-egse"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
root_dir=""
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
root_dir=$(realpath "../..")
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
root_dir=${EIVE_OBSW_ROOT}
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="host"
|
||||
builddir="cmake-build-debug"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
set +x
|
||||
cd ${root_dir}/${builddir}
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
root_dir=$(realpath "../..")
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="host"
|
||||
builddir="cmake-build-release"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
set +x
|
||||
cd ${root_dir}/${builddir}
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
os_fsfw="host"
|
||||
builddir="cmake-build-debug"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="linux"
|
||||
builddir="cmake-build-debug"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="Unix Makefiles"
|
||||
os_fsfw="linux"
|
||||
builddir="cmake-build-release"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
os_fsfw="linux"
|
||||
builddir="cmake-build-debug"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
||||
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [ -z "${EIVE_OBSW_ROOT}" ]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_defs="EIVE_Q7S_EM=ON"
|
||||
fi
|
||||
|
||||
build_defs="${build_defs} CMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="cmake-build-debug-q7s"
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_dir="${build_dir}-em"
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}" -d "${build_defs}"
|
||||
set +x
|
||||
|
||||
cd ${init_dir}
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [[ -z ${EIVE_OBSW_ROOT} ]]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_defs="EIVE_Q7S_EM=ON"
|
||||
fi
|
||||
|
||||
build_defs="${build_defs} CMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="cmake-build-release-q7s"
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_dir="${build_dir}-em"
|
||||
fi
|
||||
build_generator="make"
|
||||
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}" -d "${build_defs}"
|
||||
set +x
|
||||
|
||||
cd ${init_dir}
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="build-Release-Q7S"
|
||||
build_generator=""
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
build_generator="MinGW Makefiles"
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
build_generator="Unix Makefiles"
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "size" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [[ -z ${EIVE_OBSW_ROOT} ]]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_defs="EIVE_Q7S_EM=ON"
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="cmake-build-debug-q7s"
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_dir="${build_dir}-em"
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l "${build_dir}" -d "${build_defs}"
|
||||
set +x
|
||||
|
||||
cd ${init_dir}
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
init_dir=$(pwd)
|
||||
if [[ -z ${EIVE_OBSW_ROOT} ]]; then
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_defs="EIVE_Q7S_EM=ON"
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="cmake-build-release-q7s"
|
||||
if [ ! -z "${EIVE_Q7S_EM}" ]; then
|
||||
build_dir="${build_dir}-em"
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}" -d "${build_defs}"
|
||||
set +x
|
||||
|
||||
cd ${init_dir}
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/raspberrypi"
|
||||
build_generator="make"
|
||||
build_dir="build-Debug-RPi"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/raspberrypi"
|
||||
build_generator=""
|
||||
build_dir="build-Release-RPi"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
build_generator="MinGW Makefiles"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
build_generator="Unix Makefiles"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/raspberrypi"
|
||||
build_generator="ninja"
|
||||
build_dir="build-Debug-RPi"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
# This script can be used to set the path to the cross-compile toolchain
|
||||
# A default path is set if the path is not supplied via command line
|
||||
if [ $# -eq 1 ];then
|
||||
export PATH=$PATH:"$1"
|
||||
else
|
||||
# TODO: make version configurable via shell argument
|
||||
export PATH=$PATH:"/opt/cross-pi-gcc/bin"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
export RASPBERRY_VERSION="4"
|
||||
export RASPBIAN_ROOTFS="${HOME}/raspberrypi/rootfs"
|
||||
fi
|
||||
|
||||
# It is also recommended to set up a custom shell script to perform the
|
||||
# sysroot synchronization so that any software is built with the library and
|
||||
# headers of the Raspberry Pi. This can for example be dome with the rsync
|
||||
# command.
|
||||
# The following command can be used, <ip-address> and the local
|
||||
# <rootfs-path> need to be set accordingly.
|
||||
|
||||
# rsync -vR --progress -rl --delete-after --safe-links pi@<ip-address>:/{lib,usr,opt/vc/lib} <rootfs-path>
|
||||
|
||||
# It is recommended to use $HOME/raspberrypi/rootfs as the rootfs path,
|
||||
# so the default RASPBIAN_ROOTFS variable set in the CMakeLists.txt is correct.
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# This script can be used to set the path to the cross-compile toolchain
|
||||
# A default path is set if the path is not supplied via command line
|
||||
if [ $# -eq 1 ];then
|
||||
export PATH=$PATH:"$1"
|
||||
else
|
||||
# TODO: make version configurable via shell argument
|
||||
export PATH=$PATH:"/c/SysGCC/raspberry/bin"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
export RASPBERRY_VERSION="4"
|
||||
export RASPBIAN_ROOTFS="/c/Users/<UserName>/raspberrypi/rootfs"
|
||||
fi
|
||||
|
||||
# It is also recommended to set up a custom shell script to perform the
|
||||
# sysroot synchronization so that any software is built with the library and
|
||||
# headers of the Raspberry Pi. This can for example be dome with the rsync
|
||||
# command.
|
||||
# The following command can be used, <ip-address> and the local
|
||||
# <rootfs-path> need to be set accordingly.
|
||||
|
||||
# rsync -vR --progress -rl --delete-after --safe-links pi@<ip-address>:/{lib,usr,opt/vc/lib} <rootfs-path>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/te0720-1cfa"
|
||||
build_generator="make"
|
||||
build_dir="build-Debug-te0720-1cfa"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
# Run with: source q7s-env-win-sh [OPTIONS]
|
||||
function help () {
|
||||
echo "source q7s-env-win-sh [options] -t|--toolchain=<toolchain path> -s|--sysroot=<sysroot path>"
|
||||
}
|
||||
|
||||
TOOLCHAIN_PATH="/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
|
||||
SYSROOT="/c/Users/${USER}/eive-software/sysroots-petalinux-2019-2/cortexa9t2hf-neon-xilinx-linux-gnueabi"
|
||||
|
||||
for i in "$@"; do
|
||||
case $i in
|
||||
-t=*|--toolchain=*)
|
||||
TOOLCHAIN_PATH="${i#*=}"
|
||||
shift
|
||||
;;
|
||||
-s=*|--sysroot=*)
|
||||
SYSROOT="${i#*=}"
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
help
|
||||
shift
|
||||
;;
|
||||
-*|--*)
|
||||
echo "Unknown option $i"
|
||||
help
|
||||
return
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -d "$TOOLCHAIN_PATH" ]; then
|
||||
export PATH=$PATH:"/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
echo "Set toolchain path to /c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
|
||||
else
|
||||
echo "Toolchain path $TOOLCHAIN_PATH does not exist"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -d "$SYSROOT" ]; then
|
||||
export ZYNQ_7020_SYSROOT=$SYSROOT
|
||||
echo "Set sysroot path to $SYSROOT"
|
||||
else
|
||||
echo "Sysroot path $SYSROOT does not exist"
|
||||
return
|
||||
fi
|
||||
Reference in New Issue
Block a user