]> Git Repo - buildroot-mgba.git/blob - Makefile
Makefile: add rand/allyes/allno package config targets
[buildroot-mgba.git] / Makefile
1 # Makefile for buildroot2
2 #
3 # Copyright (C) 1999-2005 by Erik Andersen <[email protected]>
4 # Copyright (C) 2006-2009 by the Buildroot developers <[email protected]>
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 TOPDIR:=.
26 CONFIG_CONFIG_IN=Config.in
27 CONFIG_DEFCONFIG=.defconfig
28 CONFIG=package/config
29 DATE:=$(shell date +%Y%m%d)
30
31 noconfig_targets:=menuconfig xconfig config oldconfig randconfig \
32         defconfig allyesconfig allnoconfig release \
33         randpackageconfig allyespackageconfig allnopackageconfig \
34         source-check help
35
36 # Strip quotes and then whitespaces
37 qstrip=$(strip $(subst ",,$(1)))
38 #"))
39
40 # Variables for use in Make constructs
41 comma:=,
42 empty:=
43 space:=$(empty) $(empty)
44
45 # $(shell find . -name *_defconfig |sed 's/.*\///')
46 # Pull in the user's configuration file
47 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
48 -include .config
49 endif
50
51 # Override BR2_DL_DIR if shell variable defined
52 ifneq ($(BUILDROOT_DL_DIR),)
53 BR2_DL_DIR:=$(BUILDROOT_DL_DIR)
54 endif
55
56 # To put more focus on warnings, be less verbose as default
57 # Use 'make V=1' to see the full commands
58 ifdef V
59   ifeq ("$(origin V)", "command line")
60     KBUILD_VERBOSE=$(V)
61   endif
62 endif
63 ifndef KBUILD_VERBOSE
64   KBUILD_VERBOSE=0
65 endif
66
67 ifeq ($(KBUILD_VERBOSE),1)
68   quiet=
69   Q=
70 ifndef VERBOSE
71   VERBOSE=1
72 endif
73 else
74   quiet=quiet_
75   Q=@
76 endif
77
78 # we want bash as shell
79 SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
80         else if [ -x /bin/bash ]; then echo /bin/bash; \
81         else echo sh; fi; fi)
82
83 # kconfig uses CONFIG_SHELL
84 CONFIG_SHELL:=$(SHELL)
85
86 export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE
87
88 ifndef HOSTAR
89 HOSTAR:=ar
90 endif
91 ifndef HOSTAS
92 HOSTAS:=as
93 endif
94 ifndef HOSTCC
95 HOSTCC:=gcc
96 else
97 endif
98 ifndef HOSTCXX
99 HOSTCXX:=g++
100 endif
101 ifndef HOSTFC
102 HOSTFC:=gfortran
103 endif
104 ifndef HOSTCPP
105 HOSTCPP:=cpp
106 endif
107 ifndef HOSTLD
108 HOSTLD:=ld
109 endif
110 ifndef HOSTLN
111 HOSTLN:=ln
112 endif
113 ifndef HOSTNM
114 HOSTNM:=nm
115 endif
116 HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
117 HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
118 HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
119 HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
120 HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran)
121 HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
122 HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
123 HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
124 HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
125
126 ifndef CFLAGS_FOR_BUILD
127 CFLAGS_FOR_BUILD:=-g -O2
128 endif
129 ifndef CXXFLAGS_FOR_BUILD
130 CXXFLAGS_FOR_BUILD:=-g -O2
131 endif
132 ifndef FCFLAGS_FOR_BUILD
133 FCFLAGS_FOR_BUILD:=-g -O2
134 endif
135 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
136
137
138 ifeq ($(BR2_HAVE_DOT_CONFIG),y)
139
140 # cc-option
141 # Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586)
142 # sets -march=winchip-c6 if supported else falls back to -march=i586
143 # without checking the latter.
144 cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
145         > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
146
147 #############################################################
148 #
149 # Hide troublesome environment variables from sub processes
150 #
151 #############################################################
152 unexport CROSS_COMPILE
153 unexport ARCH
154
155 #############################################################
156 #
157 # Setup the proper filename extensions for the host
158 #
159 ##############################################################
160 ifneq ($(findstring linux,$(BR2_GNU_BUILD_SUFFIX)),)
161 HOST_EXEEXT:=
162 HOST_LIBEXT:=.a
163 HOST_SHREXT:=.so
164 endif
165 ifneq ($(findstring apple,$(BR2_GNU_BUILD_SUFFIX)),)
166 HOST_EXEEXT:=
167 HOST_LIBEXT:=.a
168 HOST_SHREXT:=.dylib
169 endif
170 ifneq ($(findstring cygwin,$(BR2_GNU_BUILD_SUFFIX)),)
171 HOST_EXEEXT:=.exe
172 HOST_LIBEXT:=.lib
173 HOST_SHREXT:=.dll
174 HOST_LOADLIBES="-lcurses -lintl"
175 export HOST_LOADLIBES
176 endif
177 ifneq ($(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)),)
178 HOST_EXEEXT:=.exe
179 HOST_LIBEXT:=.lib
180 HOST_SHREXT:=.dll
181 endif
182
183 # The preferred type of libs we build for the target
184 ifeq ($(BR2_PREFER_STATIC_LIB),y)
185 LIBTGTEXT=.a
186 #PREFERRED_LIB_FLAGS:=--disable-shared --enable-static
187 else
188 LIBTGTEXT=.so
189 #PREFERRED_LIB_FLAGS:=--disable-static --enable-shared
190 endif
191 PREFERRED_LIB_FLAGS:=--enable-static --enable-shared
192
193 ##############################################################
194 #
195 # The list of stuff to build for the target toolchain
196 # along with the packages to build for the target.
197 #
198 ##############################################################
199 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
200 BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
201 else
202 BASE_TARGETS:=uclibc
203 endif
204 TARGETS:=
205
206 # silent mode requested?
207 QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q)
208
209 # Strip off the annoying quoting
210 ARCH:=$(call qstrip,$(BR2_ARCH))
211 ifeq ($(ARCH),xtensa)
212 ARCH:=$(ARCH)_$(call qstrip,$(BR2_xtensa_core_name))
213 endif
214 WGET:=$(call qstrip,$(BR2_WGET)) $(SPIDER) $(QUIET)
215 SVN_CO:=$(call qstrip,$(BR2_SVN_CO)) $(QUIET)
216 SVN_UP:=$(call qstrip,$(BR2_SVN_UP)) $(QUIET)
217 BZR_CO:=$(call qstrip,$(BR2_BZR_CO)) $(QUIET)
218 BZR_UP:=$(call qstrip,$(BR2_BZR_UP)) $(QUIET)
219 GIT:=$(call qstrip,$(BR2_GIT)) $(QUIET)
220 ZCAT:=$(call qstrip,$(BR2_ZCAT))
221 BZCAT:=$(call qstrip,$(BR2_BZCAT))
222 TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
223
224 ifneq ("$(origin O)", "command line")
225 O:=output
226 else
227 # other packages might also support Linux-style out of tree builds
228 # with the O=<dir> syntax (E.G. Busybox does). As make automatically
229 # forwards command line variable definitions those packages get very
230 # confused. Fix this by telling make to not do so
231 MAKEOVERRIDES =
232 endif
233
234 BASE_DIR := $(shell mkdir -p $(O) && cd $(O) && pwd)
235 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
236
237 DL_DIR=$(call qstrip,$(BR2_DL_DIR))
238 ifeq ($(DL_DIR),)
239 DL_DIR:=$(TOPDIR)/dl
240 endif
241
242 BUILD_DIR:=$(BASE_DIR)/build
243
244 GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
245
246 STAGING_DIR:=$(call qstrip,$(BR2_STAGING_DIR))
247
248 # packages compiled for the host goes here
249 HOST_DIR:=$(BASE_DIR)/host
250
251 # stamp (dependency) files go here
252 STAMP_DIR:=$(BASE_DIR)/stamps
253
254 BINARIES_DIR:=$(BASE_DIR)/images
255 TARGET_DIR:=$(BASE_DIR)/target
256
257 # define values for prepatched source trees for toolchains
258 VENDOR_SITE:=$(call qstrip,$(BR2_VENDOR_SITE))
259 VENDOR_SUFFIX:=$(call qstrip,$(BR2_VENDOR_SUFFIX))
260 VENDOR_BINUTILS_RELEASE:=$(call qstrip,$(BR2_VENDOR_BINUTILS_RELEASE))
261 VENDOR_GCC_RELEASE:=$(call qstrip,$(BR2_VENDOR_GCC_RELEASE))
262 VENDOR_UCLIBC_RELEASE:=$(call qstrip,$(BR2_VENDOR_UCLIBC_RELEASE))
263 VENDOR_GDB_RELEASE:=$(call qstrip,$(BR2_VENDOR_GDB_RELEASE))
264 VENDOR_PATCH_DIR:=$(call qstrip,$(BR2_VENDOR_PATCH_DIR))
265
266 BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
267
268 include toolchain/Makefile.in
269 include package/Makefile.in
270
271 #############################################################
272 #
273 # You should probably leave this stuff alone unless you know
274 # what you are doing.
275 #
276 #############################################################
277
278 all: world
279
280 # In this section, we need .config
281 include .config.cmd
282
283 # We also need the various per-package makefiles, which also add
284 # each selected package to TARGETS if that package was selected
285 # in the .config file.
286 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
287 # avoid pulling in external toolchain which is broken for toplvl parallel builds
288 # Explicit ordering:
289 include toolchain/dependencies/dependencies.mk
290 include toolchain/binutils/binutils.mk
291 include toolchain/ccache/ccache.mk
292 include toolchain/elf2flt/elf2flt.mk
293 include toolchain/gcc/gcc-uclibc-3.x.mk
294 include toolchain/gcc/gcc-uclibc-4.x.mk
295 include toolchain/gdb/gdb.mk
296 include toolchain/kernel-headers/kernel-headers.mk
297 include toolchain/mklibs/mklibs.mk
298 include toolchain/sstrip/sstrip.mk
299 include toolchain/uClibc/uclibc.mk
300 else
301 include toolchain/*/*.mk
302 endif
303
304 ifeq ($(BR2_PACKAGE_LINUX),y)
305 TARGETS+=linux26-modules
306 endif
307
308 include package/*/*.mk
309
310 TARGETS+=target-finalize
311
312 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
313 TARGETS+=target-purgelocales
314 endif
315
316 # target stuff is last so it can override anything else
317 include target/Makefile.in
318
319 TARGETS+=erase-fakeroots
320
321 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
322 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
323 TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
324 TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
325 # all targets depend on the crosscompiler and it's prerequisites
326 $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
327
328 $(BR2_DEPENDS_DIR): .config
329         rm -rf $@
330         mkdir -p $(@D)
331         cp -dpRf $(CONFIG)/buildroot-config $@
332
333 dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
334         $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
335
336 $(BASE_TARGETS): dirs
337
338 world: dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
339
340
341 .PHONY: all world dirs clean dirclean distclean source \
342         $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
343         $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
344         $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
345         $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
346
347 #############################################################
348 #
349 # staging and target directories do NOT list these as
350 # dependencies anywhere else
351 #
352 #############################################################
353 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
354         @mkdir -p $@
355
356 $(STAGING_DIR):
357         @mkdir -p $(STAGING_DIR)/bin
358         @mkdir -p $(STAGING_DIR)/lib
359 ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
360         @mkdir -p $(STAGING_DIR)/usr/lib
361 else
362 ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y)
363         @ln -snf . $(STAGING_DIR)/usr
364         @mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)
365         @ln -snf ../lib $(STAGING_DIR)/usr/lib
366         @ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
367 endif
368 endif
369         @mkdir -p $(STAGING_DIR)/usr/include
370
371 $(BUILD_DIR)/.root:
372         mkdir -p $(TARGET_DIR)
373         if ! [ -d "$(TARGET_DIR)/bin" ]; then \
374                 if [ -d "$(TARGET_SKELETON)" ]; then \
375                         cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
376                 fi; \
377                 if [ -d "$(TARGET_SKELETON_PATCH)" ]; then \
378                         toolchain/patch-kernel.sh $(TARGET_DIR) $(TARGET_SKELETON_PATCH)/ \*patch\*; \
379                 fi; \
380                 touch $(STAGING_DIR)/.fakeroot.00000; \
381         fi
382         -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
383         -find $(TARGET_DIR) -type f -name .empty -print0 | xargs -0 rm -rf
384         touch $@
385
386 $(TARGET_DIR): $(BUILD_DIR)/.root
387
388 erase-fakeroots:
389         rm -f $(BUILD_DIR)/.fakeroot*
390
391 target-finalize:
392 ifeq ($(BR2_HAVE_DEVFILES),y)
393         ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
394 else
395         rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
396         find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
397         find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
398 endif
399 ifneq ($(BR2_HAVE_MANPAGES),y)
400         rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
401 endif
402 ifneq ($(BR2_HAVE_INFOPAGES),y)
403         rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
404 endif
405         find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
406         $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
407
408         mkdir -p $(TARGET_DIR)/etc
409         echo $(BR2_VERSION)$(shell $(TOPDIR)/scripts/setlocalversion) > \
410                 $(TARGET_DIR)/etc/br-version
411
412 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
413         $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
414 endif
415
416 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
417 LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
418 LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
419
420 target-purgelocales:
421         rm -f $(LOCALE_WHITELIST)
422         for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
423
424         for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \
425         do \
426                 for lang in $$(cd $$dir; ls .|grep -v man); \
427                 do \
428                         grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
429                 done; \
430         done
431 endif
432
433 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
434
435 _source-check:
436         $(MAKE) SPIDER=--spider source
437
438 external-deps:
439         @$(MAKE) -Bs BR2_WGET=$(TOPDIR)/toolchain/wget-show-external-deps.sh \
440                 SPIDER=--spider source
441
442 #############################################################
443 #
444 # Cleanup and misc junk
445 #
446 #############################################################
447 clean: $(TARGETS_CLEAN)
448         rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(BUILD_DIR)/.root $(STAMP_DIR)
449
450 dirclean: $(TARGETS_DIRCLEAN)
451         rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(BUILD_DIR)/.root $(STAMP_DIR)
452
453 distclean:
454 ifeq ($(DL_DIR),$(TOPDIR)/dl)
455         rm -rf $(DL_DIR)
456 endif
457         rm -rf $(TOOLCHAIN_DIR) $(BUILD_DIR) $(BINARIES_DIR) \
458         .config.cmd
459         $(MAKE) -C $(CONFIG) clean
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 #############################################################
577 #
578 # Cleanup and misc junk
579 #
580 #############################################################
581 clean:
582         rm -f .config .config.old .config.cmd .tmpconfig.h .lognr.*
583         -$(MAKE) -C $(CONFIG) clean
584
585 distclean: clean
586         rm -rf sources/*
587
588
589 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
590
591 flush:
592         rm -f $(BUILD_DIR)/tgt-config.cache
593
594 %_defconfig: $(CONFIG)/conf
595         cp $(shell find ./target/ -name $@) .config
596         -@$(MAKE) oldconfig
597
598 configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config
599
600 prepatch:       gcc-patched binutils-patched gdb-patched uclibc-patched
601
602 cross: $(BASE_TARGETS)
603
604 help:
605         @echo 'Cleaning:'
606         @echo '  clean                  - delete temporary files created by build'
607         @echo '  distclean              - delete all non-source files (including .config)'
608         @echo
609         @echo 'Build:'
610         @echo '  all                    - make world'
611         @echo
612         @echo 'Configuration:'
613         @echo '  menuconfig             - interactive curses-based configurator'
614         @echo '  xconfig                - interactive Qt-based configurator'
615         @echo '  oldconfig              - resolve any unresolved symbols in .config'
616         @echo '  randconfig             - New config with random answer to all options'
617         @echo '  defconfig              - New config with default answer to all options'
618         @echo '  allyesconfig           - New config where all options are accepted with yes'
619         @echo '  allnoconfig            - New config where all options are answered with no'
620         @echo '  randpackageconfig      - New config with random answer to package options'
621         @echo '  allyespackageconfig    - New config where pkg options are accepted with yes'
622         @echo '  allnopackageconfig     - New config where package options are answered with no'
623         @echo '  configured             - make {uclibc/busybox/linux26}-config'
624         @echo
625         @echo 'Miscellaneous:'
626         @echo '  source                 - download all sources needed for offline-build'
627         @echo '  source-check           - check all packages for valid download URLs'
628         @echo '  external-deps          - list external packages used'
629         @echo '  flush                  - flush configuration cache'
630         @echo
631         @echo 'See docs/README and docs/buildroot.html for further details'
632         @echo
633
634 release: distclean
635         OUT=buildroot-$$(grep -A2 BR2_VERSION $(CONFIG_CONFIG_IN)|grep default|cut -f2 -d\"); \
636         rm -rf ../$$OUT*; cp -al . ../$$OUT; cd ..; \
637         tar cfz $$OUT.tar.gz --exclude .svn --exclude .git --exclude \*~ $$OUT; \
638         rm -rf $$OUT
639
640 .PHONY: $(noconfig_targets)
641
This page took 0.061373 seconds and 4 git commands to generate.