
RM := rm -rf

-include sources.mk

OBJS += $(subst .cpp,.o,$(CPP_SRCS))

CPP_DEPS += $(subst .cpp,.d,$(CPP_SRCS))

all: fakeit_test_application

coverage: fakeit_test_application_with_coverage

check: fakeit_test_application
	./fakeit_tests.exe

fakeit_test_application: $(OBJS) 
	@echo 'Building test application: fakeit_tests.exe'
	@echo 'Invoking: Clang C++ Linker'
	clang++ -o "fakeit_tests.exe" $(OBJS) 
	@echo 'Finished building test application: fakeit_tests.exe'
	@echo ' '

%.o: ../tests/%.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: Clang C++ Compiler'
	clang++ -D__GXX_EXPERIMENTAL_CXX0X__ -I"../include" -I"../config/standalone" -O0 -g3 -Wall -Wextra -Wno-ignored-qualifiers -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '

ifneq ($(MAKECMDGOALS),clean)
-include $(CPP_DEPS)
endif

# Other Targets
clean:
	-$(RM) $(OBJS)$(CPP_DEPS) fakeit_tests.exe
	-@echo ' '
