2 # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3 # Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
5 # This file is part of LVM2.
7 # This copyrighted material is made available to anyone wishing to use,
8 # modify, copy, or redistribute it subject to the terms and conditions
9 # of the GNU General Public License v.2.
11 # You should have received a copy of the GNU General Public License
12 # along with this program; if not, write to the Free Software Foundation,
13 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 top_srcdir
= @top_srcdir@
17 top_builddir
= @top_builddir@
20 SUBDIRS
= doc
include man scripts
22 ifeq ("@UDEV_RULES@", "yes")
26 ifeq ("@INTL@", "yes")
30 SUBDIRS
+= lib tools daemons libdm
32 ifeq ("@APPLIB@", "yes")
36 ifeq ($(MAKECMDGOALS
),distclean)
37 SUBDIRS
= doc
include man scripts \
38 lib tools daemons libdm \
39 udev po liblvm
test/api
test
41 DISTCLEAN_DIRS
+= lcov_reports
*
42 DISTCLEAN_TARGETS
+= config.cache config.log config.status make.tmpl
50 tools
: lib device-mapper
53 libdm.device-mapper
: include.device-mapper
54 daemons.device-mapper
: libdm.device-mapper
55 tools.device-mapper
: libdm.device-mapper
56 device-mapper
: tools.device-mapper daemons.device-mapper man.device-mapper
58 ifeq ("@INTL@", "yes")
59 lib.pofile
: include.pofile
60 tools.pofile
: lib.pofile
61 daemons.pofile
: lib.pofile
62 po.pofile
: tools.pofile daemons.pofile
66 ifneq ("$(CFLOW_CMD)", "")
67 tools.cflow
: libdm.cflow lib.cflow
68 daemons.cflow
: tools.cflow
72 ifneq ("@CSCOPE_CMD@", "")
74 @CSCOPE_CMD@
-b
-R
-s
$(top_srcdir
)
77 DISTCLEAN_TARGETS
+= cscope.out
82 LCOV_TRACES
= libdm.
info lib.
info tools.
info \
83 daemons
/dmeventd.
info daemons
/clvmd.
info
84 CLEAN_TARGETS
+= $(LCOV_TRACES
)
87 .PHONY
: lcov-reset lcov lcov-dated
$(LCOV_TRACES
)
89 ifeq ($(MAKECMDGOALS
),lcov-dated
)
90 LCOV_REPORTS_DIR
:= lcov_reports-
$(shell date
+%Y
%m
%d
%k
%M
%S
)
93 LCOV_REPORTS_DIR
:= lcov_reports
97 $(LCOV
) --zerocounters
$(addprefix -d
, $(basename $(LCOV_TRACES
)))
99 # maybe use subdirs processing to create tracefiles...
101 $(LCOV
) -b
$(top_srcdir
)/$(basename $@
) \
102 -d
$(basename $@
) -c
-o
- |
$(SED
) \
103 -e
"s/\(dmeventd_lvm.[ch]\)/plugins\/lvm2\/\1/" \
104 -e
"s/\(dmeventd_mirror.c\)/plugins\/mirror\/\1/" \
105 -e
"s/\(dmeventd_snapshot.c\)/plugins\/snapshot\/\1/" \
108 ifneq ("$(GENHTML)", "")
110 $(RM
) -r
$(LCOV_REPORTS_DIR
)
111 $(MKDIR_P
) $(LCOV_REPORTS_DIR
)
112 for i in
$(LCOV_TRACES
); do \
113 test -s
$$i && lc
="$$lc $$i"; \
115 test -z
"$$lc" ||
$(GENHTML
) --frames
-p @abs_top_builddir@ \
116 -o
$(LCOV_REPORTS_DIR
) $$lc