Makefile.am 10.2 KB
Newer Older
's avatar
committed
1 2
## Process this file with automake to produce Makefile.in

Fumitoshi Ukai's avatar
Fumitoshi Ukai committed
3 4
AUTOMAKE_OPTIONS=subdir-objects

's avatar
committed
5 6 7 8 9 10 11 12 13 14 15
# Make sure that when we re-make ./configure, we get the macros we need
ACLOCAL_AMFLAGS = -I m4

# This is so we can #include <glog/foo>
AM_CPPFLAGS = -I$(top_srcdir)/src

# This is mostly based on configure options
AM_CXXFLAGS =

# These are good warnings to turn on by default
if GCC
's avatar
committed
16
  AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
's avatar
committed
17 18 19 20 21
endif

# These are x86-specific, having to do with frame-pointers
if X86_64
if ENABLE_FRAME_POINTERS
's avatar
committed
22
  AM_CXXFLAGS += -fno-omit-frame-pointer
's avatar
committed
23 24 25
else
  # TODO(csilvers): check if -fomit-frame-pointer might be in $(CXXFLAGS),
  #                 before setting this.
's avatar
committed
26
  AM_CXXFLAGS += -DNO_FRAME_POINTER
's avatar
committed
27 28 29
endif
endif

's avatar
committed
30 31 32 33
if DISABLE_RTTI
  AM_CXXFLAGS += -fno-rtti
endif

's avatar
committed
34 35 36
glogincludedir = $(includedir)/glog
## The .h files you want to install (that is, .h files that people
## who install this package can include in their own applications.)
37 38 39 40 41
## We have to include both the .h and .h.in forms.  The latter we
## put in noinst_HEADERS.
gloginclude_HEADERS = src/glog/log_severity.h
nodist_gloginclude_HEADERS = src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h
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
's avatar
committed
42 43 44 45 46

docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
## This is for HTML and other documentation you want to install.
## Add your documentation files (in doc/) in addition to these
## top-level boilerplate files.  Also add a TODO file if you have one.
47
dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README README.windows \
's avatar
committed
48
                doc/designstyle.css doc/glog.html
's avatar
committed
49 50 51 52

## The libraries (.so's) you want to install
lib_LTLIBRARIES =

53
# The libraries libglog depends on.
's avatar
committed
54
COMMON_LIBS = $(PTHREAD_LIBS) $(GFLAGS_LIBS) $(UNWIND_LIBS)
's avatar
committed
55
# Compile switches for our unittest.
56 57
TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS) $(GFLAGS_CFLAGS) \
              $(MINGW_CFLAGS) $(AM_CXXFLAGS)
's avatar
committed
58
# Libraries for our unittest.
59
TEST_LIBS = $(GTEST_LIBS) $(GMOCK_LIBS) $(GFLAGS_LIBS)
60

's avatar
committed
61 62 63 64 65 66 67 68 69 70 71 72 73
## unittests you want to run when people type 'make check'.
## TESTS is for binary unittests, check_SCRIPTS for script-based unittests.
## TESTS_ENVIRONMENT sets environment variables for when you run unittest,
## but it only seems to take effect for *binary* unittests (argh!)
TESTS =
TESTS_ENVIRONMENT =
check_SCRIPTS =
# Every time you add a unittest to check_SCRIPTS, add it here too
noinst_SCRIPTS =
# Binaries used for script-based unittests.
TEST_BINARIES =

TESTS += logging_unittest
74
logging_unittest_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
75
                           src/logging_unittest.cc \
's avatar
committed
76 77
                           src/config_for_unittests.h \
                           src/mock-log.h
78
nodist_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
's avatar
committed
79
logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
's avatar
committed
80
logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
's avatar
committed
81
logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
's avatar
committed
82 83 84 85 86 87 88 89 90

check_SCRIPTS += logging_striplog_test_sh
noinst_SCRIPTS += src/logging_striplog_test.sh
logging_striplog_test_sh: logging_striptest0 logging_striptest2 logging_striptest10
	$(top_srcdir)/src/logging_striplog_test.sh

check_SCRIPTS += demangle_unittest_sh
noinst_SCRIPTS += src/demangle_unittest.sh
demangle_unittest_sh: demangle_unittest
91
	$(builddir)/demangle_unittest  # force to create lt-demangle_unittest
's avatar
committed
92 93
	$(top_srcdir)/src/demangle_unittest.sh

94 95 96
check_SCRIPTS += signalhandler_unittest_sh
noinst_SCRIPTS += src/signalhandler_unittest.sh
signalhandler_unittest_sh: signalhandler_unittest
97
	$(builddir)/signalhandler_unittest  # force to create lt-signalhandler_unittest
98 99
	$(top_srcdir)/src/signalhandler_unittest.sh

's avatar
committed
100
TEST_BINARIES += logging_striptest0
101
logging_striptest0_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
102
                             src/logging_striptest_main.cc
103
nodist_logging_striptest0_SOURCES = $(nodist_gloginclude_HEADERS)
104
logging_striptest0_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
's avatar
committed
105
logging_striptest0_LDFLAGS = $(PTHREAD_CFLAGS)
106
logging_striptest0_LDADD = libglog.la $(COMMON_LIBS)
's avatar
committed
107 108

TEST_BINARIES += logging_striptest2
109
logging_striptest2_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
110
                             src/logging_striptest2.cc
111
nodist_logging_striptest2_SOURCES = $(nodist_gloginclude_HEADERS)
112
logging_striptest2_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
's avatar
committed
113
logging_striptest2_LDFLAGS = $(PTHREAD_CFLAGS)
114
logging_striptest2_LDADD = libglog.la $(COMMON_LIBS)
's avatar
committed
115 116

TEST_BINARIES += logging_striptest10
117
logging_striptest10_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
118
                              src/logging_striptest10.cc
119
nodist_logging_striptest10_SOURCES = $(nodist_gloginclude_HEADERS)
120
logging_striptest10_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
's avatar
committed
121
logging_striptest10_LDFLAGS = $(PTHREAD_CFLAGS)
122
logging_striptest10_LDADD = libglog.la $(COMMON_LIBS)
's avatar
committed
123 124

TESTS += demangle_unittest
125
demangle_unittest_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
126
                            src/demangle_unittest.cc
127
nodist_demangle_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
's avatar
committed
128
demangle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
's avatar
committed
129
demangle_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
's avatar
committed
130
demangle_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
's avatar
committed
131 132

TESTS += stacktrace_unittest
133
stacktrace_unittest_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
134
                              src/stacktrace_unittest.cc
135
nodist_stacktrace_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
136
stacktrace_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
's avatar
committed
137
stacktrace_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
138
stacktrace_unittest_LDADD = libglog.la $(COMMON_LIBS)
's avatar
committed
139 140

TESTS += symbolize_unittest
141
symbolize_unittest_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
142
                              src/symbolize_unittest.cc
143
nodist_symbolize_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
's avatar
committed
144
symbolize_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
's avatar
committed
145
symbolize_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
's avatar
committed
146
symbolize_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
's avatar
committed
147 148

TESTS += stl_logging_unittest
149
stl_logging_unittest_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
150
                               src/stl_logging_unittest.cc
151
nodist_stl_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
152
stl_logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
's avatar
committed
153
stl_logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
154
stl_logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
's avatar
committed
155

156
TEST_BINARIES += signalhandler_unittest
157
signalhandler_unittest_SOURCES = $(gloginclude_HEADERS) \
158
                               src/signalhandler_unittest.cc
159
nodist_signalhandler_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
160
signalhandler_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
161
signalhandler_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
162
signalhandler_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
163 164

TESTS += utilities_unittest
165
utilities_unittest_SOURCES = $(gloginclude_HEADERS) \
166
                             src/utilities_unittest.cc
167
nodist_utilities_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
's avatar
committed
168
utilities_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
169
utilities_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
's avatar
committed
170
utilities_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
171

's avatar
committed
172 173 174 175 176 177 178 179 180 181
if HAVE_GMOCK
TESTS += mock_log_test
mock_log_test_SOURCES = $(gloginclude_HEADERS) \
                        src/mock-log_test.cc
nodist_mock_log_test_SOURCES = $(nodist_gloginclude_HEADERS)
mock_log_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
mock_log_test_LDFLAGS = $(PTHREAD_CFLAGS)
mock_log_test_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
endif

's avatar
committed
182 183 184
## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS

lib_LTLIBRARIES += libglog.la
185
libglog_la_SOURCES = $(gloginclude_HEADERS) \
's avatar
committed
186 187
                       src/logging.cc src/raw_logging.cc src/vlog_is_on.cc \
                       src/utilities.cc src/utilities.h \
's avatar
committed
188
                       src/demangle.cc src/demangle.h \
189
                       src/stacktrace.h \
's avatar
committed
190 191 192 193 194 195
                       src/stacktrace_generic-inl.h \
                       src/stacktrace_libunwind-inl.h \
                       src/stacktrace_powerpc-inl.h \
                       src/stacktrace_x86-inl.h \
                       src/stacktrace_x86_64-inl.h \
                       src/symbolize.cc src/symbolize.h \
196
                       src/signalhandler.cc \
's avatar
committed
197 198
                       src/base/mutex.h src/base/googleinit.h \
                       src/base/commandlineflags.h src/googletest.h
199
nodist_libglog_la_SOURCES = $(nodist_gloginclude_HEADERS)
's avatar
committed
200

201 202
libglog_la_CXXFLAGS = $(PTRHEAD_CFLAGS) $(GFLAGS_CFLAGS) $(MINGW_CFLAGS) \
                      $(AM_CXXFLAGS) -DNDEBUG
203
libglog_la_LDFLAGS = $(PTRHEAD_CFLAGS) $(GFLAGS_LDFLAGS)
204
libglog_la_LIBADD = $(COMMON_LIBS)
's avatar
committed
205

206 207 208 209
## The location of the windows project file for each binary we make
WINDOWS_PROJECTS = google-glog.sln
WINDOWS_PROJECTS += vsprojects/libglog/libglog.vcproj
WINDOWS_PROJECTS += vsprojects/logging_unittest/logging_unittest.vcproj
210 211
WINDOWS_PROJECTS += vsprojects/libglog_static/libglog_static.vcproj
WINDOWS_PROJECTS += vsprojects/logging_unittest_static/logging_unittest_static.vcproj
212

's avatar
committed
213 214 215 216 217 218 219 220 221 222 223 224 225
## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS


## This should always include $(TESTS), but may also include other
## binaries that you compile but don't want automatically installed.
noinst_PROGRAMS = $(TESTS) $(TEST_BINARIES)

rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
	@cd packages && ./rpm.sh ${PACKAGE} ${VERSION}

deb: dist-gzip packages/deb.sh packages/deb/*
	@cd packages && ./deb.sh ${PACKAGE} ${VERSION}

226 227 228 229
# Windows wants write permission to .vcproj files and maybe even sln files.
dist-hook:
	test -e "$(distdir)/vsprojects" \
	   && chmod -R u+w $(distdir)/*.sln $(distdir)/vsprojects/
's avatar
committed
230 231 232

libtool: $(LIBTOOL_DEPS)
	$(SHELL) ./config.status --recheck
233

234 235
EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec \
	packages/deb.sh packages/deb/* \
236 237 238 239 240 241 242
	$(SCRIPTS) src/logging_unittest.err src/demangle_unittest.txt \
	src/windows/config.h src/windows/port.h src/windows/port.cc \
	src/windows/preprocess.sh \
	src/windows/glog/log_severity.h src/windows/glog/logging.h \
	src/windows/glog/raw_logging.h src/windows/glog/stl_logging.h \
	src/windows/glog/vlog_is_on.h \
	$(WINDOWS_PROJECTS)
243

244 245 246
CLEANFILES = core demangle.dm demangle.nm signalhandler.out* \
	signalhandler_unittest.*.log.INFO.*

247 248 249
# Add pkgconfig file
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libglog.pc