]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. | |
3 | # Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved. | |
4 | # | |
5 | # This file is part of LVM2. | |
6 | # | |
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. | |
10 | # | |
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 | |
14 | ||
15 | srcdir = @srcdir@ | |
16 | top_srcdir = @top_srcdir@ | |
17 | top_builddir = @top_builddir@ | |
18 | ||
19 | SUBDIRS = doc include man scripts | |
20 | ||
21 | ifeq ("@UDEV_RULES@", "yes") | |
22 | SUBDIRS += udev | |
23 | endif | |
24 | ||
25 | ifeq ("@INTL@", "yes") | |
26 | SUBDIRS += po | |
27 | endif | |
28 | ||
29 | SUBDIRS += lib tools daemons libdm | |
30 | ||
31 | ifeq ("@APPLIB@", "yes") | |
32 | SUBDIRS += liblvm | |
33 | endif | |
34 | ||
35 | ifeq ("@BUILD_LVMETAD@", "yes") | |
36 | SUBDIRS += libdaemon | |
37 | endif | |
38 | ||
39 | # FIXME Should use intermediate Makefiles here! | |
40 | ifeq ($(MAKECMDGOALS),distclean) | |
41 | SUBDIRS = doc include man scripts \ | |
42 | libdaemon lib tools daemons libdm \ | |
43 | udev po liblvm test \ | |
44 | unit-tests/datastruct unit-tests/mm unit-tests/regex | |
45 | endif | |
46 | DISTCLEAN_DIRS += lcov_reports* | |
47 | DISTCLEAN_TARGETS += config.cache config.log config.status make.tmpl | |
48 | ||
49 | include make.tmpl | |
50 | ||
51 | libdm: include | |
52 | lib: libdm libdaemon | |
53 | liblvm: lib | |
54 | daemons: lib libdaemon tools | |
55 | tools: lib libdaemon device-mapper | |
56 | po: tools daemons | |
57 | ||
58 | lib.device-mapper: include.device-mapper | |
59 | libdm.device-mapper: include.device-mapper | |
60 | liblvm.device-mapper: include.device-mapper | |
61 | daemons.device-mapper: libdm.device-mapper | |
62 | tools.device-mapper: libdm.device-mapper | |
63 | device-mapper: tools.device-mapper daemons.device-mapper man.device-mapper | |
64 | ||
65 | ifeq ("@INTL@", "yes") | |
66 | lib.pofile: include.pofile | |
67 | tools.pofile: lib.pofile | |
68 | daemons.pofile: lib.pofile | |
69 | po.pofile: tools.pofile daemons.pofile | |
70 | pofile: po.pofile | |
71 | endif | |
72 | ||
73 | ifneq ("$(CFLOW_CMD)", "") | |
74 | tools.cflow: libdm.cflow lib.cflow | |
75 | daemons.cflow: tools.cflow | |
76 | cflow: include.cflow | |
77 | endif | |
78 | ||
79 | ifneq ("@CSCOPE_CMD@", "") | |
80 | cscope.out: | |
81 | @CSCOPE_CMD@ -b -R -s$(top_srcdir) | |
82 | all: cscope.out | |
83 | endif | |
84 | DISTCLEAN_TARGETS += cscope.out | |
85 | ||
86 | check check_cluster check_local unit: all | |
87 | $(MAKE) -C test $(@) | |
88 | ||
89 | install_system_dirs: | |
90 | $(INSTALL_DIR) $(DESTDIR)$(DEFAULT_SYS_DIR) | |
91 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_ARCHIVE_DIR) | |
92 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_BACKUP_DIR) | |
93 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_CACHE_DIR) | |
94 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_LOCK_DIR) | |
95 | $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_RUN_DIR) | |
96 | $(INSTALL_ROOT_DATA) /dev/null $(DESTDIR)$(DEFAULT_CACHE_DIR)/.cache | |
97 | ||
98 | install_initscripts: | |
99 | $(MAKE) -C scripts install_initscripts | |
100 | ||
101 | install_systemd_units: | |
102 | $(MAKE) -C scripts install_systemd_units | |
103 | ||
104 | install_tmpfiles_configuration: | |
105 | $(MAKE) -C scripts install_tmpfiles_configuration | |
106 | ||
107 | LCOV_TRACES = libdm.info lib.info tools.info \ | |
108 | daemons/dmeventd.info daemons/clvmd.info | |
109 | CLEAN_TARGETS += $(LCOV_TRACES) | |
110 | ||
111 | ifneq ("$(LCOV)", "") | |
112 | .PHONY: lcov-reset lcov lcov-dated $(LCOV_TRACES) | |
113 | ||
114 | ifeq ($(MAKECMDGOALS),lcov-dated) | |
115 | LCOV_REPORTS_DIR := lcov_reports-$(shell date +%Y%m%d%k%M%S) | |
116 | lcov-dated: lcov | |
117 | else | |
118 | LCOV_REPORTS_DIR := lcov_reports | |
119 | endif | |
120 | ||
121 | lcov-reset: | |
122 | $(LCOV) --zerocounters $(addprefix -d , $(basename $(LCOV_TRACES))) | |
123 | ||
124 | # maybe use subdirs processing to create tracefiles... | |
125 | $(LCOV_TRACES): | |
126 | $(LCOV) -b $(basename $@) \ | |
127 | -d $(basename $@) -c -o - | $(SED) \ | |
128 | -e "s/\(dmeventd_lvm.[ch]\)/plugins\/lvm2\/\1/" \ | |
129 | -e "s/\(dmeventd_mirror.c\)/plugins\/mirror\/\1/" \ | |
130 | -e "s/\(dmeventd_snapshot.c\)/plugins\/snapshot\/\1/" \ | |
131 | >$@ | |
132 | ||
133 | ifneq ("$(GENHTML)", "") | |
134 | lcov: $(LCOV_TRACES) | |
135 | $(RM) -r $(LCOV_REPORTS_DIR) | |
136 | $(MKDIR_P) $(LCOV_REPORTS_DIR) | |
137 | for i in $(LCOV_TRACES); do \ | |
138 | test -s $$i && lc="$$lc $$i"; \ | |
139 | done; \ | |
140 | test -z "$$lc" || $(GENHTML) -p @abs_top_builddir@ \ | |
141 | -o $(LCOV_REPORTS_DIR) $$lc | |
142 | endif | |
143 | ||
144 | endif | |
145 | ||
146 | ifeq ("$(TESTING)", "yes") | |
147 | # testing and report generation | |
148 | RUBY=ruby1.9 -Ireport-generators/lib -Ireport-generators/test | |
149 | ||
150 | .PHONEY: unit-test ruby-test test-programs | |
151 | ||
152 | # FIXME: put dependencies on libdm and liblvm | |
153 | # FIXME: Should be handled by Makefiles in subdirs, not here at top level. | |
154 | test-programs: | |
155 | cd unit-tests/regex && $(MAKE) | |
156 | cd unit-tests/datastruct && $(MAKE) | |
157 | cd unit-tests/mm && $(MAKE) | |
158 | ||
159 | unit-test: test-programs | |
160 | $(RUBY) report-generators/unit_test.rb $(shell find . -name TESTS) | |
161 | $(RUBY) report-generators/title_page.rb | |
162 | ||
163 | memcheck: test-programs | |
164 | $(RUBY) report-generators/memcheck.rb $(shell find . -name TESTS) | |
165 | $(RUBY) report-generators/title_page.rb | |
166 | ||
167 | ruby-test: | |
168 | $(RUBY) report-generators/test/ts.rb | |
169 | endif |