rcp/Makefile

24 lines
634 B
Makefile

# This Makefile is entirely for running unit tests for rcp.h
INCLUDE := include
STANDARDS := 11 14 17 20 23
BINARIES := $(addprefix build/tests-, $(STANDARDS))
.PHONY: all
all: $(BINARIES)
@for std in $(STANDARDS); do \
echo "=== Test C++$$std ==="; \
build/tests-$$std; \
valgrind --leak-check=full --error-exitcode=1 \
--log-file=build/valgrind-$$std.log build/tests-$$std \
|| { echo "valgrind failed for C++$$std (see build/valgrind-$$std.log)"; exit 1; }; \
done
build/tests-%: tests.cpp $(INCLUDE)/rcp.h
@mkdir -p $(dir $@)
$(CXX) -std=c++$* -g -Wall -I$(INCLUDE) -o $@ $<
.PHONY: clean
clean:
rm -rf build