diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-05-11 20:25:15 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-05-11 20:34:12 +0200 |
commit | 4877f618d664f53694132b91fc7712844566bfbb (patch) | |
tree | b50b3417631f47c8bd8fcf58000fb9df85e2cf5a /tools/rbspeex | |
parent | 071ccc78a9f3a2360d43ad5ca7a931481a206e8a (diff) |
Rework rbspeex dependency generation to use single dependency files.
Similar as done in d2b8f91 change dependency generation to use one file per
source file. This removes the need to have external tools installed on Windows.
Previously Cygwin or msys tools needed to be in the system PATH which was
problematic at times.
This means that now building on Windows (using MinGW) doesn't require
additional tools anymore.
Change-Id: I4c0675e99c3cc3a729b91beefd58320db498ae0a
Diffstat (limited to 'tools/rbspeex')
-rw-r--r-- | tools/rbspeex/Makefile | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/tools/rbspeex/Makefile b/tools/rbspeex/Makefile index 24a0cedd8c..713111dd2e 100644 --- a/tools/rbspeex/Makefile +++ b/tools/rbspeex/Makefile @@ -70,31 +70,21 @@ TARGET_DIR ?= $(shell pwd)/ BUILD_DIR ?= $(TARGET_DIR)build$(COMPILETARGET) SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c OBJS = $(addprefix $(BUILD_DIR)/,$(SRC:%.c=%.o)) -DEPFILE = $(BUILD_DIR)/dep-speex DIRS = .PHONY : all all: ../rbspeexenc ../rbspeexdec -$(DEPFILE): $(SOURCES) - @echo MKDIR $(BUILD_DIR) - $(SILENT)mkdir -p $(BUILD_DIR) - @echo Creating dependencies - $(SILENT)rm -f $(DEPFILE) - $(SILENT)(for each in $(SOURCES) x; do \ - if test "x" != "$$each"; then \ - obj=`echo $$each | sed -e 's/\.[cS]/.o/' | sed -e 's/^.*\///' `; \ - $(CC) -MG -MM -MT "$(BUILD_DIR)/$$obj" $(CFLAGS) $$each 2>/dev/null; \ - fi; \ - if test -n "$$del"; then \ - rm $$del; \ - del=""; \ - fi \ - done > $(DEPFILE); \ - echo "oo" > /dev/null ) - -include $(DEPFILE) +$(foreach src,$(SOURCES),$(eval $(BUILD_DIR)/$(subst .c,.o,$(notdir $(src))): $(src))) +$(foreach src,$(SOURCES),$(eval $(BUILD_DIR)/$(subst .c,.d,$(notdir $(src))): $(src))) +DEPS = $(addprefix $(BUILD_DIR)/,$(subst .c,.d,$(notdir $(SOURCES)))) +-include $(DEPS) + +%.d: + @echo DEP $(notdir $@) + $(SILENT)$(call mkdir,$(BUILD_DIR)) + $(SILENT)$(CC) -MG -MM -MT $(subst .d,.o,$@) $(CFLAGS) -o $(BUILD_DIR)/$(notdir $@) $< dll: $(TARGET_DIR)rbspeex.dll @@ -105,7 +95,6 @@ $(TARGET_DIR)rbspeex.dll: $(OBJS) $(BUILD_DIR)/rbspeex.o $(TARGET_DIR)librbspeex.a: $(OBJS) $(BUILD_DIR)/rbspeex.o @echo AR $(notdir $@) - $(SILENT)rm -f $@ $(SILENT)$(CROSS)$(AR) rcs $@ $^ > /dev/null 2>&1 librbspeex.a: $(TARGET_DIR)librbspeex.a @@ -125,7 +114,8 @@ librbspeex.a: $(TARGET_DIR)librbspeex.a $(SILENT)$(CROSS)$(CC) $(CFLAGS) $(ARCHFLAGS) -c $< -o $@ clean: - rm -f $(OBJS) $(TARGET_DIR)librbspeex* ../rbspeexenc ../rbspeexdec $(TARGET_DIR)dep-speex + rm -f $(OBJS) $(TARGET_DIR)librbspeex* ../rbspeexenc ../rbspeexdec + rm -f $(DEPS) rm -rf build* $(BUILD_DIR): |