Makefiles: add pre-build
[nit.git] / contrib / memory / 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/memory
16
17 pre-build: assets/images/drawing.png
18
19 bin/memory: assets/images/drawing.png src/*.nit
20 mkdir -p bin
21 ../../bin/nitc -o bin/memory src/memory.nit -m ../../lib/mnit/linux/linux.nit
22
23 assets/images/drawing.png: art/drawing.svg
24 mkdir -p assets/images/
25 ../inkscape_tools/bin/svg_to_png_and_nit art/drawing.svg -a assets/ -s src/ -x 4
26
27 res/drawable-ldpi/icon.png: art/icon.svg
28 mkdir -p res/
29 ../inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
30
31 android: bin/memory.apk
32 bin/memory.apk: assets/images/drawing.png src/*.nit res/drawable-ldpi/icon.png
33 mkdir -p bin
34 ../../bin/nitc -o bin/memory.apk src/memory.nit -m ../../lib/mnit/android/android.nit -m ../../lib/android/landscape.nit
35
36 android-release: assets/images/drawing.png src/*.nit res/drawable-ldpi/icon.png
37 mkdir -p bin
38 ../../bin/nitc -o bin/memory.apk src/memory.nit -m ../../lib/mnit/android/android.nit -m ../../lib/android/landscape.nit --release