]>
Commit | Line | Data |
---|---|---|
8f47e579 | 1 | # |
8b67f40d | 2 | # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. |
23b059e7 | 3 | # Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved. |
8f47e579 | 4 | # |
8b67f40d | 5 | # This file is part of the device-mapper userspace tools. |
8f47e579 | 6 | # |
8b67f40d 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 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, | |
fcbef05a | 13 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
8f47e579 AK |
14 | |
15 | srcdir = @srcdir@ | |
16 | top_srcdir = @top_srcdir@ | |
db8b5af9 | 17 | top_builddir = @top_builddir@ |
3d26bde1 | 18 | abs_srcdir = @abs_srcdir@ |
8f47e579 | 19 | |
0524829a JT |
20 | SUBDIRS=dm-tools |
21 | ||
3d0480ed AK |
22 | SOURCES =\ |
23 | datastruct/bitset.c \ | |
24 | datastruct/hash.c \ | |
3e5b6ed2 | 25 | datastruct/list.c \ |
3d0480ed | 26 | libdm-common.c \ |
0173c260 | 27 | libdm-config.c \ |
3d0480ed | 28 | libdm-deptree.c \ |
0173c260 | 29 | libdm-file.c \ |
61997bb9 | 30 | libdm-report.c \ |
d62a8d2f | 31 | libdm-stats.c \ |
0173c260 AK |
32 | libdm-string.c \ |
33 | libdm-targets.c \ | |
34 | libdm-timestamp.c \ | |
3d0480ed AK |
35 | mm/dbg_malloc.c \ |
36 | mm/pool.c \ | |
38862fcd AK |
37 | regex/matcher.c \ |
38 | regex/parse_rx.c \ | |
39 | regex/ttree.c \ | |
3d0480ed | 40 | $(interface)/libdm-iface.c |
638754e5 | 41 | |
a2c9ede6 | 42 | INCLUDES = -I$(srcdir)/$(interface) |
8f47e579 | 43 | |
beeae21d | 44 | ifeq ("@STATIC_LINK@", "yes") |
5c9e27f3 | 45 | LIB_STATIC = $(interface)/libdevmapper.a |
beeae21d | 46 | endif |
3d2aecf0 | 47 | |
95fca3d1 | 48 | ifeq ("@SHARED_LINK@", "yes") |
23b059e7 | 49 | LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX) |
2c44337b | 50 | LIB_VERSION = $(LIB_VERSION_DM) |
c23f4c80 | 51 | TARGETS = libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) .symver_check |
dc8837f0 | 52 | endif |
5c9e27f3 | 53 | |
b41f5924 ZK |
54 | CFLOW_LIST = $(SOURCES) |
55 | CFLOW_LIST_TARGET = libdevmapper.cflow | |
56 | ||
8b205571 AK |
57 | EXPORTED_HEADER = $(srcdir)/libdevmapper.h |
58 | EXPORTED_FN_PREFIX = dm | |
59 | ||
ccc35e26 | 60 | include $(top_builddir)/libdm/make.tmpl |
0c330786 | 61 | |
2232e82d | 62 | PROGS_CFLAGS = $(UDEV_CFLAGS) |
a2c9ede6 | 63 | |
aee0cd65 | 64 | device-mapper: $(TARGETS) |
f8f6ec92 | 65 | |
aee0cd65 | 66 | dm-tools.device-mapper: device-mapper |
c6be4096 | 67 | |
23b059e7 | 68 | libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION): $(LIB_SHARED) |
88ad83e3 | 69 | $(SHOW) " [LN] $<" |
ceb2f0ad | 70 | $(Q) $(LN_S) -f $< $@ |
23b059e7 | 71 | |
c23f4c80 ZK |
72 | # Check versioned build when default versioned symbol is present @@ |
73 | # also the older symbol is built-in | |
74 | .symver_check: $(LIB_SHARED) | |
88ad83e3 | 75 | $(SHOW) " [CHECK] $<" |
3dee7b72 DS |
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); \ | |
c23f4c80 ZK |
78 | if test -n "$$SYM"; then touch $@; \ |
79 | else echo >&2 "Missing versioned symbols in $<"; false; fi; \ | |
80 | else touch $@; fi | |
81 | ||
d81e3d0b | 82 | .PHONY: install_dynamic install_static install_include \ |
1f84815c | 83 | install_ioctl install_ioctl_static \ |
0c8ff3ad | 84 | install_pkgconfig |
f1568304 | 85 | |
8398c19c AK |
86 | INSTALL_TYPE = install_dynamic |
87 | ||
ef6c23b6 | 88 | ifeq ("@STATIC_LINK@", "yes") |
8398c19c | 89 | INSTALL_TYPE += install_static |
ef6c23b6 AK |
90 | endif |
91 | ||
0c8ff3ad AK |
92 | ifeq ("@PKGCONFIG@", "yes") |
93 | INSTALL_TYPE += install_pkgconfig | |
94 | endif | |
95 | ||
d81e3d0b AK |
96 | install: $(INSTALL_TYPE) install_include |
97 | ||
77b69aa7 AK |
98 | install_device-mapper: install |
99 | ||
23b059e7 | 100 | install_include: $(srcdir)/libdevmapper.h |
88ad83e3 | 101 | $(SHOW) " [INSTALL] $<" |
ceb2f0ad | 102 | $(Q) $(INSTALL_DATA) -D $< $(includedir)/$(<F) |
ef6c23b6 AK |
103 | |
104 | install_dynamic: install_@interface@ | |
8f47e579 | 105 | |
04c7da67 | 106 | install_static: install_@interface@_static |
4ab5b206 | 107 | |
dc8837f0 | 108 | ifeq ("@SHARED_LINK@", "yes") |
23b059e7 | 109 | install_ioctl: install_lib_shared |
dc8837f0 AJ |
110 | endif |
111 | ifeq ("@STATIC_LINK@", "yes") | |
112 | install_ioctl: install_ioctl_static | |
113 | endif | |
d917c98c | 114 | |
23b059e7 | 115 | install_pkgconfig: libdevmapper.pc |
88ad83e3 | 116 | $(SHOW) " [INSTALL] $<" |
ceb2f0ad | 117 | $(Q) $(INSTALL_DATA) -D $< $(pkgconfigdir)/devmapper.pc |
ef6c23b6 | 118 | |
23b059e7 | 119 | install_ioctl_static: $(LIB_STATIC) |
88ad83e3 | 120 | $(SHOW) " [INSTALL] $<" |
ceb2f0ad | 121 | $(Q) $(INSTALL_DATA) -D $< $(usrlibdir)/$(<F) |
4cc80882 | 122 | |
23b059e7 | 123 | CLEAN_TARGETS += ioctl/libdevmapper.a |
98c21e98 | 124 | DISTCLEAN_TARGETS += libdevmapper.pc make.tmpl |