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
17################################################################################
18#
19# Nanoapp Libc/Libm/Builtins build helper script
20#
21################################################################################
22
23# Libm #########################################################################
24
25LIBM_PATH := $(NANOHUB_DIR)/lib/libm
26
27CFLAGS += -D_IEEE_LIBM
28
29SRCS += $(LIBM_PATH)/ef_atan2.c
30SRCS += $(LIBM_PATH)/ef_asin.c
31SRCS += $(LIBM_PATH)/ef_exp.c
32SRCS += $(LIBM_PATH)/ef_fmod.c
33SRCS += $(LIBM_PATH)/ef_pow.c
34SRCS += $(LIBM_PATH)/ef_rem_pio2.c
35SRCS += $(LIBM_PATH)/ef_sqrt.c
36SRCS += $(LIBM_PATH)/kf_cos.c
37SRCS += $(LIBM_PATH)/kf_rem_pio2.c
38SRCS += $(LIBM_PATH)/kf_sin.c
39SRCS += $(LIBM_PATH)/sf_atan.c
40SRCS += $(LIBM_PATH)/sf_cos.c
41SRCS += $(LIBM_PATH)/sf_floor.c
42SRCS += $(LIBM_PATH)/sf_fpclassify.c
43SRCS += $(LIBM_PATH)/sf_round.c
44SRCS += $(LIBM_PATH)/sf_scalbn.c
45SRCS += $(LIBM_PATH)/sf_sin.c
46SRCS += $(LIBM_PATH)/wf_atan2.c
47SRCS += $(LIBM_PATH)/wf_asin.c
48SRCS += $(LIBM_PATH)/wf_exp.c
49SRCS += $(LIBM_PATH)/wf_fmod.c
50SRCS += $(LIBM_PATH)/wf_pow.c
51
52# Libc #########################################################################
53
54LIBC_PATH := $(NANOHUB_DIR)/lib/libc
55
56SRCS += $(LIBC_PATH)/memcmp.c
57#SRCS += $(LIBC_PATH)/memcpy-armv7m.S
58SRCS += $(LIBC_PATH)/memcpy.c
59SRCS += $(LIBC_PATH)/memmove.c
60SRCS += $(LIBC_PATH)/memset.c
61SRCS += $(LIBC_PATH)/strcasecmp.c
62SRCS += $(LIBC_PATH)/strncpy.c
63SRCS += $(LIBC_PATH)/strlen.c
64
65# C++ support
66
67SRCS += $(LIBC_PATH)/crt.c
68SRCS += $(LIBC_PATH)/aeabi.cpp
69SRCS += $(LIBC_PATH)/cxa.cpp
70SRCS += $(LIBC_PATH)/new.cpp
71CFLAGS += -I$(LIBC_PATH)
72CFLAGS += -DNANOHUB_PROVIDES_CXX_SUPPORT
73
74# Builtins #####################################################################
75
76BUILTINS_PATH := $(NANOHUB_DIR)/lib/builtins
77
78#SRCS += $(BUILTINS_PATH)/aeabi_ldivmod.S
79#SRCS += $(BUILTINS_PATH)/aeabi_uldivmod.S
80SRCS += $(BUILTINS_PATH)/divdi3.c
81SRCS += $(BUILTINS_PATH)/divmoddi4.c
82SRCS += $(BUILTINS_PATH)/moddi3.c
83SRCS += $(BUILTINS_PATH)/udivmoddi4.c
84SRCS += $(BUILTINS_PATH)/umoddi3.c
85CFLAGS += -I$(BUILTINS_PATH)
86