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> |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 4 | # |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 5 | # This program is free software; you can redistribute it and/or modify |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 2 of the License, or |
| 8 | # (at your option) any later version. |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 9 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 13 | # General Public License for more details. |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 14 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program; if not, write to the Free Software |
| 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | # |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 19 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 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=./ |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 25 | CONFIG_CONFIG_IN=Config.in |
| 26 | CONFIG_DEFCONFIG=.defconfig |
| 27 | CONFIG=package/config |
Ulf Samuelsson | 7def555 | 2007-07-11 15:01:42 +0000 | [diff] [blame] | 28 | DATE:=$(shell date -u +%Y%m%d) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 29 | |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 30 | noconfig_targets:=menuconfig config oldconfig randconfig \ |
Bernhard Reutner-Fischer | 6547bce | 2007-08-22 12:35:41 +0000 | [diff] [blame] | 31 | defconfig allyesconfig allnoconfig release tags \ |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 32 | source-check help |
Bernhard Reutner-Fischer | 9e25035 | 2006-12-02 19:01:10 +0000 | [diff] [blame] | 33 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 34 | |
Ulf Samuelsson | a1b0651 | 2008-03-28 07:31:28 +0000 | [diff] [blame] | 35 | # Use shell variables, if defined |
Ulf Samuelsson | 7521f37 | 2007-09-12 04:34:16 +0000 | [diff] [blame] | 36 | ifneq ($(BUILDROOT_LOCAL),) |
Ulf Samuelsson | efd8576 | 2008-03-30 06:38:46 +0000 | [diff] [blame] | 37 | BR2_LOCAL:=$(BUILDROOT_LOCAL) |
Ulf Samuelsson | 7521f37 | 2007-09-12 04:34:16 +0000 | [diff] [blame] | 38 | else |
Ulf Samuelsson | efd8576 | 2008-03-30 06:38:46 +0000 | [diff] [blame] | 39 | BR2_LOCAL:=$(TOPDIR)/local |
Ulf Samuelsson | a1b0651 | 2008-03-28 07:31:28 +0000 | [diff] [blame] | 40 | endif |
| 41 | |
| 42 | # $(shell find . -name *_defconfig |sed 's/.*\///') |
| 43 | # Pull in the user's configuration file |
| 44 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) |
| 45 | ifeq ($(BOARD),) |
| 46 | # if "make BOARD=xyz" command |
| 47 | -include $(TOPDIR).config |
| 48 | else |
| 49 | # if "make" command |
Ulf Samuelsson | efd8576 | 2008-03-30 06:38:46 +0000 | [diff] [blame] | 50 | -include $(BR2_LOCAL)/$(BOARD)/$(BOARD).config |
Ulf Samuelsson | a1b0651 | 2008-03-28 07:31:28 +0000 | [diff] [blame] | 51 | endif |
Ulf Samuelsson | 7521f37 | 2007-09-12 04:34:16 +0000 | [diff] [blame] | 52 | endif |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 53 | |
Ulf Samuelsson | efd8576 | 2008-03-30 06:38:46 +0000 | [diff] [blame] | 54 | # Override BR2_DL_DIR if shell variable defined |
| 55 | ifneq ($(BUILDROOT_DL_DIR),) |
| 56 | BR2_DL_DIR:=$(BUILDROOT_DL_DIR) |
| 57 | endif |
| 58 | LOCAL:=$(BR2_LOCAL) |
| 59 | |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 60 | # To put more focus on warnings, be less verbose as default |
| 61 | # Use 'make V=1' to see the full commands |
| 62 | ifdef V |
| 63 | ifeq ("$(origin V)", "command line") |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 64 | KBUILD_VERBOSE=$(V) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 65 | endif |
| 66 | endif |
| 67 | ifndef KBUILD_VERBOSE |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 68 | KBUILD_VERBOSE=0 |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 69 | endif |
| 70 | |
| 71 | ifeq ($(KBUILD_VERBOSE),1) |
Ulf Samuelsson | 4df454e | 2007-07-06 12:19:35 +0000 | [diff] [blame] | 72 | quiet= |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 73 | Q= |
Bernhard Reutner-Fischer | 1669b6e | 2007-09-22 14:19:22 +0000 | [diff] [blame] | 74 | ifndef VERBOSE |
| 75 | VERBOSE=1 |
| 76 | endif |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 77 | else |
| 78 | quiet=quiet_ |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 79 | Q=@ |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 80 | endif |
| 81 | |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 82 | CONFIG_SHELL:=$(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 83 | else if [ -x /bin/bash ]; then echo /bin/bash; \ |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 84 | else echo sh; fi; fi) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 85 | |
Bernhard Reutner-Fischer | 1669b6e | 2007-09-22 14:19:22 +0000 | [diff] [blame] | 86 | export CONFIG_SHELL quiet Q KBUILD_VERBOSE VERBOSE |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 87 | |
| 88 | ifndef HOSTAR |
| 89 | HOSTAR:=ar |
| 90 | endif |
| 91 | ifndef HOSTAS |
| 92 | HOSTAS:=as |
| 93 | endif |
| 94 | ifndef HOSTCC |
| 95 | HOSTCC:=gcc |
| 96 | else |
| 97 | endif |
| 98 | ifndef HOSTCXX |
| 99 | HOSTCXX:=g++ |
| 100 | endif |
Bernhard Reutner-Fischer | 5f97580 | 2007-09-28 20:10:22 +0000 | [diff] [blame] | 101 | ifndef HOSTFC |
| 102 | HOSTFC:=gfortran |
| 103 | endif |
Ulf Samuelsson | 356133b | 2007-09-28 19:46:58 +0000 | [diff] [blame] | 104 | ifndef HOSTCPP |
| 105 | HOSTCPP:=cpp |
| 106 | endif |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 107 | ifndef HOSTLD |
| 108 | HOSTLD:=ld |
| 109 | endif |
Ulf Samuelsson | 0f9c5b1 | 2007-07-15 21:54:11 +0000 | [diff] [blame] | 110 | ifndef HOSTLN |
| 111 | HOSTLN:=ln |
| 112 | endif |
Ulf Samuelsson | 356133b | 2007-09-28 19:46:58 +0000 | [diff] [blame] | 113 | ifndef HOSTNM |
| 114 | HOSTNM:=nm |
| 115 | endif |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 116 | HOSTAR:=$(shell $(CONFIG_SHELL) -c "which $(HOSTAR)" || type -p $(HOSTAR) || echo ar) |
| 117 | HOSTAS:=$(shell $(CONFIG_SHELL) -c "which $(HOSTAS)" || type -p $(HOSTAS) || echo as) |
| 118 | HOSTCC:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCC)" || type -p $(HOSTCC) || echo gcc) |
Ulf Samuelsson | 83832cd | 2007-07-09 04:26:49 +0000 | [diff] [blame] | 119 | HOSTCXX:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCXX)" || type -p $(HOSTCXX) || echo g++) |
Bernhard Reutner-Fischer | 5f97580 | 2007-09-28 20:10:22 +0000 | [diff] [blame] | 120 | HOSTFC:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLD)" || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran) |
Ulf Samuelsson | 356133b | 2007-09-28 19:46:58 +0000 | [diff] [blame] | 121 | HOSTCPP:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCPP)" || type -p $(HOSTCPP) || echo cpp) |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 122 | HOSTLD:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLD)" || type -p $(HOSTLD) || echo ld) |
| 123 | HOSTLN:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLN)" || type -p $(HOSTLN) || echo ln) |
Ulf Samuelsson | 356133b | 2007-09-28 19:46:58 +0000 | [diff] [blame] | 124 | HOSTNM:=$(shell $(CONFIG_SHELL) -c "which $(HOSTNM)" || type -p $(HOSTNM) || echo nm) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 125 | ifndef CFLAGS_FOR_BUILD |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 126 | CFLAGS_FOR_BUILD:=-g -O2 |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 127 | endif |
Bernhard Reutner-Fischer | 5f97580 | 2007-09-28 20:10:22 +0000 | [diff] [blame] | 128 | ifndef CXXFLAGS_FOR_BUILD |
| 129 | CXXFLAGS_FOR_BUILD:=-g -O2 |
| 130 | endif |
| 131 | ifndef FCFLAGS_FOR_BUILD |
| 132 | FCFLAGS_FOR_BUILD:=-g -O2 |
| 133 | endif |
| 134 | export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 135 | |
| 136 | |
Bernhard Reutner-Fischer | cfe511b | 2007-09-29 13:58:30 +0000 | [diff] [blame] | 137 | ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 138 | |
Bernhard Reutner-Fischer | 99cf729 | 2007-02-12 13:38:06 +0000 | [diff] [blame] | 139 | # cc-option |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 140 | # Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586) |
Bernhard Reutner-Fischer | 99cf729 | 2007-02-12 13:38:06 +0000 | [diff] [blame] | 141 | # sets -march=winchip-c6 if supported else falls back to -march=i586 |
| 142 | # without checking the latter. |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 143 | cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ |
Bernhard Reutner-Fischer | 99cf729 | 2007-02-12 13:38:06 +0000 | [diff] [blame] | 144 | > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) |
| 145 | |
Peter Korsgaard | 2c64904 | 2007-06-19 15:19:27 +0000 | [diff] [blame] | 146 | ############################################################# |
| 147 | # |
| 148 | # Hide troublesome environment variables from sub processes |
| 149 | # |
| 150 | ############################################################# |
| 151 | unexport CROSS_COMPILE |
| 152 | unexport ARCH |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 153 | |
| 154 | ############################################################# |
| 155 | # |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 156 | # Setup the proper filename extensions for the host |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 157 | # |
| 158 | ############################################################## |
| 159 | ifneq ($(findstring linux,$(BR2_GNU_BUILD_SUFFIX)),) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 160 | HOST_EXEEXT:= |
| 161 | HOST_LIBEXT:=.a |
| 162 | HOST_SHREXT:=.so |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 163 | endif |
| 164 | ifneq ($(findstring apple,$(BR2_GNU_BUILD_SUFFIX)),) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 165 | HOST_EXEEXT:= |
| 166 | HOST_LIBEXT:=.a |
| 167 | HOST_SHREXT:=.dylib |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 168 | endif |
| 169 | ifneq ($(findstring cygwin,$(BR2_GNU_BUILD_SUFFIX)),) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 170 | HOST_EXEEXT:=.exe |
| 171 | HOST_LIBEXT:=.lib |
| 172 | HOST_SHREXT:=.dll |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 173 | endif |
| 174 | ifneq ($(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)),) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 175 | HOST_EXEEXT:=.exe |
| 176 | HOST_LIBEXT:=.lib |
| 177 | HOST_SHREXT:=.dll |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 178 | endif |
| 179 | |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 180 | # The preferred type of libs we build for the target |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 181 | ifeq ($(BR2_PREFER_STATIC_LIB),y) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 182 | LIBTGTEXT=.a |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 183 | #PREFERRED_LIB_FLAGS:=--disable-shared --enable-static |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 184 | else |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 185 | LIBTGTEXT=.so |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 186 | #PREFERRED_LIB_FLAGS:=--disable-static --enable-shared |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 187 | endif |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 188 | PREFERRED_LIB_FLAGS:=--enable-static --enable-shared |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 189 | |
Bernhard Reutner-Fischer | 6ad0720 | 2007-07-31 15:02:06 +0000 | [diff] [blame] | 190 | ############################################################## |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 191 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 192 | # The list of stuff to build for the target toolchain |
| 193 | # along with the packages to build for the target. |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 194 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 195 | ############################################################## |
Bernhard Reutner-Fischer | 4b0d5a8 | 2007-09-26 21:12:38 +0000 | [diff] [blame] | 196 | ifeq ($(BR2_TOOLCHAIN_SOURCE),y) |
Peter Korsgaard | 3d8919a | 2008-03-04 12:19:19 +0000 | [diff] [blame] | 197 | BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers |
"Steven J. Hill" | 02f71aa | 2007-02-06 18:19:38 +0000 | [diff] [blame] | 198 | else |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 199 | BASE_TARGETS:=uclibc |
"Steven J. Hill" | 02f71aa | 2007-02-06 18:19:38 +0000 | [diff] [blame] | 200 | endif |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 201 | TARGETS:= |
| 202 | |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 203 | # setup our pathes |
Ulf Samuelsson | f958d89 | 2007-08-14 07:45:01 +0000 | [diff] [blame] | 204 | include project/Makefile.in |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 205 | |
| 206 | BR2_DEPENDS_DIR=$(PROJECT_BUILD_DIR)/buildroot-config |
| 207 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 208 | include toolchain/Makefile.in |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 209 | include package/Makefile.in |
Eric Andersen | 27bc59d | 2003-01-17 04:31:36 +0000 | [diff] [blame] | 210 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 211 | ############################################################# |
| 212 | # |
Eric Andersen | ef407d3 | 2004-01-29 23:21:00 +0000 | [diff] [blame] | 213 | # You should probably leave this stuff alone unless you know |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 214 | # what you are doing. |
| 215 | # |
| 216 | ############################################################# |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame] | 217 | |
Bernhard Reutner-Fischer | 6547bce | 2007-08-22 12:35:41 +0000 | [diff] [blame] | 218 | all: world |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 219 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 220 | # In this section, we need .config |
| 221 | include .config.cmd |
| 222 | |
Ulf Samuelsson | f958d89 | 2007-08-14 07:45:01 +0000 | [diff] [blame] | 223 | include project/*.mk |
| 224 | |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 225 | # We also need the various per-package makefiles, which also add |
| 226 | # each selected package to TARGETS if that package was selected |
| 227 | # in the .config file. |
Bernhard Reutner-Fischer | 4b0d5a8 | 2007-09-26 21:12:38 +0000 | [diff] [blame] | 228 | ifeq ($(BR2_TOOLCHAIN_SOURCE),y) |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 229 | # avoid pulling in external toolchain which is broken for toplvl parallel builds |
Bernhard Reutner-Fischer | 57310ec | 2007-09-27 21:24:15 +0000 | [diff] [blame] | 230 | # Explicit ordering: |
| 231 | include toolchain/dependencies/dependencies.mk |
| 232 | include toolchain/binutils/binutils.mk |
| 233 | include toolchain/ccache/ccache.mk |
| 234 | include toolchain/elf2flt/elf2flt.mk |
| 235 | include toolchain/gcc/gcc-uclibc-3.x.mk |
| 236 | include toolchain/gcc/gcc-uclibc-4.x.mk |
| 237 | include toolchain/gdb/gdb.mk |
| 238 | include toolchain/kernel-headers/kernel-headers.mk |
| 239 | include toolchain/mklibs/mklibs.mk |
| 240 | include toolchain/sstrip/sstrip.mk |
| 241 | include toolchain/uClibc/uclibc.mk |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 242 | else |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 243 | include toolchain/*/*.mk |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 244 | endif |
| 245 | |
"Steven J. Hill" | 62b5ae4 | 2007-07-18 18:07:19 +0000 | [diff] [blame] | 246 | ifeq ($(BR2_PACKAGE_LINUX),y) |
| 247 | TARGETS+=linux26-modules |
| 248 | endif |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 249 | |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 250 | include package/*/*.mk |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 251 | |
John Voltz | d45de0c | 2008-03-11 13:12:39 +0000 | [diff] [blame] | 252 | TARGETS+=target-devfiles |
| 253 | |
Eric Andersen | 79f5f1e | 2005-02-17 03:00:29 +0000 | [diff] [blame] | 254 | # target stuff is last so it can override anything else |
| 255 | include target/Makefile.in |
| 256 | |
John Voltz | d45de0c | 2008-03-11 13:12:39 +0000 | [diff] [blame] | 257 | TARGETS+=erase-fakeroots |
Ulf Samuelsson | c2fc93b | 2007-08-15 09:47:49 +0000 | [diff] [blame] | 258 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 259 | TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) |
Bernhard Reutner-Fischer | 3b08e64 | 2007-09-18 13:12:25 +0000 | [diff] [blame] | 260 | TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS)) |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 261 | TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) |
Bernhard Reutner-Fischer | b3efde2 | 2007-09-01 17:10:55 +0000 | [diff] [blame] | 262 | TARGETS_ALL:=$(patsubst %,__real_tgt_%,$(TARGETS)) |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 263 | # all targets depend on the crosscompiler and it's prerequisites |
Bernhard Reutner-Fischer | b3efde2 | 2007-09-01 17:10:55 +0000 | [diff] [blame] | 264 | $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) % |
Bernhard Reutner-Fischer | acc706b | 2007-07-23 11:29:38 +0000 | [diff] [blame] | 265 | |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 266 | $(BR2_DEPENDS_DIR): .config |
| 267 | rm -rf $@ |
Bernhard Reutner-Fischer | b3efde2 | 2007-09-01 17:10:55 +0000 | [diff] [blame] | 268 | mkdir -p $(@D) |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 269 | cp -dpRf $(CONFIG)/buildroot-config $@ |
| 270 | |
Bernhard Reutner-Fischer | 5ef9e52 | 2007-07-27 14:57:34 +0000 | [diff] [blame] | 271 | dirs: $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 272 | $(BR2_DEPENDS_DIR) \ |
Bernhard Reutner-Fischer | 5ef9e52 | 2007-07-27 14:57:34 +0000 | [diff] [blame] | 273 | $(BINARIES_DIR) $(PROJECT_BUILD_DIR) |
Ulf Samuelsson | f958d89 | 2007-08-14 07:45:01 +0000 | [diff] [blame] | 274 | |
Bernhard Reutner-Fischer | 5ef9e52 | 2007-07-27 14:57:34 +0000 | [diff] [blame] | 275 | $(BASE_TARGETS): dirs |
Ulf Samuelsson | f958d89 | 2007-08-14 07:45:01 +0000 | [diff] [blame] | 276 | |
Bernhard Reutner-Fischer | b3efde2 | 2007-09-01 17:10:55 +0000 | [diff] [blame] | 277 | world: dependencies dirs target-host-info $(BASE_TARGETS) $(TARGETS_ALL) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 278 | |
Bernhard Reutner-Fischer | 5ef9e52 | 2007-07-27 14:57:34 +0000 | [diff] [blame] | 279 | |
Ulf Samuelsson | f958d89 | 2007-08-14 07:45:01 +0000 | [diff] [blame] | 280 | .PHONY: all world dirs clean dirclean distclean source \ |
Bernhard Reutner-Fischer | b3efde2 | 2007-09-01 17:10:55 +0000 | [diff] [blame] | 281 | $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \ |
Eric Andersen | 747b16d | 2004-12-11 10:33:19 +0000 | [diff] [blame] | 282 | $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \ |
Bernhard Reutner-Fischer | 5ef9e52 | 2007-07-27 14:57:34 +0000 | [diff] [blame] | 283 | $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 284 | $(BR2_DEPENDS_DIR) \ |
Bernhard Reutner-Fischer | 5ef9e52 | 2007-07-27 14:57:34 +0000 | [diff] [blame] | 285 | $(BINARIES_DIR) $(PROJECT_BUILD_DIR) |
Jon Nelson | c79e998 | 2002-01-05 20:26:15 +0000 | [diff] [blame] | 286 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 287 | ############################################################# |
| 288 | # |
Eric Andersen | ef407d3 | 2004-01-29 23:21:00 +0000 | [diff] [blame] | 289 | # staging and target directories do NOT list these as |
Mike Frysinger | d99c31c | 2006-05-26 01:18:09 +0000 | [diff] [blame] | 290 | # dependencies anywhere else |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 291 | # |
| 292 | ############################################################# |
Bernhard Reutner-Fischer | 5ef9e52 | 2007-07-27 14:57:34 +0000 | [diff] [blame] | 293 | $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) \ |
Ulf Samuelsson | c6771df | 2007-08-16 05:44:55 +0000 | [diff] [blame] | 294 | $(PROJECT_BUILD_DIR) $(BINARIES_DIR): |
Bernhard Reutner-Fischer | 8d583fc | 2007-01-30 00:58:18 +0000 | [diff] [blame] | 295 | @mkdir -p $@ |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 296 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 297 | $(STAGING_DIR): |
"Steven J. Hill" | 9c865d7 | 2007-05-07 03:56:47 +0000 | [diff] [blame] | 298 | @mkdir -p $(STAGING_DIR)/bin |
Eric Andersen | bf38723 | 2004-12-11 10:35:18 +0000 | [diff] [blame] | 299 | @mkdir -p $(STAGING_DIR)/lib |
Bernhard Reutner-Fischer | 7e0c890 | 2007-06-24 12:27:08 +0000 | [diff] [blame] | 300 | ifeq ($(BR2_TOOLCHAIN_SYSROOT),y) |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 301 | @mkdir -p $(STAGING_DIR)/usr/lib |
| 302 | else |
Ulf Samuelsson | f5905dc | 2007-10-07 18:23:43 +0000 | [diff] [blame] | 303 | ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y) |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 304 | @ln -snf . $(STAGING_DIR)/usr |
| 305 | @mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME) |
Eric Andersen | 3da708e | 2007-01-10 06:55:27 +0000 | [diff] [blame] | 306 | @ln -snf ../lib $(STAGING_DIR)/usr/lib |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 307 | @ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib |
| 308 | endif |
Ulf Samuelsson | f5905dc | 2007-10-07 18:23:43 +0000 | [diff] [blame] | 309 | endif |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 310 | @mkdir -p $(STAGING_DIR)/usr/include |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 311 | |
Ulf Samuelsson | c6771df | 2007-08-16 05:44:55 +0000 | [diff] [blame] | 312 | $(PROJECT_BUILD_DIR)/.root: |
Bernhard Reutner-Fischer | 7547c7e | 2007-08-21 10:53:39 +0000 | [diff] [blame] | 313 | mkdir -p $(TARGET_DIR) |
Bernhard Reutner-Fischer | f0ca4b8 | 2007-08-21 10:56:38 +0000 | [diff] [blame] | 314 | if ! [ -d "$(TARGET_DIR)/bin" ]; then \ |
| 315 | if [ -d "$(TARGET_SKELETON)" ]; then \ |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 316 | cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \ |
Ulf Samuelsson | 74cda1e | 2007-08-14 07:24:45 +0000 | [diff] [blame] | 317 | fi; \ |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 318 | touch $(STAGING_DIR)/.fakeroot.00000; \ |
Bernhard Reutner-Fischer | f0ca4b8 | 2007-08-21 10:56:38 +0000 | [diff] [blame] | 319 | fi |
Peter Korsgaard | e013773 | 2008-03-30 20:52:33 +0000 | [diff] [blame] | 320 | -find $(TARGET_DIR) -type d -name CVS -o -name .svn | xargs rm -rf |
Peter Korsgaard | 6a262b1 | 2008-03-30 20:48:13 +0000 | [diff] [blame] | 321 | -find $(TARGET_DIR) -type f -name .empty | xargs rm -rf |
Bernhard Reutner-Fischer | 7547c7e | 2007-08-21 10:53:39 +0000 | [diff] [blame] | 322 | touch $@ |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 323 | |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 324 | $(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root |
Ulf Samuelsson | c6771df | 2007-08-16 05:44:55 +0000 | [diff] [blame] | 325 | |
Ulf Samuelsson | c2fc93b | 2007-08-15 09:47:49 +0000 | [diff] [blame] | 326 | erase-fakeroots: |
Ulf Samuelsson | 5d2be04 | 2007-08-16 18:19:42 +0000 | [diff] [blame] | 327 | rm -f $(PROJECT_BUILD_DIR)/.fakeroot* |
Ulf Samuelsson | 412ca2a | 2007-07-12 13:11:03 +0000 | [diff] [blame] | 328 | |
John Voltz | bc67ca2 | 2008-03-10 15:22:43 +0000 | [diff] [blame] | 329 | target-devfiles: |
John Voltz | d45de0c | 2008-03-11 13:12:39 +0000 | [diff] [blame] | 330 | ifeq ($(BR2_HAVE_DEVFILES),y) |
| 331 | ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) ) |
John Voltz | bc67ca2 | 2008-03-10 15:22:43 +0000 | [diff] [blame] | 332 | else |
| 333 | rm -rf $(TARGET_DIR)/usr/include |
John Voltz | d45de0c | 2008-03-11 13:12:39 +0000 | [diff] [blame] | 334 | find $(TARGET_DIR)/usr/lib -name '*.a' -delete |
| 335 | find $(TARGET_DIR)/lib -name '*.a' -delete |
| 336 | find $(TARGET_DIR)/usr/lib -name '*.la' -delete |
| 337 | find $(TARGET_DIR)/lib -name '*.la' -delete |
John Voltz | bc67ca2 | 2008-03-10 15:22:43 +0000 | [diff] [blame] | 338 | endif |
| 339 | |
Bernhard Reutner-Fischer | 3b08e64 | 2007-09-18 13:12:25 +0000 | [diff] [blame] | 340 | source: $(TARGETS_SOURCE) $(HOST_SOURCE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 341 | |
Bernhard Reutner-Fischer | 6547bce | 2007-08-22 12:35:41 +0000 | [diff] [blame] | 342 | _source-check: |
Ulf Samuelsson | e7c08c2 | 2007-07-20 07:34:28 +0000 | [diff] [blame] | 343 | $(MAKE) SPIDER=--spider source |
Bernhard Reutner-Fischer | 825ff34 | 2007-06-07 12:57:03 +0000 | [diff] [blame] | 344 | |
Peter Korsgaard | 155971e | 2008-03-04 12:19:16 +0000 | [diff] [blame] | 345 | external-deps: |
| 346 | @$(MAKE) -Bs BR2_WGET=$(TOPDIR)toolchain/wget-show-external-deps.sh \ |
| 347 | source |
| 348 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 349 | ############################################################# |
| 350 | # |
| 351 | # Cleanup and misc junk |
| 352 | # |
| 353 | ############################################################# |
| 354 | clean: $(TARGETS_CLEAN) |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 355 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 356 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 357 | dirclean: $(TARGETS_DIRCLEAN) |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 358 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 359 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 360 | distclean: |
Mike Frysinger | 5bc1f0c | 2005-09-09 02:49:10 +0000 | [diff] [blame] | 361 | ifeq ($(DL_DIR),$(BASE_DIR)/dl) |
| 362 | rm -rf $(DL_DIR) |
| 363 | endif |
Bernhard Reutner-Fischer | 6547bce | 2007-08-22 12:35:41 +0000 | [diff] [blame] | 364 | rm -rf $(BUILD_DIR) $(PROJECT_BUILD_DIR) $(BINARIES_DIR) \ |
Ulf Samuelsson | 412ca2a | 2007-07-12 13:11:03 +0000 | [diff] [blame] | 365 | $(LINUX_KERNEL) $(IMAGE) $(BASE_DIR)/include \ |
Bernhard Reutner-Fischer | 81df226 | 2007-07-09 08:06:27 +0000 | [diff] [blame] | 366 | .config.cmd |
Bernhard Reutner-Fischer | b513619 | 2007-01-19 18:00:49 +0000 | [diff] [blame] | 367 | $(MAKE) -C $(CONFIG) clean |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 368 | |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 369 | sourceball: |
Bernhard Reutner-Fischer | 6547bce | 2007-08-22 12:35:41 +0000 | [diff] [blame] | 370 | rm -rf $(BUILD_DIR) $(PROJECT_BUILD_DIR) $(BINARIES_DIR) |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 371 | set -e; \ |
| 372 | cd ..; \ |
| 373 | rm -f buildroot.tar.bz2; \ |
| 374 | tar -cvf buildroot.tar buildroot; \ |
| 375 | bzip2 -9 buildroot.tar; \ |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 376 | |
| 377 | |
Bernhard Reutner-Fischer | cfe511b | 2007-09-29 13:58:30 +0000 | [diff] [blame] | 378 | else # ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 379 | |
| 380 | all: menuconfig |
| 381 | |
| 382 | # configuration |
| 383 | # --------------------------------------------------------------------------- |
| 384 | |
Bernhard Reutner-Fischer | c0d7d4e | 2007-07-09 18:23:20 +0000 | [diff] [blame] | 385 | HOSTCFLAGS=$(CFLAGS_FOR_BUILD) |
| 386 | export HOSTCFLAGS |
| 387 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 388 | $(CONFIG)/conf: |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 389 | @mkdir -p $(CONFIG)/buildroot-config |
Bernhard Reutner-Fischer | fb2c8fe | 2007-07-27 14:16:00 +0000 | [diff] [blame] | 390 | $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 391 | -@if [ ! -f .config ]; then \ |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 392 | cp $(CONFIG_DEFCONFIG) .config; \ |
| 393 | fi |
| 394 | $(CONFIG)/mconf: |
Bernhard Reutner-Fischer | 1dbe6e3 | 2007-08-21 17:56:47 +0000 | [diff] [blame] | 395 | @mkdir -p $(CONFIG)/buildroot-config |
Bernhard Reutner-Fischer | fb2c8fe | 2007-07-27 14:16:00 +0000 | [diff] [blame] | 396 | $(MAKE) CC="$(HOSTCC)" -C $(CONFIG) conf mconf |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 397 | -@if [ ! -f .config ]; then \ |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 398 | cp $(CONFIG_DEFCONFIG) .config; \ |
| 399 | fi |
| 400 | |
| 401 | menuconfig: $(CONFIG)/mconf |
Bernhard Reutner-Fischer | 7b403ad | 2007-08-21 11:25:30 +0000 | [diff] [blame] | 402 | @mkdir -p $(CONFIG)/buildroot-config |
Bernhard Reutner-Fischer | 153b1be | 2007-07-27 12:37:30 +0000 | [diff] [blame] | 403 | @if ! KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
"Steven J. Hill" | 62b5ae4 | 2007-07-18 18:07:19 +0000 | [diff] [blame] | 404 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ |
Bernhard Reutner-Fischer | 153b1be | 2007-07-27 12:37:30 +0000 | [diff] [blame] | 405 | $(CONFIG)/mconf $(CONFIG_CONFIG_IN); then \ |
| 406 | test -f .config.cmd || rm -f .config; \ |
| 407 | fi |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 408 | |
| 409 | config: $(CONFIG)/conf |
Bernhard Reutner-Fischer | 7b403ad | 2007-08-21 11:25:30 +0000 | [diff] [blame] | 410 | @mkdir -p $(CONFIG)/buildroot-config |
"Steven J. Hill" | 62b5ae4 | 2007-07-18 18:07:19 +0000 | [diff] [blame] | 411 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
| 412 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 413 | $(CONFIG)/conf $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 414 | |
| 415 | oldconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | 7b403ad | 2007-08-21 11:25:30 +0000 | [diff] [blame] | 416 | @mkdir -p $(CONFIG)/buildroot-config |
"Steven J. Hill" | 62b5ae4 | 2007-07-18 18:07:19 +0000 | [diff] [blame] | 417 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
| 418 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 419 | $(CONFIG)/conf -o $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 420 | |
| 421 | randconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | 7b403ad | 2007-08-21 11:25:30 +0000 | [diff] [blame] | 422 | @mkdir -p $(CONFIG)/buildroot-config |
"Steven J. Hill" | 62b5ae4 | 2007-07-18 18:07:19 +0000 | [diff] [blame] | 423 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
| 424 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 425 | $(CONFIG)/conf -r $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 426 | |
| 427 | allyesconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 428 | cat $(CONFIG_DEFCONFIG) > .config |
Bernhard Reutner-Fischer | 7b403ad | 2007-08-21 11:25:30 +0000 | [diff] [blame] | 429 | @mkdir -p $(CONFIG)/buildroot-config |
"Steven J. Hill" | 62b5ae4 | 2007-07-18 18:07:19 +0000 | [diff] [blame] | 430 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
| 431 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 432 | $(CONFIG)/conf -y $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 433 | #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 434 | |
| 435 | allnoconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | 7b403ad | 2007-08-21 11:25:30 +0000 | [diff] [blame] | 436 | @mkdir -p $(CONFIG)/buildroot-config |
"Steven J. Hill" | 62b5ae4 | 2007-07-18 18:07:19 +0000 | [diff] [blame] | 437 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
| 438 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 439 | $(CONFIG)/conf -n $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 440 | |
| 441 | defconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | 7b403ad | 2007-08-21 11:25:30 +0000 | [diff] [blame] | 442 | @mkdir -p $(CONFIG)/buildroot-config |
"Steven J. Hill" | 62b5ae4 | 2007-07-18 18:07:19 +0000 | [diff] [blame] | 443 | @KCONFIG_AUTOCONFIG=$(CONFIG)/buildroot-config/auto.conf \ |
| 444 | KCONFIG_AUTOHEADER=$(CONFIG)/buildroot-config/autoconf.h \ |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 445 | $(CONFIG)/conf -d $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 446 | |
Bernhard Reutner-Fischer | 6547bce | 2007-08-22 12:35:41 +0000 | [diff] [blame] | 447 | # check if download URLs are outdated |
Bernhard Reutner-Fischer | 825ff34 | 2007-06-07 12:57:03 +0000 | [diff] [blame] | 448 | source-check: allyesconfig |
| 449 | $(MAKE) _source-check |
| 450 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 451 | ############################################################# |
| 452 | # |
| 453 | # Cleanup and misc junk |
| 454 | # |
| 455 | ############################################################# |
| 456 | clean: |
| 457 | rm -f .config .config.old .config.cmd .tmpconfig.h |
Bernhard Reutner-Fischer | 18d979c | 2007-09-01 18:21:09 +0000 | [diff] [blame] | 458 | -$(MAKE) -C $(CONFIG) clean |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 459 | |
| 460 | distclean: clean |
| 461 | rm -rf sources/* |
| 462 | |
Bernhard Reutner-Fischer | cfe511b | 2007-09-29 13:58:30 +0000 | [diff] [blame] | 463 | endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 464 | |
Bernhard Reutner-Fischer | ba2e7e0 | 2007-06-25 10:56:13 +0000 | [diff] [blame] | 465 | %_defconfig: $(CONFIG)/conf |
| 466 | cp $(shell find ./target/ -name $@) .config |
Ulf Samuelsson | 8820d63 | 2007-09-23 14:36:04 +0000 | [diff] [blame] | 467 | -@$(MAKE) oldconfig |
Bernhard Reutner-Fischer | ba2e7e0 | 2007-06-25 10:56:13 +0000 | [diff] [blame] | 468 | |
Ulf Samuelsson | 82c92e1 | 2008-03-30 06:29:30 +0000 | [diff] [blame] | 469 | update: |
| 470 | cp .config $(BOARD_PATH)/$(BOARD_NAME)_defconfig |
| 471 | |
Ulf Samuelsson | 5459a9c | 2007-09-28 19:43:26 +0000 | [diff] [blame] | 472 | configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config |
Ulf Samuelsson | b8f28d6 | 2007-09-28 16:18:16 +0000 | [diff] [blame] | 473 | |
| 474 | cross: $(BASE_TARGETS) |
| 475 | |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 476 | help: |
| 477 | @echo 'Cleaning:' |
| 478 | @echo ' clean - delete temporary files created by build' |
| 479 | @echo ' distclean - delete all non-source files (including .config)' |
| 480 | @echo |
| 481 | @echo 'Build:' |
| 482 | @echo ' all - make world' |
| 483 | @echo |
| 484 | @echo 'Configuration:' |
| 485 | @echo ' menuconfig - interactive curses-based configurator' |
| 486 | @echo ' oldconfig - resolve any unresolved symbols in .config' |
| 487 | @echo |
| 488 | @echo 'Miscellaneous:' |
| 489 | @echo ' source - download all sources needed for offline-build' |
Bernhard Reutner-Fischer | 0338040 | 2007-08-21 10:42:05 +0000 | [diff] [blame] | 490 | @echo ' source-check - check all packages for valid download URLs' |
Peter Korsgaard | 155971e | 2008-03-04 12:19:16 +0000 | [diff] [blame] | 491 | @echo ' external-deps - list external packages used' |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 492 | @echo |
Bernhard Reutner-Fischer | 232fa7e | 2007-08-27 21:51:27 +0000 | [diff] [blame] | 493 | @echo 'See docs/README and docs/buildroot.html for further details' |
Bernhard Reutner-Fischer | 663dee4 | 2007-08-27 21:40:42 +0000 | [diff] [blame] | 494 | @echo |
Bernhard Reutner-Fischer | ba2e7e0 | 2007-06-25 10:56:13 +0000 | [diff] [blame] | 495 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 496 | .PHONY: dummy subdirs release distclean clean config oldconfig \ |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 497 | menuconfig tags check test depend defconfig help |
Ulf Samuelsson | 633c8cb | 2007-09-17 12:49:46 +0000 | [diff] [blame] | 498 | |