]> Git Repo - buildroot-mgba.git/blob - Makefile
Remove the "project" feature
[buildroot-mgba.git] / Makefile
1 # Makefile for buildroot2
2 #
3 # Copyright (C) 1999-2005 by Erik Andersen <[email protected]>
4 # Copyright (C) 2006-2009 by the Buildroot developers <[email protected]>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #
20
21 #--------------------------------------------------------------
22 # Just run 'make menuconfig', configure stuff, then run 'make'.
23 # You shouldn't need to mess with anything beyond this point...
24 #--------------------------------------------------------------
25 TOPDIR=./
26 CONFIG_CONFIG_IN=Config.in
27 CONFIG_DEFCONFIG=.defconfig
28 CONFIG=package/config
29 DATE:=$(shell date +%Y%m%d)
30
31 noconfig_targets:=menuconfig xconfig config oldconfig randconfig \
32         defconfig allyesconfig allnoconfig release tags \
33         source-check help
34
35
36 # Use shell variables, if defined
37 ifneq ($(BUILDROOT_LOCAL),)
38 BR2_LOCAL:=$(BUILDROOT_LOCAL)
39 else
40 BR2_LOCAL:=$(TOPDIR)/local
41 endif
42
43 # Strip quotes and then whitespaces
44 qstrip=$(strip $(subst ",,$(1)))
45 #"))
46
47 # Variables for use in Make constructs
48 comma:=,
49 empty:=
50 space:=$(empty) $(empty)
51
52 # $(shell find . -name *_defconfig |sed 's/.*\///')
53 # Pull in the user's configuration file
54 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
55 ifeq ($(BOARD),)
56 # if "make BOARD=xyz" command
57 -include .config
58 else
59 # if "make" command
60 -include $(BR2_LOCAL)/$(BOARD)/$(BOARD).config
61 endif
62 endif
63
64 # Override BR2_DL_DIR if shell variable defined
65 ifneq ($(BUILDROOT_DL_DIR),)
66 BR2_DL_DIR:=$(BUILDROOT_DL_DIR)
67 endif
68 LOCAL:=$(BR2_LOCAL)
69
70 # To put more focus on warnings, be less verbose as default
71 # Use 'make V=1' to see the full commands
72 ifdef V
73   ifeq ("$(origin V)", "command line")
74     KBUILD_VERBOSE=$(V)
75   endif
76 endif
77 ifndef KBUILD_VERBOSE
78   KBUILD_VERBOSE=0
79 endif
80
81 ifeq ($(KBUILD_VERBOSE),1)
82   quiet=
83   Q=
84 ifndef VERBOSE
85   VERBOSE=1
86 endif
87 else
88   quiet=quiet_
89   Q=@
90 endif
91
92 # we want bash as shell
93 SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \
94         else if [ -x /bin/bash ]; then echo /bin/bash; \
95         else echo sh; fi; fi)
96
97 # kconfig uses CONFIG_SHELL
98 CONFIG_SHELL:=$(SHELL)
99
100 export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE
101
102 ifndef HOSTAR
103 HOSTAR:=ar
104 endif
105 ifndef HOSTAS
106 HOSTAS:=as
107 endif
108 ifndef HOSTCC
109 HOSTCC:=gcc
110 else
111 endif
112 ifndef HOSTCXX
113 HOSTCXX:=g++
114 endif
115 ifndef HOSTFC
116 HOSTFC:=gfortran
117 endif
118 ifndef HOSTCPP
119 HOSTCPP:=cpp
120 endif
121 ifndef HOSTLD
122 HOSTLD:=ld
123 endif
124 ifndef HOSTLN
125 HOSTLN:=ln
126 endif
127 ifndef HOSTNM
128 HOSTNM:=nm
129 endif
130 HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
131 HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
132 HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
133 HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
134 HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran)
135 HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
136 HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
137 HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
138 HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
139
140 ifndef CFLAGS_FOR_BUILD
141 CFLAGS_FOR_BUILD:=-g -O2
142 endif
143 ifndef CXXFLAGS_FOR_BUILD
144 CXXFLAGS_FOR_BUILD:=-g -O2
145 endif
146 ifndef FCFLAGS_FOR_BUILD
147 FCFLAGS_FOR_BUILD:=-g -O2
148 endif
149 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
150
151
152 ifeq ($(BR2_HAVE_DOT_CONFIG),y)
153
154 # cc-option
155 # Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586)
156 # sets -march=winchip-c6 if supported else falls back to -march=i586
157 # without checking the latter.
158 cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
159         > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
160
161 #############################################################
162 #
163 # Hide troublesome environment variables from sub processes
164 #
165 #############################################################
166 unexport CROSS_COMPILE
167 unexport ARCH
168
169 #############################################################
170 #
171 # Setup the proper filename extensions for the host
172 #
173 ##############################################################
174 ifneq ($(findstring linux,$(BR2_GNU_BUILD_SUFFIX)),)
175 HOST_EXEEXT:=
176 HOST_LIBEXT:=.a
177 HOST_SHREXT:=.so
178 endif
179 ifneq ($(findstring apple,$(BR2_GNU_BUILD_SUFFIX)),)
180 HOST_EXEEXT:=
181 HOST_LIBEXT:=.a
182 HOST_SHREXT:=.dylib
183 endif
184 ifneq ($(findstring cygwin,$(BR2_GNU_BUILD_SUFFIX)),)
185 HOST_EXEEXT:=.exe
186 HOST_LIBEXT:=.lib
187 HOST_SHREXT:=.dll
188 HOST_LOADLIBES="-lcurses -lintl"
189 export HOST_LOADLIBES
190 endif
191 ifneq ($(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)),)
192 HOST_EXEEXT:=.exe
193 HOST_LIBEXT:=.lib
194 HOST_SHREXT:=.dll
195 endif
196
197 # The preferred type of libs we build for the target
198 ifeq ($(BR2_PREFER_STATIC_LIB),y)
199 LIBTGTEXT=.a
200 #PREFERRED_LIB_FLAGS:=--disable-shared --enable-static
201 else
202 LIBTGTEXT=.so
203 #PREFERRED_LIB_FLAGS:=--disable-static --enable-shared
204 endif
205 PREFERRED_LIB_FLAGS:=--enable-static --enable-shared
206
207 ##############################################################
208 #
209 # The list of stuff to build for the target toolchain
210 # along with the packages to build for the target.
211 #
212 ##############################################################
213 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
214 BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
215 else
216 BASE_TARGETS:=uclibc
217 endif
218 TARGETS:=
219
220 # Strip off the annoying quoting
221 ARCH:=$(call qstrip,$(BR2_ARCH))
222 ifeq ($(ARCH),xtensa)
223 ARCH:=$(ARCH)_$(call qstrip,$(BR2_xtensa_core_name))
224 endif
225 WGET:=$(call qstrip,$(BR2_WGET)) $(SPIDER) $(QUIET)
226 SVN_CO:=$(call qstrip,$(BR2_SVN_CO)) $(QUIET)
227 SVN_UP:=$(call qstrip,$(BR2_SVN_UP)) $(QUIET)
228 BZR_CO:=$(call qstrip,$(BR2_BZR_CO)) $(QUIET)
229 BZR_UP:=$(call qstrip,$(BR2_BZR_UP)) $(QUIET)
230 GIT:=$(call qstrip,$(BR2_GIT)) $(QUIET)
231 ZCAT:=$(call qstrip,$(BR2_ZCAT))
232 BZCAT:=$(call qstrip,$(BR2_BZCAT))
233 TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf
234
235 # Buildroot supports building out of tree similarly to the Linux kernel.
236 # To use, add O= to the make command line (make O=/tmp/build)
237 BASE_DIR:=$(shell pwd)
238 ifdef O
239 ifeq ("$(origin O)", "command line")
240 BASE_DIR := $(shell mkdir -p $(O) && cd $(O) && pwd)
241 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
242
243 # other packages might also support Linux-style out of tree builds
244 # with the O=<dir> syntax (E.G. Busybox does). As make automatically
245 # forwards command line variable definitions those packages get very
246 # confused. Fix this by telling make to not do so
247 MAKEOVERRIDES =
248 endif
249 endif
250
251 TOPDIR_PREFIX:=$(call qstrip,$(BR2_TOPDIR_PREFIX))_
252 TOPDIR_SUFFIX:=_$(call qstrip,$(BR2_TOPDIR_SUFFIX))
253 ifeq ($(TOPDIR_PREFIX),_)
254 TOPDIR_PREFIX:=
255 endif
256 ifeq ($(TOPDIR_SUFFIX),_)
257 TOPDIR_SUFFIX:=
258 endif
259
260 DL_DIR=$(call qstrip,$(BR2_DL_DIR))
261 ifeq ($(DL_DIR),)
262 DL_DIR:=$(BASE_DIR)/dl
263 endif
264
265 BUILD_DIR:=$(BASE_DIR)/$(TOPDIR_PREFIX)build_$(ARCH)$(ARCH_FPU_SUFFIX)$(TOPDIR_SUFFIX)
266
267 GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
268
269 STAGING_DIR:=$(call qstrip,$(BR2_STAGING_DIR))
270
271 # packages compiled for the host goes here
272 HOST_DIR:=$(BUILD_DIR)/host_dir
273
274 # stamp (dependency) files go here
275 STAMP_DIR:=$(BUILD_DIR)/stamps
276
277 BINARIES_DIR:=$(BASE_DIR)/binaries/
278 TARGET_DIR:=$(BUILD_DIR)/target_dir
279
280 # define values for prepatched source trees for toolchains
281 VENDOR_SITE:=$(call qstrip,$(BR2_VENDOR_SITE))
282 VENDOR_SUFFIX:=$(call qstrip,$(BR2_VENDOR_SUFFIX))
283 VENDOR_BINUTILS_RELEASE:=$(call qstrip,$(BR2_VENDOR_BINUTILS_RELEASE))
284 VENDOR_GCC_RELEASE:=$(call qstrip,$(BR2_VENDOR_GCC_RELEASE))
285 VENDOR_UCLIBC_RELEASE:=$(call qstrip,$(BR2_VENDOR_UCLIBC_RELEASE))
286 VENDOR_GDB_RELEASE:=$(call qstrip,$(BR2_VENDOR_GDB_RELEASE))
287 VENDOR_PATCH_DIR:=$(call qstrip,$(BR2_VENDOR_PATCH_DIR))
288
289 BR2_DEPENDS_DIR=$(BUILD_DIR)/buildroot-config
290
291 include toolchain/Makefile.in
292 include package/Makefile.in
293
294 #############################################################
295 #
296 # You should probably leave this stuff alone unless you know
297 # what you are doing.
298 #
299 #############################################################
300
301 all: world
302
303 # In this section, we need .config
304 include .config.cmd
305
306 # We also need the various per-package makefiles, which also add
307 # each selected package to TARGETS if that package was selected
308 # in the .config file.
309 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
310 # avoid pulling in external toolchain which is broken for toplvl parallel builds
311 # Explicit ordering:
312 include toolchain/dependencies/dependencies.mk
313 include toolchain/binutils/binutils.mk
314 include toolchain/ccache/ccache.mk
315 include toolchain/elf2flt/elf2flt.mk
316 include toolchain/gcc/gcc-uclibc-3.x.mk
317 include toolchain/gcc/gcc-uclibc-4.x.mk
318 include toolchain/gdb/gdb.mk
319 include toolchain/kernel-headers/kernel-headers.mk
320 include toolchain/mklibs/mklibs.mk
321 include toolchain/sstrip/sstrip.mk
322 include toolchain/uClibc/uclibc.mk
323 else
324 include toolchain/*/*.mk
325 endif
326
327 ifeq ($(BR2_PACKAGE_LINUX),y)
328 TARGETS+=linux26-modules
329 endif
330
331 include package/*/*.mk
332
333 TARGETS+=target-finalize
334
335 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
336 TARGETS+=target-purgelocales
337 endif
338
339 # target stuff is last so it can override anything else
340 include target/Makefile.in
341
342 TARGETS+=erase-fakeroots
343
344 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
345 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
346 TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
347 TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS))
348 # all targets depend on the crosscompiler and it's prerequisites
349 $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
350
351 $(BR2_DEPENDS_DIR): .config
352         rm -rf $@
353         mkdir -p $(@D)
354         cp -dpRf $(CONFIG)/buildroot-config $@
355
356 dirs: $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
357         $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
358
359 $(BASE_TARGETS): dirs
360
361 world: dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
362
363
364 .PHONY: all world dirs clean dirclean distclean source \
365         $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
366         $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
367         $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
368         $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
369
370 #############################################################
371 #
372 # staging and target directories do NOT list these as
373 # dependencies anywhere else
374 #
375 #############################################################
376 $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
377         @mkdir -p $@
378
379 $(STAGING_DIR):
380         @mkdir -p $(STAGING_DIR)/bin
381         @mkdir -p $(STAGING_DIR)/lib
382 ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
383         @mkdir -p $(STAGING_DIR)/usr/lib
384 else
385 ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y)
386         @ln -snf . $(STAGING_DIR)/usr
387         @mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)
388         @ln -snf ../lib $(STAGING_DIR)/usr/lib
389         @ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
390 endif
391 endif
392         @mkdir -p $(STAGING_DIR)/usr/include
393
394 $(BUILD_DIR)/.root:
395         mkdir -p $(TARGET_DIR)
396         if ! [ -d "$(TARGET_DIR)/bin" ]; then \
397                 if [ -d "$(TARGET_SKELETON)" ]; then \
398                         cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
399                 fi; \
400                 if [ -d "$(TARGET_SKELETON_PATCH)" ]; then \
401                         toolchain/patch-kernel.sh $(TARGET_DIR) $(TARGET_SKELETON_PATCH)/ \*patch\*; \
402                 fi; \
403                 touch $(STAGING_DIR)/.fakeroot.00000; \
404         fi
405         -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
406         -find $(TARGET_DIR) -type f -name .empty -print0 | xargs -0 rm -rf
407         touch $@
408
409 $(TARGET_DIR): $(BUILD_DIR)/.root
410
411 erase-fakeroots:
412         rm -f $(BUILD_DIR)/.fakeroot*
413
414 target-finalize:
415 ifeq ($(BR2_HAVE_DEVFILES),y)
416         ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
417 else
418         rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
419         find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
420         find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
421 endif
422 ifneq ($(BR2_HAVE_MANPAGES),y)
423         rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
424 endif
425 ifneq ($(BR2_HAVE_INFOPAGES),y)
426         rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
427 endif
428         find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
429         $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
430
431 ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
432         $(BR2_ROOTFS_POST_BUILD_SCRIPT) $(TARGET_DIR)
433 endif
434
435 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
436 LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
437 LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
438
439 target-purgelocales:
440         rm -f $(LOCALE_WHITELIST)
441         for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done
442
443         for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \
444         do \
445                 for lang in $$(cd $$dir; ls .|grep -v man); \
446                 do \
447                         grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
448                 done; \
449         done
450 endif
451
452 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
453
454 _source-check:
455         $(MAKE) SPIDER=--spider source
456
457 external-deps:
458         @$(MAKE) -Bs BR2_WGET=$(TOPDIR)/toolchain/wget-show-external-deps.sh \
459                 SPIDER=--spider source
460
461 #############################################################
462 #
463 # Cleanup and misc junk
464 #
465 #############################################################
466 clean: $(TARGETS_CLEAN)
467         rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(BUILD_DIR)/.root $(STAMP_DIR)
468
469 dirclean: $(TARGETS_DIRCLEAN)
470         rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(BUILD_DIR)/.root $(STAMP_DIR)
471
472 distclean:
473 ifeq ($(DL_DIR),$(BASE_DIR)/dl)
474         rm -rf $(DL_DIR)
475 endif
476         rm -rf $(TOOL_BUILD_DIR) $(BUILD_DIR) $(BUILD_DIR) $(BINARIES_DIR) \
477         .config.cmd
478         $(MAKE) -C $(CONFIG) clean
479
480 sourceball:
481         rm -rf $(BUILD_DIR) $(BUILD_DIR) $(BINARIES_DIR)
482         set -e; \
483         cd ..; \
484         rm -f buildroot.tar.bz2; \
485         tar -cvf buildroot.tar buildroot; \
486         bzip2 -9 buildroot.tar; \
487
488
489 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
490
491 all: menuconfig
492
493 # configuration
494 # ---------------------------------------------------------------------------
495
496 HOSTCFLAGS=$(CFLAGS_FOR_BUILD)
497 export HOSTCFLAGS
498
499 $(CONFIG)/conf:
500         @mkdir -p $(CONFIG)/buildroot-config
501         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf
502         -@if [ ! -f .config ]; then \
503                 cp $(CONFIG_DEFCONFIG) .config; \
504         fi
505
506 $(CONFIG)/mconf:
507         @mkdir -p $(CONFIG)/buildroot-config
508         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) mconf
509         -@if [ ! -f .config ]; then \
510                 cp $(CONFIG_DEFCONFIG) .config; \
511         fi
512
513 $(CONFIG)/qconf:
514         @mkdir -p $(CONFIG)/buildroot-config
515         $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) qconf
516         -@if [ ! -f .config ]; then \
517                 cp $(CONFIG_DEFCONFIG) .config; \
518         fi
519
520 xconfig: $(CONFIG)/qconf
521         @mkdir -p $(CONFIG)/buildroot-config
522         @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
523                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
524                 $(CONFIG)/qconf $(CONFIG_CONFIG_IN); then \
525                 test -f .config.cmd || rm -f .config; \
526         fi
527
528 menuconfig: $(CONFIG)/mconf
529         @mkdir -p $(CONFIG)/buildroot-config
530         @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
531                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
532                 $(CONFIG)/mconf $(CONFIG_CONFIG_IN); then \
533                 test -f .config.cmd || rm -f .config; \
534         fi
535
536 config: $(CONFIG)/conf
537         @mkdir -p $(CONFIG)/buildroot-config
538         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
539                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
540                 $(CONFIG)/conf $(CONFIG_CONFIG_IN)
541
542 oldconfig: $(CONFIG)/conf
543         @mkdir -p $(CONFIG)/buildroot-config
544         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
545                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
546                 $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
547
548 randconfig: $(CONFIG)/conf
549         @mkdir -p $(CONFIG)/buildroot-config
550         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
551                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
552                 $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
553
554 allyesconfig: $(CONFIG)/conf
555         cat $(CONFIG_DEFCONFIG) > .config
556         @mkdir -p $(CONFIG)/buildroot-config
557         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
558                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
559                 $(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
560         #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config
561
562 allnoconfig: $(CONFIG)/conf
563         @mkdir -p $(CONFIG)/buildroot-config
564         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
565                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
566                 $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
567
568 defconfig: $(CONFIG)/conf
569         @mkdir -p $(CONFIG)/buildroot-config
570         @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \
571                 KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \
572                 $(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
573
574 # check if download URLs are outdated
575 source-check: allyesconfig
576         $(MAKE) _source-check
577
578 #############################################################
579 #
580 # Cleanup and misc junk
581 #
582 #############################################################
583 clean:
584         rm -f .config .config.old .config.cmd .tmpconfig.h .lognr.*
585         -$(MAKE) -C $(CONFIG) clean
586
587 distclean: clean
588         rm -rf sources/*
589
590
591 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
592
593 flush:
594         rm -f $(BUILD_DIR)/tgt-config.cache
595
596 %_defconfig: $(CONFIG)/conf
597         cp $(shell find ./target/ -name $@) .config
598         -@$(MAKE) oldconfig
599
600 configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config
601
602 prepatch:       gcc-patched binutils-patched gdb-patched uclibc-patched
603
604 cross: $(BASE_TARGETS)
605
606 help:
607         @echo 'Cleaning:'
608         @echo '  clean                  - delete temporary files created by build'
609         @echo '  distclean              - delete all non-source files (including .config)'
610         @echo
611         @echo 'Build:'
612         @echo '  all                    - make world'
613         @echo
614         @echo 'Configuration:'
615         @echo '  menuconfig             - interactive curses-based configurator'
616         @echo '  xconfig                - interactive Qt-based configurator'
617         @echo '  oldconfig              - resolve any unresolved symbols in .config'
618         @echo '  configured             - make {uclibc/busybox/linux26}-config'
619         @echo '  saveconfig             - save current configuration under local/<project>'
620         @echo '  getconfig              - restore saved configuration from local/<project>'
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         @echo 'See docs/README and docs/buildroot.html for further details'
629         @echo
630
631 release: distclean
632         OUT=buildroot-$$(grep -A2 BR2_VERSION $(CONFIG_CONFIG_IN)|grep default|cut -f2 -d\"); \
633         rm -rf ../$$OUT*; cp -al . ../$$OUT; cd ..; \
634         tar cfz $$OUT.tar.gz --exclude .svn --exclude .git --exclude \*~ $$OUT; \
635         rm -rf $$OUT
636
637 .PHONY: dummy subdirs release distclean clean config oldconfig \
638         menuconfig xconfig tags check test depend defconfig help
639
This page took 0.063184 seconds and 4 git commands to generate.