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