Tizen 2.1 base
[external/device-mapper.git] / Makefile.in
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 ($(MAKECMDGOALS),distclean)
36   SUBDIRS = doc include man scripts \
37     lib tools daemons libdm \
38     udev po liblvm test/api test
39 endif
40 DISTCLEAN_DIRS += lcov_reports*
41 DISTCLEAN_TARGETS += config.cache config.log config.status make.tmpl
42
43 include make.tmpl
44
45 libdm: include
46 lib: libdm
47 liblvm: lib
48 daemons: lib tools
49 tools: lib device-mapper
50 po: tools daemons
51
52 lib.device-mapper: include.device-mapper
53 libdm.device-mapper: include.device-mapper
54 liblvm.device-mapper: include.device-mapper
55 daemons.device-mapper: libdm.device-mapper
56 tools.device-mapper: libdm.device-mapper
57 device-mapper: tools.device-mapper daemons.device-mapper man.device-mapper
58
59 ifeq ("@INTL@", "yes")
60 lib.pofile: include.pofile
61 tools.pofile: lib.pofile
62 daemons.pofile: lib.pofile
63 po.pofile: tools.pofile daemons.pofile
64 pofile: po.pofile
65 endif
66
67 ifneq ("$(CFLOW_CMD)", "")
68 tools.cflow: libdm.cflow lib.cflow
69 daemons.cflow: tools.cflow
70 cflow: include.cflow
71 endif
72
73 ifneq ("@CSCOPE_CMD@", "")
74 cscope.out:
75         @CSCOPE_CMD@ -b -R -s$(top_srcdir)
76 all: cscope.out
77 endif
78 DISTCLEAN_TARGETS += cscope.out
79
80 check check_cluster check_local: all
81         $(MAKE) -C test $(@)
82
83 install_system_dirs:
84         $(INSTALL_DIR) $(DESTDIR)$(DEFAULT_SYS_DIR)
85         $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_ARCHIVE_DIR)
86         $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_BACKUP_DIR)
87         $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_CACHE_DIR)
88         $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_LOCK_DIR)
89         $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_RUN_DIR)
90         $(INSTALL_ROOT_DATA) /dev/null $(DESTDIR)$(DEFAULT_CACHE_DIR)/.cache
91
92 install_initscripts: 
93         $(MAKE) -C scripts install_initscripts
94
95 LCOV_TRACES = libdm.info lib.info tools.info \
96         daemons/dmeventd.info daemons/clvmd.info
97 CLEAN_TARGETS += $(LCOV_TRACES)
98
99 ifneq ("$(LCOV)", "")
100 .PHONY: lcov-reset lcov lcov-dated $(LCOV_TRACES)
101
102 ifeq ($(MAKECMDGOALS),lcov-dated)
103 LCOV_REPORTS_DIR := lcov_reports-$(shell date +%Y%m%d%k%M%S)
104 lcov-dated: lcov
105 else
106 LCOV_REPORTS_DIR := lcov_reports
107 endif
108
109 lcov-reset:
110         $(LCOV) --zerocounters $(addprefix -d , $(basename $(LCOV_TRACES)))
111
112 # maybe use subdirs processing to create tracefiles...
113 $(LCOV_TRACES):
114         $(LCOV) -b $(top_srcdir)/$(basename $@) \
115                 -d $(basename $@) -c -o - | $(SED) \
116                 -e "s/\(dmeventd_lvm.[ch]\)/plugins\/lvm2\/\1/" \
117                 -e "s/\(dmeventd_mirror.c\)/plugins\/mirror\/\1/" \
118                 -e "s/\(dmeventd_snapshot.c\)/plugins\/snapshot\/\1/" \
119                 >$@
120
121 ifneq ("$(GENHTML)", "")
122 lcov: $(LCOV_TRACES)
123         $(RM) -r $(LCOV_REPORTS_DIR)
124         $(MKDIR_P) $(LCOV_REPORTS_DIR)
125         for i in $(LCOV_TRACES); do \
126                 test -s $$i && lc="$$lc $$i"; \
127         done; \
128         test -z "$$lc" || $(GENHTML) -p @abs_top_builddir@ \
129                 -o $(LCOV_REPORTS_DIR) $$lc
130 endif
131
132 endif
133
134 ifeq ("$(TESTING)", "yes")
135 # testing and report generation
136 RUBY=ruby1.9 -Ireport-generators/lib -Ireport-generators/test
137
138 .PHONEY: unit-test ruby-test test-programs
139
140 # FIXME: put dependencies on libdm and liblvm
141 test-programs:
142         cd unit-tests/regex && $(MAKE)
143         cd unit-tests/datastruct && $(MAKE)
144         cd unit-tests/mm && $(MAKE)
145
146 unit-test: test-programs
147         $(RUBY) report-generators/unit_test.rb $(shell find . -name TESTS)
148         $(RUBY) report-generators/title_page.rb
149
150 memcheck: test-programs
151         $(RUBY) report-generators/memcheck.rb $(shell find . -name TESTS)
152         $(RUBY) report-generators/title_page.rb
153
154 ruby-test:
155         $(RUBY) report-generators/test/ts.rb
156 endif