forked from len0rd/rockbox
Make fixepoint.c as a shared library (libfixedpoint.a).
Change-Id: Icc10d6e85f890c432f191233a4d64e09f00be43d Reviewed-on: http://gerrit.rockbox.org/456 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
This commit is contained in:
parent
8829e909b4
commit
95e23defb0
28 changed files with 91 additions and 101 deletions
|
@ -163,7 +163,6 @@ radio/radioart.c
|
||||||
#if INPUT_SRC_CAPS != 0
|
#if INPUT_SRC_CAPS != 0
|
||||||
audio_path.c
|
audio_path.c
|
||||||
#endif /* INPUT_SRC_CAPS != 0 */
|
#endif /* INPUT_SRC_CAPS != 0 */
|
||||||
fixedpoint.c
|
|
||||||
pcmbuf.c
|
pcmbuf.c
|
||||||
codec_thread.c
|
codec_thread.c
|
||||||
playback.c
|
playback.c
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
#include "lib/fixedpoint.h"
|
#include "fixedpoint.h"
|
||||||
#include "lib/pluginlib_actions.h"
|
#include "lib/pluginlib_actions.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "fixedpoint.h"
|
||||||
|
|
||||||
#include "lib/xlcd.h"
|
#include "lib/xlcd.h"
|
||||||
#include "lib/pluginlib_actions.h"
|
#include "lib/pluginlib_actions.h"
|
||||||
#include "lib/fixedpoint.h"
|
|
||||||
#include "lib/playback_control.h"
|
#include "lib/playback_control.h"
|
||||||
#include "lib/highscore.h"
|
#include "lib/highscore.h"
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "fixedpoint.h"
|
||||||
#include "clock_draw_analog.h"
|
#include "clock_draw_analog.h"
|
||||||
#include "lib/xlcd.h"
|
#include "lib/xlcd.h"
|
||||||
#include "lib/fixedpoint.h"
|
|
||||||
#include "clock_bitmaps.h"
|
#include "clock_bitmaps.h"
|
||||||
#include "clock_bitmap_strings.h"
|
#include "clock_bitmap_strings.h"
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "fixedpoint.h"
|
||||||
#include "lib/playergfx.h"
|
#include "lib/playergfx.h"
|
||||||
#include "lib/pluginlib_exit.h"
|
#include "lib/pluginlib_exit.h"
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
|
@ -31,7 +32,6 @@
|
||||||
#include "lib/mylcd.h" /* MYLCD_CFG_GREYLIB or MYLCD_CFG_PGFX */
|
#include "lib/mylcd.h" /* MYLCD_CFG_GREYLIB or MYLCD_CFG_PGFX */
|
||||||
#endif
|
#endif
|
||||||
#include "lib/xlcd.h"
|
#include "lib/xlcd.h"
|
||||||
#include "lib/fixedpoint.h"
|
|
||||||
|
|
||||||
/* Loops that the values are displayed */
|
/* Loops that the values are displayed */
|
||||||
#define DISP_TIME 30
|
#define DISP_TIME 30
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "lib/fixedpoint.h"
|
#include "fixedpoint.h"
|
||||||
|
|
||||||
#define Q_MUL(a, b, bits) (( (int64_t) (a) * (int64_t) (b) ) >> (bits))
|
#define Q_MUL(a, b, bits) (( (int64_t) (a) * (int64_t) (b) ) >> (bits))
|
||||||
#define Q15_MUL(a, b) Q_MUL(a,b,15)
|
#define Q15_MUL(a, b) Q_MUL(a,b,15)
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "fixedpoint.h"
|
||||||
#include "lib/helper.h"
|
#include "lib/helper.h"
|
||||||
|
|
||||||
#include "lib/pluginlib_actions.h"
|
#include "lib/pluginlib_actions.h"
|
||||||
#include "lib/fixedpoint.h"
|
|
||||||
|
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
#include "lib/grey.h"
|
#include "lib/grey.h"
|
||||||
|
|
|
@ -4,7 +4,6 @@ helper.c
|
||||||
md5.c
|
md5.c
|
||||||
jhash.c
|
jhash.c
|
||||||
configfile.c
|
configfile.c
|
||||||
fixedpoint.c
|
|
||||||
playback_control.c
|
playback_control.c
|
||||||
rgb_hsv.c
|
rgb_hsv.c
|
||||||
highscore.c
|
highscore.c
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
#include "../../fixedpoint.c"
|
|
|
@ -1,26 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* __________ __ ___.
|
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
||||||
* \/ \/ \/ \/ \/
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 Jens Arnold
|
|
||||||
*
|
|
||||||
* Fixed point library for plugins
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
||||||
* KIND, either express or implied.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
#ifndef _FIXEDPOINT_H_PLUGINS
|
|
||||||
#define _FIXEDPOINT_H_PLUGINS
|
|
||||||
#include "../../../firmware/include/fixedpoint.h"
|
|
||||||
#endif /* _FIXEDPOINT_H_PLUGINS */
|
|
|
@ -22,13 +22,11 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "fixedpoint.h"
|
||||||
#include "lib/helper.h"
|
#include "lib/helper.h"
|
||||||
#include "lib/pluginlib_exit.h"
|
#include "lib/pluginlib_exit.h"
|
||||||
|
|
||||||
#include "lib/xlcd.h"
|
#include "lib/xlcd.h"
|
||||||
#include "lib/configfile.h"
|
#include "lib/configfile.h"
|
||||||
#include "fixedpoint.h"
|
|
||||||
#include "lib/fixedpoint.h"
|
|
||||||
#include "lib/osd.h"
|
#include "lib/osd.h"
|
||||||
|
|
||||||
/* variable button definitions */
|
/* variable button definitions */
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "fixedpoint.h"
|
||||||
#include "lib/helper.h"
|
#include "lib/helper.h"
|
||||||
#include "lib/pluginlib_actions.h"
|
#include "lib/pluginlib_actions.h"
|
||||||
#include "lib/pluginlib_exit.h"
|
#include "lib/pluginlib_exit.h"
|
||||||
|
@ -32,7 +33,6 @@
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
#include "lib/grey.h"
|
#include "lib/grey.h"
|
||||||
#endif
|
#endif
|
||||||
#include "lib/fixedpoint.h"
|
|
||||||
|
|
||||||
|
|
||||||
/******************************* Globals ***********************************/
|
/******************************* Globals ***********************************/
|
||||||
|
|
|
@ -53,7 +53,7 @@ else
|
||||||
PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
|
PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PLUGIN_LIBS := $(PLUGINLIB) $(PLUGINBITMAPLIB) $(SETJMPLIB)
|
PLUGIN_LIBS := $(PLUGINLIB) $(PLUGINBITMAPLIB) $(SETJMPLIB) $(FIXEDPOINTLIB)
|
||||||
|
|
||||||
# include <dir>.make from each subdir (yay!)
|
# include <dir>.make from each subdir (yay!)
|
||||||
$(foreach dir,$(PLUGINSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make))
|
$(foreach dir,$(PLUGINSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make))
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*
|
*
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "lib/fixedpoint.h"
|
#include "fixedpoint.h"
|
||||||
#include "lib/playback_control.h"
|
#include "lib/playback_control.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,5 +9,7 @@
|
||||||
|
|
||||||
SRC += $(call preprocess,$(APPSDIR)/SOURCES)
|
SRC += $(call preprocess,$(APPSDIR)/SOURCES)
|
||||||
|
|
||||||
|
CORE_GCSECTIONS = yes
|
||||||
|
|
||||||
# don't build rombox.ucl
|
# don't build rombox.ucl
|
||||||
ARCHOSROM=
|
ARCHOSROM=
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "fixedpoint.h"
|
#include "fixedpoint.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -143,8 +142,6 @@ long fp_sincos(unsigned long phase, long *cos)
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(PLUGIN) || defined(CODEC)
|
|
||||||
/**
|
/**
|
||||||
* Fixed point square root via Newton-Raphson.
|
* Fixed point square root via Newton-Raphson.
|
||||||
* @param x square root argument.
|
* @param x square root argument.
|
||||||
|
@ -207,10 +204,7 @@ unsigned long isqrt(unsigned long x)
|
||||||
|
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
#endif /* PLUGIN or CODEC */
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(PLUGIN)
|
|
||||||
/**
|
/**
|
||||||
* Fixed point sinus using a lookup table
|
* Fixed point sinus using a lookup table
|
||||||
* don't forget to divide the result by 16384 to get the actual sinus value
|
* don't forget to divide the result by 16384 to get the actual sinus value
|
||||||
|
@ -325,10 +319,7 @@ long fp16_exp(int x)
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
#endif /* PLUGIN */
|
|
||||||
|
|
||||||
|
|
||||||
#if (!defined(PLUGIN) && !defined(CODEC))
|
|
||||||
/** MODIFIED FROM replaygain.c */
|
/** MODIFIED FROM replaygain.c */
|
||||||
|
|
||||||
#define FP_MUL_FRAC(x, y) fp_mul(x, y, fracbits)
|
#define FP_MUL_FRAC(x, y) fp_mul(x, y, fracbits)
|
||||||
|
@ -407,12 +398,10 @@ long fp_exp10(long x, unsigned int fracbits)
|
||||||
return FP_MUL_FRAC(k, xp);
|
return FP_MUL_FRAC(k, xp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0 /* useful code, but not currently used */
|
|
||||||
/** FIXED POINT LOG10
|
/** FIXED POINT LOG10
|
||||||
* Return log10(x) as FP integer. Argument is FP integer.
|
* Return log10(x) as FP integer. Argument is FP integer.
|
||||||
*/
|
*/
|
||||||
static long fp_log10(long n, unsigned int fracbits)
|
long fp_log10(long n, unsigned int fracbits)
|
||||||
{
|
{
|
||||||
/* Calculate log2 of argument */
|
/* Calculate log2 of argument */
|
||||||
|
|
||||||
|
@ -453,15 +442,12 @@ static long fp_log10(long n, unsigned int fracbits)
|
||||||
return FP_MUL_FRAC(log2, (FP28_LOG10OF2 >> (28 - fracbits)));
|
return FP_MUL_FRAC(log2, (FP28_LOG10OF2 >> (28 - fracbits)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** CONVERT FACTOR TO DECIBELS */
|
/** CONVERT FACTOR TO DECIBELS */
|
||||||
long fp_decibels(unsigned long factor, unsigned int fracbits)
|
long fp_decibels(unsigned long factor, unsigned int fracbits)
|
||||||
{
|
{
|
||||||
/* decibels = 20 * log10(factor) */
|
/* decibels = 20 * log10(factor) */
|
||||||
return FP_MUL_FRAC((20L << fracbits), fp_log10(factor, fracbits));
|
return FP_MUL_FRAC((20L << fracbits), fp_log10(factor, fracbits));
|
||||||
}
|
}
|
||||||
#endif /* unused code */
|
|
||||||
|
|
||||||
|
|
||||||
/** CONVERT DECIBELS TO FACTOR */
|
/** CONVERT DECIBELS TO FACTOR */
|
||||||
long fp_factor(long decibels, unsigned int fracbits)
|
long fp_factor(long decibels, unsigned int fracbits)
|
||||||
|
@ -469,4 +455,3 @@ long fp_factor(long decibels, unsigned int fracbits)
|
||||||
/* factor = 10 ^ (decibels / 20) */
|
/* factor = 10 ^ (decibels / 20) */
|
||||||
return fp_exp10(FP_DIV_FRAC(decibels, (20L << fracbits)), fracbits);
|
return fp_exp10(FP_DIV_FRAC(decibels, (20L << fracbits)), fracbits);
|
||||||
}
|
}
|
||||||
#endif /* !PLUGIN and !CODEC */
|
|
|
@ -107,10 +107,19 @@ unsigned long isqrt(unsigned long x);
|
||||||
*/
|
*/
|
||||||
long fp_exp10(long x, unsigned int fracbits);
|
long fp_exp10(long x, unsigned int fracbits);
|
||||||
|
|
||||||
|
/** FIXED POINT LOG10
|
||||||
|
* Return log10(x) as FP integer. Argument is FP integer.
|
||||||
|
*/
|
||||||
|
long fp_log10(long n, unsigned int fracbits);
|
||||||
|
|
||||||
/* fracbits in range 12 - 22 work well. Higher is better for
|
/* fracbits in range 12 - 22 work well. Higher is better for
|
||||||
* calculating dB, lower is better for calculating factor.
|
* calculating dB, lower is better for calculating factor.
|
||||||
*/
|
*/
|
||||||
/* long fp_decibels(unsigned long factor, unsigned int fracbits); */
|
|
||||||
|
/** CONVERT FACTOR TO DECIBELS */
|
||||||
|
long fp_decibels(unsigned long factor, unsigned int fracbits);
|
||||||
|
|
||||||
|
/** CONVERT DECIBELS TO FACTOR */
|
||||||
long fp_factor(long decibels, unsigned int fracbits);
|
long fp_factor(long decibels, unsigned int fracbits);
|
||||||
|
|
||||||
#endif /* FIXEDPOINT_H */
|
#endif /* FIXEDPOINT_H */
|
36
lib/fixedpoint/fixedpoint.make
Normal file
36
lib/fixedpoint/fixedpoint.make
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# __________ __ ___.
|
||||||
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
# \/ \/ \/ \/ \/
|
||||||
|
|
||||||
|
FIXEDPOINTLIB := $(BUILDDIR)/lib/libfixedpoint.a
|
||||||
|
FIXEDPOINTLIB_DIR := $(ROOTDIR)/lib/fixedpoint
|
||||||
|
FIXEDPOINTLIB_SRC := $(FIXEDPOINTLIB_DIR)/fixedpoint.c
|
||||||
|
FIXEDPOINTLIB_OBJ := $(call c2obj, $(FIXEDPOINTLIB_SRC))
|
||||||
|
|
||||||
|
INCLUDES += -I$(FIXEDPOINTLIB_DIR)
|
||||||
|
OTHER_SRC += $(FIXEDPOINTLIB_SRC)
|
||||||
|
|
||||||
|
# If not SOFTWARECODECS, then only plugins depend upon us
|
||||||
|
ifdef SOFTWARECODECS
|
||||||
|
CORE_LIBS += $(FIXEDPOINTLIB)
|
||||||
|
CORE_GCSECTIONS := yes
|
||||||
|
endif
|
||||||
|
|
||||||
|
FIXEDPOINTLIB_FLAGS := $(CFLAGS)
|
||||||
|
|
||||||
|
# Do not use '-ffunction-sections' and '-fdata-sections' when compiling sdl-sim
|
||||||
|
ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim)
|
||||||
|
FIXEDPOINTLIB_FLAGS += -ffunction-sections -fdata-sections
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(FIXEDPOINTLIB_OBJ): $(FIXEDPOINTLIB_SRC)
|
||||||
|
$(SILENT)mkdir -p $(dir $@)
|
||||||
|
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
|
||||||
|
$(FIXEDPOINTLIB_FLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
$(FIXEDPOINTLIB): $(FIXEDPOINTLIB_OBJ)
|
||||||
|
$(SILENT)$(shell rm -f $@)
|
||||||
|
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
|
|
@ -23,7 +23,7 @@
|
||||||
#include "codeclib.h"
|
#include "codeclib.h"
|
||||||
#include "inttypes.h"
|
#include "inttypes.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "lib/fixedpoint.h"
|
#include "fixedpoint.h"
|
||||||
|
|
||||||
CODEC_HEADER
|
CODEC_HEADER
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ include $(RBCODECLIB_DIR)/codecs/lib/libcodec.make
|
||||||
OTHER_INC += -I$(RBCODECLIB_DIR)/codecs/lib
|
OTHER_INC += -I$(RBCODECLIB_DIR)/codecs/lib
|
||||||
|
|
||||||
# extra libraries
|
# extra libraries
|
||||||
CODEC_LIBS := $(CODECLIB)
|
CODEC_LIBS := $(CODECLIB) $(FIXEDPOINTLIB)
|
||||||
|
|
||||||
# the codec libraries
|
# the codec libraries
|
||||||
include $(RBCODECLIB_DIR)/codecs/demac/libdemac.make
|
include $(RBCODECLIB_DIR)/codecs/demac/libdemac.make
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#if CONFIG_CODEC == SWCODEC /* software codec platforms */
|
#if CONFIG_CODEC == SWCODEC /* software codec platforms */
|
||||||
codeclib.c
|
codeclib.c
|
||||||
fixedpoint.c
|
|
||||||
ffmpeg_bitstream.c
|
ffmpeg_bitstream.c
|
||||||
|
|
||||||
mdct_lookup.c
|
mdct_lookup.c
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
#include "../../../apps/fixedpoint.c"
|
|
|
@ -1,26 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* __________ __ ___.
|
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
||||||
* \/ \/ \/ \/ \/
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 Jens Arnold
|
|
||||||
*
|
|
||||||
* Fixed point library for codecs
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
||||||
* KIND, either express or implied.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
#ifndef _FIXEDPOINT_H_CODECS
|
|
||||||
#define _FIXEDPOINT_H_CODECS
|
|
||||||
#include "../../../../firmware/include/fixedpoint.h"
|
|
||||||
#endif /* _FIXEDPOINT_H_CODECS */
|
|
|
@ -15,7 +15,9 @@ RBCODECLIB := $(BUILDDIR)/lib/librbcodec.a
|
||||||
INCLUDES += -I$(RBCODECLIB_DIR) -I$(RBCODECLIB_DIR)/codecs \
|
INCLUDES += -I$(RBCODECLIB_DIR) -I$(RBCODECLIB_DIR)/codecs \
|
||||||
-I$(RBCODECLIB_DIR)/dsp -I$(RBCODECLIB_DIR)/metadata
|
-I$(RBCODECLIB_DIR)/dsp -I$(RBCODECLIB_DIR)/metadata
|
||||||
OTHER_SRC += $(RBCODECLIB_SRC)
|
OTHER_SRC += $(RBCODECLIB_SRC)
|
||||||
CORE_LIBS += $(RBCODECLIB)
|
|
||||||
|
# libfixedpoint must go after in lib list but be made first
|
||||||
|
CORE_LIBS := $(RBCODECLIB) $(CORE_LIBS)
|
||||||
|
|
||||||
$(RBCODECLIB): $(RBCODECLIB_OBJ)
|
$(RBCODECLIB): $(RBCODECLIB_OBJ)
|
||||||
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
|
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
|
||||||
|
|
|
@ -2,5 +2,4 @@ warble.c
|
||||||
../../../firmware/common/strlcpy.c
|
../../../firmware/common/strlcpy.c
|
||||||
../../../firmware/common/unicode.c
|
../../../firmware/common/unicode.c
|
||||||
../../../firmware/common/structec.c
|
../../../firmware/common/structec.c
|
||||||
../../../apps/fixedpoint.c
|
|
||||||
../../../uisimulator/common/io.c
|
../../../uisimulator/common/io.c
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
database.c
|
database.c
|
||||||
../../apps/fixedpoint.c
|
|
||||||
../../apps/misc.c
|
../../apps/misc.c
|
||||||
../../apps/tagcache.c
|
../../apps/tagcache.c
|
||||||
../../firmware/common/crc32.c
|
../../firmware/common/crc32.c
|
||||||
|
|
|
@ -36,9 +36,12 @@ INCLUDES += -I$(ROOTDIR)/apps/gui \
|
||||||
-I$(APPSDIR) \
|
-I$(APPSDIR) \
|
||||||
-I$(BUILDDIR)
|
-I$(BUILDDIR)
|
||||||
|
|
||||||
|
ifdef SOFTWARECODECS
|
||||||
|
OTHERLIBS := $(FIXEDPOINTLIB)
|
||||||
|
endif
|
||||||
|
|
||||||
.SECONDEXPANSION: # $$(OBJ) is not populated until after this
|
.SECONDEXPANSION: # $$(OBJ) is not populated until after this
|
||||||
|
|
||||||
$(BUILDDIR)/$(BINARY): $$(DATABASE_OBJ)
|
$(BUILDDIR)/$(BINARY): $$(DATABASE_OBJ) $(OTHERLIBS)
|
||||||
$(call PRINTS,LD $(BINARY))
|
$(call PRINTS,LD $(BINARY))
|
||||||
$(SILENT)$(HOSTCC) -o $@ $+
|
$(SILENT)$(HOSTCC) $(call a2lnk $(OTHERLIBS)) -o $@ $+
|
||||||
|
|
|
@ -17,6 +17,7 @@ INCLUDES = -I$(BUILDDIR) -I$(BUILDDIR)/lang $(TARGET_INC)
|
||||||
CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS)
|
CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS)
|
||||||
PPCFLAGS = $(filter-out -g -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix
|
PPCFLAGS = $(filter-out -g -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix
|
||||||
ASMFLAGS = -D__ASSEMBLER__ # work around gcc 3.4.x bug with -std=gnu99, only meant for .S files
|
ASMFLAGS = -D__ASSEMBLER__ # work around gcc 3.4.x bug with -std=gnu99, only meant for .S files
|
||||||
|
CORE_LDOPTS = $(GLOBAL_LDOPTS) # linker ops specifically for core build
|
||||||
|
|
||||||
TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \
|
TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \
|
||||||
$(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \
|
$(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \
|
||||||
|
@ -90,10 +91,15 @@ ifndef APP_TYPE
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq (,$(findstring bootloader,$(APPSDIR)))
|
||||||
|
ifeq (,$(findstring checkwps,$(APP_TYPE)))
|
||||||
|
include $(ROOTDIR)/lib/fixedpoint/fixedpoint.make
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(findstring bootloader,$(APPSDIR)))
|
ifneq (,$(findstring bootloader,$(APPSDIR)))
|
||||||
include $(APPSDIR)/bootloader.make
|
include $(APPSDIR)/bootloader.make
|
||||||
else ifneq (,$(findstring bootbox,$(APPSDIR)))
|
else ifneq (,$(findstring bootbox,$(APPSDIR)))
|
||||||
BOOTBOXLDOPTS = -Wl,--gc-sections
|
|
||||||
include $(APPSDIR)/bootbox.make
|
include $(APPSDIR)/bootbox.make
|
||||||
else ifneq (,$(findstring checkwps,$(APP_TYPE)))
|
else ifneq (,$(findstring checkwps,$(APP_TYPE)))
|
||||||
include $(APPSDIR)/checkwps.make
|
include $(APPSDIR)/checkwps.make
|
||||||
|
@ -104,10 +110,10 @@ else ifneq (,$(findstring warble,$(APP_TYPE)))
|
||||||
include $(ROOTDIR)/lib/rbcodec/test/warble.make
|
include $(ROOTDIR)/lib/rbcodec/test/warble.make
|
||||||
include $(ROOTDIR)/lib/tlsf/libtlsf.make
|
include $(ROOTDIR)/lib/tlsf/libtlsf.make
|
||||||
include $(ROOTDIR)/lib/rbcodec/rbcodec.make
|
include $(ROOTDIR)/lib/rbcodec/rbcodec.make
|
||||||
else
|
else # core
|
||||||
include $(APPSDIR)/apps.make
|
include $(APPSDIR)/apps.make
|
||||||
include $(ROOTDIR)/lib/rbcodec/rbcodec.make
|
|
||||||
include $(APPSDIR)/lang/lang.make
|
include $(APPSDIR)/lang/lang.make
|
||||||
|
include $(ROOTDIR)/lib/rbcodec/rbcodec.make
|
||||||
|
|
||||||
ifdef ENABLEDPLUGINS
|
ifdef ENABLEDPLUGINS
|
||||||
include $(APPSDIR)/plugins/bitmaps/pluginbitmaps.make
|
include $(APPSDIR)/plugins/bitmaps/pluginbitmaps.make
|
||||||
|
@ -132,6 +138,14 @@ else
|
||||||
|
|
||||||
endif # bootloader
|
endif # bootloader
|
||||||
|
|
||||||
|
# One or more subdir makefiles requested --gc-sections?
|
||||||
|
ifdef CORE_GCSECTIONS
|
||||||
|
# Do not use '--gc-sections' when compiling sdl-sim
|
||||||
|
ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim)
|
||||||
|
CORE_LDOPTS += -Wl,--gc-sections
|
||||||
|
endif
|
||||||
|
endif # CORE_GCSECTIONS
|
||||||
|
|
||||||
OBJ := $(SRC:.c=.o)
|
OBJ := $(SRC:.c=.o)
|
||||||
OBJ := $(OBJ:.S=.o)
|
OBJ := $(OBJ:.S=.o)
|
||||||
OBJ += $(BMP:.bmp=.o)
|
OBJ += $(BMP:.bmp=.o)
|
||||||
|
@ -205,16 +219,16 @@ $(BUILDDIR)/rockbox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LI
|
||||||
-L$(BUILDDIR)/firmware -lfirmware \
|
-L$(BUILDDIR)/firmware -lfirmware \
|
||||||
-L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
|
-L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
|
||||||
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
|
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
|
||||||
-lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \
|
-lgcc -T$(LINKRAM) \
|
||||||
-T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map
|
$(CORE_LDOPTS) -Wl,-Map,$(BUILDDIR)/rockbox.map
|
||||||
|
|
||||||
$(BUILDDIR)/rombox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LINKROM)
|
$(BUILDDIR)/rombox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LINKROM)
|
||||||
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
|
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
|
||||||
-L$(BUILDDIR)/firmware -lfirmware \
|
-L$(BUILDDIR)/firmware -lfirmware \
|
||||||
-L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
|
-L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
|
||||||
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
|
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
|
||||||
-lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \
|
-lgcc -T$(LINKROM) \
|
||||||
-T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map
|
$(CORE_LDOPTS) -Wl,-Map,$(BUILDDIR)/rombox.map
|
||||||
|
|
||||||
$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf
|
$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf
|
||||||
$(call PRINTS,OC $(@F))$(call objcopy,$<,$@)
|
$(call PRINTS,OC $(@F))$(call objcopy,$<,$@)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue