summaryrefslogtreecommitdiffstats
path: root/rules/klibc.make
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2005-11-23 09:35:54 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2005-11-23 09:35:54 +0000
commit59a42ca818b0e3ce51945f190d9e7967678f8fd7 (patch)
tree62737da3903ca3751ea7f71a545a79f284966715 /rules/klibc.make
parentd656383cecbf1034fd2ab3fe71228d5bdc3bd77e (diff)
downloadptxdist-59a42ca818b0e3ce51945f190d9e7967678f8fd7.tar.gz
ptxdist-59a42ca818b0e3ce51945f190d9e7967678f8fd7.tar.xz
add klibc
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-0.7-trunk@3417 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'rules/klibc.make')
-rw-r--r--rules/klibc.make136
1 files changed, 100 insertions, 36 deletions
diff --git a/rules/klibc.make b/rules/klibc.make
index d634cb103..6f4a36655 100644
--- a/rules/klibc.make
+++ b/rules/klibc.make
@@ -1,7 +1,7 @@
# -*-makefile-*-
# $Id: template 3345 2005-11-14 17:14:19Z rsc $
#
-# Copyright (C) 2005 by Robert Schwebel
+# Copyright (C) 2005 by Sascha Hauer
#
# See CREDITS for details about who has contributed to this project.
#
@@ -17,12 +17,12 @@ PACKAGES-$(PTXCONF_KLIBC) += klibc
#
# Paths and names
#
-KLIBC_VERSION = 1.1
+KLIBC_VERSION = 1.1.1
KLIBC = klibc-$(KLIBC_VERSION)
-KLIBC_SUFFIX = tar.bz2
-KLIBC_URL = http://www.kernel.org/pub/linux/libs/klibc/$(KLIBC).$(KLIBC_SUFFIX)
-KLIBC_SOURCE = $(SRCDIR)/$(KLIBC).$(KLIBC_SUFFIX)
-KLIBC_DIR = $(BUILDDIR)/$(KLIBC)
+KLIBC_SUFFIX = tar.gz
+KLIBC_URL = http://www.kernel.org/pub/linux/libs/klibc/$(KLIBC).$(KLIBC_SUFFIX)
+KLIBC_SOURCE = $(SRCDIR)/$(KLIBC).$(KLIBC_SUFFIX)
+KLIBC_DIR = $(BUILDDIR)/$(KLIBC)
# ----------------------------------------------------------------------------
# Get
@@ -66,30 +66,18 @@ klibc_prepare: $(STATEDIR)/klibc.prepare
#
klibc_prepare_deps = \
$(STATEDIR)/klibc.extract \
- $(STATEDIR)/virtual-xchain.install \
- $(STATEDIR)/kernel.prepare
+ $(STATEDIR)/virtual-xchain.install
KLIBC_PATH = PATH=$(CROSS_PATH)
KLIBC_ENV = $(CROSS_ENV)
-
-KLIBC_MAKEVARS = ARCH=$(PTXCONF_ARCH)
-KLIBC_MAKEVARS += CROSS=$(PTXCONF_COMPILER_PREFIX)
-KLIBC_MAKEVARS += KCROSS=$(PTXCONF_COMPILER_PREFIX)
+KLIBC_ENV += PKG_CONFIG_PATH=$(CROSS_LIB_DIR)/lib/pkgconfig
#
# autoconf
#
-KLIBC_AUTOCONF = $(CROSS_AUTOCONF)
-KLIBC_AUTOCONF += --prefix=$(CROSS_LIB_DIR)
$(STATEDIR)/klibc.prepare: $(klibc_prepare_deps)
@$(call targetinfo, $@)
- @$(call clean, $(KLIBC_DIR)/config.cache)
-ifdef NATIVE
- ln -sf $(KERNEL_HOST_DIR) $(KLIBC_DIR)/linux
-else
- ln -sf $(KERNEL_DIR) $(KLIBC_DIR)/linux
-endif
$(call touch, $@)
# ----------------------------------------------------------------------------
@@ -99,10 +87,11 @@ endif
klibc_compile: $(STATEDIR)/klibc.compile
klibc_compile_deps = $(STATEDIR)/klibc.prepare
+klibc_compile_deps += $(STATEDIR)/kernel.prepare
$(STATEDIR)/klibc.compile: $(klibc_compile_deps)
@$(call targetinfo, $@)
- cd $(KLIBC_DIR) && $(KLIBC_ENV) $(KLIBC_PATH) make $(KLIBC_MAKEVARS)
+ cd $(KLIBC_DIR) && make ARCH=$(PTXCONF_ARCH) CROSS=$(COMPILER_PREFIX) KRNLSRC=$(KERNEL_DIR) prefix=$(PTXCONF_PREFIX)
$(call touch, $@)
# ----------------------------------------------------------------------------
@@ -113,7 +102,96 @@ klibc_install: $(STATEDIR)/klibc.install
$(STATEDIR)/klibc.install: $(STATEDIR)/klibc.compile
@$(call targetinfo, $@)
- # cd $(KLIBC_DIR) && $(KLIBC_ENV) $(KLIBC_PATH) make install
+
+ echo "dir /dev/ 755 0 0" > $(KLIBC_DIR)/initramfs_spec
+ echo "dir /proc/ 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+ echo "dir /sys/ 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+ echo "dir /bin/ 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+ echo "nod /dev/console 644 0 0 c 5 1" >> $(KLIBC_DIR)/initramfs_spec
+ echo "nod /dev/loop0 644 0 0 b 7 0" >> $(KLIBC_DIR)/initramfs_spec
+ifdef PTXCONF_KLIBC_KINIT
+ echo "file /bin/kinit $(KLIBC_DIR)/kinit/kinit 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_SH
+ echo "file /bin/sh $(KLIBC_DIR)/ash/sh 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_CAT
+ echo "file /bin/cat $(KLIBC_DIR)/utils/static/cat 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_INSMOD
+ echo "file /bin/insmod $(KLIBC_DIR)/utils/static/insmod 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_MOUNT
+ echo "file /bin/mount $(KLIBC_DIR)/utils/static/mount 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_DD
+ echo "file /bin/dd $(KLIBC_DIR)/utils/static/dd 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_CHROOT
+ echo "file /bin/chroot $(KLIBC_DIR)/utils/static/chroot 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_FALSE
+ echo "file /bin/false $(KLIBC_DIR)/utils/static/false 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_FSTYPE
+ echo "file /bin/fstype $(KLIBC_DIR)/utils/static/fstype 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_LN
+ echo "file /bin/ln $(KLIBC_DIR)/utils/static/ln 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_MINIPS
+ echo "file /bin/minips $(KLIBC_DIR)/utils/static/minips 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_MKDIR
+ echo "file /bin/mkdir $(KLIBC_DIR)/utils/static/mkdir 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_MKFIFO
+ echo "file /bin/mkfifo $(KLIBC_DIR)/utils/static/mkfifo 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_NUKE
+ echo "file /bin/nuke $(KLIBC_DIR)/utils/static/nuke 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_PIVOT_ROOT
+ echo "file /bin/pivot_root $(KLIBC_DIR)/utils/static/pivot_root 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_PRINTF
+ echo "file /bin/printf $(KLIBC_DIR)/utils/static/printf 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_RUN_INIT
+ echo "file /bin/run-init $(KLIBC_DIR)/utils/static/run-init 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_SLEEP
+ echo "file /bin/sleep $(KLIBC_DIR)/utils/static/sleep 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_TRUE
+ echo "file /bin/true $(KLIBC_DIR)/utils/static/true 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_UMOUNT
+ echo "file /bin/umount $(KLIBC_DIR)/utils/static/umount 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_UNAME
+ echo "file /bin/uname $(KLIBC_DIR)/utils/static/uname 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_NFSMOUNT
+ echo "file /bin/nfsmount $(KLIBC_DIR)/nfsmount/static/nfsmount 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_INIT
+ echo "slink /init $(PTXCONF_KLIBC_INIT) 755 0 0" >> $(KLIBC_DIR)/initramfs_spec
+endif
+ifdef PTXCONF_KLIBC_USER_SPEC
+ cat $(PROJECTDIR)/initramfs_spec | while read type target source rest; do \
+ if [ "$$type" == "file" ]; then \
+ if [ "$$(echo "$$source" | grep "^/")" == "" ]; then \
+ source=$(PROJECTDIR)/$$source; \
+ fi; \
+ fi; \
+ echo "$$type $$target $$source $$rest" >> $(KLIBC_DIR)/initramfs_spec; \
+ done
+endif
+
+ install $(KLIBC_DIR)/$(COMPILER_PREFIX)klcc $(PTXCONF_PREFIX)/bin/$(COMPILER_PREFIX)klcc
+ cd $(KLIBC_DIR) && make ARCH=$(PTXCONF_ARCH) CROSS=$(COMPILER_PREFIX) KRNLSRC=$(KERNEL_DIR) prefix=$(PTXCONF_PREFIX) install
+
$(call touch, $@)
# ----------------------------------------------------------------------------
@@ -126,20 +204,6 @@ klibc_targetinstall_deps = $(STATEDIR)/klibc.compile
$(STATEDIR)/klibc.targetinstall: $(klibc_targetinstall_deps)
@$(call targetinfo, $@)
-
- @$(call install_init,default)
- @$(call install_fixup,PACKAGE,klibc)
- @$(call install_fixup,PRIORITY,optional)
- @$(call install_fixup,VERSION,$(KLIBC_VERSION))
- @$(call install_fixup,SECTION,base)
- @$(call install_fixup,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
- @$(call install_fixup,DEPENDS,)
- @$(call install_fixup,DESCRIPTION,missing)
-
- # @$(call install_copy, 0, 0, 0755, $(KLIBC_DIR)/foobar, /dev/null)
-
- @$(call install_finish)
-
$(call touch, $@)
# ----------------------------------------------------------------------------