source: floppyfw/Makefile @ 49

Revision 49, 8.8 KB checked in by root, 9 years ago (diff)

voxel didn't answer, new host then.

Line 
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?
40FLOPPYFW_VERSION=3.0rc1
41
42# What sortof target system shall we compile this for?
43ARCH:=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.)
58EMULATE_FPU=false
59
60# Command used to download source code
61WGET:=wget --passive-ftp
62
63# Optimize toolchain for which type of CPU?
64# WARNING!!!  CURRENTLY BROKEN!!! LEAVE IT AS $(ARCH)!!!
65OPTIMIZE_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
71TARGET_OPTIMIZATION=-Os
72TARGET_DEBUGGING= #-g
73
74# Any additional gcc options you may want to include....
75EXTRA_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
80JLEVEL=-j$(shell expr $(shell grep -i -c '^processor[[:space:]]*:[[:space:]]*[0-9]\+' /proc/cpuinfo) \+ 1)
81
82# Sourceforge-mirror:
83SF_HOST=superb-east
84SF_MIRROR=http://$(SF_HOST).dl.sourceforge.net
85
86
87#############################################################
88#
89# The list of stuff to build for the target filesystem
90#
91#############################################################
92
93TARGETS+=uclibc
94
95# Probably a good thing even if you choose not to patch anything.
96# This target only unpacks. The linux target does the patching.
97TARGETS+=patch-o-matic
98
99# POM-patches to add:
100# I could have used base but some of the patches has a problem.
101# It's alot here, probably not so smart, cut back later.
102POM_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 TARPIT
103
104# After switching to a newer p-o-m;
105#
106# Did not apply cleanly: dropped-table tproxy
107#
108# Did not compile cleanly:
109#   policy: (ipt_policy.c:15:22: net/xfrm.h: No such file or directory)
110#
111#   osf: (extensions/libipt_osf.c: In function `help':
112#   extensions/libipt_osf.c:46: warning: too many arguments for format
113#   extensions/libipt_osf.c: In function `parse':
114#   extensions/libipt_osf.c:107: error: `IPT_OSF_CONNECTOR' undeclared (first use in this function)
115#   extensions/libipt_osf.c:107: error: (Each undeclared identifier is reported only once
116#   )
117#
118# Missing: string
119
120TARGETS+=linux
121
122TARGETS+=busybox
123USE_BUSYBOX_SNAPSHOT=false
124
125TARGETS+=iptables
126
127TARGETS+=ipset
128
129TARGETS+=iproute2
130
131TARGETS+=dnsmasq
132
133TARGETS+=bridgeutils
134
135# TARGETS+=modutils
136
137TARGETS+=pppd
138
139TARGETS+=pppoe
140
141TARGETS+=pcmcia
142
143TARGETS+=wireless-tools
144
145TARGETS+=dropbear
146
147TARGETS+=ethtool
148
149TARGETS+=e3
150
151# This won't work, yet. It awaits a newer uClibc version.
152# TARGETS+=noip2
153
154TARGETS+=nanotop
155
156#TARGETS+=siproxd
157
158# The hostap target will add patches to the kernel and build a hostap.ffw
159# package with hostapd, hostap-driver and wpa_supplicant and hostap-utils
160# if you set it here.
161# TARGETS+=hostap
162# TARGETS+=hostap-utils
163
164# Not yet
165# TARGETS+=ebtables
166
167# And at last:
168TARGETS+=module-packages
169TARGETS+=floppy
170
171#############################################################
172#
173# You should probably leave this stuff alone unless you know
174# what you are doing.
175#
176#############################################################
177
178TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_SOFT_FLOAT)
179# TARGET_CC=distcc gcc
180TARGET_CC=gcc
181TARGET_CX=g++
182
183HOSTCC:=distcc gcc
184BASE_DIR:=${shell pwd}
185SOURCE_DIR:=$(BASE_DIR)/sources
186SCRIPTS_DIR:=$(BASE_DIR)/scripts
187CONFIG_DIR:=$(BASE_DIR)/configs
188LICENSES_DIR:=$(BASE_DIR)/licenses
189MODULES_BASE_DIR:=$(BASE_DIR)/modules
190MODULES_DIR:=$(MODULES_BASE_DIR)/2.4-std
191DL_DIR:=$(BASE_DIR)/downloads
192PATCH_DIR=$(BASE_DIR)/patches
193PACKAGES_DIR=$(BASE_DIR)/packages
194PACKAGES_INI_DIR=$(PACKAGES_DIR)/scripts
195PACKAGES_SKELETON_DIR=$(PACKAGES_DIR)/skeleton
196INITRD_DIR=$(BASE_DIR)/initrd
197INITRD_MASTER=$(INITRD_DIR)/master
198ADD_DIR=$(BASE_DIR)/add
199ADD_MASTER=$(ADD_DIR)/master
200
201TMP_DIR=$(BASE_DIR)/tmp
202
203# Need another name maybe?
204BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)$(ARCH_FPU_SUFFIX)
205
206TARFLAGS=--format oldgnu
207
208#TAR_VERBOSE=--verbose
209RM=rm -f
210
211# This may be a problem to use but I'll try.
212# --strip-unneeded
213STRIP=strip --strip-unneeded -g --remove-section=.comment --remove-section=.note
214STRIP_KMOD=strip --strip-debug --remove-section=.comment --remove-section=.note
215STRIP=$(STRIP_KMOD) --strip-unneeded
216
217SSTRIP=$(shell command type sstrip >/dev/null 2>&1 && echo sstrip || echo $(STRIP))
218
219DEPMOD=(cd $(LINUX_DIR); \
220        /sbin/depmod -ae -F System.map -b $(MODULES_DIR) -r $(LINUX_VERSION))
221
222# SED=/bin/sed -i -e
223SED=/usr/bin/perl -p -i -e
224LZMAD=lzmacat
225LZMAC=lzmacomp
226MAKE=/usr/bin/make $(JLEVEL)
227HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
228        -e 's/sparc.*/sparc/' \
229        -e 's/arm.*/arm/g' \
230        -e 's/m68k.*/m68k/' \
231        -e 's/ppc/powerpc/g' \
232        -e 's/v850.*/v850/g' \
233        -e 's/sh[234]/sh/' \
234        -e 's/mips-.*/mips/' \
235        -e 's/mipsel-.*/mipsel/' \
236        -e 's/cris.*/cris/' \
237        -e 's/i[3-9]86/i386/' \
238        )
239
240GNU_HOST_NAME:=$(HOST_ARCH)-pc-linux-gnu
241
242all:   world
243
244TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
245TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
246TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
247
248world: $(ADD_MASTER) $(INITRD_MASTER) $(DL_DIR) $(TMP_DIR) $(BUILD_DIR) $(PACKAGES_DIR) $(TARGETS)
249
250.PHONY: all world clean dirclean distclean source $(TARGETS) \
251        $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE)
252
253include makefiles/*.mk
254
255#############################################################
256#
257# staging and target directories do NOT list these as
258# dependancies anywhere else
259#
260#############################################################
261$(TMP_DIR):
262        mkdir -p $(TMP_DIR)
263
264$(DL_DIR):
265        mkdir -p $(DL_DIR)
266
267$(BUILD_DIR):
268        mkdir -p $(BUILD_DIR)
269
270$(PACKAGES_DIR):
271        mkdir -p $(PACKAGES_DIR)
272
273$(MODULES_BASE_DIR):
274        mkdir -p $(MODULES_BASE_DIR)
275
276$(MODULES_DIR):
277        mkdir -p $(MODULES_DIR)
278
279$(ADD_MASTER):
280        cp -a $(ADD_DIR)/skeleton $(ADD_MASTER)
281        -find $(ADD_MASTER) -type d -name CVS -exec $(RM) -r {} \; > /dev/null 2>&1
282        -find $(ADD_MASTER) -type d -name .svn -exec $(RM) -r {} \; > /dev/null 2>&1
283
284$(INITRD_MASTER):
285        cp -a $(INITRD_DIR)/skeleton $(INITRD_MASTER)
286        -find $(INITRD_MASTER) -type d -name CVS -exec $(RM) -r {} \; > /dev/null 2>&1
287        -find $(INITRD_MASTER) -type d -name .svn -exec $(RM) -r {} \; > /dev/null 2>&1
288
289source: $(TARGETS_SOURCE)
290
291#############################################################
292#
293# Cleanup and misc junk
294#
295# Fix later.. (yeah!)
296#
297#############################################################
298clean: $(TARGETS_CLEAN)
299        $(RM) -r $(INITRD_MASTER) $(ADD_MASTER) 
300
301dirclean: $(TARGETS_DIRCLEAN)
302        $(RM) -r $(INITRD_MASTER) $(ADD_MASTER) 
303
304distclean:
305        $(RM) -r $(DL_DIR) $(BUILD_DIR)
306
307sourceball:
308        $(RM) -r $(BUILD_DIR)
309        set -e; \
310        cd ..; \
311        $(RM) buildroot.tar.bz2; \
312        tar -cvf buildroot.tar buildroot; \
313        bzip2 -9 buildroot.tar
314
315list-targets:
316        @(echo "DIRS:"; \
317                for t in $(TMP_DIR) $(DL_DIR) $(BUILD_DIR) \
318                $(MODULES_BASE_DIR) $(MODULES_DIR) \
319                $(ADD_MASTER) $(INITRD_MASTER) $(PACKAGES_DIR); do \
320                echo -e "\t$$t"; \
321          done \
322        )
323        @echo "TARGETS:"
324        @(for t in $(TARGETS); do \
325                echo -e "\t$$t"; \
326          done \
327        )
328        @echo "TARGETS_SOURCE:"
329        @(for t in $(TARGETS_SOURCE); do \
330                echo -e "\t$$t"; \
331          done \
332        )
333        @echo "TARGETS_CLEAN:"
334        @(for t in $(TARGETS_CLEAN); do \
335                echo -e "\t$$t"; \
336          done \
337        )
338        @echo "TARGETS_DIRCLEAN:"
339        @(for t in $(TARGETS_DIRCLEAN); do \
340                echo -e "\t$$t"; \
341          done \
342        )
Note: See TracBrowser for help on using the repository browser.