1 ## Makefile for the VTV library.
3 ## Copyright (C) 2013-2020 Free Software Foundation, Inc.
5 ## Process this file with automake to produce Makefile.in.
7 ## This file is part of the Vtable Verification (VTV) Library. This
8 ## library is free software; you can redistribute it and/or modify it
9 ## under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 3, or (at your option)
13 ## This library is distributed in the hope that it will be useful, but
14 ## WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ## General Public License for more details.
18 ## You should have received a copy of the GNU General Public License
19 ## along with this library; see the file COPYING3. If not see
20 ## <http://www.gnu.org/licenses/>.
22 if ENABLE_VTABLE_VERIFY
28 ACLOCAL_AMFLAGS = -I .. -I ../config
30 # May be used by toolexeclibdir.
31 gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
34 AM_CPPFLAGS = -I$(top_srcdir)/../include
35 AM_CFLAGS = $(XCFLAGS)
36 AM_CCASFLAGS = $(XCFLAGS)
37 AM_CXXFLAGS = $(XCFLAGS)
38 AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
39 AM_CXXFLAGS += -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
41 if ENABLE_VTABLE_VERIFY
42 toolexeclib_LTLIBRARIES = libvtv.la
44 toolexeclib_LTLIBRARIES += libvtv_stubs.la
68 libvtv_includedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
70 # Link in vtv_start and vtv_end.
71 BUILT_SOURCES = vtv_start.c vtv_end.c
74 $(LN_S) $(toplevel_srcdir)/libgcc/vtv_start.c $@
78 $(LN_S) $(toplevel_srcdir)/libgcc/vtv_end.c $@
83 $(LN_S) $(toplevel_srcdir)/libiberty/obstack.c $@
90 $(LN_S) $(toplevel_srcdir)/libstdc++-v3/libsupc++/vtv_stubs.cc $@
94 libvtv_la_LIBADD = -lpsapi
95 libvtv_la_LDFLAGS = $(lt_host_flags)
96 libvtv_stubs_la_LDFLAGS = $(lt_host_flags)
99 if ENABLE_VTABLE_VERIFY
100 libvtv_la_SOURCES = $(vtv_sources)
102 libvtv_la_SOURCES += obstack.c
105 libvtv_stubs_la_SOURCES = $(vtv_stubs_sources)
107 libvtv_include_HEADERS = $(vtv_headers)
110 libvtv_include_HEADERS =
113 # Least ordering for dependencies mean linking w/o libstdc++ for as
114 # long as the development of libvtv does not absolutely require it.
115 CXXVTV=$(CC_FOR_TARGET)
116 CXXLD=$(CC_FOR_TARGET)
118 LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
119 --mode=compile $(CXXVTV) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
120 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
122 CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
123 --mode=link $(CXXVTV) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
126 include $(top_srcdir)/../multilib.am