1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

make: don't invoke wildcard repeatedly

This commit is contained in:
René Kijewski 2014-08-13 20:46:47 +02:00
parent 01f6bdf789
commit 9b408fda9c

View File

@ -22,27 +22,26 @@ ${DIRS:%=ALL--%}:
${DIRS:%=CLEAN--%}: ${DIRS:%=CLEAN--%}:
"$(MAKE)" -C ${@:CLEAN--%=%} clean "$(MAKE)" -C ${@:CLEAN--%=%} clean
ASMSRC = $(wildcard *.s)
ASSMSRC = $(wildcard *.S)
ASMOBJ = $(ASMSRC:%.s=$(BINDIR)$(MODULE)/%.o)
ASMOBJ += $(ASSMSRC:%.S=$(BINDIR)$(MODULE)/%.o)
ifeq ($(strip $(SRC)),) ifeq ($(strip $(SRC)),)
SRC = $(wildcard *.c) SRC := $(wildcard *.c)
endif endif
ifeq ($(strip $(SRCXX)),) ifeq ($(strip $(SRCXX)),)
SRCXX = $(wildcard *.cpp) SRCXX := $(wildcard *.cpp)
endif
ifeq ($(strip $(ASMSRC)),)
ASMSRC := $(wildcard *.s)
endif
ifeq ($(strip $(ASSMSRC)),)
ASSMSRC := $(wildcard *.S)
endif endif
OBJC = $(SRC:%.c=$(BINDIR)$(MODULE)/%.o) OBJC := $(SRC:%.c=$(BINDIR)$(MODULE)/%.o)
OBJCXX = $(SRCXX:%.cpp=$(BINDIR)$(MODULE)/%.o) OBJCXX := $(SRCXX:%.cpp=$(BINDIR)$(MODULE)/%.o)
ASMOBJ := $(ASMSRC:%.s=$(BINDIR)$(MODULE)/%.o)
ASSMOBJ := $(ASSMSRC:%.S=$(BINDIR)$(MODULE)/%.o)
OBJ = $(OBJC) OBJ := $(OBJC) $(OBJCXX) $(ASMOBJ) $(ASSMOBJ)
OBJ += $(OBJCXX) DEP := $(OBJC:.o=.d) $(OBJCXX:.o=.d) $(ASSMOBJ:.o=.d)
DEP = $(SRC:%.c=$(BINDIR)$(MODULE)/%.d)
DEP += $(SRCXX:%.cpp=$(BINDIR)$(MODULE)/%.d)
$(BINDIR)$(MODULE)/: $(BINDIR)$(MODULE)/:
$(AD)mkdir -p $@ $(AD)mkdir -p $@
@ -68,4 +67,4 @@ $(BINDIR)$(MODULE)/%.o: %.S $(BINDIR)$(MODULE)/
# pull in dependency info for *existing* .o files # pull in dependency info for *existing* .o files
# deleted header files will be silently ignored # deleted header files will be silently ignored
-include $(OBJ:.o=.d) -include $(DEP)