summaryrefslogtreecommitdiffhomepage
path: root/tools/mirb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-06-17 22:23:55 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-06-17 22:23:55 -0700
commit95bed11755f983ac66c386dc15bca8c414f06316 (patch)
tree1ee159301f9637074abc1550fc12adfef9eb9c60 /tools/mirb
parent955a48d964a2bbe175617880c868ca8b862da74e (diff)
parent83e5999d7efcad648e9ecbd64c51b305b6261999 (diff)
downloadmruby-95bed11755f983ac66c386dc15bca8c414f06316.tar.gz
mruby-95bed11755f983ac66c386dc15bca8c414f06316.zip
Merge pull request #297 from bovi/improve-cflag-choice
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)"