Description: use Debian's C*FLAGS and LDFLAGS (esp. for hardening)
Author: Tianon Gravi <tianon@debian.org>

diff --git a/Makefile b/Makefile
index 4482430..f7f3ee0 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,10 @@ PREFIX=/usr/local
 XLIBPATH=/usr/X11R6/lib
 
 # Sets some flags for stricter compiling
-CFLAGS=-pedantic -Wall -W -O
+CFLAGS += -pedantic -Wall
+
+CPPFLAGS ?=
+LDFLAGS += -L$(XLIBPATH) -lX11
 
 PKG_CONFIG ?= pkg-config
 
@@ -32,13 +35,13 @@ all: $(target) $(sources) $(headers)
 	@echo Build Successful
 
 $(target): $(sources:.c=.o)
-	$(CC) $(CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) \
 		$^ -o $@ \
-		-L$(XLIBPATH) -lX11 \
+		$(LDFLAGS) \
 		`$(PKG_CONFIG) --libs glib-2.0`
 
 %.o: %.c
-	$(CC) -c $(CFLAGS) `$(PKG_CONFIG) --cflags glib-2.0` $<
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) `$(PKG_CONFIG) --cflags glib-2.0` $<
 
 version.h: version.h.in Makefile
 	sed -e "s/@VERSION@/$(VERSION)/" version.h.in > $@
