]>
Commit | Line | Data |
---|---|---|
795ca3e5 | 1 | # |
6606c3ae | 2 | # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. |
4ef2bf27 | 3 | # Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved. |
795ca3e5 | 4 | # |
7f8f8bfa | 5 | # This file is part of LVM2. |
795ca3e5 | 6 | # |
6606c3ae AK |
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. | |
795ca3e5 | 10 | # |
6606c3ae AK |
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 | |
795ca3e5 AK |
14 | |
15 | srcdir = @srcdir@ | |
16 | top_srcdir = @top_srcdir@ | |
db8b5af9 | 17 | top_builddir = @top_builddir@ |
795ca3e5 | 18 | |
fa68466e | 19 | SUBDIRS = doc include man |
69792976 | 20 | |
5d518f1f AK |
21 | ifeq ("@UDEV_RULES@", "yes") |
22 | SUBDIRS += udev | |
23 | endif | |
24 | ||
69792976 AK |
25 | ifeq ("@INTL@", "yes") |
26 | SUBDIRS += po | |
27 | endif | |
28 | ||
572fefeb AK |
29 | SUBDIRS += lib tools daemons libdm |
30 | ||
31 | ifeq ("@APPLIB@", "yes") | |
32 | SUBDIRS += liblvm | |
33 | endif | |
795ca3e5 | 34 | |
7126d8c2 AK |
35 | ifeq ("@BUILD_LVMETAD@", "yes") |
36 | SUBDIRS += libdaemon | |
37 | endif | |
38 | ||
fa68466e PR |
39 | SUBDIRS += scripts |
40 | ||
40dbaac8 | 41 | # FIXME Should use intermediate Makefiles here! |
5b82db9a | 42 | ifeq ($(MAKECMDGOALS),distclean) |
b7be589e | 43 | SUBDIRS = doc include man scripts \ |
7126d8c2 | 44 | libdaemon lib tools daemons libdm \ |
4b42d7ae | 45 | udev po liblvm test \ |
05fb5158 | 46 | unit-tests/datastruct unit-tests/mm unit-tests/regex |
5b82db9a | 47 | endif |
e83968fa ZK |
48 | DISTCLEAN_DIRS += lcov_reports* |
49 | DISTCLEAN_TARGETS += config.cache config.log config.status make.tmpl | |
5b82db9a | 50 | |
795ca3e5 AK |
51 | include make.tmpl |
52 | ||
0782ad50 | 53 | libdm: include |
7126d8c2 | 54 | lib: libdm libdaemon |
e0c64c6c | 55 | liblvm: lib |
7126d8c2 AK |
56 | daemons: lib libdaemon tools |
57 | tools: lib libdaemon device-mapper | |
b7edb5bf | 58 | po: tools daemons |
286f298b | 59 | scripts: liblvm libdm |
751acb38 | 60 | |
0dfae7e4 | 61 | lib.device-mapper: include.device-mapper |
2c44337b | 62 | libdm.device-mapper: include.device-mapper |
7622f312 | 63 | liblvm.device-mapper: include.device-mapper |
d4b9af44 | 64 | daemons.device-mapper: libdm.device-mapper |
0782ad50 | 65 | tools.device-mapper: libdm.device-mapper |
a479de2e | 66 | device-mapper: tools.device-mapper daemons.device-mapper man.device-mapper |
0782ad50 | 67 | |
69792976 AK |
68 | ifeq ("@INTL@", "yes") |
69 | lib.pofile: include.pofile | |
70 | tools.pofile: lib.pofile | |
d3c8211f | 71 | daemons.pofile: lib.pofile |
b7edb5bf | 72 | po.pofile: tools.pofile daemons.pofile |
69792976 AK |
73 | pofile: po.pofile |
74 | endif | |
751acb38 | 75 | |
b41f5924 ZK |
76 | ifneq ("$(CFLOW_CMD)", "") |
77 | tools.cflow: libdm.cflow lib.cflow | |
78 | daemons.cflow: tools.cflow | |
79 | cflow: include.cflow | |
8a2fc586 AK |
80 | endif |
81 | ||
82 | ifneq ("@CSCOPE_CMD@", "") | |
08db4eeb ZK |
83 | cscope.out: |
84 | @CSCOPE_CMD@ -b -R -s$(top_srcdir) | |
8a2fc586 AK |
85 | all: cscope.out |
86 | endif | |
08db4eeb | 87 | DISTCLEAN_TARGETS += cscope.out |
f0f8fbc6 | 88 | |
5ae6946e | 89 | check check_cluster check_local check_lvmetad unit: all |
a2263de0 | 90 | $(MAKE) -C test $(@) |
fddafd51 | 91 | |
3399ae32 | 92 | install_system_dirs: |
9cd9dab0 | 93 | $(INSTALL_DIR) $(DESTDIR)$(DEFAULT_SYS_DIR) |
3399ae32 AK |
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) | |
8bae0a1e | 98 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_RUN_DIR) |
3399ae32 AK |
99 | $(INSTALL_ROOT_DATA) /dev/null $(DESTDIR)$(DEFAULT_CACHE_DIR)/.cache |
100 | ||
3e730d47 AK |
101 | install_initscripts: |
102 | $(MAKE) -C scripts install_initscripts | |
103 | ||
fa68466e PR |
104 | install_systemd_generators: |
105 | $(MAKE) -C scripts install_systemd_generators | |
106 | ||
395d204d PR |
107 | install_systemd_units: |
108 | $(MAKE) -C scripts install_systemd_units | |
109 | ||
4417a8bd PR |
110 | install_tmpfiles_configuration: |
111 | $(MAKE) -C scripts install_tmpfiles_configuration | |
112 | ||
6a27e819 ZK |
113 | LCOV_TRACES = libdm.info lib.info tools.info \ |
114 | daemons/dmeventd.info daemons/clvmd.info | |
115 | CLEAN_TARGETS += $(LCOV_TRACES) | |
116 | ||
a6fd0319 | 117 | ifneq ("$(LCOV)", "") |
6a27e819 | 118 | .PHONY: lcov-reset lcov lcov-dated $(LCOV_TRACES) |
fddafd51 | 119 | |
5556819a | 120 | ifeq ($(MAKECMDGOALS),lcov-dated) |
6a27e819 ZK |
121 | LCOV_REPORTS_DIR := lcov_reports-$(shell date +%Y%m%d%k%M%S) |
122 | lcov-dated: lcov | |
5556819a | 123 | else |
6a27e819 | 124 | LCOV_REPORTS_DIR := lcov_reports |
5556819a | 125 | endif |
fddafd51 | 126 | |
5556819a | 127 | lcov-reset: |
6a27e819 ZK |
128 | $(LCOV) --zerocounters $(addprefix -d , $(basename $(LCOV_TRACES))) |
129 | ||
130 | # maybe use subdirs processing to create tracefiles... | |
131 | $(LCOV_TRACES): | |
1d6a2c73 ZK |
132 | $(LCOV) -b $(basename $@) -d $(basename $@) \ |
133 | --ignore-errors source -c -o - | $(SED) \ | |
6a27e819 | 134 | -e "s/\(dmeventd_lvm.[ch]\)/plugins\/lvm2\/\1/" \ |
1d6a2c73 | 135 | -e "s/dmeventd_\(mirror\|snapshot\|thin\|raid\)\.c/plugins\/\1\/dmeventd_\1\.c/" \ |
6a27e819 | 136 | >$@ |
fddafd51 | 137 | |
a6fd0319 | 138 | ifneq ("$(GENHTML)", "") |
6a27e819 ZK |
139 | lcov: $(LCOV_TRACES) |
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"; \ | |
144 | done; \ | |
fd4728e1 | 145 | test -z "$$lc" || $(GENHTML) -p @abs_top_builddir@ \ |
6a27e819 | 146 | -o $(LCOV_REPORTS_DIR) $$lc |
fddafd51 ZK |
147 | endif |
148 | ||
fddafd51 | 149 | endif |
1033d120 JT |
150 | |
151 | ifeq ("$(TESTING)", "yes") | |
152 | # testing and report generation | |
153 | RUBY=ruby1.9 -Ireport-generators/lib -Ireport-generators/test | |
154 | ||
155 | .PHONEY: unit-test ruby-test test-programs | |
156 | ||
52e1564f | 157 | # FIXME: put dependencies on libdm and liblvm |
40dbaac8 | 158 | # FIXME: Should be handled by Makefiles in subdirs, not here at top level. |
1033d120 | 159 | test-programs: |
66392e66 JT |
160 | cd unit-tests/regex && $(MAKE) |
161 | cd unit-tests/datastruct && $(MAKE) | |
52e1564f | 162 | cd unit-tests/mm && $(MAKE) |
1033d120 JT |
163 | |
164 | unit-test: test-programs | |
165 | $(RUBY) report-generators/unit_test.rb $(shell find . -name TESTS) | |
166 | $(RUBY) report-generators/title_page.rb | |
167 | ||
168 | memcheck: test-programs | |
169 | $(RUBY) report-generators/memcheck.rb $(shell find . -name TESTS) | |
170 | $(RUBY) report-generators/title_page.rb | |
171 | ||
172 | ruby-test: | |
173 | $(RUBY) report-generators/test/ts.rb | |
7622f312 | 174 | endif |