]>
Commit | Line | Data |
---|---|---|
6cbdfb64 | 1 | # Makefile for buildroot |
ffde94bd | 2 | # |
15b26aee | 3 | # Copyright (C) 1999-2005 by Erik Andersen <[email protected]> |
26b11df7 | 4 | # Copyright (C) 2006-2013 by the Buildroot developers <[email protected]> |
ffde94bd | 5 | # |
08782ae7 | 6 | # This program is free software; you can redistribute it and/or modify |
2d523c23 EA |
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. | |
ffde94bd | 10 | # |
2d523c23 EA |
11 | # This program is distributed in the hope that it will be useful, |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
08782ae7 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2d523c23 | 14 | # General Public License for more details. |
b30d673c | 15 | # |
2d523c23 EA |
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 | |
3ad3d8a1 | 19 | # |
02bf5816 | 20 | |
2d523c23 EA |
21 | #-------------------------------------------------------------- |
22 | # Just run 'make menuconfig', configure stuff, then run 'make'. | |
23 | # You shouldn't need to mess with anything beyond this point... | |
24 | #-------------------------------------------------------------- | |
2d239bbe | 25 | |
e5e8fae8 | 26 | # Set and export the version string |
d1476d0e | 27 | export BR2_VERSION:=2014.02-git |
e5e8fae8 | 28 | |
0edfb24c TDS |
29 | # Check for minimal make version (note: this check will break at make 10.x) |
30 | MIN_MAKE_VERSION=3.81 | |
8139e21c | 31 | ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION)) |
0edfb24c TDS |
32 | $(error You have make '$(MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required) |
33 | endif | |
34 | ||
1d4104f0 FP |
35 | export HOSTARCH := $(shell uname -m | \ |
36 | sed -e s/i.86/x86/ \ | |
37 | -e s/sun4u/sparc64/ \ | |
38 | -e s/arm.*/arm/ \ | |
39 | -e s/sa110/arm/ \ | |
40 | -e s/ppc64/powerpc/ \ | |
41 | -e s/ppc/powerpc/ \ | |
42 | -e s/macppc/powerpc/\ | |
43 | -e s/sh.*/sh/) | |
44 | ||
2d239bbe YM |
45 | # This top-level Makefile can *not* be executed in parallel |
46 | .NOTPARALLEL: | |
47 | ||
6b1dd45b PK |
48 | # absolute path |
49 | TOPDIR:=$(shell pwd) | |
18d979c7 | 50 | CONFIG_CONFIG_IN=Config.in |
56da3859 | 51 | CONFIG=support/kconfig |
a8ee1240 | 52 | DATE:=$(shell date +%Y%m%d) |
a0aef7c4 | 53 | |
8258df27 YM |
54 | # Compute the full local version string so packages can use it as-is |
55 | # Need to export it, so it can be got from environment in children (eg. mconf) | |
f082c7c5 | 56 | export BR2_VERSION_FULL:=$(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion) |
8258df27 | 57 | |
8b6585a9 | 58 | noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \ |
1ed49963 | 59 | %_defconfig allyesconfig allnoconfig silentoldconfig release \ |
6652770f | 60 | randpackageconfig allyespackageconfig allnopackageconfig \ |
9db3b47e | 61 | source-check print-version olddefconfig |
9e250356 | 62 | |
580c6d9b TP |
63 | # Strip quotes and then whitespaces |
64 | qstrip=$(strip $(subst ",,$(1))) | |
65 | #")) | |
66 | ||
f85f2de1 PK |
67 | # Variables for use in Make constructs |
68 | comma:=, | |
69 | empty:= | |
70 | space:=$(empty) $(empty) | |
71 | ||
39ca6d50 WW |
72 | ifneq ("$(origin O)", "command line") |
73 | O:=output | |
74 | CONFIG_DIR:=$(TOPDIR) | |
aefad531 | 75 | NEED_WRAPPER= |
39ca6d50 WW |
76 | else |
77 | # other packages might also support Linux-style out of tree builds | |
78 | # with the O=<dir> syntax (E.G. Busybox does). As make automatically | |
79 | # forwards command line variable definitions those packages get very | |
80 | # confused. Fix this by telling make to not do so | |
81 | MAKEOVERRIDES = | |
82 | # strangely enough O is still passed to submakes with MAKEOVERRIDES | |
83 | # (with make 3.81 atleast), the only thing that changes is the output | |
84 | # of the origin function (command line -> environment). | |
85 | # Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+) | |
86 | # To really make O go away, we have to override it. | |
87 | override O:=$(O) | |
88 | CONFIG_DIR:=$(O) | |
de846f6e PK |
89 | # we need to pass O= everywhere we call back into the toplevel makefile |
90 | EXTRAMAKEARGS = O=$(O) | |
aefad531 | 91 | NEED_WRAPPER=y |
39ca6d50 WW |
92 | endif |
93 | ||
bb335175 TDS |
94 | # bash prints the name of the directory on 'cd <dir>' if CDPATH is |
95 | # set, so unset it here to not cause problems. Notice that the export | |
96 | # line doesn't affect the environment of $(shell ..) calls, so | |
97 | # explictly throw away any output from 'cd' here. | |
98 | export CDPATH:= | |
99 | BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd) | |
100 | $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist)) | |
101 | ||
a4239f7f TP |
102 | |
103 | # Handling of BR2_EXTERNAL. | |
104 | # | |
105 | # The value of BR2_EXTERNAL is stored in .br-external in the output directory. | |
106 | # On subsequent invocations of make, it is read in. It can still be overridden | |
107 | # on the command line, therefore the file is re-created every time make is run. | |
108 | # | |
109 | # When BR2_EXTERNAL is not set, the .br-external file is removed and we point | |
110 | # to support/dummy-external. This makes sure we can unconditionally include the | |
111 | # Config.in and external.mk from the BR2_EXTERNAL directory. In this case, | |
112 | # override is necessary so the user can clear BR2_EXTERNAL from the command | |
113 | # line, but the dummy path is still used internally. | |
114 | ||
115 | BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external | |
116 | -include $(BR2_EXTERNAL_FILE) | |
117 | ifeq ($(BR2_EXTERNAL),) | |
118 | override BR2_EXTERNAL = support/dummy-external | |
119 | $(shell rm -f $(BR2_EXTERNAL_FILE)) | |
120 | else | |
121 | $(shell echo BR2_EXTERNAL ?= $(BR2_EXTERNAL) > $(BR2_EXTERNAL_FILE)) | |
122 | endif | |
123 | ||
124 | ||
bb335175 TDS |
125 | BUILD_DIR:=$(BASE_DIR)/build |
126 | STAMP_DIR:=$(BASE_DIR)/stamps | |
127 | BINARIES_DIR:=$(BASE_DIR)/images | |
128 | TARGET_DIR:=$(BASE_DIR)/target | |
129 | # initial definition so that 'make clean' works for most users, even without | |
130 | # .config. HOST_DIR will be overwritten later when .config is included. | |
131 | HOST_DIR:=$(BASE_DIR)/host | |
132 | ||
133 | LEGAL_INFO_DIR=$(BASE_DIR)/legal-info | |
858334c2 TDS |
134 | REDIST_SOURCES_DIR_TARGET=$(LEGAL_INFO_DIR)/sources |
135 | REDIST_SOURCES_DIR_HOST=$(LEGAL_INFO_DIR)/host-sources | |
366f17f7 TDS |
136 | LICENSE_FILES_DIR_TARGET=$(LEGAL_INFO_DIR)/licenses |
137 | LICENSE_FILES_DIR_HOST=$(LEGAL_INFO_DIR)/host-licenses | |
cc4f34dd TDS |
138 | LEGAL_MANIFEST_CSV_TARGET=$(LEGAL_INFO_DIR)/manifest.csv |
139 | LEGAL_MANIFEST_CSV_HOST=$(LEGAL_INFO_DIR)/host-manifest.csv | |
366f17f7 TDS |
140 | LEGAL_LICENSES_TXT_TARGET=$(LEGAL_INFO_DIR)/licenses.txt |
141 | LEGAL_LICENSES_TXT_HOST=$(LEGAL_INFO_DIR)/host-licenses.txt | |
bb335175 TDS |
142 | LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings |
143 | LEGAL_REPORT=$(LEGAL_INFO_DIR)/README | |
144 | ||
2b0f4552 YM |
145 | BUILDROOT_CONFIG=$(CONFIG_DIR)/.config |
146 | ||
a1b0651a US |
147 | # Pull in the user's configuration file |
148 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) | |
dcb79995 | 149 | -include $(BUILDROOT_CONFIG) |
7521f373 | 150 | endif |
9741a49e | 151 | |
afc61c6e BRF |
152 | # To put more focus on warnings, be less verbose as default |
153 | # Use 'make V=1' to see the full commands | |
154 | ifdef V | |
155 | ifeq ("$(origin V)", "command line") | |
18d979c7 | 156 | KBUILD_VERBOSE=$(V) |
afc61c6e BRF |
157 | endif |
158 | endif | |
159 | ifndef KBUILD_VERBOSE | |
18d979c7 | 160 | KBUILD_VERBOSE=0 |
afc61c6e BRF |
161 | endif |
162 | ||
163 | ifeq ($(KBUILD_VERBOSE),1) | |
4df454e9 | 164 | quiet= |
18d979c7 | 165 | Q= |
1669b6ed BRF |
166 | ifndef VERBOSE |
167 | VERBOSE=1 | |
168 | endif | |
afc61c6e BRF |
169 | else |
170 | quiet=quiet_ | |
18d979c7 | 171 | Q=@ |
afc61c6e BRF |
172 | endif |
173 | ||
69f85924 PK |
174 | # we want bash as shell |
175 | SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \ | |
afc61c6e | 176 | else if [ -x /bin/bash ]; then echo /bin/bash; \ |
18d979c7 | 177 | else echo sh; fi; fi) |
afc61c6e | 178 | |
69f85924 PK |
179 | # kconfig uses CONFIG_SHELL |
180 | CONFIG_SHELL:=$(SHELL) | |
181 | ||
182 | export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE | |
afc61c6e BRF |
183 | |
184 | ifndef HOSTAR | |
185 | HOSTAR:=ar | |
186 | endif | |
187 | ifndef HOSTAS | |
188 | HOSTAS:=as | |
189 | endif | |
190 | ifndef HOSTCC | |
191 | HOSTCC:=gcc | |
17b66aff | 192 | HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc) |
afc61c6e | 193 | endif |
0df02e12 | 194 | HOSTCC_NOCCACHE:=$(HOSTCC) |
afc61c6e BRF |
195 | ifndef HOSTCXX |
196 | HOSTCXX:=g++ | |
17b66aff | 197 | HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++) |
afc61c6e | 198 | endif |
0df02e12 | 199 | HOSTCXX_NOCCACHE:=$(HOSTCXX) |
5f97580e BRF |
200 | ifndef HOSTFC |
201 | HOSTFC:=gfortran | |
202 | endif | |
356133b4 US |
203 | ifndef HOSTCPP |
204 | HOSTCPP:=cpp | |
205 | endif | |
afc61c6e BRF |
206 | ifndef HOSTLD |
207 | HOSTLD:=ld | |
208 | endif | |
0f9c5b11 US |
209 | ifndef HOSTLN |
210 | HOSTLN:=ln | |
211 | endif | |
356133b4 US |
212 | ifndef HOSTNM |
213 | HOSTNM:=nm | |
214 | endif | |
f1f4451a TP |
215 | ifndef HOSTOBJCOPY |
216 | HOSTOBJCOPY:=objcopy | |
217 | endif | |
218 | ifndef HOSTRANLIB | |
219 | HOSTRANLIB:=ranlib | |
220 | endif | |
69f85924 PK |
221 | HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar) |
222 | HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as) | |
69f85924 PK |
223 | HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran) |
224 | HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp) | |
225 | HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld) | |
226 | HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln) | |
227 | HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm) | |
f1f4451a TP |
228 | HOSTOBJCOPY:=$(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy) |
229 | HOSTRANLIB:=$(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib) | |
54e93328 | 230 | |
5f97580e | 231 | export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD |
17b66aff | 232 | export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE |
afc61c6e | 233 | |
670cb306 AV |
234 | # Make sure pkg-config doesn't look outside the buildroot tree |
235 | unexport PKG_CONFIG_PATH | |
4f607edf | 236 | unexport PKG_CONFIG_SYSROOT_DIR |
bdf472d5 | 237 | unexport PKG_CONFIG_LIBDIR |
670cb306 | 238 | |
91123a6f TP |
239 | # Having DESTDIR set in the environment confuses the installation |
240 | # steps of some packages. | |
241 | unexport DESTDIR | |
242 | ||
bed61a7b GZ |
243 | # Causes breakage with packages that needs host-ruby |
244 | unexport RUBYOPT | |
245 | ||
cfe511b2 | 246 | ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
54e098e4 | 247 | |
95442bb3 | 248 | ################################################################################ |
2c649045 PK |
249 | # |
250 | # Hide troublesome environment variables from sub processes | |
251 | # | |
95442bb3 | 252 | ################################################################################ |
2c649045 PK |
253 | unexport CROSS_COMPILE |
254 | unexport ARCH | |
2bf3c166 DN |
255 | unexport CC |
256 | unexport CXX | |
257 | unexport CPP | |
258 | unexport CFLAGS | |
259 | unexport CXXFLAGS | |
260 | unexport GREP_OPTIONS | |
12c9f7dd | 261 | unexport CONFIG_SITE |
32314b44 | 262 | unexport QMAKESPEC |
20ca008d | 263 | unexport TERMINFO |
27bc59d4 | 264 | |
102a93bd | 265 | GNU_HOST_NAME:=$(shell support/gnuconfig/config.guess) |
60281cbf | 266 | |
95442bb3 | 267 | ################################################################################ |
7dcbbfbb BRF |
268 | # |
269 | # The list of stuff to build for the target toolchain | |
270 | # along with the packages to build for the target. | |
271 | # | |
95442bb3 | 272 | ################################################################################ |
17b66aff | 273 | |
8b0905bf | 274 | BASE_TARGETS = toolchain |
e57e4b96 | 275 | |
acc706b7 BRF |
276 | TARGETS:= |
277 | ||
89464a96 PK |
278 | # silent mode requested? |
279 | QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q) | |
280 | ||
397fe5cc TP |
281 | # Strip off the annoying quoting |
282 | ARCH:=$(call qstrip,$(BR2_ARCH)) | |
65e80a0b | 283 | |
891973f5 PK |
284 | KERNEL_ARCH:=$(shell echo "$(ARCH)" | sed -e "s/-.*//" \ |
285 | -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | |
f59aeca6 | 286 | -e s/arcle/arc/ \ |
8332ffab | 287 | -e s/arceb/arc/ \ |
891973f5 | 288 | -e s/arm.*/arm/ -e s/sa110/arm/ \ |
b90a1030 | 289 | -e s/aarch64/arm64/ \ |
871db074 | 290 | -e s/bfin/blackfin/ \ |
891973f5 PK |
291 | -e s/parisc64/parisc/ \ |
292 | -e s/powerpc64/powerpc/ \ | |
293 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ | |
294 | -e s/sh.*/sh/) | |
295 | ||
397fe5cc TP |
296 | ZCAT:=$(call qstrip,$(BR2_ZCAT)) |
297 | BZCAT:=$(call qstrip,$(BR2_BZCAT)) | |
177b4b4a | 298 | XZCAT:=$(call qstrip,$(BR2_XZCAT)) |
397fe5cc TP |
299 | TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf |
300 | ||
a2b4f7fb GZ |
301 | # packages compiled for the host go here |
302 | HOST_DIR:=$(call qstrip,$(BR2_HOST_DIR)) | |
397fe5cc | 303 | |
aebf199f TP |
304 | # locales to generate |
305 | GENERATE_LOCALE=$(call qstrip,$(BR2_GENERATE_LOCALE)) | |
306 | ||
6c3e3ad4 | 307 | TARGET_SKELETON=$(TOPDIR)/system/skeleton |
397fe5cc | 308 | |
9226a990 TP |
309 | # Location of a file giving a big fat warning that output/target |
310 | # should not be used as the root filesystem. | |
311 | TARGET_DIR_WARNING_FILE=$(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM | |
312 | ||
17b66aff TP |
313 | ifeq ($(BR2_CCACHE),y) |
314 | CCACHE:=$(HOST_DIR)/usr/bin/ccache | |
43329076 TDS |
315 | BUILDROOT_CACHE_DIR = $(call qstrip,$(BR2_CCACHE_DIR)) |
316 | export BUILDROOT_CACHE_DIR | |
17b66aff TP |
317 | HOSTCC := $(CCACHE) $(HOSTCC) |
318 | HOSTCXX := $(CCACHE) $(HOSTCXX) | |
319 | endif | |
320 | ||
2b0f4552 YM |
321 | # Scripts in support/ or post-build scripts may need to reference |
322 | # these locations, so export them so it is easier to use | |
323 | export BUILDROOT_CONFIG | |
324 | export TARGET_DIR | |
325 | export STAGING_DIR | |
326 | export HOST_DIR | |
327 | export BINARIES_DIR | |
1300cb55 | 328 | export BASE_DIR |
2b0f4552 | 329 | |
95442bb3 | 330 | ################################################################################ |
7dcbbfbb BRF |
331 | # |
332 | # You should probably leave this stuff alone unless you know | |
333 | # what you are doing. | |
334 | # | |
95442bb3 | 335 | ################################################################################ |
7dcbbfbb | 336 | |
6547bced | 337 | all: world |
ffde94bd | 338 | |
ebcfa987 AVEM |
339 | # Include legacy before the other things, because package .mk files |
340 | # may rely on it. | |
341 | ifneq ($(BR2_DEPRECATED),y) | |
342 | include Makefile.legacy | |
343 | endif | |
344 | ||
486253db | 345 | include package/Makefile.in |
a792668b TDS |
346 | include support/dependencies/dependencies.mk |
347 | ||
d06645d8 EA |
348 | # We also need the various per-package makefiles, which also add |
349 | # each selected package to TARGETS if that package was selected | |
350 | # in the .config file. | |
8b0905bf TP |
351 | include toolchain/helpers.mk |
352 | include toolchain/*/*.mk | |
acc706b7 | 353 | |
ee0246e1 TP |
354 | # Include the package override file if one has been provided in the |
355 | # configuration. | |
356 | PACKAGE_OVERRIDE_FILE=$(call qstrip,$(BR2_PACKAGE_OVERRIDE_FILE)) | |
357 | ifneq ($(PACKAGE_OVERRIDE_FILE),) | |
358 | -include $(PACKAGE_OVERRIDE_FILE) | |
359 | endif | |
360 | ||
741cbccb | 361 | include $(sort $(wildcard package/*/*.mk)) |
d06645d8 | 362 | |
64d8e9a0 | 363 | include boot/common.mk |
64d8e9a0 | 364 | include linux/linux.mk |
ec100c7e | 365 | include system/system.mk |
64d8e9a0 | 366 | |
8eb8aaf9 TP |
367 | include $(BR2_EXTERNAL)/external.mk |
368 | ||
32faf351 | 369 | TARGETS+=target-finalize |
d45de0ca | 370 | |
b87b4742 PK |
371 | ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) |
372 | TARGETS+=target-purgelocales | |
373 | endif | |
374 | ||
381616e7 | 375 | ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) |
aebf199f TP |
376 | ifneq ($(GENERATE_LOCALE),) |
377 | TARGETS+=target-generatelocales | |
378 | endif | |
379 | endif | |
380 | ||
217ef08a TP |
381 | ifeq ($(BR2_ECLIPSE_REGISTER),y) |
382 | TARGETS+=toolchain-eclipse-register | |
383 | endif | |
384 | ||
649b5b92 | 385 | include fs/common.mk |
79f5f1e8 | 386 | |
9fa32ba0 TP |
387 | TARGETS+=target-post-image |
388 | ||
3b08e64d | 389 | TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS)) |
08782ae7 | 390 | TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) |
b3efde23 | 391 | TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS)) |
22c2c6b5 PK |
392 | |
393 | # host-* dependencies have to be handled specially, as those aren't | |
394 | # visible in Kconfig and hence not added to a variable like TARGETS. | |
395 | # instead, find all the host-* targets listed in each <PKG>_DEPENDENCIES | |
396 | # variable for each enabled target. | |
397 | # Notice: this only works for newstyle gentargets/autotargets packages | |
398 | TARGETS_HOST_DEPS = $(sort $(filter host-%,$(foreach dep,\ | |
399 | $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS))),\ | |
400 | $($(dep))))) | |
401 | # Host packages can in turn have their own dependencies. Likewise find | |
402 | # all the package names listed in the HOST_<PKG>_DEPENDENCIES for each | |
403 | # host package found above. Ideally this should be done recursively until | |
404 | # no more packages are found, but that's hard to do in make, so limit to | |
405 | # 1 level for now. | |
406 | HOST_DEPS = $(sort $(foreach dep,\ | |
407 | $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS_HOST_DEPS))),\ | |
408 | $($(dep)))) | |
409 | HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS))) | |
410 | ||
7e76f904 LC |
411 | TARGETS_LEGAL_INFO:=$(patsubst %,%-legal-info,\ |
412 | $(TARGETS) $(BASE_TARGETS) $(TARGETS_HOST_DEPS) $(HOST_DEPS)))) | |
413 | ||
acc706b7 | 414 | # all targets depend on the crosscompiler and it's prerequisites |
b3efde23 | 415 | $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) % |
acc706b7 | 416 | |
d21a176b | 417 | dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ |
d0880f70 | 418 | $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) |
f958d897 | 419 | |
dcb79995 | 420 | $(BUILD_DIR)/buildroot-config/auto.conf: $(BUILDROOT_CONFIG) |
c729829c | 421 | $(MAKE) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig |
0b368800 TP |
422 | |
423 | prepare: $(BUILD_DIR)/buildroot-config/auto.conf | |
424 | ||
8b0905bf | 425 | world: $(BASE_TARGETS) $(TARGETS_ALL) |
2a786415 FP |
426 | |
427 | .PHONY: all world toolchain dirs clean distclean source outputmakefile \ | |
98b616d7 | 428 | legal-info legal-info-prepare legal-info-clean printvars \ |
b3efde23 | 429 | $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \ |
47e82829 | 430 | $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \ |
d21a176b | 431 | $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ |
d0880f70 | 432 | $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) |
ffde94bd | 433 | |
95442bb3 | 434 | ################################################################################ |
08782ae7 | 435 | # |
ef407d3d | 436 | # staging and target directories do NOT list these as |
d99c31c6 | 437 | # dependencies anywhere else |
08782ae7 | 438 | # |
95442bb3 | 439 | ################################################################################ |
858334c2 | 440 | $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST): |
8d583fc0 | 441 | @mkdir -p $@ |
3ad3d8a1 | 442 | |
5628776c SM |
443 | # We make a symlink lib32->lib or lib64->lib as appropriate |
444 | # MIPS64/n32 requires lib32 even though it's a 64-bit arch. | |
445 | ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y) | |
446 | LIB_SYMLINK = lib64 | |
447 | else | |
448 | LIB_SYMLINK = lib32 | |
449 | endif | |
450 | ||
08782ae7 | 451 | $(STAGING_DIR): |
9c865d75 | 452 | @mkdir -p $(STAGING_DIR)/bin |
bf38723f | 453 | @mkdir -p $(STAGING_DIR)/lib |
5628776c | 454 | @ln -snf lib $(STAGING_DIR)/$(LIB_SYMLINK) |
8027784c | 455 | @mkdir -p $(STAGING_DIR)/usr/lib |
5628776c | 456 | @ln -snf lib $(STAGING_DIR)/usr/$(LIB_SYMLINK) |
8027784c | 457 | @mkdir -p $(STAGING_DIR)/usr/include |
a05c337d | 458 | @mkdir -p $(STAGING_DIR)/usr/bin |
5ad139eb | 459 | @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging |
ffde94bd | 460 | |
2b3a43f4 DM |
461 | ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y) |
462 | TARGET_SKELETON=$(BR2_ROOTFS_SKELETON_CUSTOM_PATH) | |
463 | endif | |
464 | ||
7ad28656 TDS |
465 | RSYNC_VCS_EXCLUSIONS = \ |
466 | --exclude .svn --exclude .git --exclude .hg --exclude .bzr \ | |
467 | --exclude CVS | |
468 | ||
397fe5cc | 469 | $(BUILD_DIR)/.root: |
7547c7eb | 470 | mkdir -p $(TARGET_DIR) |
7ad28656 TDS |
471 | rsync -a $(RSYNC_VCS_EXCLUSIONS) \ |
472 | --exclude .empty --exclude '*~' \ | |
13c07c79 | 473 | $(TARGET_SKELETON)/ $(TARGET_DIR)/ |
9226a990 | 474 | cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE) |
6f1882de | 475 | @ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK) |
5628776c | 476 | @mkdir -p $(TARGET_DIR)/usr |
6f1882de | 477 | @ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK) |
7547c7eb | 478 | touch $@ |
08782ae7 | 479 | |
397fe5cc | 480 | $(TARGET_DIR): $(BUILD_DIR)/.root |
c6771dfb | 481 | |
2a97045d TDS |
482 | STRIP_FIND_CMD = find $(TARGET_DIR) |
483 | ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) | |
484 | STRIP_FIND_CMD += \( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o | |
485 | endif | |
88418bd2 | 486 | STRIP_FIND_CMD += -type f -perm /111 |
6ae7886f | 487 | STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print |
2a97045d | 488 | |
32faf351 | 489 | target-finalize: |
94d3aa17 | 490 | rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \ |
df99efb3 LC |
491 | $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \ |
492 | $(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake | |
493 | find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f | |
027aa1d2 WB |
494 | find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f |
495 | find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f | |
e48a72e5 MS |
496 | ifneq ($(BR2_PACKAGE_GDB),y) |
497 | rm -rf $(TARGET_DIR)/usr/share/gdb | |
498 | endif | |
87b0637b | 499 | ifneq ($(BR2_HAVE_DOCUMENTATION),y) |
32faf351 | 500 | rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man |
32faf351 | 501 | rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info |
87b0637b | 502 | rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc |
d701a823 | 503 | rm -rf $(TARGET_DIR)/usr/share/gtk-doc |
68ad6d4e | 504 | -rmdir $(TARGET_DIR)/usr/share 2>/dev/null |
b0c86bcc TP |
505 | endif |
506 | ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y) | |
507 | find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -print0 | xargs -0 rm -f | |
508 | endif | |
509 | ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y) | |
510 | find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f | |
32faf351 | 511 | endif |
2a97045d | 512 | $(STRIP_FIND_CMD) | xargs $(STRIPCMD) 2>/dev/null || true |
f627ebeb | 513 | if test -d $(TARGET_DIR)/lib/modules; then \ |
fde26057 | 514 | find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \ |
f627ebeb | 515 | xargs -r $(KSTRIPCMD); fi |
8101c9a3 | 516 | |
6ae7886f RB |
517 | # See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads |
518 | # besides the one in which crash occurred; or SIGTRAP kills my program when | |
519 | # I set a breakpoint" | |
520 | ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) | |
521 | find $(TARGET_DIR)/lib -type f -name 'libpthread*.so*' | \ | |
52e7073a | 522 | xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG) |
6ae7886f RB |
523 | endif |
524 | ||
4ccde7fa TP |
525 | mkdir -p $(TARGET_DIR)/etc |
526 | # Mandatory configuration file and auxilliary cache directory | |
527 | # for recent versions of ldconfig | |
528 | touch $(TARGET_DIR)/etc/ld.so.conf | |
529 | mkdir -p $(TARGET_DIR)/var/cache/ldconfig | |
e49e2fed PK |
530 | if [ -x "$(TARGET_CROSS)ldconfig" ]; \ |
531 | then \ | |
4ccde7fa | 532 | $(TARGET_CROSS)ldconfig -r $(TARGET_DIR); \ |
e49e2fed | 533 | else \ |
4ccde7fa | 534 | /sbin/ldconfig -r $(TARGET_DIR); \ |
e49e2fed | 535 | fi |
451a8878 PK |
536 | ( \ |
537 | echo "NAME=Buildroot"; \ | |
538 | echo "VERSION=$(BR2_VERSION_FULL)"; \ | |
539 | echo "ID=buildroot"; \ | |
540 | echo "VERSION_ID=$(BR2_VERSION)"; \ | |
541 | echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \ | |
542 | ) > $(TARGET_DIR)/etc/os-release | |
912ea81a | 543 | |
e9b77128 LC |
544 | @$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \ |
545 | $(call MESSAGE,"Copying overlay $(d)"); \ | |
7ad28656 TDS |
546 | rsync -a $(RSYNC_VCS_EXCLUSIONS) \ |
547 | --exclude .empty --exclude '*~' \ | |
e9b77128 | 548 | $(d)/ $(TARGET_DIR)$(sep)) |
7f860892 | 549 | |
dbf4978e | 550 | @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \ |
1b9b1685 | 551 | $(call MESSAGE,"Executing post-build script $(s)"); \ |
cfd497d4 | 552 | $(USER_HOOKS_EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) |
eed7d873 | 553 | |
b87b4742 | 554 | ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) |
397fe5cc | 555 | LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge |
6cdf2481 | 556 | LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST)) |
b87b4742 PK |
557 | |
558 | target-purgelocales: | |
559 | rm -f $(LOCALE_WHITELIST) | |
560 | for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done | |
561 | ||
562 | for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \ | |
563 | do \ | |
564 | for lang in $$(cd $$dir; ls .|grep -v man); \ | |
565 | do \ | |
566 | grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \ | |
567 | done; \ | |
568 | done | |
569 | endif | |
570 | ||
aebf199f TP |
571 | ifneq ($(GENERATE_LOCALE),) |
572 | # Generate locale data. Basically, we call the localedef program | |
573 | # (built by the host-localedef package) for each locale. The input | |
574 | # data comes preferably from the toolchain, or if the toolchain does | |
575 | # not have them (Linaro toolchains), we use the ones available on the | |
576 | # host machine. | |
577 | target-generatelocales: host-localedef | |
578 | $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/ | |
579 | $(Q)for locale in $(GENERATE_LOCALE) ; do \ | |
ea27d6e9 | 580 | inputfile=`echo $${locale} | cut -f1 -d'.'` ; \ |
8e2696ea | 581 | charmap=`echo $${locale} | cut -f2 -d'.' -s` ; \ |
aebf199f TP |
582 | if test -z "$${charmap}" ; then \ |
583 | charmap="UTF-8" ; \ | |
584 | fi ; \ | |
585 | echo "Generating locale $${inputfile}.$${charmap}" ; \ | |
586 | I18NPATH=$(STAGING_DIR)/usr/share/i18n:/usr/share/i18n \ | |
587 | $(HOST_DIR)/usr/bin/localedef \ | |
588 | --prefix=$(TARGET_DIR) \ | |
6fb546ca | 589 | --$(call LOWERCASE,$(BR2_ENDIAN))-endian \ |
aebf199f TP |
590 | -i $${inputfile} -f $${charmap} \ |
591 | $${locale} ; \ | |
592 | done | |
593 | endif | |
594 | ||
9fa32ba0 | 595 | target-post-image: |
9fa32ba0 | 596 | @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \ |
6d90a69f | 597 | $(call MESSAGE,"Executing post-image script $(s)"); \ |
cfd497d4 | 598 | $(USER_HOOKS_EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) |
9fa32ba0 | 599 | |
217ef08a TP |
600 | toolchain-eclipse-register: |
601 | ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH) | |
602 | ||
4eb982cf | 603 | source: dirs $(TARGETS_SOURCE) $(HOST_SOURCE) |
08782ae7 | 604 | |
155971e0 | 605 | external-deps: |
22c2c6b5 | 606 | @$(MAKE) -Bs DL_MODE=SHOW_EXTERNAL_DEPS $(EXTRAMAKEARGS) source | sort -u |
155971e0 | 607 | |
7e76f904 LC |
608 | legal-info-clean: |
609 | @rm -fr $(LEGAL_INFO_DIR) | |
610 | ||
611 | legal-info-prepare: $(LEGAL_INFO_DIR) | |
612 | @$(call MESSAGE,"Collecting legal info") | |
366f17f7 | 613 | @$(call legal-license-file,buildroot,COPYING,COPYING,HOST) |
cc4f34dd TDS |
614 | @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,TARGET) |
615 | @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,HOST) | |
616 | @$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,HOST) | |
7e76f904 LC |
617 | @$(call legal-warning,the Buildroot source code has not been saved) |
618 | @$(call legal-warning,the toolchain has not been saved) | |
dcb79995 | 619 | @cp $(BUILDROOT_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config |
7e76f904 | 620 | |
858334c2 TDS |
621 | legal-info: dirs legal-info-clean legal-info-prepare $(TARGETS_LEGAL_INFO) \ |
622 | $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST) | |
7e76f904 LC |
623 | @cat support/legal-info/README.header >>$(LEGAL_REPORT) |
624 | @if [ -r $(LEGAL_WARNINGS) ]; then \ | |
625 | cat support/legal-info/README.warnings-header \ | |
626 | $(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \ | |
627 | cat $(LEGAL_WARNINGS); fi | |
628 | @echo "Legal info produced in $(LEGAL_INFO_DIR)" | |
629 | @rm -f $(LEGAL_WARNINGS) | |
630 | ||
b7d6c8ad TP |
631 | show-targets: |
632 | @echo $(TARGETS) | |
633 | ||
cfe511b2 | 634 | else # ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
2d523c23 EA |
635 | |
636 | all: menuconfig | |
637 | ||
1ed49963 AVEM |
638 | endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
639 | ||
2d523c23 EA |
640 | # configuration |
641 | # --------------------------------------------------------------------------- | |
642 | ||
c0d7d4e0 BRF |
643 | HOSTCFLAGS=$(CFLAGS_FOR_BUILD) |
644 | export HOSTCFLAGS | |
645 | ||
2cc210c9 PK |
646 | $(BUILD_DIR)/buildroot-config/%onf: |
647 | mkdir -p $(@D)/lxdialog | |
17b66aff | 648 | $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) |
2d523c23 | 649 | |
1ed49963 AVEM |
650 | DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG)) |
651 | ||
652 | # We don't want to fully expand BR2_DEFCONFIG here, so Kconfig will | |
653 | # recognize that if it's still at its default $(CONFIG_DIR)/defconfig | |
1039eb74 | 654 | COMMON_CONFIG_ENV = \ |
1ed49963 | 655 | BR2_DEFCONFIG='$(call qstrip,$(value BR2_DEFCONFIG))' \ |
1039eb74 TP |
656 | KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \ |
657 | KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \ | |
0b368800 | 658 | KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \ |
a4239f7f TP |
659 | BUILDROOT_CONFIG=$(BUILDROOT_CONFIG) \ |
660 | BR2_EXTERNAL=$(BR2_EXTERNAL) | |
2d523c23 | 661 | |
aefad531 | 662 | xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile |
39ca6d50 | 663 | @mkdir -p $(BUILD_DIR)/buildroot-config |
610255e7 | 664 | @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) |
b0df9df3 | 665 | |
aefad531 | 666 | gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile |
39ca6d50 | 667 | @mkdir -p $(BUILD_DIR)/buildroot-config |
610255e7 | 668 | @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN) |
2b42aae7 | 669 | |
aefad531 | 670 | menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile |
39ca6d50 | 671 | @mkdir -p $(BUILD_DIR)/buildroot-config |
610255e7 | 672 | @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) |
2d523c23 | 673 | |
aefad531 | 674 | nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile |
8b6585a9 | 675 | @mkdir -p $(BUILD_DIR)/buildroot-config |
610255e7 | 676 | @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) |
2d523c23 | 677 | |
aefad531 | 678 | config: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 679 | @mkdir -p $(BUILD_DIR)/buildroot-config |
1039eb74 | 680 | @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) |
2d523c23 | 681 | |
aefad531 | 682 | oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 683 | mkdir -p $(BUILD_DIR)/buildroot-config |
1039eb74 | 684 | @$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN) |
2d523c23 | 685 | |
aefad531 | 686 | randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 687 | @mkdir -p $(BUILD_DIR)/buildroot-config |
1039eb74 | 688 | @$(COMMON_CONFIG_ENV) $< --randconfig $(CONFIG_CONFIG_IN) |
2d523c23 | 689 | |
aefad531 | 690 | allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 691 | @mkdir -p $(BUILD_DIR)/buildroot-config |
1039eb74 | 692 | @$(COMMON_CONFIG_ENV) $< --allyesconfig $(CONFIG_CONFIG_IN) |
2d523c23 | 693 | |
aefad531 | 694 | allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 695 | @mkdir -p $(BUILD_DIR)/buildroot-config |
1039eb74 | 696 | @$(COMMON_CONFIG_ENV) $< --allnoconfig $(CONFIG_CONFIG_IN) |
2d523c23 | 697 | |
aefad531 | 698 | randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 699 | @mkdir -p $(BUILD_DIR)/buildroot-config |
dcb79995 | 700 | @grep -v BR2_PACKAGE_ $(BUILDROOT_CONFIG) > $(CONFIG_DIR)/.config.nopkg |
8a46d4bf PK |
701 | @grep '^config BR2_PACKAGE_' Config.in.legacy | \ |
702 | while read config pkg; do \ | |
703 | echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done | |
1039eb74 | 704 | @$(COMMON_CONFIG_ENV) \ |
39ca6d50 | 705 | KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ |
1039eb74 | 706 | $< --randconfig $(CONFIG_CONFIG_IN) |
39ca6d50 | 707 | @rm -f $(CONFIG_DIR)/.config.nopkg |
6652770f | 708 | |
aefad531 | 709 | allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 710 | @mkdir -p $(BUILD_DIR)/buildroot-config |
dcb79995 | 711 | @grep -v BR2_PACKAGE_ $(BUILDROOT_CONFIG) > $(CONFIG_DIR)/.config.nopkg |
8a46d4bf PK |
712 | @grep '^config BR2_PACKAGE_' Config.in.legacy | \ |
713 | while read config pkg; do \ | |
714 | echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done | |
1039eb74 | 715 | @$(COMMON_CONFIG_ENV) \ |
39ca6d50 | 716 | KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ |
1039eb74 | 717 | $< --allyesconfig $(CONFIG_CONFIG_IN) |
39ca6d50 | 718 | @rm -f $(CONFIG_DIR)/.config.nopkg |
6652770f | 719 | |
aefad531 | 720 | allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 721 | @mkdir -p $(BUILD_DIR)/buildroot-config |
dcb79995 | 722 | @grep -v BR2_PACKAGE_ $(BUILDROOT_CONFIG) > $(CONFIG_DIR)/.config.nopkg |
1039eb74 | 723 | @$(COMMON_CONFIG_ENV) \ |
39ca6d50 | 724 | KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ |
1039eb74 | 725 | $< --allnoconfig $(CONFIG_CONFIG_IN) |
39ca6d50 | 726 | @rm -f $(CONFIG_DIR)/.config.nopkg |
6652770f | 727 | |
aefad531 | 728 | silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
0b368800 TP |
729 | @mkdir -p $(BUILD_DIR)/buildroot-config |
730 | $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN) | |
731 | ||
9db3b47e TP |
732 | olddefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
733 | @mkdir -p $(BUILD_DIR)/buildroot-config | |
734 | $(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) | |
735 | ||
aefad531 | 736 | defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
39ca6d50 | 737 | @mkdir -p $(BUILD_DIR)/buildroot-config |
1ed49963 | 738 | @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN) |
2d523c23 | 739 | |
aefad531 | 740 | %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile |
6f38119c | 741 | @mkdir -p $(BUILD_DIR)/buildroot-config |
1039eb74 | 742 | @$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN) |
6f38119c | 743 | |
ff9d6e30 TP |
744 | %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(BR2_EXTERNAL)/configs/%_defconfig outputmakefile |
745 | @mkdir -p $(BUILD_DIR)/buildroot-config | |
746 | @$(COMMON_CONFIG_ENV) $< --defconfig=$(BR2_EXTERNAL)/configs/$@ $(CONFIG_CONFIG_IN) | |
747 | ||
aefad531 | 748 | savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
e1b1a18a | 749 | @mkdir -p $(BUILD_DIR)/buildroot-config |
1ed49963 AVEM |
750 | @$(COMMON_CONFIG_ENV) $< \ |
751 | --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \ | |
752 | $(CONFIG_CONFIG_IN) | |
2d523c23 | 753 | |
6547bced | 754 | # check if download URLs are outdated |
07bae756 | 755 | source-check: |
7c297459 | 756 | $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source |
825ff341 | 757 | |
1ed49963 | 758 | .PHONY: defconfig savedefconfig |
406053d5 | 759 | |
95442bb3 | 760 | ################################################################################ |
2d523c23 EA |
761 | # |
762 | # Cleanup and misc junk | |
763 | # | |
95442bb3 | 764 | ################################################################################ |
aefad531 YM |
765 | |
766 | # outputmakefile generates a Makefile in the output directory, if using a | |
767 | # separate output directory. This allows convenient use of make in the | |
768 | # output directory. | |
769 | outputmakefile: | |
770 | ifeq ($(NEED_WRAPPER),y) | |
f082c7c5 | 771 | $(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O) |
aefad531 YM |
772 | endif |
773 | ||
98b616d7 ÉV |
774 | # printvars prints all the variables currently defined in our Makefiles |
775 | printvars: | |
776 | @$(foreach V, \ | |
777 | $(sort $(.VARIABLES)), \ | |
778 | $(if $(filter-out environment% default automatic, \ | |
779 | $(origin $V)), \ | |
780 | $(info $V=$($V) ($(value $V))))) | |
781 | ||
2d523c23 | 782 | clean: |
300eb6b7 | 783 | rm -rf $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \ |
d21a176b | 784 | $(STAMP_DIR) $(BUILD_DIR) $(BASE_DIR)/staging \ |
7e76f904 | 785 | $(LEGAL_INFO_DIR) |
2d523c23 EA |
786 | |
787 | distclean: clean | |
406053d5 PK |
788 | ifeq ($(DL_DIR),$(TOPDIR)/dl) |
789 | rm -rf $(DL_DIR) | |
790 | endif | |
791 | ifeq ($(O),output) | |
792 | rm -rf $(O) | |
793 | endif | |
dcb79995 | 794 | rm -rf $(BUILDROOT_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.auto.deps |
2d523c23 | 795 | |
e491fba2 BRF |
796 | help: |
797 | @echo 'Cleaning:' | |
406053d5 | 798 | @echo ' clean - delete all files created by build' |
e491fba2 BRF |
799 | @echo ' distclean - delete all non-source files (including .config)' |
800 | @echo | |
801 | @echo 'Build:' | |
802 | @echo ' all - make world' | |
2a786415 | 803 | @echo ' toolchain - build toolchain' |
040f6a32 SH |
804 | @echo ' <package>-rebuild - force recompile <package>' |
805 | @echo ' <package>-reconfigure - force reconfigure <package>' | |
e491fba2 BRF |
806 | @echo |
807 | @echo 'Configuration:' | |
808 | @echo ' menuconfig - interactive curses-based configurator' | |
15f5bef0 | 809 | @echo ' nconfig - interactive ncurses-based configurator' |
c48bbb8c | 810 | @echo ' xconfig - interactive Qt-based configurator' |
2b42aae7 | 811 | @echo ' gconfig - interactive GTK-based configurator' |
e491fba2 | 812 | @echo ' oldconfig - resolve any unresolved symbols in .config' |
9db3b47e TP |
813 | @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' |
814 | @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value' | |
c48bbb8c PK |
815 | @echo ' randconfig - New config with random answer to all options' |
816 | @echo ' defconfig - New config with default answer to all options' | |
33f454bb | 817 | @echo ' BR2_DEFCONFIG, if set, is used as input' |
d7051da8 | 818 | @echo ' savedefconfig - Save current config as ./defconfig (minimal config)' |
c48bbb8c PK |
819 | @echo ' allyesconfig - New config where all options are accepted with yes' |
820 | @echo ' allnoconfig - New config where all options are answered with no' | |
6652770f PK |
821 | @echo ' randpackageconfig - New config with random answer to package options' |
822 | @echo ' allyespackageconfig - New config where pkg options are accepted with yes' | |
823 | @echo ' allnopackageconfig - New config where package options are answered with no' | |
4bb33dce PK |
824 | ifeq ($(BR2_PACKAGE_BUSYBOX),y) |
825 | @echo ' busybox-menuconfig - Run BusyBox menuconfig' | |
826 | endif | |
827 | ifeq ($(BR2_LINUX_KERNEL),y) | |
828 | @echo ' linux-menuconfig - Run Linux kernel menuconfig' | |
f5777ce8 | 829 | @echo ' linux-savedefconfig - Run Linux kernel savedefconfig' |
4bb33dce PK |
830 | endif |
831 | ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) | |
832 | @echo ' uclibc-menuconfig - Run uClibc menuconfig' | |
833 | endif | |
83f1bf9e JCPV |
834 | ifeq ($(BR2_TARGET_BAREBOX),y) |
835 | @echo ' barebox-menuconfig - Run barebox menuconfig' | |
836 | @echo ' barebox-savedefconfig - Run barebox savedefconfig' | |
4bb33dce | 837 | endif |
8792cf9e TP |
838 | @echo |
839 | @echo 'Documentation:' | |
55ecab1b | 840 | @echo ' manual - build manual in all formats' |
8792cf9e TP |
841 | @echo ' manual-html - build manual in HTML' |
842 | @echo ' manual-split-html - build manual in split HTML' | |
843 | @echo ' manual-pdf - build manual in PDF' | |
462e9915 | 844 | @echo ' manual-text - build manual in text' |
8792cf9e | 845 | @echo ' manual-epub - build manual in ePub' |
e491fba2 BRF |
846 | @echo |
847 | @echo 'Miscellaneous:' | |
848 | @echo ' source - download all sources needed for offline-build' | |
07bae756 | 849 | @echo ' source-check - check selected packages for valid download URLs' |
155971e0 | 850 | @echo ' external-deps - list external packages used' |
7e76f904 | 851 | @echo ' legal-info - generate info about license compliance' |
e491fba2 | 852 | @echo |
15f5bef0 PK |
853 | @echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build' |
854 | @echo ' make O=dir - Locate all output files in "dir", including .config' | |
855 | @echo | |
ff9d6e30 | 856 | @echo 'Built-in configs:' |
b9796199 | 857 | @$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \ |
58fd779a | 858 | printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);) |
ff9d6e30 TP |
859 | ifneq ($(wildcard $(BR2_EXTERNAL)/configs/*_defconfig),) |
860 | @echo | |
861 | @echo 'User-provided configs:' | |
862 | @$(foreach b, $(sort $(notdir $(wildcard $(BR2_EXTERNAL)/configs/*_defconfig))), \ | |
863 | printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);) | |
864 | endif | |
58fd779a | 865 | @echo |
8792cf9e | 866 | @echo 'See docs/README, or generate the Buildroot manual for further details' |
663dee48 | 867 | @echo |
ba2e7e02 | 868 | |
e5e8fae8 | 869 | release: OUT=buildroot-$(BR2_VERSION) |
0dca7065 | 870 | |
134ab1ce PK |
871 | # Create release tarballs. We need to fiddle a bit to add the generated |
872 | # documentation to the git output | |
0dca7065 | 873 | release: |
c6715b69 | 874 | git archive --format=tar --prefix=$(OUT)/ HEAD > $(OUT).tar |
462e9915 | 875 | $(MAKE) O=$(OUT) manual-html manual-text manual-pdf |
134ab1ce PK |
876 | tar rf $(OUT).tar $(OUT) |
877 | gzip -9 -c < $(OUT).tar > $(OUT).tar.gz | |
878 | bzip2 -9 -c < $(OUT).tar > $(OUT).tar.bz2 | |
879 | rm -rf $(OUT) $(OUT).tar | |
e62d2ecd | 880 | |
2b91ab7a AVEM |
881 | print-version: |
882 | @echo $(BR2_VERSION_FULL) | |
883 | ||
b7285d00 | 884 | include docs/manual/manual.mk |
8792cf9e | 885 | |
6652770f | 886 | .PHONY: $(noconfig_targets) |