@MAINTAINER_CMT@$(top_srcdir)/configure: $(top_srcdir)/configure.in
@MAINTAINER_CMT@ cd $(top_srcdir) && autoheader && autoconf
+coverage.txt: Makefile $(SRCS)
+ if test -n "$(SRCS)"; then \
+ gcov -s $(top_srcdir) -o . $(SRCS) > coverage.txt 2>&1 ; \
+ fi
+
+clean::
+ $(RM) -f *.gcda *.gcov *.gcno coverage.txt
+
#
# Make depend magic...
#
uninstall-libs: uninstall-libs-recursive
+coverage.txt: coverage.txt-recursive
+
check-recursive: all
TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
- mostlyclean-recursive realclean-recursive:
+ mostlyclean-recursive realclean-recursive coverage.txt-recursive:
@for subdir in $(SUBDIRS); do \
if test -d $$subdir ; then \
target=`echo $@|$(SED) 's/-recursive//'`; \
done
all-progs-recursive install-progs-recursive install-strip-progs-recursive \
- uninstall-progs-recursive: all-libs-recursive
+ uninstall-progs-recursive coverage.txt-progs-recursive: all-libs-recursive
@for subdir in $(PROG_SUBDIRS); do \
if test -d $$subdir ; then \
target=`echo $@|$(SED) 's/-progs-recursive//'`; \
all-libs-recursive install-libs-recursive install-strip-libs-recursive \
uninstall-libs-recursive install-shlibs-libs-recursive \
- install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive:
+ install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive \
+ coverage.txt-libs-recursive:
@for subdir in $(LIB_SUBDIRS); do \
if test -d $$subdir ; then \
target=`echo $@|$(SED) 's/-libs-recursive//'`; \
mostlyclean: mostlyclean-recursive mostlyclean-local
-clean: clean-recursive clean-local clean-doc
+clean:: clean-recursive clean-local clean-doc
$(RM) -f $(SUBS)
distclean: distclean-doc distclean-recursive
enable_elf_shlibs
enable_bsd_shlibs
enable_profile
+enable_gcov
enable_checker
enable_jbd_debug
enable_blkid_debug
--enable-elf-shlibs select ELF shared libraries
--enable-bsd-shlibs select BSD shared libraries
--enable-profile build profiling libraries
+ --enable-gcov build for coverage testing using gcov
--enable-checker build checker libraries
--enable-jbd-debug enable journal debugging
--enable-blkid-debug enable blkid debugging
+# Check whether --enable-gcov was given.
+if test "${enable_gcov+set}" = set; then :
+ enableval=$enable_gcov; if test "$enableval" = "yes"
+then
+ CFLAGS="-g -fprofile-arcs -ftest-coverage"
+ LDFLAGS="-fprofile-arcs -ftest-coverage"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling gcov support" >&5
+$as_echo "Enabling gcov support" >&6; }
+fi
+
+fi
+
# Check whether --enable-checker was given.
if test "${enable_checker+set}" = set; then :
enableval=$enable_checker; if test "$enableval" = "no"
AC_SUBST(PROFILE_CMT)
AC_SUBST_FILE(MAKEFILE_PROFILE)
dnl
+dnl handle --enable-gcov
+dnl
+AC_ARG_ENABLE([gcov],
+[ --enable-gcov build for coverage testing using gcov],
+if test "$enableval" = "yes"
+then
+ CFLAGS="-g -fprofile-arcs -ftest-coverage"
+ LDFLAGS="-fprofile-arcs -ftest-coverage"
+ AC_MSG_RESULT([Enabling gcov support])
+fi
+)
+dnl
dnl handle --enable-checker
dnl
AC_ARG_ENABLE([checker],
$(RM) -f $(DESTDIR)$(man8dir)/$$i; \
done
-clean:
+clean::
$(RM) -f $(PROGS) debugfs.8 \#* *.s *.o *.a *~ debug_cmds.c \
extent_cmds.c ro_debug_cmds.c core rdebugfs debugfs.static
$(DESTDIR)$(root_sbindir)/fsck.ext4 \
$(DESTDIR)$(root_sbindir)/fsck.ext4dev
-clean:
+clean::
$(RM) -f $(PROGS) \#* *\# *.s *.o *.a *~ core e2fsck.static \
e2fsck.shared e2fsck.profiled flushb e2fsck.8 \
tst_problem tst_crc32 tst_region tst_refcount gen_crc32table \
ext2ed.conf: $(DEP_SUBSTITUTE) $(srcdir)/ext2ed.conf.in
$(SUBSTITUTE_UPTIME) $(srcdir)/ext2ed.conf.in ext2ed.conf
-clean:
+clean::
$(RM) -f ext2ed $(OBJS) $(DOCS) ext2ed.conf ext2ed.8
-rmdir doc
ID: $(HEADERS) $(SOURCES)
here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
+coverage.txt::
mostlyclean:
rm -f *.a *.la *.o *.obj *.lo core core.*
rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
rm -f -r .libs _libs
-clean: mostlyclean
+clean:: mostlyclean
distclean: clean
rm -f Makefile ID TAGS
tst_types: tst_types.o blkid_types.h
$(E) " LD $@"
- $(Q) $(CC) -o tst_types tst_types.o
+ $(Q) $(CC) -o tst_types $(ALL_LDFLAGS) tst_types.o
../../misc/blkid.o: $(top_srcdir)/misc/blkid.c blkid.h
$(E) " CC $@"
tst_badblocks: tst_badblocks.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR)
$(E) " LD $@"
- $(Q) $(CC) -o tst_badblocks tst_badblocks.o $(STATIC_LIBEXT2FS) \
- $(STATIC_LIBCOM_ERR) $(SYSLIBS)
+ $(Q) $(CC) -o tst_badblocks tst_badblocks.o $(ALL_LDFLAGS) \
+ $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(SYSLIBS)
tst_icount: $(srcdir)/icount.c $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR)
$(E) " LD $@"
tst_iscan: tst_iscan.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR)
$(E) " LD $@"
- $(Q) $(CC) -o tst_iscan tst_iscan.o $(STATIC_LIBEXT2FS) \
+ $(Q) $(CC) -o tst_iscan tst_iscan.o $(ALL_LDFLAGS) $(STATIC_LIBEXT2FS) \
$(STATIC_LIBCOM_ERR) $(SYSLIBS)
tst_getsize: tst_getsize.o $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR)
tst_types: tst_types.o ext2_types.h
$(E) " LD $@"
- $(Q) $(CC) -o tst_types tst_types.o $(SYSLIBS)
+ $(Q) $(CC) -o tst_types tst_types.o $(ALL_LDFLAGS) $(SYSLIBS)
tst_super_size.o: $(srcdir)/tst_super_size.c $(srcdir)/ext2_fs.h
tst_super_size: tst_super_size.o
$(E) " LD $@"
- $(Q) $(CC) -o tst_super_size tst_super_size.o $(SYSLIBS)
+ $(Q) $(CC) -o tst_super_size tst_super_size.o $(ALL_LDFLAGS) $(SYSLIBS)
tst_fs_struct.o: $(srcdir)/tst_fs_struct.c $(srcdir)/ext2fs.h
tst_inode_size: tst_inode_size.o
$(E) " LD $@"
- $(Q) $(CC) -o tst_inode_size tst_inode_size.o $(SYSLIBS)
+ $(Q) $(CC) -o tst_inode_size tst_inode_size.o $(ALL_LDFLAGS) $(SYSLIBS)
ext2_tdbtool: tdbtool.o
$(E) " LD $@"
- $(Q) $(CC) -o ext2_tdbtool tdbtool.o tdb.o $(SYSLIBS)
+ $(Q) $(CC) -o ext2_tdbtool tdbtool.o tdb.o $(ALL_LDFLAGS) $(SYSLIBS)
extent_dbg.c: $(srcdir)/extent_dbg.ct
$(E) " MK_CMDS $<"
$(RM) $(DESTDIR)/$(root_sysconfdir)/mke2fs.conf; \
fi
-clean:
+clean::
$(RM) -f $(SPROGS) $(USPROGS) $(UPROGS) $(UMANPAGES) $(SMANPAGES) \
$(FMANPAGES) profile.h \
base_device base_device.out mke2fs.static filefrag e2freefrag \
rm -f $(DOMAIN).po.bak
rm -fr *.o
-clean: mostlyclean
+coverage.txt::
+
+clean:: mostlyclean
distclean: clean
rm -f Makefile Makefile.in POTFILES *.mo
exit 1 ; \
fi
-clean:
+clean::
$(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \
resize2fs.static test_extent.out
$(E) " MK_CMDS $@"
$(Q) $(MK_CMDS) $(srcdir)/test_icount_cmds.ct
-clean:
+clean::
$(RM) -f $(PROGS) test_rel_cmds.c test_icount_cmds.c \
\#* *.s *.o *.a *~ core
sh gen-tarball all
sh gen-tarball subset
-clean:
+clean::
$(RM) -f $(PROGS) \#* *.s *.o *.a *~ core *.tar.gz gen-tarball \
copy-sparse dirpaths.h