summaryrefslogtreecommitdiff
path: root/find/Makefile.am
blob: 0795b876f45ce9099b76e816ded2069f96660718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
AUTOMAKE_OPTIONS = std-options
AM_CFLAGS = $(WARN_CFLAGS)
localedir = $(datadir)/locale
# noinst_PROGRAMS = regexprops
# regexprops_SOURCES = regexprops.c

noinst_LIBRARIES = libfindtools.a
libfindtools_a_SOURCES = finddata.c fstype.c parser.c pred.c exec.c tree.c util.c sharefile.c print.c
libfindtools_coverage_files = \
	$(libfindtools_a_SOURCES:.c=.gcno) \
	$(libfindtools_a_SOURCES:.c=.gcda)

# We always build two versions of find, one with fts, one without.
# Their names depend on whether the user specified --with-fts.
#
# --with-fts            find            extra binary
#       yes             with fts        'oldfind', without fts
#        no             without fts     'ftsfind', with fts
#
if WITH_FTS
bin_PROGRAMS     = find oldfind
find_SOURCES     = ftsfind.c
oldfind_SOURCES  = find.c
find_coverage_files = $(oldfind_SOURCES:.c=.gcno) $(find_SOURCES:.c=.gcno) \
                      $(oldfind_SOURCES:.c=.gcda) $(find_SOURCES:.c=.gcda)
man_MANS         = find.1 oldfind.1
else
bin_PROGRAMS      = find ftsfind
find_SOURCES      = find.c
ftsfind_SOURCES   = ftsfind.c
find_coverage_files = $(ftsfind_SOURCES:.c=.gcno) $(find_SOURCES:.c=.gcno) \
                      $(ftsfind_SOURCES:.c=.gcda) $(find_SOURCES:.c=.gcda)
man_MANS          = find.1 ftsfind.1
endif

# We don't just include man_MANS in EXTRA_DIST because while the value of
# man_MANS is not always the same, we want to distribute all of those files.
EXTRA_DIST = defs.h sharefile.h print.h find.1 ftsfind.1 oldfind.1
INCLUDES = -I../gl/lib -I$(top_srcdir)/lib -I$(top_srcdir)/gl/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
LDADD = ./libfindtools.a ../lib/libfind.a ../gl/lib/libgnulib.a $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_SELINUX) $(LIB_CLOSE) $(MODF_LIBM) $(FINDLIBS) $(GETHOSTNAME_LIB) $(LIB_EACCESS)
# gnulib advises we link against <first> because we use <second>:
# $(GETHOSTNAME_LIB)            uname
# $(LIB_CLOCK_GETTIME)          (some inditrect dependency)
# $(LIB_EACCESS)                faccessat
# $(LIB_SELINUX)                selinux-h
# $(MODF_LIBM)                  modf

SUBDIRS = . testsuite

#$(PROGRAMS): ../lib/libfind.a

dist-hook: findutils-check-manpages

# Clean coverage files generated by running binaries built with
# gcc -fprofile-arcs -ftest-coverage
CLEANFILES = $(libfindtools_coverage_files) $(find_coverage_files)

findutils-check-manpages:
	$(top_srcdir)/build-aux/man-lint.sh $(srcdir) $(man_MANS)