1 #############################################################
5 #############################################################
6 COREUTILS_SOURCE
:=coreutils-5.0.
tar.bz2
7 COREUTILS_SITE
:=ftp
://ftp.gnu.org
/gnu
/coreutils
/
9 COREUTILS_DIR
:=$(BUILD_DIR
)/coreutils-5.0
10 COREUTILS_BINARY
:=src
/vdir
11 COREUTILS_TARGET_BINARY
:=bin
/vdir
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
15 $(DL_DIR
)/$(COREUTILS_SOURCE
):
16 $(WGET
) -P
$(DL_DIR
) $(COREUTILS_SITE
)/$(COREUTILS_SOURCE
)
18 coreutils-source
: $(DL_DIR
)/$(COREUTILS_SOURCE
)
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
24 $(COREUTILS_DIR
)/.configured
: $(COREUTILS_DIR
)/.unpacked
25 (cd
$(COREUTILS_DIR
); rm -rf config.cache
; \
26 $(TARGET_CONFIGURE_OPTS
) \
27 CFLAGS
="$(TARGET_CFLAGS)" \
29 --target
=$(GNU_TARGET_NAME
) \
30 --host
=$(GNU_TARGET_NAME
) \
31 --build
=$(GNU_HOST_NAME
) \
36 --libexecdir
=/usr
/lib \
38 --datadir=/usr
/share \
39 --localstatedir
=/var \
43 $(DISABLE_LARGEFILE
) \
45 --disable-dependency-tracking \
47 #Fix up the max number of open files per process, which apparently
48 # is not set when cross compiling
49 $(SED
) 's,.*UTILS_OPEN_MAX.*,#define UTILS_OPEN_MAX 1019,g' \
50 $(COREUTILS_DIR
)/config.h
51 # This is undefined when crosscompiling...
52 $(SED
) 's,.*HAVE_PROC_UPTIME.*,#define HAVE_PROC_UPTIME 1,g' \
53 $(COREUTILS_DIR
)/config.h
54 touch
$(COREUTILS_DIR
)/.configured
56 $(COREUTILS_DIR
)/$(COREUTILS_BINARY
): $(COREUTILS_DIR
)/.configured
57 $(MAKE
) CC
=$(TARGET_CC
) -C
$(COREUTILS_DIR
)
58 rm -f
$(TARGET_DIR
)/$(COREUTILS_TARGET_BINARY
)
60 $(TARGET_DIR
)/$(COREUTILS_TARGET_BINARY
): $(COREUTILS_DIR
)/$(COREUTILS_BINARY
)
61 $(MAKE
) DESTDIR
=$(TARGET_DIR
) CC
=$(TARGET_CC
) -C
$(COREUTILS_DIR
) install
62 # some things go in root rather than usr
63 for f in
$(BIN_PROGS
); do \
64 mv
$(TARGET_DIR
)/usr
/bin
/$$f $(TARGET_DIR
)/bin
/$$f; \
66 # link for archaic shells
67 ln
-fs
test $(TARGET_DIR
)/usr
/bin
/[
68 # gnu thinks chroot is in bin, debian thinks it's in sbin
69 mv
$(TARGET_DIR
)/usr
/bin
/chroot
$(TARGET_DIR
)/usr
/sbin
/chroot
70 $(STRIP
) $(TARGET_DIR
)/usr
/sbin
/chroot
> /dev
/null
2>&1
71 rm -rf
$(TARGET_DIR
)/share
/locale
$(TARGET_DIR
)/usr
/info \
72 $(TARGET_DIR
)/usr
/man
$(TARGET_DIR
)/usr
/share
/doc
74 coreutils
: uclibc
$(TARGET_DIR
)/$(COREUTILS_TARGET_BINARY
)
77 $(MAKE
) DESTDIR
=$(TARGET_DIR
) CC
=$(TARGET_CC
) -C
$(COREUTILS_DIR
) uninstall
78 -$(MAKE
) -C
$(COREUTILS_DIR
) clean
81 rm -rf
$(COREUTILS_DIR
)