Skip to content

Commit

Permalink
Fix rebuilding librbspeex on OS X and make rm work on Windows.
Browse files Browse the repository at this point in the history
OS X ar operates on fat libaries and cannot update existing archives. Remove it
first to avoid this.
Use a make function when removing files to allow calling the correct command on
Windows, which doesn't know about rm.

Change-Id: Ia0c13ef7907239a1e6f4abc26bb08238a226c476
  • Loading branch information
bluebrother committed Jun 20, 2015
1 parent 226922e commit 465eb72
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/rbspeex/Makefile
Expand Up @@ -13,8 +13,10 @@ endif

ifeq ($(OS),Windows_NT)
mkdir = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1))
rm = if exist $(subst /,\,$(1)) del /q /s $(subst /,\,$(1))
else
mkdir = mkdir -p $(1)
rm = rm -rf $(1)
endif

SPEEXSRC = ../../lib/rbcodec/codecs/libspeex
Expand Down Expand Up @@ -100,6 +102,7 @@ $(TARGET_DIR)rbspeex.dll: $(OBJS) $(BUILD_DIR)/rbspeex.o

$(TARGET_DIR)librbspeex.a: $(OBJS) $(BUILD_DIR)/rbspeex.o
@echo AR $(notdir $@)
$(SILENT)$(call rm,$@)
$(SILENT)$(CROSS)$(AR) rcs $@ $^

librbspeex.a: $(TARGET_DIR)librbspeex.a
Expand All @@ -119,9 +122,9 @@ librbspeex.a: $(TARGET_DIR)librbspeex.a
$(SILENT)$(CROSS)$(CC) $(CFLAGS) $(ARCHFLAGS) -c $< -o $@

clean:
rm -f $(OBJS) $(TARGET_DIR)librbspeex* ../rbspeexenc ../rbspeexdec
rm -f $(DEPS)
rm -rf build*
$(call rm,$(OBJS) $(TARGET_DIR)librbspeex* ../rbspeexenc ../rbspeexdec)
$(call rm,$(DEPS))
$(call rm,build*)

$(BUILD_DIR):
@echo MKDIR $(BUILD_DIR)
Expand Down

0 comments on commit 465eb72

Please sign in to comment.