| 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=3.0.0 |
| 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 properly tested 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 | | # This one sets j<amount of CPUs> but it may be just as good or even better |
| 79 | | # with amount +1 |
| 80 | | JLEVEL=-j$(shell expr $(shell grep -i -c '^processor[[:space:]]*:[[:space:]]*[0-9]\+' /proc/cpuinfo) \+ 1) |
| 81 | | # Or if running distcc: |
| 82 | | # JLEVEL=-j5 |
| 83 | | |
| 84 | | # Sourceforge-mirror: |
| 85 | | SF_HOST=superb-east |
| 86 | | SF_MIRROR=http://$(SF_HOST).dl.sourceforge.net |
| 87 | | |
| 88 | | # NICs you want in the nics.ffw module package separated by a space. |
| 89 | | # If you want options to the module, put them in a () after the module. |
| 90 | | NIC_MODULES=3c509 3c59x 8139cp 8139too pcnet32 r8169 e100 e1000 ne ne2k-pci forcedeth tulip |
| 91 | | |
| 92 | | ############################################################# |
| 93 | | # |
| 94 | | # The list of stuff to build for the target filesystem |
| 95 | | # |
| 96 | | ############################################################# |
| 97 | | |
| 98 | | TARGETS+=uclibc |
| 99 | | |
| 100 | | # Probably a good thing even if you choose not to patch anything. |
| 101 | | # This target only unpacks. The linux target does the patching. |
| 102 | | TARGETS+=patch-o-matic |
| 103 | | |
| 104 | | # POM-patches to add: |
| 105 | | # I could have used base but some of the patches has a problem. |
| 106 | | # It's alot here, probably not so smart, cut back later. |
| 107 | | POM_PATCHES=h323-conntrack-nat quake3-conntrack-nat connlimit dstlimit 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 TARPIT |
| 108 | | |
| 109 | | # After switching to a newer p-o-m; |
| 110 | | # |
| 111 | | # Did not apply cleanly: dropped-table tproxy |
| 112 | | # |
| 113 | | # Did not compile cleanly: |
| 114 | | # policy: (ipt_policy.c:15:22: net/xfrm.h: No such file or directory) |
| 115 | | # |
| 116 | | # osf: (extensions/libipt_osf.c: In function `help': |
| 117 | | # extensions/libipt_osf.c:46: warning: too many arguments for format |
| 118 | | # extensions/libipt_osf.c: In function `parse': |
| 119 | | # extensions/libipt_osf.c:107: error: `IPT_OSF_CONNECTOR' undeclared (first use in this function) |
| 120 | | # extensions/libipt_osf.c:107: error: (Each undeclared identifier is reported only once |
| 121 | | # ) |
| 122 | | # |
| 123 | | # Missing: string |
| 124 | | |
| 125 | | # IPTABLES_MODULES: this is a result of the patches you have chosen above and |
| 126 | | # also the included modules in the kernel (also check the kernel config.) |
| 127 | | # This works the same way as NIC_MODULES. |
| 128 | | # If you want options to the module, put them in a () after the module. |
| 129 | | IPTABLES_MODULES=arp_tables arptable_filter iptable_mangle ipt_DSCP ipt_ECN ipt_LOG ipt_MARK ipt_REDIRECT ipt_TCPMSS ipt_TOS ipt_ULOG ipt_conntrack ipt_connlimit ipt_dscp ipt_ecn ipt_helper ipt_length ipt_limit ipt_mac ipt_mark ipt_physdev ipt_pkttype ipt_tcpmss ipt_tos ipt_ttl ipt_unclean ip_conntrack_ftp ip_nat_ftp ip_conntrack_irc(ports=6666,6667,6668,7000) ip_nat_irc sch_htb ip_conntrack_h323 ip_conntrack_rtsp ip_conntrack_pptp ip_conntrack_quake3 ipt_iprange ipt_multiport |
| 130 | | |
| 131 | | #ipt_MIRROR |
| 132 | | #ip_queue |
| 133 | | #ipt_string |
| 134 | | #ip_nat_tftp |
| 135 | | #ip_conntrack_tftp |
| 136 | | #ip_nat_amanda |
| 137 | | #ip_conntrack_amanda |
| 138 | | |
| 139 | | TARGETS+=linux |
| 140 | | |
| 141 | | TARGETS+=busybox |
| 142 | | USE_BUSYBOX_SNAPSHOT=false |
| 143 | | |
| 144 | | TARGETS+=iptables |
| 145 | | |
| 146 | | TARGETS+=ipset |
| 147 | | |
| 148 | | TARGETS+=iproute2 |
| 149 | | |
| 150 | | TARGETS+=dnsmasq |
| 151 | | |
| 152 | | TARGETS+=bridgeutils |
| 153 | | |
| 154 | | # TARGETS+=modutils |
| 155 | | |
| 156 | | TARGETS+=pppd |
| 157 | | |
| 158 | | TARGETS+=pppoe |
| 159 | | |
| 160 | | TARGETS+=pcmcia |
| 161 | | |
| 162 | | TARGETS+=wireless-tools |
| 163 | | |
| 164 | | TARGETS+=dropbear |
| 165 | | |
| 166 | | TARGETS+=ethtool |
| 167 | | |
| 168 | | # This one will be installed in add.ffw, alas, the floppy base itself and |
| 169 | | # not it's own package. |
| 170 | | #TARGETS+=mii-diag |
| 171 | | |
| 172 | | TARGETS+=e3 |
| 173 | | |
| 174 | | TARGETS+=noip2 |
| 175 | | |
| 176 | | TARGETS+=nanotop |
| 177 | | |
| 178 | | TARGETS+=wsmenu |
| 179 | | |
| 180 | | # These needs to be tested. |
| 181 | | TARGETS+=siproxd |
| 182 | | TARGETS+=ucarp |
| 183 | | TARGETS+=lineserv |
| 184 | | # TARGETS+=madwifi |
| 185 | | |
| 186 | | # The hostap target will add patches to the kernel and build a hostap.ffw |
| 187 | | # package with hostapd, hostap-driver and wpa_supplicant and hostap-utils |
| 188 | | # if you set it here. |
| 189 | | # TARGETS+=hostap |
| 190 | | # TARGETS+=hostap-utils |
| 191 | | |
| 192 | | # Not yet |
| 193 | | # TARGETS+=ebtables |
| 194 | | |
| 195 | | # And at last: |
| 196 | | TARGETS+=module-packages |
| 197 | | TARGETS+=floppy |
| 198 | | |
| 199 | | ############################################################# |
| 200 | | # |
| 201 | | # You should probably leave this stuff alone unless you know |
| | 13 | # General Public License for more details. |
| | 14 | # |
| | 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 | # |
| | 19 | |
| | 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 = scripts/kconfig |
| | 28 | |
| | 29 | noconfig_targets := menuconfig config oldconfig randconfig \ |
| | 30 | defconfig allyesconfig allnoconfig release tags \ |
| | 31 | $(shell find . -name *_defconfig |sed 's/.*\///') |
| | 32 | |
| | 33 | # Pull in the user's configuration file |
| | 34 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) |
| | 35 | -include $(TOPDIR).config |
| | 36 | endif |
| | 37 | |
| | 38 | ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) |
| | 39 | |
| | 40 | ############################################################# |
| | 41 | # |
| | 42 | # The list of stuff to build for the target toolchain |
| | 43 | # along with the packages to build for the target. |
| | 44 | # |
| | 45 | ############################################################## |
| | 46 | TARGETS:=uclibc busybox |
| | 47 | include package/Makefile.in |
| | 48 | |
| | 49 | ############################################################# |
| | 50 | # |
| | 51 | # You should probably leave this stuff alone unless you know |
| 206 | | TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_SOFT_FLOAT) |
| 207 | | # TARGET_CC=distcc gcc |
| 208 | | TARGET_CC=gcc |
| 209 | | TARGET_CX=g++ |
| 210 | | |
| 211 | | HOSTCC:=distcc gcc |
| 212 | | BASE_DIR:=${shell pwd} |
| 213 | | SOURCE_DIR:=$(BASE_DIR)/sources |
| 214 | | FILES_DIR:=$(FILES_DIR)/scripts |
| 215 | | SCRIPTS_DIR:=$(BASE_DIR)/scripts |
| 216 | | CONFIG_DIR:=$(BASE_DIR)/configs |
| 217 | | LICENSES_DIR:=$(BASE_DIR)/licenses |
| 218 | | MODULES_BASE_DIR:=$(BASE_DIR)/modules |
| 219 | | MODULES_DIR:=$(MODULES_BASE_DIR)/2.4-std |
| 220 | | DL_DIR:=$(BASE_DIR)/downloads |
| 221 | | PATCH_DIR=$(BASE_DIR)/patches |
| 222 | | PACKAGES_DIR=$(BASE_DIR)/packages |
| 223 | | PACKAGES_INI_DIR=$(PACKAGES_DIR)/scripts |
| 224 | | PACKAGES_SKELETON_DIR=$(PACKAGES_DIR)/skeleton |
| 225 | | INITRD_DIR=$(BASE_DIR)/initrd |
| 226 | | INITRD_MASTER=$(INITRD_DIR)/master |
| 227 | | ADD_DIR=$(BASE_DIR)/add |
| 228 | | ADD_MASTER=$(ADD_DIR)/master |
| 229 | | |
| 230 | | TMP_DIR=$(BASE_DIR)/tmp |
| 231 | | |
| 232 | | # Need another name maybe? |
| 233 | | BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)$(ARCH_FPU_SUFFIX) |
| 234 | | |
| 235 | | TARFLAGS=--format oldgnu |
| 236 | | |
| 237 | | #TAR_VERBOSE=--verbose |
| 238 | | RM=rm -f |
| 239 | | |
| 240 | | # This may be a problem to use but I'll try. |
| 241 | | # --strip-unneeded |
| 242 | | STRIP=strip --strip-unneeded -g --remove-section=.comment --remove-section=.note |
| 243 | | STRIP_KMOD=strip --strip-debug --remove-section=.comment --remove-section=.note |
| 244 | | STRIP=$(STRIP_KMOD) --strip-unneeded |
| 245 | | |
| 246 | | SSTRIP=$(shell command type sstrip >/dev/null 2>&1 && echo sstrip || echo $(STRIP)) |
| 247 | | |
| 248 | | DEPMOD=(cd $(LINUX_DIR); \ |
| 249 | | /sbin/depmod -ae -F System.map -b $(MODULES_DIR) -r $(LINUX_VERSION)) |
| 250 | | |
| 251 | | # SED=/bin/sed -i -e |
| 252 | | SED=/usr/bin/perl -p -i -e |
| 253 | | LZMAD=lzmacat |
| 254 | | LZMAC=lzmacomp |
| 255 | | MAKE=/usr/bin/make $(JLEVEL) |
| 256 | | HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \ |
| 257 | | -e 's/sparc.*/sparc/' \ |
| 258 | | -e 's/arm.*/arm/g' \ |
| 259 | | -e 's/m68k.*/m68k/' \ |
| 260 | | -e 's/ppc/powerpc/g' \ |
| 261 | | -e 's/v850.*/v850/g' \ |
| 262 | | -e 's/sh[234]/sh/' \ |
| 263 | | -e 's/mips-.*/mips/' \ |
| 264 | | -e 's/mipsel-.*/mipsel/' \ |
| 265 | | -e 's/cris.*/cris/' \ |
| 266 | | -e 's/i[3-9]86/i386/' \ |
| 267 | | ) |
| 268 | | |
| 269 | | GNU_HOST_NAME:=$(HOST_ARCH)-pc-linux-gnu |
| | 56 | |
| 297 | | mkdir -p $(BUILD_DIR) |
| 298 | | |
| 299 | | $(PACKAGES_DIR): |
| 300 | | mkdir -p $(PACKAGES_DIR) |
| 301 | | |
| 302 | | $(MODULES_BASE_DIR): |
| 303 | | mkdir -p $(MODULES_BASE_DIR) |
| 304 | | |
| 305 | | $(MODULES_DIR): |
| 306 | | mkdir -p $(MODULES_DIR) |
| 307 | | |
| 308 | | $(ADD_MASTER): |
| 309 | | cp -a $(ADD_DIR)/skeleton $(ADD_MASTER) |
| 310 | | -find $(ADD_MASTER) -type d -name CVS -exec $(RM) -r {} \; > /dev/null 2>&1 |
| 311 | | -find $(ADD_MASTER) -type d -name .svn -exec $(RM) -r {} \; > /dev/null 2>&1 |
| 312 | | |
| 313 | | $(INITRD_MASTER): |
| 314 | | cp -a $(INITRD_DIR)/skeleton $(INITRD_MASTER) |
| 315 | | -find $(INITRD_MASTER) -type d -name CVS -exec $(RM) -r {} \; > /dev/null 2>&1 |
| 316 | | -find $(INITRD_MASTER) -type d -name .svn -exec $(RM) -r {} \; > /dev/null 2>&1 |
| | 93 | @mkdir -p $(BUILD_DIR) |
| | 94 | |
| | 95 | $(TOOL_BUILD_DIR): |
| | 96 | @mkdir -p $(TOOL_BUILD_DIR) |
| | 97 | |
| | 98 | $(STAGING_DIR): |
| | 99 | @mkdir -p $(STAGING_DIR)/lib |
| | 100 | @mkdir -p $(STAGING_DIR)/include |
| | 101 | @mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) |
| | 102 | @ln -snf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib |
| | 103 | |
| | 104 | $(TARGET_DIR): |
| | 105 | if [ -f "$(TARGET_SKELETON)" ] ; then \ |
| | 106 | $(ZCAT) $(TARGET_SKELETON) | tar -C $(BUILD_DIR) -xf -; \ |
| | 107 | fi; |
| | 108 | if [ -d "$(TARGET_SKEL_DIR)" ] ; then \ |
| | 109 | cp -fa $(TARGET_SKEL_DIR)/* $(TARGET_DIR)/; \ |
| | 110 | fi; |
| | 111 | touch $(STAGING_DIR)/.fakeroot.00000 |
| | 112 | -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf |
| | 113 | -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf |
| | 114 | |
| | 115 | $(TARGET_PACKAGES_DIR): |
| | 116 | @mkdir -p $(TARGET_PACKAGES_DIR) |
| 357 | | bzip2 -9 buildroot.tar |
| 358 | | |
| 359 | | list-targets: |
| 360 | | @(echo "DIRS:"; \ |
| 361 | | for t in $(TMP_DIR) $(DL_DIR) $(BUILD_DIR) \ |
| 362 | | $(MODULES_BASE_DIR) $(MODULES_DIR) \ |
| 363 | | $(ADD_MASTER) $(INITRD_MASTER) $(PACKAGES_DIR); do \ |
| 364 | | echo -e "\t$$t"; \ |
| 365 | | done \ |
| 366 | | ) |
| 367 | | @echo "TARGETS:" |
| 368 | | @(for t in $(TARGETS); do \ |
| 369 | | echo -e "\t$$t"; \ |
| 370 | | done \ |
| 371 | | ) |
| 372 | | @echo "TARGETS_SOURCE:" |
| 373 | | @(for t in $(TARGETS_SOURCE); do \ |
| 374 | | echo -e "\t$$t"; \ |
| 375 | | done \ |
| 376 | | ) |
| 377 | | @echo "TARGETS_CLEAN:" |
| 378 | | @(for t in $(TARGETS_CLEAN); do \ |
| 379 | | echo -e "\t$$t"; \ |
| 380 | | done \ |
| 381 | | ) |
| 382 | | @echo "TARGETS_DIRCLEAN:" |
| 383 | | @(for t in $(TARGETS_DIRCLEAN); do \ |
| 384 | | echo -e "\t$$t"; \ |
| 385 | | done \ |
| 386 | | ) |
| | 143 | bzip2 -9 buildroot.tar; \ |
| | 144 | |
| | 145 | |
| | 146 | else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) |
| | 147 | |
| | 148 | all: menuconfig |
| | 149 | |
| | 150 | # configuration |
| | 151 | # --------------------------------------------------------------------------- |
| | 152 | |
| | 153 | $(CONFIG)/conf: |
| | 154 | $(MAKE) -C $(CONFIG) conf |
| | 155 | -@if [ ! -f .config ] ; then \ |
| | 156 | cp $(CONFIG_DEFCONFIG) .config; \ |
| | 157 | fi |
| | 158 | $(CONFIG)/mconf: |
| | 159 | $(MAKE) -C $(CONFIG) ncurses conf mconf |
| | 160 | -@if [ ! -f .config ] ; then \ |
| | 161 | cp $(CONFIG_DEFCONFIG) .config; \ |
| | 162 | fi |
| | 163 | |
| | 164 | menuconfig: $(CONFIG)/mconf |
| | 165 | @$(CONFIG)/mconf $(CONFIG_CONFIG_IN) |
| | 166 | |
| | 167 | config: $(CONFIG)/conf |
| | 168 | @$(CONFIG)/conf $(CONFIG_CONFIG_IN) |
| | 169 | |
| | 170 | oldconfig: $(CONFIG)/conf |
| | 171 | @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN) |
| | 172 | |
| | 173 | randconfig: $(CONFIG)/conf |
| | 174 | @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN) |
| | 175 | |
| | 176 | allyesconfig: $(CONFIG)/conf |
| | 177 | #@$(CONFIG)/conf -y $(CONFIG_CONFIG_IN) |
| | 178 | #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config |
| | 179 | @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN) |
| | 180 | |
| | 181 | allnoconfig: $(CONFIG)/conf |
| | 182 | @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN) |
| | 183 | |
| | 184 | defconfig: $(CONFIG)/conf |
| | 185 | @$(CONFIG)/conf -d $(CONFIG_CONFIG_IN) |
| | 186 | |
| | 187 | %_defconfig: $(CONFIG)/conf |
| | 188 | cp $(shell find . -name $@) .config |
| | 189 | @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN) |
| | 190 | |
| | 191 | ############################################################# |
| | 192 | # |
| | 193 | # Cleanup and misc junk |
| | 194 | # |
| | 195 | ############################################################# |
| | 196 | clean: |
| | 197 | rm -f .config .config.old .config.cmd .tmpconfig.h |
| | 198 | - $(MAKE) -C $(CONFIG) clean |
| | 199 | |
| | 200 | distclean: clean |
| | 201 | rm -rf sources/* |
| | 202 | |
| | 203 | endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) |
| | 204 | |
| | 205 | .PHONY: dummy subdirs release distclean clean config oldconfig \ |
| | 206 | menuconfig tags check test depend defconfig |
| | 207 | |
| | 208 | |