| 1 | # |
|---|
| 2 | # Makefile for floppyfw. |
|---|
| 3 | # As you can see, this is based on the buildroot/busybox/uClibc Make system. |
|---|
| 4 | # |
|---|
| 5 | # Changes are Copyright (C) 2003-2004 Thomas Lundquist <thomasez@zelow.no> |
|---|
| 6 | # |
|---|
| 7 | |
|---|
| 8 | # Makefile for a simple busybox/uClibc root filesystem |
|---|
| 9 | # |
|---|
| 10 | # Copyright (C) 2001-2003 Erik Andersen <andersen@codepoet.org> |
|---|
| 11 | # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org> |
|---|
| 12 | # |
|---|
| 13 | # This program is free software; you can redistribute it and/or modify |
|---|
| 14 | # it under the terms of the GNU Library General Public License as |
|---|
| 15 | # published by the Free Software Foundation; either version 2 of the |
|---|
| 16 | # License, or (at your option) any later version. |
|---|
| 17 | # |
|---|
| 18 | # This program is distributed in the hope that it will be useful, but |
|---|
| 19 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 21 | # Library General Public License for more details. |
|---|
| 22 | # |
|---|
| 23 | # You should have received a copy of the GNU Library General Public |
|---|
| 24 | # License along with this program; if not, write to the Free Software |
|---|
| 25 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|---|
| 26 | # USA |
|---|
| 27 | |
|---|
| 28 | # $Id: Makefile,v 1.31 2005/12/07 19:50:42 thomasez Exp $ |
|---|
| 29 | |
|---|
| 30 | ############################################################# |
|---|
| 31 | # |
|---|
| 32 | # EDIT this stuff to suit your system and preferences |
|---|
| 33 | # |
|---|
| 34 | # Use := when possible to get precomputation, thereby |
|---|
| 35 | # speeding up the build process. |
|---|
| 36 | # |
|---|
| 37 | ############################################################# |
|---|
| 38 | |
|---|
| 39 | # Which version of floppyfw is this? |
|---|
| 40 | FLOPPYFW_VERSION=2.99.5 |
|---|
| 41 | |
|---|
| 42 | # What sortof target system shall we compile this for? |
|---|
| 43 | ARCH:=i386 |
|---|
| 44 | #ARCH:=arm |
|---|
| 45 | #ARCH:=mips |
|---|
| 46 | #ARCH:=mipsel |
|---|
| 47 | #ARCH:=powerpc |
|---|
| 48 | #ARCH:=sh4 |
|---|
| 49 | #ARCH:=cris |
|---|
| 50 | #ARCH:=m68k |
|---|
| 51 | #ARCH:=v850 |
|---|
| 52 | #ARCH:=sparc |
|---|
| 53 | #ARCH:=sh64 |
|---|
| 54 | #ARCH:=whatever |
|---|
| 55 | |
|---|
| 56 | # If you want to add FPU/MATH emulation, set this to true; |
|---|
| 57 | # (Not implemented yet.) |
|---|
| 58 | EMULATE_FPU=false |
|---|
| 59 | |
|---|
| 60 | # Command used to download source code |
|---|
| 61 | WGET:=wget --passive-ftp |
|---|
| 62 | |
|---|
| 63 | # Optimize toolchain for which type of CPU? |
|---|
| 64 | # WARNING!!! CURRENTLY BROKEN!!! LEAVE IT AS $(ARCH)!!! |
|---|
| 65 | OPTIMIZE_FOR_CPU=$(ARCH) |
|---|
| 66 | # WARNING!!! CURRENTLY BROKEN!!! LEAVE IT AS $(ARCH)!!! |
|---|
| 67 | #OPTIMIZE_FOR_CPU=i486 |
|---|
| 68 | #OPTIMIZE_FOR_CPU=strongarm |
|---|
| 69 | #OPTIMIZE_FOR_CPU=whatever |
|---|
| 70 | |
|---|
| 71 | TARGET_OPTIMIZATION=-Os |
|---|
| 72 | TARGET_DEBUGGING= #-g |
|---|
| 73 | |
|---|
| 74 | # Any additional gcc options you may want to include.... |
|---|
| 75 | EXTRA_GCC_CONFIG_OPTIONS= |
|---|
| 76 | |
|---|
| 77 | # For SMP machines some stuff can be run in parallel |
|---|
| 78 | JLEVEL=-j2 |
|---|
| 79 | |
|---|
| 80 | # Sourceforge-mirror: |
|---|
| 81 | SF_MIRROR=http://voxel.dl.sourceforge.net |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | ############################################################# |
|---|
| 85 | # |
|---|
| 86 | # The list of stuff to build for the target filesystem |
|---|
| 87 | # |
|---|
| 88 | ############################################################# |
|---|
| 89 | |
|---|
| 90 | TARGETS+=uclibc |
|---|
| 91 | |
|---|
| 92 | # Probably a good thing even if you choose not to patch anything. |
|---|
| 93 | # This target only unpacks. The linux target does the patching. |
|---|
| 94 | TARGETS+=patch-o-matic |
|---|
| 95 | |
|---|
| 96 | # POM-patches to add: |
|---|
| 97 | # I could have used base but some of the patches has a problem. |
|---|
| 98 | # It's alot here, probably not so smart, cut back later. |
|---|
| 99 | POM_PATCHES=string h323-conntrack-nat quake3-conntrack-nat connlimit dstlimit mport pptp-conntrack-nat directx8-conntrack-nat time cuseeme-nat rtsp-conntrack iprange random ipp2p mms-conntrack-nat CONNMARK CLASSIFY |
|---|
| 100 | |
|---|
| 101 | # These are the ones from above minus those not in the newest p-o-m (plus a |
|---|
| 102 | # few nwe ones): |
|---|
| 103 | POM_PATCHES=h323-conntrack-nat quake3-conntrack-nat connlimit dstlimit mport pptp-conntrack-nat directx8-conntrack-nat time cuseeme-nat rtsp-conntrack iprange random ipp2p mms-conntrack-nat connrate msnp-conntrack-nat nth sip-conntrack-nat set expire psd time |
|---|
| 104 | # Did not apply cleanly: dropped-table tproxy |
|---|
| 105 | # |
|---|
| 106 | # Did not compile cleanly: |
|---|
| 107 | # policy: (ipt_policy.c:15:22: net/xfrm.h: No such file or directory) |
|---|
| 108 | # |
|---|
| 109 | # osf: (extensions/libipt_osf.c: In function `help': |
|---|
| 110 | # extensions/libipt_osf.c:46: warning: too many arguments for format |
|---|
| 111 | # extensions/libipt_osf.c: In function `parse': |
|---|
| 112 | # extensions/libipt_osf.c:107: error: `IPT_OSF_CONNECTOR' undeclared (first use in this function) |
|---|
| 113 | # extensions/libipt_osf.c:107: error: (Each undeclared identifier is reported only once |
|---|
| 114 | # ) |
|---|
| 115 | # |
|---|
| 116 | # Missing: string |
|---|
| 117 | |
|---|
| 118 | TARGETS+=linux |
|---|
| 119 | |
|---|
| 120 | TARGETS+=busybox |
|---|
| 121 | USE_BUSYBOX_SNAPSHOT=true |
|---|
| 122 | |
|---|
| 123 | TARGETS+=iptables |
|---|
| 124 | |
|---|
| 125 | TARGETS+=iproute2 |
|---|
| 126 | |
|---|
| 127 | TARGETS+=dnsmasq |
|---|
| 128 | |
|---|
| 129 | TARGETS+=bridgeutils |
|---|
| 130 | |
|---|
| 131 | # TARGETS+=modutils |
|---|
| 132 | |
|---|
| 133 | TARGETS+=pppd |
|---|
| 134 | |
|---|
| 135 | TARGETS+=pppoe |
|---|
| 136 | |
|---|
| 137 | TARGETS+=pcmcia |
|---|
| 138 | |
|---|
| 139 | TARGETS+=wireless-tools |
|---|
| 140 | |
|---|
| 141 | TARGETS+=dropbear |
|---|
| 142 | |
|---|
| 143 | TARGETS+=ethtool |
|---|
| 144 | |
|---|
| 145 | TARGETS+=e3 |
|---|
| 146 | |
|---|
| 147 | # This won't work, yet. It awaits a newer uClibc version. |
|---|
| 148 | # TARGETS+=noip2 |
|---|
| 149 | |
|---|
| 150 | TARGETS+=nanotop |
|---|
| 151 | |
|---|
| 152 | #TARGETS+=siproxd |
|---|
| 153 | |
|---|
| 154 | # The hostap target will add patches to the kernel and build a hostap.ffw |
|---|
| 155 | # package with hostapd, hostap-driver and wpa_supplicant and hostap-utils |
|---|
| 156 | # if you set it here. |
|---|
| 157 | # TARGETS+=hostap |
|---|
| 158 | # TARGETS+=hostap-utils |
|---|
| 159 | |
|---|
| 160 | # Not yet |
|---|
| 161 | # TARGETS+=ebtables |
|---|
| 162 | |
|---|
| 163 | # And at last: |
|---|
| 164 | TARGETS+=module-packages |
|---|
| 165 | TARGETS+=floppy |
|---|
| 166 | |
|---|
| 167 | ############################################################# |
|---|
| 168 | # |
|---|
| 169 | # You should probably leave this stuff alone unless you know |
|---|
| 170 | # what you are doing. |
|---|
| 171 | # |
|---|
| 172 | ############################################################# |
|---|
| 173 | |
|---|
| 174 | TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_SOFT_FLOAT) |
|---|
| 175 | # TARGET_CC=distcc gcc |
|---|
| 176 | TARGET_CC=gcc |
|---|
| 177 | TARGET_CX=g++ |
|---|
| 178 | |
|---|
| 179 | HOSTCC:=distcc gcc |
|---|
| 180 | BASE_DIR:=${shell pwd} |
|---|
| 181 | SOURCE_DIR:=$(BASE_DIR)/sources |
|---|
| 182 | SCRIPTS_DIR:=$(BASE_DIR)/scripts |
|---|
| 183 | CONFIG_DIR:=$(BASE_DIR)/configs |
|---|
| 184 | LICENSES_DIR:=$(BASE_DIR)/licenses |
|---|
| 185 | MODULES_BASE_DIR:=$(BASE_DIR)/modules |
|---|
| 186 | MODULES_DIR:=$(MODULES_BASE_DIR)/2.4-std |
|---|
| 187 | DL_DIR:=$(BASE_DIR)/downloads |
|---|
| 188 | PATCH_DIR=$(BASE_DIR)/patches |
|---|
| 189 | PACKAGES_DIR=$(BASE_DIR)/packages |
|---|
| 190 | PACKAGES_INI_DIR=$(PACKAGES_DIR)/scripts |
|---|
| 191 | PACKAGES_SKELETON_DIR=$(PACKAGES_DIR)/skeleton |
|---|
| 192 | INITRD_DIR=$(BASE_DIR)/initrd |
|---|
| 193 | INITRD_MASTER=$(INITRD_DIR)/master |
|---|
| 194 | ADD_DIR=$(BASE_DIR)/add |
|---|
| 195 | ADD_MASTER=$(ADD_DIR)/master |
|---|
| 196 | |
|---|
| 197 | TMP_DIR=$(BASE_DIR)/tmp |
|---|
| 198 | |
|---|
| 199 | # Need another name maybe? |
|---|
| 200 | BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)$(ARCH_FPU_SUFFIX) |
|---|
| 201 | |
|---|
| 202 | TARFLAGS=--format oldgnu |
|---|
| 203 | # This may be a problem to use but I'll try. |
|---|
| 204 | # --strip-unneeded |
|---|
| 205 | STRIP=strip --strip-unneeded -g --remove-section=.comment --remove-section=.note |
|---|
| 206 | SSTRIP=sstrip |
|---|
| 207 | DEPMOD=(cd $(LINUX_DIR) ; /sbin/depmod -ae -F System.map -b $(MODULES_DIR) \ |
|---|
| 208 | -r $(LINUX_VERSION)) |
|---|
| 209 | # SED=/bin/sed -i -e |
|---|
| 210 | SED=/usr/bin/perl -p -i -e |
|---|
| 211 | LZMAD=lzmacat |
|---|
| 212 | LZMAC=lzmacomp |
|---|
| 213 | MAKE=/usr/bin/make $(JLEVEL) |
|---|
| 214 | HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \ |
|---|
| 215 | -e 's/sparc.*/sparc/' \ |
|---|
| 216 | -e 's/arm.*/arm/g' \ |
|---|
| 217 | -e 's/m68k.*/m68k/' \ |
|---|
| 218 | -e 's/ppc/powerpc/g' \ |
|---|
| 219 | -e 's/v850.*/v850/g' \ |
|---|
| 220 | -e 's/sh[234]/sh/' \ |
|---|
| 221 | -e 's/mips-.*/mips/' \ |
|---|
| 222 | -e 's/mipsel-.*/mipsel/' \ |
|---|
| 223 | -e 's/cris.*/cris/' \ |
|---|
| 224 | -e 's/i[3-9]86/i386/' \ |
|---|
| 225 | ) |
|---|
| 226 | |
|---|
| 227 | GNU_HOST_NAME:=$(HOST_ARCH)-pc-linux-gnu |
|---|
| 228 | |
|---|
| 229 | all: world |
|---|
| 230 | |
|---|
| 231 | TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) |
|---|
| 232 | TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS)) |
|---|
| 233 | TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) |
|---|
| 234 | |
|---|
| 235 | world: $(ADD_MASTER) $(INITRD_MASTER) $(DL_DIR) $(TMP_DIR) $(BUILD_DIR) $(PACKAGES_DIR) $(TARGETS) |
|---|
| 236 | |
|---|
| 237 | .PHONY: all world clean dirclean distclean source $(TARGETS) \ |
|---|
| 238 | $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) |
|---|
| 239 | |
|---|
| 240 | include makefiles/*.mk |
|---|
| 241 | |
|---|
| 242 | ############################################################# |
|---|
| 243 | # |
|---|
| 244 | # staging and target directories do NOT list these as |
|---|
| 245 | # dependancies anywhere else |
|---|
| 246 | # |
|---|
| 247 | ############################################################# |
|---|
| 248 | $(TMP_DIR): |
|---|
| 249 | mkdir -p $(TMP_DIR) |
|---|
| 250 | |
|---|
| 251 | $(DL_DIR): |
|---|
| 252 | mkdir -p $(DL_DIR) |
|---|
| 253 | |
|---|
| 254 | $(BUILD_DIR): |
|---|
| 255 | mkdir -p $(BUILD_DIR) |
|---|
| 256 | |
|---|
| 257 | $(PACKAGES_DIR): |
|---|
| 258 | mkdir -p $(PACKAGES_DIR) |
|---|
| 259 | |
|---|
| 260 | $(MODULES_BASE_DIR): |
|---|
| 261 | mkdir -p $(MODULES_BASE_DIR) |
|---|
| 262 | |
|---|
| 263 | $(MODULES_DIR): |
|---|
| 264 | mkdir -p $(MODULES_DIR) |
|---|
| 265 | |
|---|
| 266 | $(ADD_MASTER): |
|---|
| 267 | cp -a $(ADD_DIR)/skeleton $(ADD_MASTER) |
|---|
| 268 | -find $(ADD_MASTER) -type d -name CVS -exec rm -rf {} \; > /dev/null 2>&1 |
|---|
| 269 | -find $(ADD_MASTER) -type d -name .svn -exec rm -rf {} \; > /dev/null 2>&1 |
|---|
| 270 | |
|---|
| 271 | $(INITRD_MASTER): |
|---|
| 272 | cp -a $(INITRD_DIR)/skeleton $(INITRD_MASTER) |
|---|
| 273 | -find $(INITRD_MASTER) -type d -name CVS -exec rm -rf {} \; > /dev/null 2>&1 |
|---|
| 274 | -find $(INITRD_MASTER) -type d -name .svn -exec rm -rf {} \; > /dev/null 2>&1 |
|---|
| 275 | |
|---|
| 276 | source: $(TARGETS_SOURCE) |
|---|
| 277 | |
|---|
| 278 | ############################################################# |
|---|
| 279 | # |
|---|
| 280 | # Cleanup and misc junk |
|---|
| 281 | # |
|---|
| 282 | # Fix later.. (yeah!) |
|---|
| 283 | # |
|---|
| 284 | ############################################################# |
|---|
| 285 | clean: $(TARGETS_CLEAN) |
|---|
| 286 | rm -rf $(INITRD_MASTER) $(ADD_MASTER) |
|---|
| 287 | |
|---|
| 288 | dirclean: $(TARGETS_DIRCLEAN) |
|---|
| 289 | rm -rf $(INITRD_MASTER) $(ADD_MASTER) |
|---|
| 290 | |
|---|
| 291 | distclean: |
|---|
| 292 | rm -rf $(DL_DIR) $(BUILD_DIR) |
|---|
| 293 | |
|---|
| 294 | sourceball: |
|---|
| 295 | rm -rf $(BUILD_DIR) |
|---|
| 296 | set -e; \ |
|---|
| 297 | cd ..; \ |
|---|
| 298 | rm -f buildroot.tar.bz2; \ |
|---|
| 299 | tar -cvf buildroot.tar buildroot; \ |
|---|
| 300 | bzip2 -9 buildroot.tar; \ |
|---|
| 301 | |
|---|
| 302 | list-targets: |
|---|
| 303 | @echo "TARGETS:" |
|---|
| 304 | @(for t in $(TARGETS); do \ |
|---|
| 305 | echo -e "\t$$t"; \ |
|---|
| 306 | done \ |
|---|
| 307 | ) |
|---|
| 308 | @echo "TARGETS_CLEAN:" |
|---|
| 309 | @(for t in $(TARGETS_CLEAN); do \ |
|---|
| 310 | echo -e "\t$$t"; \ |
|---|
| 311 | done \ |
|---|
| 312 | ) |
|---|
| 313 | @echo "TARGETS_DIRCLEAN:" |
|---|
| 314 | @(for t in $(TARGETS_DIRCLEAN); do \ |
|---|
| 315 | echo -e "\t$$t"; \ |
|---|
| 316 | done \ |
|---|
| 317 | ) |
|---|
| 318 | @echo "TARGETS_SOURCE:" |
|---|
| 319 | @(for t in $(TARGETS_SOURCE); do \ |
|---|
| 320 | echo -e "\t$$t"; \ |
|---|
| 321 | done \ |
|---|
| 322 | ) |
|---|