]> Git Repo - buildroot-mgba.git/blame - Makefile
Add in a GNU_HOST_NAME
[buildroot-mgba.git] / Makefile
CommitLineData
08782ae7 1# Makefile for a simple busybox/uClibc root filesystem
ffde94bd 2#
03c3fa25 3# Copyright (C) 2001-2003 Erik Andersen <[email protected]>
08782ae7 4# Copyright (C) 2002 by Tim Riker <[email protected]>
ffde94bd 5#
08782ae7
EA
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.
ffde94bd 10#
08782ae7
EA
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.
ffde94bd 15#
08782ae7
EA
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
ffde94bd 20
ffde94bd 21
03c3fa25 22TARGETS=
08782ae7
EA
23#############################################################
24#
25# EDIT this stuff to suit your system and preferences
26#
27# Use := when possible to get precomputation, thereby
28# speeding up the build process.
29#
30#############################################################
ffde94bd 31
08782ae7
EA
32# What sortof target system shall we compile this for?
33ARCH:=i386
34#ARCH:=arm
27bc59d4 35#ARCH:=powerpc
08782ae7 36#ARCH:=whatever
c38dcccc 37
95f81a5a 38# enable to build a native gcc toolchain with uclibc support
5a9f7f2b 39USE_UCLIBC_TOOLCHAIN:=true
95f81a5a 40
18e33c25
EA
41# If you are building a native gcc toolchain, do you want to
42# build the old gcc-2.95 based toolchain, or would you prefer
43# a nice and shiny new gcc-3.2.1 toolchain?
44GCC_2_95_TOOLCHAIN:=false
45
08782ae7
EA
46# Enable this to use the uClibc daily snapshot instead of a released
47# version. Daily snapshots may contain new features and bugfixes. Or
95f81a5a 48# they may not even compile at all, depending on what Erik is doing...
5eb4604c 49USE_UCLIBC_SNAPSHOT:=false
c38dcccc 50
085ba9f4
EA
51# Enable this to use the busybox daily snapshot instead of a released
52# version. Daily snapshots may contain new features and bugfixes. Or
53# they may not even compile at all....
cad58108 54USE_BUSYBOX_SNAPSHOT:=false
085ba9f4 55
08782ae7 56# Enable large file (files > 2 GB) support
03c3fa25 57BUILD_WITH_LARGEFILE:=true
ffde94bd 58
8a2597ea
EA
59# Command used to download source code
60WGET:=wget --passive-ftp
61
27bc59d4 62# Optimize toolchain for which type of CPU?
ef7784a6
EA
63OPTIMIZE_FOR_CPU=$(ARCH)
64#OPTIMIZE_FOR_CPU=i486
65#OPTIMIZE_FOR_CPU=strongarm
66#OPTIMIZE_FOR_CPU=whatever
27bc59d4
EA
67
68# Any additional gcc options you may want to include....
ef7784a6
EA
69EXTRA_GCC_CONFIG_OPTIONS=
70#EXTRA_GCC_CONFIG_OPTIONS=--without-float
27bc59d4 71
08782ae7
EA
72#############################################################
73#
74# The list of stuff to build for the target filesystem
75#
76#############################################################
03c3fa25
EA
77# The toolchain comes next if we are building one
78ifeq ($(USE_UCLIBC_TOOLCHAIN),true)
79TARGETS+=uclibc_toolchain
80endif
81
5455b5e0 82# Do you want user mode Linux (x86 only), or are you building a
4edbe2ca
EA
83# real kernel # that will run on its own? Perhaps you have a
84# kernel you have already configured and you want to use that?
5455b5e0 85#TARGETS+=linux
5eb4604c
EA
86#TARGETS+=user-mode-linux
87TARGETS+=system-linux
5455b5e0 88
cad58108 89# The default minimal set
b8a2361d 90TARGETS+=busybox tinylogin
cad58108
EA
91
92# Openssh...
93#TARGETS+=zlib openssl openssh
94
95# Everything needed to build a full uClibc development system!
de857763 96#TARGETS+=coreutils findutils bash make diffutils patch sed
bbe35d48 97#TARGETS+=ed flex bison file gawk tar grep gcc_target
cad58108 98
7564033f
EA
99# Of course, if you are installing a development system, you
100# may want some header files so you can compile stuff....
101#TARGETS+=ncurses-headers zlib-headers openssl-headers
102
b7d4f49c
EA
103# More development system stuff for those that want it
104#TARGETS+=m4 autoconf automake libtool
105
cad58108
EA
106# Some nice debugging tools
107#TARGETS+=gdb strace
108
382187f0 109# The Valgrind debugger (x86 only)
cad58108 110#TARGETS+=valgrind
ffde94bd 111
9741a49e 112# Some stuff for access points and firewalls
c8eea31d 113#TARGETS+=iptables hostap wtools dhcp_relay bridge
9741a49e 114
54e098e4
EA
115# Run customize.mk at the very end to add your own special config.
116# This is useful for making your own distro within the buildroot
117# process.
118# TARGETS+=customize
119
120#############################################################
121#
08782ae7 122# Pick your root filesystem type.
54e098e4
EA
123#
124#############################################################
08782ae7 125TARGETS+=ext2root
ffde94bd 126
27bc59d4
EA
127# Must mount cramfs with 'ramdisk_blocksize=4096'
128#TARGETS+=cramfsroot
129
130# You may need to edit make/jffs2root.mk to change target
131# endian-ness or similar, but this is sufficient for most
132# things as-is...
133#TARGETS+=jffs2root
134
08782ae7
EA
135#############################################################
136#
137# You should probably leave this stuff alone unless you know
138# what you are doing.
139#
140#############################################################
08782ae7 141HOSTCC:=gcc
9741a49e 142BASE_DIR:=${shell pwd}
08782ae7
EA
143SOURCE_DIR:=$(BASE_DIR)/sources
144DL_DIR:=$(SOURCE_DIR)/dl
145PATCH_DIR=$(SOURCE_DIR)/patches
146BUILD_DIR:=$(BASE_DIR)/build
147TARGET_DIR:=$(BUILD_DIR)/root
370fb2a3 148STAGING_DIR=$(BUILD_DIR)/staging_dir
d108fa86 149TOOL_BUILD_DIR=$(BASE_DIR)/build
370fb2a3 150TARGET_PATH=$(STAGING_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin
d108fa86
EA
151TARGET_CROSS=$(STAGING_DIR)/bin/$(ARCH)-uclibc-
152TARGET_CC=$(TARGET_CROSS)gcc
370fb2a3 153STRIP=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
cad58108 154#STRIP:=/bin/true
08782ae7 155IMAGE:=$(BASE_DIR)/root_fs
370fb2a3 156GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
a5c23541 157KERNEL_CROSS=$(STAGING_DIR)/bin/$(ARCH)-uclibc-
36830bae
EA
158HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
159 -e 's/sparc.*/sparc/' \
160 -e 's/arm.*/arm/g' \
161 -e 's/m68k.*/m68k/' \
162 -e 's/ppc/powerpc/g' \
163 -e 's/v850.*/v850/g' \
164 -e 's/sh[234]/sh/' \
165 -e 's/mips-.*/mips/' \
166 -e 's/mipsel-.*/mipsel/' \
167 -e 's/cris.*/cris/' \
168 )
169GNU_HOST_NAME:=$(HOST_ARCH)-pc-linux-gnu
ffde94bd 170
08782ae7 171all: world
ffde94bd 172
08782ae7 173TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
a5c23541 174TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
08782ae7 175TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
ffde94bd 176
08782ae7 177world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS)
ffde94bd 178
a5c23541
EA
179.PHONY: all world clean dirclean distclean source $(TARGETS) \
180 $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE)
ffde94bd 181
08782ae7 182include make/*.mk
ffde94bd 183
08782ae7
EA
184#############################################################
185#
186# staging and target directories do NOT list these as
187# dependancies anywhere else
188#
189#############################################################
190$(DL_DIR):
191 mkdir $(DL_DIR)
ffde94bd 192
08782ae7
EA
193$(BUILD_DIR):
194 mkdir $(BUILD_DIR)
c79e9982 195
08782ae7
EA
196$(STAGING_DIR):
197 rm -rf $(STAGING_DIR)
de2ae8dc
EA
198 mkdir -p $(STAGING_DIR)/lib
199 mkdir -p $(STAGING_DIR)/usr/lib
200 mkdir -p $(STAGING_DIR)/include
ffde94bd 201
08782ae7 202$(TARGET_DIR):
ffde94bd 203 rm -rf $(TARGET_DIR)
08782ae7
EA
204 zcat $(SOURCE_DIR)/skel.tar.gz | tar -C $(BUILD_DIR) -xf -
205 cp -a $(SOURCE_DIR)/target_skeleton/* $(TARGET_DIR)/
339f2f49 206 -find $(TARGET_DIR) -type d -name CVS -exec rm -rf {} \; > /dev/null 2>&1
08782ae7 207
a5c23541 208source: $(TARGETS_SOURCE)
08782ae7
EA
209
210#############################################################
211#
212# Cleanup and misc junk
213#
214#############################################################
215clean: $(TARGETS_CLEAN)
216 rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE)
217
218dirclean: $(TARGETS_DIRCLEAN)
219 rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE)
220
221distclean:
222 rm -rf $(DL_DIR) $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE)
223
224sourceball:
225 rm -rf $(BUILD_DIR)
226 set -e; \
227 cd ..; \
228 rm -f buildroot.tar.bz2; \
229 tar -cvf buildroot.tar buildroot; \
230 bzip2 -9 buildroot.tar; \
This page took 0.063572 seconds and 4 git commands to generate.