summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-01-15 14:04:57 +0000
committerBernhard Reutner-Fischer2006-01-15 14:04:57 +0000
commit7ca61b6f3379bf66b446617b8834d92c13b366dd (patch)
treec0aaacfeb97a9bc74e73f8ff36ecbf1fd173808b /coreutils
parent8c9daa12dcb4c1aa8f0f475896c9cfbcfb38370d (diff)
downloadbusybox-7ca61b6f3379bf66b446617b8834d92c13b366dd.zip
busybox-7ca61b6f3379bf66b446617b8834d92c13b366dd.tar.gz
- shared libbusybox.
- IMA compilation option (aka IPO, IPA,..) Please holler if i broke something..
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/Makefile.in5
-rw-r--r--coreutils/libcoreutils/Makefile.in55
2 files changed, 40 insertions, 20 deletions
diff --git a/coreutils/Makefile.in b/coreutils/Makefile.in
index 9dc604b..54ccf92 100644
--- a/coreutils/Makefile.in
+++ b/coreutils/Makefile.in
@@ -81,7 +81,12 @@ COREUTILS-$(CONFIG_WHO) += who.o
COREUTILS-$(CONFIG_WHOAMI) += whoami.o
COREUTILS-$(CONFIG_YES) += yes.o
+COREUTILS-y:=$(sort $(COREUTILS-y))
libraries-y+=$(COREUTILS_DIR)$(COREUTILS_AR)
+COREUTILS_SRC-y:=$(patsubst %.o,$(srcdir)/%.c,$(COREUTILS-y))
+COREUTILS_SRC-a:=$(wildcard $(srcdir)/*.c)
+APPLET_SRC-y+=$(COREUTILS_SRC-y)
+APPLET_SRC-a+=$(COREUTILS_SRC-a)
$(COREUTILS_DIR)$(COREUTILS_AR): $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
$(AR) $(ARFLAGS) $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
diff --git a/coreutils/libcoreutils/Makefile.in b/coreutils/libcoreutils/Makefile.in
index fe66c82..1f0c19e 100644
--- a/coreutils/libcoreutils/Makefile.in
+++ b/coreutils/libcoreutils/Makefile.in
@@ -2,36 +2,51 @@
#
# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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
-# General Public License for more details.
-#
-# You should have received a copy of the GNU 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
+# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
#
LIBCOREUTILS_AR:=libcoreutils.a
ifndef $(LIBCOREUTILS_DIR)
-LIBCOREUTILS_DIR:=$(top_builddir)/coreutils/libcoreutils/
+LIBCOREUTILS_DIR:=$(top_builddir)/coreutils/libcoreutils
endif
srcdir=$(top_srcdir)/coreutils/libcoreutils
-LIBCOREUTILS_SRC:= cp_mv_stat.c getopt_mk_fifo_nod.c
+LIBCOREUTILS_ALL_SRC:= cp_mv_stat.c getopt_mk_fifo_nod.c
+
+LIBCOREUTILS-y:=
+LIBCOREUTILS-$(CONFIG_MKFIFO) += getopt_mk_fifo_nod.o
+LIBCOREUTILS-$(CONFIG_MKNOD) += getopt_mk_fifo_nod.o
+LIBCOREUTILS-$(CONFIG_INSTALL) += cp_mv_stat.o
+LIBCOREUTILS-$(CONFIG_CP) += cp_mv_stat.o
+LIBCOREUTILS-$(CONFIG_MV) += cp_mv_stat.o
+
+LIBCOREUTILS-y:=$(sort $(LIBCOREUTILS-y))
+
+LIBCOREUTILS_SRC-y:=$(patsubst %,$(srcdir)/%,$(subst .o,.c,$(LIBCOREUTILS-y)))
+LIBCOREUTILS_SRC-a:=$(wildcard $(srcdir)/*.c)
+LIBRARY_SRC-y+=$(LIBCOREUTILS_SRC-y)
+LIBRARY_SRC-a+=$(LIBCOREUTILS_SRC-a)
-LIBCOREUTILS_OBJS=$(patsubst %.c,$(LIBCOREUTILS_DIR)%.o, $(LIBCOREUTILS_SRC))
+LIBCOREUTILS-multi-obj:=$(LIBCOREUTILS_DIR)/$(subst .a,-multi.o,$(LIBCOREUTILS_AR))
+LIBCOREUTILS-multi-pic:=$(LIBCOREUTILS_DIR)/$(subst .a,-pic.o,$(LIBCOREUTILS_AR))
+
+# We do not need to build an empty non-pic object/archive
+ifneq ($(strip $(LIBCOREUTILS-y)),)
+libraries-y+=$(LIBCOREUTILS_DIR)/$(LIBCOREUTILS_AR)
+endif
+# If we are building libbusybox.so _and_ we will use it ourselves then we
+# keep it as small as possible
+ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
+ifneq ($(strip $(LIBIPROUTE-y)),)
+libraries-m+=$(LIBCOREUTILS-multi-pic)
+endif
+endif
-libraries-y+=$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR)
+LIBCOREUTILS_OBJS=$(patsubst %,$(LIBCOREUTILS_DIR)/%, $(LIBCOREUTILS-y))
-$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR): $(LIBCOREUTILS_OBJS)
- $(AR) $(ARFLAGS) $@ $(LIBCOREUTILS_OBJS)
+$(LIBCOREUTILS_DIR)/$(LIBCOREUTILS_AR): $(patsubst %,$(LIBCOREUTILS_DIR)/%,$(LIBCOREUTILS-y))
+ $(AR) $(ARFLAGS) $(@) $(^)
-$(LIBCOREUTILS_DIR)%.o: $(srcdir)/%.c
+$(LIBCOREUTILS_DIR)/%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<