Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
19fa4a09
Commit
19fa4a09
authored
Sep 20, 2012
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default makefile for Gems
parent
ab548b1c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
25 deletions
+47
-25
mrbgems/Makefile4gem
mrbgems/Makefile4gem
+37
-0
mrbgems/g/hello_world/Makefile
mrbgems/g/hello_world/Makefile
+8
-21
mrbgems/g/hello_world/README.md
mrbgems/g/hello_world/README.md
+2
-4
No files found.
mrbgems/Makefile4gem
0 → 100644
View file @
19fa4a09
# This is the default Makefile integrated
# by each Gem. It integrates important constants
# for usage inside of a Gem.
# mruby src root
MRUBY_ROOT := ../../../
# Tools
CC := gcc
RM := rm -f
AR := ar
SRC_DIR := src
INCLUDES := -I$(SRC_DIR) -I$(MRUBY_ROOT)include -I$(MRUBY_ROOT)src -I.
CFLAGS := $(INCLUDES) -O3 -g -Wall -Werror-implicit-function-declaration
# LIBR can be manipulated with command line arguments
ifeq ($(strip $(LIBR)),)
# default mruby library
LIBR := $(MRUBY_ROOT)lib/libmruby.a
endif
# Default rules which are calling the
# gem specific gem-all and gem-clean
# implementations of a gem
.PHONY : all
all : gem-info gem-all
@echo "Gem '$(GEM)' is done"
gem-info:
@echo "Building Gem '$(GEM)'"
.PHONY : clean
clean : gem-clean
@echo "Gem '$(GEM)' is clean"
mrbgems/g/hello_world/Makefile
View file @
19fa4a09
GEMNAME
:=
hello_world
include
../../Makefile4gem
MRUBY_ROOT
=
../../../
INCLUDES
=
-I
$(MRUBY_ROOT)
include
-I
$(MRUBY_ROOT)
src
-I
.
GEM
:=
hello_world
CFLAGS
=
$(INCLUDES)
-O3
-g
-Wall
-Werror-implicit-function-declaration
RM_F
:=
rm
-f
AR
:=
ar
ifeq
($(strip $(LIBR)),)
GEM_C_FILES
:=
$(
wildcard
$(SRC_DIR)
/
*
.c
)
# default mruby library
GEM_OBJECTS
:=
$(
patsubst
%.c, %.o,
$(GEM_C_FILES)
)
LIBR
=
$(MRUBY_ROOT)
lib/libmruby.a
endif
.PHONY
:
all
gem-all
:
$(GEM_OBJECTS)
all
:
src/hello_world.o
$(AR)
rs
$(LIBR)
$<
@
$(AR)
rs
$(LIBR)
src/hello_world.o
@
echo
"Gem '
$(GEMNAME)
' is done"
src/hello_world.o
:
src/hello_world.c
gem-clean
:
@
gcc
-c
$(CFLAGS)
src/hello_world.c
-o
src/hello_world.o
-
$(RM)
$(GEM_OBJECTS)
.PHONY
:
clean
clean
:
-
$(RM_F)
src/
*
.o
@
echo
"Gem '
$(GEMNAME)
' is clean"
mrbgems/g/hello_world/README.md
View file @
19fa4a09
mruby-md5
hello world
=========
=========
MD5 digest function.
This is an example gem which implements just one method +HW.say+ in a C extension.
This library comes original from mattn (http://github.com/mattn/mruby-md5)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment