diff
Makefile | 17 ++++++++++++++---
config.mk | 7 +++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 5a4258c..894efed 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,20 @@
+include config.mk
+
CFLAGS = -std=c89 -Wall -Wextra -Werror -pedantic
-CPPFLAGS = -I/usr/X11R6/include
-LDFLAGS = -L/usr/X11R6/lib
+CPPFLAGS =
+LDFLAGS =
LDLIBS = -lX11
-WM_EXTRAS = extras/ewmh/ewmh.c
+WM_EXTRAS =
+
+ifeq ($(EWMH),1)
+WM_EXTRAS += extras/ewmh/ewmh.c
+endif
+
+ifeq ($(XINERAMA),1)
+WM_EXTRAS += extras/xinerama.c
+LDLIBS += -lXinerama
+endif
all: wm wmc
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..969824a
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,7 @@
+# features
+EWMH=1
+XINERAMA=1
+
+# uncomment on obsd and other systems which use the X11R6 path.
+#CPPFLAGS += -I/usr/X11R6/include
+#LDFLAGS += -L/usr/X11R6/lib