package/linux-firmware: split bcm43xx / bcm43xxx
[buildroot-gz.git] / linux / linux-ext-rtai.mk
blobdcfab498319c18d432c28ca394ce23952ec6556d
1 ################################################################################
2 # Linux RTAI extensions
4 # Patch the linux kernel with RTAI extension
5 ################################################################################
7 ifeq ($(BR2_LINUX_KERNEL_EXT_RTAI),y)
8 # Add dependency to RTAI (user-space) which provide kernel patches
9 LINUX_DEPENDENCIES += rtai-patch
11 RTAI_PATCH = $(call qstrip,$(BR2_LINUX_KERNEL_EXT_RTAI_PATCH))
13 ifeq ($(KERNEL_ARCH),i386)
14 RTAI_ARCH = x86
15 else ifeq ($(KERNEL_ARCH),x86_64)
16 RTAI_ARCH = x86
17 else ifeq ($(KERNEL_ARCH),powerpc)
18 RTAI_ARCH = ppc
19 else
20 RTAI_ARCH = $(KERNEL_ARCH)
21 endif
23 # Prepare kernel patch
24 ifeq ($(RTAI_PATCH),)
25 define RTAI_PREPARE_KERNEL
26 kver=`$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelversion` ; \
27 if test -f $(RTAI_DIR)/base/arch/$(RTAI_ARCH)/patches/hal-linux-$${kver}-*patch ; then \
28 support/scripts/apply-patches.sh $(LINUX_DIR) \
29 $(RTAI_DIR)/base/arch/$(RTAI_ARCH)/patches/ \
30 hal-linux-$${kver}-*patch ; \
31 else \
32 echo "No RTAI patch for your kernel version" ; \
33 exit 1 ; \
35 endef
36 else
37 define RTAI_PREPARE_KERNEL
38 support/scripts/apply-patches.sh \
39 $(LINUX_DIR) \
40 $(dir $(RTAI_PATCH)) \
41 $(notdir $(RTAI_PATCH))
42 endef
43 endif
45 LINUX_PRE_PATCH_HOOKS += RTAI_PREPARE_KERNEL
47 endif #BR2_LINUX_EXT_RTAI