• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 Google, Inc.
2#
3# This software is provided 'as-is', without any express or implied
4# warranty.  In no event will the authors be held liable for any damages
5# arising from the use of this software.
6# Permission is granted to anyone to use this software for any purpose,
7# including commercial applications, and to alter it and redistribute it
8# freely, subject to the following restrictions:
9# 1. The origin of this software must not be misrepresented; you must not
10# claim that you wrote the original software. If you use this software
11# in a product, an acknowledgment in the product documentation would be
12# appreciated but is not required.
13# 2. Altered source versions must be plainly marked as such, and must not be
14# misrepresented as being the original software.
15# 3. This notice may not be removed or altered from any source distribution.
16
17LOCAL_PATH := $(call my-dir)
18FLATBUFFERS_ROOT_DIR := $(LOCAL_PATH)/../../..
19
20# FlatBuffers test
21include $(CLEAR_VARS)
22
23# Include the FlatBuffer utility function to generate header files from schemas.
24include $(FLATBUFFERS_ROOT_DIR)/android/jni/include.mk
25
26LOCAL_MODULE := FlatBufferSample
27LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
28LOCAL_LICENSE_CONDITIONS := notice
29LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../LICENSE $(LOCAL_PATH)/../../../LICENSE.txt
30
31# Set up some useful variables to identify schema and output directories and
32# schema files.
33ANDROID_SAMPLE_GENERATED_OUTPUT_DIR := $(LOCAL_PATH)/gen/include
34ANDROID_SAMPLE_SCHEMA_DIR := $(LOCAL_PATH)/schemas
35ANDROID_SAMPLE_SCHEMA_FILES := $(ANDROID_SAMPLE_SCHEMA_DIR)/animal.fbs
36
37LOCAL_C_INCLUDES := $(ANDROID_SAMPLE_GENERATED_OUTPUT_DIR)
38
39$(info $(LOCAL_C_INCLUDES))
40
41LOCAL_SRC_FILES := main.cpp
42
43LOCAL_CPPFLAGS := -std=c++11 -fexceptions -Wall -Wno-literal-suffix
44LOCAL_LDLIBS := -llog -landroid -latomic
45LOCAL_ARM_MODE := arm
46LOCAL_STATIC_LIBRARIES := android_native_app_glue flatbuffers
47
48ifeq (,$(ANDROID_SAMPLE_RUN_ONCE))
49ANDROID_SAMPLE_RUN_ONCE := 1
50$(call flatbuffers_header_build_rules,$(ANDROID_SAMPLE_SCHEMA_FILES),$(ANDROID_SAMPLE_SCHEMA_DIR),$(ANDROID_SAMPLE_GENERATED_OUTPUT_DIR),,$(LOCAL_SRC_FILES))
51endif
52
53include $(BUILD_SHARED_LIBRARY)
54
55# Path to Flatbuffers root directory.
56$(call import-add-path,$(FLATBUFFERS_ROOT_DIR)/..)
57
58$(call import-module,flatbuffers/android/jni)
59$(call import-module,android/native_app_glue)
60