merge in oc-dr1-release history after reset to master
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..7c2da79
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,27 @@
+cc_library_headers {
+    name: "vk_headers",
+    clang: true,
+    local_include_dirs: [
+        "include",
+    ],
+    export_include_dirs: [
+        "include",
+    ],
+}
+
+cc_library_headers {
+    name: "vk_headers_ndk",
+    clang: true,
+    local_include_dirs: [
+        "include",
+    ],
+    export_include_dirs: [
+        "include",
+    ],
+    sdk_version: "24",
+}
+
+subdirs = [
+    "libs/cjson",
+    "libs/vkjson",
+]
diff --git a/Android.mk b/Android.mk
index 441a0c2..c948812 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1 +1,2 @@
-include $(call my-dir)/libs/vkjson/Android.mk
+# Leave this Android.mk empty, deleting it unmasks
+# invalid Android.mks in subdirectories.
diff --git a/libs/cjson/Android.bp b/libs/cjson/Android.bp
new file mode 100644
index 0000000..b2ad79d
--- /dev/null
+++ b/libs/cjson/Android.bp
@@ -0,0 +1,28 @@
+cc_library_static {
+    name: "cjson",
+    clang: true,
+    srcs: [
+        "cJSON.c",
+    ],
+    local_include_dirs: [
+        "includes",
+    ],
+    export_include_dirs: [
+        "includes",
+    ],
+}
+
+cc_library_static {
+    name: "cjson_ndk",
+    clang: true,
+    srcs: [
+        "cJSON.c",
+    ],
+    local_include_dirs: [
+        "includes",
+    ],
+    export_include_dirs: [
+        "includes",
+    ],
+    sdk_version: "24",
+}
diff --git a/loader/cJSON.c b/libs/cjson/cJSON.c
similarity index 100%
rename from loader/cJSON.c
rename to libs/cjson/cJSON.c
diff --git a/loader/cJSON.h b/libs/cjson/includes/cJSON.h
similarity index 100%
rename from loader/cJSON.h
rename to libs/cjson/includes/cJSON.h
diff --git a/libs/vkjson/Android.bp b/libs/vkjson/Android.bp
new file mode 100644
index 0000000..63de5c1
--- /dev/null
+++ b/libs/vkjson/Android.bp
@@ -0,0 +1,45 @@
+cc_library_static {
+    name: "libvkjson",
+    clang: true,
+    srcs: [
+        "vkjson.cc",
+        "vkjson_instance.cc",
+    ],
+    cppflags: [
+        "-std=c++11",
+        "-Wno-sign-compare",
+    ],
+    export_include_dirs: [
+        ".",
+    ],
+    whole_static_libs: [
+        "cjson",
+    ],
+    header_libs: [
+        "vk_headers",
+    ],
+}
+
+cc_library_static {
+    name: "libvkjson_ndk",
+    clang: true,
+    srcs: [
+        "vkjson.cc",
+        "vkjson_instance.cc",
+    ],
+    cppflags: [
+        "-std=c++11",
+        "-Wno-sign-compare",
+    ],
+    export_include_dirs: [
+        ".",
+    ],
+    whole_static_libs: [
+        "cjson_ndk",
+    ],
+    header_libs: [
+        "vk_headers_ndk",
+    ],
+    sdk_version: "24",
+    stl: "libc++_static",
+}
diff --git a/libs/vkjson/Android.mk b/libs/vkjson/Android.mk
deleted file mode 100644
index 61a731d..0000000
--- a/libs/vkjson/Android.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 2016 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.
-
-LOCAL_PATH := $(call my-dir)
-
-vkjson_sources := \
-	vkjson.cc \
-	vkjson_instance.cc \
-	../../loader/cJSON.c
-
-# Static library for platform use
-include $(CLEAR_VARS)
-
-LOCAL_CPP_EXTENSION := .cc
-LOCAL_CLANG := true
-LOCAL_CPPFLAGS := -std=c++11 \
-	-Wno-sign-compare
-
-LOCAL_C_INCLUDES := \
-	$(LOCAL_PATH)/../../include \
-	$(LOCAL_PATH)/../../loader
-
-LOCAL_SRC_FILES := $(vkjson_sources)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_MODULE := libvkjson
-
-include $(BUILD_STATIC_LIBRARY)
-
-# Static library for NDK use (CTS)
-include $(CLEAR_VARS)
-
-LOCAL_CPP_EXTENSION := .cc
-LOCAL_CLANG := true
-LOCAL_CPPFLAGS := -std=c++11 \
-	-Wno-sign-compare
-
-LOCAL_C_INCLUDES := \
-	$(LOCAL_PATH)/../../include \
-	$(LOCAL_PATH)/../../loader
-
-LOCAL_SRC_FILES := $(vkjson_sources)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_SDK_VERSION := 24
-LOCAL_NDK_STL_VARIANT := c++_static
-LOCAL_MODULE := libvkjson_ndk
-
-include $(BUILD_STATIC_LIBRARY)
-
-vkjson_sources :=
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 793dccc..3b90e8c 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -27,8 +27,8 @@
     debug_report.h
     table_ops.h
     gpa_helper.h
-    cJSON.c
-    cJSON.h
+    ../libs/cjson/includes/cJSON.h
+    ../libs/cjson/cJSON.c
     murmurhash.c
     murmurhash.h
 )