michael@0: ## Process this file with automake to produce Makefile.in michael@0: michael@0: # Make sure that when we re-make ./configure, we get the macros we need michael@0: ACLOCAL_AMFLAGS = -I m4 michael@0: michael@0: # This is so we can #include michael@0: AM_CPPFLAGS = -I$(top_srcdir)/src michael@0: michael@0: # This is mostly based on configure options michael@0: AM_CXXFLAGS = michael@0: michael@0: # These are good warnings to turn on by default michael@0: if GCC michael@0: AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare michael@0: endif michael@0: michael@0: # These are x86-specific, having to do with frame-pointers michael@0: if X86_64 michael@0: if ENABLE_FRAME_POINTERS michael@0: AM_CXXFLAGS += -fno-omit-frame-pointer michael@0: else michael@0: # TODO(csilvers): check if -fomit-frame-pointer might be in $(CXXFLAGS), michael@0: # before setting this. michael@0: AM_CXXFLAGS += -DNO_FRAME_POINTER michael@0: endif michael@0: endif michael@0: michael@0: glogincludedir = $(includedir)/glog michael@0: ## The .h files you want to install (that is, .h files that people michael@0: ## who install this package can include in their own applications.) michael@0: ## We have to include both the .h and .h.in forms. The latter we michael@0: ## put in noinst_HEADERS. michael@0: gloginclude_HEADERS = src/glog/log_severity.h michael@0: nodist_gloginclude_HEADERS = src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h michael@0: 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 michael@0: michael@0: docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION) michael@0: ## This is for HTML and other documentation you want to install. michael@0: ## Add your documentation files (in doc/) in addition to these michael@0: ## top-level boilerplate files. Also add a TODO file if you have one. michael@0: dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README README.windows \ michael@0: doc/designstyle.css doc/glog.html michael@0: michael@0: ## The libraries (.so's) you want to install michael@0: lib_LTLIBRARIES = michael@0: michael@0: # The libraries libglog depends on. michael@0: COMMON_LIBS = $(PTHREAD_LIBS) $(GFLAGS_LIBS) $(UNWIND_LIBS) michael@0: # Compile switches for our unittest. michael@0: TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS) $(GFLAGS_CFLAGS) $(AM_CXXFLAGS) michael@0: # Libraries for our unittest. michael@0: TEST_LIBS = $(GTEST_LIBS) $(GMOCK_LIBS) $(GFLAGS_LIBS) michael@0: michael@0: ## unittests you want to run when people type 'make check'. michael@0: ## TESTS is for binary unittests, check_SCRIPTS for script-based unittests. michael@0: ## TESTS_ENVIRONMENT sets environment variables for when you run unittest, michael@0: ## but it only seems to take effect for *binary* unittests (argh!) michael@0: TESTS = michael@0: TESTS_ENVIRONMENT = michael@0: check_SCRIPTS = michael@0: # Every time you add a unittest to check_SCRIPTS, add it here too michael@0: noinst_SCRIPTS = michael@0: # Binaries used for script-based unittests. michael@0: TEST_BINARIES = michael@0: michael@0: TESTS += logging_unittest michael@0: logging_unittest_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/logging_unittest.cc \ michael@0: src/config_for_unittests.h \ michael@0: src/mock-log.h michael@0: nodist_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) michael@0: michael@0: check_SCRIPTS += logging_striplog_test_sh michael@0: noinst_SCRIPTS += src/logging_striplog_test.sh michael@0: logging_striplog_test_sh: logging_striptest0 logging_striptest2 logging_striptest10 michael@0: $(top_srcdir)/src/logging_striplog_test.sh michael@0: michael@0: check_SCRIPTS += demangle_unittest_sh michael@0: noinst_SCRIPTS += src/demangle_unittest.sh michael@0: demangle_unittest_sh: demangle_unittest michael@0: $(builddir)/demangle_unittest # force to create lt-demangle_unittest michael@0: $(top_srcdir)/src/demangle_unittest.sh michael@0: michael@0: check_SCRIPTS += signalhandler_unittest_sh michael@0: noinst_SCRIPTS += src/signalhandler_unittest.sh michael@0: signalhandler_unittest_sh: signalhandler_unittest michael@0: $(builddir)/signalhandler_unittest # force to create lt-signalhandler_unittest michael@0: $(top_srcdir)/src/signalhandler_unittest.sh michael@0: michael@0: TEST_BINARIES += logging_striptest0 michael@0: logging_striptest0_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/logging_striptest_main.cc michael@0: nodist_logging_striptest0_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: logging_striptest0_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: logging_striptest0_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: logging_striptest0_LDADD = libglog.la $(COMMON_LIBS) michael@0: michael@0: TEST_BINARIES += logging_striptest2 michael@0: logging_striptest2_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/logging_striptest2.cc michael@0: nodist_logging_striptest2_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: logging_striptest2_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: logging_striptest2_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: logging_striptest2_LDADD = libglog.la $(COMMON_LIBS) michael@0: michael@0: TEST_BINARIES += logging_striptest10 michael@0: logging_striptest10_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/logging_striptest10.cc michael@0: nodist_logging_striptest10_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: logging_striptest10_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: logging_striptest10_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: logging_striptest10_LDADD = libglog.la $(COMMON_LIBS) michael@0: michael@0: TESTS += demangle_unittest michael@0: demangle_unittest_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/demangle_unittest.cc michael@0: nodist_demangle_unittest_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: demangle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: demangle_unittest_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: demangle_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) michael@0: michael@0: TESTS += stacktrace_unittest michael@0: stacktrace_unittest_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/stacktrace_unittest.cc michael@0: nodist_stacktrace_unittest_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: stacktrace_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: stacktrace_unittest_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: stacktrace_unittest_LDADD = libglog.la $(COMMON_LIBS) michael@0: michael@0: TESTS += symbolize_unittest michael@0: symbolize_unittest_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/symbolize_unittest.cc michael@0: nodist_symbolize_unittest_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: symbolize_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: symbolize_unittest_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: symbolize_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) michael@0: michael@0: TESTS += stl_logging_unittest michael@0: stl_logging_unittest_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/stl_logging_unittest.cc michael@0: nodist_stl_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: stl_logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: stl_logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: stl_logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) michael@0: michael@0: TEST_BINARIES += signalhandler_unittest michael@0: signalhandler_unittest_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/signalhandler_unittest.cc michael@0: nodist_signalhandler_unittest_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: signalhandler_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: signalhandler_unittest_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: signalhandler_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) michael@0: michael@0: TESTS += utilities_unittest michael@0: utilities_unittest_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/utilities_unittest.cc michael@0: nodist_utilities_unittest_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: utilities_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: utilities_unittest_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: utilities_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) michael@0: michael@0: if HAVE_GMOCK michael@0: TESTS += mock_log_test michael@0: mock_log_test_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/mock-log_test.cc michael@0: nodist_mock_log_test_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: mock_log_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS) michael@0: mock_log_test_LDFLAGS = $(PTHREAD_CFLAGS) michael@0: mock_log_test_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS) michael@0: endif michael@0: michael@0: ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS michael@0: michael@0: lib_LTLIBRARIES += libglog.la michael@0: libglog_la_SOURCES = $(gloginclude_HEADERS) \ michael@0: src/logging.cc src/raw_logging.cc src/vlog_is_on.cc \ michael@0: src/utilities.cc src/utilities.h \ michael@0: src/demangle.cc src/demangle.h \ michael@0: src/stacktrace.h \ michael@0: src/stacktrace_generic-inl.h \ michael@0: src/stacktrace_libunwind-inl.h \ michael@0: src/stacktrace_powerpc-inl.h \ michael@0: src/stacktrace_x86-inl.h \ michael@0: src/stacktrace_x86_64-inl.h \ michael@0: src/symbolize.cc src/symbolize.h \ michael@0: src/signalhandler.cc \ michael@0: src/base/mutex.h src/base/googleinit.h \ michael@0: src/base/commandlineflags.h src/googletest.h michael@0: nodist_libglog_la_SOURCES = $(nodist_gloginclude_HEADERS) michael@0: michael@0: libglog_la_CXXFLAGS = $(PTRHEAD_CFLAGS) $(GFLAGS_CFLAGS) $(AM_CXXFLAGS) -DNDEBUG michael@0: libglog_la_LDFLAGS = $(PTRHEAD_CFLAGS) $(GFLAGS_LDFLAGS) michael@0: libglog_la_LIBADD = $(COMMON_LIBS) michael@0: michael@0: ## The location of the windows project file for each binary we make michael@0: WINDOWS_PROJECTS = google-glog.sln michael@0: WINDOWS_PROJECTS += vsprojects/libglog/libglog.vcproj michael@0: WINDOWS_PROJECTS += vsprojects/logging_unittest/logging_unittest.vcproj michael@0: WINDOWS_PROJECTS += vsprojects/libglog_static/libglog_static.vcproj michael@0: WINDOWS_PROJECTS += vsprojects/logging_unittest_static/logging_unittest_static.vcproj michael@0: michael@0: ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS michael@0: michael@0: michael@0: ## This should always include $(TESTS), but may also include other michael@0: ## binaries that you compile but don't want automatically installed. michael@0: noinst_PROGRAMS = $(TESTS) $(TEST_BINARIES) michael@0: michael@0: rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec michael@0: @cd packages && ./rpm.sh ${PACKAGE} ${VERSION} michael@0: michael@0: deb: dist-gzip packages/deb.sh packages/deb/* michael@0: @cd packages && ./deb.sh ${PACKAGE} ${VERSION} michael@0: michael@0: # Windows wants write permission to .vcproj files and maybe even sln files. michael@0: dist-hook: michael@0: test -e "$(distdir)/vsprojects" \ michael@0: && chmod -R u+w $(distdir)/*.sln $(distdir)/vsprojects/ michael@0: michael@0: libtool: $(LIBTOOL_DEPS) michael@0: $(SHELL) ./config.status --recheck michael@0: michael@0: EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \ michael@0: $(SCRIPTS) src/logging_unittest.err src/demangle_unittest.txt \ michael@0: src/windows/config.h src/windows/port.h src/windows/port.cc \ michael@0: src/windows/preprocess.sh \ michael@0: src/windows/glog/log_severity.h src/windows/glog/logging.h \ michael@0: src/windows/glog/raw_logging.h src/windows/glog/stl_logging.h \ michael@0: src/windows/glog/vlog_is_on.h \ michael@0: $(WINDOWS_PROJECTS) michael@0: michael@0: CLEANFILES = core demangle.dm demangle.nm signalhandler.out* \ michael@0: signalhandler_unittest.*.log.INFO.* michael@0: michael@0: # Add pkgconfig file michael@0: pkgconfigdir = $(libdir)/pkgconfig michael@0: pkgconfig_DATA = libglog.pc