2002-04-26 05:45:55 -06:00
|
|
|
# Makefile for a simple busybox/uClibc root filesystem
|
2001-12-21 17:56:11 -07:00
|
|
|
#
|
2003-01-02 23:44:03 -07:00
|
|
|
# Copyright (C) 2001-2003 Erik Andersen <andersen@codepoet.org>
|
2002-04-26 05:45:55 -06:00
|
|
|
# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
|
2001-12-21 17:56:11 -07:00
|
|
|
#
|
2002-04-26 05:45:55 -06:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Library General Public License as
|
|
|
|
# published by the Free Software Foundation; either version 2 of the
|
|
|
|
# License, or (at your option) any later version.
|
2001-12-21 17:56:11 -07:00
|
|
|
#
|
2002-04-26 05:45:55 -06:00
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Library General Public License for more details.
|
2001-12-21 17:56:11 -07:00
|
|
|
#
|
2002-04-26 05:45:55 -06:00
|
|
|
# You should have received a copy of the GNU Library General Public
|
|
|
|
# License along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
# USA
|
2001-12-21 17:56:11 -07:00
|
|
|
|
|
|
|
|
2003-01-02 23:44:03 -07:00
|
|
|
TARGETS=
|
2002-04-26 05:45:55 -06:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# EDIT this stuff to suit your system and preferences
|
|
|
|
#
|
|
|
|
# Use := when possible to get precomputation, thereby
|
|
|
|
# speeding up the build process.
|
|
|
|
#
|
|
|
|
#############################################################
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
# What sortof target system shall we compile this for?
|
|
|
|
ARCH:=i386
|
|
|
|
#ARCH:=arm
|
2003-01-16 21:31:36 -07:00
|
|
|
#ARCH:=powerpc
|
2002-04-26 05:45:55 -06:00
|
|
|
#ARCH:=whatever
|
2002-01-02 21:51:43 -07:00
|
|
|
|
2002-07-03 04:44:59 -06:00
|
|
|
# enable to build a native gcc toolchain with uclibc support
|
2002-08-28 16:38:39 -06:00
|
|
|
USE_UCLIBC_TOOLCHAIN:=true
|
2002-07-03 04:44:59 -06:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
# Enable this to use the uClibc daily snapshot instead of a released
|
|
|
|
# version. Daily snapshots may contain new features and bugfixes. Or
|
2002-07-03 04:44:59 -06:00
|
|
|
# they may not even compile at all, depending on what Erik is doing...
|
2002-11-20 16:16:10 -07:00
|
|
|
USE_UCLIBC_SNAPSHOT:=true
|
2002-01-02 21:51:43 -07:00
|
|
|
|
2002-04-26 15:20:45 -06:00
|
|
|
# Enable this to use the busybox daily snapshot instead of a released
|
|
|
|
# version. Daily snapshots may contain new features and bugfixes. Or
|
|
|
|
# they may not even compile at all....
|
2002-11-14 05:16:04 -07:00
|
|
|
USE_BUSYBOX_SNAPSHOT:=false
|
2002-04-26 15:20:45 -06:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
# Enable large file (files > 2 GB) support
|
2003-01-02 23:44:03 -07:00
|
|
|
BUILD_WITH_LARGEFILE:=true
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-11-20 16:16:10 -07:00
|
|
|
# Command used to download source code
|
|
|
|
WGET:=wget --passive-ftp
|
|
|
|
|
2003-01-16 21:31:36 -07:00
|
|
|
# Optimize toolchain for which type of CPU?
|
2003-01-17 01:03:59 -07:00
|
|
|
OPTIMIZE_FOR_CPU=$(ARCH)
|
|
|
|
#OPTIMIZE_FOR_CPU=i486
|
|
|
|
#OPTIMIZE_FOR_CPU=strongarm
|
|
|
|
#OPTIMIZE_FOR_CPU=whatever
|
2003-01-16 21:31:36 -07:00
|
|
|
|
|
|
|
# Any additional gcc options you may want to include....
|
2003-01-17 01:03:59 -07:00
|
|
|
EXTRA_GCC_CONFIG_OPTIONS=
|
|
|
|
#EXTRA_GCC_CONFIG_OPTIONS=--without-float
|
2003-01-16 21:31:36 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# The list of stuff to build for the target filesystem
|
|
|
|
#
|
|
|
|
#############################################################
|
2003-01-02 23:44:03 -07:00
|
|
|
# The toolchain comes next if we are building one
|
|
|
|
ifeq ($(USE_UCLIBC_TOOLCHAIN),true)
|
|
|
|
TARGETS+=uclibc_toolchain
|
|
|
|
endif
|
|
|
|
|
2003-01-06 08:40:38 -07:00
|
|
|
# Do you want user mode Linux (x86 only), or are you building a
|
2003-01-15 03:20:58 -07:00
|
|
|
# real kernel # that will run on its own? Perhaps you have a
|
|
|
|
# kernel you have already configured and you want to use that?
|
2003-01-06 08:40:38 -07:00
|
|
|
#TARGETS+=linux
|
|
|
|
TARGETS+=user-mode-linux
|
2003-01-15 03:20:58 -07:00
|
|
|
#TARGETS+=system-linux
|
2003-01-06 08:40:38 -07:00
|
|
|
|
2002-11-14 05:16:04 -07:00
|
|
|
# The default minimal set
|
2002-12-11 18:57:57 -07:00
|
|
|
TARGETS+=busybox tinylogin
|
2002-11-14 05:16:04 -07:00
|
|
|
|
|
|
|
# Openssh...
|
|
|
|
#TARGETS+=zlib openssl openssh
|
|
|
|
|
|
|
|
# Everything needed to build a full uClibc development system!
|
2002-11-20 17:35:14 -07:00
|
|
|
#TARGETS+=coreutils findutils bash make sed gawk gcc_target
|
2002-11-14 05:16:04 -07:00
|
|
|
|
2003-01-08 11:22:25 -07:00
|
|
|
# Of course, if you are installing a development system, you
|
|
|
|
# may want some header files so you can compile stuff....
|
|
|
|
#TARGETS+=ncurses-headers zlib-headers openssl-headers
|
|
|
|
|
2003-01-08 19:34:10 -07:00
|
|
|
# More development system stuff for those that want it
|
|
|
|
#TARGETS+=m4 autoconf automake libtool
|
|
|
|
|
2002-11-14 05:16:04 -07:00
|
|
|
# Some nice debugging tools
|
|
|
|
#TARGETS+=gdb strace
|
|
|
|
|
2003-01-16 21:45:35 -07:00
|
|
|
# The Valgrind debugger (x86 only)
|
2002-11-14 05:16:04 -07:00
|
|
|
#TARGETS+=valgrind
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2003-01-18 14:52:46 -07:00
|
|
|
# Run customize.mk at the very end to add your own special config.
|
|
|
|
# This is useful for making your own distro within the buildroot
|
|
|
|
# process.
|
|
|
|
# TARGETS+=customize
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
2002-04-26 05:45:55 -06:00
|
|
|
# Pick your root filesystem type.
|
2003-01-18 14:52:46 -07:00
|
|
|
#
|
|
|
|
#############################################################
|
2002-04-26 05:45:55 -06:00
|
|
|
TARGETS+=ext2root
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2003-01-16 21:31:36 -07:00
|
|
|
# Must mount cramfs with 'ramdisk_blocksize=4096'
|
|
|
|
#TARGETS+=cramfsroot
|
|
|
|
|
|
|
|
# You may need to edit make/jffs2root.mk to change target
|
|
|
|
# endian-ness or similar, but this is sufficient for most
|
|
|
|
# things as-is...
|
|
|
|
#TARGETS+=jffs2root
|
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# You should probably leave this stuff alone unless you know
|
|
|
|
# what you are doing.
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
BASE_DIR:=${shell pwd}
|
|
|
|
HOSTCC:=gcc
|
|
|
|
SOURCE_DIR:=$(BASE_DIR)/sources
|
|
|
|
DL_DIR:=$(SOURCE_DIR)/dl
|
|
|
|
PATCH_DIR=$(SOURCE_DIR)/patches
|
|
|
|
BUILD_DIR:=$(BASE_DIR)/build
|
|
|
|
TARGET_DIR:=$(BUILD_DIR)/root
|
|
|
|
STAGING_DIR:=$(BUILD_DIR)/staging_dir
|
2002-07-03 04:44:59 -06:00
|
|
|
TARGET_CC:=$(STAGING_DIR)/usr/bin/gcc
|
|
|
|
TARGET_CROSS:=$(STAGING_DIR)/bin/$(ARCH)-uclibc-
|
2002-04-26 05:45:55 -06:00
|
|
|
TARGET_CC1:=$(TARGET_CROSS)gcc
|
2002-07-03 04:44:59 -06:00
|
|
|
TARGET_PATH:=$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:/bin:/sbin:/usr/bin:/usr/sbin
|
2002-04-26 05:45:55 -06:00
|
|
|
STRIP:=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
|
2002-11-14 05:16:04 -07:00
|
|
|
#STRIP:=/bin/true
|
2002-04-26 05:45:55 -06:00
|
|
|
IMAGE:=$(BASE_DIR)/root_fs
|
2003-01-17 01:03:59 -07:00
|
|
|
MAKE:=make
|
|
|
|
GNU_TARGET_NAME:=$(OPTIMIZE_FOR_CPU)-unknown-linux-gnu
|
2002-04-26 05:45:55 -06:00
|
|
|
ifneq ($(strip $(ARCH)),i386)
|
|
|
|
CROSS:=$(ARCH)-linux-
|
|
|
|
endif
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
all: world
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
|
|
|
|
TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS)
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
.PHONY: all world clean dirclean distclean $(TARGETS) $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN)
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
include make/*.mk
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# staging and target directories do NOT list these as
|
|
|
|
# dependancies anywhere else
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
$(DL_DIR):
|
|
|
|
mkdir $(DL_DIR)
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
$(BUILD_DIR):
|
|
|
|
mkdir $(BUILD_DIR)
|
2002-01-05 13:26:15 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
$(STAGING_DIR):
|
|
|
|
rm -rf $(STAGING_DIR)
|
|
|
|
mkdir $(STAGING_DIR)
|
2001-12-21 17:56:11 -07:00
|
|
|
|
2002-04-26 05:45:55 -06:00
|
|
|
$(TARGET_DIR):
|
2001-12-21 17:56:11 -07:00
|
|
|
rm -rf $(TARGET_DIR)
|
2002-04-26 05:45:55 -06:00
|
|
|
zcat $(SOURCE_DIR)/skel.tar.gz | tar -C $(BUILD_DIR) -xf -
|
|
|
|
cp -a $(SOURCE_DIR)/target_skeleton/* $(TARGET_DIR)/
|
2001-12-21 18:17:09 -07:00
|
|
|
-find $(TARGET_DIR) -type d -name CVS -exec rm -rf {} \; > /dev/null 2>&1
|
2002-04-26 05:45:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Cleanup and misc junk
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
clean: $(TARGETS_CLEAN)
|
|
|
|
rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE)
|
|
|
|
|
|
|
|
dirclean: $(TARGETS_DIRCLEAN)
|
|
|
|
rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE)
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
rm -rf $(DL_DIR) $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE)
|
|
|
|
|
|
|
|
sourceball:
|
|
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
set -e; \
|
|
|
|
cd ..; \
|
|
|
|
rm -f buildroot.tar.bz2; \
|
|
|
|
tar -cvf buildroot.tar buildroot; \
|
|
|
|
bzip2 -9 buildroot.tar; \
|