grep.mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #############################################################
  2. #
  3. # grep
  4. #
  5. #############################################################
  6. GNUGREP_SOURCE:=grep_2.5.1.orig.tar.gz
  7. GNUGREP_SITE:=http://ftp.debian.org/debian/pool/main/g/grep/
  8. GNUGREP_DIR:=$(BUILD_DIR)/grep-2.5.1
  9. GNUGREP_CAT:=zcat
  10. GNUGREP_BINARY:=src/grep
  11. GNUGREP_TARGET_BINARY:=bin/grep
  12. $(DL_DIR)/$(GNUGREP_SOURCE):
  13. $(WGET) -P $(DL_DIR) $(GNUGREP_SITE)/$(GNUGREP_SOURCE)
  14. grep-source: $(DL_DIR)/$(GNUGREP_SOURCE)
  15. $(GNUGREP_DIR)/.unpacked: $(DL_DIR)/$(GNUGREP_SOURCE)
  16. $(GNUGREP_CAT) $(DL_DIR)/$(GNUGREP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
  17. touch $(GNUGREP_DIR)/.unpacked
  18. $(GNUGREP_DIR)/.configured: $(GNUGREP_DIR)/.unpacked
  19. (cd $(GNUGREP_DIR); rm -rf config.cache; \
  20. $(TARGET_CONFIGURE_OPTS) \
  21. CFLAGS="$(TARGET_CFLAGS)" \
  22. ./configure \
  23. --target=$(GNU_TARGET_NAME) \
  24. --host=$(GNU_TARGET_NAME) \
  25. --build=$(GNU_HOST_NAME) \
  26. --prefix=/usr \
  27. --exec-prefix=/usr \
  28. --bindir=/usr/bin \
  29. --sbindir=/usr/sbin \
  30. --libexecdir=/usr/lib \
  31. --sysconfdir=/etc \
  32. --datadir=/usr/share \
  33. --localstatedir=/var \
  34. --mandir=/usr/man \
  35. --infodir=/usr/info \
  36. $(DISABLE_NLS) \
  37. $(DISABLE_LARGEFILE) \
  38. --disable-perl-regexp \
  39. --without-included-regex \
  40. );
  41. touch $(GNUGREP_DIR)/.configured
  42. $(GNUGREP_DIR)/$(GNUGREP_BINARY): $(GNUGREP_DIR)/.configured
  43. $(MAKE) -C $(GNUGREP_DIR)
  44. # This stuff is needed to work around GNU make deficiencies
  45. grep-target_binary: $(GNUGREP_DIR)/$(GNUGREP_BINARY)
  46. @if [ -L $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) ] ; then \
  47. rm -f $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY); fi;
  48. @if [ ! -f $(GNUGREP_DIR)/$(GNUGREP_BINARY) -o $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) -ot \
  49. $(GNUGREP_DIR)/$(GNUGREP_BINARY) ] ; then \
  50. set -x; \
  51. rm -f $(TARGET_DIR)/bin/grep $(TARGET_DIR)/bin/egrep $(TARGET_DIR)/bin/fgrep; \
  52. cp -a $(GNUGREP_DIR)/src/grep $(GNUGREP_DIR)/src/egrep \
  53. $(GNUGREP_DIR)/src/fgrep $(TARGET_DIR)/bin/; fi
  54. grep: uclibc grep-target_binary
  55. grep-clean:
  56. $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUGREP_DIR) uninstall
  57. -$(MAKE) -C $(GNUGREP_DIR) clean
  58. grep-dirclean:
  59. rm -rf $(GNUGREP_DIR)