From 3ef9022508e6e331e1bedb173a0aad509ceb69aa Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 23 May 2013 10:15:55 +0200 Subject: [PATCH] tools: fix dependency file generation There is a small set of places where files in subdirectories get compiled from the parent directory. Dependency file wise this is no problem as long as the files use names distinct without regard to the directories they sit in, and tools/console/ violates this (in having two main.c files). Hence we need to avoid losing the directory name, both to ensure the two compiler instances don't simultaneously write to the same file (happening of which is what triggered me looking into this) and to guarantee dependencies for all files will be seen by make on an incremental rebuild. Signed-off-by: Jan Beulich Acked-by: Ian Campbell master commit: 4d788e164d6556d931bc3e0a69e36b8cf7280794 master date: 2013-05-21 10:16:30 +0200 --- tools/Rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index f4e84c1b77..e83f682751 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -62,7 +62,7 @@ SHLIB_libxenlight = -Wl,-rpath-link=$(XEN_XENLIGHT) CFLAGS += -D__XEN_TOOLS__ # Get gcc to generate the dependencies for us. -CFLAGS += -MMD -MF .$(@F).d +CFLAGS += -MMD -MF .$(if $(filter-out .,$(@D)),$(subst /,@,$(@D))@)$(@F).d DEPS = .*.d ifneq ($(XEN_OS),NetBSD) -- 2.39.5