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 # Makefile for metrics utilities -- library, client and daemon | 5 # Makefile for metrics utilities -- library, client and daemon |
6 # | 6 # |
7 | 7 |
8 CCONFIG = $(shell $(PKG_CONFIG) --cflags dbus-1 glib-2.0 dbus-glib-1) | 8 CCONFIG = $(shell $(PKG_CONFIG) --cflags dbus-1 glib-2.0 dbus-glib-1) |
9 LDCONFIG = $(shell $(PKG_CONFIG) --libs dbus-1 glib-2.0 gthread-2.0 dbus-glib-1) | 9 LDCONFIG = $(shell $(PKG_CONFIG) --libs dbus-1 glib-2.0 gthread-2.0 dbus-glib-1) |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 metrics_daemon.o \ | 28 metrics_daemon.o \ |
29 metrics_daemon_main.o | 29 metrics_daemon_main.o |
30 TESTDAEMON_OBJS = \ | 30 TESTDAEMON_OBJS = \ |
31 counter.o \ | 31 counter.o \ |
32 metrics_daemon.o \ | 32 metrics_daemon.o \ |
33 metrics_daemon_test.o | 33 metrics_daemon_test.o |
34 LIB_OBJS = \ | 34 LIB_OBJS = \ |
35 c_metrics_library.o \ | 35 c_metrics_library.o \ |
36 metrics_library.o | 36 metrics_library.o |
37 TESTLIB_OBJS = \ | 37 TESTLIB_OBJS = \ |
38 metrics_library.o \ | |
39 metrics_library_test.o | 38 metrics_library_test.o |
40 | 39 |
41 TESTCOUNTER_LIBS = -lgmock -lgtest -lbase -lrt -lpthread | 40 TESTCOUNTER_LIBS = -lgmock -lgtest -lbase -lrt -lpthread |
42 DAEMON_LDFLAGS = $(LDFLAGS) $(LDCONFIG) -lrt -lbase -lpthread -lgflags | 41 DAEMON_LDFLAGS = $(LDFLAGS) $(LDCONFIG) -lrt -lbase -lpthread -lgflags |
43 TESTDAEMON_LIBS = -lgmock -lgtest | 42 TESTDAEMON_LIBS = -lgmock -lgtest |
44 TESTLIB_LIBS = -lgtest -lbase -lrt -lpthread | 43 TESTLIB_LIBS = -lgtest -lbase -lrt -lpthread |
45 | 44 |
46 all: $(LIB) $(SHAREDLIB) $(CLIENT) $(DAEMON) | 45 all: $(LIB) $(SHAREDLIB) $(CLIENT) $(DAEMON) |
47 | 46 |
48 tests: $(COUNTER_TEST) $(DAEMON_TEST) $(LIB_TEST) | 47 tests: $(COUNTER_TEST) $(DAEMON_TEST) $(LIB_TEST) |
(...skipping 15 matching lines...) Expand all Loading... |
64 | 63 |
65 $(SHAREDLIB): $(LIB_OBJS) | 64 $(SHAREDLIB): $(LIB_OBJS) |
66 $(CXX) $(LDFLAGS) -shared $^ -o $@ | 65 $(CXX) $(LDFLAGS) -shared $^ -o $@ |
67 | 66 |
68 $(LIB_TEST): $(TESTLIB_OBJS) $(SHAREDLIB) | 67 $(LIB_TEST): $(TESTLIB_OBJS) $(SHAREDLIB) |
69 $(CXX) -o $@ $^ $(LDFLAGS) $(TESTLIB_LIBS) | 68 $(CXX) -o $@ $^ $(LDFLAGS) $(TESTLIB_LIBS) |
70 | 69 |
71 %.o: %.cc | 70 %.o: %.cc |
72 $(CXX) $(CXXFLAGS) -c $< -o $@ | 71 $(CXX) $(CXXFLAGS) -c $< -o $@ |
73 | 72 |
74 # dependencies in addition to those defined by the rules | |
75 | |
76 metrics_daemon.o: \ | |
77 metrics_daemon.h \ | |
78 network_states.h \ | |
79 power_states.h | |
80 metrics_daemon_test.o: \ | |
81 metrics_daemon.h \ | |
82 network_states.h \ | |
83 power_states.h | |
84 | |
85 clean: | 73 clean: |
86 rm -f $(CLIENT) $(DAEMON) $(LIB) $(SHAREDLIB) *.o | 74 rm -f $(CLIENT) $(DAEMON) $(LIB) $(SHAREDLIB) *.o |
87 rm -f $(COUNTER_TEST) $(DAEMON_TEST) $(LIB_TEST) | 75 rm -f $(COUNTER_TEST) $(DAEMON_TEST) $(LIB_TEST) |
OLD | NEW |