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 = \ | 7 CRASH_OBJS = \ |
8 crash_collector.o \ | 8 crash_collector.o \ |
9 kernel_collector.o \ | 9 kernel_collector.o \ |
10 system_logging.o \ | 10 system_logging.o \ |
11 unclean_shutdown_collector.o \ | 11 unclean_shutdown_collector.o \ |
12 user_collector.o | 12 user_collector.o |
13 TEST_OBJS = $(CRASH_OBJS) system_logging_mock.o | 13 TEST_OBJS = $(CRASH_OBJS) system_logging_mock.o |
14 TEST_BINS = \ | 14 TEST_BINS = \ |
15 crash_collector_test \ | 15 crash_collector_test \ |
16 kernel_collector_test \ | 16 kernel_collector_test \ |
17 unclean_shutdown_collector_test \ | 17 unclean_shutdown_collector_test \ |
18 user_collector_test | 18 user_collector_test |
19 | 19 |
| 20 LDCONFIG = $(shell $(PKG_CONFIG) --libs libpcrecpp) |
| 21 |
20 # -lglib-2.0 is needed by libbase.a now. | 22 # -lglib-2.0 is needed by libbase.a now. |
21 COMMON_LIBS = -lbase -lpthread -lglib-2.0 -lgflags -lrt | 23 COMMON_LIBS = -lbase -lpthread -lglib-2.0 -lgflags -lrt $(LDCONFIG) |
22 REPORTER_LIBS = $(COMMON_LIBS) -lmetrics | 24 REPORTER_LIBS = $(COMMON_LIBS) -lmetrics |
23 | 25 |
24 TEST_LIBS = $(COMMON_LIBS) -lgtest -lgmock | 26 TEST_LIBS = $(COMMON_LIBS) -lgtest -lgmock |
25 INCLUDE_DIRS = -I.. -I$(SYSROOT)/usr/include/google-breakpad | 27 INCLUDE_DIRS = -I.. -I$(SYSROOT)/usr/include/google-breakpad |
26 | 28 |
27 CXXFLAGS += -Wall -Werror | 29 CXXFLAGS += -Wall -Werror |
28 | 30 |
29 all: $(REPORTER_BINS) | 31 all: $(REPORTER_BINS) |
30 | 32 |
31 $(CRASH_REPORTER): crash_reporter.o $(CRASH_OBJS) | 33 $(CRASH_REPORTER): crash_reporter.o $(CRASH_OBJS) |
32 $(CXX) $(CXXFLAGS) $^ $(REPORTER_LIBS) -o $@ | 34 $(CXX) $(CXXFLAGS) $^ $(REPORTER_LIBS) -o $@ |
33 | 35 |
34 tests: $(TEST_BINS) | 36 tests: $(TEST_BINS) |
35 | 37 |
36 %_test: %_test.o $(TEST_OBJS) | 38 %_test: %_test.o $(TEST_OBJS) |
37 $(CXX) $(CXXFLAGS) $(LIB_DIRS) $^ $(TEST_LIBS) -o $@ | 39 $(CXX) $(CXXFLAGS) $(LIB_DIRS) $^ $(TEST_LIBS) -o $@ |
38 | 40 |
39 .cc.o: | 41 .cc.o: |
40 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@ | 42 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@ |
41 | 43 |
42 clean: | 44 clean: |
43 rm -rf *.o $(CRASH_BIN) $(TEST_BINS) | 45 rm -rf *.o $(CRASH_BIN) $(TEST_BINS) |
OLD | NEW |