Separate out rs_version.mk for reusable definition of the TOT compiler.

You can add the following lines to any Android.mk to use the properly
computed value for RS_VERSION:

include frameworks/compile/slang/rs_version.mk
LOCAL_CFLAGS += $(RS_VERSION_DEFINE)

Change-Id: I68fb5c59d1f1f6a9944eaf3c6c99a0355824600f
diff --git a/rs_version.mk b/rs_version.mk
new file mode 100644
index 0000000..f2dd4e7
--- /dev/null
+++ b/rs_version.mk
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
+  RS_VERSION := $(PLATFORM_SDK_VERSION)
+else
+  # Increment by 1 whenever this is not a final release build, since we want to
+  # be able to see the RS version number change during development.
+  # See build/core/version_defaults.mk for more information about this.
+  RS_VERSION := "(1 + $(PLATFORM_SDK_VERSION))"
+endif
+RS_VERSION_DEFINE := -DRS_VERSION=$(RS_VERSION)
+
+# Use RS_VERSION_DEFINE as part of your LOCAL_CFLAGS to have the proper value.
+# LOCAL_CFLAGS += $(RS_VERSION_DEFINE)
+