Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools: Modernize rbspeex Makefile.

- Replace echo with make internal info function.
- Make dependency generation implicit to avoid another compiler call.
- Align object handling with libtools.make.

Change-Id: Iaaddd17af04039dcd8948399bc99d21def05181d

+28 -27
+28 -27
tools/rbspeex/Makefile
··· 68 68 # fall back to our own librbspeex if no suitable found. 69 69 ifeq ($(SYS_SPEEX),) 70 70 # This sets up 'SRC' based on the files mentioned in SOURCES 71 - SRC := $(shell $(CC) $(CFLAGS) -E -P -xc $(SPEEXSRC)/SOURCES) 71 + SPEEXSRCS := $(shell $(CC) $(CFLAGS) -E -P -xc $(SPEEXSRC)/SOURCES) 72 + LIBSOURCES := $(SPEEXSRCS:%.c=$(SPEEXSRC)/%.c) rbspeex.c 72 73 LIBS = $(TARGET_DIR)librbspeex.a 73 74 else 74 75 LIBS = $(SYS_SPEEX) ··· 76 77 77 78 TARGET_DIR ?= $(shell pwd)/ 78 79 BUILD_DIR ?= $(TARGET_DIR)build$(COMPILETARGET) 79 - SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c 80 - OBJS = $(addprefix $(BUILD_DIR)/,$(SRC:%.c=%.o)) 81 - DIRS = 80 + OBJDIR = $(abspath $(BUILD_DIR))/ 81 + SOURCES = rbspeex.c rbspeexenc.c rbspeexdec.c 82 + OBJS := $(addsuffix .o,$(addprefix $(OBJDIR),$(notdir $(SOURCES)))) 83 + LIBOBJS := $(addsuffix .o,$(addprefix $(OBJDIR),$(notdir $(LIBSOURCES)))) 82 84 83 85 .PHONY : all 84 86 85 87 all: ../rbspeexenc ../rbspeexdec 86 88 87 - $(foreach src,$(SOURCES),$(eval $(BUILD_DIR)/$(subst .c,.o,$(notdir $(src))): $(src))) 88 - $(foreach src,$(SOURCES),$(eval $(BUILD_DIR)/$(subst .c,.d,$(notdir $(src))): $(src))) 89 - DEPS = $(addprefix $(BUILD_DIR)/,$(subst .c,.d,$(notdir $(SOURCES)))) 89 + # create dependency files. Make sure to use the same prefix as with OBJS! 90 + $(foreach src,$(SOURCES) $(LIBSOURCES),$(eval $(addprefix $(OBJDIR),$(notdir $(src).o)): $(src))) 91 + $(foreach src,$(SOURCES) $(LIBSOURCES),$(eval $(addprefix $(OBJDIR),$(notdir $(src).d)): $(src))) 92 + DEPS = $(addprefix $(OBJDIR),$(addsuffix .d,$(notdir $(SOURCES) $(LIBSOURCES)))) 90 93 -include $(DEPS) 91 - 92 - %.d: 93 - $(SILENT)$(call mkdir,$(BUILD_DIR)) 94 - $(SILENT)$(CC) -MG -MM -MT $(subst .d,.o,$@) $(CFLAGS) -o $(BUILD_DIR)/$(notdir $@) $< 95 94 96 95 dll: $(TARGET_DIR)rbspeex.dll 97 96 98 - $(TARGET_DIR)rbspeex.dll: $(OBJS) $(BUILD_DIR)/rbspeex.o 99 - @echo DLL $(notdir $@) 97 + $(TARGET_DIR)rbspeex.dll: $(LIBOBJS) 98 + $(info DLL $(notdir $@)) 100 99 $(SILENT)$(CROSS)$(CC) $(CFLAGS) -shared -o $@ $^ \ 101 100 -Wl,--output-def,$(TARGET_DIR)rbspeex.def 102 101 103 - $(TARGET_DIR)librbspeex.a: $(OBJS) $(BUILD_DIR)/rbspeex.o 104 - @echo AR $(notdir $@) 102 + $(TARGET_DIR)librbspeex.a: $(LIBOBJS) 103 + $(info AR $(notdir $@)) 105 104 $(SILENT)$(call rm,$@) 106 105 $(SILENT)$(CROSS)$(AR) rcs $@ $^ 107 106 108 107 librbspeex.a: $(TARGET_DIR)librbspeex.a 109 108 110 - ../rbspeexenc: $(OBJS) $(BUILD_DIR)/rbspeexenc.o librbspeex.a 111 - @echo Linking ../rbspeexenc 112 - $(SILENT)$(CROSS)$(CC) $(CFLAGS) $(ARCHFLAGS) -o ../rbspeexenc $(BUILD_DIR)/rbspeexenc.o \ 109 + ../rbspeexenc: $(OBJS) $(TARGET_DIR)librbspeex.a 110 + $(info Linking ../rbspeexenc) 111 + $(SILENT)$(CROSS)$(CC) $(CFLAGS) $(LDFLAGS) $(ARCHFLAGS) -o ../rbspeexenc $(BUILD_DIR)/rbspeexenc.c.o \ 113 112 $(LIBS) -lm $(TARGET_DIR)librbspeex.a 114 113 115 - ../rbspeexdec: $(OBJS) librbspeex.a $(BUILD_DIR)/rbspeexdec.o 116 - @echo Linking ../rbspeexdec 117 - $(SILENT)$(CROSS)$(CC) $(CFLAGS) $(ARCHFLAGS) -o ../rbspeexdec $(BUILD_DIR)/rbspeexdec.o \ 114 + ../rbspeexdec: $(OBJS) $(TARGET_DIR)librbspeex.a 115 + $(info Linking ../rbspeexdec) 116 + $(SILENT)$(CROSS)$(CC) $(CFLAGS) $(LDFLAGS) $(ARCHFLAGS) -o ../rbspeexdec $(BUILD_DIR)/rbspeexdec.c.o \ 118 117 $(LIBS) -lm $(TARGET_DIR)librbspeex.a 119 118 120 - %.o: 121 - @echo CC $< 122 - $(SILENT)$(CROSS)$(CC) $(CFLAGS) $(ARCHFLAGS) -c $< -o $@ 119 + # common rules 120 + $(OBJDIR)%.c.o: 121 + $(info CC $<) 122 + $(SILENT)$(call mkdir,$(dir $@)) 123 + $(SILENT)$(CROSS)$(CC) $(ARCHFLAGS) $(GCCFLAGS) $(CFLAGS) -MMD -c -o $@ $< 123 124 124 125 clean: 125 - $(call rm,$(OBJS) $(TARGET_DIR)librbspeex* ../rbspeexenc ../rbspeexdec) 126 + $(call rm,$(OBJS) $(LIBOBJS) $(TARGET_DIR)librbspeex* ../rbspeexenc ../rbspeexdec) 126 127 $(call rm,$(DEPS)) 127 - $(call rm,build*) 128 + $(call rm,$(BUILD_DIR)) 128 129 129 130 $(BUILD_DIR): 130 - @echo MKDIR $(BUILD_DIR) 131 + $(info MKDIR $(BUILD_DIR)) 131 132 $(SILENT)$(call mkdir, $(BUILD_DIR)) 132 133