7fb1ccb682b69e801226613bff0ba1353bab1e38
[openwrt/svn-archive/archive.git] / libs / uclibc++ / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=uclibc++
12 PKG_VERSION:=0.2.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=uClibc++-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://cxx.uclibc.org/src/
17 PKG_MD5SUM:=6e6032c49916b199ffe6a585552fd46b
18 PKG_CAT:=bzcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/uClibc++-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/uclibcxx
25 NAME:=uclibc++
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=C++ library for embedded systems
29 URL:=http://cxx.uclibc.org/src/
30 endef
31
32 UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
33 -e 's/i.86/i386/' \
34 -e 's/sparc.*/sparc/' \
35 -e 's/m68k.*/m68k/' \
36 -e 's/ppc/powerpc/g' \
37 -e 's/v850.*/v850/g' \
38 -e 's/sh64/sh/' \
39 -e 's/sh[234].*/sh/' \
40 -e 's/mips.*/mips/' \
41 -e 's/mipsel.*/mips/' \
42 -e 's/cris.*/cris/' \
43 )
44
45 define Build/Configure
46 cp ./files/config.$(UCLIBC_TARGET_ARCH) $(PKG_BUILD_DIR)/.config
47 endef
48
49 define Build/Compile
50 $(MAKE) -C $(PKG_BUILD_DIR) \
51 TOPDIR="$(PKG_BUILD_DIR)/" \
52 $(TARGET_CONFIGURE_OPTS) \
53 ARCH_CFLAGS="$(TARGET_CFLAGS)" \
54 CROSS="$(TARGET_CROSS)" \
55 CP="$(CP)" \
56 all
57 endef
58
59 define Build/InstallDev
60 mkdir -p $(STAGING_DIR)/usr/include
61 $(MAKE) -C $(PKG_BUILD_DIR) \
62 TOPDIR="$(PKG_BUILD_DIR)/" \
63 $(TARGET_CONFIGURE_OPTS) \
64 ARCH_CFLAGS="$(TARGET_CFLAGS)" \
65 CROSS="$(TARGET_CROSS)" \
66 DESTDIR="$(STAGING_DIR)" \
67 install
68 endef
69
70 define Build/UninstallDev
71 rm -rf $(STAGING_DIR)/lib/libuClibc++*.{a,so*}
72 endef
73
74 define Package/uclibcxx/install
75 $(INSTALL_DIR) $(1)/lib
76 $(CP) $(PKG_BUILD_DIR)/src/libuClibc++*.so.* $(1)/lib/
77 $(CP) $(PKG_BUILD_DIR)/src/libuClibc++-*.so $(1)/lib/
78 endef
79
80 $(eval $(call BuildPackage,uclibcxx))