-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile
112 lines (92 loc) · 2.18 KB
/
Makefile
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
# SPDX-License-Identifier: GPL-2.0+
#
# Makefile for sunxi bootloader
#
TOPDIR=$(CURDIR)
SRCTREE=$(TOPDIR)
#Q: quit for compile
Q = @
ifeq ("$(origin V)", "command line")
VERBOSE=$(V)
endif
ifndef VERBOSE
VERBOSE=0
endif
ifeq ($(VERBOSE),1)
Q=
CMD_ECHO_SILENT := true
else
CMD_ECHO_SILENT := echo
endif
#P: platform: sun50iw3p1/sun8iw15p1 etc.
PLATFORM=NULL
ifeq ("$(origin p)", "command line")
PLATFORM=$(p)
endif
#ddr: compile module: dd3/lpddr3/ddr4/lpddr4
DRAM_TYPE=NULL
ifeq ("$(origin ddr)", "command line")
DRAM_TYPE=$(ddr)
DRAM_TYPE_NAME=_$(DRAM_TYPE)
endif
ifeq ("$(origin b)", "command line")
BOARD=$(b)
endif
CPU ?= armv7
#include config file
include $(TOPDIR)/mk/config.mk
include $(TOPDIR)/mk/checkconf.mk
include $(TOPDIR)/board/$(p)/common.mk
export Q TOPDIR SRCTREE CMD_ECHO_SILENT PLATFORM DRAM_TYPE_NAME CPU
define update-commit-info
sh $(SRCTREE)/tools/generate_hash_header_file.sh > \
$(SRCTREE)/include/commit_info.h.tmp
$(call mv-if-changed,$(SRCTREE)/include/commit_info.h.tmp,$(SRCTREE)/include/commit_info.h)
endef
MAKEFLAGS += --no-print-directory
all:
$(MAKE) boot0
$(MAKE) fes
boot0:
ifneq ($(wildcard $(TOPDIR)/board/$(PLATFORM)/mmc.mk),)
$(MAKE) mmc
endif
ifneq ($(wildcard $(TOPDIR)/board/$(PLATFORM)/nand.mk),)
$(MAKE) nand
endif
ifneq ($(wildcard $(TOPDIR)/board/$(PLATFORM)/spinor.mk),)
$(MAKE) spinor
endif
ifneq ($(wildcard $(TOPDIR)/board/$(PLATFORM)/sboot.mk),)
all: sboot
endif
fes: mkdepend
$(MAKE) -C $(SRCTREE)/fes $@
mmc nand spinor: mkdepend
$(MAKE) -C $(SRCTREE)/nboot $@
offline_secure_mmc offline_secure_nand offline_secure_spinor: mkdepend
$(MAKE) -C $(SRCTREE)/nboot $@
simulate: mkdepend
$(MAKE) -C $(SRCTREE)/nboot $@
sboot: mkdepend
$(MAKE) -C $(SRCTREE)/sboot $@
clean:
@find $(TOPDIR) -type f \
\( -name 'core' -o -name '*.bak' -o -name '*~' \
-o -name '*.o' -o -name '*.exe' -o -name '*.axf' \
-o -name '*.elf' \
-o -name '*.depend' \
-o -name '*.bin' \
-o -name '*.log' \
-o -name '*.map' \) \
-exec rm {} +
@rm -f $(TOPDIR)/fes/fes1.lds
@rm -f $(TOPDIR)/nboot/boot0.lds
@rm -f $(TOPDIR)/sboot/sboot.lds
distclean: clean
mkdepend:
$(call update-commit-info)
PHONY += FORCE
FORCE:
.PHONY: $(PHONY)