Skip to content
Permalink
Browse files

Makefile: the previous commit was making use of useless CPU-intensive…

… `find` when PROJECT_DIR was empty.

make's "user-defined functions" are very weird
  • Loading branch information
giuliomoro committed Feb 13, 2020
1 parent 11adec3 commit 38a9a851a906a7cd1c07b57fb60c15b978bcb626
Showing with 3 additions and 3 deletions.
  1. +3 −3 Makefile
@@ -343,10 +343,10 @@ ifeq ($(DISTCC),1)
endif

ALL_DEPS=
define find_files
$(shell find $(PROJECT_DIR)/ -type f -name "$(1)" | grep -v "$(PROJECT_DIR)/heavy/.*\.cpp")
endef

ifneq ($(PROJECT),)
find_files = $(if $(if $(PROJECT_DIR),$(if $(1),_)), $(shell find $(PROJECT_DIR)/ -type f -name "$(1)" | grep -v "$(PROJECT_DIR)/heavy/.*\.cpp"))

ASM_SRCS := $(call find_files,*.S)
ASM_OBJS := $(addprefix $(PROJECT_DIR)/build/,$(notdir $(ASM_SRCS:.S=.o)))
ALL_DEPS += $(addprefix $(PROJECT_DIR)/build/,$(notdir $(ASM_SRCS:.S=.d)))

0 comments on commit 38a9a85

Please sign in to comment.
You can’t perform that action at this time.