-LOCAL_CFLAGS = -std=c++98 -Wall -pedantic -isystem include
+LOCAL_CFLAGS = -std=c++98 -Wall -pedantic -Iinclude
LOCAL_LDFLAGS = -lboost_unit_test_framework
TESTPRG = test_suite
TESTCMD = ./$(TESTPRG) --detect_memory_leak=1 --report_level=short \
-# --build_info=yes --log_level=test_suite \
-# | grep -v "Entering test case " | grep -v "Leaving test case"
+ #--build_info=yes --log_level=test_suite \
+ #| grep -v "Entering test case " | grep -v "Leaving test case"
VALGRIND = valgrind --tool=memcheck --leak-check=yes --db-attach=no \
--num-callers=24 --leak-resolution=high --track-fds=yes \
ALL_LDFLAGS = $(LOCAL_LDFLAGS) $(LI_LDFLAGS) $(LDFLAGS)
ifdef RELEASE
-ALL_CFLAGS += -O3 -NDEBUG
+ALL_CFLAGS += -O3 -DNDEBUG
endif
ifdef DEBUG
ifneq ($(V), 1)
NICE_CXX = @echo " CXX $@"; $(CXX)
NICE_LINK = @echo " LINK $@"; $(CXX)
-NICE_TEST = @echo " TEST"; $(TESTCMD) > test_suite.log 2>&1
+NICE_TEST = @echo " TEST"; $(TESTCMD) > $(TESTPRG).log 2>&1
NICE_MEMTEST = @echo " MEMTEST"; $(VALGRIND) --log-file=valgrind.log \
- $(TESTCMD) > valgrind.test_suite.log 2>&1
+ $(TESTCMD) > valgrind.$(TESTPRG).log 2>&1
NICE_CLEAN = @echo " CLEAN"; $(RM)
else
NICE_CXX = $(CXX)
default: all
-all: test_suite
+all: $(TESTPRG)
# dependency handling
@mkdir -p include
@ln -fs ../../src include/posixx
-test: all
+test: .test-stamp
+
+.test-stamp: $(TESTPRG)
$(NICE_TEST)
+ @touch $@
+
+memtest: .memtest-stamp
-memtest: all
+.memtest-stamp: $(TESTPRG)
$(NICE_MEMTEST)
+ @touch $@
clean:
$(NICE_CLEAN) -r $(TESTPRG) include $(OBJS) .deps valgrind.log \
- *.bb *.bbg *.da *.gcov *.gcda *.gcno gmon.out
+ *.bb *.bbg *.da *.gcov *.gcda *.gcno gmon.out .*-stamp
-.PHONY: default all test clean
+.PHONY: default all test memtest clean