-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
98 lines (75 loc) · 2.1 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
export
CONFIG := $(wildcard .config)
ifneq ($(CONFIG),)
include $(CONFIG)
endif
subdirs-$(CONFIG_STATIC_APPS) := apps
subdirs-y += arch
subdirs-y += boards
subdirs-y += boot
subdirs-y += drivers
subdirs-y += fs
subdirs-y += kernel
subdirs-y += ldscripts
subdirs-y += lib
subdirs-y += loader
subdirs-y += mm
subdirs-y += third_party
subdirs-y += utils
linker_files = rnk.lds
dtb = rnk.dtb
ifeq (${MAKELEVEL}, 0)
KERNEL_BASE=$(shell pwd)
APPS_BASE=$(KERNEL_BASE)/apps
ARCH=arm
CC := $(CROSS_COMPILE)gcc
AS := $(CROSS_COMPILE)as
AR := $(CROSS_COMPILE)ar
LD := $(CROSS_COMPILE)ld
OBJCOPY := $(CROSS_COMPILE)objcopy
LDS := $(CROSS_COMPILE)gcc -E -P -C
DTC := $(KERNEL_BASE)/tools/dtc
CPP := cpp
MKDIR := mkdir -p
PYTHON := python3
RFLAT := $(KERNEL_BASE)/tools/rflat/rflat
DT_PARSER=$(KERNEL_BASE)/tools/dt_parser/dt_parser.py
ifdef DEBUGMAKE
else
PREFIX=@
endif
.PHONY: apps all clean
all: config.h
$(PREFIX)rm -f objects.lst
$(PREFIX)rm -f extra_objects.lst
$(PREFIX)$(MAKE) --no-print-directory -C tools -f Makefile.kernel dir=. all
clean:
$(PREFIX)$(MAKE) --no-print-directory -C tools -f Makefile.kernel dir=. $@
$(PREFIX)$(MAKE) --no-print-directory -C tools -f Makefile.apps dir=. $@
dist-clean: clean
$(PREFIX)$(RM) `find . -name *.d`
$(PREFIX)$(RM) `find . -name *.tmp`
%_defconfig:
$(PREFIX)cp arch/${ARCH}/configs/$@ .config
echo "Loading $@..."
config.h: .config
$(PREFIX)bash tools/generate_config.sh
menuconfig: $(KCONFIG)/kconfig-mconf
$(PREFIX)$(KCONFIG)/kconfig-mconf Kconfig
nconfig: $(KCONFIG)/kconfig-nconf
$(PREFIX)$(KCONFIG)/kconfig-nconf Kconfig
config: tools/kconfig-frontends/frontends/conf/conf
$(PREFIX)tools/kconfig-frontends/frontends/conf/conf Kconfig
tools/kconfig-frontends/bin/kconfig-%:
$(PREFIX)$(MAKE) -C ./tools/ $(subst tools/kconfig-frontends/bin/,,$@)
cscope:
$(PREFIX)echo "GEN " $@
$(PREFIX)cd $(KERNEL_BASE); cscope -b -q -k -R
%_tests:
$(PREFIX)$(MAKE) --no-print-directory -C tools -f Makefile.apps dir=$(APPS_BASE)/tests/$@ app=$@ all
%:
$(PREFIX)$(MAKE) --no-print-directory -C tools -f Makefile.apps dir=$(APPS_BASE)/$@ app=$@ all
endif
ifndef VERBOSE
.SILENT:
endif