]>
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 | |
4eee5764 | 19 | SUBDIRS = doc include man scripts |
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 | |
40dbaac8 | 35 | # FIXME Should use intermediate Makefiles here! |
5b82db9a | 36 | ifeq ($(MAKECMDGOALS),distclean) |
b7be589e ZK |
37 | SUBDIRS = doc include man scripts \ |
38 | lib tools daemons libdm \ | |
40dbaac8 AK |
39 | udev po liblvm test/api test \ |
40 | unit-tests/datastruct unit-tests/mm unit-tests/regex | |
5b82db9a | 41 | endif |
e83968fa ZK |
42 | DISTCLEAN_DIRS += lcov_reports* |
43 | DISTCLEAN_TARGETS += config.cache config.log config.status make.tmpl | |
5b82db9a | 44 | |
795ca3e5 AK |
45 | include make.tmpl |
46 | ||
0782ad50 AK |
47 | libdm: include |
48 | lib: libdm | |
e0c64c6c | 49 | liblvm: lib |
98cd0c14 | 50 | daemons: lib tools |
572fefeb | 51 | tools: lib device-mapper |
b7edb5bf | 52 | po: tools daemons |
751acb38 | 53 | |
0dfae7e4 | 54 | lib.device-mapper: include.device-mapper |
2c44337b | 55 | libdm.device-mapper: include.device-mapper |
7622f312 | 56 | liblvm.device-mapper: include.device-mapper |
d4b9af44 | 57 | daemons.device-mapper: libdm.device-mapper |
0782ad50 | 58 | tools.device-mapper: libdm.device-mapper |
a479de2e | 59 | device-mapper: tools.device-mapper daemons.device-mapper man.device-mapper |
0782ad50 | 60 | |
69792976 AK |
61 | ifeq ("@INTL@", "yes") |
62 | lib.pofile: include.pofile | |
63 | tools.pofile: lib.pofile | |
d3c8211f | 64 | daemons.pofile: lib.pofile |
b7edb5bf | 65 | po.pofile: tools.pofile daemons.pofile |
69792976 AK |
66 | pofile: po.pofile |
67 | endif | |
751acb38 | 68 | |
b41f5924 ZK |
69 | ifneq ("$(CFLOW_CMD)", "") |
70 | tools.cflow: libdm.cflow lib.cflow | |
71 | daemons.cflow: tools.cflow | |
72 | cflow: include.cflow | |
8a2fc586 AK |
73 | endif |
74 | ||
75 | ifneq ("@CSCOPE_CMD@", "") | |
08db4eeb ZK |
76 | cscope.out: |
77 | @CSCOPE_CMD@ -b -R -s$(top_srcdir) | |
8a2fc586 AK |
78 | all: cscope.out |
79 | endif | |
08db4eeb | 80 | DISTCLEAN_TARGETS += cscope.out |
f0f8fbc6 | 81 | |
a2263de0 PR |
82 | check check_cluster check_local: all |
83 | $(MAKE) -C test $(@) | |
fddafd51 | 84 | |
3399ae32 | 85 | install_system_dirs: |
9cd9dab0 | 86 | $(INSTALL_DIR) $(DESTDIR)$(DEFAULT_SYS_DIR) |
3399ae32 AK |
87 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_ARCHIVE_DIR) |
88 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_BACKUP_DIR) | |
89 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_CACHE_DIR) | |
90 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_LOCK_DIR) | |
8bae0a1e | 91 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_RUN_DIR) |
3399ae32 AK |
92 | $(INSTALL_ROOT_DATA) /dev/null $(DESTDIR)$(DEFAULT_CACHE_DIR)/.cache |
93 | ||
3e730d47 AK |
94 | install_initscripts: |
95 | $(MAKE) -C scripts install_initscripts | |
96 | ||
395d204d PR |
97 | install_systemd_units: |
98 | $(MAKE) -C scripts install_systemd_units | |
99 | ||
6a27e819 ZK |
100 | LCOV_TRACES = libdm.info lib.info tools.info \ |
101 | daemons/dmeventd.info daemons/clvmd.info | |
102 | CLEAN_TARGETS += $(LCOV_TRACES) | |
103 | ||
a6fd0319 | 104 | ifneq ("$(LCOV)", "") |
6a27e819 | 105 | .PHONY: lcov-reset lcov lcov-dated $(LCOV_TRACES) |
fddafd51 | 106 | |
5556819a | 107 | ifeq ($(MAKECMDGOALS),lcov-dated) |
6a27e819 ZK |
108 | LCOV_REPORTS_DIR := lcov_reports-$(shell date +%Y%m%d%k%M%S) |
109 | lcov-dated: lcov | |
5556819a | 110 | else |
6a27e819 | 111 | LCOV_REPORTS_DIR := lcov_reports |
5556819a | 112 | endif |
fddafd51 | 113 | |
5556819a | 114 | lcov-reset: |
6a27e819 ZK |
115 | $(LCOV) --zerocounters $(addprefix -d , $(basename $(LCOV_TRACES))) |
116 | ||
117 | # maybe use subdirs processing to create tracefiles... | |
118 | $(LCOV_TRACES): | |
119 | $(LCOV) -b $(top_srcdir)/$(basename $@) \ | |
120 | -d $(basename $@) -c -o - | $(SED) \ | |
121 | -e "s/\(dmeventd_lvm.[ch]\)/plugins\/lvm2\/\1/" \ | |
122 | -e "s/\(dmeventd_mirror.c\)/plugins\/mirror\/\1/" \ | |
123 | -e "s/\(dmeventd_snapshot.c\)/plugins\/snapshot\/\1/" \ | |
124 | >$@ | |
fddafd51 | 125 | |
a6fd0319 | 126 | ifneq ("$(GENHTML)", "") |
6a27e819 ZK |
127 | lcov: $(LCOV_TRACES) |
128 | $(RM) -r $(LCOV_REPORTS_DIR) | |
129 | $(MKDIR_P) $(LCOV_REPORTS_DIR) | |
130 | for i in $(LCOV_TRACES); do \ | |
131 | test -s $$i && lc="$$lc $$i"; \ | |
132 | done; \ | |
fd4728e1 | 133 | test -z "$$lc" || $(GENHTML) -p @abs_top_builddir@ \ |
6a27e819 | 134 | -o $(LCOV_REPORTS_DIR) $$lc |
fddafd51 ZK |
135 | endif |
136 | ||
fddafd51 | 137 | endif |
1033d120 JT |
138 | |
139 | ifeq ("$(TESTING)", "yes") | |
140 | # testing and report generation | |
141 | RUBY=ruby1.9 -Ireport-generators/lib -Ireport-generators/test | |
142 | ||
143 | .PHONEY: unit-test ruby-test test-programs | |
144 | ||
52e1564f | 145 | # FIXME: put dependencies on libdm and liblvm |
40dbaac8 | 146 | # FIXME: Should be handled by Makefiles in subdirs, not here at top level. |
1033d120 | 147 | test-programs: |
66392e66 JT |
148 | cd unit-tests/regex && $(MAKE) |
149 | cd unit-tests/datastruct && $(MAKE) | |
52e1564f | 150 | cd unit-tests/mm && $(MAKE) |
1033d120 JT |
151 | |
152 | unit-test: test-programs | |
153 | $(RUBY) report-generators/unit_test.rb $(shell find . -name TESTS) | |
154 | $(RUBY) report-generators/title_page.rb | |
155 | ||
156 | memcheck: test-programs | |
157 | $(RUBY) report-generators/memcheck.rb $(shell find . -name TESTS) | |
158 | $(RUBY) report-generators/title_page.rb | |
159 | ||
160 | ruby-test: | |
161 | $(RUBY) report-generators/test/ts.rb | |
7622f312 | 162 | endif |