Imported Upstream version 2.02.79
[platform/upstream/device-mapper.git] / libdm / 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 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., 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 SOURCES =\
20         datastruct/bitset.c \
21         datastruct/hash.c \
22         datastruct/list.c \
23         libdm-common.c \
24         libdm-file.c \
25         libdm-deptree.c \
26         libdm-string.c \
27         libdm-report.c \
28         mm/dbg_malloc.c \
29         mm/pool.c \
30         regex/matcher.c \
31         regex/parse_rx.c \
32         regex/ttree.c \
33         $(interface)/libdm-iface.c
34
35 INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
36
37 ifeq ("@STATIC_LINK@", "yes")
38 LIB_STATIC = $(interface)/libdevmapper.a
39 endif
40
41 LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
42 LIB_VERSION = $(LIB_VERSION_DM)
43 TARGETS += libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
44
45 CFLOW_LIST = $(SOURCES)
46 CFLOW_LIST_TARGET = libdevmapper.cflow
47
48 EXPORTED_HEADER = $(srcdir)/libdevmapper.h
49 EXPORTED_FN_PREFIX = dm
50
51 include $(top_builddir)/make.tmpl
52
53 DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \
54         -DDM_DEVICE_MODE=@DM_DEVICE_MODE@
55
56 LIBS += $(SELINUX_LIBS) $(UDEV_LIBS)
57
58 device-mapper: all
59
60 libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION): $(LIB_SHARED)
61         $(LN_S) -f $< $@
62
63 .PHONY: install_dynamic install_static install_include \
64         install_ioctl install_ioctl_static \
65         install_pkgconfig
66
67 INSTALL_TYPE = install_dynamic
68
69 ifeq ("@STATIC_LINK@", "yes")
70   INSTALL_TYPE += install_static
71 endif
72
73 ifeq ("@PKGCONFIG@", "yes")
74   INSTALL_TYPE += install_pkgconfig
75 endif
76
77 install: $(INSTALL_TYPE) install_include
78
79 install_device-mapper: install
80
81 install_include: $(srcdir)/libdevmapper.h
82         $(INSTALL_DATA) -D $< $(includedir)/$(<F)
83
84 install_dynamic: install_@interface@
85
86 install_static: install_@interface@_static
87
88 install_ioctl: install_lib_shared
89
90 install_pkgconfig: libdevmapper.pc
91         $(INSTALL_DATA) -D $< $(pkgconfigdir)/devmapper.pc
92
93 install_ioctl_static: $(LIB_STATIC)
94         $(INSTALL_DATA) -D $< $(usrlibdir)/$(<F)
95
96 CLEAN_TARGETS += ioctl/libdevmapper.a
97 DISTCLEAN_TARGETS += libdevmapper.pc .exported_symbols_generated