1#
2# Copyright (C) 2016 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19ifneq ($(NANOHUB_OS_PATH),)
20
21include $(CLEAR_NANO_VARS)
22
23LOCAL_MODULE := libnanohub_os
24LOCAL_MODULE_TAGS := optional
25
26LOCAL_SRC_FILES := \
27    os/core/appSec.c \
28    os/core/eventQ.c \
29    os/core/floatRt.c \
30    os/core/heap.c \
31    os/core/hostIntf.c \
32    os/core/hostIntfI2c.c \
33    os/core/hostIntfSpi.c \
34    os/core/nanohubCommand.c \
35    os/core/nanohub_chre.c \
36    os/core/osApi.c \
37    os/core/printf.c \
38    os/core/sensors.c \
39    os/core/seos.c \
40    os/core/simpleQ.c \
41    os/core/syscall.c \
42    os/core/slab.c \
43    os/core/spi.c \
44    os/core/timer.c \
45    os/core/trylock.c \
46    os/algos/ap_hub_sync.c \
47
48LOCAL_C_INCLUDES := \
49    $(NANOHUB_OS_PATH)/external/freebsd/inc \
50    $(NANOHUB_OS_PATH)/os/algos \
51
52LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_C_INCLUDES)
53
54include $(BUILD_NANOHUB_OS_STATIC_LIBRARY)
55
56########################################################
57# BOOT LOADER BINARY
58########################################################
59
60include $(CLEAR_NANO_VARS)
61
62LOCAL_MODULE := nanohub_bl
63
64LOCAL_SRC_FILES := \
65    os/core/bl.c   \
66
67LOCAL_STATIC_LIBRARIES := \
68    libnanohub_common_bl \
69    libnanohub_os \
70    libnanolibc_os \
71
72LOCAL_OBJCOPY_SECT_cortexm4 := .bl .blrodata .eedata
73
74include $(BUILD_NANOHUB_BL_EXECUTABLE)
75
76########################################################
77# NANOHUB OS BINARY
78########################################################
79
80include $(CLEAR_NANO_VARS)
81
82LOCAL_MODULE := nanohub_os
83
84LOCAL_CFLAGS := \
85    -DPLATFORM_HW_VER=0 \
86
87LOCAL_WHOLE_STATIC_LIBRARIES := \
88    libnanohub_os \
89
90LOCAL_STATIC_LIBRARIES := \
91    libnanomath_os \
92    libnanolibc_os \
93
94LOCAL_OBJCOPY_SECT_cortexm4 := .data .text
95
96include $(BUILD_NANOHUB_OS_EXECUTABLE)
97
98include $(call first-makefiles-under,$(NANOHUB_OS_PATH))
99
100endif # NANOHUB_OS_PATH
101