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
21 ifeq ("@UDEV_RULES@", "yes")
25 ifeq ("@INTL@", "yes")
29 SUBDIRS
+= lib tools daemons libdm
31 ifeq ("@APPLIB@", "yes")
35 ifeq ("@BUILD_LVMETAD@", "yes")
41 # FIXME Should use intermediate Makefiles here!
42 ifeq ($(MAKECMDGOALS
),distclean)
43 SUBDIRS
= doc
include man scripts \
44 libdaemon lib tools daemons libdm \
46 unit-tests
/datastruct unit-tests
/mm unit-tests
/regex
48 DISTCLEAN_DIRS
+= lcov_reports
*
49 DISTCLEAN_TARGETS
+= config.cache config.log config.status make.tmpl
56 daemons
: lib libdaemon tools
57 tools
: lib libdaemon device-mapper
61 lib.device-mapper
: include.device-mapper
62 libdm.device-mapper
: include.device-mapper
63 liblvm.device-mapper
: include.device-mapper
64 daemons.device-mapper
: libdm.device-mapper
65 tools.device-mapper
: libdm.device-mapper
66 device-mapper
: tools.device-mapper daemons.device-mapper man.device-mapper
68 ifeq ("@INTL@", "yes")
69 lib.pofile
: include.pofile
70 tools.pofile
: lib.pofile
71 daemons.pofile
: lib.pofile
72 po.pofile
: tools.pofile daemons.pofile
76 ifneq ("$(CFLOW_CMD)", "")
77 tools.cflow
: libdm.cflow lib.cflow
78 daemons.cflow
: tools.cflow
82 ifneq ("@CSCOPE_CMD@", "")
84 @CSCOPE_CMD@
-b
-R
-s
$(top_srcdir
)
87 DISTCLEAN_TARGETS
+= cscope.out
89 check check_cluster check_local check_lvmetad unit
: all
93 $(INSTALL_DIR
) $(DESTDIR
)$(DEFAULT_SYS_DIR
)
94 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_ARCHIVE_DIR
)
95 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_BACKUP_DIR
)
96 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_CACHE_DIR
)
97 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_LOCK_DIR
)
98 $(INSTALL_ROOT_DIR
) $(DESTDIR
)$(DEFAULT_RUN_DIR
)
99 $(INSTALL_ROOT_DATA
) /dev
/null
$(DESTDIR
)$(DEFAULT_CACHE_DIR
)/.cache
102 $(MAKE
) -C scripts install_initscripts
104 install_systemd_generators
:
105 $(MAKE
) -C scripts install_systemd_generators
107 install_systemd_units
:
108 $(MAKE
) -C scripts install_systemd_units
110 install_tmpfiles_configuration
:
111 $(MAKE
) -C scripts install_tmpfiles_configuration
113 LCOV_TRACES
= libdm.
info lib.
info tools.
info \
114 daemons
/dmeventd.
info daemons
/clvmd.
info
115 CLEAN_TARGETS
+= $(LCOV_TRACES
)
117 ifneq ("$(LCOV)", "")
118 .PHONY
: lcov-reset lcov lcov-dated
$(LCOV_TRACES
)
120 ifeq ($(MAKECMDGOALS
),lcov-dated
)
121 LCOV_REPORTS_DIR
:= lcov_reports-
$(shell date
+%Y
%m
%d
%k
%M
%S
)
124 LCOV_REPORTS_DIR
:= lcov_reports
128 $(LCOV
) --zerocounters
$(addprefix -d
, $(basename $(LCOV_TRACES
)))
130 # maybe use subdirs processing to create tracefiles...
132 $(LCOV
) -b
$(basename $@
) -d
$(basename $@
) \
133 --ignore-errors source
-c
-o
- |
$(SED
) \
134 -e
"s/\(dmeventd_lvm.[ch]\)/plugins\/lvm2\/\1/" \
135 -e
"s/dmeventd_\(mirror\|snapshot\|thin\|raid\)\.c/plugins\/\1\/dmeventd_\1\.c/" \
138 ifneq ("$(GENHTML)", "")
140 $(RM
) -r
$(LCOV_REPORTS_DIR
)
141 $(MKDIR_P
) $(LCOV_REPORTS_DIR
)
142 for i in
$(LCOV_TRACES
); do \
143 test -s
$$i && lc
="$$lc $$i"; \
145 test -z
"$$lc" ||
$(GENHTML
) -p @abs_top_builddir@ \
146 -o
$(LCOV_REPORTS_DIR
) $$lc
151 ifeq ("$(TESTING)", "yes")
152 # testing and report generation
153 RUBY
=ruby1.9
-Ireport-generators
/lib
-Ireport-generators
/test
155 .PHONEY
: unit-test ruby-test test-programs
157 # FIXME: put dependencies on libdm and liblvm
158 # FIXME: Should be handled by Makefiles in subdirs, not here at top level.
160 cd unit-tests
/regex
&& $(MAKE
)
161 cd unit-tests
/datastruct
&& $(MAKE
)
162 cd unit-tests
/mm
&& $(MAKE
)
164 unit-test
: test-programs
165 $(RUBY
) report-generators
/unit_test.rb
$(shell find .
-name TESTS
)
166 $(RUBY
) report-generators
/title_page.rb
168 memcheck
: test-programs
169 $(RUBY
) report-generators
/memcheck.rb
$(shell find .
-name TESTS
)
170 $(RUBY
) report-generators
/title_page.rb
173 $(RUBY
) report-generators
/test/ts.rb