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
)
12 mkdir
-p
$(PACKAGE_DIR
)
14 $(DL_DIR
)/$(LINUX_SOURCE
):
16 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(LINUX_SOURCE
) $(LINUX_KERNEL_MD5SUM
) $(LINUX_SITE
)
18 $(LINUX_DIR
)/.unpacked
: $(DL_DIR
)/$(LINUX_SOURCE
)
19 -mkdir
-p
$(LINUX_BUILD_DIR
)
20 bzcat
$(DL_DIR
)/$(LINUX_SOURCE
) |
tar -C
$(LINUX_BUILD_DIR
) $(TAR_OPTIONS
) -
21 rm -f
$(BUILD_DIR
)/linux
22 ln
-s
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(BUILD_DIR
)/linux
26 $(LINUX_DIR
)/.configured
: $(LINUX_DIR
)/.patched
27 $(SED
) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" \
28 $(LINUX_DIR
)/Makefile \
29 $(LINUX_DIR
)/arch
/*/Makefile
30 $(SED
) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR
)/arch
/mips
/Makefile
31 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) oldconfig
include/linux
/compile.h
include/linux
/version.h
34 $(LINUX_DIR
)/.depend_done
: $(LINUX_DIR
)/.configured
35 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
="$(KERNEL_CROSS)" ARCH
=$(LINUX_KARCH
) dep
38 $(LINUX_DIR
)/vmlinux
: $(LINUX_DIR
)/.depend_done
40 $(LINUX_DIR
)/.configured
: $(LINUX_DIR
)/.patched
41 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
="$(KERNEL_CROSS)" ARCH
=$(LINUX_KARCH
) oldconfig prepare scripts
45 $(LINUX_DIR
)/vmlinux
: $(STAMP_DIR
)/.linux-compile
46 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
="$(KERNEL_CROSS)" ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
)
48 $(LINUX_KERNEL
): $(LINUX_DIR
)/vmlinux
49 $(TARGET_CROSS
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$< $@
50 touch
-c
$(LINUX_KERNEL
)
52 $(LINUX_DIR
)/.modules_done
:
53 rm -rf
$(LINUX_BUILD_DIR
)/modules
54 $(MAKE
) -C
"$(LINUX_DIR)" CROSS_COMPILE
="$(KERNEL_CROSS)" ARCH
=$(LINUX_KARCH
) PATH
="$(TARGET_PATH)" modules
55 $(MAKE
) -C
"$(LINUX_DIR)" CROSS_COMPILE
="$(KERNEL_CROSS)" DEPMOD
=true INSTALL_MOD_PATH
=$(LINUX_BUILD_DIR
)/modules modules_install
56 touch
$(LINUX_DIR
)/.modules_done
58 $(STAMP_DIR
)/.linux-compile
:
59 @
$(MAKE
) $(LINUX_DIR
)/.modules_done
$(TARGETS
) $(KERNEL_IPKG
)
60 ln
-sf
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(BUILD_DIR
)/linux
61 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
68 @mkdir
-p
$(TARGET_MODULES_DIR
)
69 @
rm -rf
$(LINUX_BUILD_DIR
)/root
*
70 @cp
-fpR
$(BUILD_DIR
)/root
$(LINUX_BUILD_DIR
)/
71 echo
-e
'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR
)/ipkg.conf
72 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
75 [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL
) install $(INSTALL_TARGETS
)
79 mkdir
-p
$(KERNEL_IDIR
)/etc
80 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(KERNEL_IDIR
) ..
/control
/kernel.control
$(LINUX_VERSION
)-$(BOARD
)-$(LINUX_RELEASE
) $(ARCH
)
81 if
[ -f .
/config
/$(BOARD
).modules
]; then \
82 cp .
/config
/$(BOARD
).modules
$(KERNEL_IDIR
)/etc
/modules
; \
84 $(IPKG_BUILD
) $(KERNEL_IDIR
) $(LINUX_BUILD_DIR
)
86 source
: $(DL_DIR
)/$(LINUX_SOURCE
)
88 @mkdir
-p
$(STAMP_DIR
) $(PACKAGE_DIR
)
89 @
$(MAKE
) $(LINUX_DIR
)/.configured
91 compile
: prepare
$(STAMP_DIR
)/.linux-compile
94 $(MAKE
) $(KPKG_MAKEOPTS
) pkg-install
95 $(MAKE
) $(KPKG_MAKEOPTS
) $(LINUX_KERNEL
)
98 rm -f
$(STAMP_DIR
)/.linux-compile
99 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.modules_done
100 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.drivers-unpacked
101 $(MAKE
) -C
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) clean
102 rm -f
$(LINUX_KERNEL
)
106 @
[ -f
$(LINUX_KERNEL
) ] && $(MAKE
) clean
110 rm -f
$(STAMP_DIR
)/.linux-compile
111 rm -rf
$(LINUX_BUILD_DIR
)
115 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
117 $(patsubst package
/%,%,$@
)