diff options
| author | Daniel Bovensiepen <[email protected]> | 2012-06-18 11:22:05 +0800 |
|---|---|---|
| committer | Daniel Bovensiepen <[email protected]> | 2012-06-18 11:22:05 +0800 |
| commit | 83e5999d7efcad648e9ecbd64c51b305b6261999 (patch) | |
| tree | 4372c088c217869daf2dfd4527a4e8ef3b769b80 /Makefile | |
| parent | f88a8399149f9b949f31f960d56d486a423efefa (diff) | |
| download | mruby-83e5999d7efcad648e9ecbd64c51b305b6261999.tar.gz mruby-83e5999d7efcad648e9ecbd64c51b305b6261999.zip | |
Make CFLAG choices in Makefiles more flexible
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -7,12 +7,19 @@ export LL = gcc export AR = ar export YACC = bison -DEBUG_MODE = 1 -ifeq ($(DEBUG_MODE),1) -CFLAGS = -g -O3 -else -CFLAGS = -O3 +ifeq ($(strip $(COMPILE_MODE)),) + # default compile option + COMPILE_MODE = debug +endif + +ifeq ($(COMPILE_MODE),debug) + CFLAGS = -g -O3 +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 = --no-print-directory CC=$(CC) LL=$(LL) ALL_CFLAGS='$(ALL_CFLAGS)' |
