-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.src
109 lines (94 loc) · 3.62 KB
/
Makefile.src
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
#
#***************************************************************
#
# Component: VLX Linux Kernel Source Component.
#
# Copyright (C) 2011, Red Bend Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# You should have received a copy of the GNU General Public License Version 2
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contributor(s):
# Sebastien Laborie ([email protected])
# Guennadi Maslov ([email protected])
#
#***************************************************************
#
LINUXKERNEL_MERGE += -s $(LINUXKERNEL)
LINUXKERNEL_MERGE_PROFILE += $(LINUXKERNEL_PROFILE)
all:: LINUXKERNEL.all
LINUXKERNEL.all:: DEVTOOLS.all
LINUXKERNEL.all:: $(LINUXKERNEL_DIR)/DONE
$(LINUXKERNEL_DIR)/profile: $(DEVTOOLS_DIR)/host/bin/mkmerge
rm -rf $(LINUXKERNEL_DIR)
$(DEVTOOLS_DIR)/host/bin/mkmerge $(LINUXKERNEL_MERGE) -t $(LINUXKERNEL_DIR)
$(LINUXKERNEL_DIR)/GNUmakefile.defs: $(LINUXKERNEL_DIR)/profile
cp -f $(BUILD_DIR)/Paths $@
echo "LINUXKERNEL_MERGE_PROFILE=$(LINUXKERNEL_MERGE_PROFILE)" >> $@
$(LINUXKERNEL_DIR)/.config: $(LINUXKERNEL_DIR)/GNUmakefile.defs
cd $(LINUXKERNEL_DIR); $(make) .config; yes '' | $(make) oldconfig
$(LINUXKERNEL_DIR)/include/config/auto.conf: $(LINUXKERNEL_DIR)/.config
cd $(LINUXKERNEL_DIR); $(make) silentoldconfig
$(LINUXKERNEL_DIR)/VMLINUX.conf: $(LINUXKERNEL_DIR)/include/config/auto.conf
cd $(LINUXKERNEL_DIR); $(make) VMLINUX.conf
$(LINUXKERNEL_DIR)/vmlinux: $(LINUXKERNEL_DIR)/VMLINUX.conf
cd $(LINUXKERNEL_DIR); $(make) all
touch $@
$(LINUXKERNEL_DIR)/.modules: $(LINUXKERNEL_DIR)/VMLINUX.conf
cd $(LINUXKERNEL_DIR); . ./.config; if [ ! -z "$$CONFIG_MODULES" ]; then $(make) modules; fi
touch $@
$(LINUXKERNEL_DIR)/DONE: $(LINUXKERNEL_DIR)/vmlinux $(LINUXKERNEL_DIR)/.modules
touch $@
$(LINUXKERNEL_DIR)/.extern_deps: $(LINUXKERNEL_DIR)/VMLINUX.conf
touch $@
linux.%: $(LINUXKERNEL_DIR)/.extern_deps
cd $(LINUXKERNEL_DIR); $(make) $*
ROOTDIR = $(BUILD_DIR)/linux-root
linux.modules_install: LINUXKERNEL.all
mkdir -p $(ROOTDIR); cd $(ROOTDIR); INST_PATH=`pwd`; \
. $(LINUXKERNEL_DIR)/VMLINUX.conf; \
for DIR in $(LINUXMODULES_EXTRA); do \
cd $$DIR; \
find . -follow -type f -name "*.ko" | \
cpio -pdvmuL $(ROOTDIR)/lib/modules/$$LINUX_VER; \
done; \
cd $(LINUXKERNEL_DIR); \
$(make) modules_install INSTALL_MOD_PATH=$$INST_PATH \
depmod_opts='-c $$(CROSS_COMPILE) \
-b $$(INSTALL_MOD_PATH)' \
DEPMOD=$(DEVTOOLS_DIR)/cross-linux/depmod.pl; \
rm -f $$INST_PATH/lib/modules/*/build
LINUXKERNEL_DIST = $(BUILD_DIR)/dist-LINUXKERNEL
LINUXKERNEL.dist: LINUXKERNEL.all
rm -rf $(LINUXKERNEL_DIST)
mkdir -p $(LINUXKERNEL_DIST)
cd $(LINUXKERNEL_DIR) ; \
ASM_DIRS="" ; \
while true; do \
_ASM_DIRS=`find include/asm $$ASM_DIRS -follow -exec \
grep '#.*include.*asm-.*/*.h' {} \; | \
grep -v "asm-generic/" | \
sed -e 's,.*\(asm-[^/]*\)/.*,include/\1,g' | \
sort -u` ; \
[ "$$ASM_DIRS" = "$$_ASM_DIRS" ] && break ; \
ASM_DIRS="$$_ASM_DIRS" ; \
done ; \
find Documentation \
Makefile.bin \
VMLINUX.conf \
.config \
vmlinux \
System.map \
`ls -1d include/* | grep -v "/asm-"` \
include/asm-generic \
$$ASM_DIRS \
-follow -name SCCS -prune -o -print | \
cpio -pdvmL $(LINUXKERNEL_DIST)