blob: bd09e5780ad4d89ed1cba517703814aa5394f052 [file] [log] [blame]
Eric Andersen77bf6fb2002-10-23 12:54:42 +00001#############################################################
2#
3# coreutils
4#
5#############################################################
Eric Andersend35e9812003-06-25 21:22:00 +00006COREUTILS_SOURCE:=coreutils-5.0.tar.bz2
7COREUTILS_SITE:=ftp://ftp.gnu.org/gnu/coreutils/
Eric Andersen77bf6fb2002-10-23 12:54:42 +00008COREUTILS_CAT:=bzcat
Eric Andersend35e9812003-06-25 21:22:00 +00009COREUTILS_DIR:=$(BUILD_DIR)/coreutils-5.0
Eric Andersen55de6e52003-03-06 17:44:29 +000010COREUTILS_BINARY:=src/vdir
11COREUTILS_TARGET_BINARY:=bin/vdir
Eric Andersen0811c2d2003-03-10 17:45:39 +000012BIN_PROGS:=cat chgrp chmod chown cp date dd df dir echo false hostname \
13 ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true uname
Eric Andersen77bf6fb2002-10-23 12:54:42 +000014
15$(DL_DIR)/$(COREUTILS_SOURCE):
Eric Andersen8a2597e2002-11-20 23:16:10 +000016 $(WGET) -P $(DL_DIR) $(COREUTILS_SITE)/$(COREUTILS_SOURCE)
Eric Andersen77bf6fb2002-10-23 12:54:42 +000017
18coreutils-source: $(DL_DIR)/$(COREUTILS_SOURCE)
19
20$(COREUTILS_DIR)/.unpacked: $(DL_DIR)/$(COREUTILS_SOURCE)
21 $(COREUTILS_CAT) $(DL_DIR)/$(COREUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
22 touch $(COREUTILS_DIR)/.unpacked
23
24$(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked
Eric Andersenef7784a2003-01-17 08:03:59 +000025 (cd $(COREUTILS_DIR); rm -rf config.cache; \
Eric Andersen1fc3f2f2003-03-04 19:16:19 +000026 $(TARGET_CONFIGURE_OPTS) \
Manuel Novoa III d632d422003-11-01 05:34:41 +000027 CFLAGS="$(TARGET_CFLAGS)" \
Manuel Novoa III 68579662004-05-28 17:50:07 +000028 ac_cv_func_strtod=yes \
Eric Andersenef7784a2003-01-17 08:03:59 +000029 ./configure \
30 --target=$(GNU_TARGET_NAME) \
Eric Andersen1fc3f2f2003-03-04 19:16:19 +000031 --host=$(GNU_TARGET_NAME) \
32 --build=$(GNU_HOST_NAME) \
Eric Andersenef7784a2003-01-17 08:03:59 +000033 --prefix=/usr \
34 --exec-prefix=/usr \
35 --bindir=/usr/bin \
36 --sbindir=/usr/sbin \
37 --libexecdir=/usr/lib \
38 --sysconfdir=/etc \
39 --datadir=/usr/share \
40 --localstatedir=/var \
41 --mandir=/usr/man \
42 --infodir=/usr/info \
Manuel Novoa III 0e956fc2003-09-03 07:18:18 +000043 $(DISABLE_NLS) \
Manuel Novoa III 50e1da82003-11-17 01:31:38 +000044 $(DISABLE_LARGEFILE) \
Eric Andersenec59e372003-03-31 20:01:12 +000045 --disable-rpath \
46 --disable-dependency-tracking \
Eric Andersen77bf6fb2002-10-23 12:54:42 +000047 );
Eric Andersen1fc3f2f2003-03-04 19:16:19 +000048 #Fix up the max number of open files per process, which apparently
49 # is not set when cross compiling
Eric Andersen4f889ad2003-11-19 17:17:56 +000050 $(SED) 's,.*UTILS_OPEN_MAX.*,#define UTILS_OPEN_MAX 1019,g' \
Eric Andersen1fc3f2f2003-03-04 19:16:19 +000051 $(COREUTILS_DIR)/config.h
Manuel Novoa III 0e956fc2003-09-03 07:18:18 +000052 # This is undefined when crosscompiling...
Eric Andersen4f889ad2003-11-19 17:17:56 +000053 $(SED) 's,.*HAVE_PROC_UPTIME.*,#define HAVE_PROC_UPTIME 1,g' \
Manuel Novoa III 0e956fc2003-09-03 07:18:18 +000054 $(COREUTILS_DIR)/config.h
Eric Andersen77bf6fb2002-10-23 12:54:42 +000055 touch $(COREUTILS_DIR)/.configured
56
57$(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured
Eric Andersena9bfe852003-01-19 06:07:22 +000058 $(MAKE) CC=$(TARGET_CC) -C $(COREUTILS_DIR)
Eric Andersen55de6e52003-03-06 17:44:29 +000059 rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
Eric Andersen77bf6fb2002-10-23 12:54:42 +000060
61$(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY)
Eric Andersena9bfe852003-01-19 06:07:22 +000062 $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) install
Eric Andersen77bf6fb2002-10-23 12:54:42 +000063 # some things go in root rather than usr
64 for f in $(BIN_PROGS); do \
65 mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \
66 done
67 # link for archaic shells
68 ln -fs test $(TARGET_DIR)/usr/bin/[
69 # gnu thinks chroot is in bin, debian thinks it's in sbin
70 mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot
Manuel Novoa III d632d422003-11-01 05:34:41 +000071 $(STRIP) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1
Eric Andersen5dbea592003-01-17 08:51:21 +000072 rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
73 $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
Eric Andersen77bf6fb2002-10-23 12:54:42 +000074
75coreutils: uclibc $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
76
77coreutils-clean:
Eric Andersena9bfe852003-01-19 06:07:22 +000078 $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) uninstall
Eric Andersenef7784a2003-01-17 08:03:59 +000079 -$(MAKE) -C $(COREUTILS_DIR) clean
Eric Andersen77bf6fb2002-10-23 12:54:42 +000080
81coreutils-dirclean:
82 rm -rf $(COREUTILS_DIR)
83