diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-12-07 01:04:32 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-12-07 01:04:32 -0800 |
| commit | f521738953b9297a4d26e68ec42b7e9a22e5b442 (patch) | |
| tree | c54451f210ebea9233229cc29ad82311e554ff63 /tools | |
| parent | bd3b95cae66bf68a757a0dcdf05bcb05eb177391 (diff) | |
| parent | bef73cc54f044e16caf6bc1ba16ed0bf779c5ade (diff) | |
| download | mruby-f521738953b9297a4d26e68ec42b7e9a22e5b442.tar.gz mruby-f521738953b9297a4d26e68ec42b7e9a22e5b442.zip | |
Merge pull request #479 from bovi/mrbgems
mrbgems
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/mirb/Makefile | 20 | ||||
| -rw-r--r-- | tools/mrbc/mrbc.c | 7 | ||||
| -rw-r--r-- | tools/mruby/Makefile | 26 |
3 files changed, 48 insertions, 5 deletions
diff --git a/tools/mirb/Makefile b/tools/mirb/Makefile index 8dbbc52b3..c44af4c6b 100644 --- a/tools/mirb/Makefile +++ b/tools/mirb/Makefile @@ -3,9 +3,27 @@ # project-specific macros # extension of the executable-file is modifiable(.exe .out ...) +MRUBY_ROOT := ../.. BASEDIR = ../../src TARGET := ../../bin/mirb LIBR := ../../lib/libmruby.a + +ifeq ($(strip $(ENABLE_GEMS)),) + # by default GEMs are deactivated + ENABLE_GEMS = false +endif + +ifeq ($(ENABLE_GEMS),false) + GEM_ARCHIVE_FILES = +else + MAKEFILE_GEM_LIST := $(MRUBY_ROOT)/mrbgems/g/MakefileGemList + ifeq ($(wildcard $(MAKEFILE_GEM_LIST)),) + GEM_ARCHIVE_FILES = + else + include $(MAKEFILE_GEM_LIST) + endif +endif + ifeq ($(OS),Windows_NT) EXE := $(TARGET).exe else @@ -49,7 +67,7 @@ all : $(LIBR) $(EXE) # executable constructed using linker from object files $(EXE) : $(LIBR) $(OBJS) $(EXTS) - $(LL) -o $@ $(CFLAGS) $(OBJS) $(LIBR) $(EXTS) $(LIBS) + $(LL) -o $@ $(CFLAGS) $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES) $(EXTS) $(LIBS) -include $(OBJS:.o=.d) diff --git a/tools/mrbc/mrbc.c b/tools/mrbc/mrbc.c index 2ecb00623..5a92cd479 100644 --- a/tools/mrbc/mrbc.c +++ b/tools/mrbc/mrbc.c @@ -225,3 +225,10 @@ void mrb_init_mrblib(mrb_state *mrb) { } + +#ifdef ENABLE_GEMS +void +mrb_init_mrbgems(mrb_state *mrb) +{ +} +#endif diff --git a/tools/mruby/Makefile b/tools/mruby/Makefile index e94c1b2b4..b31ed4941 100644 --- a/tools/mruby/Makefile +++ b/tools/mruby/Makefile @@ -3,9 +3,27 @@ # project-specific macros # extension of the executable-file is modifiable(.exe .out ...) -BASEDIR = ../../src -TARGET := ../../bin/mruby -LIBR := ../../lib/libmruby.a +MRUBY_ROOT := ../.. +BASEDIR = $(MRUBY_ROOT)/src +TARGET := $(MRUBY_ROOT)/bin/mruby +LIBR := $(MRUBY_ROOT)/lib/libmruby.a + +ifeq ($(strip $(ENABLE_GEMS)),) + # by default GEMs are deactivated + ENABLE_GEMS = false +endif + +ifeq ($(ENABLE_GEMS),false) + GEM_ARCHIVE_FILES = +else + MAKEFILE_GEM_LIST := $(MRUBY_ROOT)/mrbgems/g/MakefileGemList + ifeq ($(wildcard $(MAKEFILE_GEM_LIST)),) + GEM_ARCHIVE_FILES = + else + include $(MAKEFILE_GEM_LIST) + endif +endif + ifeq ($(OS),Windows_NT) EXE := $(TARGET).exe else @@ -54,7 +72,7 @@ all : $(LIBR) $(EXE) # executable constructed using linker from object files $(EXE) : $(LIBR) $(OBJS) $(EXTS) - $(LL) -o $@ $(CFLAGS) $(OBJS) $(LIBR) $(EXTS) $(LIBS) + $(LL) -o $@ $(CFLAGS) $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES) $(EXTS) $(LIBS) -include $(OBJS:.o=.d) |
