Use common rules and templates, uniformize package Makefile, move ipkg related files...
[openwrt.git] / package / popt / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=popt
6 PKG_VERSION:=1.7
7 PKG_RELEASE:=4
8 PKG_MD5SUM:=5988e7aeb0ae4dac8d83561265984cc9
9
10 PKG_SOURCE_URL:= \
11 ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/ \
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/templates.mk
20
21 $(eval $(call PKG_template,LIBPOPT,libpopt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
22
23 include $(TOPDIR)/package/rules.mk
24
25 COMPILE_TARGETS += install-dev
26 CLEAN_TARGETS += uninstall-dev
27
28 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
29 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
30 $(TARGET_CONFIGURE_OPTS) \
31 CFLAGS="$(TARGET_CFLAGS)" \
32 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
33 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
34 ./configure \
35 --target=$(GNU_TARGET_NAME) \
36 --host=$(GNU_TARGET_NAME) \
37 --build=$(GNU_HOST_NAME) \
38 --program-prefix="" \
39 --program-suffix="" \
40 --prefix=/usr \
41 --exec-prefix=/usr \
42 --bindir=/usr/bin \
43 --datadir=/usr/share \
44 --includedir=/usr/include \
45 --infodir=/usr/share/info \
46 --libdir=/usr/lib \
47 --libexecdir=/usr/lib \
48 --localstatedir=/var \
49 --mandir=/usr/share/man \
50 --sbindir=/usr/sbin \
51 --sysconfdir=/etc \
52 $(DISABLE_NLS) \
53 $(DISABLE_LARGEFILE) \
54 --enable-shared \
55 --enable-static \
56 );
57 touch $(PKG_BUILD_DIR)/.configured
58
59 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
60 $(MAKE) -C $(PKG_BUILD_DIR)
61 touch $(PKG_BUILD_DIR)/.built
62
63 $(STAGING_DIR)/usr/lib/libpopt.so: $(PKG_BUILD_DIR)/.built
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 DESTDIR="$(STAGING_DIR)" \
66 install
67 rm -f $(STAGING_DIR)/usr/lib/libpopt.la
68
69 $(IPKG_LIBPOPT): $(IDIR_LIBPOPT)/CONTROL/control $(STAGING_DIR)/usr/lib/libpopt.so
70 mkdir -p $(IDIR_LIBPOPT)/usr/lib
71 cp -fpR $(STAGING_DIR)/usr/lib/libpopt.so.* $(IDIR_LIBPOPT)/usr/lib/
72 $(RSTRIP) $(IDIR_LIBPOPT)
73 mkdir -p $(PACKAGE_DIR)
74 $(IPKG_BUILD) $(IDIR_LIBPOPT) $(PACKAGE_DIR)
75
76 install-dev: $(STAGING_DIR)/usr/lib/libpopt.so
77
78 uninstall-dev:
79 -$(MAKE) -C $(PKG_BUILD_DIR) \
80 DESTDIR="$(STAGING_DIR)" \
81 uninstall
This page took 0.052494 seconds and 5 git commands to generate.