2001-09-21 16:37:43 +04:00
#
2004-03-30 23:35:44 +04:00
# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
2010-05-24 13:04:27 +04:00
# Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved.
2001-09-21 16:37:43 +04:00
#
2007-09-21 14:16:45 +04:00
# This file is part of LVM2.
2001-09-21 16:37:43 +04:00
#
2004-03-30 23:35:44 +04:00
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
2001-09-21 16:37:43 +04:00
#
2004-03-30 23:35:44 +04:00
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2001-09-21 16:37:43 +04:00
srcdir = @srcdir@
top_srcdir = @top_srcdir@
2009-10-02 23:10:31 +04:00
top_builddir = @top_builddir@
2001-09-21 16:37:43 +04:00
2013-09-05 13:32:42 +04:00
SUBDIRS = conf daemons include lib libdaemon libdm man scripts tools
2004-02-14 01:56:45 +03:00
2009-07-31 15:49:53 +04:00
i f e q ( "@UDEV_RULES@" , "yes" )
SUBDIRS += udev
e n d i f
2004-02-14 01:56:45 +03:00
i f e q ( "@INTL@" , "yes" )
SUBDIRS += po
e n d i f
2009-05-22 18:44:59 +04:00
i f e q ( "@APPLIB@" , "yes" )
SUBDIRS += liblvm
e n d i f
2001-09-21 16:37:43 +04:00
2012-10-12 05:08:47 +04:00
i f e q ( "@PYTHON_BINDINGS@" , "yes" )
SUBDIRS += python
e n d i f
2013-06-03 14:05:02 +04:00
i f e q ( $( MAKECMDGOALS ) , c l e a n )
SUBDIRS += test
e n d i f
2011-08-11 23:18:17 +04:00
# FIXME Should use intermediate Makefiles here!
2001-12-11 19:26:34 +03:00
i f e q ( $( MAKECMDGOALS ) , d i s t c l e a n )
2013-06-28 12:46:00 +04:00
SUBDIRS = conf include man test scripts \
2012-02-28 22:35:04 +04:00
libdaemon lib tools daemons libdm \
2012-10-12 05:08:47 +04:00
udev po liblvm python \
2012-06-11 19:12:20 +04:00
unit-tests/datastruct unit-tests/mm unit-tests/regex
2012-10-15 17:15:59 +04:00
tools.distclean : test .distclean
2001-12-11 19:26:34 +03:00
e n d i f
2010-04-06 13:54:11 +04:00
DISTCLEAN_DIRS += lcov_reports*
DISTCLEAN_TARGETS += config.cache config.log config.status make.tmpl
2001-12-11 19:26:34 +03:00
2001-09-21 16:37:43 +04:00
i n c l u d e m a k e . t m p l
2008-11-01 05:19:19 +03:00
libdm : include
2012-02-28 22:35:04 +04:00
lib : libdm libdaemon
2009-03-06 19:19:52 +03:00
liblvm : lib
2012-02-28 22:35:04 +04:00
daemons : lib libdaemon tools
tools : lib libdaemon device -mapper
2008-11-01 01:29:44 +03:00
po : tools daemons
2012-08-01 15:54:32 +04:00
scripts : liblvm libdm
2002-01-21 19:02:55 +03:00
2010-08-02 17:56:34 +04:00
lib.device-mapper : include .device -mapper
2008-11-04 01:14:30 +03:00
libdm.device-mapper : include .device -mapper
2010-08-02 16:10:35 +04:00
liblvm.device-mapper : include .device -mapper
2008-11-04 02:01:21 +03:00
daemons.device-mapper : libdm .device -mapper
2008-11-01 05:19:19 +03:00
tools.device-mapper : libdm .device -mapper
2013-09-05 13:32:42 +04:00
scripts.device-mapper : include .device -mapper
2008-11-04 18:55:27 +03:00
device-mapper : tools .device -mapper daemons .device -mapper man .device -mapper
2008-11-01 05:19:19 +03:00
2004-02-14 01:56:45 +03:00
i f e q ( "@INTL@" , "yes" )
lib.pofile : include .pofile
tools.pofile : lib .pofile
2004-06-24 12:02:38 +04:00
daemons.pofile : lib .pofile
2008-11-01 01:29:44 +03:00
po.pofile : tools .pofile daemons .pofile
2004-02-14 01:56:45 +03:00
pofile : po .pofile
e n d i f
2002-01-21 19:02:55 +03:00
2012-10-12 05:08:47 +04:00
i f e q ( "@PYTHON_BINDINGS@" , "yes" )
python : liblvm
e n d i f
2010-03-29 18:11:17 +04:00
i f n e q ( "$(CFLOW_CMD)" , "" )
tools.cflow : libdm .cflow lib .cflow
daemons.cflow : tools .cflow
cflow : include .cflow
2006-04-19 19:33:07 +04:00
e n d i f
i f n e q ( "@CSCOPE_CMD@" , "" )
2010-03-29 18:07:56 +04:00
cscope.out :
@CSCOPE_CMD@ -b -R -s$( top_srcdir)
2006-04-19 19:33:07 +04:00
all : cscope .out
e n d i f
2010-03-29 18:07:56 +04:00
DISTCLEAN_TARGETS += cscope.out
2007-09-18 18:00:42 +04:00
2013-12-15 20:26:28 +04:00
check check_system check_cluster check_local check_lvmetad unit : all
2010-04-13 17:28:52 +04:00
$( MAKE) -C test $( @)
2008-06-27 19:35:09 +04:00
2010-05-20 17:47:21 +04:00
install_system_dirs :
2010-11-23 00:39:47 +03:00
$( INSTALL_DIR) $( DESTDIR) $( DEFAULT_SYS_DIR)
2010-05-20 17:47:21 +04:00
$( INSTALL_ROOT_DIR) $( DESTDIR) $( DEFAULT_ARCHIVE_DIR)
$( INSTALL_ROOT_DIR) $( DESTDIR) $( DEFAULT_BACKUP_DIR)
$( INSTALL_ROOT_DIR) $( DESTDIR) $( DEFAULT_CACHE_DIR)
$( INSTALL_ROOT_DIR) $( DESTDIR) $( DEFAULT_LOCK_DIR)
2010-07-28 17:55:42 +04:00
$( INSTALL_ROOT_DIR) $( DESTDIR) $( DEFAULT_RUN_DIR)
2010-05-20 17:47:21 +04:00
$( INSTALL_ROOT_DATA) /dev/null $( DESTDIR) $( DEFAULT_CACHE_DIR) /.cache
2010-05-20 18:45:14 +04:00
install_initscripts :
$( MAKE) -C scripts install_initscripts
2012-07-31 18:46:24 +04:00
install_systemd_generators :
$( MAKE) -C scripts install_systemd_generators
2011-07-28 16:57:26 +04:00
install_systemd_units :
$( MAKE) -C scripts install_systemd_units
2012-10-12 05:08:47 +04:00
i f e q ( "@PYTHON_BINDINGS@" , "yes" )
install_python_bindings :
$( MAKE) -C liblvm/python install_python_bindings
e n d i f
2012-02-22 21:55:10 +04:00
install_tmpfiles_configuration :
$( MAKE) -C scripts install_tmpfiles_configuration
2010-04-06 13:50:07 +04:00
LCOV_TRACES = libdm.info lib.info tools.info \
daemons/dmeventd.info daemons/clvmd.info
CLEAN_TARGETS += $( LCOV_TRACES)
2010-03-29 18:06:06 +04:00
i f n e q ( "$(LCOV)" , "" )
2010-04-06 13:50:07 +04:00
.PHONY : lcov -reset lcov lcov -dated $( LCOV_TRACES )
2008-06-27 19:35:09 +04:00
2008-06-27 23:24:17 +04:00
i f e q ( $( MAKECMDGOALS ) , l c o v - d a t e d )
2010-04-06 13:50:07 +04:00
LCOV_REPORTS_DIR := lcov_reports-$( shell date +%Y%m%d%k%M%S)
lcov-dated : lcov
2008-06-27 23:24:17 +04:00
e l s e
2010-04-06 13:50:07 +04:00
LCOV_REPORTS_DIR := lcov_reports
2008-06-27 23:24:17 +04:00
e n d i f
2008-06-27 19:35:09 +04:00
2008-06-27 23:24:17 +04:00
lcov-reset :
2010-04-06 13:50:07 +04:00
$( LCOV) --zerocounters $( addprefix -d , $( basename $( LCOV_TRACES) ) )
# maybe use subdirs processing to create tracefiles...
$(LCOV_TRACES) :
2012-03-23 13:39:03 +04:00
$( LCOV) -b $( basename $@ ) -d $( basename $@ ) \
--ignore-errors source -c -o - | $( SED) \
2010-04-06 13:50:07 +04:00
-e "s/\(dmeventd_lvm.[ch]\)/plugins\/lvm2\/\1/" \
2012-03-23 13:39:03 +04:00
-e "s/dmeventd_\(mirror\|snapshot\|thin\|raid\)\.c/plugins\/\1\/dmeventd_\1\.c/" \
2010-04-06 13:50:07 +04:00
>$@
2008-06-27 19:35:09 +04:00
2010-03-29 18:06:06 +04:00
i f n e q ( "$(GENHTML)" , "" )
2010-04-06 13:50:07 +04:00
lcov : $( LCOV_TRACES )
$( RM) -r $( LCOV_REPORTS_DIR)
$( MKDIR_P) $( LCOV_REPORTS_DIR)
for i in $( LCOV_TRACES) ; do \
test -s $$ i && lc = " $$ lc $$ i " ; \
done ; \
2010-04-06 15:53:53 +04:00
test -z " $$ lc " || $( GENHTML) -p @abs_top_builddir@ \
2010-04-06 13:50:07 +04:00
-o $( LCOV_REPORTS_DIR) $$ lc
2008-06-27 19:35:09 +04:00
e n d i f
e n d i f
2010-07-20 18:38:44 +04:00
i f e q ( "$(TESTING)" , "yes" )
# testing and report generation
RUBY = ruby1.9 -Ireport-generators/lib -Ireport-generators/test
2012-10-12 05:08:47 +04:00
.PHONY : unit -test ruby -test test -programs
2010-07-20 18:38:44 +04:00
2010-08-09 14:56:01 +04:00
# FIXME: put dependencies on libdm and liblvm
2011-08-11 23:18:17 +04:00
# FIXME: Should be handled by Makefiles in subdirs, not here at top level.
2010-07-20 18:38:44 +04:00
test-programs :
2010-07-20 19:25:39 +04:00
cd unit-tests/regex && $( MAKE)
cd unit-tests/datastruct && $( MAKE)
2010-08-09 14:56:01 +04:00
cd unit-tests/mm && $( MAKE)
2010-07-20 18:38:44 +04:00
unit-test : test -programs
$( RUBY) report-generators/unit_test.rb $( shell find . -name TESTS)
$( RUBY) report-generators/title_page.rb
memcheck : test -programs
$( RUBY) report-generators/memcheck.rb $( shell find . -name TESTS)
$( RUBY) report-generators/title_page.rb
ruby-test :
$( RUBY) report-generators/test/ts.rb
2010-08-02 16:10:35 +04:00
e n d i f