Convert zlib to new packaging style
[openwrt.git] / package / zlib / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=zlib
6 PKG_VERSION:=1.2.2
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=68bd51aaa6558c3bc3fd4890e53413de
9
10 PKG_SOURCE_URL:=\
11 http://www.zlib.net/ \
12 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_CAT:=zcat
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
18
19 include $(TOPDIR)/package/rules.mk
20
21 $(eval $(call PKG_template,ZLIB,zlib,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
22
23 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
24 (cd $(PKG_BUILD_DIR); \
25 $(TARGET_CONFIGURE_OPTS) \
26 ./configure \
27 --prefix=/usr \
28 --shared \
29 );
30 touch $(PKG_BUILD_DIR)/.configured
31
32 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
33 $(MAKE) -C $(PKG_BUILD_DIR) \
34 $(TARGET_CONFIGURE_OPTS) \
35 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
36 libz.a libz.so
37 mkdir -p $(PKG_INSTALL_DIR)
38 $(MAKE) -C $(PKG_BUILD_DIR) \
39 DESTDIR="$(PKG_INSTALL_DIR)" \
40 install
41 touch $(PKG_BUILD_DIR)/.built
42
43 $(IPKG_ZLIB):
44 install -m0755 -d $(IDIR_ZLIB)/usr/lib
45 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(IDIR_ZLIB)/usr/lib/
46 $(RSTRIP) $(IDIR_ZLIB)
47 $(IPKG_BUILD) $(IDIR_ZLIB) $(PACKAGE_DIR)
48
49 $(STAGING_DIR)/usr/lib/libz.so: $(PKG_BUILD_DIR)/.built
50 mkdir -p $(STAGING_DIR)/usr/include
51 cp -fpR $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h $(STAGING_DIR)/usr/include
52 mkdir -p $(STAGING_DIR)/usr/lib
53 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} $(STAGING_DIR)/usr/include
54 touch $(STAGING_DIR)/usr/lib/libz.so
55
56 install-dev: $(STAGING_DIR)/usr/lib/libz.so
57
58 uninstall-dev:
59 rm -rf $(STAGING_DIR)/usr/include/z{conf,lib}.h
60 rm -rf $(STAGING_DIR)/usr/lib/libz.{a,so*}
61
62 compile: install-dev
63 clean: uninstall-dev
This page took 0.044161 seconds and 5 git commands to generate.