-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
75 lines (58 loc) · 1.87 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
# SPDX-License-Identifier: GPL-2.0-or-later
# ==========================================================================
# System top
# ==========================================================================
include scripts/top.mk
include scripts/platform.mk
include scripts/compile.mk
#####################################
# Generic headers #
#####################################
asm-generic: FORCE
$(Q)$(MAKE) $(asm-generic)=arch/$(arch)/include/generated/asm \
generic=include/asm-generic
$(Q)$(MAKE) $(asm-generic)=arch/$(arch)/include/generated/lightcore/asm \
generic=include/lightcore/asm-generic
#####################################
# Devicetree files #
#####################################
dtstree = boot/dts
%dtb: scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
dtbs: scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree)
ifdef CONFIG_BUILTIN_DTB
build: dtbs
endif
#####################################
# Compiler #
#####################################
build/boot/kboot: build FORCE
build/boot/preload: asm-generic FORCE
kboot: build/boot/kboot FORCE
preload: build/boot/preload FORCE
tools: build/tools/kernelcrc build/tools/mkincbin FORCE
build: asm-generic scripts_basic tools FORCE
$(Q)$(MAKE) $(build)=$(srctree)
disk uboot: kboot preload FORCE
$(Q)$(MAKE) $(build)=$(srctree)/boot $@
ifdef CONFIG_PRELOAD
start: disk
else
start: uboot
endif
#####################################
# Run & Install #
#####################################
include $(srctree)/boot/run/config.mk
ckfile := $(objtree)/boot/kboot/boot.bin
ifeq ($(wildcard $(ckfile)),)
run install uninsall: FORCE
$(Q)$(ECHO) "Please run make first"
else
run: FORCE
$(Q)$(SHELL) $(srctree)/boot/run/$(run_shell)
install: FORCE
$(Q)$(SHELL) $(srctree)/boot/install.sh \
$(KERNELVERSION) $(KBOOT_IMAGE) $(INSTALL_PATH)
endif