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