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
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
* `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
+ ~~~