Skip to content

Commit

Permalink
[llbuild] Refactor import_dir to match other Makefiles
Browse files Browse the repository at this point in the history
Signed-off-by: Björn Bidar <[email protected]>
  • Loading branch information
Thaodan committed Mar 28, 2024
1 parent 6dc5349 commit 173bf67
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions llbuild/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ll build system
# ll build system -*- makefile -*-
#
# Copyright (C) 2006-2007 Lauri Leukkunen <[email protected]>
#
Expand Down Expand Up @@ -41,15 +41,17 @@ endef
define import_dir
subdirs :=
subdirs-y :=
objects :=
objects-y :=
objs :=
objs-y :=
D := $(1)
$(shell mkdir -p $(1))
include $(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))))
Expand All @@ -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 =
Expand Down

0 comments on commit 173bf67

Please sign in to comment.