Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 1 | # Makefile for a simple busybox/uClibc root filesystem |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 2 | # |
Eric Andersen | 03c3fa2 | 2003-01-03 06:44:03 +0000 | [diff] [blame] | 3 | # Copyright (C) 2001-2003 Erik Andersen <andersen@codepoet.org> |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 4 | # Copyright (C) 2002 by Tim Riker <Tim@Rikers.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 |
| 7 | # it under the terms of the GNU Library General Public License as |
| 8 | # published by the Free Software Foundation; either version 2 of the |
| 9 | # License, or (at your option) any later version. |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 10 | # |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 11 | # This program is distributed in the hope that it will be useful, but |
| 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | # Library General Public License for more details. |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 15 | # |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 16 | # You should have received a copy of the GNU Library General Public |
| 17 | # License along with this program; if not, write to the Free Software |
| 18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 19 | # USA |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 20 | |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 21 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 22 | ############################################################# |
| 23 | # |
| 24 | # EDIT this stuff to suit your system and preferences |
| 25 | # |
| 26 | # Use := when possible to get precomputation, thereby |
| 27 | # speeding up the build process. |
| 28 | # |
| 29 | ############################################################# |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 30 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 31 | # What sortof target system shall we compile this for? |
| 32 | ARCH:=i386 |
| 33 | #ARCH:=arm |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 34 | #ARCH:=mipsel |
| 35 | #ARCH:=mips |
Eric Andersen | 27bc59d | 2003-01-17 04:31:36 +0000 | [diff] [blame] | 36 | #ARCH:=powerpc |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 37 | #ARCH:=whatever |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 38 | |
Eric Andersen | 95f81a5 | 2002-07-03 10:44:59 +0000 | [diff] [blame] | 39 | # enable to build a native gcc toolchain with uclibc support |
Eric Andersen | 5a9f7f2 | 2002-08-28 22:38:39 +0000 | [diff] [blame] | 40 | USE_UCLIBC_TOOLCHAIN:=true |
Eric Andersen | 95f81a5 | 2002-07-03 10:44:59 +0000 | [diff] [blame] | 41 | |
Eric Andersen | 18e33c2 | 2003-02-04 12:37:32 +0000 | [diff] [blame] | 42 | # If you are building a native gcc toolchain, do you want to |
| 43 | # build the old gcc-2.95 based toolchain, or would you prefer |
| 44 | # a nice and shiny new gcc-3.2.1 toolchain? |
| 45 | GCC_2_95_TOOLCHAIN:=false |
| 46 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 47 | # Enable this to use the uClibc daily snapshot instead of a released |
| 48 | # version. Daily snapshots may contain new features and bugfixes. Or |
Eric Andersen | 95f81a5 | 2002-07-03 10:44:59 +0000 | [diff] [blame] | 49 | # they may not even compile at all, depending on what Erik is doing... |
Eric Andersen | d906413 | 2003-04-26 02:59:09 +0000 | [diff] [blame] | 50 | USE_UCLIBC_SNAPSHOT:=true |
Jon Nelson | c38dccc | 2002-01-03 04:51:43 +0000 | [diff] [blame] | 51 | |
Eric Andersen | 085ba9f | 2002-04-26 21:20:45 +0000 | [diff] [blame] | 52 | # Enable this to use the busybox daily snapshot instead of a released |
| 53 | # version. Daily snapshots may contain new features and bugfixes. Or |
| 54 | # they may not even compile at all.... |
Eric Andersen | 26da803 | 2003-06-04 20:49:24 +0000 | [diff] [blame] | 55 | USE_BUSYBOX_SNAPSHOT:=true |
Eric Andersen | 085ba9f | 2002-04-26 21:20:45 +0000 | [diff] [blame] | 56 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 57 | # Enable large file (files > 2 GB) support |
Eric Andersen | 03c3fa2 | 2003-01-03 06:44:03 +0000 | [diff] [blame] | 58 | BUILD_WITH_LARGEFILE:=true |
Jon Nelson | c38dccc | 2002-01-03 04:51:43 +0000 | [diff] [blame] | 59 | |
Eric Andersen | 8a2597e | 2002-11-20 23:16:10 +0000 | [diff] [blame] | 60 | # Command used to download source code |
| 61 | WGET:=wget --passive-ftp |
| 62 | |
Eric Andersen | 27bc59d | 2003-01-17 04:31:36 +0000 | [diff] [blame] | 63 | # Optimize toolchain for which type of CPU? |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 64 | OPTIMIZE_FOR_CPU=$(ARCH) |
| 65 | #OPTIMIZE_FOR_CPU=i486 |
| 66 | #OPTIMIZE_FOR_CPU=strongarm |
| 67 | #OPTIMIZE_FOR_CPU=whatever |
Eric Andersen | 27bc59d | 2003-01-17 04:31:36 +0000 | [diff] [blame] | 68 | |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 69 | # Soft floating point options. |
| 70 | # Notes: |
| 71 | # Currently builds with gcc 3.3 for i386, arm, mips, mipsel. |
| 72 | # Only tested with multilib enabled. |
| 73 | # For i386, long double is the same as double (64 bits). While this |
| 74 | # is unusual for x86, it seemed the best approach considering the |
| 75 | # limitations in the gcc floating point emulation library. |
| 76 | # For arm, soft float uses the usual libfloat routines. |
| 77 | # The uClibc built will support _only_ applications compiled with the |
| 78 | # -msoft-float flag. To avoid CFLAGS problems, you may want to use |
| 79 | # scripts similar to those in the build*/staging_dir/bin directory. |
| 80 | # Uncomment the next 2 lines to build a soft-float toolchain and rootfs. |
| 81 | # SOFT_FLOAT_CONFIG_OPTION=--without-float |
| 82 | # TARGET_SOFT_FLOAT=-msoft-float |
| 83 | |
| 84 | TARGET_OPTIMIZATION=-Os |
| 85 | TARGET_DEBUGGING= #-g |
| 86 | TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_SOFT_FLOAT) |
| 87 | |
Eric Andersen | 27bc59d | 2003-01-17 04:31:36 +0000 | [diff] [blame] | 88 | # Any additional gcc options you may want to include.... |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 89 | EXTRA_GCC_CONFIG_OPTIONS= |
Eric Andersen | 27bc59d | 2003-01-17 04:31:36 +0000 | [diff] [blame] | 90 | |
Eric Andersen | cb7d5b8 | 2003-09-14 11:38:35 +0000 | [diff] [blame] | 91 | # Enable the following if you want locale/gettext/i18n support. |
| 92 | #ENABLE_LOCALE:=true |
| 93 | ENABLE_LOCALE:=false |
| 94 | |
| 95 | # If you want multilib enabled, enable this... |
| 96 | MULTILIB:=--enable-multilib |
| 97 | |
| 98 | #Install libstdc++? |
| 99 | INSTALL_LIBSTDCPP=true |
Manuel Novoa III | 0e956fc | 2003-09-03 07:18:18 +0000 | [diff] [blame] | 100 | |
Eric Andersen | 02bf581 | 2003-10-18 11:09:54 +0000 | [diff] [blame] | 101 | # For SMP machines some stuff can be run in parallel |
| 102 | #JLEVEL=-j3 |
| 103 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 104 | ############################################################# |
| 105 | # |
| 106 | # The list of stuff to build for the target filesystem |
| 107 | # |
| 108 | ############################################################# |
Eric Andersen | cb7d5b8 | 2003-09-14 11:38:35 +0000 | [diff] [blame] | 109 | TARGETS:= |
Eric Andersen | 03c3fa2 | 2003-01-03 06:44:03 +0000 | [diff] [blame] | 110 | # The toolchain comes next if we are building one |
| 111 | ifeq ($(USE_UCLIBC_TOOLCHAIN),true) |
Eric Andersen | a0aef7c | 2003-09-26 21:18:46 +0000 | [diff] [blame] | 112 | ifeq ($(GCC_2_95_TOOLCHAIN),true) |
| 113 | TARGETS+=binutils uclibc-configured gcc2_95 |
| 114 | else |
Eric Andersen | cb7d5b8 | 2003-09-14 11:38:35 +0000 | [diff] [blame] | 115 | TARGETS+=binutils uclibc-configured gcc3_3 |
Eric Andersen | a0aef7c | 2003-09-26 21:18:46 +0000 | [diff] [blame] | 116 | endif |
Eric Andersen | cb7d5b8 | 2003-09-14 11:38:35 +0000 | [diff] [blame] | 117 | else |
| 118 | TARGETS+=uclibc |
Eric Andersen | 03c3fa2 | 2003-01-03 06:44:03 +0000 | [diff] [blame] | 119 | endif |
| 120 | |
Eric Andersen | cb7d5b8 | 2003-09-14 11:38:35 +0000 | [diff] [blame] | 121 | # Do you want user mode Linux (x86 only), or are you building a |
| 122 | # your own kernel that will run on its own? Perhaps you have a |
Eric Andersen | 4edbe2c | 2003-01-15 10:20:58 +0000 | [diff] [blame] | 123 | # kernel you have already configured and you want to use that? |
Eric Andersen | cb7d5b8 | 2003-09-14 11:38:35 +0000 | [diff] [blame] | 124 | # The default is to just use a set of known working kernel |
| 125 | # headers. Unless you want to build a kernel, I recommend just |
| 126 | # using that... |
| 127 | TARGETS+=kernel-headers |
Eric Andersen | 5455b5e | 2003-01-06 15:40:38 +0000 | [diff] [blame] | 128 | #TARGETS+=linux |
Eric Andersen | 5eb4604 | 2003-03-04 07:14:03 +0000 | [diff] [blame] | 129 | #TARGETS+=user-mode-linux |
Eric Andersen | 59759b8 | 2003-09-10 13:04:12 +0000 | [diff] [blame] | 130 | #TARGETS+=system-linux |
Eric Andersen | 5455b5e | 2003-01-06 15:40:38 +0000 | [diff] [blame] | 131 | |
Eric Andersen | cad5810 | 2002-11-14 12:16:04 +0000 | [diff] [blame] | 132 | # The default minimal set |
Eric Andersen | b8a2361 | 2002-12-12 01:57:57 +0000 | [diff] [blame] | 133 | TARGETS+=busybox tinylogin |
Eric Andersen | cad5810 | 2002-11-14 12:16:04 +0000 | [diff] [blame] | 134 | |
| 135 | # Openssh... |
| 136 | #TARGETS+=zlib openssl openssh |
Eric Andersen | 59759b8 | 2003-09-10 13:04:12 +0000 | [diff] [blame] | 137 | # Dropbear sshd is much smaller than openssl + openssh |
| 138 | #TARGETS+=dropbear_sshd |
Eric Andersen | cad5810 | 2002-11-14 12:16:04 +0000 | [diff] [blame] | 139 | |
| 140 | # Everything needed to build a full uClibc development system! |
Eric Andersen | de85776 | 2003-02-12 10:45:37 +0000 | [diff] [blame] | 141 | #TARGETS+=coreutils findutils bash make diffutils patch sed |
Eric Andersen | a0aef7c | 2003-09-26 21:18:46 +0000 | [diff] [blame] | 142 | #TARGETS+=ed flex bison file gawk tar grep |
| 143 | |
| 144 | #If you want a development system, you probably want gcc built |
| 145 | # with uClibc so it can run within your dev system... |
| 146 | #TARGETS+=gcc2_95_target |
Eric Andersen | bc9faa3 | 2003-10-22 06:44:40 +0000 | [diff] [blame] | 147 | #TARGETS+=gcc3_3_target |
Eric Andersen | cad5810 | 2002-11-14 12:16:04 +0000 | [diff] [blame] | 148 | |
Eric Andersen | 7564033 | 2003-01-08 18:22:25 +0000 | [diff] [blame] | 149 | # Of course, if you are installing a development system, you |
| 150 | # may want some header files so you can compile stuff.... |
| 151 | #TARGETS+=ncurses-headers zlib-headers openssl-headers |
| 152 | |
Eric Andersen | b7d4f49 | 2003-01-09 02:34:10 +0000 | [diff] [blame] | 153 | # More development system stuff for those that want it |
| 154 | #TARGETS+=m4 autoconf automake libtool |
| 155 | |
Eric Andersen | 1369474 | 2003-06-28 02:02:47 +0000 | [diff] [blame] | 156 | # Perl |
| 157 | #TARGETS+=perl |
| 158 | |
Eric Andersen | cad5810 | 2002-11-14 12:16:04 +0000 | [diff] [blame] | 159 | # Some nice debugging tools |
| 160 | #TARGETS+=gdb strace |
| 161 | |
Eric Andersen | 382187f | 2003-01-17 04:45:35 +0000 | [diff] [blame] | 162 | # The Valgrind debugger (x86 only) |
Eric Andersen | cad5810 | 2002-11-14 12:16:04 +0000 | [diff] [blame] | 163 | #TARGETS+=valgrind |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 164 | |
Eric Andersen | 9741a49 | 2003-01-19 07:49:24 +0000 | [diff] [blame] | 165 | # Some stuff for access points and firewalls |
Eric Andersen | c8eea31 | 2003-02-19 07:07:53 +0000 | [diff] [blame] | 166 | #TARGETS+=iptables hostap wtools dhcp_relay bridge |
Eric Andersen | 26da803 | 2003-06-04 20:49:24 +0000 | [diff] [blame] | 167 | #TARGETS+=iproute2 netsnmp |
Eric Andersen | 9741a49 | 2003-01-19 07:49:24 +0000 | [diff] [blame] | 168 | |
Eric Andersen | 54e098e | 2003-01-18 21:52:46 +0000 | [diff] [blame] | 169 | # Run customize.mk at the very end to add your own special config. |
| 170 | # This is useful for making your own distro within the buildroot |
| 171 | # process. |
| 172 | # TARGETS+=customize |
| 173 | |
| 174 | ############################################################# |
| 175 | # |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 176 | # Pick your root filesystem type. |
Eric Andersen | 54e098e | 2003-01-18 21:52:46 +0000 | [diff] [blame] | 177 | # |
| 178 | ############################################################# |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 179 | TARGETS+=ext2root |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 180 | |
Eric Andersen | 27bc59d | 2003-01-17 04:31:36 +0000 | [diff] [blame] | 181 | # Must mount cramfs with 'ramdisk_blocksize=4096' |
| 182 | #TARGETS+=cramfsroot |
| 183 | |
| 184 | # You may need to edit make/jffs2root.mk to change target |
| 185 | # endian-ness or similar, but this is sufficient for most |
| 186 | # things as-is... |
| 187 | #TARGETS+=jffs2root |
| 188 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 189 | ############################################################# |
| 190 | # |
| 191 | # You should probably leave this stuff alone unless you know |
| 192 | # what you are doing. |
| 193 | # |
| 194 | ############################################################# |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 195 | ifeq ("$(strip $(TARGET_SOFT_FLOAT))","") |
| 196 | ARCH_FPU_SUFFIX:= |
| 197 | else |
| 198 | ARCH_FPU_SUFFIX:=_nofpu |
| 199 | endif |
| 200 | |
| 201 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 202 | HOSTCC:=gcc |
Eric Andersen | 9741a49 | 2003-01-19 07:49:24 +0000 | [diff] [blame] | 203 | BASE_DIR:=${shell pwd} |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 204 | SOURCE_DIR:=$(BASE_DIR)/sources |
| 205 | DL_DIR:=$(SOURCE_DIR)/dl |
| 206 | PATCH_DIR=$(SOURCE_DIR)/patches |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 207 | BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)$(ARCH_FPU_SUFFIX) |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 208 | TARGET_DIR:=$(BUILD_DIR)/root |
Eric Andersen | 370fb2a | 2003-02-12 19:49:55 +0000 | [diff] [blame] | 209 | STAGING_DIR=$(BUILD_DIR)/staging_dir |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 210 | TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build_$(ARCH)$(ARCH_FPU_SUFFIX) |
Eric Andersen | 370fb2a | 2003-02-12 19:49:55 +0000 | [diff] [blame] | 211 | TARGET_PATH=$(STAGING_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 212 | #TARGET_CROSS=$(STAGING_DIR)/bin/$(ARCH)-uclibc- |
| 213 | TARGET_CROSS=$(STAGING_DIR)/bin/$(ARCH)-linux- |
| 214 | TARGET_CC=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) |
Eric Andersen | 370fb2a | 2003-02-12 19:49:55 +0000 | [diff] [blame] | 215 | STRIP=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note |
Eric Andersen | cad5810 | 2002-11-14 12:16:04 +0000 | [diff] [blame] | 216 | #STRIP:=/bin/true |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 217 | IMAGE:=$(BASE_DIR)/root_fs_$(ARCH)$(ARCH_FPU_SUFFIX) |
Eric Andersen | 370fb2a | 2003-02-12 19:49:55 +0000 | [diff] [blame] | 218 | GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 219 | #KERNEL_CROSS=$(STAGING_DIR)/bin/$(ARCH)-uclibc- |
| 220 | KERNEL_CROSS=$(STAGING_DIR)/bin/$(ARCH)-linux- |
Eric Andersen | 36830ba | 2003-03-04 07:56:11 +0000 | [diff] [blame] | 221 | HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \ |
| 222 | -e 's/sparc.*/sparc/' \ |
| 223 | -e 's/arm.*/arm/g' \ |
| 224 | -e 's/m68k.*/m68k/' \ |
| 225 | -e 's/ppc/powerpc/g' \ |
| 226 | -e 's/v850.*/v850/g' \ |
| 227 | -e 's/sh[234]/sh/' \ |
| 228 | -e 's/mips-.*/mips/' \ |
| 229 | -e 's/mipsel-.*/mipsel/' \ |
| 230 | -e 's/cris.*/cris/' \ |
Eric Andersen | 0554f62 | 2003-09-30 20:59:17 +0000 | [diff] [blame] | 231 | -e 's/i[3-9]86/i386/' \ |
Eric Andersen | 36830ba | 2003-03-04 07:56:11 +0000 | [diff] [blame] | 232 | ) |
| 233 | GNU_HOST_NAME:=$(HOST_ARCH)-pc-linux-gnu |
Eric Andersen | 1fc3f2f | 2003-03-04 19:16:19 +0000 | [diff] [blame] | 234 | TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \ |
| 235 | AR=$(TARGET_CROSS)ar \ |
| 236 | AS=$(TARGET_CROSS)as \ |
| 237 | LD=$(TARGET_CROSS)ld \ |
| 238 | NM=$(TARGET_CROSS)nm \ |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame^] | 239 | CC=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \ |
| 240 | GCC=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \ |
| 241 | CXX=$(TARGET_CROSS)g++$(TARGET_SOFT_FLOAT) \ |
Eric Andersen | 1fc3f2f | 2003-03-04 19:16:19 +0000 | [diff] [blame] | 242 | RANLIB=$(TARGET_CROSS)ranlib |
Eric Andersen | cb7d5b8 | 2003-09-14 11:38:35 +0000 | [diff] [blame] | 243 | ifeq ($(ENABLE_LOCALE),true) |
| 244 | DISABLE_NLS:= |
| 245 | else |
| 246 | DISABLE_NLS:=--disable-nls |
| 247 | endif |
| 248 | |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 249 | |
| 250 | all: world |
| 251 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 252 | TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) |
Eric Andersen | a5c2354 | 2003-02-19 08:56:04 +0000 | [diff] [blame] | 253 | TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS)) |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 254 | TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 255 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 256 | world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 257 | |
Eric Andersen | a5c2354 | 2003-02-19 08:56:04 +0000 | [diff] [blame] | 258 | .PHONY: all world clean dirclean distclean source $(TARGETS) \ |
| 259 | $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) |
Jon Nelson | c79e998 | 2002-01-05 20:26:15 +0000 | [diff] [blame] | 260 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 261 | include make/*.mk |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 262 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 263 | ############################################################# |
| 264 | # |
| 265 | # staging and target directories do NOT list these as |
| 266 | # dependancies anywhere else |
| 267 | # |
| 268 | ############################################################# |
| 269 | $(DL_DIR): |
| 270 | mkdir $(DL_DIR) |
| 271 | |
| 272 | $(BUILD_DIR): |
| 273 | mkdir $(BUILD_DIR) |
| 274 | |
| 275 | $(STAGING_DIR): |
| 276 | rm -rf $(STAGING_DIR) |
Eric Andersen | de2ae8d | 2003-02-12 09:59:22 +0000 | [diff] [blame] | 277 | mkdir -p $(STAGING_DIR)/lib |
| 278 | mkdir -p $(STAGING_DIR)/usr/lib |
| 279 | mkdir -p $(STAGING_DIR)/include |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 280 | |
| 281 | $(TARGET_DIR): |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 282 | rm -rf $(TARGET_DIR) |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 283 | zcat $(SOURCE_DIR)/skel.tar.gz | tar -C $(BUILD_DIR) -xf - |
| 284 | cp -a $(SOURCE_DIR)/target_skeleton/* $(TARGET_DIR)/ |
Eric Andersen | 339f2f4 | 2001-12-22 01:17:09 +0000 | [diff] [blame] | 285 | -find $(TARGET_DIR) -type d -name CVS -exec rm -rf {} \; > /dev/null 2>&1 |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 286 | |
Eric Andersen | a5c2354 | 2003-02-19 08:56:04 +0000 | [diff] [blame] | 287 | source: $(TARGETS_SOURCE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 288 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 289 | ############################################################# |
| 290 | # |
| 291 | # Cleanup and misc junk |
| 292 | # |
| 293 | ############################################################# |
| 294 | clean: $(TARGETS_CLEAN) |
| 295 | rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 296 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 297 | dirclean: $(TARGETS_DIRCLEAN) |
| 298 | rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 299 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 300 | distclean: |
| 301 | rm -rf $(DL_DIR) $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE) |
Eric Andersen | ffde94b | 2001-12-22 00:56:11 +0000 | [diff] [blame] | 302 | |
Eric Andersen | 08782ae | 2002-04-26 11:45:55 +0000 | [diff] [blame] | 303 | sourceball: |
| 304 | rm -rf $(BUILD_DIR) |
| 305 | set -e; \ |
| 306 | cd ..; \ |
| 307 | rm -f buildroot.tar.bz2; \ |
| 308 | tar -cvf buildroot.tar buildroot; \ |
| 309 | bzip2 -9 buildroot.tar; \ |