summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/g/hello_world/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/g/hello_world/Makefile')
-rw-r--r--mrbgems/g/hello_world/Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/mrbgems/g/hello_world/Makefile b/mrbgems/g/hello_world/Makefile
new file mode 100644
index 000000000..50a92f03a
--- /dev/null
+++ b/mrbgems/g/hello_world/Makefile
@@ -0,0 +1,25 @@
+GEMNAME := hello_world
+MRUBY_ROOT = ../../../
+
+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
+
+ifeq ($(strip $(LIBR)),)
+ # default mruby library
+ LIBR = $(MRUBY_ROOT)lib/libmruby.a
+endif
+
+.PHONY : all
+all : src/hello_world.o
+ @$(AR) rs $(LIBR) src/hello_world.o
+ @echo "Gem '$(GEMNAME)' is done"
+
+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"