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
cc382f9b
Commit
cc382f9b
authored
Nov 23, 2012
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the usage of MRUBY_ROOT to the mrbgems build system, so that we can easily build everywhere
parent
3d81ed3d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
19 deletions
+29
-19
Makefile
Makefile
+4
-2
mrbgems/Makefile
mrbgems/Makefile
+8
-4
mrbgems/Makefile4gem
mrbgems/Makefile4gem
+8
-8
mrbgems/generator.c
mrbgems/generator.c
+9
-5
No files found.
Makefile
View file @
cc382f9b
...
...
@@ -7,6 +7,8 @@ export LL = gcc
export
AR
=
ar
export
YACC
=
bison
MRUBY_ROOT
:=
$(
realpath
.
)
ifeq
($(strip $(ENABLE_GEMS)),)
# by default GEMs are deactivated
ENABLE_GEMS
=
false
...
...
@@ -32,9 +34,9 @@ endif
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
ifeq
($(OS),Windows_NT)
MAKE_FLAGS
=
--no-print-directory
CC
=
$(CC)
LL
=
$(LL)
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
ENABLE_GEMS
=
'
$(ENABLE_GEMS)
'
ACTIVE_GEMS
=
'
$(ACTIVE_GEMS)
'
MAKE_FLAGS
=
--no-print-directory
CC
=
$(CC)
LL
=
$(LL)
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
ENABLE_GEMS
=
'
$(ENABLE_GEMS)
'
ACTIVE_GEMS
=
'
$(ACTIVE_GEMS)
'
MRUBY_ROOT
=
'
$(MRUBY_ROOT)
'
else
MAKE_FLAGS
=
--no-print-directory
CC
=
'
$(CC)
'
LL
=
'
$(LL)
'
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
ENABLE_GEMS
=
'
$(ENABLE_GEMS)
'
ACTIVE_GEMS
=
'
$(ACTIVE_GEMS)
'
MAKE_FLAGS
=
--no-print-directory
CC
=
'
$(CC)
'
LL
=
'
$(LL)
'
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
ENABLE_GEMS
=
'
$(ENABLE_GEMS)
'
ACTIVE_GEMS
=
'
$(ACTIVE_GEMS)
'
MRUBY_ROOT
=
'
$(MRUBY_ROOT)
'
endif
##############################
...
...
mrbgems/Makefile
View file @
cc382f9b
# makefile description.
# add gems to the ruby library
ifeq
($(strip $(MRUBY_ROOT)),)
MRUBY_ROOT
:=
$(
realpath
..
)
endif
LIBR
:=
../lib/libmruby.a
RM_F
:=
rm
-f
CC_FLAGS
:=
-Wall
-Werror-implicit-function-declaration
-g
-O3
-MMD
-I
.
-I
./../include
...
...
@@ -9,7 +13,7 @@ export CC = gcc
export
LL
=
gcc
export
AR
=
ar
GENERATOR
:=
.
/generator
GENERATOR
:=
$(MRUBY_ROOT)
/mrbgems
/generator
ifeq
($(OS),Windows_NT)
GENERATOR_BIN
:=
$(GENERATOR)
.exe
else
...
...
@@ -40,7 +44,7 @@ all_gems : $(GENERATOR_BIN)
@
echo
"Generate Gem Makefile"
$(GENERATOR_BIN)
makefile
"
$(ACTIVE_GEMS)
"
>
$(GEM_MAKEFILE)
@
echo
"Build all gems"
$(MAKE)
-C
g
$(MAKE)
-C
g
MRUBY_ROOT
=
'
$(MRUBY_ROOT)
'
ACTIVE_GEMS
=
"
$(ACTIVE_GEMS)
"
$(GEM_INIT).c
:
$(GENERATOR_BIN)
@
echo
"Generate Gem driver"
...
...
@@ -61,12 +65,12 @@ $(GENERATOR).o : $(GENERATOR).c
.PHONY
:
prepare-test
prepare-test
:
@
$(MAKE)
prepare-test
-C
g
ACTIVE_GEMS
=
"
$(ACTIVE_GEMS)
"
@
$(MAKE)
prepare-test
-C
g
ACTIVE_GEMS
=
"
$(ACTIVE_GEMS)
"
MRUBY_ROOT
=
'
$(MRUBY_ROOT)
'
# clean driver and all gems
.PHONY
:
clean
clean
:
$(GENERATOR_BIN)
@
echo
"Cleanup Gems"
$(GENERATOR_BIN)
makefile
"
$(ACTIVE_GEMS)
"
>
$(GEM_MAKEFILE)
$(MAKE)
clean
-C
g
$(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
mrbgems/Makefile4gem
View file @
cc382f9b
...
...
@@ -4,7 +4,7 @@
ifeq ($(strip $(MRUBY_ROOT)),)
# mruby src root
MRUBY_ROOT :=
../../../
MRUBY_ROOT :=
$(realpath ../../..)
endif
# Tools
...
...
@@ -15,13 +15,13 @@ AR := ar
SRC_DIR := src
MRB_DIR := mrblib
INCLUDES := -I$(SRC_DIR) -I$(MRUBY_ROOT)
include -I$(MRUBY_ROOT)
src -I.
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
LIBR := $(MRUBY_ROOT)
/
lib/libmruby.a
endif
GEM_PACKAGE := mrb-$(GEM)-gem.a
...
...
@@ -49,14 +49,14 @@ gem_mixlib.c : gem_mrblib_header.ctmp gem_mrblib_irep.ctmp gem_mixlib_init.ctmp
cat $^ > $@
gem_mixlib_init.ctmp :
$(MRUBY_ROOT)mrbgems/generator gem_mixlib $(GEM) "$(ACTIVE_GEMS)" > $@
$(MRUBY_ROOT)
/
mrbgems/generator gem_mixlib $(GEM) "$(ACTIVE_GEMS)" > $@
# Building target for C files
gem-c-files : gem_srclib.o
$(AR) rs $(GEM_PACKAGE) $(GEM_OBJECTS) $<
gem_srclib.c :
$(MRUBY_ROOT)mrbgems/generator gem_srclib $(GEM) "$(ACTIVE_GEMS)" > $@
$(MRUBY_ROOT)
/
mrbgems/generator gem_srclib $(GEM) "$(ACTIVE_GEMS)" > $@
# Building target for Ruby Files
gem-rb-files : gem_mrblib.o
...
...
@@ -66,13 +66,13 @@ gem_mrblib.c : gem_mrblib_header.ctmp gem_mrblib_irep.ctmp gem_mrblib_init.ctmp
cat $^ > $@
gem_mrblib_header.ctmp :
$(MRUBY_ROOT)mrbgems/generator gem_mrblib "$(ACTIVE_GEMS)" > $@
$(MRUBY_ROOT)
/
mrbgems/generator gem_mrblib "$(ACTIVE_GEMS)" > $@
gem_mrblib_init.ctmp :
$(MRUBY_ROOT)mrbgems/generator gem_mrblib $(GEM) "$(ACTIVE_GEMS)" > $@
$(MRUBY_ROOT)
/
mrbgems/generator gem_mrblib $(GEM) "$(ACTIVE_GEMS)" > $@
gem_mrblib_irep.ctmp : gem_mrblib.rbtmp
$(MRUBY_ROOT)bin/mrbc -Bgem_mrblib_irep_$(GEM) -o$@ $<
$(MRUBY_ROOT)
/
bin/mrbc -Bgem_mrblib_irep_$(GEM) -o$@ $<
gem_mrblib.rbtmp :
cat $(GEM_RB_FILES) > $@
...
...
mrbgems/generator.c
View file @
cc382f9b
...
...
@@ -129,11 +129,15 @@ make_gem_makefile(char active_gems[1024])
char
*
gem_check
=
{
0
};
int
gem_empty
;
printf
(
"CFLAGS := -I. -I../../include -I../../src
\n\n
"
printf
(
"ifeq ($(strip $(MRUBY_ROOT)),)
\n
"
" MRUBY_ROOT := $(realpath ../../..)
\n
"
"endif
\n\n
"
"MAKEFILE_4_GEM := $(MRUBY_ROOT)/mrbgems/Makefile4gem
\n\n
"
"CFLAGS := -I. -I$(MRUBY_ROOT)/include -I$(MRUBY_ROOT)/src
\n\n
"
"ifeq ($(OS),Windows_NT)
\n
"
"
MAKE_FLAGS = --no-print-directory CC=$(CC) LL=$(LL) ALL_CFLAGS='$(ALL_CFLAGS
)'
\n
"
"
MAKE_FLAGS = --no-print-directory CC=$(CC) LL=$(LL) ALL_CFLAGS='$(ALL_CFLAGS)' MRUBY_ROOT='$(MRUBY_ROOT)' MAKEFILE_4_GEM='$(MAKEFILE_4_GEM
)'
\n
"
"else
\n
"
"
MAKE_FLAGS = --no-print-directory CC='$(CC)' LL='$(LL)' ALL_CFLAGS='$(ALL_CFLAGS
)'
\n
"
"
MAKE_FLAGS = --no-print-directory CC='$(CC)' LL='$(LL)' ALL_CFLAGS='$(ALL_CFLAGS)' MRUBY_ROOT='$(MRUBY_ROOT)' MAKEFILE_4_GEM='$(MAKEFILE_4_GEM
)'
\n
"
"endif
\n\n
"
);
/* is there any GEM available? */
...
...
@@ -168,9 +172,9 @@ make_gem_makefile(char active_gems[1024])
for_each_gem
(
" "
,
"/test/*.rb "
,
"
\t
cat"
,
" > mrbgemtest.rbtmp"
,
TRUE
,
active_gems
)
);
else
printf
(
"
\t
..
/generator rbtmp
\"
%s
\"
> mrbgemtest.rbtmp"
,
active_gems
);
printf
(
"
\t
$(MRUBY_ROOT)/mrbgems
/generator rbtmp
\"
%s
\"
> mrbgemtest.rbtmp"
,
active_gems
);
printf
(
"
\n\t
../..
/bin/mrbc -Bmrbgemtest_irep -omrbgemtest.ctmp mrbgemtest.rbtmp
\n\n
"
);
printf
(
"
\n\t
$(MRUBY_ROOT)
/bin/mrbc -Bmrbgemtest_irep -omrbgemtest.ctmp mrbgemtest.rbtmp
\n\n
"
);
/* Makefile Rules to Clean GEMs */
...
...
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