From: Ruben Undheim <ruben.undheim@gmail.com>
Date: Tue, 14 Jun 2016 18:46:08 +0200
Subject: This makes sure that the CXXFLAGS given by the Debian build system
 are not overwritten,
 but prepended. Additionally unwanted CXXFLAGS are removed.

---
 icebram/Makefile  | 3 ++-
 icemulti/Makefile | 2 +-
 icepack/Makefile  | 2 +-
 icepll/Makefile   | 2 +-
 iceprog/Makefile  | 4 ++--
 icetime/Makefile  | 2 +-
 6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/icebram/Makefile b/icebram/Makefile
index 827fe7c..26baa49 100644
--- a/icebram/Makefile
+++ b/icebram/Makefile
@@ -1,6 +1,7 @@
 include ../config.mk
 LDLIBS = -lm -lstdc++
-CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include
+CXXFLAGS += -Wall -std=c++11
+
 
 ifeq ($(STATIC),1)
 LDFLAGS += -static
diff --git a/icemulti/Makefile b/icemulti/Makefile
index 009889e..5c4ceb7 100644
--- a/icemulti/Makefile
+++ b/icemulti/Makefile
@@ -1,6 +1,6 @@
 include ../config.mk
 LDLIBS = -lm -lstdc++
-CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11
+CXXFLAGS += -Wall -std=c++11
 
 ifeq ($(STATIC),1)
 LDFLAGS += -static
diff --git a/icepack/Makefile b/icepack/Makefile
index cfe48be..0d65562 100644
--- a/icepack/Makefile
+++ b/icepack/Makefile
@@ -1,6 +1,6 @@
 include ../config.mk
 LDLIBS = -lm -lstdc++
-CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include
+CXXFLAGS += -Wall -std=c++11
 MXEGCC = /usr/local/src/mxe/usr/bin/i686-pc-mingw32-gcc
 
 ifeq ($(STATIC),1)
diff --git a/icepll/Makefile b/icepll/Makefile
index e0badf6..3606093 100644
--- a/icepll/Makefile
+++ b/icepll/Makefile
@@ -1,6 +1,6 @@
 include ../config.mk
 LDLIBS = -lm -lstdc++
-CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include
+CXXFLAGS += -Wall -std=c++11
 
 ifeq ($(STATIC),1)
 LDFLAGS += -static
diff --git a/iceprog/Makefile b/iceprog/Makefile
index 5614646..9209cc2 100644
--- a/iceprog/Makefile
+++ b/iceprog/Makefile
@@ -2,11 +2,11 @@ include ../config.mk
 
 ifneq ($(shell uname -s),Darwin)
   LDLIBS = -L/usr/local/lib -lm
-  CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
+  CFLAGS += -Wall -std=c99 -I/usr/local/include
 else
   LIBFTDI_NAME = $(shell $(PKG_CONFIG) --exists libftdi1 && echo ftdi1 || echo ftdi)
   LDLIBS = -L/usr/local/lib -l$(LIBFTDI_NAME) -lm
-  CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
+  CFLAGS += -Wall -std=c99 -I/usr/local/include
 endif
 
 ifeq ($(STATIC),1)
diff --git a/icetime/Makefile b/icetime/Makefile
index c56002b..22414df 100644
--- a/icetime/Makefile
+++ b/icetime/Makefile
@@ -1,6 +1,6 @@
 include ../config.mk
 LDLIBS = -lm -lstdc++
-CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include -DPREFIX='"$(PREFIX)"'
+CXXFLAGS += -Wall -std=c++11 -DPREFIX='"$(PREFIX)"'
 
 ifeq ($(STATIC),1)
 LDFLAGS += -static
