diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-01-02 09:54:05 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-01-02 09:54:05 -0800 |
| commit | 65901c3dbdc6ee38acdfaa6c29d8d4bdd575a6be (patch) | |
| tree | b79aa703ef7c528896c4f1be8280d0691314008b /tools/mirb | |
| parent | a48fc0d7952ad1f10ae777637269fe6a3f9ad0a2 (diff) | |
| parent | 7c469c0b9dadd1de09fed18c3e5cc551012c38c1 (diff) | |
| download | mruby-65901c3dbdc6ee38acdfaa6c29d8d4bdd575a6be.tar.gz mruby-65901c3dbdc6ee38acdfaa6c29d8d4bdd575a6be.zip | |
Merge pull request #679 from masuidrive/merge_to_cruby_building_script
Rebuild CRuby based building script without Makefile
Diffstat (limited to 'tools/mirb')
| -rw-r--r-- | tools/mirb/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | tools/mirb/Makefile | 94 | ||||
| -rw-r--r-- | tools/mirb/mirb.rake | 10 |
3 files changed, 10 insertions, 103 deletions
diff --git a/tools/mirb/CMakeLists.txt b/tools/mirb/CMakeLists.txt deleted file mode 100644 index a9f52db1f..000000000 --- a/tools/mirb/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# build tools/mirb executable - -file(GLOB MIRBBIN_SRC_C "*.c") -add_executable(mirb ${MIRBBIN_SRC_C}) -target_link_libraries(mirb libmruby_static ${MRUBY_LIBS}) - -install(TARGETS mirb RUNTIME DESTINATION bin) - -# vim: ts=2 sts=2 sw=2 et diff --git a/tools/mirb/Makefile b/tools/mirb/Makefile deleted file mode 100644 index b953038a8..000000000 --- a/tools/mirb/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -# Makefile description. -# basic build file for mirb executable - -# 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 - EXE := $(TARGET) -endif -OBJ0 := $(patsubst %.c,%.o,$(wildcard $(BASEDIR)/../tools/mirb/*.c)) -OBJS := $(OBJ0) - -# ext libraries -EXTS := $(EXT1) - -# libraries, includes -LIBS = -lm -INCLUDES = -I$(BASEDIR) -I$(BASEDIR)/../include - -ifeq ($(strip $(COMPILE_MODE)),) - # default compile option - 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)' -else - MAKE_FLAGS = CC='$(CC)' LL='$(LL)' ALL_CFLAGS='$(ALL_CFLAGS)' LDFLAGS='$(LDFLAGS)' -endif - -############################## -# generic build targets, rules - -.PHONY : all -all : $(LIBR) $(EXE) - -# executable constructed using linker from object files -$(EXE) : $(LIBR) $(OBJS) $(GEM_ARCHIVE_FILES) $(EXTS) - $(LL) -o $@ $(LDFLAGS) $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES) $(EXTS) $(LIBS) - --include $(OBJS:.o=.d) - -# objects compiled from source -$(OBJS) : %.o : %.c - $(CC) $(ALL_CFLAGS) -MMD $(INCLUDES) -c $< -o $@ - -# C library compile -$(LIBR) : - @$(MAKE) -C $(BASEDIR) $(MAKE_FLAGS) - -# mruby library compile -# extend libraries complile -$(EXTS) : %.o : %.c - $(CC) $(ALL_CFLAGS) -MMD $(INCLUDES) -c $< -o $@ - -# clean up -.PHONY : clean #cleandep -clean : - $(MAKE) clean -C ../../mrblib $(MAKE_FLAGS) - $(MAKE) clean -C ../mrbc $(MAKE_FLAGS) - @echo "make: removing targets, objects and depend files of `pwd`" - -$(RM_F) $(EXE) $(OBJS) - -$(RM_F) $(OBJS:.o=.d) diff --git a/tools/mirb/mirb.rake b/tools/mirb/mirb.rake new file mode 100644 index 000000000..045f6ab90 --- /dev/null +++ b/tools/mirb/mirb.rake @@ -0,0 +1,10 @@ +dir = File.dirname(__FILE__).sub(%r|^\./|, '') + +MRuby.each_target do + exec = exefile("#{build_dir}/bin/mirb") + objs = Dir.glob("#{dir}/*.{c}").map { |f| f.pathmap("#{build_dir}/%X.o") } + + file exec => objs + ["#{build_dir}/lib/libmruby.a"] do |t| + link t.name, t.prerequisites, [], gems.map { |g| g.mruby_libs } + end +end
\ No newline at end of file |
