2aaeab1d23f21ba8160c6a42f0d5d5a65af45eec
[openwrt.git] / openwrt / package / pcre / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := pcre
6 PKG_VERSION := 5.0
7 PKG_RELEASE := 3
8 PKG_MD5SUM := 53976b62032fd5c76678274e5fd196b4
9
10 PKG_SOURCE_URL := ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ \
11 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
12 PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
14 PKG_CAT := zcat
15 PKG_IPK := $(PACKAGE_DIR)/lib$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
16 PKG_IPK_DIR := $(PKG_BUILD_DIR)/ipkg
17
18 $(DL_DIR)/$(PKG_SOURCE):
19 mkdir -p $(DL_DIR)
20 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
21
22 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE)
23 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
24 # $(PATCH) $(PKG_BUILD_DIR) ./patches
25 touch $(PKG_BUILD_DIR)/.patched
26
27 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
28 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
29 $(TARGET_CONFIGURE_OPTS) \
30 CFLAGS="$(TARGET_CFLAGS)" \
31 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
32 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
33 ./configure \
34 --target=$(GNU_TARGET_NAME) \
35 --host=$(GNU_TARGET_NAME) \
36 --build=$(GNU_HOST_NAME) \
37 --program-prefix="" \
38 --program-suffix="" \
39 --prefix=/usr \
40 --exec-prefix=/usr \
41 --bindir=/usr/bin \
42 --datadir=/usr/share \
43 --includedir=/usr/include \
44 --infodir=/usr/share/info \
45 --libdir=/usr/lib \
46 --libexecdir=/usr/lib \
47 --localstatedir=/var \
48 --mandir=/usr/share/man \
49 --sbindir=/usr/sbin \
50 --sysconfdir=/etc \
51 $(DISABLE_NLS) \
52 $(DISABLE_LARGEFILE) \
53 --enable-shared \
54 --enable-static \
55 --enable-utf8 \
56 );
57 touch $(PKG_BUILD_DIR)/.configured
58
59 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
60 $(MAKE) -C "$(PKG_BUILD_DIR)" \
61 CC_FOR_BUILD="$(HOSTCC)" \
62 LINK_FOR_BUILD="$(HOSTCC)" \
63 CFLAGS_FOR_BUILD="" \
64 dftables
65 $(MAKE) \
66 $(TARGET_CONFIGURE_OPTS) \
67 CFLAGS="$(TARGET_CFLAGS)" \
68
69 touch $(PKG_BUILD_DIR)/.built
70
71 $(STAGING_DIR)/usr/lib/libpcre.so: $(PKG_BUILD_DIR)/.built
72 $(MAKE) -C "$(PKG_BUILD_DIR)" \
73 DESTDIR="$(STAGING_DIR)" \
74 install
75 rm -f $(STAGING_DIR)/usr/lib/libpcre*.la
76
77 $(PKG_IPK): $(STAGING_DIR)/usr/lib/libpcre.so
78 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) libpcre.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
79 mkdir -p $(PKG_IPK_DIR)/usr/lib
80 cp -fp $(STAGING_DIR)/usr/lib/libpcre*.so.* $(PKG_IPK_DIR)/usr/lib/
81 $(STRIP) $(PKG_IPK_DIR)/usr/lib/*.so*
82 mkdir -p $(PACKAGE_DIR)
83 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
84
85 $(IPKG_STATE_DIR)/info/libpcre.list: $(PKG_IPK)
86 $(IPKG) install $(PKG_IPK)
87
88 source: $(DL_DIR)/$(PKG_SOURCE)
89 prepare: $(PKG_BUILD_DIR)/.patched
90 compile: $(PKG_IPK)
91 install: $(IPKG_STATE_DIR)/info/libpcre.list
92
93 clean:
94 rm -rf \
95 $(STAGING_DIR)/usr/bin/pcre-config \
96 $(STAGING_DIR)/usr/include/pcre* \
97 $(STAGING_DIR)/usr/lib/libpcre* \
98 $(STAGING_DIR)/usr/lib/pkgconfig/libpcre.pc \
99 $(STAGING_DIR)/usr/share/man/man*/pcre* \
100 $(PKG_BUILD_DIR) \
101 $(PKG_IPK) \
This page took 0.052471 seconds and 3 git commands to generate.