Makefile.am 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. ## Process this file with automake to produce Makefile.in
  2. AUTOMAKE_OPTIONS=subdir-objects
  3. # Make sure that when we re-make ./configure, we get the macros we need
  4. ACLOCAL_AMFLAGS = -I m4
  5. # This is so we can #include <glog/foo>
  6. AM_CPPFLAGS = -I$(top_srcdir)/src
  7. # This is mostly based on configure options
  8. AM_CXXFLAGS =
  9. # These are good warnings to turn on by default
  10. if GCC
  11. AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
  12. endif
  13. # These are x86-specific, having to do with frame-pointers
  14. if X86_64
  15. if ENABLE_FRAME_POINTERS
  16. AM_CXXFLAGS += -fno-omit-frame-pointer
  17. else
  18. # TODO(csilvers): check if -fomit-frame-pointer might be in $(CXXFLAGS),
  19. # before setting this.
  20. AM_CXXFLAGS += -DNO_FRAME_POINTER
  21. endif
  22. endif
  23. if DISABLE_RTTI
  24. AM_CXXFLAGS += -fno-rtti
  25. endif
  26. glogincludedir = $(includedir)/glog
  27. ## The .h files you want to install (that is, .h files that people
  28. ## who install this package can include in their own applications.)
  29. ## We have to include both the .h and .h.in forms. The latter we
  30. ## put in noinst_HEADERS.
  31. gloginclude_HEADERS = src/glog/log_severity.h
  32. nodist_gloginclude_HEADERS = src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h
  33. noinst_HEADERS = src/glog/logging.h.in src/glog/raw_logging.h.in src/glog/vlog_is_on.h.in src/glog/stl_logging.h.in
  34. docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
  35. ## This is for HTML and other documentation you want to install.
  36. ## Add your documentation files (in doc/) in addition to these
  37. ## top-level boilerplate files. Also add a TODO file if you have one.
  38. dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README README.windows \
  39. doc/designstyle.css doc/glog.html
  40. ## The libraries (.so's) you want to install
  41. lib_LTLIBRARIES =
  42. # The libraries libglog depends on.
  43. COMMON_LIBS = $(PTHREAD_LIBS) $(GFLAGS_LIBS) $(UNWIND_LIBS)
  44. # Compile switches for our unittest.
  45. TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS) $(GFLAGS_CFLAGS) \
  46. $(MINGW_CFLAGS) $(AM_CXXFLAGS)
  47. # Libraries for our unittest.
  48. TEST_LIBS = $(GTEST_LIBS) $(GMOCK_LIBS) $(GFLAGS_LIBS)
  49. ## unittests you want to run when people type 'make check'.
  50. ## TESTS is for binary unittests, check_SCRIPTS for script-based unittests.
  51. ## TESTS_ENVIRONMENT sets environment variables for when you run unittest,
  52. ## but it only seems to take effect for *binary* unittests (argh!)
  53. TESTS =
  54. TESTS_ENVIRONMENT =
  55. check_SCRIPTS =
  56. # Every time you add a unittest to check_SCRIPTS, add it here too
  57. noinst_SCRIPTS =
  58. # Binaries used for script-based unittests.
  59. TEST_BINARIES =
  60. TESTS += logging_unittest
  61. logging_unittest_SOURCES = $(gloginclude_HEADERS) \
  62. src/logging_unittest.cc \
  63. src/config_for_unittests.h \
  64. src/mock-log.h
  65. nodist_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
  66. logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  67. logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
  68. logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
  69. check_SCRIPTS += logging_striplog_test_sh
  70. noinst_SCRIPTS += src/logging_striplog_test.sh
  71. logging_striplog_test_sh: logging_striptest0 logging_striptest2 logging_striptest10
  72. $(top_srcdir)/src/logging_striplog_test.sh
  73. check_SCRIPTS += demangle_unittest_sh
  74. noinst_SCRIPTS += src/demangle_unittest.sh
  75. demangle_unittest_sh: demangle_unittest
  76. $(builddir)/demangle_unittest # force to create lt-demangle_unittest
  77. $(top_srcdir)/src/demangle_unittest.sh
  78. check_SCRIPTS += signalhandler_unittest_sh
  79. noinst_SCRIPTS += src/signalhandler_unittest.sh
  80. signalhandler_unittest_sh: signalhandler_unittest
  81. $(builddir)/signalhandler_unittest # force to create lt-signalhandler_unittest
  82. $(top_srcdir)/src/signalhandler_unittest.sh
  83. TEST_BINARIES += logging_striptest0
  84. logging_striptest0_SOURCES = $(gloginclude_HEADERS) \
  85. src/logging_striptest_main.cc
  86. nodist_logging_striptest0_SOURCES = $(nodist_gloginclude_HEADERS)
  87. logging_striptest0_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  88. logging_striptest0_LDFLAGS = $(PTHREAD_CFLAGS)
  89. logging_striptest0_LDADD = libglog.la $(COMMON_LIBS)
  90. TEST_BINARIES += logging_striptest2
  91. logging_striptest2_SOURCES = $(gloginclude_HEADERS) \
  92. src/logging_striptest2.cc
  93. nodist_logging_striptest2_SOURCES = $(nodist_gloginclude_HEADERS)
  94. logging_striptest2_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  95. logging_striptest2_LDFLAGS = $(PTHREAD_CFLAGS)
  96. logging_striptest2_LDADD = libglog.la $(COMMON_LIBS)
  97. TEST_BINARIES += logging_striptest10
  98. logging_striptest10_SOURCES = $(gloginclude_HEADERS) \
  99. src/logging_striptest10.cc
  100. nodist_logging_striptest10_SOURCES = $(nodist_gloginclude_HEADERS)
  101. logging_striptest10_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  102. logging_striptest10_LDFLAGS = $(PTHREAD_CFLAGS)
  103. logging_striptest10_LDADD = libglog.la $(COMMON_LIBS)
  104. TESTS += demangle_unittest
  105. demangle_unittest_SOURCES = $(gloginclude_HEADERS) \
  106. src/demangle_unittest.cc
  107. nodist_demangle_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
  108. demangle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  109. demangle_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
  110. demangle_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
  111. TESTS += stacktrace_unittest
  112. stacktrace_unittest_SOURCES = $(gloginclude_HEADERS) \
  113. src/stacktrace_unittest.cc
  114. nodist_stacktrace_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
  115. stacktrace_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  116. stacktrace_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
  117. stacktrace_unittest_LDADD = libglog.la $(COMMON_LIBS)
  118. TESTS += symbolize_unittest
  119. symbolize_unittest_SOURCES = $(gloginclude_HEADERS) \
  120. src/symbolize_unittest.cc
  121. nodist_symbolize_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
  122. symbolize_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  123. symbolize_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
  124. symbolize_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
  125. TESTS += stl_logging_unittest
  126. stl_logging_unittest_SOURCES = $(gloginclude_HEADERS) \
  127. src/stl_logging_unittest.cc
  128. nodist_stl_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
  129. stl_logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  130. stl_logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
  131. stl_logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
  132. TEST_BINARIES += signalhandler_unittest
  133. signalhandler_unittest_SOURCES = $(gloginclude_HEADERS) \
  134. src/signalhandler_unittest.cc
  135. nodist_signalhandler_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
  136. signalhandler_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  137. signalhandler_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
  138. signalhandler_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
  139. TESTS += utilities_unittest
  140. utilities_unittest_SOURCES = $(gloginclude_HEADERS) \
  141. src/utilities_unittest.cc
  142. nodist_utilities_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
  143. utilities_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  144. utilities_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
  145. utilities_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
  146. if HAVE_GMOCK
  147. TESTS += mock_log_test
  148. mock_log_test_SOURCES = $(gloginclude_HEADERS) \
  149. src/mock-log_test.cc
  150. nodist_mock_log_test_SOURCES = $(nodist_gloginclude_HEADERS)
  151. mock_log_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
  152. mock_log_test_LDFLAGS = $(PTHREAD_CFLAGS)
  153. mock_log_test_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
  154. endif
  155. ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
  156. lib_LTLIBRARIES += libglog.la
  157. libglog_la_SOURCES = $(gloginclude_HEADERS) \
  158. src/logging.cc src/raw_logging.cc src/vlog_is_on.cc \
  159. src/utilities.cc src/utilities.h \
  160. src/demangle.cc src/demangle.h \
  161. src/stacktrace.h \
  162. src/stacktrace_generic-inl.h \
  163. src/stacktrace_libunwind-inl.h \
  164. src/stacktrace_powerpc-inl.h \
  165. src/stacktrace_x86-inl.h \
  166. src/stacktrace_x86_64-inl.h \
  167. src/symbolize.cc src/symbolize.h \
  168. src/signalhandler.cc \
  169. src/base/mutex.h src/base/googleinit.h \
  170. src/base/commandlineflags.h src/googletest.h
  171. nodist_libglog_la_SOURCES = $(nodist_gloginclude_HEADERS)
  172. libglog_la_CXXFLAGS = $(PTRHEAD_CFLAGS) $(GFLAGS_CFLAGS) $(MINGW_CFLAGS) \
  173. $(AM_CXXFLAGS) -DNDEBUG
  174. libglog_la_LDFLAGS = $(PTRHEAD_CFLAGS) $(GFLAGS_LDFLAGS)
  175. libglog_la_LIBADD = $(COMMON_LIBS)
  176. ## The location of the windows project file for each binary we make
  177. WINDOWS_PROJECTS = google-glog.sln
  178. WINDOWS_PROJECTS += vsprojects/libglog/libglog.vcproj
  179. WINDOWS_PROJECTS += vsprojects/logging_unittest/logging_unittest.vcproj
  180. WINDOWS_PROJECTS += vsprojects/libglog_static/libglog_static.vcproj
  181. WINDOWS_PROJECTS += vsprojects/logging_unittest_static/logging_unittest_static.vcproj
  182. ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
  183. ## This should always include $(TESTS), but may also include other
  184. ## binaries that you compile but don't want automatically installed.
  185. noinst_PROGRAMS = $(TESTS) $(TEST_BINARIES)
  186. rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
  187. @cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
  188. deb: dist-gzip packages/deb.sh packages/deb/*
  189. @cd packages && ./deb.sh ${PACKAGE} ${VERSION}
  190. # Windows wants write permission to .vcproj files and maybe even sln files.
  191. dist-hook:
  192. test -e "$(distdir)/vsprojects" \
  193. && chmod -R u+w $(distdir)/*.sln $(distdir)/vsprojects/
  194. libtool: $(LIBTOOL_DEPS)
  195. $(SHELL) ./config.status --recheck
  196. EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec \
  197. packages/deb.sh packages/deb/* \
  198. $(SCRIPTS) src/logging_unittest.err src/demangle_unittest.txt \
  199. src/windows/config.h src/windows/port.h src/windows/port.cc \
  200. src/windows/preprocess.sh \
  201. src/windows/glog/log_severity.h src/windows/glog/logging.h \
  202. src/windows/glog/raw_logging.h src/windows/glog/stl_logging.h \
  203. src/windows/glog/vlog_is_on.h \
  204. $(WINDOWS_PROJECTS)
  205. CLEANFILES = core demangle.dm demangle.nm signalhandler.out* \
  206. signalhandler_unittest.*.log.INFO.*
  207. # Add pkgconfig file
  208. pkgconfigdir = $(libdir)/pkgconfig
  209. pkgconfig_DATA = libglog.pc