Index: Makefile |
diff --git a/Makefile b/Makefile |
index d62f0f6e58be9c1e2059347900a03d3e9d35cc6f..3ef81f1b063d3fbdceed9a8c399157e9e3a2983d 100644 |
--- a/Makefile |
+++ b/Makefile |
@@ -7,21 +7,28 @@ CXXFLAGS ?= -Wall -Werror -g |
PKG_CONFIG ?= pkg-config |
LIBS = -lbase -lpthread -lrt |
+TEST_LIBS = -lgtest -lgflags |
INCLUDE_DIRS = -I.. $(shell $(PKG_CONFIG) --cflags x11 xrandr) |
LIB_DIRS = $(shell $(PKG_CONFIG) --libs x11 xrandr) |
BIN=monitor_reconfigure |
-OBJECTS=monitor_reconfigure_main.o |
+OBJECTS=monitor_reconfigure_main.o resolution_selector.o |
.cc.o: |
$(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@ |
$(BIN): $(OBJECTS) |
$(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) $(LIB_DIRS) $^ $(LIBS) $(LDFLAGS) \ |
- -o $@ |
+ -o $@ |
all: $(BIN) |
+test: resolution_selector_test |
+ |
+resolution_selector_test: resolution_selector_test.cc resolution_selector.o |
+ $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) $(LIB_DIRS) $^ \ |
+ $(LIBS) $(TEST_LIBS) $(LDFLAGS) -o $@ |
+ |
clean: |
- @rm -f $(BIN) $(OBJECTS) |
+ @rm -f $(BIN) $(OBJECTS) resolution_selector_test |