forked from mrubyc/mrubyc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
145 lines (119 loc) · 3.99 KB
/
Makefile
File metadata and controls
145 lines (119 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#
# mruby/c Makefile
#
# Copyright (C) 2015- Kyushu Institute of Technology.
# Copyright (C) 2015- Shimane IT Open-Innovation Center.
# Copyright (C) 2024- HASUMI Hitoshi.
#
# This file is distributed under BSD 3-Clause License.
#
USER_ID = $(shell id -u)
.PHONY: all mrblib mrubyc_lib mrubyc_bin
all: mrubyc_lib mrubyc_bin
mrblib:
cd mrblib ; $(MAKE) all
mrubyc_lib: mrblib
cd src ; $(MAKE) all
mrubyc_bin: mrubyc_lib
cd sample_c ; $(MAKE) all
.PHONY: autogen
autogen:
cd src && $(MAKE) autogen
.PHONY: clean clean_all
clean:
cd src ; $(MAKE) clean
cd sample_c ; $(MAKE) clean
# clean including auto generated files.
clean_all:
cd mrblib ; $(MAKE) clean_all
cd src ; $(MAKE) clean_all
cd sample_c ; $(MAKE) clean
.PHONY: docker_build delete_docker docker_bash
docker_build:
docker build -t mrubyc-test --no-cache --build-arg USER_ID=$(USER_ID) $(options) .
docker_bash:
docker run --rm -it -v $(shell pwd):/work/mrubyc mrubyc-test /bin/bash
docker_bash_root:
docker run -u root --rm -it -v $(shell pwd):/work/mrubyc mrubyc-test /bin/bash
delete_docker:
docker rmi mrubyc-test
.PHONY: test test_all test_host_gcc test_host_clang test_mips test_arm test_host_gcc_no_libc test_host_clang_no_libc test_mips_no_libc test_arm_no_libc
test: autogen # if platform includes darwin, test_clang, else, test_host_gcc
@if [ `uname` = "Darwin" ]; then \
make test_host_clang_no_libc; \
else \
make test_host_gcc_no_libc; \
fi
test_all: test_host_gcc test_host_gcc_no_libc test_host_clang test_host_clang_no_libc test_arm test_arm_no_libc test_mips test_mips_no_libc
test_arm_no_libc:
docker run \
-e PICORUBY_DEBUG=1 \
-e MRUBY_CONFIG=arm-linux-gnueabihf \
-e PICORUBY_NO_LIBC_ALLOC=1 \
-e RUBY="qemu-arm -L /usr/arm-linux-gnueabihf build/arm-linux-gnueabihf/bin/picoruby" \
--rm -v $(shell pwd):/work/mrubyc mrubyc-test \
bash -c \
"rake clean && rake && ruby /work/mrubyc/test/0_runner.rb"
test_arm:
docker run \
-e PICORUBY_DEBUG=1 \
-e MRUBY_CONFIG=arm-linux-gnueabihf \
-e RUBY="qemu-arm -L /usr/arm-linux-gnueabihf build/arm-linux-gnueabihf/bin/picoruby" \
--rm -v $(shell pwd):/work/mrubyc mrubyc-test \
bash -c \
"rake clean && rake && ruby /work/mrubyc/test/0_runner.rb"
test_host_gcc_no_libc:
docker run \
-e CC=gcc \
-e PICORUBY_DEBUG=1 \
-e MRUBY_CONFIG=picoruby-test \
-e PICORUBY_NO_LIBC_ALLOC=1 \
-e RUBY="build/host/bin/picoruby" \
--rm -v $(shell pwd):/work/mrubyc mrubyc-test \
bash -c \
"rake clean && rake && ruby /work/mrubyc/test/0_runner.rb"
test_host_gcc:
docker run \
-e CC=gcc \
-e PICORUBY_DEBUG=1 \
-e MRUBY_CONFIG=picoruby-test \
-e RUBY="build/host/bin/picoruby" \
--rm -v $(shell pwd):/work/mrubyc mrubyc-test \
bash -c \
"rake clean && rake && ruby /work/mrubyc/test/0_runner.rb"
test_host_clang_no_libc:
docker run \
-e CC=clang \
-e PICORUBY_DEBUG=1 \
-e MRUBY_CONFIG=picoruby-test \
-e PICORUBY_NO_LIBC_ALLOC=1 \
-e RUBY="build/host/bin/picoruby" \
--rm -v $(shell pwd):/work/mrubyc mrubyc-test \
bash -c \
"rake clean && rake && ruby /work/mrubyc/test/0_runner.rb"
test_host_clang:
docker run \
-e CC=clang \
-e PICORUBY_DEBUG=1 \
-e MRUBY_CONFIG=picoruby-test \
-e RUBY="build/host/bin/picoruby" \
--rm -v $(shell pwd):/work/mrubyc mrubyc-test \
bash -c \
"rake clean && rake && ruby /work/mrubyc/test/0_runner.rb"
test_mips:
docker run -e QEMU_LD_PREFIX=/usr/mips-linux-gnu \
-e PICORUBY_DEBUG=1 \
-e MRUBY_CONFIG=mips-linux-gnu \
-e RUBY="qemu-mips -L /usr/mips-linux-gnu build/mips-linux-gnu/bin/picoruby" \
--rm -v $(shell pwd):/work/mrubyc mrubyc-test \
bash -c \
"rake clean && rake && ruby /work/mrubyc/test/0_runner.rb"
test_mips_no_libc:
docker run -e QEMU_LD_PREFIX=/usr/mips-linux-gnu \
-e PICORUBY_DEBUG=1 \
-e MRUBY_CONFIG=mips-linux-gnu \
-e PICORUBY_NO_LIBC_ALLOC=1 \
-e RUBY="qemu-mips -L /usr/mips-linux-gnu build/mips-linux-gnu/bin/picoruby" \
--rm -v $(shell pwd):/work/mrubyc mrubyc-test \
bash -c \
"rake clean && rake && ruby /work/mrubyc/test/0_runner.rb"