Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 1 | # Makefile for buildroot2 |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 2 | # |
Eric Andersen | 15b26ae | 2005-02-07 22:19:26 +0000 | [diff] [blame] | 3 | # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org> |
Peter Korsgaard | 9fc4359 | 2012-03-01 14:04:54 +0100 | [diff] [blame] | 4 | # Copyright (C) 2006-2012 by the Buildroot developers <buildroot@uclibc.org> |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 5 | # |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 6 | # This program is free software; you can redistribute it and/or modify |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 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. |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 10 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 14 | # General Public License for more details. |
Peter Korsgaard | b30d673 | 2009-01-26 19:42:47 +0000 | [diff] [blame] | 15 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 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 | # |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 20 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 21 | #-------------------------------------------------------------- |
| 22 | # Just run 'make menuconfig', configure stuff, then run 'make'. |
| 23 | # You shouldn't need to mess with anything beyond this point... |
| 24 | #-------------------------------------------------------------- |
Yann E. MORIN | 2d239bb | 2010-10-31 17:35:09 +0100 | [diff] [blame] | 25 | |
Yann E. MORIN | e5e8fae | 2010-10-31 17:35:10 +0100 | [diff] [blame] | 26 | # Set and export the version string |
Peter Korsgaard | f968656 | 2012-09-03 21:27:41 +0200 | [diff] [blame] | 27 | export BR2_VERSION:=2012.11-git |
Yann E. MORIN | e5e8fae | 2010-10-31 17:35:10 +0100 | [diff] [blame] | 28 | |
Thomas De Schampheleire | 0edfb24 | 2012-02-08 17:22:17 +0100 | [diff] [blame] | 29 | # Check for minimal make version (note: this check will break at make 10.x) |
| 30 | MIN_MAKE_VERSION=3.81 |
Peter Korsgaard | 8139e21 | 2012-02-09 22:58:05 +0100 | [diff] [blame] | 31 | ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION)) |
Thomas De Schampheleire | 0edfb24 | 2012-02-08 17:22:17 +0100 | [diff] [blame] | 32 | $(error You have make '$(MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required) |
| 33 | endif |
| 34 | |
Francois Perrad | 1d4104f | 2012-07-18 15:59:09 +0200 | [diff] [blame] | 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 | |
Yann E. MORIN | 2d239bb | 2010-10-31 17:35:09 +0100 | [diff] [blame] | 45 | # This top-level Makefile can *not* be executed in parallel |
| 46 | .NOTPARALLEL: |
| 47 | |
Peter Korsgaard | 6b1dd45 | 2009-11-30 17:29:01 +0100 | [diff] [blame] | 48 | # absolute path |
| 49 | TOPDIR:=$(shell pwd) |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 50 | CONFIG_CONFIG_IN=Config.in |
Thomas Petazzoni | 56da385 | 2011-08-31 23:35:05 +0200 | [diff] [blame] | 51 | CONFIG=support/kconfig |
Ulf Samuelsson | a8ee124 | 2008-05-11 06:55:04 +0000 | [diff] [blame] | 52 | DATE:=$(shell date +%Y%m%d) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 53 | |
Yann E. MORIN | 8258df2 | 2010-10-31 17:35:12 +0100 | [diff] [blame] | 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) |
Thomas Petazzoni | f082c7c | 2011-08-31 23:35:02 +0200 | [diff] [blame] | 56 | export BR2_VERSION_FULL:=$(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion) |
Yann E. MORIN | 8258df2 | 2010-10-31 17:35:12 +0100 | [diff] [blame] | 57 | |
Thomas Petazzoni | 8b6585a | 2010-08-21 17:21:40 +0200 | [diff] [blame] | 58 | noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \ |
Thomas Petazzoni | 0b36880 | 2010-08-22 07:27:09 +0200 | [diff] [blame] | 59 | defconfig %_defconfig savedefconfig allyesconfig allnoconfig silentoldconfig release \ |
Peter Korsgaard | 6652770 | 2009-10-04 21:57:12 +0200 | [diff] [blame] | 60 | randpackageconfig allyespackageconfig allnopackageconfig \ |
Arnout Vandecappelle (Essensium/Mind) | 2b91ab7 | 2012-03-11 12:16:39 +0100 | [diff] [blame] | 61 | source-check print-version |
Bernhard Reutner-Fischer | 9e25035 | 2006-12-02 19:01:10 +0000 | [diff] [blame] | 62 | |
Thomas Petazzoni | 580c6d9 | 2009-07-30 17:26:49 +0200 | [diff] [blame] | 63 | # Strip quotes and then whitespaces |
| 64 | qstrip=$(strip $(subst ",,$(1))) |
| 65 | #")) |
| 66 | |
Peter Korsgaard | f85f2de | 2009-01-25 20:19:01 +0000 | [diff] [blame] | 67 | # Variables for use in Make constructs |
| 68 | comma:=, |
| 69 | empty:= |
| 70 | space:=$(empty) $(empty) |
| 71 | |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 72 | ifneq ("$(origin O)", "command line") |
| 73 | O:=output |
| 74 | CONFIG_DIR:=$(TOPDIR) |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 75 | NEED_WRAPPER= |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 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) |
Peter Korsgaard | de846f6 | 2010-08-29 23:24:07 +0200 | [diff] [blame] | 89 | # we need to pass O= everywhere we call back into the toplevel makefile |
| 90 | EXTRAMAKEARGS = O=$(O) |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 91 | NEED_WRAPPER=y |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 92 | endif |
| 93 | |
Ulf Samuelsson | a1b0651 | 2008-03-28 07:31:28 +0000 | [diff] [blame] | 94 | # Pull in the user's configuration file |
| 95 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 96 | -include $(CONFIG_DIR)/.config |
Ulf Samuelsson | 7521f37 | 2007-09-12 04:34:16 +0000 | [diff] [blame] | 97 | endif |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 98 | |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 99 | # To put more focus on warnings, be less verbose as default |
| 100 | # Use 'make V=1' to see the full commands |
| 101 | ifdef V |
| 102 | ifeq ("$(origin V)", "command line") |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 103 | KBUILD_VERBOSE=$(V) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 104 | endif |
| 105 | endif |
| 106 | ifndef KBUILD_VERBOSE |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 107 | KBUILD_VERBOSE=0 |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 108 | endif |
| 109 | |
| 110 | ifeq ($(KBUILD_VERBOSE),1) |
Ulf Samuelsson | 4df454e | 2007-07-06 12:19:35 +0000 | [diff] [blame] | 111 | quiet= |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 112 | Q= |
Bernhard Reutner-Fischer | 1669b6e | 2007-09-22 14:19:22 +0000 | [diff] [blame] | 113 | ifndef VERBOSE |
| 114 | VERBOSE=1 |
| 115 | endif |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 116 | else |
| 117 | quiet=quiet_ |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 118 | Q=@ |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 119 | endif |
| 120 | |
Peter Korsgaard | 69f8592 | 2009-01-01 21:20:35 +0000 | [diff] [blame] | 121 | # we want bash as shell |
| 122 | SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 123 | else if [ -x /bin/bash ]; then echo /bin/bash; \ |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 124 | else echo sh; fi; fi) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 125 | |
Peter Korsgaard | 69f8592 | 2009-01-01 21:20:35 +0000 | [diff] [blame] | 126 | # kconfig uses CONFIG_SHELL |
| 127 | CONFIG_SHELL:=$(SHELL) |
| 128 | |
| 129 | export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 130 | |
| 131 | ifndef HOSTAR |
| 132 | HOSTAR:=ar |
| 133 | endif |
| 134 | ifndef HOSTAS |
| 135 | HOSTAS:=as |
| 136 | endif |
| 137 | ifndef HOSTCC |
| 138 | HOSTCC:=gcc |
Thomas Petazzoni | 17b66af | 2010-12-07 21:09:56 +0100 | [diff] [blame] | 139 | HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 140 | endif |
Mike Frysinger | 0df02e1 | 2011-03-28 03:18:47 -0400 | [diff] [blame] | 141 | HOSTCC_NOCCACHE:=$(HOSTCC) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 142 | ifndef HOSTCXX |
| 143 | HOSTCXX:=g++ |
Thomas Petazzoni | 17b66af | 2010-12-07 21:09:56 +0100 | [diff] [blame] | 144 | HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 145 | endif |
Mike Frysinger | 0df02e1 | 2011-03-28 03:18:47 -0400 | [diff] [blame] | 146 | HOSTCXX_NOCCACHE:=$(HOSTCXX) |
Bernhard Reutner-Fischer | 5f97580 | 2007-09-28 20:10:22 +0000 | [diff] [blame] | 147 | ifndef HOSTFC |
| 148 | HOSTFC:=gfortran |
| 149 | endif |
Ulf Samuelsson | 356133b | 2007-09-28 19:46:58 +0000 | [diff] [blame] | 150 | ifndef HOSTCPP |
| 151 | HOSTCPP:=cpp |
| 152 | endif |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 153 | ifndef HOSTLD |
| 154 | HOSTLD:=ld |
| 155 | endif |
Ulf Samuelsson | 0f9c5b1 | 2007-07-15 21:54:11 +0000 | [diff] [blame] | 156 | ifndef HOSTLN |
| 157 | HOSTLN:=ln |
| 158 | endif |
Ulf Samuelsson | 356133b | 2007-09-28 19:46:58 +0000 | [diff] [blame] | 159 | ifndef HOSTNM |
| 160 | HOSTNM:=nm |
| 161 | endif |
Peter Korsgaard | 69f8592 | 2009-01-01 21:20:35 +0000 | [diff] [blame] | 162 | HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar) |
| 163 | HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as) |
Peter Korsgaard | 69f8592 | 2009-01-01 21:20:35 +0000 | [diff] [blame] | 164 | HOSTFC:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran) |
| 165 | HOSTCPP:=$(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp) |
| 166 | HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld) |
| 167 | HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln) |
| 168 | HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm) |
Ulf Samuelsson | 54e9332 | 2008-07-06 07:34:41 +0000 | [diff] [blame] | 169 | |
Bernhard Reutner-Fischer | 5f97580 | 2007-09-28 20:10:22 +0000 | [diff] [blame] | 170 | export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD |
Thomas Petazzoni | 17b66af | 2010-12-07 21:09:56 +0100 | [diff] [blame] | 171 | export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 172 | |
Arnout Vandecappelle | 670cb30 | 2012-06-30 10:29:22 +0000 | [diff] [blame] | 173 | # Make sure pkg-config doesn't look outside the buildroot tree |
| 174 | unexport PKG_CONFIG_PATH |
| 175 | |
Thomas Petazzoni | 91123a6 | 2012-07-02 04:21:14 +0000 | [diff] [blame] | 176 | # Having DESTDIR set in the environment confuses the installation |
| 177 | # steps of some packages. |
| 178 | unexport DESTDIR |
| 179 | |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 180 | # bash prints the name of the directory on 'cd <dir>' if CDPATH is |
| 181 | # set, so unset it here to not cause problems. Notice that the export |
| 182 | # line doesn't affect the environment of $(shell ..) calls, so |
| 183 | # explictly throw away any output from 'cd' here. |
| 184 | export CDPATH:= |
| 185 | BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd) |
| 186 | $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist)) |
| 187 | |
| 188 | BUILD_DIR:=$(BASE_DIR)/build |
| 189 | |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 190 | |
Bernhard Reutner-Fischer | cfe511b | 2007-09-29 13:58:30 +0000 | [diff] [blame] | 191 | ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 192 | |
Peter Korsgaard | 2c64904 | 2007-06-19 15:19:27 +0000 | [diff] [blame] | 193 | ############################################################# |
| 194 | # |
| 195 | # Hide troublesome environment variables from sub processes |
| 196 | # |
| 197 | ############################################################# |
| 198 | unexport CROSS_COMPILE |
| 199 | unexport ARCH |
Daniel Nyström | 2bf3c16 | 2010-12-26 00:29:42 +0100 | [diff] [blame] | 200 | unexport CC |
| 201 | unexport CXX |
| 202 | unexport CPP |
| 203 | unexport CFLAGS |
| 204 | unexport CXXFLAGS |
| 205 | unexport GREP_OPTIONS |
Peter Korsgaard | 12c9f7d | 2011-12-12 10:25:50 +0100 | [diff] [blame] | 206 | unexport CONFIG_SITE |
Stephan Hoffmann | 32314b4 | 2012-08-17 13:54:16 +0200 | [diff] [blame] | 207 | unexport QMAKESPEC |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 208 | |
Thomas Petazzoni | 102a93b | 2011-08-31 23:35:06 +0200 | [diff] [blame] | 209 | GNU_HOST_NAME:=$(shell support/gnuconfig/config.guess) |
Thomas Petazzoni | 60281cb | 2010-04-10 23:17:25 +0200 | [diff] [blame] | 210 | |
Bernhard Reutner-Fischer | 6ad0720 | 2007-07-31 15:02:06 +0000 | [diff] [blame] | 211 | ############################################################## |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 212 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 213 | # The list of stuff to build for the target toolchain |
| 214 | # along with the packages to build for the target. |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 215 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 216 | ############################################################## |
Thomas Petazzoni | 17b66af | 2010-12-07 21:09:56 +0100 | [diff] [blame] | 217 | |
| 218 | ifeq ($(BR2_CCACHE),y) |
| 219 | BASE_TARGETS += host-ccache |
| 220 | endif |
| 221 | |
Thomas Petazzoni | bc994c5 | 2009-12-14 12:10:12 +0100 | [diff] [blame] | 222 | ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) |
Gustavo Zacarias | 009407e | 2010-12-31 08:39:01 -0300 | [diff] [blame] | 223 | BASE_TARGETS += uclibc-configured host-binutils cross_compiler uclibc-target-utils kernel-headers |
Yann E. MORIN | 10c1eec | 2010-09-19 21:54:09 +0200 | [diff] [blame] | 224 | else |
Thomas Petazzoni | 17b66af | 2010-12-07 21:09:56 +0100 | [diff] [blame] | 225 | BASE_TARGETS += uclibc |
"Steven J. Hill" | 02f71aa | 2007-02-06 18:19:38 +0000 | [diff] [blame] | 226 | endif |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 227 | TARGETS:= |
| 228 | |
Peter Korsgaard | 89464a9 | 2009-09-30 17:39:44 +0200 | [diff] [blame] | 229 | # silent mode requested? |
| 230 | QUIET:=$(if $(findstring s,$(MAKEFLAGS)),-q) |
| 231 | |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 232 | # Strip off the annoying quoting |
| 233 | ARCH:=$(call qstrip,$(BR2_ARCH)) |
Thomas Petazzoni | 65e80a0 | 2010-04-28 23:40:57 +0200 | [diff] [blame] | 234 | |
Peter Korsgaard | 891973f | 2010-10-17 23:32:37 +0200 | [diff] [blame] | 235 | KERNEL_ARCH:=$(shell echo "$(ARCH)" | sed -e "s/-.*//" \ |
| 236 | -e s/i.86/i386/ -e s/sun4u/sparc64/ \ |
| 237 | -e s/arm.*/arm/ -e s/sa110/arm/ \ |
Thomas Petazzoni | b90a103 | 2012-10-28 17:40:35 +0100 | [diff] [blame] | 238 | -e s/aarch64/arm64/ \ |
Mike Frysinger | 871db07 | 2011-02-07 00:49:11 -0500 | [diff] [blame] | 239 | -e s/bfin/blackfin/ \ |
Peter Korsgaard | 891973f | 2010-10-17 23:32:37 +0200 | [diff] [blame] | 240 | -e s/parisc64/parisc/ \ |
| 241 | -e s/powerpc64/powerpc/ \ |
| 242 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ |
| 243 | -e s/sh.*/sh/) |
| 244 | |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 245 | ZCAT:=$(call qstrip,$(BR2_ZCAT)) |
| 246 | BZCAT:=$(call qstrip,$(BR2_BZCAT)) |
Allan W. Nielsen | 177b4b4 | 2011-05-10 08:17:05 +0200 | [diff] [blame] | 247 | XZCAT:=$(call qstrip,$(BR2_XZCAT)) |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 248 | TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 249 | |
Gustavo Zacarias | a2b4f7f | 2011-02-02 10:05:56 -0300 | [diff] [blame] | 250 | # packages compiled for the host go here |
| 251 | HOST_DIR:=$(call qstrip,$(BR2_HOST_DIR)) |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 252 | |
Thomas Petazzoni | aebf199 | 2012-05-08 04:39:22 +0000 | [diff] [blame] | 253 | # locales to generate |
| 254 | GENERATE_LOCALE=$(call qstrip,$(BR2_GENERATE_LOCALE)) |
| 255 | |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 256 | # stamp (dependency) files go here |
Thomas Petazzoni | 3b2a803 | 2009-07-31 10:31:39 +0200 | [diff] [blame] | 257 | STAMP_DIR:=$(BASE_DIR)/stamps |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 258 | |
Thomas Petazzoni | 3b2a803 | 2009-07-31 10:31:39 +0200 | [diff] [blame] | 259 | BINARIES_DIR:=$(BASE_DIR)/images |
| 260 | TARGET_DIR:=$(BASE_DIR)/target |
Thomas Petazzoni | 4c5bf46 | 2010-04-28 23:40:52 +0200 | [diff] [blame] | 261 | TOOLCHAIN_DIR=$(BASE_DIR)/toolchain |
Thomas Petazzoni | 6c3e3ad | 2012-11-03 08:27:58 +0000 | [diff] [blame] | 262 | TARGET_SKELETON=$(TOPDIR)/system/skeleton |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 263 | |
Luca Ceresoli | 7e76f90 | 2012-05-17 19:33:00 +0200 | [diff] [blame] | 264 | LEGAL_INFO_DIR=$(BASE_DIR)/legal-info |
| 265 | REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources |
| 266 | LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses |
| 267 | LEGAL_MANIFEST_CSV=$(LEGAL_INFO_DIR)/manifest.csv |
| 268 | LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt |
| 269 | LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings |
| 270 | LEGAL_REPORT=$(LEGAL_INFO_DIR)/README |
| 271 | |
Thomas Petazzoni | 9226a99 | 2012-11-17 03:52:14 +0000 | [diff] [blame] | 272 | # Location of a file giving a big fat warning that output/target |
| 273 | # should not be used as the root filesystem. |
| 274 | TARGET_DIR_WARNING_FILE=$(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM |
| 275 | |
Thomas Petazzoni | 17b66af | 2010-12-07 21:09:56 +0100 | [diff] [blame] | 276 | ifeq ($(BR2_CCACHE),y) |
| 277 | CCACHE:=$(HOST_DIR)/usr/bin/ccache |
Thomas De Schampheleire | 4332907 | 2012-05-16 21:39:28 +0200 | [diff] [blame] | 278 | BUILDROOT_CACHE_DIR = $(call qstrip,$(BR2_CCACHE_DIR)) |
| 279 | export BUILDROOT_CACHE_DIR |
Thomas Petazzoni | 17b66af | 2010-12-07 21:09:56 +0100 | [diff] [blame] | 280 | HOSTCC := $(CCACHE) $(HOSTCC) |
| 281 | HOSTCXX := $(CCACHE) $(HOSTCXX) |
| 282 | endif |
| 283 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 284 | ############################################################# |
| 285 | # |
Eric Andersen | ef407d3 | 2004-01-29 23:21:00 +0000 | [diff] [blame] | 286 | # You should probably leave this stuff alone unless you know |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 287 | # what you are doing. |
| 288 | # |
| 289 | ############################################################# |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame] | 290 | |
Bernhard Reutner-Fischer | 6547bce | 2007-08-22 12:35:41 +0000 | [diff] [blame] | 291 | all: world |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 292 | |
Thomas Petazzoni | 486253d | 2012-04-17 16:45:23 +0200 | [diff] [blame] | 293 | include package/Makefile.in |
Thomas De Schampheleire | a792668 | 2012-02-08 17:22:16 +0100 | [diff] [blame] | 294 | include support/dependencies/dependencies.mk |
| 295 | |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 296 | # We also need the various per-package makefiles, which also add |
| 297 | # each selected package to TARGETS if that package was selected |
| 298 | # in the .config file. |
Thomas Petazzoni | bc994c5 | 2009-12-14 12:10:12 +0100 | [diff] [blame] | 299 | ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) |
Yann E. MORIN | ed02009 | 2010-07-28 00:08:15 +0200 | [diff] [blame] | 300 | include toolchain/toolchain-buildroot.mk |
Yann E. MORIN | 26b44b2 | 2010-03-26 20:46:37 +0100 | [diff] [blame] | 301 | else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) |
Yann E. MORIN | ed02009 | 2010-07-28 00:08:15 +0200 | [diff] [blame] | 302 | include toolchain/toolchain-external.mk |
Yann E. MORIN | 10c1eec | 2010-09-19 21:54:09 +0200 | [diff] [blame] | 303 | else ifeq ($(BR2_TOOLCHAIN_CTNG),y) |
| 304 | include toolchain/toolchain-crosstool-ng.mk |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 305 | endif |
| 306 | |
Thomas Petazzoni | ee0246e | 2011-09-29 21:57:38 +0200 | [diff] [blame] | 307 | # Include the package override file if one has been provided in the |
| 308 | # configuration. |
| 309 | PACKAGE_OVERRIDE_FILE=$(call qstrip,$(BR2_PACKAGE_OVERRIDE_FILE)) |
| 310 | ifneq ($(PACKAGE_OVERRIDE_FILE),) |
| 311 | -include $(PACKAGE_OVERRIDE_FILE) |
| 312 | endif |
| 313 | |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 314 | include package/*/*.mk |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 315 | |
Peter Korsgaard | 64d8e9a | 2010-11-07 19:33:11 +0100 | [diff] [blame] | 316 | include boot/common.mk |
Peter Korsgaard | 64d8e9a | 2010-11-07 19:33:11 +0100 | [diff] [blame] | 317 | include linux/linux.mk |
| 318 | |
Peter Korsgaard | 32faf35 | 2009-04-07 21:04:31 +0000 | [diff] [blame] | 319 | TARGETS+=target-finalize |
John Voltz | d45de0c | 2008-03-11 13:12:39 +0000 | [diff] [blame] | 320 | |
Peter Korsgaard | b87b474 | 2009-04-06 09:21:26 +0000 | [diff] [blame] | 321 | ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) |
| 322 | TARGETS+=target-purgelocales |
| 323 | endif |
| 324 | |
Thomas Petazzoni | aebf199 | 2012-05-08 04:39:22 +0000 | [diff] [blame] | 325 | ifneq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_CTNG_eglibc)$(BR2_TOOLCHAIN_CTNG_glibc),) |
| 326 | ifneq ($(GENERATE_LOCALE),) |
| 327 | TARGETS+=target-generatelocales |
| 328 | endif |
| 329 | endif |
| 330 | |
Thomas Petazzoni | 6c3e3ad | 2012-11-03 08:27:58 +0000 | [diff] [blame] | 331 | include system/system.mk |
Thomas Petazzoni | 649b5b9 | 2010-03-14 18:20:45 +0100 | [diff] [blame] | 332 | include fs/common.mk |
Eric Andersen | 79f5f1e | 2005-02-17 03:00:29 +0000 | [diff] [blame] | 333 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 334 | TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) |
Bernhard Reutner-Fischer | 3b08e64 | 2007-09-18 13:12:25 +0000 | [diff] [blame] | 335 | TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS)) |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 336 | TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) |
Bernhard Reutner-Fischer | b3efde2 | 2007-09-01 17:10:55 +0000 | [diff] [blame] | 337 | TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS)) |
Peter Korsgaard | 22c2c6b | 2010-11-19 14:20:56 +0100 | [diff] [blame] | 338 | |
| 339 | # host-* dependencies have to be handled specially, as those aren't |
| 340 | # visible in Kconfig and hence not added to a variable like TARGETS. |
| 341 | # instead, find all the host-* targets listed in each <PKG>_DEPENDENCIES |
| 342 | # variable for each enabled target. |
| 343 | # Notice: this only works for newstyle gentargets/autotargets packages |
| 344 | TARGETS_HOST_DEPS = $(sort $(filter host-%,$(foreach dep,\ |
| 345 | $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS))),\ |
| 346 | $($(dep))))) |
| 347 | # Host packages can in turn have their own dependencies. Likewise find |
| 348 | # all the package names listed in the HOST_<PKG>_DEPENDENCIES for each |
| 349 | # host package found above. Ideally this should be done recursively until |
| 350 | # no more packages are found, but that's hard to do in make, so limit to |
| 351 | # 1 level for now. |
| 352 | HOST_DEPS = $(sort $(foreach dep,\ |
| 353 | $(addsuffix _DEPENDENCIES,$(call UPPERCASE,$(TARGETS_HOST_DEPS))),\ |
| 354 | $($(dep)))) |
| 355 | HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS))) |
| 356 | |
Luca Ceresoli | 7e76f90 | 2012-05-17 19:33:00 +0200 | [diff] [blame] | 357 | TARGETS_LEGAL_INFO:=$(patsubst %,%-legal-info,\ |
| 358 | $(TARGETS) $(BASE_TARGETS) $(TARGETS_HOST_DEPS) $(HOST_DEPS)))) |
| 359 | |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 360 | # all targets depend on the crosscompiler and it's prerequisites |
Bernhard Reutner-Fischer | b3efde2 | 2007-09-01 17:10:55 +0000 | [diff] [blame] | 361 | $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) % |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 362 | |
Peter Korsgaard | a77ee7f | 2012-09-10 12:38:29 +0200 | [diff] [blame] | 363 | dirs: $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ |
Peter Korsgaard | d0880f7 | 2012-01-15 20:59:37 +0100 | [diff] [blame] | 364 | $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) |
Ulf Samuelsson | f958d89 | 2007-08-14 07:45:01 +0000 | [diff] [blame] | 365 | |
Peter Korsgaard | ed7791e | 2012-02-25 23:18:03 +0100 | [diff] [blame] | 366 | $(BASE_TARGETS): dirs $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake |
Ulf Samuelsson | f958d89 | 2007-08-14 07:45:01 +0000 | [diff] [blame] | 367 | |
Thomas Petazzoni | 0b36880 | 2010-08-22 07:27:09 +0200 | [diff] [blame] | 368 | $(BUILD_DIR)/buildroot-config/auto.conf: $(CONFIG_DIR)/.config |
Thomas Petazzoni | c729829 | 2011-04-02 18:44:36 +0200 | [diff] [blame] | 369 | $(MAKE) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig |
Thomas Petazzoni | 0b36880 | 2010-08-22 07:27:09 +0200 | [diff] [blame] | 370 | |
| 371 | prepare: $(BUILD_DIR)/buildroot-config/auto.conf |
| 372 | |
Thomas De Schampheleire | ee7f92e | 2012-02-08 17:22:19 +0100 | [diff] [blame] | 373 | world: prepare dirs dependencies $(BASE_TARGETS) $(TARGETS_ALL) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 374 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 375 | .PHONY: all world dirs clean distclean source outputmakefile \ |
Luca Ceresoli | 7e76f90 | 2012-05-17 19:33:00 +0200 | [diff] [blame] | 376 | legal-info legal-info-prepare legal-info-clean \ |
Bernhard Reutner-Fischer | b3efde2 | 2007-09-01 17:10:55 +0000 | [diff] [blame] | 377 | $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \ |
Luca Ceresoli | 7e76f90 | 2012-05-17 19:33:00 +0200 | [diff] [blame] | 378 | $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \ |
Peter Korsgaard | a77ee7f | 2012-09-10 12:38:29 +0200 | [diff] [blame] | 379 | $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ |
Peter Korsgaard | d0880f7 | 2012-01-15 20:59:37 +0100 | [diff] [blame] | 380 | $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) |
Jon Nelson | c79e998 | 2002-01-05 20:26:15 +0000 | [diff] [blame] | 381 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 382 | ############################################################# |
| 383 | # |
Eric Andersen | ef407d3 | 2004-01-29 23:21:00 +0000 | [diff] [blame] | 384 | # staging and target directories do NOT list these as |
Mike Frysinger | d99c31c | 2006-05-26 01:18:09 +0000 | [diff] [blame] | 385 | # dependencies anywhere else |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 386 | # |
| 387 | ############################################################# |
Peter Korsgaard | a77ee7f | 2012-09-10 12:38:29 +0200 | [diff] [blame] | 388 | $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR): |
Bernhard Reutner-Fischer | 8d583fc | 2007-01-30 00:58:18 +0000 | [diff] [blame] | 389 | @mkdir -p $@ |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 390 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 391 | $(STAGING_DIR): |
"Steven J. Hill" | 9c865d7 | 2007-05-07 03:56:47 +0000 | [diff] [blame] | 392 | @mkdir -p $(STAGING_DIR)/bin |
Eric Andersen | bf38723 | 2004-12-11 10:35:18 +0000 | [diff] [blame] | 393 | @mkdir -p $(STAGING_DIR)/lib |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 394 | @mkdir -p $(STAGING_DIR)/usr/lib |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 395 | @mkdir -p $(STAGING_DIR)/usr/include |
Thomas Petazzoni | a05c337 | 2010-02-09 22:44:15 +0100 | [diff] [blame] | 396 | @mkdir -p $(STAGING_DIR)/usr/bin |
Gustavo Zacarias | 5ad139e | 2010-12-31 08:39:05 -0300 | [diff] [blame] | 397 | @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 398 | |
Dmytro Milinevskyy | 2b3a43f | 2010-06-16 23:25:56 +0300 | [diff] [blame] | 399 | ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y) |
| 400 | TARGET_SKELETON=$(BR2_ROOTFS_SKELETON_CUSTOM_PATH) |
| 401 | endif |
| 402 | |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 403 | $(BUILD_DIR)/.root: |
Bernhard Reutner-Fischer | 7547c7e | 2007-08-21 10:53:39 +0000 | [diff] [blame] | 404 | mkdir -p $(TARGET_DIR) |
Bernhard Reutner-Fischer | f0ca4b8 | 2007-08-21 10:56:38 +0000 | [diff] [blame] | 405 | if ! [ -d "$(TARGET_DIR)/bin" ]; then \ |
| 406 | if [ -d "$(TARGET_SKELETON)" ]; then \ |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 407 | cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \ |
Ulf Samuelsson | 74cda1e | 2007-08-14 07:24:45 +0000 | [diff] [blame] | 408 | fi; \ |
Bernhard Reutner-Fischer | f0ca4b8 | 2007-08-21 10:56:38 +0000 | [diff] [blame] | 409 | fi |
Thomas Petazzoni | 9226a99 | 2012-11-17 03:52:14 +0000 | [diff] [blame] | 410 | cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE) |
Will Newton | fc3eb18 | 2009-08-10 10:04:14 +0100 | [diff] [blame] | 411 | -find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf |
Anders Darander | b9656e8 | 2009-12-23 10:05:45 +0100 | [diff] [blame] | 412 | -find $(TARGET_DIR) -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf |
Bernhard Reutner-Fischer | 7547c7e | 2007-08-21 10:53:39 +0000 | [diff] [blame] | 413 | touch $@ |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 414 | |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 415 | $(TARGET_DIR): $(BUILD_DIR)/.root |
Ulf Samuelsson | c6771df | 2007-08-16 05:44:55 +0000 | [diff] [blame] | 416 | |
Thomas De Schampheleire | 2a97045 | 2012-06-21 19:34:50 +0000 | [diff] [blame] | 417 | STRIP_FIND_CMD = find $(TARGET_DIR) |
| 418 | ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) |
| 419 | STRIP_FIND_CMD += \( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o |
| 420 | endif |
| 421 | STRIP_FIND_CMD += -type f -perm +111 |
| 422 | STRIP_FIND_CMD += -not \( $(call findfileclauses,libthread_db*.so* $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print |
| 423 | |
Peter Korsgaard | 32faf35 | 2009-04-07 21:04:31 +0000 | [diff] [blame] | 424 | target-finalize: |
John Voltz | d45de0c | 2008-03-11 13:12:39 +0000 | [diff] [blame] | 425 | ifeq ($(BR2_HAVE_DEVFILES),y) |
Thomas Petazzoni | f082c7c | 2011-08-31 23:35:02 +0200 | [diff] [blame] | 426 | ( support/scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) ) |
John Voltz | bc67ca2 | 2008-03-10 15:22:43 +0000 | [diff] [blame] | 427 | else |
Valentine Barshak | 94d3aa1 | 2012-10-02 08:52:15 +0000 | [diff] [blame] | 428 | rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \ |
| 429 | $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig |
Wade Berrier | 027aa1d | 2009-04-28 17:33:44 +0000 | [diff] [blame] | 430 | find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f |
| 431 | find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f |
John Voltz | bc67ca2 | 2008-03-10 15:22:43 +0000 | [diff] [blame] | 432 | endif |
Malte Starostik | e48a72e | 2010-07-24 21:29:56 +0200 | [diff] [blame] | 433 | ifneq ($(BR2_PACKAGE_GDB),y) |
| 434 | rm -rf $(TARGET_DIR)/usr/share/gdb |
| 435 | endif |
Thomas Petazzoni | 87b0637 | 2010-04-10 22:42:45 +0200 | [diff] [blame] | 436 | ifneq ($(BR2_HAVE_DOCUMENTATION),y) |
Peter Korsgaard | 32faf35 | 2009-04-07 21:04:31 +0000 | [diff] [blame] | 437 | rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man |
Peter Korsgaard | 32faf35 | 2009-04-07 21:04:31 +0000 | [diff] [blame] | 438 | rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info |
Thomas Petazzoni | 87b0637 | 2010-04-10 22:42:45 +0200 | [diff] [blame] | 439 | rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc |
Paulius Zaleckas | d701a82 | 2010-05-05 13:09:36 +0300 | [diff] [blame] | 440 | rm -rf $(TARGET_DIR)/usr/share/gtk-doc |
Mike Frysinger | 68ad6d4 | 2010-11-18 16:25:58 -0500 | [diff] [blame] | 441 | -rmdir $(TARGET_DIR)/usr/share 2>/dev/null |
Peter Korsgaard | 32faf35 | 2009-04-07 21:04:31 +0000 | [diff] [blame] | 442 | endif |
Thomas Petazzoni | b0c86bc | 2011-01-11 21:44:29 +0100 | [diff] [blame] | 443 | ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y) |
| 444 | find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -print0 | xargs -0 rm -f |
| 445 | endif |
| 446 | ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y) |
| 447 | find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f |
| 448 | endif |
Thomas De Schampheleire | 2a97045 | 2012-06-21 19:34:50 +0000 | [diff] [blame] | 449 | $(STRIP_FIND_CMD) | xargs $(STRIPCMD) 2>/dev/null || true |
Mike Frysinger | 8101c9a | 2010-11-17 18:55:43 -0500 | [diff] [blame] | 450 | find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \ |
Gustavo Zacarias | 0dc940c | 2010-11-30 12:19:59 -0300 | [diff] [blame] | 451 | xargs -r $(KSTRIPCMD) || true |
Mike Frysinger | 8101c9a | 2010-11-17 18:55:43 -0500 | [diff] [blame] | 452 | |
Thomas Petazzoni | 4ccde7f | 2010-08-30 22:52:18 +0200 | [diff] [blame] | 453 | mkdir -p $(TARGET_DIR)/etc |
| 454 | # Mandatory configuration file and auxilliary cache directory |
| 455 | # for recent versions of ldconfig |
| 456 | touch $(TARGET_DIR)/etc/ld.so.conf |
| 457 | mkdir -p $(TARGET_DIR)/var/cache/ldconfig |
Peter Korsgaard | e49e2fe | 2010-07-26 23:53:37 +0200 | [diff] [blame] | 458 | if [ -x "$(TARGET_CROSS)ldconfig" ]; \ |
| 459 | then \ |
Thomas Petazzoni | 4ccde7f | 2010-08-30 22:52:18 +0200 | [diff] [blame] | 460 | $(TARGET_CROSS)ldconfig -r $(TARGET_DIR); \ |
Peter Korsgaard | e49e2fe | 2010-07-26 23:53:37 +0200 | [diff] [blame] | 461 | else \ |
Thomas Petazzoni | 4ccde7f | 2010-08-30 22:52:18 +0200 | [diff] [blame] | 462 | /sbin/ldconfig -r $(TARGET_DIR); \ |
Peter Korsgaard | e49e2fe | 2010-07-26 23:53:37 +0200 | [diff] [blame] | 463 | fi |
Peter Korsgaard | 451a887 | 2012-02-14 12:58:25 +0100 | [diff] [blame] | 464 | ( \ |
| 465 | echo "NAME=Buildroot"; \ |
| 466 | echo "VERSION=$(BR2_VERSION_FULL)"; \ |
| 467 | echo "ID=buildroot"; \ |
| 468 | echo "VERSION_ID=$(BR2_VERSION)"; \ |
| 469 | echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \ |
| 470 | ) > $(TARGET_DIR)/etc/os-release |
Peter Korsgaard | 912ea81 | 2009-09-30 17:40:24 +0200 | [diff] [blame] | 471 | |
Daniel Mack | eed7d87 | 2009-07-08 22:46:58 +0200 | [diff] [blame] | 472 | ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"") |
Philippe Reynes | dbf4978 | 2012-11-17 13:01:22 +0100 | [diff] [blame^] | 473 | @$(call MESSAGE,"Executing post-build script\(s\)") |
| 474 | @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \ |
| 475 | $(s) $(TARGET_DIR)$(sep)) |
Daniel Mack | eed7d87 | 2009-07-08 22:46:58 +0200 | [diff] [blame] | 476 | endif |
| 477 | |
Peter Korsgaard | b87b474 | 2009-04-06 09:21:26 +0000 | [diff] [blame] | 478 | ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) |
Thomas Petazzoni | 397fe5c | 2009-09-05 15:49:30 +0200 | [diff] [blame] | 479 | LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge |
Thomas Petazzoni | 6cdf248 | 2009-07-30 17:28:20 +0200 | [diff] [blame] | 480 | LOCALE_NOPURGE=$(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST)) |
Peter Korsgaard | b87b474 | 2009-04-06 09:21:26 +0000 | [diff] [blame] | 481 | |
| 482 | target-purgelocales: |
| 483 | rm -f $(LOCALE_WHITELIST) |
| 484 | for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done |
| 485 | |
| 486 | for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \ |
| 487 | do \ |
| 488 | for lang in $$(cd $$dir; ls .|grep -v man); \ |
| 489 | do \ |
| 490 | grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \ |
| 491 | done; \ |
| 492 | done |
| 493 | endif |
| 494 | |
Thomas Petazzoni | aebf199 | 2012-05-08 04:39:22 +0000 | [diff] [blame] | 495 | ifneq ($(GENERATE_LOCALE),) |
| 496 | # Generate locale data. Basically, we call the localedef program |
| 497 | # (built by the host-localedef package) for each locale. The input |
| 498 | # data comes preferably from the toolchain, or if the toolchain does |
| 499 | # not have them (Linaro toolchains), we use the ones available on the |
| 500 | # host machine. |
| 501 | target-generatelocales: host-localedef |
| 502 | $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/ |
| 503 | $(Q)for locale in $(GENERATE_LOCALE) ; do \ |
| 504 | inputfile=`echo $${locale} | cut -f1 -d'.'` ; \ |
| 505 | charmap=`echo $${locale} | cut -f2 -d'.'` ; \ |
| 506 | if test -z "$${charmap}" ; then \ |
| 507 | charmap="UTF-8" ; \ |
| 508 | fi ; \ |
| 509 | echo "Generating locale $${inputfile}.$${charmap}" ; \ |
| 510 | I18NPATH=$(STAGING_DIR)/usr/share/i18n:/usr/share/i18n \ |
| 511 | $(HOST_DIR)/usr/bin/localedef \ |
| 512 | --prefix=$(TARGET_DIR) \ |
| 513 | --`echo $(BR2_ENDIAN) | tr [A-Z] [a-z]`-endian \ |
| 514 | -i $${inputfile} -f $${charmap} \ |
| 515 | $${locale} ; \ |
| 516 | done |
| 517 | endif |
| 518 | |
Thomas De Schampheleire | 4eb982c | 2011-07-27 11:34:51 +0200 | [diff] [blame] | 519 | source: dirs $(TARGETS_SOURCE) $(HOST_SOURCE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 520 | |
Peter Korsgaard | 155971e | 2008-03-04 12:19:16 +0000 | [diff] [blame] | 521 | external-deps: |
Peter Korsgaard | 22c2c6b | 2010-11-19 14:20:56 +0100 | [diff] [blame] | 522 | @$(MAKE) -Bs DL_MODE=SHOW_EXTERNAL_DEPS $(EXTRAMAKEARGS) source | sort -u |
Peter Korsgaard | 155971e | 2008-03-04 12:19:16 +0000 | [diff] [blame] | 523 | |
Luca Ceresoli | 7e76f90 | 2012-05-17 19:33:00 +0200 | [diff] [blame] | 524 | legal-info-clean: |
| 525 | @rm -fr $(LEGAL_INFO_DIR) |
| 526 | |
| 527 | legal-info-prepare: $(LEGAL_INFO_DIR) |
| 528 | @$(call MESSAGE,"Collecting legal info") |
| 529 | @$(call legal-license-file,buildroot,COPYING,COPYING) |
| 530 | @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE) |
| 531 | @$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved) |
| 532 | @$(call legal-warning,the Buildroot source code has not been saved) |
| 533 | @$(call legal-warning,the toolchain has not been saved) |
| 534 | @cp $(CONFIG_DIR)/.config $(LEGAL_INFO_DIR)/buildroot.config |
| 535 | |
| 536 | legal-info: dirs legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \ |
| 537 | $(TARGETS_LEGAL_INFO) |
| 538 | @cat support/legal-info/README.header >>$(LEGAL_REPORT) |
| 539 | @if [ -r $(LEGAL_WARNINGS) ]; then \ |
| 540 | cat support/legal-info/README.warnings-header \ |
| 541 | $(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \ |
| 542 | cat $(LEGAL_WARNINGS); fi |
| 543 | @echo "Legal info produced in $(LEGAL_INFO_DIR)" |
| 544 | @rm -f $(LEGAL_WARNINGS) |
| 545 | |
Thomas Petazzoni | b7d6c8a | 2010-05-13 19:20:33 +0200 | [diff] [blame] | 546 | show-targets: |
| 547 | @echo $(TARGETS) |
| 548 | |
Bernhard Reutner-Fischer | cfe511b | 2007-09-29 13:58:30 +0000 | [diff] [blame] | 549 | else # ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 550 | |
| 551 | all: menuconfig |
| 552 | |
| 553 | # configuration |
| 554 | # --------------------------------------------------------------------------- |
| 555 | |
Bernhard Reutner-Fischer | c0d7d4e | 2007-07-09 18:23:20 +0000 | [diff] [blame] | 556 | HOSTCFLAGS=$(CFLAGS_FOR_BUILD) |
| 557 | export HOSTCFLAGS |
| 558 | |
Peter Korsgaard | 2cc210c | 2010-06-20 23:05:32 +0200 | [diff] [blame] | 559 | $(BUILD_DIR)/buildroot-config/%onf: |
| 560 | mkdir -p $(@D)/lxdialog |
Thomas Petazzoni | 17b66af | 2010-12-07 21:09:56 +0100 | [diff] [blame] | 561 | $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) |
Alper Yildirim | b0df9df | 2009-07-20 19:17:10 +0200 | [diff] [blame] | 562 | |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 563 | COMMON_CONFIG_ENV = \ |
| 564 | KCONFIG_AUTOCONFIG=$(BUILD_DIR)/buildroot-config/auto.conf \ |
| 565 | KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \ |
Thomas Petazzoni | 0b36880 | 2010-08-22 07:27:09 +0200 | [diff] [blame] | 566 | KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \ |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 567 | BUILDROOT_CONFIG=$(CONFIG_DIR)/.config |
Alper Yildirim | b0df9df | 2009-07-20 19:17:10 +0200 | [diff] [blame] | 568 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 569 | xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 570 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Peter Korsgaard | 610255e | 2010-11-24 15:30:54 +0100 | [diff] [blame] | 571 | @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) |
Alper Yildirim | b0df9df | 2009-07-20 19:17:10 +0200 | [diff] [blame] | 572 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 573 | gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 574 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Peter Korsgaard | 610255e | 2010-11-24 15:30:54 +0100 | [diff] [blame] | 575 | @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN) |
Peter Korsgaard | 2b42aae | 2010-06-05 21:09:05 +0200 | [diff] [blame] | 576 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 577 | menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 578 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Peter Korsgaard | 610255e | 2010-11-24 15:30:54 +0100 | [diff] [blame] | 579 | @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 580 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 581 | nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile |
Thomas Petazzoni | 8b6585a | 2010-08-21 17:21:40 +0200 | [diff] [blame] | 582 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Peter Korsgaard | 610255e | 2010-11-24 15:30:54 +0100 | [diff] [blame] | 583 | @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 584 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 585 | config: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 586 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 587 | @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 588 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 589 | oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 590 | mkdir -p $(BUILD_DIR)/buildroot-config |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 591 | @$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 592 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 593 | randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 594 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 595 | @$(COMMON_CONFIG_ENV) $< --randconfig $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 596 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 597 | allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 598 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 599 | @$(COMMON_CONFIG_ENV) $< --allyesconfig $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 600 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 601 | allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 602 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 603 | @$(COMMON_CONFIG_ENV) $< --allnoconfig $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 604 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 605 | randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 606 | @mkdir -p $(BUILD_DIR)/buildroot-config |
| 607 | @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 608 | @$(COMMON_CONFIG_ENV) \ |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 609 | KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 610 | $< --randconfig $(CONFIG_CONFIG_IN) |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 611 | @rm -f $(CONFIG_DIR)/.config.nopkg |
Peter Korsgaard | 6652770 | 2009-10-04 21:57:12 +0200 | [diff] [blame] | 612 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 613 | allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 614 | @mkdir -p $(BUILD_DIR)/buildroot-config |
| 615 | @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 616 | @$(COMMON_CONFIG_ENV) \ |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 617 | KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 618 | $< --allyesconfig $(CONFIG_CONFIG_IN) |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 619 | @rm -f $(CONFIG_DIR)/.config.nopkg |
Peter Korsgaard | 6652770 | 2009-10-04 21:57:12 +0200 | [diff] [blame] | 620 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 621 | allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 622 | @mkdir -p $(BUILD_DIR)/buildroot-config |
| 623 | @grep -v BR2_PACKAGE_ $(CONFIG_DIR)/.config > $(CONFIG_DIR)/.config.nopkg |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 624 | @$(COMMON_CONFIG_ENV) \ |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 625 | KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 626 | $< --allnoconfig $(CONFIG_CONFIG_IN) |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 627 | @rm -f $(CONFIG_DIR)/.config.nopkg |
Peter Korsgaard | 6652770 | 2009-10-04 21:57:12 +0200 | [diff] [blame] | 628 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 629 | silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Thomas Petazzoni | 0b36880 | 2010-08-22 07:27:09 +0200 | [diff] [blame] | 630 | @mkdir -p $(BUILD_DIR)/buildroot-config |
| 631 | $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN) |
| 632 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 633 | defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Will Wagner | 39ca6d5 | 2010-01-11 12:28:50 +0000 | [diff] [blame] | 634 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Arnout Vandecappelle | 33f454b | 2012-04-28 07:14:50 +0000 | [diff] [blame] | 635 | @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(BR2_DEFCONFIG),=$(BR2_DEFCONFIG)) $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 636 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 637 | %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile |
Thomas Petazzoni | 6f38119 | 2010-08-11 20:01:23 +0200 | [diff] [blame] | 638 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Thomas Petazzoni | 1039eb7 | 2010-08-21 18:29:27 +0200 | [diff] [blame] | 639 | @$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN) |
Thomas Petazzoni | 6f38119 | 2010-08-11 20:01:23 +0200 | [diff] [blame] | 640 | |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 641 | savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile |
Thomas Petazzoni | e1b1a18 | 2010-08-21 18:50:44 +0200 | [diff] [blame] | 642 | @mkdir -p $(BUILD_DIR)/buildroot-config |
Peter Korsgaard | 35ac32d | 2011-02-02 15:33:10 +0100 | [diff] [blame] | 643 | @$(COMMON_CONFIG_ENV) $< --savedefconfig=$(CONFIG_DIR)/defconfig $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 644 | |
Bernhard Reutner-Fischer | 6547bce | 2007-08-22 12:35:41 +0000 | [diff] [blame] | 645 | # check if download URLs are outdated |
Thomas De Schampheleire | 07bae75 | 2012-06-21 19:38:42 +0000 | [diff] [blame] | 646 | source-check: |
Yann E. MORIN | 7c29745 | 2011-07-14 13:02:33 +0200 | [diff] [blame] | 647 | $(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source |
Bernhard Reutner-Fischer | 825ff34 | 2007-06-07 12:57:03 +0000 | [diff] [blame] | 648 | |
Peter Korsgaard | 406053d | 2009-11-20 14:05:48 +0100 | [diff] [blame] | 649 | endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
| 650 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 651 | ############################################################# |
| 652 | # |
| 653 | # Cleanup and misc junk |
| 654 | # |
| 655 | ############################################################# |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 656 | |
| 657 | # outputmakefile generates a Makefile in the output directory, if using a |
| 658 | # separate output directory. This allows convenient use of make in the |
| 659 | # output directory. |
| 660 | outputmakefile: |
| 661 | ifeq ($(NEED_WRAPPER),y) |
Thomas Petazzoni | f082c7c | 2011-08-31 23:35:02 +0200 | [diff] [blame] | 662 | $(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O) |
Yann E. MORIN | aefad53 | 2010-09-26 10:56:12 +0200 | [diff] [blame] | 663 | endif |
| 664 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 665 | clean: |
Peter Korsgaard | 406053d | 2009-11-20 14:05:48 +0100 | [diff] [blame] | 666 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \ |
Luca Ceresoli | 7e76f90 | 2012-05-17 19:33:00 +0200 | [diff] [blame] | 667 | $(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR) $(BASE_DIR)/staging \ |
| 668 | $(LEGAL_INFO_DIR) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 669 | |
| 670 | distclean: clean |
Peter Korsgaard | 406053d | 2009-11-20 14:05:48 +0100 | [diff] [blame] | 671 | ifeq ($(DL_DIR),$(TOPDIR)/dl) |
| 672 | rm -rf $(DL_DIR) |
| 673 | endif |
| 674 | ifeq ($(O),output) |
| 675 | rm -rf $(O) |
| 676 | endif |
Peter Korsgaard | 610255e | 2010-11-24 15:30:54 +0100 | [diff] [blame] | 677 | rm -rf $(CONFIG_DIR)/.config $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.auto.deps |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 678 | |
Ulf Samuelsson | b8f28d6 | 2007-09-28 16:18:16 +0000 | [diff] [blame] | 679 | cross: $(BASE_TARGETS) |
| 680 | |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 681 | help: |
| 682 | @echo 'Cleaning:' |
Peter Korsgaard | 406053d | 2009-11-20 14:05:48 +0100 | [diff] [blame] | 683 | @echo ' clean - delete all files created by build' |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 684 | @echo ' distclean - delete all non-source files (including .config)' |
| 685 | @echo |
| 686 | @echo 'Build:' |
| 687 | @echo ' all - make world' |
Stephan Hoffmann | 040f6a3 | 2012-04-06 18:44:22 +0200 | [diff] [blame] | 688 | @echo ' <package>-rebuild - force recompile <package>' |
| 689 | @echo ' <package>-reconfigure - force reconfigure <package>' |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 690 | @echo |
| 691 | @echo 'Configuration:' |
| 692 | @echo ' menuconfig - interactive curses-based configurator' |
Peter Korsgaard | 15f5bef | 2011-02-01 08:41:01 +0100 | [diff] [blame] | 693 | @echo ' nconfig - interactive ncurses-based configurator' |
Peter Korsgaard | c48bbb8 | 2009-10-04 21:42:54 +0200 | [diff] [blame] | 694 | @echo ' xconfig - interactive Qt-based configurator' |
Peter Korsgaard | 2b42aae | 2010-06-05 21:09:05 +0200 | [diff] [blame] | 695 | @echo ' gconfig - interactive GTK-based configurator' |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 696 | @echo ' oldconfig - resolve any unresolved symbols in .config' |
Peter Korsgaard | c48bbb8 | 2009-10-04 21:42:54 +0200 | [diff] [blame] | 697 | @echo ' randconfig - New config with random answer to all options' |
| 698 | @echo ' defconfig - New config with default answer to all options' |
Arnout Vandecappelle | 33f454b | 2012-04-28 07:14:50 +0000 | [diff] [blame] | 699 | @echo ' BR2_DEFCONFIG, if set, is used as input' |
Peter Korsgaard | d7051da | 2010-12-07 12:16:44 +0100 | [diff] [blame] | 700 | @echo ' savedefconfig - Save current config as ./defconfig (minimal config)' |
Peter Korsgaard | c48bbb8 | 2009-10-04 21:42:54 +0200 | [diff] [blame] | 701 | @echo ' allyesconfig - New config where all options are accepted with yes' |
| 702 | @echo ' allnoconfig - New config where all options are answered with no' |
Peter Korsgaard | 6652770 | 2009-10-04 21:57:12 +0200 | [diff] [blame] | 703 | @echo ' randpackageconfig - New config with random answer to package options' |
| 704 | @echo ' allyespackageconfig - New config where pkg options are accepted with yes' |
| 705 | @echo ' allnopackageconfig - New config where package options are answered with no' |
Peter Korsgaard | 4bb33dc | 2011-04-25 00:10:45 +0200 | [diff] [blame] | 706 | ifeq ($(BR2_PACKAGE_BUSYBOX),y) |
| 707 | @echo ' busybox-menuconfig - Run BusyBox menuconfig' |
| 708 | endif |
| 709 | ifeq ($(BR2_LINUX_KERNEL),y) |
| 710 | @echo ' linux-menuconfig - Run Linux kernel menuconfig' |
Jean-Christophe PLAGNIOL-VILLARD | f5777ce | 2011-08-22 21:28:47 +0200 | [diff] [blame] | 711 | @echo ' linux-savedefconfig - Run Linux kernel savedefconfig' |
Peter Korsgaard | 4bb33dc | 2011-04-25 00:10:45 +0200 | [diff] [blame] | 712 | endif |
| 713 | ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) |
| 714 | @echo ' uclibc-menuconfig - Run uClibc menuconfig' |
| 715 | endif |
| 716 | ifeq ($(BR2_TOOLCHAIN_CTNG),y) |
| 717 | @echo ' ctng-menuconfig - Run crosstool-NG menuconfig' |
| 718 | endif |
Jean-Christophe PLAGNIOL-VILLARD | 83f1bf9 | 2011-08-22 21:28:48 +0200 | [diff] [blame] | 719 | ifeq ($(BR2_TARGET_BAREBOX),y) |
| 720 | @echo ' barebox-menuconfig - Run barebox menuconfig' |
| 721 | @echo ' barebox-savedefconfig - Run barebox savedefconfig' |
| 722 | endif |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 723 | @echo |
Thomas Petazzoni | 8792cf9 | 2011-10-10 10:46:40 +0200 | [diff] [blame] | 724 | @echo 'Documentation:' |
| 725 | @echo ' manual - build manual in HTML, split HTML, PDF and txt' |
| 726 | @echo ' manual-html - build manual in HTML' |
| 727 | @echo ' manual-split-html - build manual in split HTML' |
| 728 | @echo ' manual-pdf - build manual in PDF' |
| 729 | @echo ' manual-txt - build manual in txt' |
| 730 | @echo ' manual-epub - build manual in ePub' |
| 731 | @echo |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 732 | @echo 'Miscellaneous:' |
| 733 | @echo ' source - download all sources needed for offline-build' |
Thomas De Schampheleire | 07bae75 | 2012-06-21 19:38:42 +0000 | [diff] [blame] | 734 | @echo ' source-check - check selected packages for valid download URLs' |
Peter Korsgaard | 155971e | 2008-03-04 12:19:16 +0000 | [diff] [blame] | 735 | @echo ' external-deps - list external packages used' |
Luca Ceresoli | 7e76f90 | 2012-05-17 19:33:00 +0200 | [diff] [blame] | 736 | @echo ' legal-info - generate info about license compliance' |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 737 | @echo |
Peter Korsgaard | 15f5bef | 2011-02-01 08:41:01 +0100 | [diff] [blame] | 738 | @echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build' |
| 739 | @echo ' make O=dir - Locate all output files in "dir", including .config' |
| 740 | @echo |
Danomi Mocelopolis | b979619 | 2011-07-17 22:17:08 +0200 | [diff] [blame] | 741 | @$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \ |
Peter Korsgaard | 58fd779 | 2009-10-04 22:09:25 +0200 | [diff] [blame] | 742 | printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);) |
| 743 | @echo |
Thomas Petazzoni | 8792cf9 | 2011-10-10 10:46:40 +0200 | [diff] [blame] | 744 | @echo 'See docs/README, or generate the Buildroot manual for further details' |
Bernhard Reutner-Fischer | 663dee4 | 2007-08-27 21:40:42 +0000 | [diff] [blame] | 745 | @echo |
Bernhard Reutner-Fischer | ba2e7e0 | 2007-06-25 10:56:13 +0000 | [diff] [blame] | 746 | |
Yann E. MORIN | e5e8fae | 2010-10-31 17:35:10 +0100 | [diff] [blame] | 747 | release: OUT=buildroot-$(BR2_VERSION) |
Peter Korsgaard | 0dca706 | 2010-11-04 00:00:00 +0100 | [diff] [blame] | 748 | |
Peter Korsgaard | 134ab1c | 2012-02-03 22:03:29 +0100 | [diff] [blame] | 749 | # Create release tarballs. We need to fiddle a bit to add the generated |
| 750 | # documentation to the git output |
Peter Korsgaard | 0dca706 | 2010-11-04 00:00:00 +0100 | [diff] [blame] | 751 | release: |
Peter Korsgaard | 134ab1c | 2012-02-03 22:03:29 +0100 | [diff] [blame] | 752 | git archive --format=tar --prefix=$(OUT)/ master > $(OUT).tar |
| 753 | $(MAKE) O=$(OUT) manual-html manual-txt manual-pdf |
| 754 | tar rf $(OUT).tar $(OUT) |
| 755 | gzip -9 -c < $(OUT).tar > $(OUT).tar.gz |
| 756 | bzip2 -9 -c < $(OUT).tar > $(OUT).tar.bz2 |
| 757 | rm -rf $(OUT) $(OUT).tar |
Peter Korsgaard | e62d2ec | 2009-01-15 19:36:06 +0000 | [diff] [blame] | 758 | |
Arnout Vandecappelle (Essensium/Mind) | 2b91ab7 | 2012-03-11 12:16:39 +0100 | [diff] [blame] | 759 | print-version: |
| 760 | @echo $(BR2_VERSION_FULL) |
| 761 | |
Thomas Petazzoni | b7285d0 | 2012-04-17 16:45:22 +0200 | [diff] [blame] | 762 | include docs/manual/manual.mk |
Thomas Petazzoni | 8792cf9 | 2011-10-10 10:46:40 +0200 | [diff] [blame] | 763 | |
Peter Korsgaard | 6652770 | 2009-10-04 21:57:12 +0200 | [diff] [blame] | 764 | .PHONY: $(noconfig_targets) |
Ulf Samuelsson | 50cbb4a | 2008-07-05 09:22:38 +0000 | [diff] [blame] | 765 | |