1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR
)/rules.mk
5 include ${ADK_TOPDIR}/mk
/kernel-ver.mk
6 include $(ADK_TOPDIR
)/mk
/linux.mk
7 include ${ADK_TOPDIR}/mk
/kernel-vars.mk
9 KERNEL_FILE
:=$(ADK_TARGET_KERNEL
)
10 KERNEL_TARGET
:=$(ADK_TARGET_KERNEL
)
11 ifeq ($(ADK_TARGET_KERNEL_LINUXBIN
),y
)
13 KERNEL_TARGET
:=$(ADK_TARGET_KERNEL
)
15 ifeq ($(ADK_TARGET_KERNEL_ZIMAGE
),y
)
17 KERNEL_TARGET
:=$(ADK_TARGET_KERNEL
)
19 ifeq ($(ADK_TARGET_KERNEL_BZIMAGE
),y
)
23 ifeq ($(ADK_TARGET_KERNEL_IMAGE
),y
)
25 KERNEL_TARGET
:=$(ADK_TARGET_KERNEL
)
28 $(LINUX_DIR
)/.prepared
: $(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/linux-
$(KERNEL_VERSION
)/.patched
29 $(TRACE
) target
/kernel-prepare
30 ln
-sf
$(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/linux-
$(KERNEL_VERSION
) $(LINUX_DIR
)
31 mkdir
-p
$(LINUX_BUILD_DIR
)/kmod-control
34 $(LINUX_DIR
)/.config
: $(LINUX_DIR
)/.prepared
$(BUILD_DIR
)/.kernelconfig
$(ADK_TOPDIR
)/mk
/modules.mk
35 $(TRACE
) target
/$(ADK_TARGET_ARCH
)-kernel-configure
36 -for f in
$(TARGETS
);do if
[ -f
$$f ];then
rm $$f;fi
;done
37 $(CP
) $(BUILD_DIR
)/.kernelconfig
$(LINUX_DIR
)/mini.config
38 ${KERNEL_MAKE_ENV} $(MAKE
) -C
"${LINUX_DIR}" ${KERNEL_MAKE_OPTS} KCONFIG_ALLCONFIG
=mini.config allnoconfig
$(MAKE_TRACE
)
39 touch
-c
$(LINUX_DIR
)/.config
41 $(LINUX_DIR
)/$(KERNEL_FILE
): $(LINUX_DIR
)/.config
42 $(TRACE
) target
/$(ADK_TARGET_ARCH
)-kernel-compile
43 ${KERNEL_MAKE_ENV} $(MAKE
) -C
"${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j
${ADK_MAKE_JOBS} LOCALVERSION
="" $(KERNEL_TARGET
) modules
$(MAKE_TRACE
)
44 touch
-c
$(LINUX_DIR
)/$(KERNEL_FILE
)
46 $(LINUX_BUILD_DIR
)/modules
: $(LINUX_DIR
)/$(KERNEL_FILE
)
47 $(TRACE
) target
/$(ADK_TARGET_ARCH
)-kernel-modules-install
48 rm -rf
$(LINUX_BUILD_DIR
)/modules
49 ${KERNEL_MAKE_ENV} $(MAKE
) -C
"${LINUX_DIR}" ${KERNEL_MAKE_OPTS} DEPMOD
=true \
50 INSTALL_MOD_PATH
=$(LINUX_BUILD_DIR
)/modules \
52 modules_install
$(MAKE_TRACE
)
53 $(TRACE
) target
/$(ADK_TARGET_ARCH
)-create-packages
54 @mkdir
-p
${PACKAGE_DIR}
55 ifneq ($(strip $(TARGETS
)),)
59 $(INSTALL_TARGETS
): $(LINUX_BUILD_DIR
)/modules
62 compile
: $(LINUX_BUILD_DIR
)/modules
63 install: compile
$(INSTALL_TARGETS
)
64 ifneq ($(strip $(INSTALL_TARGETS
)),)
65 $(TRACE
) target
/${ADK_TARGET_ARCH}-modules-install
66 ifeq ($(ADK_TARGET_PACKAGE_IPKG
),y
)
67 $(PKG_INSTALL
) $(INSTALL_TARGETS
) $(MAKE_TRACE
)
69 $(foreach pkg
,$(INSTALL_TARGETS
),$(shell $(PKG_INSTALL
) $(pkg
)))
74 rm -rf
$(LINUX_BUILD_DIR
)