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