Makefile 18 KB

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