]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - Makefile
aumix: SITE has changed
[coffee/buildroot.git] / Makefile
1 # Makefile for buildroot2
2 #
3 # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4 # Copyright (C) 2006-2010 by the Buildroot developers <buildroot@uclibc.org>
5 #
6 # This program is free software; you can redistribute it and/or modify
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.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
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
19 #
20
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 # absolute path
26 TOPDIR:=$(shell pwd)
27 CONFIG_CONFIG_IN=Config.in
28 CONFIG_DEFCONFIG=.defconfig
29 CONFIG=package/config
30 DATE:=$(shell date +%Y%m%d)
31
32 noconfig_targets:=menuconfig xconfig config oldconfig randconfig \
33         defconfig allyesconfig allnoconfig release \
34         randpackageconfig allyespackageconfig allnopackageconfig \
35         source-check help
36
37 # Strip quotes and then whitespaces
38 qstrip=$(strip $(subst ",,$(1)))
39 #"))
40
41 # Variables for use in Make constructs
42 comma:=,
43 empty:=
44 space:=$(empty) $(empty)
45
46 # $(shell find . -name *_defconfig |sed 's/.*\///')
47 # Pull in the user's configuration file
48 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
49 -include .config
50 endif
51
52 # Override BR2_DL_DIR if shell variable defined
53 ifneq ($(BUILDROOT_DL_DIR),)
54 BR2_DL_DIR:=$(BUILDROOT_DL_DIR)
55 endif
56
57 # To put more focus on warnings, be less verbose as default
58 # Use 'make V=1' to see the full commands
59 ifdef V
60   ifeq ("$(origin V)", "command line")
61     KBUILD_VERBOSE=$(V)
62   endif
63 endif
64 ifndef KBUILD_VERBOSE
65   KBUILD_VERBOSE=0
66 endif
67
68 ifeq ($(KBUILD_VERBOSE),1)
69   quiet=
70   Q=
71 ifndef VERBOSE
72   VERBOSE=1
73 endif
74 else
75   quiet=quiet_
76   Q=@
77 endif
78
79 # we want bash as shell
80 SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
81         else if [ -x /bin/bash ]; then echo /bin/bash; \
82         else echo sh; fi; fi)
83
84 # kconfig uses CONFIG_SHELL
85 CONFIG_SHELL:=$(SHELL)
86
87 export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE
88
89 ifndef HOSTAR
90 HOSTAR:=ar
91 endif
92 ifndef HOSTAS
93 HOSTAS:=as
94 endif
95 ifndef HOSTCC
96 HOSTCC:=gcc
97 else
98 endif
99 ifndef HOSTCXX
100 HOSTCXX:=g++
101 endif
102 ifndef HOSTFC
103 HOSTFC:=gfortran
104 endif
105 ifndef HOSTCPP
106 HOSTCPP:=cpp
107 endif
108 ifndef HOSTLD
109 HOSTLD:=ld
110 endif
111 ifndef HOSTLN
112 HOSTLN:=ln
113 endif
114 ifndef HOSTNM
115 HOSTNM:=nm
116 endif
117 HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
118 HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
119 HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
120 HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
121 HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran)
122 HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
123 HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
124 HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
125 HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
126
127 ifndef CFLAGS_FOR_BUILD
128 CFLAGS_FOR_BUILD:=-g -O2
129 endif
130 ifndef CXXFLAGS_FOR_BUILD
131 CXXFLAGS_FOR_BUILD:=-g -O2
132 endif
133 ifndef FCFLAGS_FOR_BUILD
134 FCFLAGS_FOR_BUILD:=-g -O2
135 endif
136 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
137
138
139 ifeq ($(BR2_HAVE_DOT_CONFIG),y)
140
141 # cc-option
142 # Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586)
143 # sets -march=winchip-c6 if supported else falls back to -march=i586
144 # without checking the latter.
145 cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
146         > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
147
148 #############################################################
149 #
150 # Hide troublesome environment variables from sub processes
151 #
152 #############################################################
153 unexport CROSS_COMPILE
154 unexport ARCH
155
156 GNU_HOST_NAME:=$(shell package/gnuconfig/config.guess)
157
158 #############################################################
159 #
160 # Setup the proper filename extensions for the host
161 #
162 ##############################################################
163 ifneq ($(findstring linux,$(GNU_HOST_NAME)),)
164 HOST_EXEEXT:=
165 HOST_LIBEXT:=.a
166 HOST_SHREXT:=.so
167 endif
168 ifneq ($(findstring apple,$(GNU_HOST_NAME)),)
169 HOST_EXEEXT:=
170 HOST_LIBEXT:=.a
171 HOST_SHREXT:=.dylib
172 endif
173 ifneq ($(findstring cygwin,$(GNU_HOST_NAME)),)
174 HOST_EXEEXT:=.exe
175 HOST_LIBEXT:=.lib
176 HOST_SHREXT:=.dll
177 HOST_LOADLIBES="-lcurses -lintl"
178 export HOST_LOADLIBES
179 endif
180 ifneq ($(findstring mingw,$(GNU_HOST_NAME)),)
181 HOST_EXEEXT:=.exe
182 HOST_LIBEXT:=.lib
183 HOST_SHREXT:=.dll
184 endif
185
186 # The preferred type of libs we build for the target
187 ifeq ($(BR2_PREFER_STATIC_LIB),y)
188 LIBTGTEXT=.a
189 #PREFERRED_LIB_FLAGS:=--disable-shared --enable-static
190 else
191 LIBTGTEXT=.so
192 #PREFERRED_LIB_FLAGS:=--disable-static --enable-shared
193 endif
194 PREFERRED_LIB_FLAGS:=--enable-static --enable-shared
195
196 ##############################################################
197 #
198 # The list of stuff to build for the target toolchain
199 # along with the packages to build for the target.
200 #
201 ##############################################################
202 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
203 BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
204 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
205 BASE_TARGETS:=uclibc
206 endif
207 TARGETS:=
208
209 # silent mode requested?
210 QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q)
211
212 # Strip off the annoying quoting
213 ARCH:=$(call qstrip,$(BR2_ARCH))
214 ifeq ($(ARCH),xtensa)
215 ARCH:=$(ARCH)_$(call qstrip,$(BR2_xtensa_core_name))
216 endif
217
218 WGET:=$(call qstrip,$(BR2_WGET)) $(SPIDER) $(QUIET)
219 SVN_CO:=$(call qstrip,$(BR2_SVN_CO)) $(QUIET)
220 SVN_UP:=$(call qstrip,$(BR2_SVN_UP)) $(QUIET)
221 BZR_CO:=$(call qstrip,$(BR2_BZR_CO)) $(QUIET)
222 BZR_UP:=$(call qstrip,$(BR2_BZR_UP)) $(QUIET)
223 GIT:=$(call qstrip,$(BR2_GIT)) $(QUIET)
224 ZCAT:=$(call qstrip,$(BR2_ZCAT))
225 BZCAT:=$(call qstrip,$(BR2_BZCAT))
226 TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
227
228 ifneq ("$(origin O)", "command line")
229 O:=output
230 else
231 # other packages might also support Linux-style out of tree builds
232 # with the O=<dir> syntax (E.G. Busybox does). As make automatically
233 # forwards command line variable definitions those packages get very
234 # confused. Fix this by telling make to not do so
235 MAKEOVERRIDES =
236 # strangely enough O is still passed to submakes with MAKEOVERRIDES
237 # (with make 3.81 atleast), the only thing that changes is the output
238 # of the origin function (command line -> environment).
239 # Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+)
240 # To really make O go away, we have to override it.
241 override O:=$(O)
242 endif
243
244 # bash prints the name of the directory on 'cd <dir>' if CDPATH is
245 # set, so unset it here to not cause problems. Notice that the export
246 # line doesn't affect the environment of $(shell ..) calls, so
247 # explictly throw away any output from 'cd' here.
248 export CDPATH:=
249 BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
250 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
251
252 DL_DIR=$(call qstrip,$(BR2_DL_DIR))
253 ifeq ($(DL_DIR),)
254 DL_DIR:=$(TOPDIR)/dl
255 endif
256
257 BUILD_DIR:=$(BASE_DIR)/build
258
259 GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
260
261 STAGING_DIR:=$(call qstrip,$(BR2_STAGING_DIR))
262
263 # packages compiled for the host goes here
264 HOST_DIR:=$(BASE_DIR)/host
265
266 # stamp (dependency) files go here
267 STAMP_DIR:=$(BASE_DIR)/stamps
268
269 BINARIES_DIR:=$(BASE_DIR)/images
270 TARGET_DIR:=$(BASE_DIR)/target
271 TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
272
273 BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
274
275 include toolchain/Makefile.in
276 include package/Makefile.in
277
278 #############################################################
279 #
280 # You should probably leave this stuff alone unless you know
281 # what you are doing.
282 #
283 #############################################################
284
285 all: world
286
287 # In this section, we need .config
288 include .config.cmd
289
290 # We also need the various per-package makefiles, which also add
291 # each selected package to TARGETS if that package was selected
292 # in the .config file.
293 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
294 # avoid pulling in external toolchain which is broken for toplvl parallel builds
295 # Explicit ordering:
296 include toolchain/dependencies/dependencies.mk
297 include toolchain/binutils/binutils.mk
298 include toolchain/ccache/ccache.mk
299 include toolchain/elf2flt/elf2flt.mk
300 include toolchain/gcc/gcc-uclibc-3.x.mk
301 include toolchain/gcc/gcc-uclibc-4.x.mk
302 include toolchain/gdb/gdb.mk
303 include toolchain/kernel-headers/kernel-headers.mk
304 include toolchain/mklibs/mklibs.mk
305 include toolchain/sstrip/sstrip.mk
306 include toolchain/uClibc/uclibc.mk
307 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
308 include toolchain/*/*.mk
309 endif
310
311 ifeq ($(BR2_PACKAGE_LINUX),y)
312 TARGETS+=linux26-modules
313 endif
314
315 include package/*/*.mk
316
317 TARGETS+=target-finalize
318
319 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
320 TARGETS+=target-purgelocales
321 endif
322
323 include fs/common.mk
324
325 # target stuff is last so it can override anything else
326 include target/Makefile.in
327
328 TARGETS+=erase-fakeroots
329
330 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
331 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
332 TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
333 TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
334 # all targets depend on the crosscompiler and it's prerequisites
335 $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
336
337 $(BR2_DEPENDS_DIR): .config
338         rm -rf $@
339         mkdir -p $(@D)
340         cp -dpRf $(CONFIG)/buildroot-config $@
341
342 dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
343         $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
344
345 $(BASE_TARGETS): dirs
346
347 world: dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
348
349
350 .PHONY: all world dirs clean distclean source \
351         $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
352         $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
353         $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
354         $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
355
356 #############################################################
357 #
358 # staging and target directories do NOT list these as
359 # dependencies anywhere else
360 #
361 #############################################################
362 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
363         @mkdir -p $@
364
365 $(STAGING_DIR):
366         @mkdir -p $(STAGING_DIR)/bin
367         @mkdir -p $(STAGING_DIR)/lib
368 ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
369         @mkdir -p $(STAGING_DIR)/usr/lib
370 else
371 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
372         @ln -snf . $(STAGING_DIR)/usr
373         @mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)
374         @ln -snf ../lib $(STAGING_DIR)/usr/lib
375         @ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
376 endif
377 endif
378         @mkdir -p $(STAGING_DIR)/usr/include
379         @mkdir -p $(STAGING_DIR)/usr/bin
380
381 $(BUILD_DIR)/.root:
382         mkdir -p $(TARGET_DIR)
383         if ! [ -d "$(TARGET_DIR)/bin" ]; then \
384                 if [ -d "$(TARGET_SKELETON)" ]; then \
385                         cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
386                 fi; \
387                 if [ -d "$(TARGET_SKELETON_PATCH)" ]; then \
388                         toolchain/patch-kernel.sh $(TARGET_DIR) $(TARGET_SKELETON_PATCH)/ \*patch\*; \
389                 fi; \
390                 touch $(STAGING_DIR)/.fakeroot.00000; \
391         fi
392         -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
393         -find $(TARGET_DIR) -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf
394         touch $@
395
396 $(TARGET_DIR): $(BUILD_DIR)/.root
397
398 erase-fakeroots:
399         rm -f $(BUILD_DIR)/.fakeroot*
400
401 target-finalize:
402 ifeq ($(BR2_HAVE_DEVFILES),y)
403         ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
404 else
405         rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
406         find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
407         find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
408 endif
409 ifneq ($(BR2_HAVE_DOCUMENTATION),y)
410         rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
411         rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
412         rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
413         rm -rf $(TARGET_DIR)/usr/share/gtk-doc
414 endif
415         find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
416         $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
417
418         mkdir -p $(TARGET_DIR)/etc
419         echo $(BR2_VERSION)$(shell $(TOPDIR)/scripts/setlocalversion) > \
420                 $(TARGET_DIR)/etc/br-version
421
422 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
423         $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
424 endif
425
426 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
427 LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
428 LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
429
430 target-purgelocales:
431         rm -f $(LOCALE_WHITELIST)
432         for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
433
434         for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \
435         do \
436                 for lang in $$(cd $$dir; ls .|grep -v man); \
437                 do \
438                         grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
439                 done; \
440         done
441 endif
442
443 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
444
445 _source-check:
446         $(MAKE) SPIDER=--spider source
447
448 external-deps:
449         @$(MAKE) -Bs BR2_WGET=$(TOPDIR)/toolchain/wget-show-external-deps.sh \
450                 SPIDER=--spider source
451
452 ifeq ($(BR2_CONFIG_CACHE),y)
453 # drop configure cache if configuration is changed
454 $(BUILD_DIR)/tgt-config.cache: .config
455         rm -f $@
456         touch $@
457
458 $(BASE_TARGETS): | $(BUILD_DIR)/tgt-config.cache
459 endif
460
461 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
462
463 all: menuconfig
464
465 # configuration
466 # ---------------------------------------------------------------------------
467
468 HOSTCFLAGS=$(CFLAGS_FOR_BUILD)
469 export HOSTCFLAGS
470
471 $(CONFIG)/conf:
472         @mkdir -p $(CONFIG)/buildroot-config
473         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf
474         -@if [ ! -f .config ]; then \
475                 cp $(CONFIG_DEFCONFIG) .config; \
476         fi
477
478 $(CONFIG)/mconf:
479         @mkdir -p $(CONFIG)/buildroot-config
480         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) mconf
481         -@if [ ! -f .config ]; then \
482                 cp $(CONFIG_DEFCONFIG) .config; \
483         fi
484
485 $(CONFIG)/qconf:
486         @mkdir -p $(CONFIG)/buildroot-config
487         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) qconf
488         -@if [ ! -f .config ]; then \
489                 cp $(CONFIG_DEFCONFIG) .config; \
490         fi
491
492 xconfig: $(CONFIG)/qconf
493         @mkdir -p $(CONFIG)/buildroot-config
494         @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
495                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
496                 $(CONFIG)/qconf $(CONFIG_CONFIG_IN); then \
497                 test -f .config.cmd || rm -f .config; \
498         fi
499
500 menuconfig: $(CONFIG)/mconf
501         @mkdir -p $(CONFIG)/buildroot-config
502         @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
503                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
504                 $(CONFIG)/mconf $(CONFIG_CONFIG_IN); then \
505                 test -f .config.cmd || rm -f .config; \
506         fi
507
508 config: $(CONFIG)/conf
509         @mkdir -p $(CONFIG)/buildroot-config
510         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
511                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
512                 $(CONFIG)/conf $(CONFIG_CONFIG_IN)
513
514 oldconfig: $(CONFIG)/conf
515         @mkdir -p $(CONFIG)/buildroot-config
516         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
517                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
518                 $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
519
520 randconfig: $(CONFIG)/conf
521         @mkdir -p $(CONFIG)/buildroot-config
522         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
523                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
524                 $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
525
526 allyesconfig: $(CONFIG)/conf
527         cat $(CONFIG_DEFCONFIG) > .config
528         @mkdir -p $(CONFIG)/buildroot-config
529         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
530                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
531                 $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
532
533 allnoconfig: $(CONFIG)/conf
534         @mkdir -p $(CONFIG)/buildroot-config
535         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
536                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
537                 $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
538
539 randpackageconfig: $(CONFIG)/conf
540         @mkdir -p $(CONFIG)/buildroot-config
541         @grep -v BR2_PACKAGE_ .config > .config.nopkg
542         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
543                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
544                 KCONFIG_ALLCONFIG=.config.nopkg \
545                 $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
546         @rm -f .config.nopkg
547
548 allyespackageconfig: $(CONFIG)/conf
549         @mkdir -p $(CONFIG)/buildroot-config
550         @grep -v BR2_PACKAGE_ .config > .config.nopkg
551         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
552                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
553                 KCONFIG_ALLCONFIG=.config.nopkg \
554                 $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
555         @rm -f .config.nopkg
556
557 allnopackageconfig: $(CONFIG)/conf
558         @mkdir -p $(CONFIG)/buildroot-config
559         @grep -v BR2_PACKAGE_ .config > .config.nopkg
560         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
561                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
562                 KCONFIG_ALLCONFIG=.config.nopkg \
563                 $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
564         @rm -f .config.nopkg
565
566 defconfig: $(CONFIG)/conf
567         @mkdir -p $(CONFIG)/buildroot-config
568         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
569                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
570                 $(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
571
572 # check if download URLs are outdated
573 source-check: allyesconfig
574         $(MAKE) _source-check
575
576 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
577
578 #############################################################
579 #
580 # Cleanup and misc junk
581 #
582 #############################################################
583 clean:
584         rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
585                 $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR)
586
587 distclean: clean
588 ifeq ($(DL_DIR),$(TOPDIR)/dl)
589         rm -rf $(DL_DIR)
590 endif
591 ifeq ($(O),output)
592         rm -rf $(O)
593 endif
594         rm -rf .config .config.old .config.cmd .auto.deps
595         -$(MAKE) -C $(CONFIG) clean
596
597 flush:
598         rm -f $(BUILD_DIR)/tgt-config.cache
599
600 %_defconfig: $(TOPDIR)/configs/%_defconfig
601         cp $^ .config
602         @$(MAKE) oldconfig
603
604 configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config
605
606 prepatch:       gcc-patched binutils-patched gdb-patched uclibc-patched
607
608 cross: $(BASE_TARGETS)
609
610 help:
611         @echo 'Cleaning:'
612         @echo '  clean                  - delete all files created by build'
613         @echo '  distclean              - delete all non-source files (including .config)'
614         @echo
615         @echo 'Build:'
616         @echo '  all                    - make world'
617         @echo
618         @echo 'Configuration:'
619         @echo '  menuconfig             - interactive curses-based configurator'
620         @echo '  xconfig                - interactive Qt-based configurator'
621         @echo '  oldconfig              - resolve any unresolved symbols in .config'
622         @echo '  randconfig             - New config with random answer to all options'
623         @echo '  defconfig              - New config with default answer to all options'
624         @echo '  allyesconfig           - New config where all options are accepted with yes'
625         @echo '  allnoconfig            - New config where all options are answered with no'
626         @echo '  randpackageconfig      - New config with random answer to package options'
627         @echo '  allyespackageconfig    - New config where pkg options are accepted with yes'
628         @echo '  allnopackageconfig     - New config where package options are answered with no'
629         @echo '  configured             - make {uclibc/busybox/linux26}-config'
630         @echo
631         @echo 'Miscellaneous:'
632         @echo '  source                 - download all sources needed for offline-build'
633         @echo '  source-check           - check all packages for valid download URLs'
634         @echo '  external-deps          - list external packages used'
635         @echo '  flush                  - flush configuration cache'
636         @echo
637         @$(foreach b, $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig)), \
638           printf "  %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
639         @echo
640         @echo 'See docs/README and docs/buildroot.html for further details'
641         @echo
642
643 release:
644         OUT=buildroot-$$(grep -A2 BR2_VERSION $(CONFIG_CONFIG_IN)|grep default|cut -f2 -d\"); \
645         git archive --format=tar --prefix=$$OUT/ master|gzip -9 >$$OUT.tar.gz
646
647 .PHONY: $(noconfig_targets)
648