libmad: cleanup, fix cflags
[openwrt/svn-archive/archive.git] / libs / libmad / Makefile
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
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libmad
12 PKG_VERSION:=0.15.1b
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/mad \
17 ftp://ftp.mars.org/pub/mpeg/
18 PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 FPM:=default
27 ifeq ($(ARCH),armeb)
28 FPM:=arm
29 endif
30 ifeq ($(ARCH),i386)
31 FPM:=intel
32 endif
33 ifeq ($(ARCH),mipsel)
34 FPM:=mips
35 endif
36
37 define Package/libmad
38 SECTION:=libs
39 CATEGORY:=Libraries
40 TITLE:=An high-quality MPEG audio decoding library
41 DESCRIPTION:=\
42 MAD is a high-quality MPEG audio decoder. It currently supports \\\
43 MPEG-1 and the MPEG-2 extension to lower sampling frequencies, \\\
44 as well as the de facto MPEG 2.5 format. All three audio layers - \\\
45 Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented.
46 URL:=http://www.underbit.com/products/mad/
47 endef
48
49 CONFIGURE_ARGS += \
50 --enable-shared \
51 --enable-static \
52 --enable-fpm="$(FPM)" \
53 --disable-debugging \
54 --enable-speed \
55
56 MAKE_FLAGS += \
57 CFLAGS="$(TARGET_CFLAGS)" \
58 DESTDIR="$(PKG_INSTALL_DIR)" \
59 all install
60
61 define Build/InstallDev
62 mkdir -p $(STAGING_DIR)/usr/include
63 $(CP) $(PKG_INSTALL_DIR)/usr/include/mad.h $(STAGING_DIR)/usr/include/
64 mkdir -p $(STAGING_DIR)/usr/lib
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.{a,so*} $(STAGING_DIR)/usr/lib/
66 endef
67
68 define Build/UninstallDev
69 rm -rf \
70 $(STAGING_DIR)/usr/include/mad.h \
71 $(STAGING_DIR)/usr/lib/libmad.{a,so*}
72 endef
73
74 define Package/libmad/install
75 $(INSTALL_DIR) $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.so.* $(1)/usr/lib/
77 endef
78
79 $(eval $(call BuildPackage,libmad))