grep.mk 2.6 KB

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