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