Skip to content

Commit 0b91aa8

Browse files
authored
Merge pull request #2878 from stan-dev/tests/clean-object-files
Delete object files after test executable is built
2 parents 4c3441b + 9ef7c16 commit 0b91aa8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

make/tests

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ test/%$(EXE) : test/%.o $(GTEST)/src/gtest_main.cc $(GTEST)/src/gtest-all.o $(MP
2929

3030
##
3131
# Include dependency files for tests
32+
# This has the side-effect of making the object files non-intermediates,
33+
# so we need to explicitly tell make we don't want to keep them
3234
##
3335
ifneq ($(filter test/%,$(MAKECMDGOALS)),)
3436
-include $(patsubst %$(EXE),%.d,$(filter test/%,$(MAKECMDGOALS)))
37+
.INTERMEDIATE: $(patsubst test/%_test$(EXE),test/%_test.o,$(filter test/%_test$(EXE),$(MAKECMDGOALS)))
3538
endif
3639

3740
##

0 commit comments

Comments
 (0)