2019-12-10 13:03:47 +00:00
|
|
|
#!/bin/bash
|
2021-01-20 12:30:12 +00:00
|
|
|
|
2021-02-03 14:37:12 +00:00
|
|
|
# Author: Xianjun jiao
|
|
|
|
# SPDX-FileCopyrightText: 2019 UGent
|
2021-01-20 12:30:12 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2020-04-27 07:37:04 +00:00
|
|
|
if [ "$#" -ne 3 ]; then
|
|
|
|
echo "You must enter exactly 3 arguments: \$OPENWIFI_DIR \$XILINX_DIR ARCH_BIT(32 or 64)"
|
2019-12-10 13:03:47 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-03-04 18:39:12 +00:00
|
|
|
OPENWIFI_DIR=$1
|
|
|
|
XILINX_DIR=$2
|
2020-04-27 07:37:04 +00:00
|
|
|
ARCH_OPTION=$3
|
2020-03-04 18:39:12 +00:00
|
|
|
|
|
|
|
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
|
|
|
|
echo "\$OPENWIFI_DIR is found!"
|
|
|
|
else
|
|
|
|
echo "\$OPENWIFI_DIR is not correct. Please check!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$XILINX_DIR/SDK" ]; then
|
|
|
|
echo "\$XILINX_DIR is found!"
|
|
|
|
else
|
|
|
|
echo "\$XILINX_DIR is not correct. Please check!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-04-27 07:37:04 +00:00
|
|
|
if [ "$ARCH_OPTION" != "32" ] && [ "$ARCH_OPTION" != "64" ]; then
|
|
|
|
echo "\$ARCH_OPTION is not correct. Should be 32 or 64. Please check!"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "\$ARCH_OPTION is valid!"
|
|
|
|
fi
|
2020-03-04 18:39:12 +00:00
|
|
|
|
2020-04-27 07:37:04 +00:00
|
|
|
source $XILINX_DIR/SDK/2018.3/settings64.sh
|
|
|
|
if [ "$ARCH_OPTION" == "64" ]; then
|
|
|
|
LINUX_KERNEL_SRC_DIR=$OPENWIFI_DIR/adi-linux-64/
|
|
|
|
ARCH="arm64"
|
|
|
|
CROSS_COMPILE="aarch64-linux-gnu-"
|
2021-09-29 14:52:45 +00:00
|
|
|
echo "#define USE_NEW_RX_INTERRUPT 1" > pre_def.h
|
2019-12-10 13:03:47 +00:00
|
|
|
else
|
2020-04-27 07:37:04 +00:00
|
|
|
LINUX_KERNEL_SRC_DIR=$OPENWIFI_DIR/adi-linux/
|
|
|
|
ARCH="arm"
|
|
|
|
CROSS_COMPILE="arm-linux-gnueabihf-"
|
2021-09-29 14:52:45 +00:00
|
|
|
echo "#define USE_NEW_RX_INTERRUPT 1" > pre_def.h
|
2019-12-10 13:03:47 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# check if user entered the right path to analog device linux
|
2020-04-27 07:37:04 +00:00
|
|
|
if [ -d "$LINUX_KERNEL_SRC_DIR" ]; then
|
|
|
|
echo " setup linux kernel path ${LINUX_KERNEL_SRC_DIR}"
|
2019-12-10 13:03:47 +00:00
|
|
|
else
|
2020-04-27 07:37:04 +00:00
|
|
|
echo "Error: path to adi linux: ${LINUX_KERNEL_SRC_DIR} not found. Can not continue."
|
|
|
|
exit 1
|
2019-12-10 13:03:47 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-27 07:37:04 +00:00
|
|
|
set -x
|
|
|
|
|
2020-03-04 18:39:12 +00:00
|
|
|
home_dir=$(pwd)
|
2019-12-10 13:03:47 +00:00
|
|
|
|
2020-03-04 18:39:12 +00:00
|
|
|
cd $OPENWIFI_DIR/driver/
|
2020-09-04 08:57:04 +00:00
|
|
|
echo "#define GIT_REV 0x"$(git log -1 --pretty=%h) > git_rev.h
|
2020-04-27 07:37:04 +00:00
|
|
|
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
2020-03-04 18:39:12 +00:00
|
|
|
cd $OPENWIFI_DIR/driver/openofdm_tx
|
2020-04-27 07:37:04 +00:00
|
|
|
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
2020-03-04 18:39:12 +00:00
|
|
|
cd $OPENWIFI_DIR/driver/openofdm_rx
|
2020-04-27 07:37:04 +00:00
|
|
|
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
2020-03-04 18:39:12 +00:00
|
|
|
cd $OPENWIFI_DIR/driver/tx_intf
|
2020-04-27 07:37:04 +00:00
|
|
|
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
2020-03-04 18:39:12 +00:00
|
|
|
cd $OPENWIFI_DIR/driver/rx_intf
|
2020-04-27 07:37:04 +00:00
|
|
|
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
2020-03-04 18:39:12 +00:00
|
|
|
cd $OPENWIFI_DIR/driver/xpu
|
2020-04-27 07:37:04 +00:00
|
|
|
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
2021-05-05 14:44:39 +00:00
|
|
|
# cd $OPENWIFI_DIR/driver/ad9361
|
|
|
|
# make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
2019-12-10 13:03:47 +00:00
|
|
|
|
2020-03-04 18:39:12 +00:00
|
|
|
cd $home_dir
|