Here are the general steps i use to compile AOSP Master for Dragonboard 410c.
First Download Kernel and a Toolchain
mkdir /root/DB-KERNEL/
cd /root/DB-KERNEL/
git clone Linaro Git Hosting -b release/android/qcomlt-4.14 db410c-kernel
cd /root/DB-KERNEL/db410c-kernel
mkdir /root/DB-KERNEL/Liarno-Toolchain
cd /root/DB-KERNEL/Liarno-Toolchain
wget http://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/aarch64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz
tar -xf gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz
SETUP TOOLCHAIN
export ARCH=arm64
cd /root/DB-KERNEL/Liarno-Toolchain
export PATH=$(pwd)/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/:$PATH
export CROSS_COMPILE=$(pwd)/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
aarch64-linux-gnu-gcc --version
MAKE KERNEL CONFIG (defconfig)
cd /root/DB-KERNEL/db410c-kernel/kernel/configs/
./android-fetch-configs.sh
cd /root/DB-KERNEL/db410c-kernel
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- qcom_defconfig android-recommended.config android-recommended-arm64.config android-base.config
THEN BUILD KERNEL
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j16
NEXT DOWNLOAD AOSP SOURCE
mkdir /root/AOSP
cd /root/AOSP
repo init -u https://android.googlesource.com/platform/manifest -b master
git clone https://android-git.linaro.org/git/platform/manifest.git .repo/local_manifests -b dragonboard
Copy Device tree and kernel to AOSP TREE
cd /root/DB-KERNEL/db410c-kernel
cat /root/DB-KERNEL/db410c-kernel/arch/arm64/boot/Image.gz /root/DB-KERNEL/db410c-kernel/arch/arm64/boot/dts/qcom/apq8016-sbc.dtb > db410c-qcomlt-4.14.gz-dtb
cp /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb-old
rm -rf /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb
cp db410c-qcomlt-4.14.gz-dtb /root/AOSP-DB/device/linaro/dragonboard-kernels/
USE AOSP TOOLCHIN TO BUILD AOSP
cd /root/AOSP/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/
export PATH=$(pwd)/bin/:$PATH
export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-
BUILD AOSP
cd /root/AOSP
source build/envsetup.sh
lunch db410c32_only-userdebug
make -j16