From 2829179be1ff1f56822ea1227e6fb8c2caf633fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Thu, 28 Mar 2024 18:35:36 +0200 Subject: [PATCH] [llbuild] Refactor import_dir to match other Makefiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Bidar --- llbuild/Makefile.include | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/llbuild/Makefile.include b/llbuild/Makefile.include index 48df2d3d..9c7dbc54 100644 --- a/llbuild/Makefile.include +++ b/llbuild/Makefile.include @@ -1,4 +1,4 @@ -# ll build system +# ll build system -*- makefile -*- # # Copyright (C) 2006-2007 Lauri Leukkunen # @@ -41,15 +41,17 @@ endef define import_dir subdirs := subdirs-y := - objects := - objects-y := + objs := + objs-y := D := $(1) $(shell mkdir -p $(1)) include $(SRCDIR)/$(1)/Makefile - dep_files := $$(wildcard $(1)/.*.d) - include $(dep_files) - all_objects := $$(all_objects) $$(patsubst %,$(1)/%,$$(objects)) - all_objects := $$(all_objects) $$(patsubst %,$(1)/%,$$(objects-y)) + deps := $(join $(subst ./, $(D)/, $(dir $(objs))), $(patsubst %,.%.d,$(notdir $(objs)))) + objs-y := $(join $(subst ./, $(D)/, $(dir $(objs))), $(notdir $(objs))) + objs-all := $(objs-all) \ + $(patsubst %,$(OBJDIR)%,$(objs-y)) + deps-all := $(deps-all) $(patsubst %,$(OBJDIR)%,$(deps)) + include $(wildcard $(deps)) subdirs := $$(subdirs) $$(subdirs-y) tmp := $$(patsubst %,$(1)/%,$$(subdirs)) perkele := $$(foreach dir,$$(tmp),$$(eval $$(call import_dir,$$(dir)))) @@ -58,8 +60,9 @@ endef $(foreach dir,$(subdirs),$(eval $(call import_dir,$(dir)))) -all_objects += $(foreach t,$(extra_targets),$($(t))) +objs-all += $(foreach t,$(extra_targets),$($(t))) +CLEAN_FILES += $(deps-all) ifdef V Q =