summaryrefslogtreecommitdiff
path: root/bsp/phytium/aarch64/makefile
blob: d25db6c53cce7717a32c09de54daf126df6d518a (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.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_E2000Q_DEMO_BOARD
RTCONFIG := e2000q_demo
endif

ifdef CONFIG_E2000D_DEMO_BOARD
RTCONFIG := e2000d_demo
endif

ifdef CONFIG_TARGET_PHYTIUMPI
RTCONFIG := phytium_pi
endif

ifdef CONFIG_RT_USING_SMART
RTCONFIG := $(RTCONFIG)_rtsmart
else
RTCONFIG := $(RTCONFIG)_rtthread
endif

ifdef CONFIG_PHYTIUM_RTT_TEST
RTCONFIG := $(RTCONFIG)_test
endif

ifdef CONFIG_RT_CHERRYUSB_HOST_PUSB2
RTCONFIG := $(RTCONFIG)_pusb2_hc
endif

ifdef CONFIG_RT_CHERRYUSB_DEVICE_PUSB2
RTCONFIG := $(RTCONFIG)_pusb2_dc
endif

ifdef CONFIG_RT_CHERRYUSB_HOST_XHCI
RTCONFIG := $(RTCONFIG)_xhci
endif

boot:
	make all
	cp rtthread_a64.elf /mnt/d/tftpboot
	cp rtthread_a64.bin /mnt/d/tftpboot

debug:
	@$(OD) -D rtthread_a64.elf > rtthread_a64.asm
	@$(OD) -S rtthread_a64.elf > rtthread_a64.dis

all:
	@echo "Build started..."
	scons -j8

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_demo_rtsmart:
	@echo "Load configs from ./configs/e2000q_demo_rtsmart"
	@cp ./configs/e2000q_demo_rtsmart ./.config -f
	@cp ./configs/e2000q_demo_rtsmart.h ./rtconfig.h -f
	@scons -c

load_e2000q_demo_rtsmart_test:
	@echo "Load configs from ./configs/e2000q_demo_rtsmart_test"
	@cp ./configs/e2000q_demo_rtsmart_test ./.config -f
	@cp ./configs/e2000q_demo_rtsmart_test.h ./rtconfig.h -f
	@scons -c

load_e2000q_demo_rtthread:
	@echo "Load configs from ./configs/e2000q_demo_rtthread"
	@cp ./configs/e2000q_demo_rtthread ./.config -f
	@cp ./configs/e2000q_demo_rtthread.h ./rtconfig.h -f
	@scons -c

load_e2000q_demo_rtthread_test:
	@echo "Load configs from ./configs/e2000q_demo_rtthread_test"
	@cp ./configs/e2000q_demo_rtthread_test ./.config -f
	@cp ./configs/e2000q_demo_rtthread_test.h ./rtconfig.h -f
	@scons -c

load_e2000d_demo_rtsmart:
	@echo "Load configs from ./configs/e2000d_demo_rtsmart"
	@cp ./configs/e2000d_demo_rtsmart ./.config -f
	@cp ./configs/e2000d_demo_rtsmart.h ./rtconfig.h -f
	@scons -c

load_e2000d_demo_rtsmart_test:
	@echo "Load configs from ./configs/e2000d_demo_rtsmart_test"
	@cp ./configs/e2000d_demo_rtsmart_test ./.config -f
	@cp ./configs/e2000d_demo_rtsmart_test.h ./rtconfig.h -f
	@scons -c

load_e2000d_demo_rtthread:
	@echo "Load configs from ./configs/e2000d_demo_rtthread"
	@cp ./configs/e2000d_demo_rtthread ./.config -f
	@cp ./configs/e2000d_demo_rtthread.h ./rtconfig.h -f
	scons -c

load_e2000d_demo_rtthread_test:
	@echo "Load configs from ./configs/e2000d_demo_rtthread_test"
	@cp ./configs/e2000d_demo_rtthread_test ./.config -f
	@cp ./configs/e2000d_demo_rtthread_test.h ./rtconfig.h -f
	scons -c

load_e2000d_demo_rtthread_pusb2_dc:
	@echo "Load configs from ./configs/e2000d_demo_rtthread_pusb2_dc"
	@cp ./configs/e2000d_demo_rtthread_pusb2_dc ./.config -f
	@cp ./configs/e2000d_demo_rtthread_pusb2_dc.h ./rtconfig.h -f

load_e2000d_demo_rtthread_xhci:
	@echo "Load configs from ./configs/e2000d_demo_rtthread_xhci"
	@cp ./configs/e2000d_demo_rtthread_xhci ./.config -f
	@cp ./configs/e2000d_demo_rtthread_xhci.h ./rtconfig.h -f

load_phytium_pi_rtthread_pusb2_hc:
	@echo "Load configs from ./configs/phytium_pi_rtthread_pusb2_hc"
	@cp ./configs/phytium_pi_rtthread_pusb2_hc ./.config -f
	@cp ./configs/phytium_pi_rtthread_pusb2_hc.h ./rtconfig.h -f
	scons -c

load_phytium_pi_rtthread_xhic:
	@echo "Load configs from ./configs/phytium_pi_rtthread_xhci"
	@cp ./configs/phytium_pi_rtthread_xhci ./.config -f
	@cp ./configs/phytium_pi_rtthread_xhci.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
	@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