Skip to content

Commit d2dba9b

Browse files
committed
[llbuild] Refactor import_dir to match other Makefiles
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
1 parent 5eb842e commit d2dba9b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

llbuild/Makefile.include

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ll build system
1+
# ll build system -*- makefile -*-
22
#
33
# Copyright (C) 2006-2007 Lauri Leukkunen <lle@rahina.org>
44
#
@@ -41,15 +41,17 @@ endef
4141
define import_dir
4242
subdirs :=
4343
subdirs-y :=
44-
objects :=
45-
objects-y :=
44+
objs :=
45+
objs-y :=
4646
D := $(1)
4747
$(shell mkdir -p $(1))
4848
include $(1)/Makefile
49-
dep_files := $$(wildcard $(1)/.*.d)
50-
include $(dep_files)
51-
all_objects := $$(all_objects) $$(patsubst %,$(1)/%,$$(objects))
52-
all_objects := $$(all_objects) $$(patsubst %,$(1)/%,$$(objects-y))
49+
deps := $(join $(subst ./, $(D)/, $(dir $(objs))), $(patsubst %,.%.d,$(notdir $(objs))))
50+
objs-y := $(join $(subst ./, $(D)/, $(dir $(objs))), $(notdir $(objs)))
51+
objs-all := $(objs-all) \
52+
$(patsubst %,$(OBJDIR)%,$(objs-y))
53+
deps-all := $(deps-all) $(patsubst %,$(OBJDIR)%,$(deps))
54+
include $(wildcard $(deps))
5355
subdirs := $$(subdirs) $$(subdirs-y)
5456
tmp := $$(patsubst %,$(1)/%,$$(subdirs))
5557
perkele := $$(foreach dir,$$(tmp),$$(eval $$(call import_dir,$$(dir))))
@@ -58,8 +60,9 @@ endef
5860
$(foreach dir,$(subdirs),$(eval $(call import_dir,$(dir))))
5961

6062

61-
all_objects += $(foreach t,$(extra_targets),$($(t)))
63+
objs-all += $(foreach t,$(extra_targets),$($(t)))
6264

65+
CLEAN_FILES += $(deps-all)
6366

6467
ifdef V
6568
Q =

0 commit comments

Comments
 (0)