OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 CRASH_REPORTER = crash_reporter | 5 CRASH_REPORTER = crash_reporter |
6 REPORTER_BINS = $(CRASH_REPORTER) | 6 REPORTER_BINS = $(CRASH_REPORTER) |
7 CRASH_OBJS = system_logging.o user_collector.o | 7 CRASH_OBJS = system_logging.o user_collector.o |
8 TEST_OBJS = $(CRASH_OBJS) system_logging_mock.o | 8 TEST_OBJS = $(CRASH_OBJS) system_logging_mock.o |
9 TEST_BINS = user_collector_test | 9 TEST_BINS = user_collector_test |
10 | 10 |
11 COMMON_LIBS = -lbase -lpthread -lgflags -lrt | 11 # -lglib-2.0 is needed by libbase.a now. |
| 12 COMMON_LIBS = -lbase -lpthread -lglib-2.0 -lgflags -lrt |
12 REPORTER_LIBS = $(COMMON_LIBS) -lmetrics | 13 REPORTER_LIBS = $(COMMON_LIBS) -lmetrics |
13 | 14 |
14 TEST_LIBS = $(COMMON_LIBS) -lgtest -lgmock | 15 TEST_LIBS = $(COMMON_LIBS) -lgtest -lgmock |
15 INCLUDE_DIRS = -I.. -I$(SYSROOT)/usr/include/google-breakpad | 16 INCLUDE_DIRS = -I.. -I$(SYSROOT)/usr/include/google-breakpad |
16 | 17 |
17 CXXFLAGS += -Wall -Werror | 18 CXXFLAGS += -Wall -Werror |
18 | 19 |
19 all: $(REPORTER_BINS) | 20 all: $(REPORTER_BINS) |
20 | 21 |
21 $(CRASH_REPORTER): crash_reporter.o $(CRASH_OBJS) | 22 $(CRASH_REPORTER): crash_reporter.o $(CRASH_OBJS) |
22 $(CXX) $(CXXFLAGS) $^ $(REPORTER_LIBS) -o $@ | 23 $(CXX) $(CXXFLAGS) $^ $(REPORTER_LIBS) -o $@ |
23 | 24 |
24 tests: $(TEST_BINS) | 25 tests: $(TEST_BINS) |
25 | 26 |
26 user_collector_test: user_collector_test.o $(TEST_OBJS) | 27 user_collector_test: user_collector_test.o $(TEST_OBJS) |
27 $(CXX) $(CXXFLAGS) $(LIB_DIRS) $^ $(TEST_LIBS) -o $@ | 28 $(CXX) $(CXXFLAGS) $(LIB_DIRS) $^ $(TEST_LIBS) -o $@ |
28 | 29 |
29 .cc.o: | 30 .cc.o: |
30 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@ | 31 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@ |
31 | 32 |
32 clean: | 33 clean: |
33 rm -rf *.o $(CRASH_BIN) $(TEST_BINS) | 34 rm -rf *.o $(CRASH_BIN) $(TEST_BINS) |
OLD | NEW |