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=./ |
| 25 | CONFIG_CONFIG_IN = Config.in |
| 26 | CONFIG_DEFCONFIG = .defconfig |
| 27 | CONFIG = package/config |
| 28 | |
| 29 | noconfig_targets := menuconfig config oldconfig randconfig \ |
"Steven J. Hill" | 0c1e709 | 2006-06-22 02:24:08 +0000 | [diff] [blame] | 30 | defconfig allyesconfig allnoconfig release tags \ |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 31 | source-check help |
Bernhard Reutner-Fischer | 9e25035 | 2006-12-02 19:01:10 +0000 | [diff] [blame] | 32 | |
| 33 | # $(shell find . -name *_defconfig |sed 's/.*\///') |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 34 | |
| 35 | # Pull in the user's configuration file |
| 36 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) |
| 37 | -include $(TOPDIR).config |
| 38 | endif |
| 39 | |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 40 | # To put more focus on warnings, be less verbose as default |
| 41 | # Use 'make V=1' to see the full commands |
| 42 | ifdef V |
| 43 | ifeq ("$(origin V)", "command line") |
| 44 | KBUILD_VERBOSE = $(V) |
| 45 | endif |
| 46 | endif |
| 47 | ifndef KBUILD_VERBOSE |
| 48 | KBUILD_VERBOSE = 0 |
| 49 | endif |
| 50 | |
| 51 | ifeq ($(KBUILD_VERBOSE),1) |
Ulf Samuelsson | 4df454e | 2007-07-06 12:19:35 +0000 | [diff] [blame] | 52 | quiet= |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 53 | Q = |
| 54 | else |
| 55 | quiet=quiet_ |
| 56 | Q = @ |
| 57 | endif |
| 58 | |
| 59 | CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
| 60 | else if [ -x /bin/bash ]; then echo /bin/bash; \ |
| 61 | else echo sh; fi ; fi) |
| 62 | |
| 63 | export CONFIG_SHELL quiet Q KBUILD_VERBOSE |
| 64 | |
| 65 | ifndef HOSTAR |
| 66 | HOSTAR:=ar |
| 67 | endif |
| 68 | ifndef HOSTAS |
| 69 | HOSTAS:=as |
| 70 | endif |
| 71 | ifndef HOSTCC |
| 72 | HOSTCC:=gcc |
| 73 | else |
| 74 | endif |
| 75 | ifndef HOSTCXX |
| 76 | HOSTCXX:=g++ |
| 77 | endif |
| 78 | ifndef HOSTLD |
| 79 | HOSTLD:=ld |
| 80 | endif |
Ulf Samuelsson | 83832cd | 2007-07-09 04:26:49 +0000 | [diff] [blame] | 81 | HOSTAR :=$(shell $(CONFIG_SHELL) -c "which $(HOSTAR)" || type -p $(HOSTAR) || echo ar) |
| 82 | HOSTAS :=$(shell $(CONFIG_SHELL) -c "which $(HOSTAS)" || type -p $(HOSTAS) || echo as) |
| 83 | HOSTCC :=$(shell $(CONFIG_SHELL) -c "which $(HOSTCC)" || type -p $(HOSTCC) || echo gcc) |
| 84 | HOSTCXX:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCXX)" || type -p $(HOSTCXX) || echo g++) |
| 85 | HOSTLD :=$(shell $(CONFIG_SHELL) -c "which $(HOSTLD)" || type -p $(HOSTLD) || echo ld) |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 86 | ifndef CFLAGS_FOR_BUILD |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 87 | CFLAGS_FOR_BUILD:=-g -O2 |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 88 | endif |
| 89 | export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD |
| 90 | |
| 91 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 92 | ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 93 | |
Bernhard Reutner-Fischer | 99cf729 | 2007-02-12 13:38:06 +0000 | [diff] [blame] | 94 | # cc-option |
| 95 | # Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586) |
| 96 | # sets -march=winchip-c6 if supported else falls back to -march=i586 |
| 97 | # without checking the latter. |
| 98 | cc-option = $(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ |
| 99 | > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) |
| 100 | |
Peter Korsgaard | 2c64904 | 2007-06-19 15:19:27 +0000 | [diff] [blame] | 101 | ############################################################# |
| 102 | # |
| 103 | # Hide troublesome environment variables from sub processes |
| 104 | # |
| 105 | ############################################################# |
| 106 | unexport CROSS_COMPILE |
| 107 | unexport ARCH |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 108 | |
| 109 | ############################################################# |
| 110 | # |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 111 | # Setup the proper filename extensions for the host |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 112 | # |
| 113 | ############################################################## |
| 114 | ifneq ($(findstring linux,$(BR2_GNU_BUILD_SUFFIX)),) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 115 | HOST_EXEEXT:= |
| 116 | HOST_LIBEXT:=.a |
| 117 | HOST_SHREXT:=.so |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 118 | endif |
| 119 | ifneq ($(findstring apple,$(BR2_GNU_BUILD_SUFFIX)),) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 120 | HOST_EXEEXT:= |
| 121 | HOST_LIBEXT:=.a |
| 122 | HOST_SHREXT:=.dylib |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 123 | endif |
| 124 | ifneq ($(findstring cygwin,$(BR2_GNU_BUILD_SUFFIX)),) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 125 | HOST_EXEEXT:=.exe |
| 126 | HOST_LIBEXT:=.lib |
| 127 | HOST_SHREXT:=.dll |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 128 | endif |
| 129 | ifneq ($(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)),) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 130 | HOST_EXEEXT:=.exe |
| 131 | HOST_LIBEXT:=.lib |
| 132 | HOST_SHREXT:=.dll |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 133 | endif |
| 134 | |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 135 | # The preferred type of libs we build for the target |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 136 | ifeq ($(BR2_PREFER_STATIC_LIB),y) |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 137 | LIBTGTEXT=.a |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 138 | #PREFERRED_LIB_FLAGS:=--disable-shared --enable-static |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 139 | else |
Bernhard Reutner-Fischer | c6e43c9 | 2007-06-02 11:22:17 +0000 | [diff] [blame] | 140 | LIBTGTEXT=.so |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 141 | #PREFERRED_LIB_FLAGS:=--disable-static --enable-shared |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 142 | endif |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 143 | PREFERRED_LIB_FLAGS:=--enable-static --enable-shared |
Bernhard Reutner-Fischer | 7dcbbfb | 2007-06-02 09:05:40 +0000 | [diff] [blame] | 144 | |
| 145 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 146 | ############################################################# |
| 147 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 148 | # The list of stuff to build for the target toolchain |
| 149 | # along with the packages to build for the target. |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 150 | # |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 151 | ############################################################## |
"Steven J. Hill" | 02f71aa | 2007-02-06 18:19:38 +0000 | [diff] [blame] | 152 | ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) |
Eric Andersen | 98bc6da | 2006-07-18 23:43:58 +0000 | [diff] [blame] | 153 | TARGETS:=uclibc-configured binutils gcc uclibc-target-utils |
"Steven J. Hill" | 02f71aa | 2007-02-06 18:19:38 +0000 | [diff] [blame] | 154 | else |
| 155 | TARGETS:=uclibc |
| 156 | endif |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 157 | include toolchain/Makefile.in |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 158 | include package/Makefile.in |
Eric Andersen | 27bc59d | 2003-01-17 04:31:36 +0000 | [diff] [blame] | 159 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 160 | ############################################################# |
| 161 | # |
Eric Andersen | ef407d3 | 2004-01-29 23:21:00 +0000 | [diff] [blame] | 162 | # You should probably leave this stuff alone unless you know |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 163 | # what you are doing. |
| 164 | # |
| 165 | ############################################################# |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame] | 166 | |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 167 | all: world |
| 168 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 169 | # In this section, we need .config |
| 170 | include .config.cmd |
| 171 | |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 172 | # We also need the various per-package makefiles, which also add |
| 173 | # each selected package to TARGETS if that package was selected |
| 174 | # in the .config file. |
| 175 | include toolchain/*/*.mk |
| 176 | include package/*/*.mk |
Eric Andersen | d06645d | 2005-02-10 03:06:39 +0000 | [diff] [blame] | 177 | |
Eric Andersen | 79f5f1e | 2005-02-17 03:00:29 +0000 | [diff] [blame] | 178 | # target stuff is last so it can override anything else |
| 179 | include target/Makefile.in |
| 180 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 181 | TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) |
Eric Andersen | a5c2354 | 2003-02-19 08:56:04 +0000 | [diff] [blame] | 182 | TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS)) |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 183 | TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 184 | |
Bernhard Reutner-Fischer | 6e2823c | 2006-11-17 15:43:51 +0000 | [diff] [blame] | 185 | world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS) |
Bernhard Reutner-Fischer | 870cb9e | 2006-11-17 11:21:23 +0000 | [diff] [blame] | 186 | dirs: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 187 | |
Bernhard Reutner-Fischer | 870cb9e | 2006-11-17 11:21:23 +0000 | [diff] [blame] | 188 | .PHONY: all world dirs clean dirclean distclean source $(TARGETS) \ |
Eric Andersen | 747b16d | 2004-12-11 10:33:19 +0000 | [diff] [blame] | 189 | $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \ |
| 190 | $(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR) |
Jon Nelson | c79e998 | 2002-01-05 20:26:15 +0000 | [diff] [blame] | 191 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 192 | ############################################################# |
| 193 | # |
Eric Andersen | ef407d3 | 2004-01-29 23:21:00 +0000 | [diff] [blame] | 194 | # staging and target directories do NOT list these as |
Mike Frysinger | d99c31c | 2006-05-26 01:18:09 +0000 | [diff] [blame] | 195 | # dependencies anywhere else |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 196 | # |
| 197 | ############################################################# |
Bernhard Reutner-Fischer | 8d583fc | 2007-01-30 00:58:18 +0000 | [diff] [blame] | 198 | $(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR): |
| 199 | @mkdir -p $@ |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 200 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 201 | $(STAGING_DIR): |
"Steven J. Hill" | 9c865d7 | 2007-05-07 03:56:47 +0000 | [diff] [blame] | 202 | @mkdir -p $(STAGING_DIR)/bin |
Eric Andersen | bf38723 | 2004-12-11 10:35:18 +0000 | [diff] [blame] | 203 | @mkdir -p $(STAGING_DIR)/lib |
Bernhard Reutner-Fischer | 7e0c890 | 2007-06-24 12:27:08 +0000 | [diff] [blame] | 204 | ifeq ($(BR2_TOOLCHAIN_SYSROOT),y) |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 205 | @mkdir -p $(STAGING_DIR)/usr/lib |
| 206 | else |
| 207 | @ln -snf . $(STAGING_DIR)/usr |
| 208 | @mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME) |
Eric Andersen | 3da708e | 2007-01-10 06:55:27 +0000 | [diff] [blame] | 209 | @ln -snf ../lib $(STAGING_DIR)/usr/lib |
Bernhard Reutner-Fischer | 8027784 | 2007-06-20 11:26:36 +0000 | [diff] [blame] | 210 | @ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib |
| 211 | endif |
| 212 | @mkdir -p $(STAGING_DIR)/usr/include |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 213 | |
| 214 | $(TARGET_DIR): |
Eric Andersen | a4c685f | 2006-11-15 21:00:07 +0000 | [diff] [blame] | 215 | mkdir -p $(TARGET_DIR) |
Eric Andersen | ba70f94 | 2006-11-15 06:52:00 +0000 | [diff] [blame] | 216 | if [ -d "$(TARGET_SKELETON)" ] ; then \ |
| 217 | cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \ |
Eric Andersen | bb15c22 | 2005-02-17 18:21:20 +0000 | [diff] [blame] | 218 | fi; |
Eric Andersen | 5418a92 | 2006-04-07 22:42:15 +0000 | [diff] [blame] | 219 | touch $(STAGING_DIR)/.fakeroot.00000 |
Eric Andersen | bb15c22 | 2005-02-17 18:21:20 +0000 | [diff] [blame] | 220 | -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf |
| 221 | -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 222 | |
Bernhard Reutner-Fischer | 73be7f9 | 2007-04-06 16:36:48 +0000 | [diff] [blame] | 223 | source: $(TARGETS_SOURCE) $(HOST_SOURCE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 224 | |
Bernhard Reutner-Fischer | 825ff34 | 2007-06-07 12:57:03 +0000 | [diff] [blame] | 225 | .config.check: dependencies |
| 226 | $(SED) '/BR2_WGET/s/\"$$/ --spider\"/g' .config |
| 227 | touch $@ |
| 228 | |
| 229 | _source-check: .config.check |
| 230 | $(MAKE) source |
| 231 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 232 | ############################################################# |
| 233 | # |
| 234 | # Cleanup and misc junk |
| 235 | # |
| 236 | ############################################################# |
| 237 | clean: $(TARGETS_CLEAN) |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 238 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 239 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 240 | dirclean: $(TARGETS_DIRCLEAN) |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 241 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 242 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 243 | distclean: |
Mike Frysinger | 5bc1f0c | 2005-09-09 02:49:10 +0000 | [diff] [blame] | 244 | ifeq ($(DL_DIR),$(BASE_DIR)/dl) |
| 245 | rm -rf $(DL_DIR) |
| 246 | endif |
Bernhard Reutner-Fischer | 81df226 | 2007-07-09 08:06:27 +0000 | [diff] [blame^] | 247 | rm -rf $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE) $(BASE_DIR)/include \ |
| 248 | .config.cmd |
Bernhard Reutner-Fischer | b513619 | 2007-01-19 18:00:49 +0000 | [diff] [blame] | 249 | $(MAKE) -C $(CONFIG) clean |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 250 | |
Manuel Novoa III | 3ad3d8a | 2004-09-03 00:49:43 +0000 | [diff] [blame] | 251 | sourceball: |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 252 | rm -rf $(BUILD_DIR) |
| 253 | set -e; \ |
| 254 | cd ..; \ |
| 255 | rm -f buildroot.tar.bz2; \ |
| 256 | tar -cvf buildroot.tar buildroot; \ |
| 257 | bzip2 -9 buildroot.tar; \ |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 258 | |
| 259 | |
| 260 | else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) |
| 261 | |
| 262 | all: menuconfig |
| 263 | |
| 264 | # configuration |
| 265 | # --------------------------------------------------------------------------- |
| 266 | |
| 267 | $(CONFIG)/conf: |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 268 | $(MAKE) CC="$(HOSTCC)" HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" MAKECMDGOALS="$(MAKECMDGOALS)" \ |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 269 | -C $(CONFIG) conf |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 270 | -@if [ ! -f .config ] ; then \ |
| 271 | cp $(CONFIG_DEFCONFIG) .config; \ |
| 272 | fi |
| 273 | $(CONFIG)/mconf: |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 274 | $(MAKE) CC="$(HOSTCC)" HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" MAKECMDGOALS="$(MAKECMDGOALS)" \ |
Bernhard Reutner-Fischer | afc61c6 | 2007-06-28 10:47:05 +0000 | [diff] [blame] | 275 | -C $(CONFIG) conf mconf |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 276 | -@if [ ! -f .config ] ; then \ |
| 277 | cp $(CONFIG_DEFCONFIG) .config; \ |
| 278 | fi |
| 279 | |
| 280 | menuconfig: $(CONFIG)/mconf |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 281 | @-mkdir -p include/config |
| 282 | @KCONFIG_AUTOCONFIG=include/config/auto.conf \ |
| 283 | KCONFIG_AUTOHEADER=include/autoconf.h \ |
| 284 | $(CONFIG)/mconf $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 285 | |
| 286 | config: $(CONFIG)/conf |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 287 | @-mkdir -p include/config |
| 288 | @KCONFIG_AUTOCONFIG=include/config/auto.conf \ |
| 289 | KCONFIG_AUTOHEADER=include/autoconf.h \ |
| 290 | $(CONFIG)/conf $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 291 | |
| 292 | oldconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 293 | @-mkdir -p include/config |
| 294 | @KCONFIG_AUTOCONFIG=include/config/auto.conf \ |
| 295 | KCONFIG_AUTOHEADER=include/autoconf.h \ |
| 296 | $(CONFIG)/conf -o $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 297 | |
| 298 | randconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 299 | @-mkdir -p include/config |
| 300 | @KCONFIG_AUTOCONFIG=include/config/auto.conf \ |
| 301 | KCONFIG_AUTOHEADER=include/autoconf.h \ |
| 302 | $(CONFIG)/conf -r $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 303 | |
| 304 | allyesconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 305 | cat $(CONFIG_DEFCONFIG) > .config |
| 306 | @-mkdir -p include/config |
| 307 | @KCONFIG_AUTOCONFIG=include/config/auto.conf \ |
| 308 | KCONFIG_AUTOHEADER=include/autoconf.h \ |
| 309 | $(CONFIG)/conf -y $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 310 | #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 311 | |
| 312 | allnoconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 313 | @-mkdir -p include/config |
| 314 | @KCONFIG_AUTOCONFIG=include/config/auto.conf \ |
| 315 | KCONFIG_AUTOHEADER=include/autoconf.h \ |
| 316 | $(CONFIG)/conf -n $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 317 | |
| 318 | defconfig: $(CONFIG)/conf |
Bernhard Reutner-Fischer | f987b7a | 2007-07-08 00:00:17 +0000 | [diff] [blame] | 319 | @-mkdir -p include/config |
| 320 | @KCONFIG_AUTOCONFIG=include/config/auto.conf \ |
| 321 | KCONFIG_AUTOHEADER=include/autoconf.h \ |
| 322 | $(CONFIG)/conf -d $(CONFIG_CONFIG_IN) |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 323 | |
Bernhard Reutner-Fischer | 825ff34 | 2007-06-07 12:57:03 +0000 | [diff] [blame] | 324 | # check if download URLs are outdated |
| 325 | source-check: allyesconfig |
| 326 | $(MAKE) _source-check |
| 327 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 328 | ############################################################# |
| 329 | # |
| 330 | # Cleanup and misc junk |
| 331 | # |
| 332 | ############################################################# |
| 333 | clean: |
| 334 | rm -f .config .config.old .config.cmd .tmpconfig.h |
| 335 | - $(MAKE) -C $(CONFIG) clean |
| 336 | |
| 337 | distclean: clean |
| 338 | rm -rf sources/* |
| 339 | |
| 340 | endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) |
| 341 | |
Bernhard Reutner-Fischer | ba2e7e0 | 2007-06-25 10:56:13 +0000 | [diff] [blame] | 342 | %_defconfig: $(CONFIG)/conf |
| 343 | cp $(shell find ./target/ -name $@) .config |
| 344 | @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN) |
| 345 | |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 346 | help: |
| 347 | @echo 'Cleaning:' |
| 348 | @echo ' clean - delete temporary files created by build' |
| 349 | @echo ' distclean - delete all non-source files (including .config)' |
| 350 | @echo |
| 351 | @echo 'Build:' |
| 352 | @echo ' all - make world' |
| 353 | @echo |
| 354 | @echo 'Configuration:' |
| 355 | @echo ' menuconfig - interactive curses-based configurator' |
| 356 | @echo ' oldconfig - resolve any unresolved symbols in .config' |
| 357 | @echo |
| 358 | @echo 'Miscellaneous:' |
| 359 | @echo ' source - download all sources needed for offline-build' |
| 360 | @echo ' source-check - check all packages for valid download URLS' |
| 361 | @echo |
Bernhard Reutner-Fischer | ba2e7e0 | 2007-06-25 10:56:13 +0000 | [diff] [blame] | 362 | |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 363 | .PHONY: dummy subdirs release distclean clean config oldconfig \ |
Bernhard Reutner-Fischer | e491fba | 2007-07-08 12:20:58 +0000 | [diff] [blame] | 364 | menuconfig tags check test depend defconfig help |
Eric Andersen | 2d523c2 | 2004-10-09 01:06:03 +0000 | [diff] [blame] | 365 | |
| 366 | |