Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 88 lines (74 sloc) 1.966 kb
f6a9846 Daniel Bovensiepen Fix writing errors in Makefiles
bovi authored
1 # Makefile description.
db99923 Yukihiro "Matz" Matsumoto build process restructured
matz authored
2 # basic build file for mruby
e0d6430 Hiroshi Mimaki add mruby sources
mimaki authored
3
105c11b Jon Clean and DRY up the basic Makefiles
jonforums authored
4 # compiler, linker (gcc), archiver, parser generator
5 export CC = gcc
6 export LL = gcc
7 export AR = ar
8 export YACC = bison
9
83e5999 Daniel Bovensiepen Make CFLAG choices in Makefiles more flexible
bovi authored
10 ifeq ($(strip $(COMPILE_MODE)),)
11 # default compile option
12 COMPILE_MODE = debug
13 endif
14
15 ifeq ($(COMPILE_MODE),debug)
16 CFLAGS = -g -O3
17 else ifeq ($(COMPILE_MODE),release)
18 CFLAGS = -O3
19 else ifeq ($(COMPILE_MODE),small)
20 CFLAGS = -Os
e0d6430 Hiroshi Mimaki add mruby sources
mimaki authored
21 endif
83e5999 Daniel Bovensiepen Make CFLAG choices in Makefiles more flexible
bovi authored
22
e0d6430 Hiroshi Mimaki add mruby sources
mimaki authored
23 ALL_CFLAGS = -Wall -Werror-implicit-function-declaration $(CFLAGS)
db99923 Yukihiro "Matz" Matsumoto build process restructured
matz authored
24 ifeq ($(OS),Windows_NT)
25 MAKE_FLAGS = --no-print-directory CC=$(CC) LL=$(LL) ALL_CFLAGS='$(ALL_CFLAGS)'
26 else
27 MAKE_FLAGS = --no-print-directory CC='$(CC)' LL='$(LL)' ALL_CFLAGS='$(ALL_CFLAGS)'
28 endif
e0d6430 Hiroshi Mimaki add mruby sources
mimaki authored
29
30 ##############################
6f00683 Jon Add `help` and `showconfig` targets to Makefile
jonforums authored
31 # internal variables
32
33 export MSG_BEGIN = @for line in
34 export MSG_END = ; do echo "$$line"; done
35
105c11b Jon Clean and DRY up the basic Makefiles
jonforums authored
36 export CP := cp
37 export RM_F := rm -f
38 export CAT := cat
39
6f00683 Jon Add `help` and `showconfig` targets to Makefile
jonforums authored
40 ##############################
e0d6430 Hiroshi Mimaki add mruby sources
mimaki authored
41 # generic build targets, rules
42
43 .PHONY : all
db99923 Yukihiro "Matz" Matsumoto build process restructured
matz authored
44 all :
4390ff1 Yukihiro "Matz" Matsumoto Makefile: run make at src first
matz authored
45 @$(MAKE) -C src $(MAKE_FLAGS)
0026d5f Yukihiro "Matz" Matsumoto run make -c mrblib from top
matz authored
46 @$(MAKE) -C mrblib $(MAKE_FLAGS)
db99923 Yukihiro "Matz" Matsumoto build process restructured
matz authored
47 @$(MAKE) -C tools/mruby $(MAKE_FLAGS)
917d70e Daniel Bovensiepen mirb - Embeddable Interactive Ruby Shell
bovi authored
48 @$(MAKE) -C tools/mirb $(MAKE_FLAGS)
49
8085817 Yukihiro "Matz" Matsumoto make test restructuring
matz authored
50 # mruby test
51 .PHONY : test
ec8f97d Yukihiro "Matz" Matsumoto add "all" to test dependency
matz authored
52 test : all
c8c0ef8 Daniel Bovensiepen mrit - Embeddable Ruby ISO Test
bovi authored
53 @$(MAKE) -C test $(MAKE_FLAGS)
54
e0d6430 Hiroshi Mimaki add mruby sources
mimaki authored
55 # clean up
56 .PHONY : clean
57 clean :
db99923 Yukihiro "Matz" Matsumoto build process restructured
matz authored
58 @$(MAKE) clean -C src $(MAKE_FLAGS)
59 @$(MAKE) clean -C tools/mruby $(MAKE_FLAGS)
917d70e Daniel Bovensiepen mirb - Embeddable Interactive Ruby Shell
bovi authored
60 @$(MAKE) clean -C tools/mirb $(MAKE_FLAGS)
c8c0ef8 Daniel Bovensiepen mrit - Embeddable Ruby ISO Test
bovi authored
61 @$(MAKE) clean -C test $(MAKE_FLAGS)
6f00683 Jon Add `help` and `showconfig` targets to Makefile
jonforums authored
62
63 # display help for build configuration and interesting targets
64 .PHONY : showconfig
65 showconfig :
66 $(MSG_BEGIN) \
67 "" \
68 " CC = $(CC)" \
69 " LL = $(LL)" \
70 " MAKE = $(MAKE)" \
71 "" \
72 " CFLAGS = $(CFLAGS)" \
73 " ALL_CFLAGS = $(ALL_CFLAGS)" \
74 $(MSG_END)
75
76 .PHONY : help
77 help :
78 $(MSG_BEGIN) \
79 "" \
80 " Basic mruby Makefile" \
81 "" \
82 "targets:" \
83 " all (default): build all targets, install (locally) in-repo" \
84 " clean: clean all built and in-repo installed artifacts" \
85 " showconfig: show build config summary" \
86 " test: run all mruby tests" \
87 $(MSG_END)
Something went wrong with that request. Please try again.