2023-05-11 10:25:21 +08:00
|
|
|
.PHONY: debug boot all clean menuconfig
|
|
|
|
|
|
|
|
CC = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)gcc
|
|
|
|
CXX = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)g++
|
|
|
|
CPP = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)gcc -E -P -x c
|
|
|
|
STRIP = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)strip --strip-unneeded
|
|
|
|
OBJCOPY = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)objcopy
|
|
|
|
OBJDUMP = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)objdump
|
|
|
|
LD = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)ld
|
|
|
|
AR = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)ar rcs
|
|
|
|
NM = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)nm
|
|
|
|
OD = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)objdump
|
|
|
|
RTCONFIG =
|
|
|
|
|
|
|
|
include .config
|
|
|
|
|
|
|
|
ifdef CONFIG_TARGET_E2000Q
|
|
|
|
RTCONFIG := e2000q
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_TARGET_E2000D
|
|
|
|
RTCONFIG := e2000d
|
|
|
|
endif
|
|
|
|
|
2023-08-29 10:27:54 +08:00
|
|
|
ifdef CONFIG_TARGET_PHYTIUMPI
|
|
|
|
RTCONFIG := phytium_pi
|
|
|
|
endif
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
ifdef CONFIG_RT_USING_SMART
|
|
|
|
RTCONFIG := $(RTCONFIG)_rtsmart
|
|
|
|
else
|
|
|
|
RTCONFIG := $(RTCONFIG)_rtthread
|
|
|
|
endif
|
|
|
|
|
2023-08-02 13:27:09 +08:00
|
|
|
ifdef CONFIG_PHYTIUM_RTT_TEST
|
|
|
|
RTCONFIG := $(RTCONFIG)_test
|
|
|
|
endif
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
boot:
|
|
|
|
make all
|
|
|
|
cp rtthread_a64.elf /mnt/d/tftboot
|
|
|
|
cp rtthread_a64.bin /mnt/d/tftboot
|
|
|
|
|
|
|
|
debug:
|
|
|
|
@$(OD) -D rtthread_a64.elf > rtthread_a64.asm
|
|
|
|
@$(OD) -S rtthread_a64.elf > rtthread_a64.dis
|
|
|
|
|
|
|
|
all:
|
|
|
|
@echo "Build started..."
|
|
|
|
scons -j1024
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Cleaning..."
|
|
|
|
scons -c
|
|
|
|
|
|
|
|
menuconfig:
|
|
|
|
@echo "Running menuconfig..."
|
|
|
|
scons --menuconfig
|
|
|
|
|
|
|
|
saveconfig:
|
|
|
|
@echo "Save configs to" ./configs/$(RTCONFIG)
|
|
|
|
@cp ./.config ./configs/$(RTCONFIG) -f
|
|
|
|
@cp ./rtconfig.h ./configs/$(RTCONFIG).h -f
|
|
|
|
|
|
|
|
load_e2000q_rtsmart:
|
|
|
|
@echo "Load configs from ./configs/e2000q_rtsmart"
|
|
|
|
@cp ./configs/e2000q_rtsmart ./.config -f
|
|
|
|
@cp ./configs/e2000q_rtsmart.h ./rtconfig.h -f
|
|
|
|
@scons -c
|
|
|
|
|
2023-08-02 13:27:09 +08:00
|
|
|
load_e2000q_rtsmart_test:
|
|
|
|
@echo "Load configs from ./configs/e2000q_rtsmart"
|
|
|
|
@cp ./configs/e2000q_rtsmart_test ./.config -f
|
|
|
|
@cp ./configs/e2000q_rtsmart_test.h ./rtconfig.h -f
|
|
|
|
@scons -c
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
load_e2000q_rtthread:
|
|
|
|
@echo "Load configs from ./configs/e2000q_rtthread"
|
|
|
|
@cp ./configs/e2000q_rtthread ./.config -f
|
|
|
|
@cp ./configs/e2000q_rtthread.h ./rtconfig.h -f
|
|
|
|
@scons -c
|
|
|
|
|
2023-08-02 13:27:09 +08:00
|
|
|
load_e2000q_rtthread_test:
|
|
|
|
@echo "Load configs from ./configs/e2000q_rtthread"
|
|
|
|
@cp ./configs/e2000q_rtthread_test ./.config -f
|
|
|
|
@cp ./configs/e2000q_rtthread_test.h ./rtconfig.h -f
|
|
|
|
@scons -c
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
load_e2000d_rtsmart:
|
|
|
|
@echo "Load configs from ./configs/e2000d_rtsmart"
|
|
|
|
@cp ./configs/e2000d_rtsmart ./.config -f
|
|
|
|
@cp ./configs/e2000d_rtsmart.h ./rtconfig.h -f
|
|
|
|
@scons -c
|
|
|
|
|
2023-08-02 13:27:09 +08:00
|
|
|
load_e2000d_rtsmart_test:
|
|
|
|
@echo "Load configs from ./configs/e2000d_rtsmart"
|
|
|
|
@cp ./configs/e2000d_rtsmart_test ./.config -f
|
|
|
|
@cp ./configs/e2000d_rtsmart_test.h ./rtconfig.h -f
|
|
|
|
@scons -c
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
load_e2000d_rtthread:
|
|
|
|
@echo "Load configs from ./configs/e2000d_rtthread"
|
|
|
|
@cp ./configs/e2000d_rtthread ./.config -f
|
|
|
|
@cp ./configs/e2000d_rtthread.h ./rtconfig.h -f
|
|
|
|
@scons -c
|
2023-08-02 13:27:09 +08:00
|
|
|
|
|
|
|
load_e2000d_rtthread_test:
|
|
|
|
@echo "Load configs from ./configs/e2000d_rtthread"
|
|
|
|
@cp ./configs/e2000d_rtthread_test ./.config -f
|
|
|
|
@cp ./configs/e2000d_rtthread_test.h ./rtconfig.h -f
|
2023-08-29 10:27:54 +08:00
|
|
|
@scons -c
|
|
|
|
|
|
|
|
load_phytium_pi_rtthread:
|
|
|
|
@echo "Load configs from ./configs/phytium_pi_rtthread"
|
|
|
|
@cp ./configs/phytium_pi_rtthread ./.config -f
|
|
|
|
@cp ./configs/phytium_pi_rtthread.h ./rtconfig.h -f
|
|
|
|
scons -c
|
|
|
|
|
|
|
|
load_phytium_pi_rtsmart:
|
|
|
|
@echo "Load configs from ./configs/phytium_pi_rtsmart"
|
|
|
|
@cp ./configs/phytium_pi_rtsmart ./.config -f
|
|
|
|
@cp ./configs/phytium_pi_rtsmart.h ./rtconfig.h -f
|
2023-08-02 13:27:09 +08:00
|
|
|
@scons -c
|