#########################################################################
# Copyright (c) 2023, Anlogic Inc. and Contributors. All rights reserved.

# SPDX-License-Identifier: BSD-3-Clause
#########################################################################
DOWNLOAD = ddr


#########################################################################
# 1. define SDK_ROOT, BOARD info, CHIP, COMPILE_PREFIX
#########################################################################
SDK_ROOT ?= F:/Anlogic_FlyDragon/My_Prj/FlyDragon_AD7606_DSO/Prj/AD7606_DSO/FD/AD7606_DSO_bsp

CHIP ?= dr1m90

ifeq ($(CHIP), dr1m90)
COMPILE_PREFIX ?= ${FD_ROOT_PATH}/toolchain/gcc/aarch64/bin/aarch64-none-elf-
else
COMPILE_PREFIX ?= ${FD_ROOT_PATH}/toolchain/gcc/riscv/fpsoc/bin/riscv-nuclei-elf-
endif

#########################################################################
# 2. define SRC_DIR, INC_DIR, LD_LIBS, LIB_DIR
#    LD_LIBS: External library files that the app depends on
#    LIB_DIR: The path where the external library file resides
#    C_SRCS:   c sources for application
#    CXX_SRCS: cpp sources for application
#    ASM_SRCS: asm sources for application
#########################################################################

SRC_DIR += $(sort $(dir $(foreach dir, $(shell find "./" -type d), $(wildcard $(dir)/*.c))))

INC_DIR += $(sort $(dir $(foreach dir, $(shell find "./" -type d), $(wildcard $(dir)/*.h))))



LD_LIBS  =
LIB_DIR  =

CXX_SRCS :=
ASM_SRCS :=


#########################################################################
# 3. CFLAGS
#########################################################################
CFLAGS := -O2 -g


#########################################################################
# 4. PINMUX_MODE: sdk internal define, pinmux setting need to remove;
#    Fixme: where to add board init source files and headers files
#########################################################################
PLAT_DIR ?= $(SDK_ROOT)/platform


#########################################################################
# 5. define build target
#########################################################################
TARGET ?= HELLOWORLD


#########################################################################
# 6. define ARMv8_CORE for apu
#########################################################################
#{{ARMv8_CORE}}

#########################################################################
# 7. linker scripts
#########################################################################
LINKER_SCRIPT := ./lds/gcc_$(CHIP)_$(DOWNLOAD).ld


# include rules.mk
include $(SDK_ROOT)/tools/make/rules.mk

# vim: syntax=make
# vim: syntax=mak
