Support Mac-Android Cross-Compilation

- Rename Android sampleApp target to SampleAppAndroid to avoid name collision
- Detect skia_os on Darwin to differentiate between xcode and make builds
Review URL: https://codereview.appspot.com/6303044

git-svn-id: http://skia.googlecode.com/svn/trunk@4168 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/Makefile b/Makefile
index a3ac806..f206ccf 100644
--- a/Makefile
+++ b/Makefile
@@ -86,12 +86,15 @@
 # For the Mac, we create a convenience symlink to the generated binary.
 .PHONY: $(ALL_TARGETS)
 $(ALL_TARGETS):: gyp_if_needed
-ifneq (,$(findstring Linux, $(uname)))
+ifneq (,$(findstring skia_os=android, $(GYP_DEFINES)))
 	$(MAKE) -C out $@ BUILDTYPE=$(BUILDTYPE)
-endif
-ifneq (,$(findstring Darwin, $(uname)))
+else ifneq (,$(findstring Linux, $(uname)))
+	$(MAKE) -C out $@ BUILDTYPE=$(BUILDTYPE)
+else ifneq (,$(findstring Darwin, $(uname)))
 	rm -f out/$(BUILDTYPE) || if test -d out/$(BUILDTYPE); then echo "run 'make clean' or otherwise delete out/$(BUILDTYPE)"; exit 1; fi
 	xcodebuild -project out/gyp/$@.xcodeproj -configuration $(BUILDTYPE)
 	ln -s $(CWD)/xcodebuild/$(BUILDTYPE) out/$(BUILDTYPE)
-endif
-
+else
+	echo "unknown platform $(uname)"
+	exit 1
+endif
\ No newline at end of file