TEST_DIRS := $(shell cd $(TOP); find tests -type d) TEST_SRCS := $(shell cd $(TOP); find tests -type f -name '*.cpp') TEST_OBJS := $(TEST_SRCS:.cpp=.o) ALL_DIRS += $(TEST_DIRS) ALL_EXES += test-all$(binext) ALL_OBJS += $(TEST_OBJS) TEST_LIBS = $(strip \ $(CPPUNIT_LIBS) \ $(SDL_LIBS) \ $(SDL_IMG_LIBS) \ ) test-all$(binext): $(BASE_OBJS) $(TEST_OBJS) -@$(MKDIR) "$(@D)" @echo "link: $@" $(VERBOSE) $(CXX) -o "$@" $(LDFLAGS) $^ $(TEST_LIBS) run-test-all: test-all$(binext) @echo "test: test-all$(binext)" $(VERBOSE) ./test-all$(binext) tests: test-all$(binext) test: run-test-all .PHONY: run-test-all