summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile22
-rw-r--r--test/init_mrbtest.c5
2 files changed, 11 insertions, 16 deletions
diff --git a/test/Makefile b/test/Makefile
index f918d674d..95690a60b 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -52,14 +52,6 @@ ifeq ($(strip $(COMPILE_MODE)),)
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 = CC=$(CC) LL=$(LL) ALL_CFLAGS='$(ALL_CFLAGS)' LDFLAGS='$(LDFLAGS)'
@@ -85,7 +77,7 @@ RAKE = ../minirake
# generic build targets, rules
.PHONY : test
-all : $(EXE) $(MRUBY) $(TESTRB) $(TESTMRB)
+all : $(EXE) $(MRUBY) $(TESTRB) $(TESTMRB)
@echo "# exec mrbtest"
./$(EXE)
@echo
@@ -97,9 +89,14 @@ all : $(EXE) $(MRUBY) $(TESTRB) $(TESTMRB)
@echo
# executable constructed using linker from object files
-$(EXE) : $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES)
+$(EXE) : generate-mrbgems-test $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES)
$(LL) -o $@ $(LDFLAGS) $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES) $(LIBS)
+generate-mrbgems-test :
+ifeq ($(ENABLE_GEMS),true)
+ @$(RAKE) mrbgems_prepare_test
+endif
+
-include $(OBJS:.o=.d)
# objects compiled from source
@@ -107,10 +104,7 @@ $(OBJS) : %.o : %.c
$(CC) $(ALL_CFLAGS) -MMD $(INCLUDES) -c $< -o $@
# Compile C source from merged mruby source
-$(CLIB) : $(DLIB) $(INIT)
-ifeq ($(ENABLE_GEMS),true)
- @$(RAKE) mrbgems_prepare_test
-endif
+$(CLIB) : $(DLIB) $(INIT) $(GEMDLIB)
$(CAT) $(INIT) $(DLIB) $(GEMDLIB) > $@
$(DLIB) : $(RLIB) $(MRBC)
diff --git a/test/init_mrbtest.c b/test/init_mrbtest.c
index 569fde302..6b2219b6f 100644
--- a/test/init_mrbtest.c
+++ b/test/init_mrbtest.c
@@ -5,14 +5,15 @@
#include "mruby/proc.h"
extern const char mrbtest_irep[];
-extern const char mrbgemtest_irep[];
+
+void mrbgemtest_init(mrb_state* mrb);
void
mrb_init_mrbtest(mrb_state *mrb)
{
mrb_load_irep(mrb, mrbtest_irep);
#ifndef DISABLE_GEMS
- mrb_load_irep(mrb, mrbgemtest_irep);
+ mrbgemtest_init(mrb);
#endif
if (mrb->exc) {
mrb_p(mrb, mrb_obj_value(mrb->exc));