about summary refs log tree commit diff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rw-r--r--mk/libraries.mk6
1 files changed, 4 insertions, 2 deletions
diff --git a/mk/libraries.mk b/mk/libraries.mk
index 58c67063be5e..bea684490f7e 100644
--- a/mk/libraries.mk
+++ b/mk/libraries.mk
@@ -89,9 +89,11 @@ define build-library =
   # Propagate CXXFLAGS to the individual object files.
   $$(foreach obj, $$($(1)_OBJS), $$(eval $$(obj)_CXXFLAGS=$$($(1)_CXXFLAGS)))
 
-  include $$(wildcard $$(_d)/*.dep)
+  # Include .dep files, if they exist.
+  $(1)_DEPS := $$(addsuffix .dep, $$(basename $$(_srcs)))
+  -include $$($(1)_DEPS)
 
   libs_list += $$($(1)_PATH)
-  clean_files += $$(_d)/*.a $$(_d)/*.so $$(_d)/*.o $$(_d)/*.dep
+  clean_files += $$(_d)/*.a $$(_d)/*.so $$(_d)/*.o $$(_d)/*.dep $$($(1)_DEPS) $$($(1)_OBJS)
   dist_files += $$(_srcs)
 endef