2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 TLSFLIB_DIR
:= $(ROOTDIR
)/lib
/tlsf
11 TLSFLIB_SRC
:= $(call preprocess
, $(TLSFLIB_DIR
)/SOURCES
)
12 TLSFLIB_OBJ
:= $(call c2obj
, $(TLSFLIB_SRC
))
13 TLSFLIB
:= $(BUILDDIR
)/lib
/libtlsf.a
15 OTHER_SRC
+= $(TLSFLIB_SRC
)
16 INCLUDES
+= -I
$(TLSFLIB_DIR
)/src
17 EXTRA_LIBS
+= $(TLSFLIB
)
19 TLSFLIBFLAGS
= $(CFLAGS
) -fstrict-aliasing
-ffunction-sections
$(SHARED_CFLAGS
)
21 # Enable statistics in the sim
22 ifneq ($(findstring sdl-sim
, $(APP_TYPE
)), sdl-sim
)
23 TLSFLIBFLAGS
+= -DTLSF_STATISTIC
=1
26 # special rules for tlsf
27 $(BUILDDIR
)/lib
/tlsf
/src
/%.o
: $(TLSFLIB_DIR
)/src
/%.c
28 $(SILENT
)mkdir
-p
$(dir $@
)
29 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) -c
$< -o
$@ \
30 -I
$(TLSFLIB_DIR
)/src
$(TLSFLIBFLAGS
)
32 $(TLSFLIB
): $(TLSFLIB_OBJ
)
33 $(SILENT
)$(shell rm -f
$@
)
34 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null