git.strcat.st

/strcat/wm.git/ - summarytreelogarchivereleases

subject
add config.mk
commit
b03f448cd975ce7e7b952f057a5a902ba36f8fb0
date
2026-05-30T17:54:35Z
message
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