| 1 | ## Process this file with automake to create Makefile.in
|
|---|
| 2 | # Copyright 1997-1998, 2005-2021 Free Software Foundation, Inc.
|
|---|
| 3 | #
|
|---|
| 4 | # This program is free software; you can redistribute it and/or modify
|
|---|
| 5 | # it under the terms of the GNU General Public License as published by
|
|---|
| 6 | # the Free Software Foundation; either version 3, or (at your option)
|
|---|
| 7 | # any later version.
|
|---|
| 8 | #
|
|---|
| 9 | # This program is distributed in the hope that it will be useful,
|
|---|
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 12 | # GNU General Public License for more details.
|
|---|
| 13 | #
|
|---|
| 14 | # You should have received a copy of the GNU General Public License
|
|---|
| 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|---|
| 16 |
|
|---|
| 17 | LN = ln
|
|---|
| 18 |
|
|---|
| 19 | AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(PCRE_CFLAGS)
|
|---|
| 20 |
|
|---|
| 21 | # Tell the linker to omit references to unused shared libraries.
|
|---|
| 22 | AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
|
|---|
| 23 |
|
|---|
| 24 | bin_PROGRAMS = grep
|
|---|
| 25 | bin_SCRIPTS = egrep fgrep
|
|---|
| 26 | grep_SOURCES = \
|
|---|
| 27 | dfasearch.c \
|
|---|
| 28 | die.h \
|
|---|
| 29 | grep.c \
|
|---|
| 30 | kwsearch.c \
|
|---|
| 31 | kwset.c \
|
|---|
| 32 | searchutils.c
|
|---|
| 33 | if USE_PCRE
|
|---|
| 34 | grep_SOURCES += pcresearch.c
|
|---|
| 35 | endif
|
|---|
| 36 |
|
|---|
| 37 | noinst_HEADERS = grep.h kwset.h search.h system.h
|
|---|
| 38 |
|
|---|
| 39 | # Sometimes, the expansion of $(LIBINTL) includes -lc which may
|
|---|
| 40 | # include modules defining variables like 'optind', so libgreputils.a
|
|---|
| 41 | # must precede $(LIBINTL) in order to ensure we use GNU getopt.
|
|---|
| 42 | # But libgreputils.a must also follow $(LIBINTL), since libintl uses
|
|---|
| 43 | # replacement functions defined in libgreputils.a.
|
|---|
| 44 | LDADD = \
|
|---|
| 45 | ../lib/libgreputils.a $(LIBINTL) ../lib/libgreputils.a $(LIBICONV) \
|
|---|
| 46 | $(LIBTHREAD)
|
|---|
| 47 |
|
|---|
| 48 | grep_LDADD = $(LDADD) $(PCRE_LIBS) $(LIBCSTACK)
|
|---|
| 49 | localedir = $(datadir)/locale
|
|---|
| 50 | AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
|
|---|
| 51 |
|
|---|
| 52 | EXTRA_DIST = egrep.sh
|
|---|
| 53 |
|
|---|
| 54 | egrep fgrep: egrep.sh Makefile
|
|---|
| 55 | $(AM_V_GEN)grep=`echo grep | sed -e '$(transform)'` && \
|
|---|
| 56 | case $@ in egrep) option=-E;; fgrep) option=-F;; esac && \
|
|---|
| 57 | shell_does_substrings='set x/y && d=$${1%/*} && test "$$d" = x' && \
|
|---|
| 58 | if $(SHELL) -c "$$shell_does_substrings" 2>/dev/null; then \
|
|---|
| 59 | edit_substring='s,X,X,'; \
|
|---|
| 60 | else \
|
|---|
| 61 | edit_substring='s,\$${0%/\*},`expr "X$$0" : '\''X\\(.*\\)/'\''`,g'; \
|
|---|
| 62 | fi && \
|
|---|
| 63 | sed -e 's|[@]SHELL@|$(SHELL)|g' \
|
|---|
| 64 | -e "$$edit_substring" \
|
|---|
| 65 | -e "s|[@]grep@|$$grep|g" \
|
|---|
| 66 | -e "s|[@]option@|$$option|g" <$(srcdir)/egrep.sh >$@-t
|
|---|
| 67 | $(AM_V_at)chmod +x $@-t
|
|---|
| 68 | $(AM_V_at)mv $@-t $@
|
|---|
| 69 |
|
|---|
| 70 | CLEANFILES = egrep fgrep *-t
|
|---|