diff options
| -rw-r--r-- | mrbgems/Makefile | 8 | ||||
| -rw-r--r-- | mrbgems/Makefile4gem | 2 | ||||
| -rw-r--r-- | mrbgems/generator.c | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/mrbgems/Makefile b/mrbgems/Makefile index c9cd7add2..2c0a0962c 100644 --- a/mrbgems/Makefile +++ b/mrbgems/Makefile @@ -40,15 +40,15 @@ $(GEM_INIT).a : $(GEM_INIT).o all_gems : $(GENERATOR_BIN) @echo "Generate Gem List Makefile" - $(GENERATOR_BIN) makefile_list "$(ACTIVE_GEMS)" > $(GEM_MAKEFILE_LIST) + $(GENERATOR_BIN) makefile_list $(ACTIVE_GEMS) > $(GEM_MAKEFILE_LIST) @echo "Generate Gem Makefile" - $(GENERATOR_BIN) makefile "$(ACTIVE_GEMS)" "$(MRUBY_ROOT)" > $(GEM_MAKEFILE) + $(GENERATOR_BIN) makefile $(ACTIVE_GEMS) "$(MRUBY_ROOT)" > $(GEM_MAKEFILE) @echo "Build all gems" $(MAKE) -C g MRUBY_ROOT='$(MRUBY_ROOT)' ACTIVE_GEMS="$(ACTIVE_GEMS)" $(GEM_INIT).c : $(GENERATOR_BIN) @echo "Generate Gem driver" - $(GENERATOR_BIN) $(GEM_INIT) "$(ACTIVE_GEMS)" > $@ + $(GENERATOR_BIN) $(GEM_INIT) $(ACTIVE_GEMS) > $@ $(GEM_INIT).o : $(GEM_INIT).c @echo "Build the driver which initializes all gems" @@ -71,6 +71,6 @@ prepare-test : .PHONY : clean clean : $(GENERATOR_BIN) @echo "Cleanup Gems" - $(GENERATOR_BIN) makefile "$(ACTIVE_GEMS)" "$(MRUBY_ROOT)" > $(GEM_MAKEFILE) + $(GENERATOR_BIN) makefile $(ACTIVE_GEMS) "$(MRUBY_ROOT)" > $(GEM_MAKEFILE) $(MAKE) clean -C g ACTIVE_GEMS="$(ACTIVE_GEMS)" MRUBY_ROOT='$(MRUBY_ROOT)' -$(RM_F) $(GEM_INIT).c *.o *.d $(GENERATOR_BIN) $(GEM_MAKEFILE) $(GEM_MAKEFILE_LIST) gem_init.a diff --git a/mrbgems/Makefile4gem b/mrbgems/Makefile4gem index df972ddbb..7e54afc65 100644 --- a/mrbgems/Makefile4gem +++ b/mrbgems/Makefile4gem @@ -69,7 +69,7 @@ gem_mrblib_init.ctmp : $(MRUBY_ROOT)/mrbgems/generator gem_mrblib $(GEM) > $@ gem_mrblib_irep.ctmp : gem_mrblib.rbtmp - $(MRUBY_ROOT)/bin/mrbc -Bgem_mrblib_irep_$(GEM) -o$@ $< + $(MRUBY_ROOT)/bin/mrbc -Bgem_mrblib_irep_$(subst -,_,$(GEM)) -o$@ $< gem_mrblib.rbtmp : cat $(GEM_RB_FILES) > $@ diff --git a/mrbgems/generator.c b/mrbgems/generator.c index 76b3ebe1e..f5b1304fa 100644 --- a/mrbgems/generator.c +++ b/mrbgems/generator.c @@ -28,7 +28,7 @@ static char static char *get_full_path(char *path, char *mruby_root) { - char full_path[1024] = { 0 }; + static char full_path[1024] = { 0 }; if (path[0] == '/') { /* An absolute UNIX path starts with a slash */ strcpy(full_path, path); @@ -149,7 +149,7 @@ for_each_gem (char before[1024], char after[1024], char gem_name[1024] = { 0 }; int char_index; char gem_list[1024][1024] = { { 0 }, { 0 } }; - int gem_index; + int gem_index = 0; int i; int skip; FILE *check; @@ -185,6 +185,8 @@ for_each_gem (char before[1024], char after[1024], skip = FALSE; else skip = TRUE; + if (check) + fclose(check); } if (skip == FALSE) |
