update alsa, fix compile
[openwrt/svn-archive/archive.git] / openwrt / target / linux / package / alsa / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4 include ../../rules.mk
5
6 PKG_NAME:=alsa-driver
7 PKG_VERSION:=1.0.11rc4
8 PKG_RELEASE:=1
9 PKG_MD5SUM:=8e5794026082a964b09b46f9d881e6ec
10
11 PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/driver/
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
13 PKG_CAT:=bzcat
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16
17 include $(TOPDIR)/package/rules.mk
18
19 ifeq ($(LINUX_KARCH),i386)
20 KERNEL_C_INCS:= -I$(LINUX_DIR)/include/asm-i386/mach-generic -I$(LINUX_DIR)/include/asm-i386/mach-default
21 KERNEL_C_OPTS:= -Os -mpreferred-stack-boundary=2 -march=i486 -fno-unit-at-a-time
22 endif
23 ifeq ($(LINUX_KARCH),mips)
24 KERNEL_C_INCS:= -I$(LINUX_DIR)/include/asm-mips/mach-generic
25 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
26 endif
27
28 $(eval $(call PKG_template,KMOD_ALSA,kmod-alsa,$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE),$(ARCH),kernel ($(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE))))
29
30 $(PKG_BUILD_DIR)/.configured:
31 (cd $(PKG_BUILD_DIR); \
32 CFLAGS="$(KERNEL_C_INCS)" \
33 ./configure \
34 --with-build=$(LINUX_DIR) \
35 --with-kernel=$(LINUX_DIR) \
36 --with-cross=$(KERNEL_CROSS) \
37 --with-redhat=no \
38 --with-suse=no \
39 --with-oss=yes \
40 --with-isapnp=no \
41 --with-sequencer=no \
42 --with-cards=usb-audio \
43 );
44 touch $@
45
46 $(PKG_BUILD_DIR)/.built:
47 $(MAKE) -C $(PKG_BUILD_DIR) \
48 ARCH="$(LINUX_KARCH)" \
49 CROSS_COMPILE="$(TARGET_CROSS)" \
50 c_opts="$(KERNEL_C_OPTS)" \
51 all
52 touch $@
53
54 $(IPKG_KMOD_ALSA):
55 install -d -m0755 $(IDIR_KMOD_ALSA)/etc/modules.d
56 install -m0644 ./files/alsa.modules $(IDIR_KMOD_ALSA)/etc/modules.d/70-alsa
57 install -d -m0755 $(IDIR_KMOD_ALSA)/lib/modules/$(LINUX_VERSION)
58 install -m0644 $(PKG_BUILD_DIR)/modules/*.$(LINUX_KMOD_SUFFIX) \
59 $(IDIR_KMOD_ALSA)/lib/modules/$(LINUX_VERSION)/
60 $(IPKG_BUILD) $(IDIR_KMOD_ALSA) $(PACKAGE_DIR)