libctf: enable silent build rules
[binutils-gdb.git] / libctf / Makefile.am
1 ## Process this file with automake to produce Makefile.in.
2 #
3 # Copyright (C) 2019-2021 Free Software Foundation, Inc.
4 #
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; see the file COPYING. If not see
17 # <http://www.gnu.org/licenses/>.
18 #
19
20 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
21
22 AUTOMAKE_OPTIONS = dejagnu foreign no-texinfo.tex
23
24 if BUILD_INFO
25 SUBDIRS = doc
26 endif
27
28 # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
29 # -I../zlib, unless we were configured with --with-system-zlib, in which
30 # case both are empty.
31 ZLIB = @zlibdir@ -lz
32 ZLIBINC = @zlibinc@
33
34 BASEDIR = $(srcdir)/..
35 BFDDIR = $(BASEDIR)/bfd
36 INCDIR = $(srcdir)/../include
37 AM_CPPFLAGS = -D_GNU_SOURCE -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../bfd -I../bfd @INCINTL@
38 AM_CFLAGS = -std=gnu99 @ac_libctf_warn_cflags@ @warn@ @c_warn@ @WARN_PEDANTIC@ @WERROR@ $(ZLIBINC)
39
40 if INSTALL_LIBBFD
41 lib_LTLIBRARIES = libctf.la libctf-nobfd.la
42 include_HEADERS = $(INCDIR)/ctf.h $(INCDIR)/ctf-api.h
43 else
44 include_HEADERS =
45 noinst_LTLIBRARIES = libctf.la libctf-nobfd.la
46 endif
47
48 libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB)
49 libctf_ldflags_nover = -version-info 0:0:0 @SHARED_LDFLAGS@
50 libctf_nobfd_la_LDFLAGS = $(libctf_ldflags_nover) @VERSION_FLAGS_NOBFD@
51 libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
52 libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c \
53 ctf-hash.c ctf-labels.c ctf-dedup.c ctf-link.c ctf-lookup.c \
54 ctf-open.c ctf-serialize.c ctf-sha1.c ctf-string.c ctf-subr.c \
55 ctf-types.c ctf-util.c
56 if NEED_CTF_QSORT_R
57 libctf_nobfd_la_SOURCES += ctf-qsort_r.c
58 endif
59
60 # @CTF_LIBADD@ appears here twice: once, to force libiberty to get searched before
61 # install-time libbfd adds a -L to the install dir (possibly pointing at an
62 # incompatible libiberty), and once via lictf_nobfd_la_LIBADD so that the
63 # references in there get picked up.
64 libctf_la_LIBADD = @CTF_LIBADD@ ../bfd/libbfd.la $(libctf_nobfd_la_LIBADD)
65 libctf_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=0
66 libctf_la_LDFLAGS = $(libctf_ldflags_nover) @VERSION_FLAGS@
67 libctf_la_SOURCES = $(libctf_nobfd_la_SOURCES) ctf-open-bfd.c
68
69 # Setup the testing framework, if you have one
70 EXPECT = expect
71 RUNTEST = runtest
72 RUNTESTFLAGS =
73
74 if TCL_TRY
75 CC_FOR_TARGET = ` \
76 if [ -f $$r/../gcc/xgcc ] ; then \
77 if [ -f $$r/../newlib/Makefile ] ; then \
78 echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
79 else \
80 echo $$r/../gcc/xgcc -B$$r/../gcc/; \
81 fi; \
82 else \
83 if [ "@host@" = "@target@" ] ; then \
84 echo $(CC); \
85 else \
86 echo gcc | sed '$(transform)'; \
87 fi; \
88 fi`
89
90 check-DEJAGNU: site.exp development.exp
91 srcroot=`cd $(srcdir) && pwd`; export srcroot; \
92 r=`pwd`; export r; \
93 LC_ALL=C; export LC_ALL; \
94 EXPECT=$(EXPECT); export EXPECT; \
95 runtest=$(RUNTEST); \
96 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
97 $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
98 CC="$(CC)" CC_FOR_TARGET="$(CC_FOR_TARGET)" \
99 CFLAGS="$(CFLAGS) -I$(INCDIR) -I$(srcdir) -I$(builddir) -I$(builddir)/../bfd $(ZLIBINC)" \
100 LIBS="$(libctf_nobfd_la_LIBADD) $(LIBS)" $(RUNTESTFLAGS); \
101 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
102 fi
103
104 development.exp: $(BFDDIR)/development.sh
105 $(AM_V_GEN)$(EGREP) "(development|experimental)=" $(BFDDIR)/development.sh \
106 | $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@
107
108 # development.sh is used to determine -Werror default.
109 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
110
111 EXTRA_DEJAGNU_SITE_CONFIG = development.exp
112
113 DISTCLEANFILES = site.exp development.exp
114 endif