From 1b0d1daf38f00410f062556aa2635a1886ec0b61 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Mon, 5 Dec 2005 19:32:13 +0000 Subject: [PATCH] Codec makefile cleanup: remove redundant things, don't generate dependency files when cleaning. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8154 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/Tremor/Makefile | 10 +++------- apps/codecs/liba52/Makefile | 13 +++++-------- apps/codecs/libalac/Makefile | 11 ++++------- apps/codecs/libfaad/Makefile | 13 +++++-------- apps/codecs/libffmpegFLAC/Makefile | 11 ++++------- apps/codecs/libm4a/Makefile | 11 ++++------- apps/codecs/libmad/Makefile | 12 +++++------- apps/codecs/libmusepack/Makefile | 12 ++++-------- apps/codecs/libwavpack/Makefile | 13 +++++-------- 9 files changed, 39 insertions(+), 67 deletions(-) diff --git a/apps/codecs/Tremor/Makefile b/apps/codecs/Tremor/Makefile index 4eadd24a10..7fd5de852b 100644 --- a/apps/codecs/Tremor/Makefile +++ b/apps/codecs/Tremor/Makefile @@ -16,7 +16,7 @@ endif TREMOROPTS = -O2 CFLAGS = $(GCCOPTS) $(TREMOROPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ --DMEM=${MEMORYSIZE} + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -27,22 +27,18 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DEPFILE = $(OBJDIR)/dep-Tremor DIRS = -OUTPUT = $(BUILDDIR)/libTremor.a - all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" @$(AR) ruv $@ $+ >/dev/null 2>&1 -$(OBJDIR)/%.o: $(APPSDIR)/codecs/Tremor/%.c - @echo "(Tremor) CC "`basename $<` - @$(CC) -c $(CFLAGS) -I$(APPSDIR)/codecs/Tremor/ $< -o $@ - include $(TOOLSDIR)/make.inc clean: @echo "cleaning Tremor" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif diff --git a/apps/codecs/liba52/Makefile b/apps/codecs/liba52/Makefile index 54542c096e..8e0501798d 100644 --- a/apps/codecs/liba52/Makefile +++ b/apps/codecs/liba52/Makefile @@ -14,8 +14,9 @@ ifdef APPEXTRA INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) endif -A52OPTS = -CFLAGS = $(GCCOPTS) $(A52OPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} +A52OPTS = -O2 +CFLAGS = $(GCCOPTS) $(A52OPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -26,22 +27,18 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DEPFILE = $(OBJDIR)/dep-liba52 DIRS = -OUTPUT = $(BUILDDIR)/liba52.a - all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" @$(AR) ruv $@ $+ >/dev/null 2>&1 -$(OBJDIR)/liba52/%.o: $(APPSDIR)/codecs/liba52/%.c - @echo "(liba52) CC $<" - @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/liba52/ $< -o $@ - include $(TOOLSDIR)/make.inc clean: @echo "cleaning liba52" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif diff --git a/apps/codecs/libalac/Makefile b/apps/codecs/libalac/Makefile index 5bffb0669e..5bca428f81 100644 --- a/apps/codecs/libalac/Makefile +++ b/apps/codecs/libalac/Makefile @@ -15,7 +15,8 @@ ifdef APPEXTRA endif ALACOPTS = -O3 -CFLAGS = $(GCCOPTS) $(ALACOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} +CFLAGS = $(GCCOPTS) $(ALACOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -26,22 +27,18 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DEPFILE = $(OBJDIR)/dep-libalac DIRS = -OUTPUT = $(BUILDDIR)/libalac.a - all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" @$(AR) ruv $@ $+ >/dev/null 2>&1 -$(OBJDIR)/libalac/%.o: $(APPSDIR)/codecs/libalac/%.c - @echo "(libalac) CC $<" - @$(CC) -c $(CFLAGS) -I$(APPSDIR)/codecs/libalac/ $< -o $@ - include $(TOOLSDIR)/make.inc clean: @echo "cleaning libalac" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif diff --git a/apps/codecs/libfaad/Makefile b/apps/codecs/libfaad/Makefile index 98ad9b9160..548ae5c602 100644 --- a/apps/codecs/libfaad/Makefile +++ b/apps/codecs/libfaad/Makefile @@ -11,11 +11,12 @@ INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR) ifdef APPEXTRA -INCLUDES += -I$(APPSDIR)/$(APPEXTRA) + INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) endif FAADOPTS = -O2 -Wno-char-subscripts -CFLAGS = $(GCCOPTS) $(FAADOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} +CFLAGS = $(GCCOPTS) $(FAADOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -26,22 +27,18 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DEPFILE = $(OBJDIR)/dep-libfaad DIRS = -OUTPUT = $(BUILDDIR)/libfaad.a - all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" @$(AR) ruv $@ $+ >/dev/null 2>&1 -$(OBJDIR)/libfaad/%.o: $(APPSDIR)/codecs/libfaad/%.c - @echo "(libfaad) CC $<" - @$(CC) -c $(CFLAGS) -I$(APPSDIR)/codecs/libfaad/ $< -o $@ - include $(TOOLSDIR)/make.inc clean: @echo "cleaning libfaad" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif diff --git a/apps/codecs/libffmpegFLAC/Makefile b/apps/codecs/libffmpegFLAC/Makefile index 29db4aae87..60da5ae7ff 100644 --- a/apps/codecs/libffmpegFLAC/Makefile +++ b/apps/codecs/libffmpegFLAC/Makefile @@ -15,7 +15,8 @@ ifdef APPEXTRA endif FLACOPTS = -O2 -CFLAGS = $(GCCOPTS) $(FLACOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} +CFLAGS = $(GCCOPTS) $(FLACOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -26,22 +27,18 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DEPFILE = $(OBJDIR)/dep-libffmpegFLAC DIRS = -OUTPUT = $(BUILDDIR)/libffmpegFLAC.a - all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" @$(AR) ruv $@ $+ >/dev/null 2>&1 -$(OBJDIR)/libffmpegFLAC/%.o: $(APPSDIR)/codecs/libffmpegFLAC/%.c - @echo "(libffmpegFLAC) CC $<" - @$(CC) -c $(CFLAGS) -I$(APPSDIR)/codecs/libffmpegFLAC/ $< -o $@ - include $(TOOLSDIR)/make.inc clean: @echo "cleaning libffmpegFLAC" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif diff --git a/apps/codecs/libm4a/Makefile b/apps/codecs/libm4a/Makefile index 540a532213..7f870c9407 100644 --- a/apps/codecs/libm4a/Makefile +++ b/apps/codecs/libm4a/Makefile @@ -15,7 +15,8 @@ ifdef APPEXTRA endif M4AOPTS = -O3 -CFLAGS = $(GCCOPTS) $(M4AOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} +CFLAGS = $(GCCOPTS) $(M4AOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -26,22 +27,18 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DEPFILE = $(OBJDIR)/dep-libm4a DIRS = -OUTPUT = $(BUILDDIR)/libm4a.a - all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" @$(AR) ruv $@ $+ >/dev/null 2>&1 -$(OBJDIR)/libm4a/%.o: $(APPSDIR)/codecs/libm4a/%.c - @echo "(libm4a) CC $<" - @$(CC) -c $(CFLAGS) -I$(APPSDIR)/codecs/libm4a/ $< -o $@ - include $(TOOLSDIR)/make.inc clean: @echo "cleaning libm4a" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif diff --git a/apps/codecs/libmad/Makefile b/apps/codecs/libmad/Makefile index 14c25c6b29..e2f2643b27 100644 --- a/apps/codecs/libmad/Makefile +++ b/apps/codecs/libmad/Makefile @@ -16,8 +16,8 @@ endif # NOTE: FPM_ define has been moved to global.h MADOPTS = -DNDEBUG -O2 -CFLAGS = $(GCCOPTS) $(MADOPTS)\ -$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} +CFLAGS = $(GCCOPTS) $(MADOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -32,11 +32,7 @@ all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" - $(AR) ruv $@ $+ >/dev/null 2>&1 - -$(OBJDIR)/%.o: $(APPSDIR)/codecs/libmad/%.c - @echo "(libmad) CC "`basename $<` - @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libmad/ $< -o $@ + @$(AR) ruv $@ $+ >/dev/null 2>&1 include $(TOOLSDIR)/make.inc @@ -44,4 +40,6 @@ clean: @echo "cleaning libmad" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif diff --git a/apps/codecs/libmusepack/Makefile b/apps/codecs/libmusepack/Makefile index 6912f74e75..8e65915feb 100644 --- a/apps/codecs/libmusepack/Makefile +++ b/apps/codecs/libmusepack/Makefile @@ -15,8 +15,8 @@ ifdef APPEXTRA endif MUSEPACKOPTS = -O2 -CFLAGS = $(GCCOPTS) $(MUSEPACKOPTS)\ -$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} +CFLAGS = $(GCCOPTS) $(MUSEPACKOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -27,22 +27,18 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DEPFILE = $(OBJDIR)/dep-libmusepack DIRS = -OUTPUT = $(OBJDIR)/libmusepack.a - all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" @$(AR) ruv $@ $+ >/dev/null 2>&1 -$(OBJDIR)/libmusepack/%.o: $(APPSDIR)/codecs/libmusepack/%.c - @echo "CC $<" - @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libmusepack/ $< -o $@ - include $(TOOLSDIR)/make.inc clean: @echo "cleaning libmusepack" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif diff --git a/apps/codecs/libwavpack/Makefile b/apps/codecs/libwavpack/Makefile index 6b9461bbb9..39478799bf 100644 --- a/apps/codecs/libwavpack/Makefile +++ b/apps/codecs/libwavpack/Makefile @@ -14,8 +14,9 @@ ifdef APPEXTRA INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) endif -CFLAGS = $(GCCOPTS) \ -$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -O2 \ +WAVPACKOPTS = -O2 +CFLAGS = $(GCCOPTS) $(WAVPACKOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ + -DMEM=${MEMORYSIZE} # This sets up 'SRC' based on the files mentioned in SOURCES include $(TOOLSDIR)/makesrc.inc @@ -26,22 +27,18 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DEPFILE = $(OBJDIR)/dep-libwavpack DIRS = -OUTPUT = $(BUILDDIR)/libwavpack.a - all: $(OUTPUT) $(OUTPUT): $(OBJS) @echo "AR $@" @$(AR) ruv $@ $+ >/dev/null 2>&1 -$(OBJDIR)/libwavpack/%.o: $(APPSDIR)/codecs/libwavpack/%.c - @echo "(libwavpack) CC $<" - @$(CC) -c -O2 $(CFLAGS) -I$(APPSDIR)/codecs/libwavpack/ $< -o $@ - include $(TOOLSDIR)/make.inc clean: @echo "cleaning libwavpack" @rm -f $(OBJS) $(OUTPUT) $(DEPFILE) +ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) +endif