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 =