CXXOPTS=-D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++11 -Os -Wall -Wno-invalid-offsetof -fno-rtti
EXTRA_LIBS=
BUILD_SHUTDOWN=yes
+SANITIZEOPTS=-fsanitize=address,undefined
# OpenBSD, tested with GCC 4.9.3 and gmake:
#CXX=clang++
#CXXOPTS=-std=gnu++11 -Os -Wall -fno-rtti
#EXTRA_LIBS=
#BUILD_SHUTDOWN=no
+#SANITIZEOPTS=
# (shutdown command not available for OpenBSD yet).
# MacOS: use Linux settings, but don't build shutdown:
-include ../../mconfig
objects = tests.o
-parent_objs = ../service.o ../control.o ../dinit-log.o ../load_service.o ../dinit.o
+parent_objs = service.o control.o dinit-log.o load_service.o dinit.o
check: build-tests
./tests
build-tests: tests
tests: $(objects) $(parent_objs)
- $(CXX) -o tests tests.o $(parent_objs) $(EXTRA_LIBS)
+ $(CXX) $(SANITIZEOPTS) -o tests tests.o $(parent_objs) $(EXTRA_LIBS)
$(objects): %.o: %.cc
- $(CXX) $(CXXOPTS) -I.. -I../dasynq -c $< -o $@
+ $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -I.. -I../dasynq -c $< -o $@
+
+$(parent_objs): %.o: ../%.cc
+ $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -I.. -I../dasynq -c $< -o $@
clean:
rm -f *.o *.d