forked from kendryte/k230_sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse.mak
executable file
·68 lines (51 loc) · 2.14 KB
/
parse.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
ifeq ($(wildcard .config), .config)
include .config
else
include $(DEFCONFIG)
endif
# Strip quotes and then whitespaces
qstrip = $(strip $(subst ",,$(1)))
ifdef CONFIG_BUILD_RELEASE_VER
CONFIG_DBGLV := 0
endif
ifeq ("$(origin debug)", "command line")
CONFIG_DBGLV = $(debug)
endif
CONFIG_DBGLV ?=0
export KCFLAGS=-DDBGLV=$(CONFIG_DBGLV)
export RTT_CC := gcc
export RTT_CC_PREFIX := $(CONFIG_TOOLCHAIN_PREFIX_RTT)
export RTT_EXEC_PATH := $(CONFIG_TOOLCHAIN_PATH_RTT)
export LINUX_CC := gcc
export LINUX_CC_PREFIX := $(CONFIG_TOOLCHAIN_PREFIX_LINUX)
export LINUX_EXEC_PATH :=$(CONFIG_TOOLCHAIN_PATH_LINUX)
export MPP_BUILD_DIR := $(BUILD_DIR)/big/mpp
export RTT_SDK_BUILD_DIR := $(BUILD_DIR)/big/rt-smart
export BIG_OPENSBI_BUILD_DIR := $(BUILD_DIR)/common/big-opensbi
export LITTLE_OPENSBI_BUILD_DIR := $(BUILD_DIR)/common/little-opensbi
export CDK_BUILD_DIR := $(BUILD_DIR)/common/cdk
export LINUX_BUILD_DIR := $(BUILD_DIR)/little/linux
export BUILDROOT_BUILD_DIR := $(BUILD_DIR)/little/buildroot-ext
export UBOOT_BUILD_DIR := $(BUILD_DIR)/little/uboot
export IMAGE_DIR := $(BUILD_DIR)/images
CONFIG_BOARD_NAME_NO_QUOTES = $(call qstrip ,$(CONFIG_BOARD_NAME))
CONFIG_UBOOT_DEFCONFIG ?= $(CONFIG_BOARD_NAME_NO_QUOTES)
CONFIG_UBOOT_DEFCONFIG := $(call qstrip ,$(CONFIG_UBOOT_DEFCONFIG))
CONFIG_LINUX_DEFCONFIG ?= $(CONFIG_BOARD_NAME_NO_QUOTES)
CONFIG_LINUX_DEFCONFIG := $(call qstrip ,$(CONFIG_LINUX_DEFCONFIG))
LINUX_KERNEL_DEFCONFIG = $(CONFIG_LINUX_DEFCONFIG)_defconfig
UBOOT_DEFCONFIG =$(CONFIG_UBOOT_DEFCONFIG)_defconfig
BUILDROOT_DEFCONFIG = $(CONFIG_BOARD_NAME_NO_QUOTES)_defconfig
ifneq ($(CONFIG_DBGLV),0)
#debug version
ifneq ($(wildcard $(LINUX_SRC_PATH)/arch/riscv/configs/$(CONFIG_LINUX_DEFCONFIG)_d_defconfig),)
LINUX_KERNEL_DEFCONFIG = $(CONFIG_LINUX_DEFCONFIG)_d_defconfig
endif
ifneq ($(wildcard $(UBOOT_SRC_PATH)/configs/$(CONFIG_UBOOT_DEFCONFIG)_d_defconfig),)
UBOOT_DEFCONFIG = $(CONFIG_UBOOT_DEFCONFIG)_d_defconfig
endif
ifneq ($(wildcard $(BUILDROOT-EXT_SRC_PATH)/configs/$(CONFIG_BOARD_NAME_NO_QUOTES)_d_defconfig),)
BUILDROOT_DEFCONFIG = $(CONFIG_BOARD_NAME_NO_QUOTES)_d_defconfig
endif
endif
export UBOOT_DEFCONFIG