|
1 | | -# ll build system |
| 1 | +# ll build system -*- makefile -*- |
2 | 2 | # |
3 | 3 | # Copyright (C) 2006-2007 Lauri Leukkunen <lle@rahina.org> |
4 | 4 | # |
@@ -41,15 +41,17 @@ endef |
41 | 41 | define import_dir |
42 | 42 | subdirs := |
43 | 43 | subdirs-y := |
44 | | - objects := |
45 | | - objects-y := |
| 44 | + objs := |
| 45 | + objs-y := |
46 | 46 | D := $(1) |
47 | 47 | $(shell mkdir -p $(1)) |
48 | 48 | 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)) |
53 | 55 | subdirs := $$(subdirs) $$(subdirs-y) |
54 | 56 | tmp := $$(patsubst %,$(1)/%,$$(subdirs)) |
55 | 57 | perkele := $$(foreach dir,$$(tmp),$$(eval $$(call import_dir,$$(dir)))) |
|
58 | 60 | $(foreach dir,$(subdirs),$(eval $(call import_dir,$(dir)))) |
59 | 61 |
|
60 | 62 |
|
61 | | -all_objects += $(foreach t,$(extra_targets),$($(t))) |
| 63 | +objs-all += $(foreach t,$(extra_targets),$($(t))) |
62 | 64 |
|
| 65 | +CLEAN_FILES += $(deps-all) |
63 | 66 |
|
64 | 67 | ifdef V |
65 | 68 | Q = |
|
0 commit comments