add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[openwrt.git] / package / zlib / 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:=zlib
12 PKG_VERSION:=1.2.3
13 PKG_RELEASE:=3
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://www.zlib.net @SF/zlib
17 PKG_MD5SUM:=dee233bf288ee795ac96a98cc2e369b6
18 PKG_CAT:=bzcat
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/zlib
23 SECTION:=libs
24 CATEGORY:=Libraries
25 TITLE:=Library implementing the deflate compression method
26 URL:=http://www.zlib.net/
27 endef
28
29 define Build/Configure
30 (cd $(PKG_BUILD_DIR); \
31 $(TARGET_CONFIGURE_OPTS) \
32 LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
33 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
34 UNAME_S="Linux" \
35 ./configure \
36 --prefix=/usr \
37 --shared \
38 );
39 endef
40
41 define Build/Compile
42 $(MAKE) -C $(PKG_BUILD_DIR) \
43 $(TARGET_CONFIGURE_OPTS) \
44 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
45 libz.a libz.so
46 mkdir -p $(PKG_INSTALL_DIR)
47 $(MAKE) -C $(PKG_BUILD_DIR) \
48 DESTDIR="$(PKG_INSTALL_DIR)" \
49 install
50 endef
51
52 define Build/InstallDev
53 mkdir -p $(STAGING_DIR)/usr/include
54 $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
55 $(STAGING_DIR)/usr/include/
56 mkdir -p $(STAGING_DIR)/usr/lib
57 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
58 $(STAGING_DIR)/usr/lib/
59 endef
60
61 define Build/UninstallDev
62 rm -rf $(STAGING_DIR)/usr/include/z{conf,lib}.h \
63 $(STAGING_DIR)/usr/lib/libz.{a,so*}
64 endef
65
66 define Package/zlib/install
67 $(INSTALL_DIR) $(1)/usr/lib
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
69 endef
70
71 $(eval $(call BuildPackage,zlib))
This page took 0.05558 seconds and 5 git commands to generate.