2005-08-15 13:43:09 +03:00
|
|
|
LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
|
|
|
|
-e 's/mipsel/mips/' \
|
|
|
|
-e 's/powerpc/ppc/' \
|
|
|
|
-e 's/sh[234]/sh/' \
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2005-05-28 12:17:29 +03:00
|
|
|
define KMOD_template
|
|
|
|
ifeq ($$(strip $(4)),)
|
|
|
|
KDEPEND_$(1):=m
|
|
|
|
else
|
|
|
|
KDEPEND_$(1):=$($(4))
|
|
|
|
endif
|
|
|
|
|
2005-06-11 18:36:31 +03:00
|
|
|
ifeq ($$(strip $(5)),)
|
2005-07-04 23:18:35 +03:00
|
|
|
IDEPEND_$(1):=kernel-$(LINUX_VERSION)-$(BOARD) ($(PKG_RELEASE))
|
2005-06-11 18:36:31 +03:00
|
|
|
else
|
2005-07-04 23:18:35 +03:00
|
|
|
IDEPEND_$(1):=kernel-$(LINUX_VERSION)-$(BOARD) ($(PKG_RELEASE)), $(5)
|
2005-06-11 18:36:31 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE)_$(ARCH).ipk
|
2005-05-28 12:17:29 +03:00
|
|
|
I_$(1) := $(PKG_BUILD_DIR)/ipkg/$(2)
|
|
|
|
|
|
|
|
ifeq ($$(KDEPEND_$(1)),m)
|
|
|
|
ifneq ($(BR2_PACKAGE_KMOD_$(1)),)
|
|
|
|
TARGETS += $$(PKG_$(1))
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_KMOD_$(1)),y)
|
|
|
|
INSTALL_TARGETS += $$(PKG_$(1))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
$$(PKG_$(1)): $(LINUX_DIR)/.modules_done
|
2005-06-11 18:36:31 +03:00
|
|
|
rm -rf $$(I_$(1))
|
2005-05-28 12:17:29 +03:00
|
|
|
mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION)
|
2005-06-11 18:36:31 +03:00
|
|
|
$(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) ../control/kmod-$(2).control $(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE) $(ARCH)
|
|
|
|
echo "Depends: $$(IDEPEND_$(1))" >> $$(I_$(1))/CONTROL/control
|
2005-05-28 12:17:29 +03:00
|
|
|
cp $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
|
2005-07-16 12:49:24 +03:00
|
|
|
ifneq ($(6),)
|
|
|
|
mkdir -p $$(I_$(1))/etc/modules.d
|
|
|
|
for module in $(7); do \
|
|
|
|
echo $$$$module >> $$(I_$(1))/etc/modules.d/$(6)-$(2); \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
$(8)
|
2005-05-28 12:17:29 +03:00
|
|
|
$(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR)
|
|
|
|
|
|
|
|
endef
|
2005-08-15 13:43:09 +03:00
|
|
|
|
|
|
|
|