use a default uclibc++ config instead of multiple copies of the same
[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 if [ -f ./files/config.$(UCLIBC_TARGET_ARCH) ]; then \
47 cp ./files/config.$(UCLIBC_TARGET_ARCH) $(PKG_BUILD_DIR)/.config; \
48 else \
49 cp ./files/config.default $(PKG_BUILD_DIR)/.config; \
50 fi
51 endef
52
53 define Build/Compile
54 $(MAKE) -C $(PKG_BUILD_DIR) \
55 TOPDIR="$(PKG_BUILD_DIR)/" \
56 $(TARGET_CONFIGURE_OPTS) \
57 ARCH_CFLAGS="$(TARGET_CFLAGS)" \
58 CROSS="$(TARGET_CROSS)" \
59 CP="$(CP)" \
60 all
61 endef
62
63 define Build/InstallDev
64 mkdir -p $(STAGING_DIR)/usr/include
65 $(MAKE) -C $(PKG_BUILD_DIR) \
66 TOPDIR="$(PKG_BUILD_DIR)/" \
67 $(TARGET_CONFIGURE_OPTS) \
68 ARCH_CFLAGS="$(TARGET_CFLAGS)" \
69 CROSS="$(TARGET_CROSS)" \
70 DESTDIR="$(STAGING_DIR)" \
71 install
72 endef
73
74 define Build/UninstallDev
75 rm -rf $(STAGING_DIR)/lib/libuClibc++*.{a,so*}
76 endef
77
78 define Package/uclibcxx/install
79 $(INSTALL_DIR) $(1)/lib
80 $(CP) $(PKG_BUILD_DIR)/src/libuClibc++*.so.* $(1)/lib/
81 $(CP) $(PKG_BUILD_DIR)/src/libuClibc++-*.so $(1)/lib/
82 endef
83
84 $(eval $(call BuildPackage,uclibcxx))