summaryrefslogtreecommitdiffhomepage
path: root/tools/mirb
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2012-06-18 11:22:05 +0800
committerDaniel Bovensiepen <[email protected]>2012-06-18 11:22:05 +0800
commit83e5999d7efcad648e9ecbd64c51b305b6261999 (patch)
tree4372c088c217869daf2dfd4527a4e8ef3b769b80 /tools/mirb
parentf88a8399149f9b949f31f960d56d486a423efefa (diff)
downloadmruby-83e5999d7efcad648e9ecbd64c51b305b6261999.tar.gz
mruby-83e5999d7efcad648e9ecbd64c51b305b6261999.zip
Make CFLAG choices in Makefiles more flexible
Diffstat (limited to 'tools/mirb')
-rw-r--r--tools/mirb/Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/mirb/Makefile b/tools/mirb/Makefile
index ba307227c..52941f242 100644
--- a/tools/mirb/Makefile
+++ b/tools/mirb/Makefile
@@ -21,12 +21,19 @@ EXTS := $(EXT1)
LIBS = -lm
INCLUDES = -I$(BASEDIR) -I$(BASEDIR)/../include
-DEBUG_MODE = 1
-ifeq ($(DEBUG_MODE),1)
+ifeq ($(strip $(COMPILE_MODE)),)
+ # default compile option
+ COMPILE_MODE = debug
+endif
+
+ifeq ($(COMPILE_MODE),debug)
CFLAGS = -g -O3
-else
+else ifeq ($(COMPILE_MODE),release)
CFLAGS = -O3
+else ifeq ($(COMPILE_MODE),small)
+ CFLAGS = -Os
endif
+
ALL_CFLAGS = -Wall -Werror-implicit-function-declaration $(CFLAGS)
ifeq ($(OS),Windows_NT)
MAKE_FLAGS = CC=$(CC) LL=$(LL) ALL_CFLAGS="$(ALL_CFLAGS)"