Allow user to specify compiler optimization flags via CFLAGS at compile time. suggested by Ole André Vadla Ravnås
diff --git a/Makefile b/Makefile
index 40cc55e..089f231 100644
--- a/Makefile
+++ b/Makefile
@@ -16,16 +16,19 @@
STRIP = $(CROSS)strip
endif
-CFLAGS += -fPIC -O3 -Wall -Iinclude
+ifneq (,$(findstring yes,$(CAPSTONE_DIET)))
+CFLAGS ?= -Os
+CFLAGS += -DCAPSTONE_DIET
+else
+CFLAGS ?= -O3
+endif
+
+CFLAGS += -fPIC -Wall -Iinclude
ifeq ($(USE_SYS_DYN_MEM),yes)
CFLAGS += -DUSE_SYS_DYN_MEM
endif
-ifneq (,$(findstring yes,$(CAPSTONE_DIET)))
-CFLAGS += -DCAPSTONE_DIET -Os
-endif
-
PREFIX ?= /usr
DESTDIR ?=
INCDIR = $(DESTDIR)$(PREFIX)/include