Imported Upstream version 4.5.14
[platform/upstream/findutils.git] / locate / Makefile.am
1 # The default database to build and search.
2 AUTOMAKE_OPTIONS = std-options
3 AM_CFLAGS = $(WARN_CFLAGS)
4 LOCATE_DB = $(localstatedir)/locatedb
5 localedir = $(datadir)/locale
6
7 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = \
8         frcode$(EXEEXT) \
9         code$(EXEEXT) \
10         bigram$(EXEEXT)
11 bin_PROGRAMS = locate
12 libexec_PROGRAMS = frcode code bigram
13 bin_SCRIPTS = updatedb
14 man_MANS = locate.1 updatedb.1 locatedb.5
15 BUILT_SOURCES = dblocation.texi
16 EXTRA_DIST = dblocation.texi locatedb.h updatedb.sh $(man_MANS)
17 CLEANFILES = updatedb
18
19 DISTCLEANFILES = dblocation.texi
20 locate_SOURCES = locate.c word_io.c
21 code_SOURCES = code.c word_io.c
22 locate_TEXINFOS = dblocation.texi
23
24 AM_CPPFLAGS = -I$(top_srcdir)/lib -I../gl/lib -I$(top_srcdir)/gl/lib -I../intl -DLOCATE_DB=\"$(LOCATE_DB)\" -DLOCALEDIR=\"$(localedir)\"
25
26 LDADD = ../lib/libfind.a ../gl/lib/libgnulib.a $(LIB_CLOSE) $(LIBINTL)
27
28 $(PROGRAMS) $(LIBPROGRAMS): ../lib/libfind.a ../gl/lib/libgnulib.a
29
30 # We generate updatedb from the Makefile rather than with AC_OUTPUT in
31 # configure.ac in order to allow the user better control of what goes
32 # into it by setting Makefile variables.
33 updatedb: updatedb.sh Makefile
34         rm -f $@
35         find=`echo find|sed '$(transform)'`; \
36         frcode=`echo frcode|sed '$(transform)'`; \
37         bigram=`echo bigram|sed '$(transform)'`; \
38         code=`echo code|sed '$(transform)'`; \
39         sed \
40         -e "s,@""bindir""@,$(bindir)," \
41         -e "s,@""libexecdir""@,$(libexecdir)," \
42         -e "s,@""LOCATE_DB""@,$(LOCATE_DB)," \
43         -e "s,@""VERSION""@,$(VERSION)," \
44         -e "s,@""PACKAGE_NAME""@,$(PACKAGE_NAME)," \
45         -e "s,@""find""@,$${find}," \
46         -e "s,@""frcode""@,$${frcode}," \
47         -e "s,@""bigram""@,$${bigram}," \
48         -e "s,@""code""@,$${code}," \
49         -e "s,@""SORT""@,$(SORT)," \
50         -e "s,@""SORT_SUPPORTS_Z""@,$(SORT_SUPPORTS_Z)," \
51         $(srcdir)/updatedb.sh > $@
52         chmod +x $@
53
54 install-data-hook:
55         $(top_srcdir)/build-aux/mkinstalldirs $(DESTDIR)$(localstatedir)
56
57 dblocation.texi:
58         echo '@set LOCATE_DB $(LOCATE_DB)' > $@.tmp
59         if test -f $@ && cmp $@.tmp $@ >/dev/null ; then \
60             rm $@.tmp ; \
61         else \
62             mv $@.tmp $@ ; \
63         fi
64 .PHONY: dblocation.texi
65
66 SUBDIRS = . testsuite
67
68 dist-hook: findutils-check-manpages
69
70 findutils-check-manpages:
71         $(top_srcdir)/build-aux/man-lint.sh $(srcdir) $(man_MANS)
72
73 # Clean coverage files generated by running binaries built with
74 # gcc -fprofile-arcs -ftest-coverage
75 coverage-clean:
76         $(RM) *.gcno *.gcda *.gcov *.lcov
77
78 clean-local: coverage-clean