fix flag handling

Make sure we respect CPPFLAGS and don't hardcode

BUG=None
TEST=`emerge-x86-alex rootdev` uses right flags

Change-Id: I668af9e02b842ddc54f60e07d313a564cc927413
Reviewed-on: https://chromium-review.googlesource.com/175522
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/Makefile b/Makefile
index ed0bbc2..1575f3a 100644
--- a/Makefile
+++ b/Makefile
@@ -2,16 +2,17 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+CFLAGS += -Wall -Werror
 OUT = $(CURDIR)
 $(shell mkdir -p $(OUT))
 
 all: $(OUT)/rootdev $(OUT)/librootdev.so.1.0
 
 $(OUT)/rootdev: main.c $(OUT)/librootdev.so.1.0
-	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -O2 -Wall
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
 
 $(OUT)/librootdev.so.1.0: rootdev.c
-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -fPIC \
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC \
 		-Wl,-soname,librootdev.so.1 $< -o $@
 	ln -s $(@F) $(OUT)/librootdev.so.1
 	ln -s $(@F) $(OUT)/librootdev.so