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 CXX ?= g++ | 5 CXX ?= g++ |
6 CXXFLAGS ?= -Wall -Werror -g | 6 CXXFLAGS ?= -Wall -Werror -g |
7 PKG_CONFIG ?= pkg-config | 7 PKG_CONFIG ?= pkg-config |
8 | 8 |
9 LIBS = -lbase -lpthread -lrt | 9 LIBS = -lbase -lpthread -lrt |
| 10 TEST_LIBS = -lgtest -lgflags |
10 INCLUDE_DIRS = -I.. $(shell $(PKG_CONFIG) --cflags x11 xrandr) | 11 INCLUDE_DIRS = -I.. $(shell $(PKG_CONFIG) --cflags x11 xrandr) |
11 LIB_DIRS = $(shell $(PKG_CONFIG) --libs x11 xrandr) | 12 LIB_DIRS = $(shell $(PKG_CONFIG) --libs x11 xrandr) |
12 | 13 |
13 | 14 |
14 BIN=monitor_reconfigure | 15 BIN=monitor_reconfigure |
15 OBJECTS=monitor_reconfigure_main.o | 16 OBJECTS=monitor_reconfigure_main.o resolution_selector.o |
16 | 17 |
17 .cc.o: | 18 .cc.o: |
18 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@ | 19 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@ |
19 | 20 |
20 $(BIN): $(OBJECTS) | 21 $(BIN): $(OBJECTS) |
21 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) $(LIB_DIRS) $^ $(LIBS) $(LDFLAGS) \ | 22 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) $(LIB_DIRS) $^ $(LIBS) $(LDFLAGS) \ |
22 » » -o $@ | 23 » -o $@ |
23 | 24 |
24 all: $(BIN) | 25 all: $(BIN) |
25 | 26 |
| 27 test: resolution_selector_test |
| 28 |
| 29 resolution_selector_test: resolution_selector_test.cc resolution_selector.o |
| 30 $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) $(LIB_DIRS) $^ \ |
| 31 $(LIBS) $(TEST_LIBS) $(LDFLAGS) -o $@ |
| 32 |
26 clean: | 33 clean: |
27 » @rm -f $(BIN) $(OBJECTS) | 34 » @rm -f $(BIN) $(OBJECTS) resolution_selector_test |
OLD | NEW |