]> Git Repo - buildroot-mgba.git/blob - Makefile
Makefile: document configure cache handling
[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 # 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 #############################################################
157 #
158 # Setup the proper filename extensions for the host
159 #
160 ##############################################################
161 ifneq ($(findstring linux,$(BR2_GNU_BUILD_SUFFIX)),)
162 HOST_EXEEXT:=
163 HOST_LIBEXT:=.a
164 HOST_SHREXT:=.so
165 endif
166 ifneq ($(findstring apple,$(BR2_GNU_BUILD_SUFFIX)),)
167 HOST_EXEEXT:=
168 HOST_LIBEXT:=.a
169 HOST_SHREXT:=.dylib
170 endif
171 ifneq ($(findstring cygwin,$(BR2_GNU_BUILD_SUFFIX)),)
172 HOST_EXEEXT:=.exe
173 HOST_LIBEXT:=.lib
174 HOST_SHREXT:=.dll
175 HOST_LOADLIBES="-lcurses -lintl"
176 export HOST_LOADLIBES
177 endif
178 ifneq ($(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)),)
179 HOST_EXEEXT:=.exe
180 HOST_LIBEXT:=.lib
181 HOST_SHREXT:=.dll
182 endif
183
184 # The preferred type of libs we build for the target
185 ifeq ($(BR2_PREFER_STATIC_LIB),y)
186 LIBTGTEXT=.a
187 #PREFERRED_LIB_FLAGS:=--disable-shared --enable-static
188 else
189 LIBTGTEXT=.so
190 #PREFERRED_LIB_FLAGS:=--disable-static --enable-shared
191 endif
192 PREFERRED_LIB_FLAGS:=--enable-static --enable-shared
193
194 ##############################################################
195 #
196 # The list of stuff to build for the target toolchain
197 # along with the packages to build for the target.
198 #
199 ##############################################################
200 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
201 BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
202 else
203 BASE_TARGETS:=uclibc
204 endif
205 TARGETS:=
206
207 # silent mode requested?
208 QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q)
209
210 # Strip off the annoying quoting
211 ARCH:=$(call qstrip,$(BR2_ARCH))
212 ifeq ($(ARCH),xtensa)
213 ARCH:=$(ARCH)_$(call qstrip,$(BR2_xtensa_core_name))
214 endif
215 WGET:=$(call qstrip,$(BR2_WGET)) $(SPIDER) $(QUIET)
216 SVN_CO:=$(call qstrip,$(BR2_SVN_CO)) $(QUIET)
217 SVN_UP:=$(call qstrip,$(BR2_SVN_UP)) $(QUIET)
218 BZR_CO:=$(call qstrip,$(BR2_BZR_CO)) $(QUIET)
219 BZR_UP:=$(call qstrip,$(BR2_BZR_UP)) $(QUIET)
220 GIT:=$(call qstrip,$(BR2_GIT)) $(QUIET)
221 ZCAT:=$(call qstrip,$(BR2_ZCAT))
222 BZCAT:=$(call qstrip,$(BR2_BZCAT))
223 TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
224
225 ifneq ("$(origin O)", "command line")
226 O:=output
227 else
228 # other packages might also support Linux-style out of tree builds
229 # with the O=<dir> syntax (E.G. Busybox does). As make automatically
230 # forwards command line variable definitions those packages get very
231 # confused. Fix this by telling make to not do so
232 MAKEOVERRIDES =
233 endif
234
235 BASE_DIR := $(shell mkdir -p $(O) && cd $(O) && pwd)
236 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
237
238 DL_DIR=$(call qstrip,$(BR2_DL_DIR))
239 ifeq ($(DL_DIR),)
240 DL_DIR:=$(TOPDIR)/dl
241 endif
242
243 BUILD_DIR:=$(BASE_DIR)/build
244
245 GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
246
247 STAGING_DIR:=$(call qstrip,$(BR2_STAGING_DIR))
248
249 # packages compiled for the host goes here
250 HOST_DIR:=$(BASE_DIR)/host
251
252 # stamp (dependency) files go here
253 STAMP_DIR:=$(BASE_DIR)/stamps
254
255 BINARIES_DIR:=$(BASE_DIR)/images
256 TARGET_DIR:=$(BASE_DIR)/target
257
258 # define values for prepatched source trees for toolchains
259 VENDOR_SITE:=$(call qstrip,$(BR2_VENDOR_SITE))
260 VENDOR_SUFFIX:=$(call qstrip,$(BR2_VENDOR_SUFFIX))
261 VENDOR_BINUTILS_RELEASE:=$(call qstrip,$(BR2_VENDOR_BINUTILS_RELEASE))
262 VENDOR_GCC_RELEASE:=$(call qstrip,$(BR2_VENDOR_GCC_RELEASE))
263 VENDOR_UCLIBC_RELEASE:=$(call qstrip,$(BR2_VENDOR_UCLIBC_RELEASE))
264 VENDOR_GDB_RELEASE:=$(call qstrip,$(BR2_VENDOR_GDB_RELEASE))
265 VENDOR_PATCH_DIR:=$(call qstrip,$(BR2_VENDOR_PATCH_DIR))
266
267 BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
268
269 include toolchain/Makefile.in
270 include package/Makefile.in
271
272 #############################################################
273 #
274 # You should probably leave this stuff alone unless you know
275 # what you are doing.
276 #
277 #############################################################
278
279 all: world
280
281 # In this section, we need .config
282 include .config.cmd
283
284 # We also need the various per-package makefiles, which also add
285 # each selected package to TARGETS if that package was selected
286 # in the .config file.
287 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
288 # avoid pulling in external toolchain which is broken for toplvl parallel builds
289 # Explicit ordering:
290 include toolchain/dependencies/dependencies.mk
291 include toolchain/binutils/binutils.mk
292 include toolchain/ccache/ccache.mk
293 include toolchain/elf2flt/elf2flt.mk
294 include toolchain/gcc/gcc-uclibc-3.x.mk
295 include toolchain/gcc/gcc-uclibc-4.x.mk
296 include toolchain/gdb/gdb.mk
297 include toolchain/kernel-headers/kernel-headers.mk
298 include toolchain/mklibs/mklibs.mk
299 include toolchain/sstrip/sstrip.mk
300 include toolchain/uClibc/uclibc.mk
301 else
302 include toolchain/*/*.mk
303 endif
304
305 ifeq ($(BR2_PACKAGE_LINUX),y)
306 TARGETS+=linux26-modules
307 endif
308
309 include package/*/*.mk
310
311 TARGETS+=target-finalize
312
313 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
314 TARGETS+=target-purgelocales
315 endif
316
317 # target stuff is last so it can override anything else
318 include target/Makefile.in
319
320 TARGETS+=erase-fakeroots
321
322 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
323 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
324 TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
325 TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
326 # all targets depend on the crosscompiler and it's prerequisites
327 $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
328
329 $(BR2_DEPENDS_DIR): .config
330         rm -rf $@
331         mkdir -p $(@D)
332         cp -dpRf $(CONFIG)/buildroot-config $@
333
334 dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
335         $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
336
337 $(BASE_TARGETS): dirs
338
339 world: dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
340
341
342 .PHONY: all world dirs clean distclean source \
343         $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
344         $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
345         $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
346         $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
347
348 #############################################################
349 #
350 # staging and target directories do NOT list these as
351 # dependencies anywhere else
352 #
353 #############################################################
354 $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
355         @mkdir -p $@
356
357 $(STAGING_DIR):
358         @mkdir -p $(STAGING_DIR)/bin
359         @mkdir -p $(STAGING_DIR)/lib
360 ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
361         @mkdir -p $(STAGING_DIR)/usr/lib
362 else
363 ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y)
364         @ln -snf . $(STAGING_DIR)/usr
365         @mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)
366         @ln -snf ../lib $(STAGING_DIR)/usr/lib
367         @ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
368 endif
369 endif
370         @mkdir -p $(STAGING_DIR)/usr/include
371
372 $(BUILD_DIR)/.root:
373         mkdir -p $(TARGET_DIR)
374         if ! [ -d "$(TARGET_DIR)/bin" ]; then \
375                 if [ -d "$(TARGET_SKELETON)" ]; then \
376                         cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
377                 fi; \
378                 if [ -d "$(TARGET_SKELETON_PATCH)" ]; then \
379                         toolchain/patch-kernel.sh $(TARGET_DIR) $(TARGET_SKELETON_PATCH)/ \*patch\*; \
380                 fi; \
381                 touch $(STAGING_DIR)/.fakeroot.00000; \
382         fi
383         -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
384         -find $(TARGET_DIR) -type f -name .empty -print0 | xargs -0 rm -rf
385         touch $@
386
387 $(TARGET_DIR): $(BUILD_DIR)/.root
388
389 erase-fakeroots:
390         rm -f $(BUILD_DIR)/.fakeroot*
391
392 target-finalize:
393 ifeq ($(BR2_HAVE_DEVFILES),y)
394         ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
395 else
396         rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
397         find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
398         find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
399 endif
400 ifneq ($(BR2_HAVE_MANPAGES),y)
401         rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
402 endif
403 ifneq ($(BR2_HAVE_INFOPAGES),y)
404         rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
405 endif
406         find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
407         $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
408
409         mkdir -p $(TARGET_DIR)/etc
410         echo $(BR2_VERSION)$(shell $(TOPDIR)/scripts/setlocalversion) > \
411                 $(TARGET_DIR)/etc/br-version
412
413 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
414         $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
415 endif
416
417 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
418 LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
419 LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
420
421 target-purgelocales:
422         rm -f $(LOCALE_WHITELIST)
423         for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
424
425         for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \
426         do \
427                 for lang in $$(cd $$dir; ls .|grep -v man); \
428                 do \
429                         grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
430                 done; \
431         done
432 endif
433
434 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
435
436 _source-check:
437         $(MAKE) SPIDER=--spider source
438
439 external-deps:
440         @$(MAKE) -Bs BR2_WGET=$(TOPDIR)/toolchain/wget-show-external-deps.sh \
441                 SPIDER=--spider source
442
443 ifeq ($(BR2_CONFIG_CACHE),y)
444 # drop configure cache if configuration is changed
445 $(BUILD_DIR)/tgt-config.cache: .config
446         rm -f $@
447         touch $@
448
449 $(BASE_TARGETS): | $(BUILD_DIR)/tgt-config.cache
450 endif
451
452 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
453
454 all: menuconfig
455
456 # configuration
457 # ---------------------------------------------------------------------------
458
459 HOSTCFLAGS=$(CFLAGS_FOR_BUILD)
460 export HOSTCFLAGS
461
462 $(CONFIG)/conf:
463         @mkdir -p $(CONFIG)/buildroot-config
464         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf
465         -@if [ ! -f .config ]; then \
466                 cp $(CONFIG_DEFCONFIG) .config; \
467         fi
468
469 $(CONFIG)/mconf:
470         @mkdir -p $(CONFIG)/buildroot-config
471         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) mconf
472         -@if [ ! -f .config ]; then \
473                 cp $(CONFIG_DEFCONFIG) .config; \
474         fi
475
476 $(CONFIG)/qconf:
477         @mkdir -p $(CONFIG)/buildroot-config
478         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) qconf
479         -@if [ ! -f .config ]; then \
480                 cp $(CONFIG_DEFCONFIG) .config; \
481         fi
482
483 xconfig: $(CONFIG)/qconf
484         @mkdir -p $(CONFIG)/buildroot-config
485         @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
486                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
487                 $(CONFIG)/qconf $(CONFIG_CONFIG_IN); then \
488                 test -f .config.cmd || rm -f .config; \
489         fi
490
491 menuconfig: $(CONFIG)/mconf
492         @mkdir -p $(CONFIG)/buildroot-config
493         @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
494                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
495                 $(CONFIG)/mconf $(CONFIG_CONFIG_IN); then \
496                 test -f .config.cmd || rm -f .config; \
497         fi
498
499 config: $(CONFIG)/conf
500         @mkdir -p $(CONFIG)/buildroot-config
501         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
502                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
503                 $(CONFIG)/conf $(CONFIG_CONFIG_IN)
504
505 oldconfig: $(CONFIG)/conf
506         @mkdir -p $(CONFIG)/buildroot-config
507         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
508                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
509                 $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
510
511 randconfig: $(CONFIG)/conf
512         @mkdir -p $(CONFIG)/buildroot-config
513         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
514                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
515                 $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
516
517 allyesconfig: $(CONFIG)/conf
518         cat $(CONFIG_DEFCONFIG) > .config
519         @mkdir -p $(CONFIG)/buildroot-config
520         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
521                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
522                 $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
523
524 allnoconfig: $(CONFIG)/conf
525         @mkdir -p $(CONFIG)/buildroot-config
526         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
527                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
528                 $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
529
530 randpackageconfig: $(CONFIG)/conf
531         @mkdir -p $(CONFIG)/buildroot-config
532         @grep -v BR2_PACKAGE_ .config > .config.nopkg
533         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
534                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
535                 KCONFIG_ALLCONFIG=.config.nopkg \
536                 $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
537         @rm -f .config.nopkg
538
539 allyespackageconfig: $(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 -y $(CONFIG_CONFIG_IN)
546         @rm -f .config.nopkg
547
548 allnopackageconfig: $(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 -n $(CONFIG_CONFIG_IN)
555         @rm -f .config.nopkg
556
557 defconfig: $(CONFIG)/conf
558         @mkdir -p $(CONFIG)/buildroot-config
559         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
560                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
561                 $(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
562
563 # check if download URLs are outdated
564 source-check: allyesconfig
565         $(MAKE) _source-check
566
567 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
568
569 #############################################################
570 #
571 # Cleanup and misc junk
572 #
573 #############################################################
574 clean:
575         rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
576                 $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR)
577
578 distclean: clean
579 ifeq ($(DL_DIR),$(TOPDIR)/dl)
580         rm -rf $(DL_DIR)
581 endif
582 ifeq ($(O),output)
583         rm -rf $(O)
584 endif
585         rm -rf .config .config.old .config.cmd .auto.deps
586         -$(MAKE) -C $(CONFIG) clean
587
588 flush:
589         rm -f $(BUILD_DIR)/tgt-config.cache
590
591 %_defconfig: $(TOPDIR)/configs/%_defconfig
592         cp $^ .config
593         @$(MAKE) oldconfig
594
595 configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config
596
597 prepatch:       gcc-patched binutils-patched gdb-patched uclibc-patched
598
599 cross: $(BASE_TARGETS)
600
601 help:
602         @echo 'Cleaning:'
603         @echo '  clean                  - delete all files created by build'
604         @echo '  distclean              - delete all non-source files (including .config)'
605         @echo
606         @echo 'Build:'
607         @echo '  all                    - make world'
608         @echo
609         @echo 'Configuration:'
610         @echo '  menuconfig             - interactive curses-based configurator'
611         @echo '  xconfig                - interactive Qt-based configurator'
612         @echo '  oldconfig              - resolve any unresolved symbols in .config'
613         @echo '  randconfig             - New config with random answer to all options'
614         @echo '  defconfig              - New config with default answer to all options'
615         @echo '  allyesconfig           - New config where all options are accepted with yes'
616         @echo '  allnoconfig            - New config where all options are answered with no'
617         @echo '  randpackageconfig      - New config with random answer to package options'
618         @echo '  allyespackageconfig    - New config where pkg options are accepted with yes'
619         @echo '  allnopackageconfig     - New config where package options are answered with no'
620         @echo '  configured             - make {uclibc/busybox/linux26}-config'
621         @echo
622         @echo 'Miscellaneous:'
623         @echo '  source                 - download all sources needed for offline-build'
624         @echo '  source-check           - check all packages for valid download URLs'
625         @echo '  external-deps          - list external packages used'
626         @echo '  flush                  - flush configuration cache'
627         @echo
628         @$(foreach b, $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig)), \
629           printf "  %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
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.068327 seconds and 4 git commands to generate.