Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 1 | ############################################################# |
| 2 | # |
| 3 | # coreutils |
| 4 | # |
| 5 | ############################################################# |
Eric Andersen | d35e981 | 2003-06-25 21:22:00 +0000 | [diff] [blame] | 6 | COREUTILS_SOURCE:=coreutils-5.0.tar.bz2 |
| 7 | COREUTILS_SITE:=ftp://ftp.gnu.org/gnu/coreutils/ |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 8 | COREUTILS_CAT:=bzcat |
Eric Andersen | d35e981 | 2003-06-25 21:22:00 +0000 | [diff] [blame] | 9 | COREUTILS_DIR:=$(BUILD_DIR)/coreutils-5.0 |
Eric Andersen | 55de6e5 | 2003-03-06 17:44:29 +0000 | [diff] [blame] | 10 | COREUTILS_BINARY:=src/vdir |
| 11 | COREUTILS_TARGET_BINARY:=bin/vdir |
Eric Andersen | 0811c2d | 2003-03-10 17:45:39 +0000 | [diff] [blame] | 12 | BIN_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 Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 14 | |
| 15 | $(DL_DIR)/$(COREUTILS_SOURCE): |
Eric Andersen | 8a2597e | 2002-11-20 23:16:10 +0000 | [diff] [blame] | 16 | $(WGET) -P $(DL_DIR) $(COREUTILS_SITE)/$(COREUTILS_SOURCE) |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 17 | |
| 18 | coreutils-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 Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 25 | (cd $(COREUTILS_DIR); rm -rf config.cache; \ |
Eric Andersen | 1fc3f2f | 2003-03-04 19:16:19 +0000 | [diff] [blame] | 26 | $(TARGET_CONFIGURE_OPTS) \ |
Manuel Novoa III | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame] | 27 | CFLAGS="$(TARGET_CFLAGS)" \ |
Manuel Novoa III | 6857966 | 2004-05-28 17:50:07 +0000 | [diff] [blame^] | 28 | ac_cv_func_strtod=yes \ |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 29 | ./configure \ |
| 30 | --target=$(GNU_TARGET_NAME) \ |
Eric Andersen | 1fc3f2f | 2003-03-04 19:16:19 +0000 | [diff] [blame] | 31 | --host=$(GNU_TARGET_NAME) \ |
| 32 | --build=$(GNU_HOST_NAME) \ |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 33 | --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 | 0e956fc | 2003-09-03 07:18:18 +0000 | [diff] [blame] | 43 | $(DISABLE_NLS) \ |
Manuel Novoa III | 50e1da8 | 2003-11-17 01:31:38 +0000 | [diff] [blame] | 44 | $(DISABLE_LARGEFILE) \ |
Eric Andersen | ec59e37 | 2003-03-31 20:01:12 +0000 | [diff] [blame] | 45 | --disable-rpath \ |
| 46 | --disable-dependency-tracking \ |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 47 | ); |
Eric Andersen | 1fc3f2f | 2003-03-04 19:16:19 +0000 | [diff] [blame] | 48 | #Fix up the max number of open files per process, which apparently |
| 49 | # is not set when cross compiling |
Eric Andersen | 4f889ad | 2003-11-19 17:17:56 +0000 | [diff] [blame] | 50 | $(SED) 's,.*UTILS_OPEN_MAX.*,#define UTILS_OPEN_MAX 1019,g' \ |
Eric Andersen | 1fc3f2f | 2003-03-04 19:16:19 +0000 | [diff] [blame] | 51 | $(COREUTILS_DIR)/config.h |
Manuel Novoa III | 0e956fc | 2003-09-03 07:18:18 +0000 | [diff] [blame] | 52 | # This is undefined when crosscompiling... |
Eric Andersen | 4f889ad | 2003-11-19 17:17:56 +0000 | [diff] [blame] | 53 | $(SED) 's,.*HAVE_PROC_UPTIME.*,#define HAVE_PROC_UPTIME 1,g' \ |
Manuel Novoa III | 0e956fc | 2003-09-03 07:18:18 +0000 | [diff] [blame] | 54 | $(COREUTILS_DIR)/config.h |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 55 | touch $(COREUTILS_DIR)/.configured |
| 56 | |
| 57 | $(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured |
Eric Andersen | a9bfe85 | 2003-01-19 06:07:22 +0000 | [diff] [blame] | 58 | $(MAKE) CC=$(TARGET_CC) -C $(COREUTILS_DIR) |
Eric Andersen | 55de6e5 | 2003-03-06 17:44:29 +0000 | [diff] [blame] | 59 | rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 60 | |
| 61 | $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY) |
Eric Andersen | a9bfe85 | 2003-01-19 06:07:22 +0000 | [diff] [blame] | 62 | $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) install |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 63 | # 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 | d632d42 | 2003-11-01 05:34:41 +0000 | [diff] [blame] | 71 | $(STRIP) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1 |
Eric Andersen | 5dbea59 | 2003-01-17 08:51:21 +0000 | [diff] [blame] | 72 | rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ |
| 73 | $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 74 | |
| 75 | coreutils: uclibc $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) |
| 76 | |
| 77 | coreutils-clean: |
Eric Andersen | a9bfe85 | 2003-01-19 06:07:22 +0000 | [diff] [blame] | 78 | $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) uninstall |
Eric Andersen | ef7784a | 2003-01-17 08:03:59 +0000 | [diff] [blame] | 79 | -$(MAKE) -C $(COREUTILS_DIR) clean |
Eric Andersen | 77bf6fb | 2002-10-23 12:54:42 +0000 | [diff] [blame] | 80 | |
| 81 | coreutils-dirclean: |
| 82 | rm -rf $(COREUTILS_DIR) |
| 83 | |