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
105c11b7
Commit
105c11b7
authored
May 23, 2012
by
Jon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean and DRY up the basic Makefiles
parent
6f00683e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
59 deletions
+36
-59
Makefile
Makefile
+10
-3
mrblib/Makefile
mrblib/Makefile
+8
-9
src/Makefile
src/Makefile
+4
-9
test/Makefile
test/Makefile
+7
-22
tools/mirb/Makefile
tools/mirb/Makefile
+2
-6
tools/mrbc/Makefile
tools/mrbc/Makefile
+3
-5
tools/mruby/Makefile
tools/mruby/Makefile
+2
-5
No files found.
Makefile
View file @
105c11b7
# makefile discription.
# makefile discription.
# basic build file for mruby
# basic build file for mruby
# compiler, linker (gcc)
# compiler, linker (gcc), archiver, parser generator
CC
=
gcc
export
CC
=
gcc
LL
=
gcc
export
LL
=
gcc
export
AR
=
ar
export
YACC
=
bison
DEBUG_MODE
=
1
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
-O3
CFLAGS
=
-g
-O3
...
@@ -23,6 +26,10 @@ endif
...
@@ -23,6 +26,10 @@ endif
export
MSG_BEGIN
=
@for line
in
export
MSG_BEGIN
=
@for line
in
export
MSG_END
=
;
do
echo
"
$$
line"
;
done
export
MSG_END
=
;
do
echo
"
$$
line"
;
done
export
CP
:=
cp
export
RM_F
:=
rm
-f
export
CAT
:=
cat
##############################
##############################
# generic build targets, rules
# generic build targets, rules
...
...
mrblib/Makefile
View file @
105c11b7
...
@@ -15,17 +15,15 @@ MRBS := $(MRB1)
...
@@ -15,17 +15,15 @@ MRBS := $(MRB1)
LIBR0
:=
../lib/libmruby_core.a
LIBR0
:=
../lib/libmruby_core.a
LIBR
:=
../lib/libmruby.a
LIBR
:=
../lib/libmruby.a
# C compiler (gcc)
# libraries, includes
CC
=
gcc
INCLUDES
=
-I
../src
-I
../include
LL
=
gcc
AR
=
ar
DEBUG_MODE
=
1
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
CFLAGS
=
-g
else
else
CFLAGS
=
-O3
CFLAGS
=
-O3
endif
endif
INCLUDES
=
-I
../src
-I
../include
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
ifeq
($(OS),Windows_NT)
ifeq
($(OS),Windows_NT)
MAKE_FLAGS
=
CC
=
$(CC)
LL
=
$(LL)
ALL_CFLAGS
=
"
$(ALL_CFLAGS)
"
MAKE_FLAGS
=
CC
=
$(CC)
LL
=
$(LL)
ALL_CFLAGS
=
"
$(ALL_CFLAGS)
"
...
@@ -40,6 +38,7 @@ else
...
@@ -40,6 +38,7 @@ else
MRBC
=
../bin/mrbc
MRBC
=
../bin/mrbc
endif
endif
##############################
##############################
# generic build targets, rules
# generic build targets, rules
...
@@ -48,7 +47,7 @@ all : $(LIBR)
...
@@ -48,7 +47,7 @@ all : $(LIBR)
# update libmruby.a
# update libmruby.a
$(LIBR)
:
$(MLIB) $(LIBR0)
$(LIBR)
:
$(MLIB) $(LIBR0)
cp
$(LIBR0)
$(LIBR)
$(CP)
$(LIBR0)
$(LIBR)
$(AR)
r
$(LIBR)
$(MLIB)
$(AR)
r
$(LIBR)
$(MLIB)
# Compile mrblib source
# Compile mrblib source
...
@@ -57,17 +56,17 @@ $(MLIB) : $(CLIB)
...
@@ -57,17 +56,17 @@ $(MLIB) : $(CLIB)
# Compile C source from merged mruby source
# Compile C source from merged mruby source
$(CLIB)
:
$(RLIB) $(MRBC)
$(CLIB)
:
$(RLIB) $(MRBC)
$(MRBC)
-Bmrblib_irep
-o
$(DLIB)
$(RLIB)
;
cat
init_
$(TARGET)
.c
$(DLIB)
>
$@
$(MRBC)
-Bmrblib_irep
-o
$(DLIB)
$(RLIB)
;
$(CAT)
init_
$(TARGET)
.c
$(DLIB)
>
$@
$(MRBC)
:
../src/opcode.h ../src/codegen.c ../src/parse.y
$(MRBC)
:
../src/opcode.h ../src/codegen.c ../src/parse.y
$(MAKE)
-C
../tools/mrbc
$(MAKE_FLAGS)
$(MAKE)
-C
../tools/mrbc
$(MAKE_FLAGS)
# merge mruby sources
# merge mruby sources
$(RLIB)
:
$(MRBS)
$(RLIB)
:
$(MRBS)
cat
$?
>
$@
$(CAT)
$?
>
$@
# clean up
# clean up
.PHONY
:
clean
.PHONY
:
clean
clean
:
clean
:
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
-
rm
-f
$(MRBC)
$(MLIB)
$(CLIB)
$(RLIB)
$(DLIB)
$(DEPLIB)
$(LIBR)
-
$(RM_F)
$(MRBC)
$(MLIB)
$(CLIB)
$(RLIB)
$(DLIB)
$(DEPLIB)
$(LIBR)
src/Makefile
View file @
105c11b7
...
@@ -19,12 +19,6 @@ OBJS := $(OBJ1) $(OBJ2) $(OBJ3)
...
@@ -19,12 +19,6 @@ OBJS := $(OBJ1) $(OBJ2) $(OBJ3)
# libraries, includes
# libraries, includes
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
# compiler, linker (gcc)
CC
=
gcc
LL
=
gcc
AR
=
ar
YACC
=
bison
DEBUG_MODE
=
1
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
-O3
CFLAGS
=
-g
-O3
...
@@ -33,6 +27,7 @@ CFLAGS = -O3
...
@@ -33,6 +27,7 @@ CFLAGS = -O3
endif
endif
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
##############################
##############################
# generic build targets, rules
# generic build targets, rules
...
@@ -64,6 +59,6 @@ $(LDEF) : $(KWD)
...
@@ -64,6 +59,6 @@ $(LDEF) : $(KWD)
.PHONY
:
clean
#
cleandep
.PHONY
:
clean
#
cleandep
clean
:
clean
:
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
-
rm
-f
$(TARGET)
$(OBJS)
$(OBJY)
$(YC)
-
$(RM_F)
$(TARGET)
$(OBJS)
$(OBJY)
$(YC)
-
rm
-f
$(OBJS:.o=.d)
$(OBJY:.o=.d)
-
$(RM_F)
$(OBJS:.o=.d)
$(OBJY:.o=.d)
-
rm
-f
$(
patsubst
%.c,%.o,
$(EXCEPT1)
)
$(
patsubst
%.c,%.d,
$(EXCEPT1)
)
-
$(RM_F)
$(
patsubst
%.c,%.o,
$(EXCEPT1)
)
$(
patsubst
%.c,%.d,
$(EXCEPT1)
)
test/Makefile
View file @
105c11b7
...
@@ -16,17 +16,16 @@ ASSLIB := $(BASEDIR)/assert.rb
...
@@ -16,17 +16,16 @@ ASSLIB := $(BASEDIR)/assert.rb
MRBS
:=
$(BASEDIR)
/t/
*
.rb
MRBS
:=
$(BASEDIR)
/t/
*
.rb
OBJS
:=
driver.o
$(MLIB)
OBJS
:=
driver.o
$(MLIB)
#
C compiler (gcc)
#
libraries, includes
CC
=
gcc
LIBS
=
-lm
LL
=
gcc
INCLUDES
=
-I
$(BASEDIR)
/../src
-I
$(BASEDIR)
/../include
AR
=
ar
DEBUG_MODE
=
1
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
CFLAGS
=
-g
else
else
CFLAGS
=
-O3
CFLAGS
=
-O3
endif
endif
INCLUDES
=
-I
../src
-I
../include
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
ifeq
($(OS),Windows_NT)
ifeq
($(OS),Windows_NT)
MAKE_FLAGS
=
CC
=
$(CC)
LL
=
$(LL)
ALL_CFLAGS
=
"
$(ALL_CFLAGS)
"
MAKE_FLAGS
=
CC
=
$(CC)
LL
=
$(LL)
ALL_CFLAGS
=
"
$(ALL_CFLAGS)
"
...
@@ -43,20 +42,6 @@ MRBC = ../bin/mrbc
...
@@ -43,20 +42,6 @@ MRBC = ../bin/mrbc
EXE
:=
$(TARGET)
EXE
:=
$(TARGET)
endif
endif
# libraries, includes
LIBS
=
-lm
# compiler, linker (gcc)
CC
=
gcc
LL
=
gcc
YACC
=
bison
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
-O3
else
CFLAGS
=
-O3
endif
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
##############################
##############################
# generic build targets, rules
# generic build targets, rules
...
@@ -77,14 +62,14 @@ $(OBJS) : %.o : %.c
...
@@ -77,14 +62,14 @@ $(OBJS) : %.o : %.c
# Compile C source from merged mruby source
# Compile C source from merged mruby source
$(CLIB)
:
$(RLIB) $(MRBC) $(INIT)
$(CLIB)
:
$(RLIB) $(MRBC) $(INIT)
$(MRBC)
-Bmrbtest_irep
-o
$(DLIB)
$(RLIB)
;
cat
$(INIT)
$(DLIB)
>
$@
$(MRBC)
-Bmrbtest_irep
-o
$(DLIB)
$(RLIB)
;
$(CAT)
$(INIT)
$(DLIB)
>
$@
# merge mruby sources
# merge mruby sources
$(RLIB)
:
$(ASSLIB) $(MRBS)
$(RLIB)
:
$(ASSLIB) $(MRBS)
cat
$(ASSLIB)
$(MRBS)
>
$@
$(CAT)
$(ASSLIB)
$(MRBS)
>
$@
# clean up
# clean up
.PHONY
:
clean
.PHONY
:
clean
clean
:
clean
:
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
-
rm
-f
$(MLIB)
$(CLIB)
$(RLIB)
$(DLIB)
$(DEPLIB)
$(OBJS)
$(EXE)
-
$(RM_F)
$(MLIB)
$(CLIB)
$(RLIB)
$(DLIB)
$(DEPLIB)
$(OBJS)
$(EXE)
tools/mirb/Makefile
View file @
105c11b7
...
@@ -21,10 +21,6 @@ EXTS := $(EXT1)
...
@@ -21,10 +21,6 @@ EXTS := $(EXT1)
LIBS
=
-lm
LIBS
=
-lm
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
# compiler, linker (gcc)
CC
=
gcc
LL
=
gcc
YACC
=
bison
DEBUG_MODE
=
1
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
-O3
CFLAGS
=
-g
-O3
...
@@ -69,5 +65,5 @@ clean :
...
@@ -69,5 +65,5 @@ clean :
$(MAKE)
clean
-C
../../mrblib
$(MAKE_FLAGS)
$(MAKE)
clean
-C
../../mrblib
$(MAKE_FLAGS)
$(MAKE)
clean
-C
../mrbc
$(MAKE_FLAGS)
$(MAKE)
clean
-C
../mrbc
$(MAKE_FLAGS)
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
-
rm
-f
$(EXE)
$(OBJS)
-
$(RM_F)
$(EXE)
$(OBJS)
-
rm
-f
$(OBJS:.o=.d)
-
$(RM_F)
$(OBJS:.o=.d)
tools/mrbc/Makefile
View file @
105c11b7
...
@@ -23,9 +23,6 @@ LIBS = -lm
...
@@ -23,9 +23,6 @@ LIBS = -lm
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
# compiler, linker (gcc)
# compiler, linker (gcc)
CC
=
gcc
LL
=
gcc
YACC
=
bison
DEBUG_MODE
=
1
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
-O3
CFLAGS
=
-g
-O3
...
@@ -39,6 +36,7 @@ else
...
@@ -39,6 +36,7 @@ else
MAKE_FLAGS
=
CC
=
'
$(CC)
'
LL
=
'
$(LL)
'
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
MAKE_FLAGS
=
CC
=
'
$(CC)
'
LL
=
'
$(LL)
'
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
endif
endif
##############################
##############################
# generic build targets, rules
# generic build targets, rules
...
@@ -63,5 +61,5 @@ $(LIBR) :
...
@@ -63,5 +61,5 @@ $(LIBR) :
.PHONY
:
clean
.PHONY
:
clean
clean
:
clean
:
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
-
rm
-f
$(EXE)
$(OBJS)
-
$(RM_F)
$(EXE)
$(OBJS)
-
rm
-f
$(OBJS:.o=.d)
-
$(RM_F)
$(OBJS:.o=.d)
tools/mruby/Makefile
View file @
105c11b7
...
@@ -26,9 +26,6 @@ LIBS = -lm
...
@@ -26,9 +26,6 @@ LIBS = -lm
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
# compiler, linker (gcc)
# compiler, linker (gcc)
CC
=
gcc
LL
=
gcc
YACC
=
bison
DEBUG_MODE
=
1
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
-O3
CFLAGS
=
-g
-O3
...
@@ -73,5 +70,5 @@ clean :
...
@@ -73,5 +70,5 @@ clean :
$(MAKE)
clean
-C
../../mrblib
$(MAKE_FLAGS)
$(MAKE)
clean
-C
../../mrblib
$(MAKE_FLAGS)
$(MAKE)
clean
-C
../mrbc
$(MAKE_FLAGS)
$(MAKE)
clean
-C
../mrbc
$(MAKE_FLAGS)
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
-
rm
-f
$(EXE)
$(OBJS)
-
$(RM_F)
$(EXE)
$(OBJS)
-
rm
-f
$(OBJS:.o=.d)
-
$(RM_F)
$(OBJS:.o=.d)
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