Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Unified Diff: src/platform/monitor_reconfig/Makefile

Issue 1619018: monitor_reconfigure: Clean up build and style. (Closed)
Patch Set: update header guard name Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/platform/monitor_reconfig/Makefile
diff --git a/src/platform/monitor_reconfig/Makefile b/src/platform/monitor_reconfig/Makefile
index 81bc3221b144657c338390ce3c0139ddb2db6953..d62f0f6e58be9c1e2059347900a03d3e9d35cc6f 100644
--- a/src/platform/monitor_reconfig/Makefile
+++ b/src/platform/monitor_reconfig/Makefile
@@ -1,27 +1,27 @@
-# Makefile for monitor_reconfigure
-#######################################################
-CXX ?= /usr/bin/g++
-CC ?= /usr/bin/gcc
-CPPFLAGS += -I../..
-CFLAGS += -Wall -g -O2
-CXXFLAGS=$(CFLAGS)
-LDFLAGS += -lX11 -lXrandr
-#######################################################
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
-NAME=monitor_reconfigure
-VERSION=0.1
+CXX ?= g++
+CXXFLAGS ?= -Wall -Werror -g
+PKG_CONFIG ?= pkg-config
-CPPFLAGS+=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\"
+LIBS = -lbase -lpthread -lrt
+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
-all: monitor_reconfigure
+.cc.o:
+ $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@
-monitor_reconfigure: $(OBJECTS)
- $(CXX) $(LDFLAGS) $^ -o $@
+$(BIN): $(OBJECTS)
+ $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) $(LIB_DIRS) $^ $(LIBS) $(LDFLAGS) \
+ -o $@
-install: monitor_reconfigure
- install -D -m 755 monitor_reconfigure $(DESTDIR)/usr/sbin/monitor_reconfigure
+all: $(BIN)
clean:
- @rm -f monitor_reconfigure *.o
+ @rm -f $(BIN) $(OBJECTS)
« no previous file with comments | « no previous file | src/platform/monitor_reconfig/README » ('j') | src/platform/monitor_reconfig/monitor_reconfigure_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698