Skip to content

Commit

Permalink
Ensure tests' obj files are rebuilt if dependent headers change
Browse files Browse the repository at this point in the history
  • Loading branch information
rhargreaves committed Sep 8, 2024
1 parent bf7de7d commit c15bd79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ system: $(SYSTEM_TESTS_TARGET)

$(OBJ_DIR)/%.o: %.c
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -MMD -c $< -o $@
$(CC) $(CFLAGS) -MMD -MT "$@ $(basename $@).d" -c $< -o $@

-include $(wildcard $(OBJ_DIR)/*.d) $(wildcard $(OBJ_DIR)/*/*.d)

$(UNIT_TESTS_TARGET): $(SRC_OBJ) $(UNIT_TEST_OBJ) $(COMMON_TEST_OBJ)
mkdir -p $(dir $@)
Expand Down

0 comments on commit c15bd79

Please sign in to comment.