Change dependency file names from foo.dep to .foo.o.dep

This commit is contained in:
Eelco Dolstra 2014-02-01 11:31:25 +01:00
parent 4271927c5b
commit f324b49ea1
6 changed files with 14 additions and 12 deletions

View file

@ -11,4 +11,6 @@ $(dist_name).tar.bz2: $(dist_files)
clean_files += $(dist_name).tar.bz2
print-top-help += echo " dist: Generate a source distribution";
endif

View file

@ -51,3 +51,7 @@ define install-symlink =
$$(trace-install) ln -sfn $(1) $(2)
endef
print-top-help += \
echo " install: Install into \$$(prefix) (currently set to '$(prefix)')";

6
lib.mk
View file

@ -45,11 +45,7 @@ ifeq ($(BUILD_DEBUG), 1)
endif
# Utility function for recursively finding files, e.g.
# $(call rwildcard, path/to/dir, *.c *.h).
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
include mk/functions.mk
include mk/tracing.mk
include mk/clean.mk
include mk/dist.mk

View file

@ -107,10 +107,10 @@ define build-library =
$$(foreach obj, $$($(1)_OBJS), $$(eval $$(obj): $$($(1)_COMMON_DEPS)))
# Include .dep files, if they exist.
$(1)_DEPS := $$(addsuffix .dep, $$(basename $$(_srcs)))
$(1)_DEPS := $$(foreach fn, $$($(1)_OBJS), $$(call filename-to-dep, $$(fn)))
-include $$($(1)_DEPS)
libs_list += $$($(1)_PATH)
clean_files += $$(_d)/*.a $$(_d)/*.$(SO_EXT) $$(_d)/*.o $$(_d)/*.dep $$($(1)_DEPS) $$($(1)_OBJS)
clean_files += $$(_d)/*.a $$(_d)/*.$(SO_EXT) $$(_d)/*.o $$(_d)/.*.dep $$($(1)_DEPS) $$($(1)_OBJS)
dist_files += $$(_srcs)
endef

View file

@ -1,8 +1,8 @@
%.o: %.cc
$(trace-cxx) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP
$(trace-cxx) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
%.o: %.cpp
$(trace-cxx) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP
$(trace-cxx) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
%.o: %.c
$(trace-cc) $(CC) -o $@ -c $< $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP
$(trace-cc) $(CC) -o $@ -c $< $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP

View file

@ -53,10 +53,10 @@ define build-program =
$$(foreach obj, $$($(1)_OBJS), $$(eval $$(obj): $$($(1)_COMMON_DEPS)))
# Include .dep files, if they exist.
$(1)_DEPS := $$(addsuffix .dep, $$(basename $$(_srcs)))
$(1)_DEPS := $$(foreach fn, $$($(1)_OBJS), $$(call filename-to-dep, $$(fn)))
-include $$($(1)_DEPS)
programs_list += $$($(1)_PATH)
clean_files += $$($(1)_PATH) $$(_d)/*.o $$(_d)/*.dep $$($(1)_DEPS) $$($(1)_OBJS)
clean_files += $$($(1)_PATH) $$(_d)/*.o $$(_d)/.*.dep $$($(1)_DEPS) $$($(1)_OBJS)
dist_files += $$(_srcs)
endef