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