first try to configure pptp automatically
[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
18 IPKG_ZLIB:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
19 IDIR_ZLIB:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)
20 INFO_ZLIB:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
21
22 $(DL_DIR)/$(PKG_SOURCE):
23 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
24
25 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
26 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
27 $(PATCH) $(PKG_BUILD_DIR) ./patches
28 touch $(PKG_BUILD_DIR)/.prepared
29
30 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
31 (cd $(PKG_BUILD_DIR); \
32 $(TARGET_CONFIGURE_OPTS) \
33 ./configure \
34 --prefix=/usr \
35 --shared \
36 );
37 touch $(PKG_BUILD_DIR)/.configured
38
39 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
40 $(MAKE) -C $(PKG_BUILD_DIR) \
41 $(TARGET_CONFIGURE_OPTS) \
42 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
43 libz.a libz.so
44 touch $(PKG_BUILD_DIR)/.built
45
46 $(STAGING_DIR)/usr/lib/libz.so: $(PKG_BUILD_DIR)/.built
47 $(MAKE) -C $(PKG_BUILD_DIR) \
48 DESTDIR="$(STAGING_DIR)" \
49 install
50
51 $(IPKG_ZLIB): $(STAGING_DIR)/usr/lib/libz.so
52 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_ZLIB) ./ipkg/$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
53 mkdir -p $(IDIR_ZLIB)/usr/lib
54 cp -fpR $(STAGING_DIR)/usr/lib/libz.so.* $(IDIR_ZLIB)/usr/lib/
55 $(STRIP) $(IDIR_ZLIB)/usr/lib/lib*.so*
56 mkdir -p $(PACKAGE_DIR)
57 $(IPKG_BUILD) $(IDIR_ZLIB) $(PACKAGE_DIR)
58
59 $(INFO_ZLIB): $(IPKG_ZLIB)
60 $(IPKG) install $(IPKG_ZLIB)
61
62 source: $(DL_DIR)/$(PKG_SOURCE)
63 prepare: $(PKG_BUILD_DIR)/.prepared
64 compile: $(IPKG_ZLIB)
65 install: $(INFO_ZLIB)
66
67 clean:
68 rm -rf $(STAGING_DIR)/usr/include/z{conf,lib}.h
69 rm -rf $(STAGING_DIR)/usr/lib/libz.{a,so*}
70 rm -rf $(STAGING_DIR)/usr/share/man/man*/zlib.*
71 rm -rf $(PKG_BUILD_DIR) $(IPKG_ZLIB)
This page took 0.039888 seconds and 5 git commands to generate.