2 # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3 # Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved.
5 # This file is part of the device-mapper userspace tools.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 top_srcdir = @top_srcdir@
17 top_builddir = @top_builddir@
33 $(interface)/libdm-iface.c
35 INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
37 ifeq ("@STATIC_LINK@", "yes")
38 LIB_STATIC = $(interface)/libdevmapper.a
41 LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
42 LIB_VERSION = $(LIB_VERSION_DM)
43 TARGETS += libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
45 CFLOW_LIST = $(SOURCES)
46 CFLOW_LIST_TARGET = libdevmapper.cflow
48 EXPORTED_HEADER = $(srcdir)/libdevmapper.h
49 EXPORTED_FN_PREFIX = dm
51 include $(top_builddir)/make.tmpl
53 DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \
54 -DDM_DEVICE_MODE=@DM_DEVICE_MODE@
56 LIBS += $(SELINUX_LIBS) $(UDEV_LIBS)
60 libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION): $(LIB_SHARED)
63 .PHONY: install_dynamic install_static install_include \
64 install_ioctl install_ioctl_static \
67 INSTALL_TYPE = install_dynamic
69 ifeq ("@STATIC_LINK@", "yes")
70 INSTALL_TYPE += install_static
73 ifeq ("@PKGCONFIG@", "yes")
74 INSTALL_TYPE += install_pkgconfig
77 install: $(INSTALL_TYPE) install_include
79 install_device-mapper: install
81 install_include: $(srcdir)/libdevmapper.h
82 $(INSTALL_DATA) -D $< $(includedir)/$(<F)
84 install_dynamic: install_@interface@
86 install_static: install_@interface@_static
88 install_ioctl: install_lib_shared
90 install_pkgconfig: libdevmapper.pc
91 $(INSTALL_DATA) -D $< $(pkgconfigdir)/devmapper.pc
93 install_ioctl_static: $(LIB_STATIC)
94 $(INSTALL_DATA) -D $< $(usrlibdir)/$(<F)
96 CLEAN_TARGETS += ioctl/libdevmapper.a
97 DISTCLEAN_TARGETS += libdevmapper.pc .exported_symbols_generated