diff options
| author | Daniel Bovensiepen <[email protected]> | 2012-09-20 00:27:56 +0800 |
|---|---|---|
| committer | Daniel Bovensiepen <[email protected]> | 2012-09-20 00:27:56 +0800 |
| commit | 19fa4a0993acef802ab4250541c1df72c7e2b604 (patch) | |
| tree | 11ea5e1e499d053c01364bda05a3a818f9d43858 /mrbgems/g | |
| parent | ab548b1c19a23cb6e8369a67d03f4c60a54f8a54 (diff) | |
| download | mruby-19fa4a0993acef802ab4250541c1df72c7e2b604.tar.gz mruby-19fa4a0993acef802ab4250541c1df72c7e2b604.zip | |
Add default makefile for Gems
Diffstat (limited to 'mrbgems/g')
| -rw-r--r-- | mrbgems/g/hello_world/Makefile | 29 | ||||
| -rw-r--r-- | mrbgems/g/hello_world/README.md | 6 |
2 files changed, 10 insertions, 25 deletions
diff --git a/mrbgems/g/hello_world/Makefile b/mrbgems/g/hello_world/Makefile index 50a92f03a..c03910bf6 100644 --- a/mrbgems/g/hello_world/Makefile +++ b/mrbgems/g/hello_world/Makefile @@ -1,25 +1,12 @@ -GEMNAME := hello_world -MRUBY_ROOT = ../../../ +include ../../Makefile4gem -INCLUDES = -I$(MRUBY_ROOT)include -I$(MRUBY_ROOT)src -I. -CFLAGS = $(INCLUDES) -O3 -g -Wall -Werror-implicit-function-declaration -RM_F := rm -f -AR := ar +GEM := hello_world -ifeq ($(strip $(LIBR)),) - # default mruby library - LIBR = $(MRUBY_ROOT)lib/libmruby.a -endif +GEM_C_FILES := $(wildcard $(SRC_DIR)/*.c) +GEM_OBJECTS := $(patsubst %.c, %.o, $(GEM_C_FILES)) -.PHONY : all -all : src/hello_world.o - @$(AR) rs $(LIBR) src/hello_world.o - @echo "Gem '$(GEMNAME)' is done" +gem-all : $(GEM_OBJECTS) + $(AR) rs $(LIBR) $< -src/hello_world.o : src/hello_world.c - @gcc -c $(CFLAGS) src/hello_world.c -o src/hello_world.o - -.PHONY : clean -clean : - -$(RM_F) src/*.o - @echo "Gem '$(GEMNAME)' is clean" +gem-clean : + -$(RM) $(GEM_OBJECTS) diff --git a/mrbgems/g/hello_world/README.md b/mrbgems/g/hello_world/README.md index d84bb9941..42792567f 100644 --- a/mrbgems/g/hello_world/README.md +++ b/mrbgems/g/hello_world/README.md @@ -1,6 +1,4 @@ -mruby-md5 +hello world ========= -MD5 digest function. - -This library comes original from mattn (http://github.com/mattn/mruby-md5) +This is an example gem which implements just one method +HW.say+ in a C extension. |
