examples/calculator: add rule to build iOS version
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 13 Nov 2015 17:03:30 +0000 (12:03 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 9 Feb 2016 19:41:47 +0000 (14:41 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

examples/calculator/Makefile
examples/calculator/README.md

index 24b10ab..a0ea5cf 100644 (file)
@@ -3,17 +3,20 @@ NITLS=../../bin/nitls
 
 all: bin/calculator bin/test
 
-bin/calculator: $(shell ${NITLS} -M src/calculator.nit -m linux) ${NITC}
+bin/calculator: $(shell ${NITLS} -M src/calculator.nit linux) ${NITC}
        mkdir -p bin
        ${NITC} -o $@ src/calculator.nit -m linux
 
+# ---
+# Android
+
 android: bin/calculator.apk
 
-bin/calculator.apk: $(shell ${NITLS} -M src/calculator.nit -m android) ${NITC} res/drawable-ldpi/icon.png
+bin/calculator.apk: $(shell ${NITLS} -M src/calculator.nit android) ${NITC} res/drawable-ldpi/icon.png
        mkdir -p bin
        ${NITC} -o $@ src/calculator.nit -m ../../lib/android/ui/ -D debug
 
-android-release: $(shell ${NITLS} -M src/calculator.nit -m android) ${NITC} res/drawable-ldpi/icon.png
+android-release: $(shell ${NITLS} -M src/calculator.nit android) ${NITC} res/drawable-ldpi/icon.png
        mkdir -p bin
        ${NITC} -o bin/calculator.apk src/calculator.nit -m ../../lib/android/ui/ --release
 
@@ -27,6 +30,16 @@ res/drawable-ldpi/icon.png: art/icon.svg ../../contrib/inkscape_tools/bin/svg_to
 android-install: bin/calculator.apk
        adb install -r bin/calculator.apk
 
+# ---
+# iOS
+
+bin/calculator.app: $(shell ${NITLS} -M src/calculator.nit ios) ${NITC}
+       mkdir -p bin
+       ${NITC} -o $@ src/calculator.nit -m ios -D debug
+
+# ---
+# Tests
+
 bin/test: $(shell ${NITLS} -M src/calculator_test.nit) ${NITC}
        mkdir -p bin
        ${NITC} -o $@ src/calculator_test.nit
index 9028013..0073c26 100644 (file)
@@ -7,9 +7,25 @@ Portable calculator built using _app.nit_
 * `calculator` implements the portable graphical interface using the _app.nit_ framework
 * `calculator_test` test `CalculatorContext` as a black box.
 
-# Usage
+# Compilation
 
-1. Compile with a call to `make`.
-2. Run with either:
-       1. The desktop version, `bin/calculator`.
-       2. The Android version by install the APK at `bin/calculator.apk`.
+* Compile and run on the desktop (GNU/Linux and OS X) with:
+
+       ~~~
+       make
+       bin/calculator
+       ~~~
+
+* Compile for Android and install on a device or emulator with:
+
+       ~~~
+       make bin/android.apk
+       adb install -r bin/calculator.apk
+       ~~~
+
+* Compile for iOS and run on the simulator with:
+
+       ~~~
+       make bin/android.app
+       ios-sim launch bin/calculator.app
+       ~~~