move compile-time package dependencies in a separate file (sdk-compatible)
[openwrt/svn-archive/archive.git] / openwrt / package / sqlite2 / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=sqlite2
6 PKG_VERSION:=2.8.17
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=838dbac20b56d2c4292e98848505a05b
9
10 PKG_SOURCE_URL:=http://www.sqlite.org/
11 PKG_SOURCE:=sqlite-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/sqlite-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 include $(TOPDIR)/package/rules.mk
18
19 $(eval $(call PKG_template,LIBSQLITE2,libsqlite2,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20 $(eval $(call PKG_template,SQLITE2_CLI,sqlite2-cli,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
21
22 $(PKG_BUILD_DIR)/.configured:
23 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
24 $(TARGET_CONFIGURE_OPTS) \
25 CFLAGS="$(TARGET_CFLAGS)" \
26 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
27 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
28 config_BUILD_CC="$(HOSTCC)" \
29 config_BUILD_CFLAGS="-O2" \
30 config_TARGET_CC="$(TARGET_CC)" \
31 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
32 config_TARGET_READLINE_INC="-I$(STAGING_DIR)/usr/include" \
33 config_TARGET_READLINE_LIBS="-L$(STAGING_DIR)/usr/lib -lreadline -lncurses" \
34 config_TARGET_TCL_INC="-DNO_TCL=1" \
35 ./configure \
36 --target=$(GNU_TARGET_NAME) \
37 --host=$(GNU_TARGET_NAME) \
38 --build=$(GNU_HOST_NAME) \
39 --program-prefix="" \
40 --program-suffix="" \
41 --prefix=/usr \
42 --exec-prefix=/usr \
43 --bindir=/usr/bin \
44 --datadir=/usr/share \
45 --includedir=/usr/include \
46 --infodir=/usr/share/info \
47 --libdir=/usr/lib \
48 --libexecdir=/usr/lib \
49 --localstatedir=/var \
50 --mandir=/usr/share/man \
51 --sbindir=/usr/sbin \
52 --sysconfdir=/etc \
53 $(DISABLE_LARGEFILE) \
54 --enable-shared \
55 --enable-static \
56 );
57 touch $@
58
59 $(PKG_BUILD_DIR)/.built:
60 rm -rf $(PKG_INSTALL_DIR)
61 mkdir -p $(PKG_INSTALL_DIR)
62 $(MAKE) -C $(PKG_BUILD_DIR) \
63 DESTDIR="$(PKG_INSTALL_DIR)" \
64 all install
65 touch $@
66
67 $(IPKG_LIBSQLITE2):
68 install -d -m0755 $(IDIR_LIBSQLITE2)/usr/lib
69 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.so.* $(IDIR_LIBSQLITE2)/usr/lib/
70 $(RSTRIP) $(IDIR_LIBSQLITE2)
71 $(IPKG_BUILD) $(IDIR_LIBSQLITE2) $(PACKAGE_DIR)
72
73 $(IPKG_SQLITE2_CLI):
74 install -d -m0755 $(IDIR_SQLITE2_CLI)/usr/bin
75 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sqlite $(IDIR_SQLITE2_CLI)/usr/bin/
76 $(RSTRIP) $(IDIR_SQLITE2_CLI)
77 $(IPKG_BUILD) $(IDIR_SQLITE2_CLI) $(PACKAGE_DIR)
78
79 $(STAGING_DIR)/usr/lib/libsqlite.so: $(PKG_BUILD_DIR)/.built
80 mkdir -p $(STAGING_DIR)/usr/include
81 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite.h $(STAGING_DIR)/usr/include/
82 mkdir -p $(STAGING_DIR)/usr/lib
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.{a,so*} $(STAGING_DIR)/usr/lib/
84 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite.pc $(STAGING_DIR)/usr/lib/pkgconfig/
86 touch $@
87
88 install-dev: $(STAGING_DIR)/usr/lib/libsqlite.so
89
90 uninstall-dev:
91 rm -rf \
92 $(STAGING_DIR)/usr/include/sqlite.h \
93 $(STAGING_DIR)/usr/lib/libsqlite.{a,so*} \
94 $(STAGING_DIR)/usr/lib/pkgconfig/sqlite.pc \
95
96 compile-targets: install-dev
97 clean-targets: uninstall-dev
98
99 mostlyclean:
100 -$(MAKE) -C $(PKG_BUILD_DIR) clean
101 rm -f $(PKG_BUILD_DIR)/.built