]>
Commit | Line | Data |
---|---|---|
2d523c23 | 1 | # Makefile for buildroot2 |
ffde94bd | 2 | # |
15b26aee | 3 | # Copyright (C) 1999-2005 by Erik Andersen <[email protected]> |
2671be4d | 4 | # Copyright (C) 2006-2009 by the Buildroot developers <[email protected]> |
ffde94bd | 5 | # |
08782ae7 | 6 | # This program is free software; you can redistribute it and/or modify |
2d523c23 EA |
7 | # it under the terms of the GNU General Public License as published by |
8 | # the Free Software Foundation; either version 2 of the License, or | |
9 | # (at your option) any later version. | |
ffde94bd | 10 | # |
2d523c23 EA |
11 | # This program is distributed in the hope that it will be useful, |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
08782ae7 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2d523c23 | 14 | # General Public License for more details. |
ffde94bd | 15 | # |
2d523c23 EA |
16 | # You should have received a copy of the GNU General Public License |
17 | # along with this program; if not, write to the Free Software | |
18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
3ad3d8a1 | 19 | # |
02bf5816 | 20 | |
2d523c23 EA |
21 | #-------------------------------------------------------------- |
22 | # Just run 'make menuconfig', configure stuff, then run 'make'. | |
23 | # You shouldn't need to mess with anything beyond this point... | |
24 | #-------------------------------------------------------------- | |
25 | TOPDIR=./ | |
18d979c7 BRF |
26 | CONFIG_CONFIG_IN=Config.in |
27 | CONFIG_DEFCONFIG=.defconfig | |
28 | CONFIG=package/config | |
a8ee1240 | 29 | DATE:=$(shell date +%Y%m%d) |
a0aef7c4 | 30 | |
18d979c7 | 31 | noconfig_targets:=menuconfig config oldconfig randconfig \ |
6547bced | 32 | defconfig allyesconfig allnoconfig release tags \ |
e491fba2 | 33 | source-check help |
9e250356 | 34 | |
cad58108 | 35 | |
a1b0651a | 36 | # Use shell variables, if defined |
7521f373 | 37 | ifneq ($(BUILDROOT_LOCAL),) |
efd8576c | 38 | BR2_LOCAL:=$(BUILDROOT_LOCAL) |
7521f373 | 39 | else |
2ad346ab | 40 | BR2_LOCAL:=$(TOPDIR)/local |
a1b0651a US |
41 | endif |
42 | ||
f85f2de1 PK |
43 | # Variables for use in Make constructs |
44 | comma:=, | |
45 | empty:= | |
46 | space:=$(empty) $(empty) | |
47 | ||
a1b0651a US |
48 | # $(shell find . -name *_defconfig |sed 's/.*\///') |
49 | # Pull in the user's configuration file | |
50 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) | |
51 | ifeq ($(BOARD),) | |
52 | # if "make BOARD=xyz" command | |
d45f355d | 53 | -include .config |
a1b0651a US |
54 | else |
55 | # if "make" command | |
efd8576c | 56 | -include $(BR2_LOCAL)/$(BOARD)/$(BOARD).config |
a1b0651a | 57 | endif |
7521f373 | 58 | endif |
9741a49e | 59 | |
efd8576c US |
60 | # Override BR2_DL_DIR if shell variable defined |
61 | ifneq ($(BUILDROOT_DL_DIR),) | |
62 | BR2_DL_DIR:=$(BUILDROOT_DL_DIR) | |
63 | endif | |
64 | LOCAL:=$(BR2_LOCAL) | |
65 | ||
afc61c6e BRF |
66 | # To put more focus on warnings, be less verbose as default |
67 | # Use 'make V=1' to see the full commands | |
68 | ifdef V | |
69 | ifeq ("$(origin V)", "command line") | |
18d979c7 | 70 | KBUILD_VERBOSE=$(V) |
afc61c6e BRF |
71 | endif |
72 | endif | |
73 | ifndef KBUILD_VERBOSE | |
18d979c7 | 74 | KBUILD_VERBOSE=0 |
afc61c6e BRF |
75 | endif |
76 | ||
77 | ifeq ($(KBUILD_VERBOSE),1) | |
4df454e9 | 78 | quiet= |
18d979c7 | 79 | Q= |
1669b6ed BRF |
80 | ifndef VERBOSE |
81 | VERBOSE=1 | |
82 | endif | |
afc61c6e BRF |
83 | else |
84 | quiet=quiet_ | |
18d979c7 | 85 | Q=@ |
afc61c6e BRF |
86 | endif |
87 | ||
69f85924 PK |
88 | # we want bash as shell |
89 | SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \ | |
afc61c6e | 90 | else if [ -x /bin/bash ]; then echo /bin/bash; \ |
18d979c7 | 91 | else echo sh; fi; fi) |
afc61c6e | 92 | |
69f85924 PK |
93 | # kconfig uses CONFIG_SHELL |
94 | CONFIG_SHELL:=$(SHELL) | |
95 | ||
96 | export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE | |
afc61c6e BRF |
97 | |
98 | ifndef HOSTAR | |
99 | HOSTAR:=ar | |
100 | endif | |
101 | ifndef HOSTAS | |
102 | HOSTAS:=as | |
103 | endif | |
104 | ifndef HOSTCC | |
105 | HOSTCC:=gcc | |
106 | else | |
107 | endif | |
108 | ifndef HOSTCXX | |
109 | HOSTCXX:=g++ | |
110 | endif | |
5f97580e BRF |
111 | ifndef HOSTFC |
112 | HOSTFC:=gfortran | |
113 | endif | |
356133b4 US |
114 | ifndef HOSTCPP |
115 | HOSTCPP:=cpp | |
116 | endif | |
afc61c6e BRF |
117 | ifndef HOSTLD |
118 | HOSTLD:=ld | |
119 | endif | |
0f9c5b11 US |
120 | ifndef HOSTLN |
121 | HOSTLN:=ln | |
122 | endif | |
356133b4 US |
123 | ifndef HOSTNM |
124 | HOSTNM:=nm | |
125 | endif | |
69f85924 PK |
126 | HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar) |
127 | HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as) | |
128 | HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc) | |
129 | HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++) | |
130 | HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran) | |
131 | HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp) | |
132 | HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld) | |
133 | HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln) | |
134 | HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm) | |
135 | HOST_GLIB_BIN:=`dirname $(shell which glib-genmarshal || echo /usr/bin/glib-genmarshal)` | |
136 | HOST_GLIB:=$(shell dirname $(HOST_GLIB_BIN) || echo /usr) | |
54e93328 US |
137 | |
138 | ||
afc61c6e | 139 | ifndef CFLAGS_FOR_BUILD |
f987b7a5 | 140 | CFLAGS_FOR_BUILD:=-g -O2 |
afc61c6e | 141 | endif |
5f97580e BRF |
142 | ifndef CXXFLAGS_FOR_BUILD |
143 | CXXFLAGS_FOR_BUILD:=-g -O2 | |
144 | endif | |
145 | ifndef FCFLAGS_FOR_BUILD | |
146 | FCFLAGS_FOR_BUILD:=-g -O2 | |
147 | endif | |
148 | export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD | |
afc61c6e BRF |
149 | |
150 | ||
cfe511b2 | 151 | ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
54e098e4 | 152 | |
99cf7293 | 153 | # cc-option |
18d979c7 | 154 | # Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586) |
99cf7293 BRF |
155 | # sets -march=winchip-c6 if supported else falls back to -march=i586 |
156 | # without checking the latter. | |
18d979c7 | 157 | cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ |
99cf7293 BRF |
158 | > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) |
159 | ||
2c649045 PK |
160 | ############################################################# |
161 | # | |
162 | # Hide troublesome environment variables from sub processes | |
163 | # | |
164 | ############################################################# | |
165 | unexport CROSS_COMPILE | |
166 | unexport ARCH | |
27bc59d4 | 167 | |
08782ae7 EA |
168 | ############################################################# |
169 | # | |
c6e43c9d | 170 | # Setup the proper filename extensions for the host |
08782ae7 | 171 | # |
7dcbbfbb BRF |
172 | ############################################################## |
173 | ifneq ($(findstring linux,$(BR2_GNU_BUILD_SUFFIX)),) | |
c6e43c9d BRF |
174 | HOST_EXEEXT:= |
175 | HOST_LIBEXT:=.a | |
176 | HOST_SHREXT:=.so | |
3096f34d | 177 | endif |
7dcbbfbb | 178 | ifneq ($(findstring apple,$(BR2_GNU_BUILD_SUFFIX)),) |
c6e43c9d BRF |
179 | HOST_EXEEXT:= |
180 | HOST_LIBEXT:=.a | |
181 | HOST_SHREXT:=.dylib | |
3096f34d | 182 | endif |
7dcbbfbb | 183 | ifneq ($(findstring cygwin,$(BR2_GNU_BUILD_SUFFIX)),) |
c6e43c9d BRF |
184 | HOST_EXEEXT:=.exe |
185 | HOST_LIBEXT:=.lib | |
186 | HOST_SHREXT:=.dll | |
2c279671 PK |
187 | HOST_LOADLIBES="-lcurses -lintl" |
188 | export HOST_LOADLIBES | |
3096f34d | 189 | endif |
7dcbbfbb | 190 | ifneq ($(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)),) |
c6e43c9d BRF |
191 | HOST_EXEEXT:=.exe |
192 | HOST_LIBEXT:=.lib | |
193 | HOST_SHREXT:=.dll | |
3096f34d | 194 | endif |
cb7d5b81 | 195 | |
c6e43c9d | 196 | # The preferred type of libs we build for the target |
3096f34d | 197 | ifeq ($(BR2_PREFER_STATIC_LIB),y) |
c6e43c9d | 198 | LIBTGTEXT=.a |
8027784c | 199 | #PREFERRED_LIB_FLAGS:=--disable-shared --enable-static |
3096f34d | 200 | else |
c6e43c9d | 201 | LIBTGTEXT=.so |
8027784c | 202 | #PREFERRED_LIB_FLAGS:=--disable-static --enable-shared |
3096f34d | 203 | endif |
8027784c | 204 | PREFERRED_LIB_FLAGS:=--enable-static --enable-shared |
ffde94bd | 205 | |
6ad07203 | 206 | ############################################################## |
7dcbbfbb BRF |
207 | # |
208 | # The list of stuff to build for the target toolchain | |
209 | # along with the packages to build for the target. | |
210 | # | |
211 | ############################################################## | |
4b0d5a80 | 212 | ifeq ($(BR2_TOOLCHAIN_SOURCE),y) |
3d8919a1 | 213 | BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers |
7dcbbfbb | 214 | else |
51f5f627 | 215 | BASE_TARGETS:=uclibc |
7dcbbfbb | 216 | endif |
acc706b7 BRF |
217 | TARGETS:= |
218 | ||
18d979c7 | 219 | # setup our pathes |
f958d897 | 220 | include project/Makefile.in |
1dbe6e33 BRF |
221 | |
222 | BR2_DEPENDS_DIR=$(PROJECT_BUILD_DIR)/buildroot-config | |
223 | ||
7dcbbfbb BRF |
224 | include toolchain/Makefile.in |
225 | include package/Makefile.in | |
226 | ||
227 | ############################################################# | |
228 | # | |
229 | # You should probably leave this stuff alone unless you know | |
230 | # what you are doing. | |
231 | # | |
232 | ############################################################# | |
233 | ||
6547bced | 234 | all: world |
ffde94bd | 235 | |
2d523c23 EA |
236 | # In this section, we need .config |
237 | include .config.cmd | |
238 | ||
f958d897 US |
239 | include project/*.mk |
240 | ||
d06645d8 EA |
241 | # We also need the various per-package makefiles, which also add |
242 | # each selected package to TARGETS if that package was selected | |
243 | # in the .config file. | |
4b0d5a80 | 244 | ifeq ($(BR2_TOOLCHAIN_SOURCE),y) |
acc706b7 | 245 | # avoid pulling in external toolchain which is broken for toplvl parallel builds |
57310ec6 BRF |
246 | # Explicit ordering: |
247 | include toolchain/dependencies/dependencies.mk | |
248 | include toolchain/binutils/binutils.mk | |
249 | include toolchain/ccache/ccache.mk | |
250 | include toolchain/elf2flt/elf2flt.mk | |
251 | include toolchain/gcc/gcc-uclibc-3.x.mk | |
252 | include toolchain/gcc/gcc-uclibc-4.x.mk | |
253 | include toolchain/gdb/gdb.mk | |
254 | include toolchain/kernel-headers/kernel-headers.mk | |
255 | include toolchain/mklibs/mklibs.mk | |
256 | include toolchain/sstrip/sstrip.mk | |
257 | include toolchain/uClibc/uclibc.mk | |
acc706b7 | 258 | else |
d06645d8 | 259 | include toolchain/*/*.mk |
acc706b7 BRF |
260 | endif |
261 | ||
62b5ae4b SH |
262 | ifeq ($(BR2_PACKAGE_LINUX),y) |
263 | TARGETS+=linux26-modules | |
264 | endif | |
acc706b7 | 265 | |
d06645d8 | 266 | include package/*/*.mk |
d06645d8 | 267 | |
d45de0ca JV |
268 | TARGETS+=target-devfiles |
269 | ||
79f5f1e8 EA |
270 | # target stuff is last so it can override anything else |
271 | include target/Makefile.in | |
272 | ||
02a623dd | 273 | TARGETS+=erase-fakeroots |
c2fc93bc | 274 | |
08782ae7 | 275 | TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) |
3b08e64d | 276 | TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS)) |
08782ae7 | 277 | TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) |
b3efde23 | 278 | TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS)) |
acc706b7 | 279 | # all targets depend on the crosscompiler and it's prerequisites |
b3efde23 | 280 | $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) % |
acc706b7 | 281 | |
1dbe6e33 BRF |
282 | $(BR2_DEPENDS_DIR): .config |
283 | rm -rf $@ | |
b3efde23 | 284 | mkdir -p $(@D) |
1dbe6e33 BRF |
285 | cp -dpRf $(CONFIG)/buildroot-config $@ |
286 | ||
5ef9e52b | 287 | dirs: $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ |
7167dede HCE |
288 | $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(PROJECT_BUILD_DIR) \ |
289 | $(PROJECT_BUILD_DIR)/autotools-stamps | |
f958d897 | 290 | |
5ef9e52b | 291 | $(BASE_TARGETS): dirs |
f958d897 | 292 | |
b3efde23 | 293 | world: dependencies dirs target-host-info $(BASE_TARGETS) $(TARGETS_ALL) |
ffde94bd | 294 | |
5ef9e52b | 295 | |
f958d897 | 296 | .PHONY: all world dirs clean dirclean distclean source \ |
b3efde23 | 297 | $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \ |
747b16dd | 298 | $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \ |
5ef9e52b | 299 | $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ |
7167dede HCE |
300 | $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(PROJECT_BUILD_DIR) \ |
301 | $(PROJECT_BUILD_DIR)/autotools-stamps | |
ffde94bd | 302 | |
08782ae7 EA |
303 | ############################################################# |
304 | # | |
ef407d3d | 305 | # staging and target directories do NOT list these as |
d99c31c6 | 306 | # dependencies anywhere else |
08782ae7 EA |
307 | # |
308 | ############################################################# | |
7167dede HCE |
309 | $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(PROJECT_BUILD_DIR) \ |
310 | $(PROJECT_BUILD_DIR)/autotools-stamps $(BINARIES_DIR): | |
8d583fc0 | 311 | @mkdir -p $@ |
3ad3d8a1 | 312 | |
08782ae7 | 313 | $(STAGING_DIR): |
9c865d75 | 314 | @mkdir -p $(STAGING_DIR)/bin |
bf38723f | 315 | @mkdir -p $(STAGING_DIR)/lib |
7e0c890c | 316 | ifeq ($(BR2_TOOLCHAIN_SYSROOT),y) |
8027784c BRF |
317 | @mkdir -p $(STAGING_DIR)/usr/lib |
318 | else | |
f5905dc9 | 319 | ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y) |
8027784c BRF |
320 | @ln -snf . $(STAGING_DIR)/usr |
321 | @mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME) | |
3da708e4 | 322 | @ln -snf ../lib $(STAGING_DIR)/usr/lib |
8027784c | 323 | @ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib |
f5905dc9 | 324 | endif |
8027784c BRF |
325 | endif |
326 | @mkdir -p $(STAGING_DIR)/usr/include | |
ffde94bd | 327 | |
c6771dfb | 328 | $(PROJECT_BUILD_DIR)/.root: |
7547c7eb | 329 | mkdir -p $(TARGET_DIR) |
f0ca4b82 BRF |
330 | if ! [ -d "$(TARGET_DIR)/bin" ]; then \ |
331 | if [ -d "$(TARGET_SKELETON)" ]; then \ | |
18d979c7 | 332 | cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \ |
74cda1e4 | 333 | fi; \ |
18d979c7 | 334 | touch $(STAGING_DIR)/.fakeroot.00000; \ |
f0ca4b82 | 335 | fi |
e0137736 | 336 | -find $(TARGET_DIR) -type d -name CVS -o -name .svn | xargs rm -rf |
6a262b14 | 337 | -find $(TARGET_DIR) -type f -name .empty | xargs rm -rf |
7547c7eb | 338 | touch $@ |
08782ae7 | 339 | |
1dbe6e33 | 340 | $(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root |
c6771dfb | 341 | |
c2fc93bc | 342 | erase-fakeroots: |
5d2be049 | 343 | rm -f $(PROJECT_BUILD_DIR)/.fakeroot* |
412ca2a4 | 344 | |
bc67ca29 | 345 | target-devfiles: |
d45de0ca JV |
346 | ifeq ($(BR2_HAVE_DEVFILES),y) |
347 | ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) ) | |
bc67ca29 | 348 | else |
926646d9 | 349 | rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig |
02a623dd PK |
350 | find $(TARGET_DIR)/usr/lib -name '*.a' -delete |
351 | find $(TARGET_DIR)/lib -name '*.a' -delete | |
352 | find $(TARGET_DIR)/usr/lib -name '*.la' -delete | |
353 | find $(TARGET_DIR)/lib -name '*.la' -delete | |
bc67ca29 JV |
354 | endif |
355 | ||
3b08e64d | 356 | source: $(TARGETS_SOURCE) $(HOST_SOURCE) |
08782ae7 | 357 | |
6547bced | 358 | _source-check: |
e7c08c29 | 359 | $(MAKE) SPIDER=--spider source |
825ff341 | 360 | |
155971e0 | 361 | external-deps: |
2ad346ab | 362 | @$(MAKE) -Bs BR2_WGET=$(TOPDIR)/toolchain/wget-show-external-deps.sh \ |
bcad6288 | 363 | SPIDER=--spider source |
155971e0 | 364 | |
08782ae7 EA |
365 | ############################################################# |
366 | # | |
367 | # Cleanup and misc junk | |
368 | # | |
369 | ############################################################# | |
370 | clean: $(TARGETS_CLEAN) | |
346844d0 | 371 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps |
08782ae7 EA |
372 | |
373 | dirclean: $(TARGETS_DIRCLEAN) | |
346844d0 | 374 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps |
08782ae7 EA |
375 | |
376 | distclean: | |
5bc1f0c3 MF |
377 | ifeq ($(DL_DIR),$(BASE_DIR)/dl) |
378 | rm -rf $(DL_DIR) | |
379 | endif | |
6547bced | 380 | rm -rf $(BUILD_DIR) $(PROJECT_BUILD_DIR) $(BINARIES_DIR) \ |
db8eecfc | 381 | $(LINUX_KERNEL) $(BASE_DIR)/include \ |
81df2264 | 382 | .config.cmd |
b5136193 | 383 | $(MAKE) -C $(CONFIG) clean |
08782ae7 | 384 | |
3ad3d8a1 | 385 | sourceball: |
6547bced | 386 | rm -rf $(BUILD_DIR) $(PROJECT_BUILD_DIR) $(BINARIES_DIR) |
08782ae7 EA |
387 | set -e; \ |
388 | cd ..; \ | |
389 | rm -f buildroot.tar.bz2; \ | |
390 | tar -cvf buildroot.tar buildroot; \ | |
391 | bzip2 -9 buildroot.tar; \ | |
2d523c23 EA |
392 | |
393 | ||
cfe511b2 | 394 | else # ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
2d523c23 EA |
395 | |
396 | all: menuconfig | |
397 | ||
398 | # configuration | |
399 | # --------------------------------------------------------------------------- | |
400 | ||
c0d7d4e0 BRF |
401 | HOSTCFLAGS=$(CFLAGS_FOR_BUILD) |
402 | export HOSTCFLAGS | |
403 | ||
2d523c23 | 404 | $(CONFIG)/conf: |
1dbe6e33 | 405 | @mkdir -p $(CONFIG)/buildroot-config |
fb2c8fec | 406 | $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf |
18d979c7 | 407 | -@if [ ! -f .config ]; then \ |
2d523c23 EA |
408 | cp $(CONFIG_DEFCONFIG) .config; \ |
409 | fi | |
410 | $(CONFIG)/mconf: | |
1dbe6e33 | 411 | @mkdir -p $(CONFIG)/buildroot-config |
fb2c8fec | 412 | $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf mconf |
18d979c7 | 413 | -@if [ ! -f .config ]; then \ |
2d523c23 EA |
414 | cp $(CONFIG_DEFCONFIG) .config; \ |
415 | fi | |
416 | ||
417 | menuconfig: $(CONFIG)/mconf | |
7b403ada | 418 | @mkdir -p $(CONFIG)/buildroot-config |
153b1bea | 419 | @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
62b5ae4b | 420 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ |
153b1bea BRF |
421 | $(CONFIG)/mconf $(CONFIG_CONFIG_IN); then \ |
422 | test -f .config.cmd || rm -f .config; \ | |
423 | fi | |
2d523c23 EA |
424 | |
425 | config: $(CONFIG)/conf | |
7b403ada | 426 | @mkdir -p $(CONFIG)/buildroot-config |
62b5ae4b SH |
427 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
428 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ | |
f987b7a5 | 429 | $(CONFIG)/conf $(CONFIG_CONFIG_IN) |
2d523c23 EA |
430 | |
431 | oldconfig: $(CONFIG)/conf | |
7b403ada | 432 | @mkdir -p $(CONFIG)/buildroot-config |
62b5ae4b SH |
433 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
434 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ | |
f987b7a5 | 435 | $(CONFIG)/conf -o $(CONFIG_CONFIG_IN) |
2d523c23 EA |
436 | |
437 | randconfig: $(CONFIG)/conf | |
7b403ada | 438 | @mkdir -p $(CONFIG)/buildroot-config |
62b5ae4b SH |
439 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
440 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ | |
f987b7a5 | 441 | $(CONFIG)/conf -r $(CONFIG_CONFIG_IN) |
2d523c23 EA |
442 | |
443 | allyesconfig: $(CONFIG)/conf | |
f987b7a5 | 444 | cat $(CONFIG_DEFCONFIG) > .config |
7b403ada | 445 | @mkdir -p $(CONFIG)/buildroot-config |
62b5ae4b SH |
446 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
447 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ | |
f987b7a5 | 448 | $(CONFIG)/conf -y $(CONFIG_CONFIG_IN) |
2d523c23 | 449 | #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config |
2d523c23 EA |
450 | |
451 | allnoconfig: $(CONFIG)/conf | |
7b403ada | 452 | @mkdir -p $(CONFIG)/buildroot-config |
62b5ae4b SH |
453 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
454 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ | |
f987b7a5 | 455 | $(CONFIG)/conf -n $(CONFIG_CONFIG_IN) |
2d523c23 EA |
456 | |
457 | defconfig: $(CONFIG)/conf | |
7b403ada | 458 | @mkdir -p $(CONFIG)/buildroot-config |
62b5ae4b SH |
459 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
460 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ | |
f987b7a5 | 461 | $(CONFIG)/conf -d $(CONFIG_CONFIG_IN) |
2d523c23 | 462 | |
6547bced | 463 | # check if download URLs are outdated |
825ff341 BRF |
464 | source-check: allyesconfig |
465 | $(MAKE) _source-check | |
466 | ||
2d523c23 EA |
467 | ############################################################# |
468 | # | |
469 | # Cleanup and misc junk | |
470 | # | |
471 | ############################################################# | |
472 | clean: | |
84518dc8 | 473 | rm -f .config .config.old .config.cmd .tmpconfig.h .lognr.* |
18d979c7 | 474 | -$(MAKE) -C $(CONFIG) clean |
2d523c23 EA |
475 | |
476 | distclean: clean | |
477 | rm -rf sources/* | |
478 | ||
cfe511b2 | 479 | endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
2d523c23 | 480 | |
ba2e7e02 BRF |
481 | %_defconfig: $(CONFIG)/conf |
482 | cp $(shell find ./target/ -name $@) .config | |
8820d63a | 483 | -@$(MAKE) oldconfig |
ba2e7e02 | 484 | |
82c92e1e US |
485 | update: |
486 | cp .config $(BOARD_PATH)/$(BOARD_NAME)_defconfig | |
487 | ||
5459a9c5 | 488 | configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config |
b8f28d65 | 489 | |
126bb72f US |
490 | prepatch: gcc-patched binutils-patched gdb-patched uclibc-patched |
491 | ||
84518dc8 | 492 | .lognr.$(PROJECT): |
9220e90b | 493 | @echo "0" > .lognr.$(PROJECT) |
def8b8d1 | 494 | |
84518dc8 | 495 | log: .lognr.$(PROJECT) |
9220e90b | 496 | @expr `cat .lognr.$(PROJECT)` + 1 > .lognr.$(PROJECT) |
84518dc8 | 497 | @echo Creating $(PROJECT)-`cat .lognr.$(PROJECT)`.log |
02a623dd | 498 | @$(MAKE) > $(PROJECT)-`cat .lognr.$(PROJECT)`.log 2>&1 |
9220e90b | 499 | |
195df2e1 | 500 | |
b8f28d65 US |
501 | cross: $(BASE_TARGETS) |
502 | ||
e491fba2 BRF |
503 | help: |
504 | @echo 'Cleaning:' | |
505 | @echo ' clean - delete temporary files created by build' | |
506 | @echo ' distclean - delete all non-source files (including .config)' | |
507 | @echo | |
508 | @echo 'Build:' | |
509 | @echo ' all - make world' | |
510 | @echo | |
511 | @echo 'Configuration:' | |
512 | @echo ' menuconfig - interactive curses-based configurator' | |
513 | @echo ' oldconfig - resolve any unresolved symbols in .config' | |
7b2ec610 | 514 | @echo ' configured - make {uclibc/busybox/linux26}-config' |
386b8139 HCE |
515 | @echo ' saveconfig - save current configuration under local/<project>' |
516 | @echo ' getconfig - restore saved configuration from local/<project>' | |
e491fba2 BRF |
517 | @echo |
518 | @echo 'Miscellaneous:' | |
519 | @echo ' source - download all sources needed for offline-build' | |
03380402 | 520 | @echo ' source-check - check all packages for valid download URLs' |
155971e0 | 521 | @echo ' external-deps - list external packages used' |
e491fba2 | 522 | @echo |
232fa7ee | 523 | @echo 'See docs/README and docs/buildroot.html for further details' |
663dee48 | 524 | @echo |
ba2e7e02 | 525 | |
e62d2ecd PK |
526 | release: distclean |
527 | OUT=buildroot-$$(grep -A2 BR2_VERSION $(CONFIG_CONFIG_IN)|grep default|cut -f2 -d\"); \ | |
528 | rm -rf ../$$OUT*; cp -al . ../$$OUT; cd ..; \ | |
529 | tar cfz $$OUT.tar.gz --exclude .svn --exclude .git --exclude \*~ $$OUT; \ | |
530 | rm -rf $$OUT | |
531 | ||
2d523c23 | 532 | .PHONY: dummy subdirs release distclean clean config oldconfig \ |
e491fba2 | 533 | menuconfig tags check test depend defconfig help |
50cbb4a1 | 534 |