summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/codecs.make58
-rw-r--r--apps/codecs/demac/libdemac.make12
-rw-r--r--apps/codecs/liba52/liba52.make13
-rw-r--r--apps/codecs/libalac/libalac.make12
-rw-r--r--apps/codecs/libasap/libasap.make7
-rw-r--r--apps/codecs/libasf/libasf.make14
-rw-r--r--apps/codecs/libatrac/libatrac.make13
-rw-r--r--apps/codecs/libcook/libcook.make13
-rw-r--r--apps/codecs/libfaad/libfaad.make8
-rw-r--r--apps/codecs/libffmpegFLAC/libffmpegFLAC.make8
-rw-r--r--apps/codecs/libgme/libay.make11
-rw-r--r--apps/codecs/libgme/libgbs.make11
-rw-r--r--apps/codecs/libgme/libhes.make11
-rw-r--r--apps/codecs/libgme/libkss.make11
-rw-r--r--apps/codecs/libgme/libnsf.make11
-rw-r--r--apps/codecs/libgme/libsgc.make11
-rw-r--r--apps/codecs/libgme/libvgm.make11
-rw-r--r--apps/codecs/libm4a/libm4a.make7
-rw-r--r--apps/codecs/libmusepack/libmusepack.make8
-rw-r--r--apps/codecs/libpcm/libpcm.make7
-rw-r--r--apps/codecs/librm/librm.make7
-rw-r--r--apps/codecs/libspc/libspc.make7
-rw-r--r--apps/codecs/libtremor/libtremor.make13
-rw-r--r--apps/codecs/libtta/libtta.make11
-rw-r--r--apps/codecs/libwavpack/libwavpack.make13
-rw-r--r--apps/codecs/libwma/libwma.make13
-rw-r--r--apps/codecs/libwmapro/libwmapro.make12
27 files changed, 58 insertions, 275 deletions
diff --git a/apps/codecs/codecs.make b/apps/codecs/codecs.make
index 19ff60ba3a..1644ff0e91 100644
--- a/apps/codecs/codecs.make
+++ b/apps/codecs/codecs.make
@@ -55,6 +55,64 @@ include $(APPSDIR)/codecs/libgme/libkss.make
CODECFLAGS = $(CFLAGS) -fstrict-aliasing -I$(APPSDIR)/codecs \
-I$(APPSDIR)/codecs/lib -DCODEC
+# set CODECFLAGS per codec lib, since gcc takes the last -Ox and the last
+# in a -ffoo -fno-foo pair, there is no need to filter them out
+$(A52LIB) : CODECFLAGS += -O1
+$(ALACLIB) : CODECFLAGS += -O1
+$(ASAPLIB) : CODECFLAGS += -O1
+$(ASFLIB) : CODECFLAGS += -O2
+$(ATRACLIB) : CODECFLAGS += -O1
+$(AYLIB) : CODECFLAGS += -fno-strict-aliasing -O2
+$(COOKLIB): CODECFLAGS += -O1
+$(DEMACLIB) : CODECFLAGS += -O3
+$(FAADLIB) : CODECFLAGS += -O2
+$(FFMPEGFLACLIB) : CODECFLAGS += -O2
+$(GBSLIB) : CODECFLAGS += -fno-strict-aliasing -O2
+$(HESLIB) : CODECFLAGS += -fno-strict-aliasing -O2
+$(KSSLIB) : CODECFLAGS += -fno-strict-aliasing -O2
+$(M4ALIB) : CODECFLAGS += -O3
+$(MUSEPACKLIB) : CODECFLAGS += -O1
+$(NSFLIB) : CODECFLAGS += -fno-strict-aliasing -O2
+$(PCMSLIB) : CODECFLAGS += -O1
+$(RMLIB) : CODECFLAGS += -O3
+$(SGCLIB) : CODECFLAGS += -fno-strict-aliasing -O2
+$(SPCLIB) : CODECFLAGS += -fno-strict-aliasing -O1
+$(TREMORLIB) : CODECFLAGS += -O2
+$(TTALIB) : CODECFLAGS += -O2
+$(VGMLIB) : CODECFLAGS += -fno-strict-aliasing -O2
+$(WAVPACKLIB) : CODECFLAGS += -O1
+$(WMALIB) : CODECFLAGS += -O2
+$(WMAPROLIB) : CODECFLAGS += -O1
+$(WMAVOICELIB) : CODECFLAGS += -O1
+
+# fine-tuning of CODECFLAGS per cpu arch
+ifeq ($(CPU),arm)
+ # redo per arm generation
+ $(ALACLIB) : CODECFLAGS += -O2
+ $(AYLIB) : CODECFLAGS += -fno-strict-aliasing -O3
+ $(GBSLIB) : CODECFLAGS += -fno-strict-aliasing -O3
+ $(HESLIB) : CODECFLAGS += -fno-strict-aliasing -O3
+ $(KSSLIB) : CODECFLAGS += -fno-strict-aliasing -O3
+ $(NSFLIB) : CODECFLAGS += -fno-strict-aliasing -O3
+ $(SGCLIB) : CODECFLAGS += -fno-strict-aliasing -O3
+ $(VGMLIB) : CODECFLAGS += -fno-strict-aliasing -O3
+ $(WAVPACKLIB) : CODECFLAGS += -O3
+else ifeq ($(CPU),coldfire)
+ $(A52LIB) : CODECFLAGS += -O2
+ $(ASFLIB) : CODECFLAGS += -O3
+ $(ATRACLIB) : CODECFLAGS += -O2
+ $(COOKLIB): CODECFLAGS += -O2
+ $(DEMACLIB) : CODECFLAGS += -O2
+ $(TREMORLIB) : CODECFLAGS += -O3
+ $(WMAPROLIB) : CODECFLAGS += -O3
+ $(WMAVOICELIB) : CODECFLAGS += -O2
+endif
+
+ifeq ($(MEMORYSIZE),2)
+ $(ASFLIB) : CODECFLAGS += -Os
+ $(WMALIB) : CODECFLAGS += -Os
+endif
+
ifndef APP_TYPE
CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h
CODEC_LDS := $(APPSDIR)/plugins/plugin.lds # codecs and plugins use same file
diff --git a/apps/codecs/demac/libdemac.make b/apps/codecs/demac/libdemac.make
index bf0f821de3..4614344849 100644
--- a/apps/codecs/demac/libdemac.make
+++ b/apps/codecs/demac/libdemac.make
@@ -26,14 +26,6 @@ $(DEMACLIB): $(DEMACLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-DEMACFLAGS = $(filter-out -O%,$(CODECFLAGS))
-
-ifeq ($(CPU),coldfire)
- DEMACFLAGS += -O2
-else
- DEMACFLAGS += -O3
-endif
-
$(CODECDIR)/ape_free_iram.h: $(CODECDIR)/ape-pre.map
$(call PRINTS,GEN $(@F))perl -an \
-e 'if(/^PLUGIN_IRAM/){$$istart=hex($$F[1]);$$ilen=hex($$F[2])}' \
@@ -41,7 +33,3 @@ $(CODECDIR)/ape_free_iram.h: $(CODECDIR)/ape-pre.map
-e '}{if($$ilen){print"#define FREE_IRAM ".($$ilen+$$istart-$$iend)."\n";}' \
$(CODECDIR)/ape-pre.map \
> $@
-
-$(CODECDIR)/demac/%.o: $(ROOTDIR)/apps/codecs/demac/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(DEMACFLAGS) -c $< -o $@
diff --git a/apps/codecs/liba52/liba52.make b/apps/codecs/liba52/liba52.make
index c0fc7c8885..79b2eb222e 100644
--- a/apps/codecs/liba52/liba52.make
+++ b/apps/codecs/liba52/liba52.make
@@ -16,16 +16,3 @@ OTHER_SRC += $(A52LIB_SRC)
$(A52LIB): $(A52LIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-A52FLAGS = -I$(APPSDIR)/codecs/liba52 $(filter-out -O%,$(CODECFLAGS))
-
-ifeq ($(CPU),coldfire)
- A52FLAGS += -O2
-else
- A52FLAGS += -O1
-endif
-
-$(CODECDIR)/liba52/%.o: $(ROOTDIR)/apps/codecs/liba52/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(A52FLAGS) -c $< -o $@
-
diff --git a/apps/codecs/libalac/libalac.make b/apps/codecs/libalac/libalac.make
index b3b24cd2ee..a0300554c3 100644
--- a/apps/codecs/libalac/libalac.make
+++ b/apps/codecs/libalac/libalac.make
@@ -16,15 +16,3 @@ OTHER_SRC += $(ALACLIB_SRC)
$(ALACLIB): $(ALACLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-ALACFLAGS = $(filter-out -O%,$(CODECFLAGS))
-
-ifeq ($(CPU),arm)
- ALACFLAGS += -O2
-else
- ALACFLAGS += -O1
-endif
-
-$(CODECDIR)/libalac/%.o: $(ROOTDIR)/apps/codecs/libalac/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ALACFLAGS) -c $< -o $@
diff --git a/apps/codecs/libasap/libasap.make b/apps/codecs/libasap/libasap.make
index 8054648f3d..d904c14257 100644
--- a/apps/codecs/libasap/libasap.make
+++ b/apps/codecs/libasap/libasap.make
@@ -16,10 +16,3 @@ OTHER_SRC += $(ASAPLIB_SRC)
$(ASAPLIB): $(ASAPLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-ASAPFLAGS = $(filter-out -O%,$(CODECFLAGS))
-ASAPFLAGS += -O1
-
-$(CODECDIR)/libasap/%.o: $(ROOTDIR)/apps/codecs/libasap/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ASAPFLAGS) -c $< -o $@
diff --git a/apps/codecs/libasf/libasf.make b/apps/codecs/libasf/libasf.make
index 52e338eb64..143d83f549 100644
--- a/apps/codecs/libasf/libasf.make
+++ b/apps/codecs/libasf/libasf.make
@@ -16,17 +16,3 @@ OTHER_SRC += $(ASFLIB_SRC)
$(ASFLIB): $(ASFLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-ASFFLAGS = $(filter-out -O%,$(CODECFLAGS))
-
-ifeq ($(MEMORYSIZE),2)
- ASFFLAGS += -Os
-else ifeq ($(CPU),coldfire)
- ASFFLAGS += -O3
-else
- ASFFLAGS += -O2
-endif
-
-$(CODECDIR)/libasf/%.o: $(ROOTDIR)/apps/codecs/libasf/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ASFFLAGS) -c $< -o $@
diff --git a/apps/codecs/libatrac/libatrac.make b/apps/codecs/libatrac/libatrac.make
index 980f5873f6..01606e1f15 100644
--- a/apps/codecs/libatrac/libatrac.make
+++ b/apps/codecs/libatrac/libatrac.make
@@ -16,16 +16,3 @@ OTHER_SRC += $(ATRACLIB_SRC)
$(ATRACLIB): $(ATRACLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-ATRACFLAGS = -I$(APPSDIR)/codecs/libatrac $(filter-out -O%,$(CODECFLAGS))
-# not tuned for arm
-ifeq ($(CPU),coldfire)
- ATRACFLAGS += -O2
-else
- ATRACFLAGS += -O1
-endif
-
-$(CODECDIR)/libatrac/%.o: $(ROOTDIR)/apps/codecs/libatrac/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ATRACFLAGS) -c $< -o $@
-
diff --git a/apps/codecs/libcook/libcook.make b/apps/codecs/libcook/libcook.make
index 6a2817e07c..c3f1c10319 100644
--- a/apps/codecs/libcook/libcook.make
+++ b/apps/codecs/libcook/libcook.make
@@ -16,16 +16,3 @@ OTHER_SRC += $(COOKLIB_SRC)
$(COOKLIB): $(COOKLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-COOKFLAGS = -I$(APPSDIR)/codecs/libcook $(filter-out -O%,$(CODECFLAGS))
-
-ifeq ($(CPU),coldfire)
- COOKFLAGS += -O2
-else
- COOKFLAGS += -O1
-endif
-
-$(CODECDIR)/libcook/%.o: $(ROOTDIR)/apps/codecs/libcook/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(COOKFLAGS) -c $< -o $@
-
diff --git a/apps/codecs/libfaad/libfaad.make b/apps/codecs/libfaad/libfaad.make
index a52e6f354a..4f5fbc322c 100644
--- a/apps/codecs/libfaad/libfaad.make
+++ b/apps/codecs/libfaad/libfaad.make
@@ -17,11 +17,3 @@ OTHER_INC += -I$(APPSDIR)/codecs/libfaad
$(FAADLIB): $(FAADLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-# libfaad is faster on ARM with -O2, use -O1 for other CPUs
-FAADFLAGS = -I$(APPSDIR)/codecs/libfaad $(filter-out -O%,$(CODECFLAGS))
-FAADFLAGS += -O2
-
-$(CODECDIR)/libfaad/%.o: $(ROOTDIR)/apps/codecs/libfaad/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(FAADFLAGS) -c $< -o $@
diff --git a/apps/codecs/libffmpegFLAC/libffmpegFLAC.make b/apps/codecs/libffmpegFLAC/libffmpegFLAC.make
index 912538530a..734f3d2d8e 100644
--- a/apps/codecs/libffmpegFLAC/libffmpegFLAC.make
+++ b/apps/codecs/libffmpegFLAC/libffmpegFLAC.make
@@ -13,14 +13,6 @@ FFMPEGFLACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libffmpegFLAC/SOURCES)
FFMPEGFLACLIB_OBJ := $(call c2obj, $(FFMPEGFLACLIB_SRC))
OTHER_SRC += $(FFMPEGFLACLIB_SRC)
-# libffmpegFLAC is faster on ARM-targets with -O2 than -O1
-FFMPEGFLACFLAGS = -I$(APPSDIR)/codecs/libffmpegFLAC $(filter-out -O%,$(CODECFLAGS))
-FFMPEGFLACFLAGS += -O2
-
$(FFMPEGFLACLIB): $(FFMPEGFLACLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-$(CODECDIR)/libffmpegFLAC/%.o: $(ROOTDIR)/apps/codecs/libffmpegFLAC/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(FFMPEGFLACFLAGS) -c $< -o $@
diff --git a/apps/codecs/libgme/libay.make b/apps/codecs/libgme/libay.make
index 5eee8ac1e4..0b5691c1f1 100644
--- a/apps/codecs/libgme/libay.make
+++ b/apps/codecs/libgme/libay.make
@@ -8,14 +8,3 @@ OTHER_SRC += $(AYLIB_SRC)
$(AYLIB): $(AYLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-AYFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing -DGME_AY_TYPE
-ifeq ($(CPU),arm)
- AYFLAGS += -O3
-else
- AYFLAGS += -O2
-endif
-
-$(CODECDIR)/libgme/%.o: $(ROOTDIR)/apps/codecs/libgme/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(AYFLAGS) -c $< -o $@
diff --git a/apps/codecs/libgme/libgbs.make b/apps/codecs/libgme/libgbs.make
index cf6ff01274..6661a4994f 100644
--- a/apps/codecs/libgme/libgbs.make
+++ b/apps/codecs/libgme/libgbs.make
@@ -8,14 +8,3 @@ OTHER_SRC += $(GBSLIB_SRC)
$(GBSLIB): $(GBSLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-GBSFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing -DGME_GBS_TYPE
-ifeq ($(CPU),arm)
- GBSFLAGS += -O3
-else
- GBSFLAGS += -O2
-endif
-
-$(CODECDIR)/libgme/%.o: $(ROOTDIR)/apps/codecs/libgme/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(GBSFLAGS) -c $< -o $@
diff --git a/apps/codecs/libgme/libhes.make b/apps/codecs/libgme/libhes.make
index e0018565fb..81e29f8c5a 100644
--- a/apps/codecs/libgme/libhes.make
+++ b/apps/codecs/libgme/libhes.make
@@ -8,14 +8,3 @@ OTHER_SRC += $(HESLIB_SRC)
$(HESLIB): $(HESLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-HESFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing -DGME_HES_TYPE
-ifeq ($(CPU),arm)
- HESFLAGS += -O3
-else
- HESFLAGS += -O2
-endif
-
-$(CODECDIR)/libgme/%.o: $(ROOTDIR)/apps/codecs/libgme/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(HESFLAGS) -c $< -o $@
diff --git a/apps/codecs/libgme/libkss.make b/apps/codecs/libgme/libkss.make
index 0e2dd54bc2..c93d8d169f 100644
--- a/apps/codecs/libgme/libkss.make
+++ b/apps/codecs/libgme/libkss.make
@@ -8,14 +8,3 @@ OTHER_SRC += $(KSSLIB_SRC)
$(KSSLIB): $(KSSLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-KSSFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing -DGME_KSS_TYPE
-ifeq ($(CPU),arm)
- KSSFLAGS += -O3
-else
- KSSFLAGS += -O2
-endif
-
-$(CODECDIR)/libgme/%.o: $(ROOTDIR)/apps/codecs/libgme/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(KSSFLAGS) -c $< -o $@
diff --git a/apps/codecs/libgme/libnsf.make b/apps/codecs/libgme/libnsf.make
index 8b9df7526f..9ab171711a 100644
--- a/apps/codecs/libgme/libnsf.make
+++ b/apps/codecs/libgme/libnsf.make
@@ -8,14 +8,3 @@ OTHER_SRC += $(NSFLIB_SRC)
$(NSFLIB): $(NSFLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-NSFFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing -DGME_NSF_TYPE
-ifeq ($(CPU),arm)
- NSFFLAGS += -O3
-else
- NSFFLAGS += -O2
-endif
-
-$(CODECDIR)/libgme/%.o: $(ROOTDIR)/apps/codecs/libgme/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(NSFFLAGS) -c $< -o $@
diff --git a/apps/codecs/libgme/libsgc.make b/apps/codecs/libgme/libsgc.make
index 0defe788c6..ddaec96081 100644
--- a/apps/codecs/libgme/libsgc.make
+++ b/apps/codecs/libgme/libsgc.make
@@ -8,14 +8,3 @@ OTHER_SRC += $(SGCLIB_SRC)
$(SGCLIB): $(SGCLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-SGCFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing -DGME_SGC_TYPE
-ifeq ($(CPU),arm)
- SGCFLAGS += -O3
-else
- SGCFLAGS += -O2
-endif
-
-$(CODECDIR)/libgme/%.o: $(ROOTDIR)/apps/codecs/libgme/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SGCFLAGS) -c $< -o $@
diff --git a/apps/codecs/libgme/libvgm.make b/apps/codecs/libgme/libvgm.make
index f0e7cbb598..cc492d5143 100644
--- a/apps/codecs/libgme/libvgm.make
+++ b/apps/codecs/libgme/libvgm.make
@@ -8,14 +8,3 @@ OTHER_SRC += $(VGMLIB_SRC)
$(VGMLIB): $(VGMLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-VGMFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing -DGME_VGM_TYPE
-ifeq ($(CPU),arm)
- VGMFLAGS += -O3
-else
- VGMFLAGS += -O2
-endif
-
-$(CODECDIR)/libgme/%.o: $(ROOTDIR)/apps/codecs/libgme/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VGMFLAGS) -c $< -o $@
diff --git a/apps/codecs/libm4a/libm4a.make b/apps/codecs/libm4a/libm4a.make
index 8b11fce32d..9a8a4cb74a 100644
--- a/apps/codecs/libm4a/libm4a.make
+++ b/apps/codecs/libm4a/libm4a.make
@@ -16,10 +16,3 @@ OTHER_SRC += $(M4ALIB_SRC)
$(M4ALIB): $(M4ALIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-M4AFLAGS = $(filter-out -O%,$(CODECFLAGS))
-M4AFLAGS += -O3
-
-$(CODECDIR)/libm4a/%.o: $(ROOTDIR)/apps/codecs/libm4a/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(M4AFLAGS) -c $< -o $@
diff --git a/apps/codecs/libmusepack/libmusepack.make b/apps/codecs/libmusepack/libmusepack.make
index 3a4127e9c4..ac201c4552 100644
--- a/apps/codecs/libmusepack/libmusepack.make
+++ b/apps/codecs/libmusepack/libmusepack.make
@@ -16,11 +16,3 @@ OTHER_SRC += $(MUSEPACKLIB_SRC)
$(MUSEPACKLIB): $(MUSEPACKLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-# libmusepack is faster on ARM-targets with -O1 than -O2
-MUSEPACKFLAGS = $(filter-out -O%,$(CODECFLAGS)) -I$(APPSDIR)/codecs/libmusepack
-MUSEPACKFLAGS += -O1
-
-$(CODECDIR)/libmusepack/%.o: $(ROOTDIR)/apps/codecs/libmusepack/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(MUSEPACKFLAGS) -c $< -o $@
diff --git a/apps/codecs/libpcm/libpcm.make b/apps/codecs/libpcm/libpcm.make
index ce7b6b5083..1188bde1b0 100644
--- a/apps/codecs/libpcm/libpcm.make
+++ b/apps/codecs/libpcm/libpcm.make
@@ -16,10 +16,3 @@ OTHER_SRC += $(PCMSLIB_SRC)
$(PCMSLIB): $(PCMSLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-PCMSFLAGS = $(filter-out -O%,$(CODECFLAGS))
-PCMSFLAGS += -O1
-
-$(CODECDIR)/libpcm/%.o: $(ROOTDIR)/apps/codecs/libpcm/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(PCMSFLAGS) -c $< -o $@
diff --git a/apps/codecs/librm/librm.make b/apps/codecs/librm/librm.make
index 99d89cdab7..7f2c34c9ac 100644
--- a/apps/codecs/librm/librm.make
+++ b/apps/codecs/librm/librm.make
@@ -16,10 +16,3 @@ OTHER_SRC += $(RMLIB_SRC)
$(RMLIB): $(RMLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-RMFLAGS = $(filter-out -O%,$(CODECFLAGS))
-RMFLAGS += -O3
-
-$(CODECDIR)/librm/%.o: $(ROOTDIR)/apps/codecs/librm/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(RMFLAGS) -c $< -o $@
diff --git a/apps/codecs/libspc/libspc.make b/apps/codecs/libspc/libspc.make
index 63360af1b1..8cf04dc5c8 100644
--- a/apps/codecs/libspc/libspc.make
+++ b/apps/codecs/libspc/libspc.make
@@ -16,10 +16,3 @@ OTHER_SRC += $(SPCLIB_SRC)
$(SPCLIB): $(SPCLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-SPCFLAGS = $(filter-out -O%,$(CODECFLAGS)) -fno-strict-aliasing
-SPCFLAGS += -O1
-
-$(CODECDIR)/libspc/%.o: $(ROOTDIR)/apps/codecs/libspc/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPCFLAGS) -c $< -o $@
diff --git a/apps/codecs/libtremor/libtremor.make b/apps/codecs/libtremor/libtremor.make
index e6816aa604..586c703346 100644
--- a/apps/codecs/libtremor/libtremor.make
+++ b/apps/codecs/libtremor/libtremor.make
@@ -16,16 +16,3 @@ OTHER_SRC += $(TREMORLIB_SRC)
$(TREMORLIB): $(TREMORLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-TREMORFLAGS = -I$(APPSDIR)/codecs/libtremor $(filter-out -O%,$(CODECFLAGS))
-
-# Tremor is slightly faster on coldfire with -O3
-ifeq ($(CPU),coldfire)
- TREMORFLAGS += -O3
-else
- TREMORFLAGS += -O2
-endif
-
-$(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TREMORFLAGS) -c $< -o $@
diff --git a/apps/codecs/libtta/libtta.make b/apps/codecs/libtta/libtta.make
index 7bd953e371..f8b7c650b2 100644
--- a/apps/codecs/libtta/libtta.make
+++ b/apps/codecs/libtta/libtta.make
@@ -16,14 +16,3 @@ OTHER_SRC += $(TTALIB_SRC)
$(TTALIB): $(TTALIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-TTAFLAGS = $(filter-out -O%,$(CODECFLAGS))
-TTAFLAGS += -O2
-
-$(CODECDIR)/libtta/%.o: $(ROOTDIR)/apps/codecs/libtta/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TTAFLAGS) -c $< -o $@
-
-$(CODECDIR)/libtta/%.o: $(ROOTDIR)/apps/codecs/libtta/%.S
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TTAFLAGS) $(ASMFLAGS) -c $< -o $@
diff --git a/apps/codecs/libwavpack/libwavpack.make b/apps/codecs/libwavpack/libwavpack.make
index 61430b55da..a2e5377418 100644
--- a/apps/codecs/libwavpack/libwavpack.make
+++ b/apps/codecs/libwavpack/libwavpack.make
@@ -13,19 +13,6 @@ WAVPACKLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libwavpack/SOURCES)
WAVPACKLIB_OBJ := $(call c2obj, $(WAVPACKLIB_SRC))
OTHER_SRC += $(WAVPACKLIB_SRC)
-WAVPACKFLAGS = -I$(APPSDIR)/codecs/libwavpack $(filter-out -O%,$(CODECFLAGS))
-
-ifeq ($(CPU),arm)
- WAVPACKFLAGS += -O3
-else
- WAVPACKFLAGS += -O1
-endif
-
-
$(WAVPACKLIB): $(WAVPACKLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-$(CODECDIR)/libwavpack/%.o: $(ROOTDIR)/apps/codecs/libwavpack/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(WAVPACKFLAGS) -c $< -o $@
diff --git a/apps/codecs/libwma/libwma.make b/apps/codecs/libwma/libwma.make
index 66b315eca0..71c4cdc626 100644
--- a/apps/codecs/libwma/libwma.make
+++ b/apps/codecs/libwma/libwma.make
@@ -16,16 +16,3 @@ OTHER_SRC += $(WMALIB_SRC)
$(WMALIB): $(WMALIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-WMAFLAGS = -I$(APPSDIR)/codecs/libwma $(filter-out -O%,$(CODECFLAGS))
-
-ifeq ($(MEMORYSIZE),2)
- WMAFLAGS += -Os
-else
- WMAFLAGS += -O2
-endif
-
-$(CODECDIR)/libwma/%.o: $(ROOTDIR)/apps/codecs/libwma/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(WMAFLAGS) -c $< -o $@
-
diff --git a/apps/codecs/libwmapro/libwmapro.make b/apps/codecs/libwmapro/libwmapro.make
index 4dc52fa15b..9177eafb20 100644
--- a/apps/codecs/libwmapro/libwmapro.make
+++ b/apps/codecs/libwmapro/libwmapro.make
@@ -16,15 +16,3 @@ OTHER_SRC += $(WMAPROLIB_SRC)
$(WMAPROLIB): $(WMAPROLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
-
-WMAPROFLAGS = -I$(APPSDIR)/codecs/libwmapro $(filter-out -O%,$(CODECFLAGS))
-
-ifeq ($(CPU),coldfire)
- WMAPROFLAGS += -O3
-else
- WMAPROFLAGS += -O1
-endif
-
-$(CODECDIR)/libwmapro/%.o: $(ROOTDIR)/apps/codecs/libwmapro/%.c
- $(SILENT)mkdir -p $(dir $@)
- $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(WMAPROFLAGS) -c $< -o $@