summaryrefslogtreecommitdiffhomepage
path: root/tools/mirb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-12-07 01:04:32 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2012-12-07 01:04:32 -0800
commitf521738953b9297a4d26e68ec42b7e9a22e5b442 (patch)
treec54451f210ebea9233229cc29ad82311e554ff63 /tools/mirb
parentbd3b95cae66bf68a757a0dcdf05bcb05eb177391 (diff)
parentbef73cc54f044e16caf6bc1ba16ed0bf779c5ade (diff)
downloadmruby-f521738953b9297a4d26e68ec42b7e9a22e5b442.tar.gz
mruby-f521738953b9297a4d26e68ec42b7e9a22e5b442.zip
Merge pull request #479 from bovi/mrbgems
mrbgems
Diffstat (limited to 'tools/mirb')
-rw-r--r--tools/mirb/Makefile20
1 files changed, 19 insertions, 1 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)