Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id$
  8. include $(TOPDIR)/rules.mk
  9. include $(INCLUDE_DIR)/kernel.mk
  10. PKG_NAME:=alsa-driver
  11. PKG_VERSION:=1.0.11
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  14. PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/driver/
  15. PKG_MD5SUM:=57534e4297cd683371402220e3753885
  16. PKG_CAT:=bzcat
  17. PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/kmod-alsa
  20. SECTION:=kernel
  21. CATEGORY:=Kernel drivers
  22. DEPENDS:=@USB_SUPPORT
  23. TITLE:=Advanced Linux Sound Architecture
  24. URL:=http://alsa-project.org/
  25. VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
  26. endef
  27. ifeq ($(KERNEL),2.4)
  28. ifeq ($(LINUX_KARCH),i386)
  29. KERNEL_C_OPTS:= -Os -mpreferred-stack-boundary=2 -march=i486 -fno-unit-at-a-time
  30. endif
  31. ifeq ($(LINUX_KARCH),mips)
  32. KERNEL_C_OPTS:= -Os -G 0 -mno-abicalls -fno-pic -finline-limit=100000 -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap
  33. endif
  34. endif
  35. ifeq ($(LINUX_KARCH),i386)
  36. KERNEL_C_INCS:= -I$(LINUX_DIR)/include/asm-i386/mach-generic -I$(LINUX_DIR)/include/asm-i386/mach-default
  37. endif
  38. ifeq ($(LINUX_KARCH),mips)
  39. KERNEL_C_INCS:= -I$(LINUX_DIR)/include/asm-mips/mach-generic
  40. endif
  41. define Build/Configure
  42. (cd $(PKG_BUILD_DIR); \
  43. CFLAGS="$(KERNEL_C_INCS)" \
  44. ./configure \
  45. --with-build="$(LINUX_DIR)" \
  46. --with-kernel="$(LINUX_DIR)" \
  47. --with-cross="$(KERNEL_CROSS)" \
  48. --with-redhat=no \
  49. --with-suse=no \
  50. --with-oss=yes \
  51. --with-isapnp=no \
  52. --with-sequencer=no \
  53. --with-cards=usb-audio \
  54. );
  55. endef
  56. define Build/Compile
  57. $(MAKE) -C $(PKG_BUILD_DIR) \
  58. ARCH="$(LINUX_KARCH)" \
  59. CROSS_COMPILE="$(TARGET_CROSS)" \
  60. c_opts="$(KERNEL_C_OPTS)" \
  61. all
  62. endef
  63. define Package/kmod-alsa/install
  64. install -d -m0755 $(1)/lib/modules/$(LINUX_VERSION)
  65. install -m0644 $(PKG_BUILD_DIR)/modules/*.$(LINUX_KMOD_SUFFIX) \
  66. $(1)/lib/modules/$(LINUX_VERSION)/
  67. install -d -m0755 $(1)/etc/modules.d
  68. install -m0644 ./files/alsa.modules $(1)/etc/modules.d/70-alsa
  69. endef
  70. $(eval $(call BuildPackage,kmod-alsa))