Makefiles: add pre-build
[nit.git] / contrib / tinks / Makefile
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 all: bin/server bin/tinks
16
17 pre-build: assets/images/drawing.png src/client/client_serialize.nit src/server/server_serialize.nit
18
19 # Client
20 bin/tinks: assets/images/drawing.png src/client/client_serialize.nit $(shell ../../bin/nitls -M src/client/linux_client.nit)
21 ../../bin/nitc -o bin/tinks src/client/linux_client.nit -m src/client/client_serialize.nit
22
23 src/client/client_serialize.nit: $(shell ../../bin/nitls -M src/client/client.nit)
24 ../../bin/nitserial -o src/client/client_serialize.nit src/client/client.nit
25
26 assets/images/drawing.png: art/drawing.svg
27 ../inkscape_tools/bin/svg_to_png_and_nit art/drawing.svg -a assets/ -s src/client/ -x 2.0
28
29 # Server
30 bin/server: src/server/server_serialize.nit $(shell ../../bin/nitls -M src/server/dedicated.nit)
31 ../../bin/nitc -o bin/server src/server/dedicated.nit -m src/server/server_serialize.nit
32
33 src/server/server_serialize.nit: $(shell ../../bin/nitls -M src/server/dedicated.nit)
34 ../../bin/nitserial -o src/server/server_serialize.nit src/server/dedicated.nit
35
36 # Android
37 android: bin/tinks.apk
38 bin/tinks.apk: assets/images/drawing.png src/client/client_serialize.nit res/drawable-ldpi/icon.png $(shell ../../bin/nitls -M src/client/android_client.nit)
39 ../../bin/nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit
40
41 android-release: assets/images/drawing.png src/client/client_serialize.nit res/drawable-ldpi/icon.png $(shell ../../bin/nitls -M src/client/android_client.nit)
42 ../../bin/nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit --release
43
44 res/drawable-ldpi/icon.png: art/icon.svg
45 ../inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
46
47 # Archive
48 pub: assets/images/drawing.png src/client/client_serialize.nit bin/tinks.apk
49 ../../bin/nitc --no-stacktrace -o bin/tinks src/client/linux_client.nit -m src/client/client_serialize.nit
50 tar -czvf bin/tinks.tar.gz bin/tinks assets/
51 scp bin/tinks.tar.gz bin/tinks.apk xymus.net:/var/www/pub/
52
53 .PHONY: pub