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