From dc120fbebb5c30cc52e557ca76b36d4b280c5d8a Mon Sep 17 00:00:00 2001 From: Sean Bartell Date: Sat, 13 Aug 2011 15:21:14 -0400 Subject: [PATCH 6/7] rbcodec refactoring: makefile --- lib/rbcodec/rbcodec.make | 6 ++++++ lib/rbcodec/test/Makefile | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/rbcodec/rbcodec.make b/lib/rbcodec/rbcodec.make index acbe532..6d36295 100644 --- a/lib/rbcodec/rbcodec.make +++ b/lib/rbcodec/rbcodec.make @@ -5,6 +5,12 @@ # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ # \/ \/ \/ \/ \/ +preprocess = $(shell $(CC) $(PPCFLAGS) $(RBCODEC_CFLAGS) $(2) -E -P -x c -include rbcodecconfig.h $(1) | \ + grep -v '^\#' | grep -v "^ *$$" | sed -e 's:^..*:$(dir $(1))&:') +c2obj = $(addsuffix .o,$(basename $(subst $(RBCODEC_DIR),$(RBCODEC_BLD),$(1)))) +MEMORYSIZE = 128 +CPU = arm + RBCODEC_CFLAGS += -I$(RBCODEC_DIR)/util RBCODEC_LIB = $(RBCODEC_BLD)/librbcodec.a RBCODEC_SRC := $(call preprocess, $(RBCODEC_DIR)/SOURCES, $(RBCODEC_CFLAGS) \ diff --git a/lib/rbcodec/test/Makefile b/lib/rbcodec/test/Makefile index 0c58902..39797b2 100644 --- a/lib/rbcodec/test/Makefile +++ b/lib/rbcodec/test/Makefile @@ -29,7 +29,20 @@ WARBLE_OBJS = $(BUILDDIR)/warble.o WARBLE_CFLAGS = '-DCODECDIR="$(CODECDIR)"' $(shell sdl-config --cflags) WARBLE_LDFLAGS = -lm -ldl $(shell sdl-config --libs) -include $(ROOTDIR)/tools/functions.make +ifndef V +SILENT:=@ +endif +PRINTS=$(SILENT)$(call info,$(1)) +# old 'make' versions don't have the built-in 'info' function +info=old$(shell echo >&2 "Consider upgrading to GNU make 3.81+ for optimum build performance.") +ifeq ($(call info),old) +export info=echo "$$(1)"; +endif + + #$(TOOLSDIR)/addtargetdir.pl $(ROOTDIR) $(BUILDDIR) + +mkdepfile = $(SILENT)$(CC) $(PPCFLAGS) $(OTHER_INC) -MG -MM -include rbcodecconfig.h $(2) | \ + sed -e 's:^\S.*:$(RBCODEC_BLD)/&:' >> $(1) RBCODEC_CFLAGS += -D_FILE_H_ -DLOGF_H -DDEBUG_H # will be removed later WARBLE_CFLAGS += $(RBCODEC_CFLAGS) @@ -51,9 +64,9 @@ dep $(DEPFILE): $(SILENT)mkdir -p $(dir $(DEPFILE)) $(call PRINTS,Generating dependencies) @rm -f $(DEPFILE)_ - $(call mkdepfile,$(DEPFILE)_,$(SRC)) + #$(call mkdepfile,$(DEPFILE)_,$(SRC)) $(call mkdepfile,$(DEPFILE)_,$(OTHER_SRC)) - $(call mkdepfile,$(DEPFILE)_,$(ASMDEFS_SRC)) + #$(call mkdepfile,$(DEPFILE)_,$(ASMDEFS_SRC)) @mv $(DEPFILE)_ $(DEPFILE) -include $(DEPFILE) -- 1.7.6