Add libpcre dependency for atftp, closes #432
[openwrt.git] / rules.mk
1 include $(TOPDIR)/.config
2 SHELL=/bin/bash
3 export SHELL
4
5 ifeq ($(V),)
6 V=5
7 endif
8
9
10 ifneq ($(V),0)
11 TRACE:=echo "---> "
12 START_TRACE:=echo -n "---> "
13 END_TRACE:=echo
14 else
15 START_TRACE:=:
16 END_TRACE:=:
17 TRACE:=:
18 endif
19
20 ifeq (${shell [ "$(V)" -ge 5 ] && echo 1},)
21 CMD_TRACE:=:
22 PKG_TRACE:=:
23 else
24 CMD_TRACE:=echo -n
25 PKG_TRACE:=echo "------> "
26 endif
27
28 ifeq (${shell [ "$(V)" -ge 10 ] && echo 1},)
29 EXTRA_MAKEFLAGS:=-s
30 MAKE_TRACE:=2>&1 >&/dev/null || { echo "Build failed. Please re-run make with V=99 to see what's going on"; /bin/false; }
31 else
32 MAKE_TRACE:=
33 EXTRA_MAKEFLAGS:=
34 TRACE:=:
35 PKG_TRACE:=:
36 CMD_TRACE:=:
37 START_TRACE:=:
38 END_TRACE:=:
39 endif
40
41 CP=cp -fpR
42 MAKE1=make
43 MAKEFLAGS=-j$(BR2_JLEVEL) V=$(V) $(EXTRA_MAKEFLAGS)
44 # Strip off the annoying quoting
45 ARCH:=$(strip $(subst ",, $(BR2_ARCH)))
46 WGET:=$(strip $(subst ",, $(BR2_WGET)))
47 GCC_VERSION:=$(strip $(subst ",, $(BR2_GCC_VERSION)))
48 GCC_USE_SJLJ_EXCEPTIONS:=$(strip $(subst ",, $(BR2_GCC_USE_SJLJ_EXCEPTIONS)))
49 TARGET_OPTIMIZATION:=$(strip $(subst ",, $(BR2_TARGET_OPTIMIZATION)))
50 #"))"))"))"))")) # for vim's broken syntax highlighting :)
51
52
53 ifeq ($(BR2_SOFT_FLOAT),y)
54 # gcc 3.4.x soft float configuration is different than previous versions.
55 ifeq ($(findstring 3.4.,$(GCC_VERSION)),3.4.)
56 SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
57 else
58 SOFT_FLOAT_CONFIG_OPTION:=--without-float
59 endif
60 TARGET_SOFT_FLOAT:=-msoft-float
61 ARCH_FPU_SUFFIX:=_nofpu
62 else
63 SOFT_FLOAT_CONFIG_OPTION:=
64 TARGET_SOFT_FLOAT:=
65 ARCH_FPU_SUFFIX:=
66 endif
67
68
69 ifeq ($(BR2_TAR_VERBOSITY),y)
70 TAR_OPTIONS=-xvf
71 else
72 TAR_OPTIONS=-xf
73 endif
74
75 ifneq ($(BR2_LARGEFILE),y)
76 DISABLE_LARGEFILE= --disable-largefile
77 endif
78 TARGET_CFLAGS:=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
79
80 OPTIMIZE_FOR_CPU=$(ARCH)
81 HOSTCC:=gcc
82 BASE_DIR:=$(TOPDIR)
83 DL_DIR:=$(BASE_DIR)/dl
84 BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)$(ARCH_FPU_SUFFIX)
85 STAGING_DIR:=$(BASE_DIR)/staging_dir_$(ARCH)$(ARCH_FPU_SUFFIX)
86 SCRIPT_DIR:=$(BASE_DIR)/scripts
87 BIN_DIR:=$(BASE_DIR)/bin
88 STAMP_DIR:=$(BUILD_DIR)/stamp
89 PACKAGE_DIR:=$(BIN_DIR)/packages
90 STAMP_DIR:=$(BUILD_DIR)/stamp
91 TARGET_DIR:=$(BUILD_DIR)/root
92 TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build_$(ARCH)$(ARCH_FPU_SUFFIX)
93 TARGET_PATH=$(STAGING_DIR)/usr/bin:$(STAGING_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin
94 IMAGE:=$(BUILD_DIR)/root_fs_$(ARCH)$(ARCH_FPU_SUFFIX)
95 REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux-uclibc
96 GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
97 KERNEL_CROSS:=$(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-
98 TARGET_CROSS:=$(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-
99 TARGET_CC:=$(TARGET_CROSS)gcc
100 STRIP:=$(STAGING_DIR)/bin/sstrip
101 PATCH=$(SCRIPT_DIR)/patch-kernel.sh
102 SED:=$(STAGING_DIR)/bin/sed -i -e
103 LINUX_DIR:=$(BUILD_DIR)/linux
104 LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux
105
106
107 HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
108 -e 's/sparc.*/sparc/' \
109 -e 's/arm.*/arm/g' \
110 -e 's/m68k.*/m68k/' \
111 -e 's/ppc/powerpc/g' \
112 -e 's/v850.*/v850/g' \
113 -e 's/sh[234]/sh/' \
114 -e 's/mips-.*/mips/' \
115 -e 's/mipsel-.*/mipsel/' \
116 -e 's/cris.*/cris/' \
117 -e 's/i[3-9]86/i386/' \
118 )
119 GNU_HOST_NAME:=$(HOST_ARCH)-pc-linux-gnu
120 TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
121 AR=$(TARGET_CROSS)ar \
122 AS=$(TARGET_CROSS)as \
123 LD=$(TARGET_CROSS)ld \
124 NM=$(TARGET_CROSS)nm \
125 CC=$(TARGET_CROSS)gcc \
126 GCC=$(TARGET_CROSS)gcc \
127 CXX=$(TARGET_CROSS)g++ \
128 RANLIB=$(TARGET_CROSS)ranlib
129
130 ifeq ($(ENABLE_LOCALE),true)
131 DISABLE_NLS:=
132 else
133 DISABLE_NLS:=--disable-nls
134 endif
135
136 ifeq ($(BR2_ENABLE_MULTILIB),y)
137 MULTILIB:=--enable-multilib
138 endif
139
140 # invoke ipkg-build with some default options
141 IPKG_BUILD := PATH="$(TARGET_PATH)" ipkg-build -c -o root -g root
142 # where to build (and put) .ipk packages
143 IPKG_TARGET_DIR := $(PACKAGE_DIR)
144 IPKG:=IPKG_TMP=$(BUILD_DIR)/tmp IPKG_INSTROOT=$(TARGET_DIR) IPKG_CONF_DIR=$(STAGING_DIR)/etc IPKG_OFFLINE_ROOT=$(BUILD_DIR)/root $(SCRIPT_DIR)/ipkg -force-defaults -force-depends
145 IPKG_STATE_DIR := $(TARGET_DIR)/usr/lib/ipkg
146
147 RSTRIP:=STRIP="$(STRIP)" $(SCRIPT_DIR)/rstrip.sh
148 RSTRIP_KMOD:=STRIP="$(TARGET_CROSS)strip --strip-unneeded --remove-section=.comment" $(SCRIPT_DIR)/rstrip.sh
149
This page took 0.053557 seconds and 5 git commands to generate.