-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
68 lines (59 loc) · 1.36 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
BOGUS_TARGETS := FORCE makefile .config
-include .config
ifeq ($(CONFIG_MIPS),y)
export ARCH := mips
else
ifeq ($(CONFIG_ARM),y)
export ARCH := arm
endif
endif
# don't override the build target name if an external module source
# directory was specified
EXT_MODULE_BUILD := n
ifdef KBUILD_EXTMOD
EXT_MODULE_BUILD := y
endif
ifdef M
EXT_MODULE_BUILD := y
endif
.PHONY: default
default::
ifeq ($(EXT_MODULE_BUILD),y)
$(MAKE) -f Makefile
else
ifeq ($(ARCH),mips)
$(MAKE) -f Makefile vmlinux
gzip < vmlinux > vmlinuz
else
ifeq ($(ARCH),arm)
$(MAKE) -f Makefile zImage
ifeq ($(CONFIG_ARM_APPENDED_DTB),y)
rm -f arch/arm/boot/*.dtb
$(MAKE) -f Makefile dtbs
cat arch/arm/boot/zImage arch/arm/boot/*.dtb > vmlinuz
else
cp arch/arm/boot/zImage vmlinuz
endif
else
$(MAKE) -f Makefile
endif
endif
endif
.PHONY: %_defconfig
%_defconfig::
@if [ -e arch/mips/configs/$@ ]; then \
$(MAKE) -f Makefile $@ ARCH=mips || exit 1; \
elif [ -e arch/arm/configs/$@ ]; then \
$(MAKE) -f Makefile $@ ARCH=arm || exit 1; \
else \
$(MAKE) -f Makefile $@ || exit 1; \
fi
# These targets must not be passed through to the original Makefile
.PHONY: $(BOGUS_TARGETS)
$(BOGUS_TARGETS)::
# Everything else (maybe including clean, distclean) does get passed through
# Since this file doesn't contain dependency information, don't parallelize
# here.
.NOTPARALLEL: %
%:: FORCE
$(MAKE) -f Makefile $@