firmware-utils: move bcm_tag.h here
[openwrt/svn-archive/archive.git] / package / zlib / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=zlib
11 PKG_VERSION:=1.2.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.zlib.net @SF/libpng
16 PKG_MD5SUM:=2ab442d169156f34c379c968f3f482dd
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/zlib
21 SECTION:=libs
22 CATEGORY:=Libraries
23 TITLE:=Library implementing the deflate compression method
24 URL:=http://www.zlib.net/
25 endef
26
27 define Build/Configure
28 (cd $(PKG_BUILD_DIR); \
29 $(TARGET_CONFIGURE_OPTS) \
30 LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
31 CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
32 ./configure \
33 --prefix=/usr \
34 --shared \
35 --uname=Linux \
36 );
37 endef
38
39 define Build/Compile
40 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
41 $(TARGET_CONFIGURE_OPTS) \
42 CFLAGS="$(TARGET_CFLAGS)" \
43 libz.a libz.so.$(PKG_VERSION)
44 mkdir -p $(PKG_INSTALL_DIR)
45 $(MAKE) -C $(PKG_BUILD_DIR) \
46 DESTDIR="$(PKG_INSTALL_DIR)" \
47 install
48 endef
49
50 define Build/InstallDev
51 mkdir -p $(1)/usr/include
52 $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
53 $(1)/usr/include/
54 mkdir -p $(1)/usr/lib
55 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
56 $(1)/usr/lib/
57 mkdir -p $(1)/usr/lib/pkgconfig
58 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \
59 $(1)/usr/lib/pkgconfig/
60 endef
61
62 # libz.so is needed for openssl (zlib-dynamic)
63 define Package/zlib/install
64 $(INSTALL_DIR) $(1)/usr/lib
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so $(1)/usr/lib/
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
67 endef
68
69 $(eval $(call BuildPackage,zlib))