summaryrefslogtreecommitdiffhomepage
path: root/test/Makefile
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2012-09-22 02:07:15 +0800
committerDaniel Bovensiepen <[email protected]>2012-09-22 02:07:15 +0800
commitdf91989bf760d206a3b3d035f2425caa65d35d60 (patch)
tree7b3147bace420fc7eab141e16e325c3ed7e2e614 /test/Makefile
parent0e7d5a2e4bcca01a41ea00324261818440808e6f (diff)
downloadmruby-df91989bf760d206a3b3d035f2425caa65d35d60.tar.gz
mruby-df91989bf760d206a3b3d035f2425caa65d35d60.zip
Optimize Makefiles
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile22
1 files changed, 13 insertions, 9 deletions
diff --git a/test/Makefile b/test/Makefile
index efabdc367..04722e2d1 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -10,6 +10,8 @@ MLIB := $(TARGET).o
CLIB := $(TARGET).c
INIT := init_$(TARGET).c
DLIB := $(TARGET).ctmp
+GEMDIR := ../mrbgems
+GEMDLIB := $(GEMDIR)/g/mrbgemtest.ctmp
RLIB := $(TARGET).rbtmp
DEPLIB := $(TARGET).d driver.d
ASSLIB := $(BASEDIR)/assert.rb
@@ -42,14 +44,13 @@ endif
# mruby compiler and test driver
ifeq ($(OS),Windows_NT)
-MRBC = ../bin/mrbc.exe
-EXE := $(TARGET).exe
+ MRBC = ../bin/mrbc.exe
+ EXE := $(TARGET).exe
else
-MRBC = ../bin/mrbc
-EXE := $(TARGET)
+ MRBC = ../bin/mrbc
+ EXE := $(TARGET)
endif
-
##############################
# generic build targets, rules
@@ -68,15 +69,18 @@ $(OBJS) : %.o : %.c
$(CC) $(ALL_CFLAGS) -MMD $(INCLUDES) -c $< -o $@
# Compile C source from merged mruby source
-$(CLIB) : ../mrbgems/g/mrbgemtest.ctmp $(RLIB) $(MRBC) $(INIT)
- $(MRBC) -Bmrbtest_irep -o$(DLIB) $(RLIB); $(CAT) $(INIT) $(DLIB) ../mrbgems/g/mrbgemtest.ctmp > $@
+$(CLIB) : $(DLIB) $(GEMDLIB) $(INIT)
+ $(CAT) $(INIT) $(DLIB) $(GEMDLIB) > $@
+
+$(DLIB) : $(RLIB) $(MRBC)
+ $(MRBC) -Bmrbtest_irep -o$@ $(RLIB)
# merge mruby sources
$(RLIB) : $(ASSLIB) $(MRBS)
$(CAT) $(ASSLIB) $(MRBS) > $@
-../mrbgems/g/mrbgemtest.ctmp :
- @$(MAKE) prepare-test -C ../mrbgems
+$(GEMDLIB) :
+ @$(MAKE) prepare-test -C $(GEMDIR)
# clean up
.PHONY : clean