also install required files for HAVE_INCLUDES
[buildroot.git] / package / grep / grep.mk
blob7830a5404875cb74db59303f2361d2cd503db6a1
1 #############################################################
3 # grep
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
14 $(DL_DIR)/$(GNUGREP_SOURCE):
15 $(WGET) -P $(DL_DIR) $(GNUGREP_SITE)/$(GNUGREP_SOURCE)
17 grep-source: $(DL_DIR)/$(GNUGREP_SOURCE)
19 $(GNUGREP_DIR)/.unpacked: $(DL_DIR)/$(GNUGREP_SOURCE)
20 rm -rf $(GNUGREP_DIR).xxx
21 $(GNUGREP_CAT) $(DL_DIR)/$(GNUGREP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
22 mv $(GNUGREP_DIR) $(GNUGREP_DIR).xxx
23 $(GNUGREP_CAT) $(GNUGREP_DIR).xxx/grep_$(GNUGREP_VERSION).tar.gz | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
24 rm -rf $(GNUGREP_DIR).xxx
25 touch $(GNUGREP_DIR)/.unpacked
27 $(GNUGREP_DIR)/.configured: $(GNUGREP_DIR)/.unpacked
28 (cd $(GNUGREP_DIR); rm -rf config.cache; \
29 $(TARGET_CONFIGURE_OPTS) \
30 $(TARGET_CONFIGURE_ARGS) \
31 ./configure \
32 --target=$(GNU_TARGET_NAME) \
33 --host=$(GNU_TARGET_NAME) \
34 --build=$(GNU_HOST_NAME) \
35 --prefix=/usr \
36 --exec-prefix=/usr \
37 --bindir=/usr/bin \
38 --sbindir=/usr/sbin \
39 --libdir=/lib \
40 --libexecdir=/usr/lib \
41 --sysconfdir=/etc \
42 --datadir=/usr/share \
43 --localstatedir=/var \
44 --mandir=/usr/man \
45 --infodir=/usr/info \
46 $(DISABLE_NLS) \
47 $(DISABLE_LARGEFILE) \
48 --disable-perl-regexp \
49 --without-included-regex \
51 touch $(GNUGREP_DIR)/.configured
53 $(GNUGREP_DIR)/$(GNUGREP_BINARY): $(GNUGREP_DIR)/.configured
54 $(MAKE) -C $(GNUGREP_DIR)
56 # This stuff is needed to work around GNU make deficiencies
57 grep-target_binary: $(GNUGREP_DIR)/$(GNUGREP_BINARY)
58 @if [ -L $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) ]; then \
59 rm -f $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY); fi
60 @if [ ! -f $(GNUGREP_DIR)/$(GNUGREP_BINARY) -o $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) -ot \
61 $(GNUGREP_DIR)/$(GNUGREP_BINARY) ]; then \
62 set -x; \
63 rm -f $(TARGET_DIR)/bin/grep $(TARGET_DIR)/bin/egrep $(TARGET_DIR)/bin/fgrep; \
64 cp -a $(GNUGREP_DIR)/src/grep $(GNUGREP_DIR)/src/egrep \
65 $(GNUGREP_DIR)/src/fgrep $(TARGET_DIR)/bin/; fi
67 grep: gettext libintl grep-target_binary
69 grep-clean:
70 $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUGREP_DIR) uninstall
71 -$(MAKE) -C $(GNUGREP_DIR) clean
73 grep-dirclean:
74 rm -rf $(GNUGREP_DIR)
76 #############################################################
78 # Toplevel Makefile options
80 #############################################################
81 ifeq ($(BR2_PACKAGE_GREP),y)
82 TARGETS+=grep
83 endif