2 # Copyright (C) 2005-2007 Red Hat, Inc. All rights reserved.
4 # This file is part of the device-mapper userspace tools.
6 # This copyrighted material is made available to anyone wishing to use,
7 # modify, copy, or redistribute it subject to the terms and conditions
8 # of the GNU Lesser General Public License v.2.1.
10 # You should have received a copy of the GNU Lesser General Public License
11 # along with this program; if not, write to the Free Software Foundation,
12 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 top_srcdir
= @top_srcdir@
16 top_builddir
= @top_builddir@
19 SOURCES
= libdevmapper-event.c
22 .PHONY
: install_lib_dynamic install_lib_static install_include \
23 install_pkgconfig install_dmeventd_dynamic install_dmeventd_static \
24 install_lib install_dmeventd
26 INSTALL_DMEVENTD_TARGETS
= install_dmeventd_dynamic
27 INSTALL_LIB_TARGETS
= install_lib_dynamic
29 ifeq ("@STATIC_LINK@", "yes")
30 LIB_STATIC
= libdevmapper-event.a
31 TARGETS
+= dmeventd.static
32 INSTALL_DMEVENTD_TARGETS
+= install_dmeventd_static
33 INSTALL_LIB_TARGETS
+= install_lib_static
36 LIB_VERSION
= $(LIB_VERSION_DM
)
38 ifeq ("@LIB_SUFFIX@","dylib")
39 LIB_SHARED
= libdevmapper-event.dylib
41 LIB_SHARED
= libdevmapper-event.so
42 VERSIONED_SHLIB
= $(LIB_SHARED
).
$(LIB_VERSION
)
45 CLEAN_TARGETS
= dmeventd.o dmeventd.static
47 ifneq ($(MAKECMDGOALS
),device-mapper
)
51 include ..
/..
/make.tmpl
54 device-mapper
: $(TARGETS
)
57 LVMLIBS
+= -ldevmapper-event
-lpthread
-ldevmapper
59 $(VERSIONED_SHLIB
): $(LIB_SHARED
)
61 $(LN_S
) $(LIB_SHARED
) $@
63 dmeventd
: $(LIB_SHARED
) $(VERSIONED_SHLIB
) dmeventd.o
64 $(CC
) $(CFLAGS
) $(LDFLAGS
) -L.
-o
$@ dmeventd.o \
65 $(LVMLIBS
) $(LIBS
) -rdynamic
67 dmeventd.static
: $(LIB_STATIC
) dmeventd.o
$(interfacedir
)/libdevmapper.a
68 $(CC
) $(CFLAGS
) $(LDFLAGS
) -static
-L.
-L
$(interfacedir
) -o
$@ \
69 dmeventd.o
$(LVMLIBS
) $(LIBS
) -rdynamic
71 ifeq ("@PKGCONFIG@", "yes")
72 INSTALL_LIB_TARGETS
+= install_pkgconfig
76 $(INSTALL
) -D
$(OWNER
) $(GROUP
) -m
444 $(srcdir)/libdevmapper-event.h \
77 $(includedir)/libdevmapper-event.h
80 $(INSTALL
) -D
$(OWNER
) $(GROUP
) -m
444 libdevmapper-event.
pc \
81 $(usrlibdir
)/pkgconfig
/devmapper-event.
pc
83 install_lib_dynamic
: libdevmapper-event.
$(LIB_SUFFIX
)
84 $(INSTALL
) -D
$(OWNER
) $(GROUP
) -m
555 $(STRIP
) $< \
85 $(libdir)/libdevmapper-event.
$(LIB_SUFFIX
).
$(LIB_VERSION
)
86 $(LN_S
) -f libdevmapper-event.
$(LIB_SUFFIX
).
$(LIB_VERSION
) \
87 $(libdir)/libdevmapper-event.
$(LIB_SUFFIX
)
89 install_lib_static
: libdevmapper-event.a
90 $(INSTALL
) -D
$(OWNER
) $(GROUP
) -m
555 $(STRIP
) $< \
91 $(libdir)/libdevmapper-event.a.
$(LIB_VERSION
)
92 $(LN_S
) -f libdevmapper-event.a.
$(LIB_VERSION
) $(libdir)/libdevmapper-event.a
94 install_lib
: $(INSTALL_LIB_TARGETS
)
96 install_dmeventd_dynamic
: dmeventd
97 $(INSTALL
) -D
$(OWNER
) $(GROUP
) -m
555 $(STRIP
) $< $(sbindir
)/$<
99 install_dmeventd_static
: dmeventd.static
100 $(INSTALL
) -D
$(OWNER
) $(GROUP
) -m
555 $(STRIP
) $< $(sbindir
)/$<
102 install_dmeventd
: $(INSTALL_DMEVENTD_TARGETS
)
104 install: install_include install_lib install_dmeventd
106 install_device-mapper
: install_include install_lib install_dmeventd
108 .PHONY
: distclean_lib
distclean
111 $(RM
) libdevmapper-event.
pc
113 distclean: distclean_lib