src/Makefile

changeset 1064
f3b04cd60776
parent 1050
3df63e95921a
child 1067
7799addf475f
equal deleted inserted replaced
1063:e453e717876e 1064:f3b04cd60776
27 iterator.c linked_list.c list.c map.c mempool.c printf.c string.c tree.c \ 27 iterator.c linked_list.c list.c map.c mempool.c printf.c string.c tree.c \
28 streams.c szmul.c properties.c json.c 28 streams.c szmul.c properties.c json.c
29 29
30 OBJ_EXT=.o 30 OBJ_EXT=.o
31 OBJ=$(SRC:%.c=$(build_dir)/%$(OBJ_EXT)) 31 OBJ=$(SRC:%.c=$(build_dir)/%$(OBJ_EXT))
32 GCOV=$(SRC:%.c=%.c.gcov)
33 32
34 static: $(build_dir)/libucx_static$(STLIB_EXT) 33 static: $(build_dir)/libucx_static$(STLIB_EXT)
35 34
36 shared: $(build_dir)/libucx$(SHLIB_EXT) 35 shared: $(build_dir)/libucx$(SHLIB_EXT)
37 36
38 check-coverage: $(GCOV) 37 check-coverage: $(SRC:%.c=$(build_dir)/%.gcda)
39 mv *.gcov "$(build_dir)" 38 gcovr --html-details $(build_dir)/coverage.html \
39 --object-directory $(build_dir) \
40 --root $(root_dir)/src \
41 --exclude-directories $(build_dir)/tests \
42 $(build_dir)
40 43
41 %.c.gcov: %.c $(build_dir)/%.gcno 44 $(build_dir)/%.gcda:
42 @tabs 22
43 @gcov -Ho "$(build_dir)" $< | grep -A1 'File' | grep -v '\--' \
44 | sed 's/File / /' | sed 's/Lines executed:/\t/' | tr -d '\n'"'" \
45 | sed -E 's/(of [0-9]+)/\1\n/g'
46 @tabs -8
47
48 $(build_dir)/%.gcno:
49 test -f "$@" 45 test -f "$@"
50 46
51 $(build_dir)/libucx_static$(STLIB_EXT): $(OBJ) 47 $(build_dir)/libucx_static$(STLIB_EXT): $(OBJ)
52 $(AR) $(ARFLAGS) $@ $^ 48 $(AR) $(ARFLAGS) $@ $^
53 49
58 $(MKDIR) $(libdir) $(includedir)/cx 54 $(MKDIR) $(libdir) $(includedir)/cx
59 $(RMFILE) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR) 55 $(RMFILE) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
60 $(RMFILE) $(libdir)/libucx$(SHLIB_EXT) 56 $(RMFILE) $(libdir)/libucx$(SHLIB_EXT)
61 $(COPYFILE) $(build_dir)/libucx_static$(STLIB_EXT) $(libdir)/libucx_static$(STLIB_EXT) 57 $(COPYFILE) $(build_dir)/libucx_static$(STLIB_EXT) $(libdir)/libucx_static$(STLIB_EXT)
62 $(COPYFILE) $(build_dir)/libucx$(SHLIB_EXT) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION) 58 $(COPYFILE) $(build_dir)/libucx$(SHLIB_EXT) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION)
63 $(COPYALL) $(src_dir)/src/cx $(includedir) 59 $(COPYALL) $(root_dir)/src/cx $(includedir)
64 $(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR) 60 $(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
65 $(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR) $(libdir)/libucx$(SHLIB_EXT) 61 $(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR) $(libdir)/libucx$(SHLIB_EXT)
66 62
67 FORCE: 63 FORCE:
68 64

mercurial