2 # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3 # Copyright (C) 2004-2010 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@
19 SUBDIRS
= doc
include man scripts
21 ifeq ("@UDEV_RULES@", "yes")
25 ifeq ("@INTL@", "yes")
29 SUBDIRS
+= lib tools daemons libdm
31 ifeq ("@APPLIB@", "yes")
35 ifeq ($(MAKECMDGOALS
),distclean)
36 SUBDIRS
= doc
include man scripts \
37 lib tools daemons libdm \
38 udev po liblvm
test/api
test
40 DISTCLEAN_DIRS
+= lcov_reports
*
41 DISTCLEAN_TARGETS
+= config.cache config.log config.status make.tmpl
49 tools
: lib device-mapper
52 libdm.device-mapper
: include.device-mapper
53 daemons.device-mapper
: libdm.device-mapper
54 tools.device-mapper
: libdm.device-mapper
55 device-mapper
: tools.device-mapper daemons.device-mapper man.device-mapper
57 ifeq ("@INTL@", "yes")
58 lib.pofile
: include.pofile
59 tools.pofile
: lib.pofile
60 daemons.pofile
: lib.pofile
61 po.pofile
: tools.pofile daemons.pofile
65 ifneq ("$(CFLOW_CMD)", "")
66 tools.cflow
: libdm.cflow lib.cflow
67 daemons.cflow
: tools.cflow
71 ifneq ("@CSCOPE_CMD@", "")
73 @CSCOPE_CMD@
-b
-R
-s
$(top_srcdir
)
76 DISTCLEAN_TARGETS
+= cscope.out
78 check check_cluster check_local
: all
82 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_SYS_DIR
)
83 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_ARCHIVE_DIR
)
84 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_BACKUP_DIR
)
85 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_CACHE_DIR
)
86 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_LOCK_DIR
)
87 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_RUN_DIR
)
88 $(INSTALL_ROOT_DATA
) /dev
/null
$(DESTDIR
)$(DEFAULT_CACHE_DIR
)/.cache
91 $(MAKE
) -C scripts install_initscripts
93 LCOV_TRACES
= libdm.
info lib.
info tools.
info \
94 daemons
/dmeventd.
info daemons
/clvmd.
info
95 CLEAN_TARGETS
+= $(LCOV_TRACES
)
98 .PHONY
: lcov-reset lcov lcov-dated
$(LCOV_TRACES
)
100 ifeq ($(MAKECMDGOALS
),lcov-dated
)
101 LCOV_REPORTS_DIR
:= lcov_reports-
$(shell date
+%Y
%m
%d
%k
%M
%S
)
104 LCOV_REPORTS_DIR
:= lcov_reports
108 $(LCOV
) --zerocounters
$(addprefix -d
, $(basename $(LCOV_TRACES
)))
110 # maybe use subdirs processing to create tracefiles...
112 $(LCOV
) -b
$(top_srcdir
)/$(basename $@
) \
113 -d
$(basename $@
) -c
-o
- |
$(SED
) \
114 -e
"s/\(dmeventd_lvm.[ch]\)/plugins\/lvm2\/\1/" \
115 -e
"s/\(dmeventd_mirror.c\)/plugins\/mirror\/\1/" \
116 -e
"s/\(dmeventd_snapshot.c\)/plugins\/snapshot\/\1/" \
119 ifneq ("$(GENHTML)", "")
121 $(RM
) -r
$(LCOV_REPORTS_DIR
)
122 $(MKDIR_P
) $(LCOV_REPORTS_DIR
)
123 for i in
$(LCOV_TRACES
); do \
124 test -s
$$i && lc
="$$lc $$i"; \
126 test -z
"$$lc" ||
$(GENHTML
) -p @abs_top_builddir@ \
127 -o
$(LCOV_REPORTS_DIR
) $$lc
132 ifeq ("$(TESTING)", "yes")
133 # testing and report generation
134 RUBY
=ruby1.9
-Ireport-generators
/lib
-Ireport-generators
/test
136 .PHONEY
: unit-test ruby-test test-programs
139 cd unit-tests
/regex
&& $(MAKE
)
140 cd unit-tests
/datastruct
&& $(MAKE
)
142 unit-test
: test-programs
143 $(RUBY
) report-generators
/unit_test.rb
$(shell find .
-name TESTS
)
144 $(RUBY
) report-generators
/title_page.rb
146 memcheck
: test-programs
147 $(RUBY
) report-generators
/memcheck.rb
$(shell find .
-name TESTS
)
148 $(RUBY
) report-generators
/title_page.rb
151 $(RUBY
) report-generators
/test/ts.rb