]>
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 the device-mapper userspace tools. | |
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 Lesser General Public License v.2.1. | |
10 | # | |
11 | # You should have received a copy of the GNU Lesser General Public License | |
12 | # along with this program; if not, write to the Free Software Foundation, | |
13 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
14 | ||
15 | srcdir = @srcdir@ | |
16 | top_srcdir = @top_srcdir@ | |
17 | top_builddir = @top_builddir@ | |
18 | abs_srcdir = @abs_srcdir@ | |
19 | ||
20 | SUBDIRS=dm-tools | |
21 | ||
22 | SOURCES =\ | |
23 | datastruct/bitset.c \ | |
24 | datastruct/hash.c \ | |
25 | datastruct/list.c \ | |
26 | libdm-common.c \ | |
27 | libdm-config.c \ | |
28 | libdm-deptree.c \ | |
29 | libdm-file.c \ | |
30 | libdm-report.c \ | |
31 | libdm-stats.c \ | |
32 | libdm-string.c \ | |
33 | libdm-targets.c \ | |
34 | libdm-timestamp.c \ | |
35 | mm/dbg_malloc.c \ | |
36 | mm/pool.c \ | |
37 | regex/matcher.c \ | |
38 | regex/parse_rx.c \ | |
39 | regex/ttree.c \ | |
40 | $(interface)/libdm-iface.c | |
41 | ||
42 | INCLUDES = -I$(srcdir)/$(interface) | |
43 | ||
44 | ifeq ("@STATIC_LINK@", "yes") | |
45 | LIB_STATIC = $(interface)/libdevmapper.a | |
46 | endif | |
47 | ||
48 | ifeq ("@SHARED_LINK@", "yes") | |
49 | LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX) | |
50 | LIB_VERSION = $(LIB_VERSION_DM) | |
51 | TARGETS = libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) .symver_check | |
52 | endif | |
53 | ||
54 | CFLOW_LIST = $(SOURCES) | |
55 | CFLOW_LIST_TARGET = libdevmapper.cflow | |
56 | ||
57 | EXPORTED_HEADER = $(srcdir)/libdevmapper.h | |
58 | EXPORTED_FN_PREFIX = dm | |
59 | ||
60 | include $(top_builddir)/libdm/make.tmpl | |
61 | ||
62 | PROGS_CFLAGS = $(UDEV_CFLAGS) | |
63 | ||
64 | device-mapper: $(TARGETS) | |
65 | ||
66 | dm-tools.device-mapper: device-mapper | |
67 | ||
68 | libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION): $(LIB_SHARED) | |
69 | $(SHOW) " [LN] $<" | |
70 | $(Q) $(LN_S) -f $< $@ | |
71 | ||
72 | # Check versioned build when default versioned symbol is present @@ | |
73 | # also the older symbol is built-in | |
74 | .symver_check: $(LIB_SHARED) | |
75 | $(SHOW) " [CHECK] $<" | |
76 | $(Q) if $(READELF) -Ws $< | grep -q dm_stats_create_region@@; then \ | |
77 | SYM=$$($(READELF) -Ws $< | grep dm_stats_create_region@DM_1_02_106); \ | |
78 | if test -n "$$SYM"; then touch $@; \ | |
79 | else echo >&2 "Missing versioned symbols in $<"; false; fi; \ | |
80 | else touch $@; fi | |
81 | ||
82 | .PHONY: install_dynamic install_static install_include \ | |
83 | install_ioctl install_ioctl_static \ | |
84 | install_pkgconfig | |
85 | ||
86 | INSTALL_TYPE = install_dynamic | |
87 | ||
88 | ifeq ("@STATIC_LINK@", "yes") | |
89 | INSTALL_TYPE += install_static | |
90 | endif | |
91 | ||
92 | ifeq ("@PKGCONFIG@", "yes") | |
93 | INSTALL_TYPE += install_pkgconfig | |
94 | endif | |
95 | ||
96 | install: $(INSTALL_TYPE) install_include | |
97 | ||
98 | install_device-mapper: install | |
99 | ||
100 | install_include: $(srcdir)/libdevmapper.h | |
101 | $(SHOW) " [INSTALL] $<" | |
102 | $(Q) $(INSTALL_DATA) -D $< $(includedir)/$(<F) | |
103 | ||
104 | install_dynamic: install_@interface@ | |
105 | ||
106 | install_static: install_@interface@_static | |
107 | ||
108 | ifeq ("@SHARED_LINK@", "yes") | |
109 | install_ioctl: install_lib_shared | |
110 | endif | |
111 | ifeq ("@STATIC_LINK@", "yes") | |
112 | install_ioctl: install_ioctl_static | |
113 | endif | |
114 | ||
115 | install_pkgconfig: libdevmapper.pc | |
116 | $(SHOW) " [INSTALL] $<" | |
117 | $(Q) $(INSTALL_DATA) -D $< $(pkgconfigdir)/devmapper.pc | |
118 | ||
119 | install_ioctl_static: $(LIB_STATIC) | |
120 | $(SHOW) " [INSTALL] $<" | |
121 | $(Q) $(INSTALL_DATA) -D $< $(usrlibdir)/$(<F) | |
122 | ||
123 | CLEAN_TARGETS += ioctl/libdevmapper.a | |
124 | DISTCLEAN_TARGETS += libdevmapper.pc make.tmpl |