1 LINUX_SOURCE
:=linux-
$(LINUX_VERSION
).
tar.bz2
2 LINUX_SITE
=http
://www.us.kernel.org
/pub
/linux
/kernel
/v
$(KERNEL
) \
3 http
://www.us.kernel.org
/pub
/linux
/kernel
/v
$(KERNEL
) \
4 http
://www.kernel.org
/pub
/linux
/kernel
/v
$(KERNEL
) \
5 http
://www.de.kernel.org
/pub
/linux
/kernel
/v
$(KERNEL
)
7 KERNEL_IDIR
:=$(LINUX_BUILD_DIR
)/kernel-ipkg
9 $(TARGETS
): $(PACKAGE_DIR
)
17 $(DL_DIR
)/$(LINUX_SOURCE
):
19 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(LINUX_SOURCE
) $(LINUX_KERNEL_MD5SUM
) $(LINUX_SITE
)
21 $(LINUX_DIR
)/.unpacked
: $(DL_DIR
)/$(LINUX_SOURCE
)
22 -mkdir
-p
$(LINUX_BUILD_DIR
)
23 bzcat
$(DL_DIR
)/$(LINUX_SOURCE
) |
tar -C
$(LINUX_BUILD_DIR
) $(TAR_OPTIONS
) -
27 $(LINUX_DIR
)/.configured
: $(LINUX_DIR
)/.patched
28 $(SED
) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" \
29 $(LINUX_DIR
)/Makefile \
30 $(LINUX_DIR
)/arch
/*/Makefile
31 $(SED
) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR
)/arch
/mips
/Makefile
32 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) oldconfig
include/linux
/compile.h
include/linux
/version.h
35 $(LINUX_DIR
)/.depend_done
: $(LINUX_DIR
)/.configured
36 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
="$(KERNEL_CROSS)" ARCH
=$(LINUX_KARCH
) dep
39 $(LINUX_DIR
)/vmlinux
: $(LINUX_DIR
)/.depend_done
41 $(LINUX_DIR
)/.configured
: $(LINUX_DIR
)/.patched
42 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
="$(KERNEL_CROSS)" ARCH
=$(LINUX_KARCH
) oldconfig prepare scripts
46 $(LINUX_DIR
)/vmlinux
: $(STAMP_DIR
)/.linux-compile pkg-install
47 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
="$(KERNEL_CROSS)" ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
)
49 $(LINUX_KERNEL
): $(LINUX_DIR
)/vmlinux
50 $(TARGET_CROSS
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$< $@
51 touch
-c
$(LINUX_KERNEL
)
53 $(LINUX_DIR
)/.modules_done
:
54 rm -rf
$(LINUX_BUILD_DIR
)/modules
55 $(MAKE
) -C
"$(LINUX_DIR)" CROSS_COMPILE
="$(KERNEL_CROSS)" ARCH
=$(LINUX_KARCH
) PATH
="$(TARGET_PATH)" modules
56 $(MAKE
) -C
"$(LINUX_DIR)" CROSS_COMPILE
="$(KERNEL_CROSS)" DEPMOD
=true INSTALL_MOD_PATH
=$(LINUX_BUILD_DIR
)/modules modules_install
57 touch
$(LINUX_DIR
)/.modules_done
59 $(STAMP_DIR
)/.linux-compile
:
60 @
$(MAKE
) $(LINUX_DIR
)/.modules_done
$(TARGETS
) $(KERNEL_IPKG
)
61 ln
-sf
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(BUILD_DIR
)/linux
66 mkdir
-p
$(KERNEL_IDIR
)/etc
67 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(KERNEL_IDIR
) ..
/control
/kernel.control
$(LINUX_VERSION
)-$(BOARD
)-$(LINUX_RELEASE
) $(ARCH
)
68 if
[ -f .
/config
/$(BOARD
).modules
]; then \
69 cp .
/config
/$(BOARD
).modules
$(KERNEL_IDIR
)/etc
/modules
; \
71 $(IPKG_BUILD
) $(KERNEL_IDIR
) $(LINUX_BUILD_DIR
)
73 $(BUILD_DIR
)/kernel.mk
: $(LINUX_DIR
) FORCE
74 echo
"BOARD:=$(BOARD)" > $@
75 echo
"LINUX_VERSION:=$(LINUX_VERSION)" >> $@
76 echo
"LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@
79 @
{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG
) install $(INSTALL_TARGETS
) || true
; }
81 source
: $(DL_DIR
)/$(LINUX_SOURCE
)
82 prepare
: $(BUILD_DIR
)/kernel.mk
83 @mkdir
-p
$(STAMP_DIR
) $(PACKAGE_DIR
)
84 @
$(MAKE
) $(LINUX_DIR
)/.configured
86 compile
: prepare
$(STAMP_DIR
)/.linux-compile
88 install: compile
$(LINUX_KERNEL
)
91 rm -f
$(STAMP_DIR
)/.linux-compile
92 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.modules_done
93 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.drivers-unpacked
94 $(MAKE
) -C
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) clean
99 if
[ -f
$(LINUX_KERNEL
) ]; then \
102 $(MAKE
) compile
$(MAKE_TRACE
)
105 rm -f
$(STAMP_DIR
)/.linux-compile
106 rm -rf
$(LINUX_BUILD_DIR
)