grep.mk 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #############################################################
  2. #
  3. # grep
  4. #
  5. #############################################################
  6. GNUGREP_SOURCE:=grep_2.5.1.ds1.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. rm -rf $(GNUGREP_DIR).xxx
  17. $(GNUGREP_CAT) $(DL_DIR)/$(GNUGREP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  18. mv $(GNUGREP_DIR) $(GNUGREP_DIR).xxx
  19. $(GNUGREP_CAT) $(GNUGREP_DIR).xxx/grep_2.5.1.tar.gz | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  20. rm -rf $(GNUGREP_DIR).xxx
  21. touch $(GNUGREP_DIR)/.unpacked
  22. $(GNUGREP_DIR)/.configured: $(GNUGREP_DIR)/.unpacked
  23. (cd $(GNUGREP_DIR); rm -rf config.cache; \
  24. $(TARGET_CONFIGURE_OPTS) \
  25. CFLAGS="$(TARGET_CFLAGS)" \
  26. ./configure \
  27. --target=$(GNU_TARGET_NAME) \
  28. --host=$(GNU_TARGET_NAME) \
  29. --build=$(GNU_HOST_NAME) \
  30. --prefix=/usr \
  31. --exec-prefix=/usr \
  32. --bindir=/usr/bin \
  33. --sbindir=/usr/sbin \
  34. --libexecdir=/usr/lib \
  35. --sysconfdir=/etc \
  36. --datadir=/usr/share \
  37. --localstatedir=/var \
  38. --mandir=/usr/man \
  39. --infodir=/usr/info \
  40. $(DISABLE_NLS) \
  41. $(DISABLE_LARGEFILE) \
  42. --disable-perl-regexp \
  43. --without-included-regex \
  44. );
  45. touch $(GNUGREP_DIR)/.configured
  46. $(GNUGREP_DIR)/$(GNUGREP_BINARY): $(GNUGREP_DIR)/.configured
  47. $(MAKE) -C $(GNUGREP_DIR)
  48. # This stuff is needed to work around GNU make deficiencies
  49. grep-target_binary: $(GNUGREP_DIR)/$(GNUGREP_BINARY)
  50. @if [ -L $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) ] ; then \
  51. rm -f $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY); fi;
  52. @if [ ! -f $(GNUGREP_DIR)/$(GNUGREP_BINARY) -o $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) -ot \
  53. $(GNUGREP_DIR)/$(GNUGREP_BINARY) ] ; then \
  54. set -x; \
  55. rm -f $(TARGET_DIR)/bin/grep $(TARGET_DIR)/bin/egrep $(TARGET_DIR)/bin/fgrep; \
  56. cp -a $(GNUGREP_DIR)/src/grep $(GNUGREP_DIR)/src/egrep \
  57. $(GNUGREP_DIR)/src/fgrep $(TARGET_DIR)/bin/; fi
  58. grep: uclibc grep-target_binary
  59. grep-clean:
  60. $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUGREP_DIR) uninstall
  61. -$(MAKE) -C $(GNUGREP_DIR) clean
  62. grep-dirclean:
  63. rm -rf $(GNUGREP_DIR)
  64. #############################################################
  65. #
  66. # Toplevel Makefile options
  67. #
  68. #############################################################
  69. ifeq ($(strip $(BR2_PACKAGE_GREP)),y)
  70. TARGETS+=grep
  71. endif