tests/Makefile.inc: Correct dependency file suffix

The dependency file, generated by

 $(HOSTCC) ... -MMD -MT $@ -c $< -o $@.orig

is determined by replacing the suffix of "$@.orig" with ".d", resulting
in "$@.d" (which is *.o.d). The file name was accidentally changed in
CB:55360. Now explicitly specify the path by the "-MF" option.

BUG=none
TEST=make unit-tests; find build/tests/ -name "*.d"
BRANCH=none

Change-Id: I01f77ebaaae78dd9e69394a49e524f1013857195
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56444
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
diff --git a/tests/Makefile.inc b/tests/Makefile.inc
index b4b8cda..056ad7d 100644
--- a/tests/Makefile.inc
+++ b/tests/Makefile.inc
@@ -118,8 +118,8 @@
 $($(1)-srcobjs): OBJCOPY_FLAGS += $$(foreach mock,$$($(1)-mocks),--globalize-symbol=$$(mock) --weaken-symbol=$$(mock))
 $($(1)-objs): $(testobj)/$(1)/%.o: $$$$*.c $$($(1)-config-file)
 	mkdir -p $$(dir $$@)
-	$(HOSTCC) $(HOSTCFLAGS) $$(TEST_CFLAGS) $($(1)-cflags)  -MMD \
-		-MT $$@ -c $$< -o $$@.orig
+	$(HOSTCC) $(HOSTCFLAGS) $$(TEST_CFLAGS) $($(1)-cflags) -MMD \
+		-MF $$(basename $$@).d -MT $$@ -c $$< -o $$@.orig
 	$(OBJCOPY) $$@.orig $$(OBJCOPY_FLAGS) $$@
 
 $($(1)-bin): $($(1)-objs) $(CMOCKA_LIB)