summaryrefslogtreecommitdiffhomepage
path: root/mrblib/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'mrblib/Makefile')
-rw-r--r--mrblib/Makefile17
1 files changed, 8 insertions, 9 deletions
diff --git a/mrblib/Makefile b/mrblib/Makefile
index d22c4509f..9a7e93596 100644
--- a/mrblib/Makefile
+++ b/mrblib/Makefile
@@ -15,17 +15,15 @@ MRBS := $(MRB1)
LIBR0 := ../lib/libmruby_core.a
LIBR := ../lib/libmruby.a
-# C compiler (gcc)
-CC = gcc
-LL = gcc
-AR = ar
+# libraries, includes
+INCLUDES = -I../src -I../include
+
DEBUG_MODE = 1
ifeq ($(DEBUG_MODE),1)
CFLAGS = -g
else
CFLAGS = -O3
endif
-INCLUDES = -I../src -I../include
ALL_CFLAGS = -Wall -Werror-implicit-function-declaration $(CFLAGS)
ifeq ($(OS),Windows_NT)
MAKE_FLAGS = CC=$(CC) LL=$(LL) ALL_CFLAGS="$(ALL_CFLAGS)"
@@ -40,6 +38,7 @@ else
MRBC = ../bin/mrbc
endif
+
##############################
# generic build targets, rules
@@ -48,7 +47,7 @@ all : $(LIBR)
# update libmruby.a
$(LIBR) : $(MLIB) $(LIBR0)
- cp $(LIBR0) $(LIBR)
+ $(CP) $(LIBR0) $(LIBR)
$(AR) r $(LIBR) $(MLIB)
# Compile mrblib source
@@ -57,17 +56,17 @@ $(MLIB) : $(CLIB)
# Compile C source from merged mruby source
$(CLIB) : $(RLIB) $(MRBC)
- $(MRBC) -Bmrblib_irep -o$(DLIB) $(RLIB); cat init_$(TARGET).c $(DLIB) > $@
+ $(MRBC) -Bmrblib_irep -o$(DLIB) $(RLIB); $(CAT) init_$(TARGET).c $(DLIB) > $@
$(MRBC) : ../src/opcode.h ../src/codegen.c ../src/parse.y
$(MAKE) -C ../tools/mrbc $(MAKE_FLAGS)
# merge mruby sources
$(RLIB) : $(MRBS)
- cat $? > $@
+ $(CAT) $? > $@
# clean up
.PHONY : clean
clean :
@echo "make: removing targets, objects and depend files of `pwd`"
- -rm -f $(MRBC) $(MLIB) $(CLIB) $(RLIB) $(DLIB) $(DEPLIB) $(LIBR)
+ -$(RM_F) $(MRBC) $(MLIB) $(CLIB) $(RLIB) $(DLIB) $(DEPLIB) $(LIBR)