diff --git a/parser/Makefile b/parser/Makefile index 895fee3df..20abd9e11 100644 --- a/parser/Makefile +++ b/parser/Makefile @@ -51,6 +51,9 @@ CFLAGS = -g -O2 -pipe ifdef DEBUG CFLAGS += -pg -D DEBUG endif +ifdef COVERAGE +CFLAGS = -g -pg -fprofile-arcs -ftest-coverage +endif endif #CFLAGS LIBAPPARMOR_PATH=../libraries/libapparmor/src/ @@ -149,6 +152,9 @@ indep: docs all: arch indep +.PHONY: coverage +coverage: + $(MAKE) clean apparmor_parser COVERAGE=1 apparmor_parser: $(OBJECTS) $(AAREOBJECTS) $(CXX) $(LDFLAGS) $(EXTRA_CFLAGS) -o $@ $(OBJECTS) $(LIBS) \ @@ -302,7 +308,8 @@ install-indep: .SILENT: clean .PHONY: clean clean: _clean - rm -f core core.* *.o *.s *.a *~ + rm -f core core.* *.o *.s *.a *~ *.gcda *.gcno + rm -f gmon.out rm -f $(TOOLS) $(TESTS) rm -f $(LEX_C_FILES) rm -f $(YACC_C_FILES) diff --git a/parser/libapparmor_re/Makefile b/parser/libapparmor_re/Makefile index 053c8c633..b54586daa 100644 --- a/parser/libapparmor_re/Makefile +++ b/parser/libapparmor_re/Makefile @@ -29,4 +29,4 @@ parse.cc : parse.y parse.h flex-tables.h ../immunix.h ${BISON} -o $@ $< clean: - rm -f *.o parse.cc ${TARGET} + rm -f *.o parse.cc ${TARGET} *.gcda *.gcno diff --git a/parser/tst/Makefile b/parser/tst/Makefile index 8b1aa8f41..d254809d3 100644 --- a/parser/tst/Makefile +++ b/parser/tst/Makefile @@ -59,3 +59,4 @@ $(PARSER): clean: find $(GEN_TRANS_DIRS) -type f | xargs rm -f + rm -f gmon.out