summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@linux.intel.com>2017-01-20 18:08:18 +0200
committerMartin Peres <martin.peres@linux.intel.com>2017-01-20 18:08:18 +0200
commit1443224f9d2de179514a0bf14194ac3fe3a01499 (patch)
tree3600ee64d2bd38ad49f263d6dc15548b9d908d89 /Makefile
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0c97d49
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+CC = gcc
+CFLAGS = -c -Wall
+LDFLAGS =
+
+# List of sources:
+SOURCES = auto-randr.c
+OBJECTS = $(SOURCES:.cpp=.o)
+
+# Name of executable target:
+EXECUTABLE = auto-randr
+
+CFLAGS += `pkg-config --cflags x11`
+LDFLAGS += `pkg-config --libs x11`
+
+CFLAGS += `pkg-config --cflags xrandr`
+LDFLAGS += `pkg-config --libs xrandr`
+
+all: $(SOURCES) $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CC) $(OBJECTS) -o $@ $(LDFLAGS)
+
+.cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
+
+clean:
+ rm $(OBJECTS) $(EXECUTABLE)