add quotes to TARGET_CC and TARGET_CROSS to help with distcc and ccache
[openwrt/svn-archive/archive.git] / libs / libaudiofile / 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:=libaudiofile
12 PKG_VERSION:=0.2.6
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://www.cti.ecp.fr/~beauxir5/peercast
18 PKG_MD5SUM:=460f848ce5f4a33ae66b15a4fb7720ec
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libaudiofile
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Audio File library
29 DESCRIPTION:=Audio File library.\\\
30 The audiofile library allows the processing of audio data to and from audio \\\
31 files of many common formats (currently AIFF, AIFF-C, WAVE, NeXT/Sun, BICS, \\\
32 and raw data).
33 URL:=http://www.68k.org/~michael/audiofile/
34 endef
35
36 define Build/Configure
37 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
38 $(TARGET_CONFIGURE_OPTS) \
39 CFLAGS="$(TARGET_CFLAGS)" \
40 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
41 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
42 ac_cv_linux_vers=$(BR2_DEFAULT_KERNEL_HEADERS) \
43 ./configure \
44 --target=$(GNU_TARGET_NAME) \
45 --host=$(GNU_TARGET_NAME) \
46 --build=$(GNU_HOST_NAME) \
47 --program-prefix="" \
48 --program-suffix="" \
49 --prefix=/usr \
50 --exec-prefix=/usr \
51 --bindir=/usr/bin \
52 --datadir=/usr/share \
53 --includedir=/usr/include \
54 --infodir=/usr/share/info \
55 --libdir=/usr/lib \
56 --libexecdir=/usr/lib \
57 --localstatedir=/var \
58 --mandir=/usr/share/man \
59 --sbindir=/usr/sbin \
60 --sysconfdir=/etc \
61 $(DISABLE_NLS) \
62 $(DISABLE_LARGEFILE) \
63 --enable-shared \
64 --enable-static \
65 --with-build-cc="$(HOSTCC)" \
66 );
67 endef
68
69 define Build/Compile
70 rm -rf $(PKG_INSTALL_DIR)
71 mkdir -p $(PKG_INSTALL_DIR)
72 $(MAKE) -C $(PKG_BUILD_DIR) \
73 CCOPT="$(TARGET_CFLAGS)" \
74 DESTDIR="$(PKG_INSTALL_DIR)" \
75 all install
76 endef
77
78 define Package/libaudiofile/install
79 install -m0755 -d $(1)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.so.* $(1)/usr/lib/
81 endef
82
83 define Build/InstallDev
84 mkdir -p $(STAGING_DIR)/usr/bin
85 $(CP) $(PKG_INSTALL_DIR)/usr/bin/audiofile-config $(STAGING_DIR)/usr/bin/
86 mkdir -p $(STAGING_DIR)/usr/include
87 $(CP) $(PKG_INSTALL_DIR)/usr/include/af_vfs.h $(STAGING_DIR)/usr/include/
88 $(CP) $(PKG_INSTALL_DIR)/usr/include/audiofile.h $(STAGING_DIR)/usr/include/
89 $(CP) $(PKG_INSTALL_DIR)/usr/include/aupvlist.h $(STAGING_DIR)/usr/include/
90 mkdir -p $(STAGING_DIR)/usr/lib
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.{a,so*} $(STAGING_DIR)/usr/lib/
92 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/audiofile.pc $(STAGING_DIR)/usr/lib/pkgconfig/
94 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/audiofile.pc
95 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/audiofile.pc
96 endef
97
98 define Build/UninstallDev
99 rm -rf \
100 $(STAGING_DIR)/usr/include/af_vfs.h \
101 $(STAGING_DIR)/usr/include/audiofile.h \
102 $(STAGING_DIR)/usr/include/aupvlist.h \
103 $(STAGING_DIR)/usr/lib/libaudiofile.{a,so*} \
104 $(STAGING_DIR)/usr/lib/pkgconfig/libaudiofile.pc
105 endef
106
107 $(eval $(call BuildPackage,libaudiofile))