summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile23
1 files changed, 12 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index d86eaf014d..9f0b6795ef 100644
--- a/Makefile
+++ b/Makefile
@@ -273,17 +273,18 @@ src-to-ali=\
# Add paths to files in X-y to X-srcs
# Add subdirs-y to subdirs
includemakefiles= \
- $(foreach class,classes subdirs $(classes) $(special-classes), $(eval $(class)-y:=)) \
- $(eval -include $(1)) \
- $(foreach class,$(classes-y), $(call add-class,$(class))) \
- $(foreach special,$(special-classes), \
- $(foreach item,$($(special)-y), $(call $(special)-handler,$(dir $(1)),$(item)))) \
- $(foreach class,$(classes), \
- $(eval $(class)-srcs+= \
- $$(subst $(absobj)/,$(obj)/, \
- $$(subst $(top)/,, \
- $$(abspath $$(subst $(dir $(1))/,/,$$(addprefix $(dir $(1)),$$($(class)-y)))))))) \
- $(eval subdirs+=$$(subst $(CURDIR)/,,$$(wildcard $$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))))
+ $(if $(wildcard $(1)), \
+ $(foreach class,classes subdirs $(classes) $(special-classes), $(eval $(class)-y:=)) \
+ $(eval -include $(1)) \
+ $(foreach class,$(classes-y), $(call add-class,$(class))) \
+ $(foreach special,$(special-classes), \
+ $(foreach item,$($(special)-y), $(call $(special)-handler,$(dir $(1)),$(item)))) \
+ $(foreach class,$(classes), \
+ $(eval $(class)-srcs+= \
+ $$(subst $(absobj)/,$(obj)/, \
+ $$(subst $(top)/,, \
+ $$(abspath $$(subst $(dir $(1))/,/,$$(addprefix $(dir $(1)),$$($(class)-y)))))))) \
+ $(eval subdirs+=$$(subst $(CURDIR)/,,$$(wildcard $$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))))
# For each path in $(subdirs) call includemakefiles
# Repeat until subdirs is empty