forked from mruby-zest/mruby-zest-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
204 lines (166 loc) · 7.53 KB
/
Makefile
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
UV_DIR = libuv-v1.9.1
UV_FILE = $(UV_DIR).tar.gz
UV_URL = http://dist.libuv.org/dist/v1.9.1/$(UV_FILE)
all:
ruby ./rebuild-fcache.rb
cd deps/nanovg/src && $(CC) nanovg.c -c -fPIC
$(AR) rc deps/libnanovg.a deps/nanovg/src/*.o
# cd deps/pugl && python2 ./waf configure --no-cairo --static
cd deps/pugl && python2 ./waf configure --no-cairo --static --debug
cd deps/pugl && python2 ./waf
cd src/osc-bridge && CFLAGS="-I ../../deps/$(UV_DIR)/include " make lib
cd mruby && MRUBY_CONFIG=../build_config.rb rake
$(CC) -shared -o libzest.so `find mruby/build/host -type f | grep -e "\.o$$" | grep -v bin` ./deps/libnanovg.a \
./deps/libnanovg.a \
src/osc-bridge/libosc-bridge.a \
./deps/$(UV_DIR)/.libs/libuv.a -lm -lX11 -lGL -lpthread
$(CC) test-libversion.c deps/pugl/build/libpugl-0.a -ldl -o zest -lX11 -lGL -lpthread -I deps/pugl -std=gnu99
osx:
ruby ./rebuild-fcache.rb
cd deps/nanovg/src && $(CC) nanovg.c -c -fPIC
$(AR) rc deps/libnanovg.a deps/nanovg/src/*.o
cd deps/pugl && python2 ./waf configure --no-cairo --static
# cd deps/pugl && python2 ./waf configure --no-cairo --static --debug
cd deps/pugl && python2 ./waf
cd src/osc-bridge && CFLAGS="-I ../../deps/$(UV_DIR)/include " make lib
cd mruby && MRUBY_CONFIG=../build_config.rb rake
$(CC) -shared -o libzest.so `find mruby/build/host -type f | grep -e "\.o$$" | grep -v bin` ./deps/libnanovg.a \
./deps/libnanovg.a \
src/osc-bridge/libosc-bridge.a \
./deps/$(UV_DIR)/.libs/libuv.a -lm -framework OpenGL -lpthread
$(CC) test-libversion.c deps/pugl/build/libpugl-0.a -ldl -o zest -framework OpenGL -framework AppKit -lpthread -I deps/pugl -std=gnu99
windows:
cd deps/nanovg/src && $(CC) -mstackrealign nanovg.c -c
$(AR) rc deps/libnanovg.a deps/nanovg/src/*.o
cd deps/pugl && CFLAGS="-mstackrealign" python2 ./waf configure --no-cairo --static --target=win32
cd deps/pugl && python2 ./waf
cd src/osc-bridge && CFLAGS="-mstackrealign -I ../../deps/$(UV_DIR)/include " make lib
cd mruby && WINDOWS=1 MRUBY_CONFIG=../build_config.rb rake
$(CC) -mstackrealign -shared -o libzest.dll -static-libgcc `find mruby/build/w64 -type f | grep -e "\.o$$" | grep -v bin` \
./deps/libnanovg.a \
src/osc-bridge/libosc-bridge.a \
./deps/libuv-win.a \
-lm -lpthread -lws2_32 -lkernel32 -lpsapi -luserenv -liphlpapi -lglu32 -lgdi32 -lopengl32
$(CC) -mstackrealign -DWIN32 test-libversion.c deps/pugl/build/libpugl-0.a -o zest.exe -lpthread -I deps/pugl -std=c99 -lws2_32 -lkernel32 -lpsapi -luserenv -liphlpapi -lglu32 -lgdi32 -lopengl32
builddep: deps/libuv.a
deps/libuv.a:
cd deps/$(UV_DIR) && ./autogen.sh
cd deps/$(UV_DIR) && CFLAGS=-fPIC ./configure
cd deps/$(UV_DIR) && CFLAGS=-fPIC make
cp deps/$(UV_DIR)/.libs/libuv.a deps/
builddepwin: deps/libuv-win.a
deps/libuv-win.a:
cd deps/$(UV_DIR) && ./autogen.sh
cd deps/$(UV_DIR) && CFLAGS="-mstackrealign" ./configure --host=x86_64-w64-mingw32
cd deps/$(UV_DIR) && LD=x86_64-w64-mingw32-gcc make
cp deps/$(UV_DIR)/.libs/libuv.a deps/libuv-win.a
deps/$(UV_DIR):
cd deps && wget -4 $(UV_URL) && tar xvf $(UV_FILE)
setup: deps/$(UV_DIR)
setupwin:
cd deps && wget -4 $(UV_URL)
cd deps && tar xvf $(UV_FILE)
push:
cd src/osc-bridge && git push
cd src/mruby-qml-parse && git push
cd src/mruby-qml-spawn && git push
cd src/mruby-zest && git push
git push
status:
cd src/osc-bridge && git status
cd src/mruby-qml-parse && git status
cd src/mruby-qml-spawn && git status
cd src/mruby-zest && git status
git status
diff:
cd src/osc-bridge && git diff
cd src/mruby-qml-parse && git diff
cd src/mruby-qml-spawn && git diff
cd src/mruby-zest && git diff
git diff
stats:
@echo 'main repo commits: ' `git log --oneline | wc -l`
@echo 'mruby-zest commits: ' `cd src/mruby-zest && git log --oneline | wc -l`
@echo 'mruby-qml-parse commits: ' `cd src/mruby-qml-parse && git log --oneline | wc -l`
@echo 'mruby-qml-spawn commits: ' `cd src/mruby-qml-spawn && git log --oneline | wc -l`
@echo 'osc-bridge commits: ' `cd src/osc-bridge && git log --oneline | wc -l`
@echo 'number of qml files:' `find src/ -type f | grep -e qml$$ | wc -l`
@echo 'number of ruby files:' `find src/ -type f | grep -e rb$$ | wc -l`
@echo 'number of c files:' `find src/ -type f | grep -e c$$ | wc -l`
@echo 'number of header files:' `find src/ -type f | grep -e h$$ | wc -l`
@echo 'lines of OSC schema:' `wc -l src/osc-bridge/schema/test.json`
@echo 'lines of qml:'
@wc -l `find src/ -type f | grep qml$$` | tail -n 1
@echo 'lines of ruby:'
@wc -l `find src/ -type f | grep -e rb$$ | grep -v fcache` | tail -n 1
@echo 'lines of c source:'
@wc -l `find src/ -type f | grep -e c$$` | tail -n 1
@echo 'lines of c header:'
@wc -l `find src/ -type f | grep -e h$$` | tail -n 1
@echo 'total lines of code:'
@wc -l `find src/ -type f | grep -Ee "(qml|rb|c|h)$$" | grep -v fcache` | tail -n 1
verbose: ## Compile mruby with --trace
cd mruby && MRUBY_CONFIG=../build_config.rb rake --trace
trace:
cd mruby && MRUBY_CONFIG=../build_config.rb rake --trace
test:
cd mruby && MRUBY_CONFIG=../build_config.rb rake test
rtest:
cd src/mruby-qml-parse && ruby test-non-mruby.rb
cd src/mruby-qml-spawn && ruby test-non-mruby.rb
run: ## Run the toolkit
./zest osc.udp://127.0.0.1:1337
valgrind: ## Launch with valgrind
valgrind --leak-check=full --show-reachable=yes --log-file=leak-log.txt ./zest osc.udp://127.0.0.1:1337
callgrind: ## Launch with callgrind
valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes ./zest osc.udp://127.0.0.1:1337
gdb:
gdb --args ./zest osc.udp://127.0.0.1:1337
gltrace: ## Launch with apitrace
/work/mytmp/apitrace/build/apitrace trace ./zest osc.udp://127.0.0.1:1337
qtrace:
/work/mytmp/apitrace/build/qapitrace ./mruby.trace
scratch:
./mruby/bin/mruby scratch.rb
clean: ## Clean Build Data
cd mruby && MRUBY_CONFIG=../build_config.rb rake clean
cd mruby && rm -rf build/w64
pack:
rm -rf package
mkdir package
mkdir package/schema
mkdir package/qml
mkdir package/font
mkdir package/completions
cp src/mruby-zest/qml/* package/qml/
cp src/mruby-zest/example/* package/qml/
cp src/osc-bridge/schema/test.json package/schema/
cp deps/nanovg/example/*.ttf package/font/
cp mruby/bin/mruby package/
cp libzest.so package/
cp zest package/
cp completions/zyn-fusion package/completions
echo 'Version 3.0.0-pre ' >> package/VERSION
echo 'built on: ' >> package/VERSION
echo `date` >> package/VERSION
rm -f zest-dist.tar
rm -f zest-dist.tar.bz2
tar cf zest-dist.tar package/
bzip2 zest-dist.tar
pack32: ## Create 64bit Linux Package
make pack
mv zest-dist.tar.bz2 zest-dist-x86.tar.bz2
pack64: ## Create 64bit Linux Package
make pack
mv zest-dist.tar.bz2 zest-dist-x86_64.tar.bz2
put32: ## Push to the server
scp zest-dist-x86.tar.bz2 [email protected]:/var/www/htdocs/zest/
put64: ## Push to the server
scp zest-dist-x86_64.tar.bz2 [email protected]:/var/www/htdocs/zest/
packsrc:
git-archive-all zynaddsubfx-3.0.0.tar.bz2
putsrc:
scp zynaddsubfx-3.0.0.tar.bz2 [email protected]:/var/www/htdocs/zest/
.PHONY: help
help: ## This help
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'