blob: 5be0e38ea79aa0d5e9c0fc704c74e452f1a0601f [file] [log] [blame]
Michael Sevakis95e23de2013-04-16 17:47:58 -04001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7
8FIXEDPOINTLIB := $(BUILDDIR)/lib/libfixedpoint.a
9FIXEDPOINTLIB_DIR := $(ROOTDIR)/lib/fixedpoint
10FIXEDPOINTLIB_SRC := $(FIXEDPOINTLIB_DIR)/fixedpoint.c
11FIXEDPOINTLIB_OBJ := $(call c2obj, $(FIXEDPOINTLIB_SRC))
12
13INCLUDES += -I$(FIXEDPOINTLIB_DIR)
14OTHER_SRC += $(FIXEDPOINTLIB_SRC)
15
Michael Sevakis95e23de2013-04-16 17:47:58 -040016CORE_LIBS += $(FIXEDPOINTLIB)
Dominik Riebelingd566fd52013-05-03 13:02:56 +020017CORE_GCSECTIONS := yes
Michael Sevakis95e23de2013-04-16 17:47:58 -040018
Michael Sevakis5314fb22013-04-25 18:33:08 -040019FIXEDPOINTLIB_FLAGS := $(CFLAGS) $(SHARED_CFLAGS)
Michael Sevakis95e23de2013-04-16 17:47:58 -040020
21# Do not use '-ffunction-sections' and '-fdata-sections' when compiling sdl-sim
22ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim)
23 FIXEDPOINTLIB_FLAGS += -ffunction-sections -fdata-sections
24endif
25
26$(FIXEDPOINTLIB_OBJ): $(FIXEDPOINTLIB_SRC)
27 $(SILENT)mkdir -p $(dir $@)
28 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
29 $(FIXEDPOINTLIB_FLAGS) -c $< -o $@
30
31$(FIXEDPOINTLIB): $(FIXEDPOINTLIB_OBJ)
32 $(SILENT)$(shell rm -f $@)
33 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null