Fix some syntax/HTML issues.
[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 TEST_BINARIES += logging_striptest0
74 logging_striptest0_SOURCES = $(gloginclude_HEADERS) src/config.h \
75                              src/logging_striptest_main.cc
76 logging_striptest0_CXXFLAGS = $(PTHREAD_CFLAGS)
77 logging_striptest0_LDFLAGS = $(PTHREAD_CFLAGS)
78 logging_striptest0_LDADD = libglog.la $(PTHREAD_LIBS) $(GFLAGS_LIBS)
79
80 TEST_BINARIES += logging_striptest2
81 logging_striptest2_SOURCES = $(gloginclude_HEADERS) src/config.h \
82                              src/logging_striptest2.cc
83 logging_striptest2_CXXFLAGS = $(PTHREAD_CFLAGS)
84 logging_striptest2_LDFLAGS = $(PTHREAD_CFLAGS)
85 logging_striptest2_LDADD = libglog.la $(PTHREAD_LIBS) $(GFLAGS_LIBS)
86
87 TEST_BINARIES += logging_striptest10
88 logging_striptest10_SOURCES = $(gloginclude_HEADERS) src/config.h \
89                               src/logging_striptest10.cc
90 logging_striptest10_CXXFLAGS = $(PTHREAD_CFLAGS)
91 logging_striptest10_LDFLAGS = $(PTHREAD_CFLAGS)
92 logging_striptest10_LDADD = libglog.la $(PTHREAD_LIBS) $(GFLAGS_LIBS)
93
94 TESTS += demangle_unittest
95 demangle_unittest_SOURCES = $(gloginclude_HEADERS) src/config.h \
96                             src/demangle_unittest.cc
97 demangle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
98 demangle_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
99 demangle_unittest_LDADD = libglog.la $(PTHREAD_LIBS) $(GFLAGS_LIBS)
100
101 TESTS += stacktrace_unittest
102 stacktrace_unittest_SOURCES = $(gloginclude_HEADERS) src/config.h \
103                               src/stacktrace_unittest.cc
104 stacktrace_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
105 stacktrace_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
106 stacktrace_unittest_LDADD = libglog.la $(PTHREAD_LIBS) $(GFLAGS_LIBS)
107
108 TESTS += symbolize_unittest
109 symbolize_unittest_SOURCES = $(gloginclude_HEADERS) src/config.h \
110                               src/symbolize_unittest.cc
111 symbolize_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
112 symbolize_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
113 symbolize_unittest_LDADD = libglog.la $(PTHREAD_LIBS) $(GFLAGS_LIBS)
114
115 TESTS += stacktrace_framesizes_unittest
116 stacktrace_framesizes_unittest_SOURCES = $(gloginclude_HEADERS) src/config.h \
117                                          src/stacktrace_framesizes_unittest.cc
118 stacktrace_framesizes_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
119 stacktrace_framesizes_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
120 stacktrace_framesizes_unittest_LDADD = libglog.la $(PTHREAD_LIBS) $(GFLAGS_LIBS)
121
122 TESTS += stl_logging_unittest
123 stl_logging_unittest_SOURCES = $(gloginclude_HEADERS) src/config.h \
124                                src/stl_logging_unittest.cc
125 stl_logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
126 stl_logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
127 stl_logging_unittest_LDADD = libglog.la $(PTHREAD_LIBS) $(GFLAGS_LIBS)
128
129 ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
130
131 lib_LTLIBRARIES += libglog.la
132 libglog_la_SOURCES = $(gloginclude_HEADERS) src/config.h \
133                        src/logging.cc src/raw_logging.cc src/vlog_is_on.cc \
134                        src/utilities.cc src/utilities.h \
135                        src/demangle.cc src/demangle.h \
136                        src/stacktrace.cc src/stacktrace.h \
137                        src/stacktrace_generic-inl.h \
138                        src/stacktrace_libunwind-inl.h \
139                        src/stacktrace_powerpc-inl.h \
140                        src/stacktrace_x86-inl.h \
141                        src/stacktrace_x86_64-inl.h \
142                        src/symbolize.cc src/symbolize.h \
143                        src/base/mutex.h src/base/googleinit.h \
144                        src/base/commandlineflags.h src/googletest.h
145
146 libglog_la_CXXFLAGS = $(PTRHEAD_CFLAGS) -DNDEBUG
147 libglog_la_LDFLAGS = $(PTRHEAD_CFLAGS)
148 libglog_la_LIBADD = $(PTHREAD_LIBS)
149
150 ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
151
152
153 ## This should always include $(TESTS), but may also include other
154 ## binaries that you compile but don't want automatically installed.
155 noinst_PROGRAMS = $(TESTS) $(TEST_BINARIES)
156
157 rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
158         @cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
159
160 deb: dist-gzip packages/deb.sh packages/deb/*
161         @cd packages && ./deb.sh ${PACKAGE} ${VERSION}
162
163 # TODO(hamaji): We don't support Visual Studio for now.
164 ## Windows wants write permission to .vcproj files and maybe even sln files.
165 #dist-hook:
166 #       test -e "$(distdir)/vsprojects" \
167 #          && chmod -R u+w $(distdir)/*.sln $(distdir)/vsprojects/
168
169 libtool: $(LIBTOOL_DEPS)
170         $(SHELL) ./config.status --recheck
171 EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \
172         $(SCRIPTS) src/logging_unittest.err src/demangle_unittest.txt