X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/e9470e9bef5f9c7bb1baa9b296d6701ba4b0a6e8..30bf34f05c0f66d9d9221f7ebfe9808024337dd4:/target/linux/linux-2.4/Makefile diff --git a/target/linux/linux-2.4/Makefile b/target/linux/linux-2.4/Makefile index a0d56bfaf..bd1dd6c5d 100644 --- a/target/linux/linux-2.4/Makefile +++ b/target/linux/linux-2.4/Makefile @@ -1,18 +1,10 @@ -############################################################# # $Id$ -# # Linux 2.4 kernel target for the OpenWRT project -# -# patches are sorted by numbers -# 0xx needed patches for board, cpu, filesystem -# 1xx addon patches for new features (netfilter, ebtables, cifs,..) -# 2xx compile fixes, driver fixes -# -############################################################# include $(TOPDIR)/rules.mk include ../rules.mk +KERNEL:=2.4 LINUX_VERSION:=2.4.30 MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION) LINUX_KCONFIG:=./config/$(BOARD) @@ -24,7 +16,7 @@ LINUX_BINARY_DRIVER_SITE := http://openwrt.org/downloads/sources/ LINUX_SOURCE := linux-$(LINUX_VERSION).tar.bz2 LINUX_SOURCE_DIR := $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) MODULES_DIR := $(LINUX_BUILD_DIR)/modules/$(MODULES_SUBDIR) -TARGET_MODULES_DIR := $(TARGET_DIR)/lib/modules/$(LINUX_VERSION) +TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/lib/modules/$(LINUX_VERSION) IPKG_KERNEL:=IPKG_TMP=$(BUILD_DIR)/tmp IPKG_INSTROOT=$(LINUX_TARGET_DIR) IPKG_CONF_DIR=$(LINUX_BUILD_DIR) $(SCRIPT_DIR)/ipkg -force-defaults -force-depends PKG_BUILD_DIR := $(LINUX_BUILD_DIR)/linux-modules @@ -99,6 +91,9 @@ $(eval $(call KMOD_template,NFS,nfs,\ $(MODULES_DIR)/kernel/fs/nfs/*.o \ $(MODULES_DIR)/kernel/net/sunrpc/*.o \ ,CONFIG_NFS_FS,,30,sunrpc lockd nfs)) +$(eval $(call KMOD_template,SOUNDCORE,soundcore,\ + $(MODULES_DIR)/kernel/drivers/sound/soundcore.o \ +,CONFIG_SOUND,,30,soundcore)) $(eval $(call KMOD_template,USB,usb-core,\ $(MODULES_DIR)/kernel/drivers/usb/usbcore.o \ ,CONFIG_USB,,50,usbcore)) @@ -111,6 +106,23 @@ $(eval $(call KMOD_template,USB_OHCI,usb-ohci,\ $(eval $(call KMOD_template,USB2,usb2,\ $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.o \ ,CONFIG_USB_EHCI_HCD,kmod-usb-core,60,ehci-hcd)) + +$(eval $(call KMOD_template,USB_SERIAL,usb-serial,\ + $(MODULES_DIR)/kernel/drivers/usb/serial/usbserial.o \ +,CONFIG_USB_SERIAL,kmod-usb-core,60,usbserial)) +$(eval $(call KMOD_template,USB_SERIAL_BELKIN,usb-serial-belkin,\ + $(MODULES_DIR)/kernel/drivers/usb/serial/belkin_sa.o \ +,CONFIG_USB_SERIAL_BELKIN,kmod-usb-serial,61,belkin_sa)) +$(eval $(call KMOD_template,USB_SERIAL_FTDI,usb-serial-ftdi,\ + $(MODULES_DIR)/kernel/drivers/usb/serial/ftdi_sio.o \ +,CONFIG_USB_SERIAL_IR,kmod-usb-serial,61,ftdi_usb)) +$(eval $(call KMOD_template,USB_SERIAL_MCT_U232,usb-serial-mct-u232,\ + $(MODULES_DIR)/kernel/drivers/usb/serial/mct_u232.o \ +,CONFIG_USB_SERIAL_MCT_U232,kmod-usb-serial,61,mct_u232)) +$(eval $(call KMOD_template,USB_SERIAL_PL2303,usb-serial-pl2303,\ + $(MODULES_DIR)/kernel/drivers/usb/serial/pl2303.o \ +,CONFIG_USB_SERIAL_PL2303,kmod-usb-serial,61,pl2303)) + $(eval $(call KMOD_template,USB_STORAGE,usb-storage,\ $(MODULES_DIR)/kernel/drivers/scsi/*.o \ $(MODULES_DIR)/kernel/drivers/usb/storage/*.o \ @@ -118,6 +130,9 @@ $(eval $(call KMOD_template,USB_STORAGE,usb-storage,\ $(eval $(call KMOD_template,USB_PRINTER,usb-printer,\ $(MODULES_DIR)/kernel/drivers/usb/printer.o \ ,CONFIG_USB_PRINTER,kmod-usb-core,60,printer)) +$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\ + $(MODULES_DIR)/kernel/drivers/usb/audio.o \ +,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio)) $(eval $(call KMOD_template,IDE,ide,\ $(MODULES_DIR)/kernel/drivers/ide/*.o \ $(MODULES_DIR)/kernel/drivers/ide/*/*.o \ @@ -142,7 +157,7 @@ $(eval $(call KMOD_template,VFAT,vfat,\ $(MODULES_DIR)/kernel/fs/vfat/vfat.o \ $(MODULES_DIR)/kernel/fs/fat/fat.o \ ,CONFIG_VFAT_FS,,30,fat vfat)) -ifneq (${shell ls $(MODULES_DIR)/kernel/crypto/*.o},) +ifneq ($(wildcard $(MODULES_DIR)/kernel/crypto/*.o),) CONFIG_CRYPTO:=m endif $(eval $(call KMOD_template,CRYPTO,crypto,\ @@ -166,7 +181,7 @@ $(eval $(call KMOD_template,TUN,tun,\ $(eval $(call KMOD_template,GRE,gre,\ $(MODULES_DIR)/kernel/net/ipv4/ip_gre.o \ ,CONFIG_NET_IPGRE)) -ifneq (${shell ls $(MODULES_DIR)/kernel/net/sched/*.o},) +ifneq ($(wildcard $(MODULES_DIR)/kernel/net/sched/*.o),) CONFIG_SCHED:=m endif $(eval $(call KMOD_template,SCHED,sched,\ @@ -178,6 +193,10 @@ $(eval $(call KMOD_template,VIDEODEV,videodev,\ $(eval $(call KMOD_template,PWC,pwc,\ $(MODULES_DIR)/kernel/drivers/usb/pwc.o \ ,CONFIG_USB_PWC)) +$(eval $(call KMOD_template,AX25,ax25,\ + $(MODULES_DIR)/kernel/net/ax25/ax25.o \ + $(MODULES_DIR)/kernel/drivers/net/hamradio/mkiss.o \ +,CONFIG_AX25)) $(TARGETS): $(PACKAGE_DIR) @@ -192,8 +211,8 @@ $(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE) touch $(LINUX_DIR)/.unpacked $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked - $(PATCH) $(LINUX_DIR) ./patches/generic - [ -d ./patches/$(BOARD) ] && $(PATCH) $(LINUX_DIR) ./patches/$(BOARD) + $(PATCH) $(LINUX_DIR) ./patches/generic $(MAKE_TRACE) + [ -d ./patches/$(BOARD) ] && $(PATCH) $(LINUX_DIR) ./patches/$(BOARD) $(MAKE_TRACE) touch $(LINUX_DIR)/.patched $(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched @@ -202,24 +221,24 @@ $(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched $(LINUX_DIR)/Makefile \ $(LINUX_DIR)/arch/*/Makefile $(SED) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR)/arch/mips/Makefile - $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) oldconfig include/linux/version.h + $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) oldconfig include/linux/version.h $(MAKE_TRACE) touch $(LINUX_DIR)/.configured $(LINUX_DIR)/.depend_done: $(LINUX_DIR)/.configured - $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) dep + $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) dep $(MAKE_TRACE) touch $(LINUX_DIR)/.depend_done $(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.depend_done - $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) + $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) $(MAKE_TRACE) $(LINUX_KERNEL): $(LINUX_DIR)/vmlinux - $(TARGET_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@ + $(TARGET_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@ $(MAKE_TRACE) touch -c $(LINUX_KERNEL) - + $(LINUX_DIR)/.modules_done: $(LINUX_KERNEL) $(LINUX_IMAGE) rm -rf $(LINUX_BUILD_DIR)/modules - $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) modules - $(MAKE) -C $(LINUX_DIR) DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install + $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) modules $(MAKE_TRACE) + $(MAKE) -C $(LINUX_DIR) DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install $(MAKE_TRACE) touch $(LINUX_DIR)/.modules_done $(STAGING_DIR)/include/linux/version.h: $(LINUX_DIR)/.configured @@ -231,6 +250,7 @@ $(STAMP_DIR)/.linux-compile: $(LINUX_DIR)/.modules_done @mkdir -p $(STAMP_DIR) @$(MAKE) $(TARGETS) ln -sf $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(LINUX_DIR) + @$(TRACE) target/linux/package $(MAKE) -C $(TOPDIR)/target/linux/package \ $(KPKG_MAKEOPTS) \ compile @@ -242,45 +262,44 @@ $(TARGET_MODULES_DIR): $(KERNEL_IPKG): rm -rf $(KERNEL_IDIR) mkdir -p $(KERNEL_IDIR)/etc - $(SCRIPT_DIR)/make-ipkg-dir.sh $(KERNEL_IDIR) ../control/kernel.control $(PKG_RELEASE) $(ARCH) + $(SCRIPT_DIR)/make-ipkg-dir.sh $(KERNEL_IDIR) ../control/kernel.control $(PKG_RELEASE) $(ARCH) echo 'Package: kernel-$(LINUX_VERSION)-$(BOARD)' >> $(KERNEL_IDIR)/CONTROL/control if [ -f ./config/$(BOARD).modules ]; then \ cp ./config/$(BOARD).modules $(KERNEL_IDIR)/etc/modules; \ fi - $(IPKG_BUILD) $(KERNEL_IDIR) $(LINUX_BUILD_DIR) + $(IPKG_BUILD) $(KERNEL_IDIR) $(LINUX_BUILD_DIR) $(MAKE_TRACE) source: $(DL_DIR)/$(LINUX_SOURCE) prepare: $(LINUX_DIR)/.configured -compile: $(STAMP_DIR)/.linux-compile +compile: + $(MAKE) $(STAMP_DIR)/.linux-compile $(MAKE_TRACE) install: compile $(TARGET_MODULES_DIR) $(KERNEL_IPKG) rm -rf $(LINUX_BUILD_DIR)/root* + cp -fpR $(BUILD_DIR)/root $(LINUX_BUILD_DIR)/ echo -e 'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR)/ipkg.conf - $(MAKE) -C $(TOPDIR)/package \ - TARGET_DIR="$(LINUX_TARGET_DIR)" \ - IPKG_CONF="$(LINUX_BUILD_DIR)" \ - BOARD="$(BOARD)" \ - install $(MAKE) -C $(TOPDIR)/target/linux/package \ $(KPKG_MAKEOPTS) \ install - [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL) install $(INSTALL_TARGETS) || true + @{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL) install $(INSTALL_TARGETS) || true; } $(MAKE_TRACE) mostlyclean: + @$(PKG_TRACE) Cleaning... rm -f $(STAMP_DIR)/.linux-compile rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.modules_done rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.drivers-unpacked - $(MAKE) -C $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) clean + $(MAKE) -C $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) clean $(MAKE_TRACE) rm -f $(LINUX_KERNEL) $(LINUX_IMAGE) rebuild: -$(MAKE) mostlyclean if [ -f $(LINUX_KERNEL) ]; then \ - $(MAKE) clean; \ + $(MAKE) clean $(MAKE_TRACE); \ fi - $(MAKE) compile + $(MAKE) compile $(MAKE_TRACE) clean: + @$(PKG_TRACE) Cleaning... rm -f $(STAMP_DIR)/.linux-compile rm -rf $(LINUX_BUILD_DIR) rm -f $(TARGETS)