>From eb5d7870f800a201b23c5e96c4a2b2fac9848b80 Mon Sep 17 00:00:00 2001
From: "Dmitrij D. Czarkoff" <[email protected]>
Date: Fri, 5 Dec 2014 11:08:12 +0100
Subject: [PATCH 2/2] Decouple build system from program settings
---
config.mk | 3 ++-
slock.c | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/config.mk b/config.mk
index 8cc3f68..520fe8a 100644
--- a/config.mk
+++ b/config.mk
@@ -14,12 +14,13 @@ INCS = -I. -I/usr/include -I${X11INC}
LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext
# flags
-CPPFLAGS = -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H -DCOLOR1=\"black\"
-DCOLOR2=\"\#005577\"
+CPPFLAGS = -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H
CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
LDFLAGS = -s ${LIBS}
# On *BSD remove -DHAVE_SHADOW_H from CPPFLAGS and add -DHAVE_BSD_AUTH
# On OpenBSD and Darwin remove -lcrypt from LIBS
+# Redefine COLOR1 and COLOR2 to set custom colors
# compiler and linker
CC = cc
diff --git a/slock.c b/slock.c
index d281965..1ddc35b 100644
--- a/slock.c
+++ b/slock.c
@@ -1,4 +1,3 @@
-
/* See LICENSE file for license details. */
#define _XOPEN_SOURCE 500
#if HAVE_SHADOW_H
@@ -23,6 +22,9 @@
#include <bsd_auth.h>
#endif
+#define COLOR1 "black"
+#define COLOR2 "#005577"
+
typedef struct {
int screen;
Window root, win;
--
2.1.3