summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/boa.mk64
-rw-r--r--make/busybox.mk47
-rw-r--r--make/ext2root.mk53
-rw-r--r--make/tinylogin.mk38
-rw-r--r--make/uclibc.mk75
-rw-r--r--make/user-mode-linux.mk54
6 files changed, 331 insertions, 0 deletions
diff --git a/make/boa.mk b/make/boa.mk
new file mode 100644
index 000000000..0b595bd4c
--- /dev/null
+++ b/make/boa.mk
@@ -0,0 +1,64 @@
+#
+TARGETS += boa
+TARGETS_CLEAN += boa_clean
+TARGETS_MRPROPER += boa_mrproper
+TARGETS_DISTCLEAN += boa_distclean
+
+BOA_VERSION=0.94.12pre1
+
+# Don't alter below this line unless you (think) you know
+# what you are doing! Danger, Danger!
+
+BOA_URI=http://www.boa.org
+BOA_SOURCE=boa-$(BOA_VERSION).tar.gz
+BOA_DIR=$(BASE_DIR)/${shell basename $(BOA_SOURCE) .tar.gz}
+BOA_WORKDIR=$(BASE_DIR)/boa_workdir
+
+IMAGE_SIZE += +100
+
+$(SOURCE_DIR)/$(BOA_SOURCE):
+ while [ ! -f $(SOURCE_DIR)/$(BOA_SOURCE) ] ; do \
+ wget -P $(SOURCE_DIR) --passive-ftp $(BOA_URI)/$(BOA_SOURCE); \
+ done
+
+$(BOA_DIR)/.unpacked: $(SOURCE_DIR)/$(BOA_SOURCE)
+ gzip -d -c $(SOURCE_DIR)/$(BOA_SOURCE) | tar -xvf -
+ touch $(BOA_DIR)/.unpacked
+
+$(BOA_WORKDIR)/Makefile: $(TARGET_CC) $(BOA_DIR)/.unpacked
+ rm -f $(BOA_WORKDIR)/Makefile
+ mkdir -p $(BOA_WORKDIR)
+ if [ -f $(SOURCE_DIR)/boa-config.site-$(ARCH) ]; then \
+ (cd $(BOA_WORKDIR) && CONFIG_SITE=$(SOURCE_DIR)/boa-config.site-$(ARCH) CC=$(TARGET_CC) $(BOA_DIR)/src/configure); \
+ else \
+ (cd $(BOA_WORKDIR) && CC=$(TARGET_CC) $(BOA_DIR)/src/configure); \
+ fi
+ touch $(BOA_WORKDIR)/.depend
+
+$(BOA_WORKDIR)/boa $(BOA_WORKDIR)/boa_indexer: $(BOA_WORKDIR)/Makefile
+ rm -f $@
+ make VPATH=$(BOA_DIR)/src/ -C $(BOA_WORKDIR)
+
+$(BOA_WORKDIR)/.installed: $(BOA_WORKDIR)/boa $(BOA_WORKDIR)/boa_indexer
+ mkdir -p $(TARGET_DIR)/usr/sbin
+ cp -f $(BOA_WORKDIR)/boa $(TARGET_DIR)/usr/sbin/boa
+ mkdir -p $(TARGET_DIR)/usr/lib/boa
+ cp -f $(BOA_WORKDIR)/boa_indexer $(TARGET_DIR)/usr/lib/boa/boa_indexer
+ mkdir -p $(TARGET_DIR)/etc/boa
+ cp -f $(SOURCE_DIR)/boa.conf $(TARGET_DIR)/etc/boa
+ cp -f $(SOURCE_DIR)/mime.types $(TARGET_DIR)/etc/mime.types
+ strip --strip-all $(TARGET_DIR)/usr/sbin/boa $(TARGET_DIR)/usr/lib/boa/boa_indexer
+ touch $(BOA_WORKDIR)/.installed
+
+boa: $(BOA_WORKDIR)/.installed
+
+boa_clean:
+ @if [ -d $(BOA_WORKDIR)/Makefile ] ; then \
+ make -C $(BOA_WORKDIR) clean ; \
+ fi;
+
+boa_mrproper:
+ rm -rf $(BOA_DIR) $(BOA_WORKDIR)
+
+boa_distclean: boa_mrproper
+ rm -f $(SOURCE_DIR)/$(BOA_SOURCE)
diff --git a/make/busybox.mk b/make/busybox.mk
new file mode 100644
index 000000000..179a5d74d
--- /dev/null
+++ b/make/busybox.mk
@@ -0,0 +1,47 @@
+#############################################################
+#
+# busybox
+#
+#############################################################
+USE_BUSYBOX_SNAPSHOT=true
+ifeq ($(USE_BUSYBOX_SNAPSHOT),true)
+# Be aware that this changes daily....
+BUSYBOX_DIR:=$(BUILD_DIR)/busybox
+BUSYBOX_SOURCE=busybox-snapshot.tar.bz2
+BUSYBOX_SITE:=http://www.busybox.net/downloads/snapshots
+UNZIP=bzcat
+else
+BUSYBOX_DIR:=$(BUILD_DIR)/busybox-0.60.2
+BUSYBOX_SOURCE:=busybox-0.60.2.tar.gz
+BUSYBOX_SITE:=http://www.busybox.net/downloads
+UNZIP=zcat
+endif
+BUSYBOX_PATCH:=$(SOURCE_DIR)/busybox.patch
+
+
+$(DL_DIR)/$(BUSYBOX_SOURCE):
+ wget -P $(DL_DIR) --passive-ftp $(BUSYBOX_SITE)/$(BUSYBOX_SOURCE)
+
+busybox-source: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_PATCH)
+
+$(BUSYBOX_DIR)/Config.h: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_PATCH)
+ $(UNZIP) $(DL_DIR)/$(BUSYBOX_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ cat $(BUSYBOX_PATCH) | patch -d $(BUSYBOX_DIR) -p1
+ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
+ perl -i -p -e "s/^DOLFS.*/DOLFS=true/;" $(BUSYBOX_DIR)/Makefile
+endif
+
+$(BUSYBOX_DIR)/busybox: $(BUSYBOX_DIR)/Config.h
+ make CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" -C $(BUSYBOX_DIR)
+
+$(TARGET_DIR)/bin/busybox: $(BUSYBOX_DIR)/busybox
+ make CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" -C $(BUSYBOX_DIR) install
+
+busybox: uclibc $(TARGET_DIR)/bin/busybox
+
+busybox-clean:
+ rm -f $(TARGET_DIR)/bin/busybox
+ -make -C $(BUSYBOX_DIR) clean
+
+busybox-dirclean:
+ rm -rf $(BUSYBOX_DIR)
diff --git a/make/ext2root.mk b/make/ext2root.mk
new file mode 100644
index 000000000..37a9da2c0
--- /dev/null
+++ b/make/ext2root.mk
@@ -0,0 +1,53 @@
+#############################################################
+#
+# genext2fs to build to target ext2 filesystems
+#
+#############################################################
+GENEXT2_DIR=$(BUILD_DIR)/genext2fs-1.3.orig
+GENEXT2_SOURCE=genext2fs_1.3.orig.tar.gz
+GENEXT2_SITE=http://ftp.debian.org/debian/pool/main/g/genext2fs
+GENEXT2_PATCH=$(SOURCE_DIR)/genext2fs.patch
+
+$(DL_DIR)/$(GENEXT2_SOURCE):
+ wget -P $(DL_DIR) --passive-ftp $(GENEXT2_SITE)/$(GENEXT2_SOURCE)
+
+$(GENEXT2_DIR): $(DL_DIR)/$(GENEXT2_SOURCE) $(GENEXT2_PATCH)
+ zcat $(DL_DIR)/$(GENEXT2_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ cat $(GENEXT2_PATCH) | patch -p1 -d $(GENEXT2_DIR)
+
+$(GENEXT2_DIR)/genext2fs: $(GENEXT2_DIR)
+ $(MAKE) CFLAGS="-Wall -O2 -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64" -C $(GENEXT2_DIR);
+ touch -c $(GENEXT2_DIR)/genext2fs
+
+genext2fs: $(GENEXT2_DIR)/genext2fs
+
+
+
+#############################################################
+#
+# Build the ext2 root filesystem image
+#
+# Known problems :
+# - genext2fs: couldn't allocate a block (no free space)
+#
+# Since genext2fs allocates only one group of blocks, the FS
+# size is limited to a maximum of 8 Mb.
+#
+#############################################################
+# FIXME -- calculate these numbers...
+SIZE=4000
+INODES=1000
+
+ext2root: genext2fs #$(shell find $(TARGET_DIR) -type f)
+ -@find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIP) --strip-unneeded 2>/dev/null || true;
+ -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
+ $(GENEXT2_DIR)/genext2fs -i $(INODES) -b $(SIZE) -d $(TARGET_DIR) -D $(SOURCE_DIR)/device_table.txt $(IMAGE)
+
+ext2root-source: $(DL_DIR)/$(GENEXT2_SOURCE)
+
+ext2root-clean:
+ -make -C $(GENEXT2_DIR) clean
+
+ext2root-dirclean:
+ rm -rf $(GENEXT2_DIR)
+
diff --git a/make/tinylogin.mk b/make/tinylogin.mk
new file mode 100644
index 000000000..653f37921
--- /dev/null
+++ b/make/tinylogin.mk
@@ -0,0 +1,38 @@
+#############################################################
+#
+# tinylogin
+#
+#############################################################
+TINYLOGIN_DIR:=$(BUILD_DIR)/tinylogin-1.00
+# FIXME - this changes daily. we should use a stable tarball and cvs up if desired
+#TINYLOGIN_SOURCE=tinylogin-snapshot.tar.bz2
+TINYLOGIN_SOURCE:=tinylogin-1.00.tar.bz2
+TINYLOGIN_SITE:=http://tinylogin.busybox.net/downloads
+
+$(DL_DIR)/$(TINYLOGIN_SOURCE):
+ wget -P $(DL_DIR) --passive-ftp $(TINYLOGIN_SITE)/$(TINYLOGIN_SOURCE)
+
+tinylogin-source: $(DL_DIR)/$(TINYLOGIN_SOURCE)
+
+$(TINYLOGIN_DIR)/Config.h: $(DL_DIR)/$(TINYLOGIN_SOURCE)
+ bzcat $(DL_DIR)/$(TINYLOGIN_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ perl -i -p -e "s/\`id -u\` -ne 0/0 == 1/;" \
+ -e "s/4755 --owner=root --group=root/755/" \
+ $(TINYLOGIN_DIR)/install.sh
+ # date test this one
+ touch $(TINYLOGIN_DIR)/Config.h
+
+$(TINYLOGIN_DIR)/tinylogin: $(TINYLOGIN_DIR)/Config.h
+ make CROSS="$(TARGET_CROSS)" -C $(TINYLOGIN_DIR)
+
+$(TARGET_DIR)/bin/tinylogin: $(TINYLOGIN_DIR)/tinylogin
+ make CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" -C $(TINYLOGIN_DIR) install
+
+tinylogin: uclibc $(TARGET_DIR)/bin/tinylogin
+
+tinylogin-clean:
+ rm -f $(TARGET_DIR)/bin/tinylogin
+ -make -C $(TINYLOGIN_DIR) clean
+
+tinylogin-dirclean:
+ rm -rf $(TINYLOGIN_DIR)
diff --git a/make/uclibc.mk b/make/uclibc.mk
new file mode 100644
index 000000000..3b3b16de2
--- /dev/null
+++ b/make/uclibc.mk
@@ -0,0 +1,75 @@
+#############################################################
+#
+# uClibc (the C library)
+#
+#############################################################
+
+ifeq ($(USE_UCLIBC_SNAPSHOT),true)
+# Be aware that this changes daily....
+UCLIBC_DIR=$(BUILD_DIR)/uClibc
+UCLIBC_SOURCE=uClibc-snapshot.tar.bz2
+else
+UCLIBC_DIR:=$(BUILD_DIR)/uClibc-0.9.11
+UCLIBC_SOURCE:=uClibc-0.9.11.tar.bz2
+endif
+#UCLIBC_URI:=http://www.uclibc.org/downloads
+UCLIBC_URI:=http://de.busybox.net/downloads/uClibc
+ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
+LARGEFILE=true
+else
+LARGEFILE=false
+endif
+ifneq ($(CROSS),)
+CROSSARG:=--cross="$(CROSS)"
+endif
+
+$(DL_DIR)/$(UCLIBC_SOURCE):
+ wget -P $(DL_DIR) --passive-ftp $(UCLIBC_URI)/$(UCLIBC_SOURCE)
+
+uclibc-source: $(DL_DIR)/$(UCLIBC_SOURCE)
+
+$(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
+ rm -rf $(UCLIBC_DIR)
+ bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ touch $(UCLIBC_DIR)/.unpacked
+
+$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked
+ $(UCLIBC_DIR)/extra/Configs/uClibc_config_fix.pl \
+ --arch=$(ARCH) \
+ $(CROSSARG) --c99_math=true \
+ --devel_prefix=$(STAGING_DIR) \
+ --float=true \
+ --kernel_dir=$(LINUX_DIR) \
+ --large_file=$(LARGEFILE) \
+ --ldso_path="/lib" \
+ --long_long=true \
+ --rpc_support=true \
+ --shadow=true \
+ --shared_support=true \
+ --threads=true \
+ --debug=false \
+ --file=$(UCLIBC_DIR)/extra/Configs/Config.$(ARCH) \
+ > $(UCLIBC_DIR)/Config;
+ perl -i -p -e 's,SYSTEM_DEVEL_PREFIX.*,SYSTEM_DEVEL_PREFIX=$(STAGING_DIR)/usr,g' $(UCLIBC_DIR)/Config
+
+ touch $(UCLIBC_DIR)/.configured
+
+$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured
+ $(MAKE) -C $(UCLIBC_DIR)
+
+$(STAGING_DIR)/lib/libc.a: $(UCLIBC_DIR)/lib/libc.a
+ $(MAKE) -C $(UCLIBC_DIR) install
+
+$(TARGET_DIR)/lib/libc.so.0: $(STAGING_DIR)/lib/libc.a
+ $(MAKE) -C $(UCLIBC_DIR) DEVEL_PREFIX=$(TARGET_DIR) \
+ SYSTEM_DEVEL_PREFIX=$(TARGET_DIR)/usr install_runtime install_utils
+
+uclibc: $(LINUX_KERNEL) $(TARGET_DIR)/lib/libc.so.0
+
+uclibc-clean:
+ rm -f $(TARGET_DIR)/lib/libc.so.0
+ -make -C $(UCLIBC_DIR) clean
+ rm -f $(UCLIBC_DIR)/Config
+
+uclibc-dirclean:
+ rm -rf $(UCLIBC_DIR)
diff --git a/make/user-mode-linux.mk b/make/user-mode-linux.mk
new file mode 100644
index 000000000..930e24915
--- /dev/null
+++ b/make/user-mode-linux.mk
@@ -0,0 +1,54 @@
+#############################################################
+#
+# Linux kernel targets
+#
+#############################################################
+UMLINUX_DIR=$(BUILD_DIR)/linux
+UMLINUX_SOURCE=linux-2.4.18.tar.bz2
+UMLINUX_SITE=http://ftp.us.kernel.org/pub/linux/kernel/v2.4
+UMLINUX_PATCH_1:=uml-patch-2.4.18-19.bz2
+UMLINUX_PATCH_1_SITE:=http://prdownloads.sourceforge.net/user-mode-linux
+UMLINUX_KCONFIG=$(SOURCE_DIR)/linux-uml.config
+
+$(DL_DIR)/$(UMLINUX_SOURCE):
+ wget -P $(DL_DIR) --passive-ftp $(UMLINUX_SITE)/$(UMLINUX_SOURCE)
+
+$(DL_DIR)/$(UMLINUX_PATCH_1):
+ wget -P $(DL_DIR) --passive-ftp $(UMLINUX_PATCH_1_SITE)/$(UMLINUX_PATCH_1)
+
+user-mode-linux-source: $(DL_DIR)/$(UMLINUX_SOURCE) $(DL_DIR)/$(UMLINUX_PATCH_1)
+
+$(UMLINUX_DIR)/.unpacked: $(DL_DIR)/$(UMLINUX_SOURCE) $(DL_DIR)/$(UMLINUX_PATCH_1)
+ bzcat $(DL_DIR)/$(UMLINUX_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ touch $(UMLINUX_DIR)/.unpacked
+
+$(UMLINUX_DIR)/.patched: $(UMLINUX_DIR)/.unpacked
+ bzcat $(DL_DIR)/$(UMLINUX_PATCH_1) | patch -d $(UMLINUX_DIR) -p1
+ touch $(UMLINUX_DIR)/.patched
+
+$(UMLINUX_DIR)/.set_arch: $(UMLINUX_DIR)/.patched
+ perl -i -p -e "s/^ARCH :=.*/ARCH:=um/g;" $(UMLINUX_DIR)/Makefile
+ touch $(UMLINUX_DIR)/.set_arch
+
+$(UMLINUX_DIR)/.config: $(UMLINUX_DIR)/.set_arch
+ cp $(UMLINUX_KCONFIG) $(UMLINUX_DIR)/.config
+ make -C $(UMLINUX_DIR) oldconfig
+ touch -c $(UMLINUX_DIR)/.config
+
+$(UMLINUX_DIR)/linux: $(UMLINUX_DIR)/.config
+ make -C $(UMLINUX_DIR) dep
+ make -C $(UMLINUX_DIR) linux
+
+$(LINUX_KERNEL): $(UMLINUX_DIR)/linux
+ cp -fa $(UMLINUX_DIR)/linux $(LINUX_KERNEL)
+
+user-mode-linux: $(LINUX_KERNEL)
+
+# Renamed so it is not cleaned by default on a make clean
+user-mode-linux_clean: clean
+ rm -f $(LINUX_KERNEL)
+ -make -C $(UMLINUX_DIR) clean
+
+user-mode-linux-dirclean:
+ rm -rf $(UMLINUX_DIR)
+