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>
This commit is contained in:
Yu-Ping Wu
2021-07-20 14:32:40 +08:00
committed by Patrick Georgi
parent 6e85862a74
commit 0f88f6ff92

View File

@@ -118,8 +118,8 @@ $($(1)-objs): TEST_CFLAGS += -I$$(dir $$($(1)-config-file)) \
$($(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)