summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/g/hello_world/Makefile
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2012-09-19 23:18:35 +0800
committerDaniel Bovensiepen <[email protected]>2012-09-19 23:18:35 +0800
commitab548b1c19a23cb6e8369a67d03f4c60a54f8a54 (patch)
treeea792d474e0536dff15de6e9a619f918a888f231 /mrbgems/g/hello_world/Makefile
parente7425584e3aebc0295f1b55f7f44c2c5f5583964 (diff)
downloadmruby-ab548b1c19a23cb6e8369a67d03f4c60a54f8a54.tar.gz
mruby-ab548b1c19a23cb6e8369a67d03f4c60a54f8a54.zip
add hello world test program
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"