Blame src/Makefile.am

Packit 709fb3
## Process this file with automake to create Makefile.in
Packit 709fb3
# Copyright 1997-1998, 2005-2017 Free Software Foundation, Inc.
Packit 709fb3
#
Packit 709fb3
# This program is free software; you can redistribute it and/or modify
Packit 709fb3
# it under the terms of the GNU General Public License as published by
Packit 709fb3
# the Free Software Foundation; either version 3, or (at your option)
Packit 709fb3
# any later version.
Packit 709fb3
#
Packit 709fb3
# This program is distributed in the hope that it will be useful,
Packit 709fb3
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 709fb3
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 709fb3
# GNU General Public License for more details.
Packit 709fb3
#
Packit 709fb3
# You should have received a copy of the GNU General Public License
Packit 709fb3
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 709fb3
Packit 709fb3
LN = ln
Packit 709fb3
Packit 709fb3
AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(PCRE_CFLAGS)
Packit 709fb3
Packit 709fb3
# Tell the linker to omit references to unused shared libraries.
Packit 709fb3
AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
Packit 709fb3
Packit 709fb3
bin_PROGRAMS = grep
Packit 709fb3
bin_SCRIPTS = egrep fgrep
Packit 709fb3
grep_SOURCES =					\
Packit 709fb3
  dfasearch.c					\
Packit 709fb3
  die.h						\
Packit 709fb3
  grep.c					\
Packit 709fb3
  kwsearch.c					\
Packit 709fb3
  kwset.c					\
Packit 709fb3
  pcresearch.c					\
Packit 709fb3
  searchutils.c
Packit 709fb3
Packit 709fb3
noinst_HEADERS = grep.h kwset.h search.h system.h
Packit 709fb3
Packit 709fb3
# Sometimes, the expansion of $(LIBINTL) includes -lc which may
Packit 709fb3
# include modules defining variables like 'optind', so libgreputils.a
Packit 709fb3
# must precede $(LIBINTL) in order to ensure we use GNU getopt.
Packit 709fb3
# But libgreputils.a must also follow $(LIBINTL), since libintl uses
Packit 709fb3
# replacement functions defined in libgreputils.a.
Packit 709fb3
LDADD = \
Packit 709fb3
  ../lib/libgreputils.a $(LIBINTL) ../lib/libgreputils.a $(LIBICONV) \
Packit 709fb3
  $(LIBTHREAD)
Packit 709fb3
Packit 709fb3
grep_LDADD = $(LDADD) $(PCRE_LIBS)
Packit 709fb3
localedir = $(datadir)/locale
Packit 709fb3
AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
Packit 709fb3
Packit 709fb3
EXTRA_DIST = egrep.sh
Packit 709fb3
Packit 709fb3
egrep fgrep: egrep.sh Makefile
Packit 709fb3
	$(AM_V_GEN)grep=`echo grep | sed -e '$(transform)'` &&		\
Packit 709fb3
	case $@ in egrep) option=-E;; fgrep) option=-F;; esac &&	\
Packit 709fb3
	shell_does_substrings='set x/y && d=$${1%/*} && test "$$d" = x' && \
Packit 709fb3
	if $(SHELL) -c "$$shell_does_substrings" 2>/dev/null; then	\
Packit 709fb3
	  edit_substring='s,X,X,';					\
Packit 709fb3
	else								\
Packit 709fb3
	  edit_substring='s,\$${0%/\*},`expr "X$$0" : '\''X\\(.*\\)/'\''`,g'; \
Packit 709fb3
	fi &&								\
Packit 709fb3
	sed -e 's|[@]SHELL@|$(SHELL)|g'					\
Packit 709fb3
	    -e "$$edit_substring"					\
Packit 709fb3
	    -e "s|[@]grep@|$$grep|g"					\
Packit 709fb3
	    -e "s|[@]option@|$$option|g" <$(srcdir)/egrep.sh >$@-t
Packit 709fb3
	$(AM_V_at)chmod +x $@-t
Packit 709fb3
	$(AM_V_at)mv $@-t $@
Packit 709fb3
Packit 709fb3
CLEANFILES = egrep fgrep *-t