1 #############################################################
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
10 GNUGREP_BINARY:=src/grep
11 GNUGREP_TARGET_BINARY:=bin/grep
13 $(DL_DIR)/$(GNUGREP_SOURCE):
14 $(WGET) -P $(DL_DIR) $(GNUGREP_SITE)/$(GNUGREP_SOURCE)
16 grep-source: $(DL_DIR)/$(GNUGREP_SOURCE)
18 $(GNUGREP_DIR)/.unpacked: $(DL_DIR)/$(GNUGREP_SOURCE)
19 rm -rf $(GNUGREP_DIR).xxx
20 $(GNUGREP_CAT) $(DL_DIR)/$(GNUGREP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
21 mv $(GNUGREP_DIR) $(GNUGREP_DIR).xxx
22 $(GNUGREP_CAT) $(GNUGREP_DIR).xxx/grep_2.5.1.tar.gz | tar -C $(BUILD_DIR) -xvf -
23 rm -rf $(GNUGREP_DIR).xxx
24 touch $(GNUGREP_DIR)/.unpacked
26 $(GNUGREP_DIR)/.configured: $(GNUGREP_DIR)/.unpacked
27 (cd $(GNUGREP_DIR); rm -rf config.cache; \
28 $(TARGET_CONFIGURE_OPTS) \
29 CFLAGS="$(TARGET_CFLAGS)" \
31 --target=$(GNU_TARGET_NAME) \
32 --host=$(GNU_TARGET_NAME) \
33 --build=$(GNU_HOST_NAME) \
38 --libexecdir=/usr/lib \
40 --datadir=/usr/share \
41 --localstatedir=/var \
45 $(DISABLE_LARGEFILE) \
46 --disable-perl-regexp \
47 --without-included-regex \
49 touch $(GNUGREP_DIR)/.configured
51 $(GNUGREP_DIR)/$(GNUGREP_BINARY): $(GNUGREP_DIR)/.configured
52 $(MAKE) -C $(GNUGREP_DIR)
54 # This stuff is needed to work around GNU make deficiencies
55 grep-target_binary: $(GNUGREP_DIR)/$(GNUGREP_BINARY)
56 @if [ -L $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) ] ; then \
57 rm -f $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY); fi;
58 @if [ ! -f $(GNUGREP_DIR)/$(GNUGREP_BINARY) -o $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) -ot \
59 $(GNUGREP_DIR)/$(GNUGREP_BINARY) ] ; then \
61 rm -f $(TARGET_DIR)/bin/grep $(TARGET_DIR)/bin/egrep $(TARGET_DIR)/bin/fgrep; \
62 cp -a $(GNUGREP_DIR)/src/grep $(GNUGREP_DIR)/src/egrep \
63 $(GNUGREP_DIR)/src/fgrep $(TARGET_DIR)/bin/; fi
65 grep: uclibc grep-target_binary
68 $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUGREP_DIR) uninstall
69 -$(MAKE) -C $(GNUGREP_DIR) clean