Makefile.am 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. ## Makefile for the VTV library.
  2. ##
  3. ## Copyright (C) 2013 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 cat $(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 VTV_CYGMIN
  35. toolexeclib_LTLIBRARIES = libvtv.la libvtv_stubs.la
  36. else
  37. toolexeclib_LTLIBRARIES = libvtv.la
  38. endif
  39. vtv_headers = \
  40. vtv_map.h \
  41. vtv_malloc.h \
  42. vtv_fail.h \
  43. vtv_set.h \
  44. vtv_utils.h \
  45. vtv_rts.h
  46. vtv_sources = \
  47. vtv_start.c \
  48. vtv_malloc.cc \
  49. vtv_rts.cc \
  50. vtv_utils.cc \
  51. vtv_end.c
  52. vtv_stubs_sources = \
  53. vtv_start.c \
  54. vtv_stubs.cc \
  55. vtv_end.c
  56. libvtv_includedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
  57. # Link in vtv_start and vtv_end.
  58. BUILT_SOURCES = vtv_start.c vtv_end.c
  59. vtv_start.c:
  60. rm -f $@
  61. $(LN_S) $(toplevel_srcdir)/libgcc/vtv_start.c $@
  62. vtv_end.c:
  63. rm -f $@
  64. $(LN_S) $(toplevel_srcdir)/libgcc/vtv_end.c $@
  65. if VTV_CYGMIN
  66. obstack.c:
  67. rm -f $@
  68. $(LN_S) $(toplevel_srcdir)/libiberty/obstack.c $@
  69. vtv_stubs.cc:
  70. rm -f $@
  71. $(LN_S) $(toplevel_srcdir)/libstdc++-v3/libsupc++/vtv_stubs.cc $@
  72. endif
  73. if VTV_CYGMIN
  74. libvtv_la_LIBADD = -lpsapi
  75. libvtv_la_LDFLAGS = $(lt_host_flags)
  76. libvtv_stubs_la_LDFLAGS = $(lt_host_flags)
  77. endif
  78. if ENABLE_VTABLE_VERIFY
  79. if VTV_CYGMIN
  80. libvtv_la_SOURCES = $(vtv_sources) obstack.c
  81. libvtv_stubs_la_SOURCES = $(vtv_stubs_sources)
  82. else
  83. libvtv_la_SOURCES = $(vtv_sources)
  84. endif
  85. libvtv_include_HEADERS = $(vtv_headers)
  86. else
  87. libvtv_la_SOURCES =
  88. libvtv_include_HEADERS =
  89. endif
  90. # Least ordering for dependencies mean linking w/o libstdc++ for as
  91. # long as the development of libvtv does not absolutely require it.
  92. CXXVTV=$(CC_FOR_TARGET)
  93. CXXLD=$(CC_FOR_TARGET)
  94. LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  95. --mode=compile $(CXXVTV) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
  96. $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
  97. CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  98. --mode=link $(CXXVTV) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
  99. $(LDFLAGS) -o $@