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