2005-06-09 11:46:12 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# modutils
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-07-11 16:06:06 +02:00
|
|
|
MODUTILS_VERSION:=2.4.27
|
|
|
|
MODUTILS_SOURCE=modutils-$(MODUTILS_VERSION).tar.bz2
|
2006-11-17 16:43:51 +01:00
|
|
|
MODUTILS_CAT:=$(BZCAT)
|
2008-03-11 19:54:17 +01:00
|
|
|
MODUTILS_SITE=$(BR2_KERNEL_MIRROR)/linux/utils/kernel/modutils/v2.4/
|
2007-07-11 16:06:06 +02:00
|
|
|
MODUTILS_DIR1=$(BUILD_DIR)/modutils-$(MODUTILS_VERSION)
|
2009-09-23 01:30:00 +02:00
|
|
|
MODUTILS_DIR2=$(TOOLCHAIN_DIR)/modutils-$(MODUTILS_VERSION)
|
2007-07-31 20:37:52 +02:00
|
|
|
MODUTILS_BINARY=depmod
|
|
|
|
MODUTILS_TARGET_BINARY=sbin/$(MODUTILS_BINARY)
|
2005-06-09 11:46:12 +02:00
|
|
|
|
2007-10-01 18:15:31 +02:00
|
|
|
STRIPPROG=$(STRIPCMD)
|
2005-06-09 11:46:12 +02:00
|
|
|
|
|
|
|
$(DL_DIR)/$(MODUTILS_SOURCE):
|
2009-01-16 12:42:52 +01:00
|
|
|
$(call DOWNLOAD,$(MODUTILS_SITE),$(MODUTILS_SOURCE))
|
2005-06-09 11:46:12 +02:00
|
|
|
|
2005-09-30 22:17:07 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# build modutils for use on the target system
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
$(MODUTILS_DIR1)/.source: $(DL_DIR)/$(MODUTILS_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(MODUTILS_CAT) $(DL_DIR)/$(MODUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
|
2005-09-30 22:17:07 +02:00
|
|
|
toolchain/patch-kernel.sh $(MODUTILS_DIR1) \
|
2005-06-09 11:46:12 +02:00
|
|
|
package/modutils \*.patch
|
2005-09-30 22:17:07 +02:00
|
|
|
touch $(MODUTILS_DIR1)/.source
|
2005-06-09 11:46:12 +02:00
|
|
|
|
2005-09-30 22:17:07 +02:00
|
|
|
$(MODUTILS_DIR1)/.configured: $(MODUTILS_DIR1)/.source
|
2007-09-25 14:34:09 +02:00
|
|
|
(cd $(MODUTILS_DIR1); rm -f config.cache; \
|
2005-06-09 11:46:12 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-06-27 14:01:27 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2005-09-30 22:17:07 +02:00
|
|
|
INSTALL=$(MODUTILS_DIR1)/install-sh \
|
2009-10-01 21:24:42 +02:00
|
|
|
./configure $(QUIET) \
|
2005-06-09 11:46:12 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/ \
|
|
|
|
--sysconfdir=/etc \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-08-28 23:42:44 +02:00
|
|
|
touch $@
|
2005-06-09 11:46:12 +02:00
|
|
|
|
2007-07-31 20:37:52 +02:00
|
|
|
$(MODUTILS_DIR1)/.build: $(MODUTILS_DIR1)/.configured
|
2006-07-09 06:54:00 +02:00
|
|
|
$(MAKE1) CC=$(TARGET_CC) -C $(MODUTILS_DIR1)
|
2007-07-31 20:37:52 +02:00
|
|
|
touch $@
|
2005-06-09 11:46:12 +02:00
|
|
|
|
2007-07-31 20:37:52 +02:00
|
|
|
$(STAGING_DIR)/$(MODUTILS_TARGET_BINARY): $(MODUTILS_DIR1)/.build
|
2005-06-09 11:46:12 +02:00
|
|
|
STRIPPROG='$(STRIPPROG)' \
|
2007-07-31 20:37:52 +02:00
|
|
|
$(MAKE) prefix=$(STAGING_DIR) -C $(MODUTILS_DIR1) install-bin
|
|
|
|
touch -c $@
|
2005-06-09 11:46:12 +02:00
|
|
|
|
2007-08-20 19:21:16 +02:00
|
|
|
$(TARGET_DIR)/sbin/rmmod: $(STAGING_DIR)/$(MODUTILS_TARGET_BINARY)
|
2007-08-21 21:33:00 +02:00
|
|
|
cp -dpf $(STAGING_DIR)/sbin/depmod $(TARGET_DIR)/sbin/depmod
|
|
|
|
cp -dpf $(STAGING_DIR)/sbin/insmod $(TARGET_DIR)/sbin/insmod
|
|
|
|
cp -dpf $(STAGING_DIR)/sbin/modinfo $(TARGET_DIR)/sbin/modinfo
|
|
|
|
ln -s insmod $(TARGET_DIR)/sbin/kallsyms
|
|
|
|
ln -s insmod $(TARGET_DIR)/sbin/ksyms
|
|
|
|
ln -s insmod $(TARGET_DIR)/sbin/lsmod
|
|
|
|
ln -s insmod $(TARGET_DIR)/sbin/modprobe
|
|
|
|
ln -s insmod $(TARGET_DIR)/sbin/rmmod
|
2007-07-31 20:37:52 +02:00
|
|
|
|
2009-09-02 17:02:02 +02:00
|
|
|
modutils: $(TARGET_DIR)/sbin/rmmod
|
2005-06-09 11:46:12 +02:00
|
|
|
|
|
|
|
modutils-source: $(DL_DIR)/$(MODUTILS_SOURCE)
|
|
|
|
|
|
|
|
modutils-clean:
|
2005-09-30 22:17:07 +02:00
|
|
|
$(MAKE) prefix=$(TARGET_DIR)/usr -C $(MODUTILS_DIR1) uninstall
|
|
|
|
-$(MAKE) -C $(MODUTILS_DIR1) clean
|
2005-06-09 11:46:12 +02:00
|
|
|
|
|
|
|
modutils-dirclean:
|
2005-09-30 22:17:07 +02:00
|
|
|
rm -rf $(MODUTILS_DIR1)
|
|
|
|
|
2007-07-31 20:37:52 +02:00
|
|
|
modutils-target-clean:
|
|
|
|
rm -f $(TARGET_DIR)/sbin/depmod
|
|
|
|
rm -f $(TARGET_DIR)/sbin/insmod
|
|
|
|
rm -f $(TARGET_DIR)/sbin/modinfo
|
|
|
|
rm -f $(TARGET_DIR)/sbin/kallsyms
|
|
|
|
rm -f $(TARGET_DIR)/sbin/ksyms
|
|
|
|
rm -f $(TARGET_DIR)/sbin/lsmod
|
|
|
|
rm -f $(TARGET_DIR)/sbin/modprobe
|
|
|
|
rm -f $(TARGET_DIR)/sbin/rmmod
|
2005-09-30 22:17:07 +02:00
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# build modutils for use on the host system
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_mips),y)
|
2005-09-30 22:17:07 +02:00
|
|
|
DEPMOD_EXTRA_STUFF=CFLAGS=-D__MIPSEB__
|
|
|
|
endif
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_mipsel),y)
|
2005-09-30 22:17:07 +02:00
|
|
|
DEPMOD_EXTRA_STUFF=CFLAGS=-D__MIPSEL__
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(MODUTILS_DIR2)/.source: $(DL_DIR)/$(MODUTILS_SOURCE)
|
2009-09-23 01:30:00 +02:00
|
|
|
$(MODUTILS_CAT) $(DL_DIR)/$(MODUTILS_SOURCE) | tar -C $(TOOLCHAIN_DIR) -xvf -
|
2005-09-30 22:17:07 +02:00
|
|
|
toolchain/patch-kernel.sh $(MODUTILS_DIR2) \
|
|
|
|
package/modutils \*.patch
|
2007-08-28 23:42:44 +02:00
|
|
|
touch $@
|
2005-09-30 22:17:07 +02:00
|
|
|
|
|
|
|
$(MODUTILS_DIR2)/.configured: $(MODUTILS_DIR2)/.source
|
|
|
|
(cd $(MODUTILS_DIR2); \
|
2009-10-01 21:24:42 +02:00
|
|
|
./configure $(QUIET) $(DEPMOD_EXTRA_STUFF) \
|
2005-09-30 22:17:07 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/ \
|
|
|
|
--sysconfdir=/etc \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-08-28 23:42:44 +02:00
|
|
|
touch $@
|
2005-09-30 22:17:07 +02:00
|
|
|
|
|
|
|
$(MODUTILS_DIR2)/$(MODUTILS_BINARY): $(MODUTILS_DIR2)/.configured
|
2006-07-09 06:54:00 +02:00
|
|
|
$(MAKE1) -C $(MODUTILS_DIR2)
|
2007-08-28 23:42:44 +02:00
|
|
|
touch -c $@
|
2005-09-30 22:17:07 +02:00
|
|
|
|
2006-12-13 12:01:54 +01:00
|
|
|
$(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-depmod: $(MODUTILS_DIR2)/$(MODUTILS_BINARY)
|
|
|
|
mkdir -p $(STAGING_DIR)/bin
|
|
|
|
cp $(MODUTILS_DIR2)/$(MODUTILS_BINARY) $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-depmod
|
2007-08-28 23:42:44 +02:00
|
|
|
touch -c $@
|
2005-09-30 22:17:07 +02:00
|
|
|
|
2009-09-02 17:02:02 +02:00
|
|
|
cross-depmod: $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-depmod
|
2005-09-30 22:17:07 +02:00
|
|
|
|
|
|
|
cross-depmod-source: $(DL_DIR)/$(MODUTILS_SOURCE)
|
|
|
|
|
|
|
|
cross-depmod-clean:
|
|
|
|
$(MAKE) prefix=$(TARGET_DIR)/usr -C $(MODUTILS_DIR2) uninstall
|
|
|
|
-$(MAKE) -C $(MODUTILS_DIR2) clean
|
|
|
|
|
|
|
|
cross-depmod-dirclean:
|
|
|
|
rm -rf $(MODUTILS_DIR2)
|
|
|
|
|
|
|
|
|
2005-06-09 11:46:12 +02:00
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
## Toplevel Makefile options
|
|
|
|
#
|
|
|
|
##############################################################
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_MODUTILS),y)
|
2005-06-09 11:46:12 +02:00
|
|
|
TARGETS+=modutils
|
|
|
|
endif
|