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 $(TOPDIR
)/rules.mk
5 include $(TOPDIR
)/mk
/linux.mk
6 include ${TOPDIR}/mk
/kernel-vars.mk
8 $(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/linux-
$(KERNEL_VERSION
)/.patched
:
9 $(TRACE
) target
/kernel-patch
10 $(PATCH
) $(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/linux-
$(KERNEL_VERSION
) \
11 ..
/linux
/patches
/$(KERNEL_VERSION
) *.patch
$(MAKE_TRACE
)
14 $(LINUX_DIR
)/.prepared
: $(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/linux-
$(KERNEL_VERSION
)/.patched
15 $(TRACE
) target
/kernel-prepare
16 ln
-sf
$(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/linux-
$(KERNEL_VERSION
) $(LINUX_DIR
)
17 mkdir
-p
$(LINUX_BUILD_DIR
)/kmod-control
20 $(LINUX_DIR
)/.config
: $(LINUX_DIR
)/.prepared
$(BUILD_DIR
)/.kernelconfig
$(TOPDIR
)/mk
/modules.mk
21 $(TRACE
) target
/$(ADK_TARGET_ARCH
)-kernel-configure
22 for f in
$(TARGETS
);do if
[ -f
$$f ];then
rm $$f;fi
;done
$(MAKE_TRACE
)
23 $(CP
) $(BUILD_DIR
)/.kernelconfig
$(LINUX_DIR
)/.config
24 echo N |
${KERNEL_MAKE_ENV} $(MAKE
) ${KERNEL_MAKE_OPTS} oldconfig
$(MAKE_TRACE
)
25 ${KERNEL_MAKE_ENV} $(MAKE
) ${KERNEL_MAKE_OPTS} prepare scripts
$(MAKE_TRACE
)
26 touch
-c
$(LINUX_DIR
)/.config
28 $(LINUX_DIR
)/vmlinux
: $(LINUX_DIR
)/.config
29 $(TRACE
) target
/$(ADK_TARGET_ARCH
)-kernel-compile
30 ${KERNEL_MAKE_ENV} $(MAKE
) ${KERNEL_MAKE_OPTS} -j
${ADK_MAKE_JOBS} LOCALVERSION
="" $(MAKE_TRACE
)
31 $(TRACE
) target
/$(ADK_TARGET_ARCH
)-kernel-modules-install
32 rm -rf
$(LINUX_BUILD_DIR
)/modules
33 ${KERNEL_MAKE_ENV} $(MAKE
) ${KERNEL_MAKE_OPTS} DEPMOD
=true \
34 INSTALL_MOD_PATH
=$(LINUX_BUILD_DIR
)/modules \
36 modules_install
$(MAKE_TRACE
)
37 $(TRACE
) target
/$(ADK_TARGET_ARCH
)-create-packages
38 ifneq ($(strip $(TARGETS
)),)
41 touch
-c
$(LINUX_DIR
)/vmlinux
44 compile
: $(LINUX_DIR
)/vmlinux
46 ifneq ($(strip $(INSTALL_TARGETS
)),)
47 $(TRACE
) target
/${ADK_TARGET_ARCH}-modules-install
48 ifeq ($(ADK_TARGET_PACKAGE_IPKG
),y
)
49 $(PKG_INSTALL
) $(INSTALL_TARGETS
) $(MAKE_TRACE
)
51 $(foreach pkg
,$(INSTALL_TARGETS
),$(shell $(PKG_INSTALL
) $(pkg
)))
56 rm -rf
$(LINUX_BUILD_DIR
)