Makefile.am 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ## Makefile for the VTV library.
  2. ##
  3. ## Copyright (C) 2013-2022 Free Software Foundation, Inc.
  4. ##
  5. ## Process this file with automake to produce Makefile.in.
  6. ##
  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)
  11. ## any later version.
  12. ## This library is distributed in the hope that it will be useful, but
  13. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. ## General Public License for more details.
  16. ## You should have received a copy of the GNU General Public License
  17. ## along with this library; see the file COPYING3. If not see
  18. ## <http://www.gnu.org/licenses/>.
  19. if ENABLE_VTABLE_VERIFY
  20. SUBDIRS = testsuite
  21. else
  22. SUBDIRS=
  23. endif
  24. ACLOCAL_AMFLAGS = -I .. -I ../config
  25. # May be used by toolexeclibdir.
  26. gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
  27. DEFS = @DEFS@
  28. AM_CPPFLAGS = -I$(top_srcdir)/../include
  29. AM_CFLAGS = $(XCFLAGS)
  30. AM_CCASFLAGS = $(XCFLAGS)
  31. AM_CXXFLAGS = $(XCFLAGS)
  32. AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
  33. AM_CXXFLAGS += -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
  34. if ENABLE_VTABLE_VERIFY
  35. toolexeclib_LTLIBRARIES = libvtv.la
  36. if VTV_CYGMIN
  37. toolexeclib_LTLIBRARIES += libvtv_stubs.la
  38. endif
  39. endif
  40. vtv_headers = \
  41. vtv_map.h \
  42. vtv_malloc.h \
  43. vtv_fail.h \
  44. vtv_set.h \
  45. vtv_utils.h \
  46. vtv_rts.h
  47. vtv_sources = \
  48. vtv_start.c \
  49. vtv_malloc.cc \
  50. vtv_rts.cc \
  51. vtv_utils.cc \
  52. vtv_end.c
  53. vtv_stubs_sources = \
  54. vtv_start.c \
  55. vtv_stubs.cc \
  56. vtv_end.c
  57. libvtv_includedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
  58. # Link in vtv_start and vtv_end.
  59. BUILT_SOURCES = vtv_start.c vtv_end.c
  60. vtv_start.c:
  61. rm -f $@
  62. $(LN_S) $(toplevel_srcdir)/libgcc/vtv_start.c $@
  63. vtv_end.c:
  64. rm -f $@
  65. $(LN_S) $(toplevel_srcdir)/libgcc/vtv_end.c $@
  66. if VTV_NO_OBSTACK
  67. obstack.c:
  68. rm -f $@
  69. $(LN_S) $(toplevel_srcdir)/libiberty/obstack.c $@
  70. > config.h
  71. endif
  72. if VTV_CYGMIN
  73. vtv_stubs.cc:
  74. rm -f $@
  75. $(LN_S) $(toplevel_srcdir)/libstdc++-v3/libsupc++/vtv_stubs.cc $@
  76. endif
  77. if VTV_CYGMIN
  78. libvtv_la_LIBADD = -lpsapi
  79. libvtv_la_LDFLAGS = $(lt_host_flags)
  80. libvtv_stubs_la_LDFLAGS = $(lt_host_flags)
  81. endif
  82. if ENABLE_VTABLE_VERIFY
  83. libvtv_la_SOURCES = $(vtv_sources)
  84. if VTV_NO_OBSTACK
  85. libvtv_la_SOURCES += obstack.c
  86. endif
  87. if VTV_CYGMIN
  88. libvtv_stubs_la_SOURCES = $(vtv_stubs_sources)
  89. endif
  90. libvtv_include_HEADERS = $(vtv_headers)
  91. else
  92. libvtv_la_SOURCES =
  93. libvtv_include_HEADERS =
  94. endif
  95. # Least ordering for dependencies mean linking w/o libstdc++ for as
  96. # long as the development of libvtv does not absolutely require it.
  97. CXXVTV=$(CC_FOR_TARGET)
  98. CXXLD=$(CC_FOR_TARGET)
  99. LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  100. --mode=compile $(CXXVTV) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
  101. $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
  102. CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  103. --mode=link $(CXXVTV) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
  104. $(LDFLAGS) -o $@
  105. include $(top_srcdir)/../multilib.am