[package/mac80211]: tune ath dependencies - carl9170 can be used on targets with...
[openwrt.git] / toolchain / uClibc / Makefile
1
2
3 #
4 # Copyright (C) 2006-2010 OpenWrt.org
5 #
6 # This is free software, licensed under the GNU General Public License v2.
7 # See /LICENSE for more information.
8 #
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/target.mk
11
12 PKG_NAME:=uClibc
13 PKG_VERSION:=$(call qstrip,$(CONFIG_UCLIBC_VERSION))
14 ifeq ($(CONFIG_UCLIBC_VERSION_0_9_32),y)
15 PKG_SOURCE_URL:=git://git.busybox.net/uClibc
16 PKG_SOURCE_PROTO:=git
17 PKG_SOURCE_VERSION:=4ac7ad3543dd6d7780e71af80fa5c45414451719
18 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20 LIBC_SO_VERSION:=$(PKG_VERSION)-rc1-git
21 else
22 PKG_SOURCE_URL:=http://www.uclibc.org/downloads
23 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
24 LIBC_SO_VERSION:=$(PKG_VERSION)
25 endif
26 PATCH_DIR:=./patches-$(PKG_VERSION)
27 CONFIG_DIR:=./config-$(PKG_VERSION)
28
29 PKG_MD5SUM_0.9.30.1 = 1a4b84e5536ad8170563ffa88c34679c
30 PKG_MD5SUM_0.9.31 = 52fb8a494758630c8d3ddd7f1e0daafd
31 PKG_MD5SUM=$(PKG_MD5SUM_$(PKG_VERSION))
32
33 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
34
35 include $(INCLUDE_DIR)/toolchain-build.mk
36
37 HOST_STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed
38 HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc-utils_installed
39
40 UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
41 -e 's/i.86/i386/' \
42 -e 's/sparc.*/sparc/' \
43 -e 's/arm.*/arm/g' \
44 -e 's/avr32.*/avr32/g' \
45 -e 's/m68k.*/m68k/' \
46 -e 's/ppc/powerpc/g' \
47 -e 's/v850.*/v850/g' \
48 -e 's/sh64/sh/' \
49 -e 's/sh[234].*/sh/' \
50 -e 's/mips.*/mips/' \
51 -e 's/mipsel.*/mips/' \
52 -e 's/cris.*/cris/' \
53 )
54
55
56 define Host/SetToolchainInfo
57 $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
58 $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk
59 $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
60 $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk
61 endef
62
63 GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \
64 $(if $(wildcard $(CONFIG_DIR)/common),'+' $(CONFIG_DIR)/common) \
65 $(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard $(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \
66 $(CONFIG_DIR)/$(ARCH)$(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD))
67
68 define Host/Prepare
69 $(call Host/SetToolchainInfo)
70 $(call Host/Prepare/Default)
71 $(if $(strip $(QUILT)), \
72 cd $(HOST_BUILD_DIR); \
73 if $(QUILT_CMD) next >/dev/null 2>&1; then \
74 $(QUILT_CMD) push -a; \
75 fi
76 )
77 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
78 $(GEN_CONFIG) > $(HOST_BUILD_DIR)/.config
79 $(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/include\",g' \
80 -e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \
81 -e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \
82 -e 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=$(if $(CONFIG_LARGEFILE),y,n),g' \
83 -e 's,^.*CONFIG_ARM_EABI.*,CONFIG_ARM_EABI=$(if $(CONFIG_EABI_SUPPORT),y,n),g' \
84 -e 's,^.*CONFIG_ARM_OABI.*,CONFIG_ARM_OABI=$(if $(CONFIG_EABI_SUPPORT),n,y),g' \
85 -e 's,^.*UCLIBC_HAS_SHADOW.*,UCLIBC_HAS_SHADOW=$(if $(CONFIG_SHADOW_PASSWORDS),y,n),g' \
86 $(HOST_BUILD_DIR)/.config
87 $(MAKE) -C $(HOST_BUILD_DIR) oldconfig KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS"
88 $(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS"
89 PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \
90 PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
91 DEVEL_PREFIX=/ \
92 RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
93 HOSTCC="$(HOSTCC)" \
94 CC="$(TARGET_CC)" \
95 CPU_CFLAGS="$(TARGET_CFLAGS)" \
96 ARCH="$(CONFIG_ARCH)" \
97 pregen \
98 install_headers
99 endef
100
101 define Host/Configure
102 endef
103
104 CPU_CFLAGS = \
105 -funsigned-char -fno-builtin -fno-asm \
106 --std=gnu99 -ffunction-sections -fdata-sections \
107 $(TARGET_CFLAGS)
108
109 UCLIBC_MAKE = PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \
110 $(TARGET_CONFIGURE_OPTS) \
111 DEVEL_PREFIX=/ \
112 RUNTIME_PREFIX=/ \
113 HOSTCC="$(HOSTCC)" \
114 CPU_CFLAGS="$(CPU_CFLAGS)" \
115 ARCH="$(CONFIG_ARCH)" \
116 LIBGCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" \
117 DOSTRIP=""
118
119 define Host/Compile
120 $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak
121 $(UCLIBC_MAKE) $(TOOLCHAIN_JOBS) PREFIX= all
122 $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev
123 $(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/
124 $(CP) $(HOST_BUILD_DIR)/libpthread/*/libpthread_so.a $(TOOLCHAIN_DIR)/lib/
125 ( cd $(TOOLCHAIN_DIR) ; \
126 for d in lib usr/lib ; do \
127 for f in libc.so libpthread.so libgcc_s.so ; do \
128 if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \
129 $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
130 fi \
131 done \
132 done \
133 )
134 endef
135
136 define Host/Install
137 $(UCLIBC_MAKE) PREFIX= utils
138 $(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin
139 $(INSTALL_BIN) \
140 $(HOST_BUILD_DIR)/utils/ldd \
141 $(TOOLCHAIN_DIR)/bin/
142 $(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin
143 $(INSTALL_BIN) \
144 $(HOST_BUILD_DIR)/utils/ldconfig \
145 $(TOOLCHAIN_DIR)/sbin/
146 endef
147
148 define Host/Clean
149 rm -rf \
150 $(HOST_BUILD_DIR) \
151 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
152 $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
153 endef
154
155 $(eval $(call HostBuild))
This page took 0.054962 seconds and 5 git commands to generate.