2 # Copyright (C) 2005-2010 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@
18 SOURCES = libdevmapper-event.c
23 .PHONY: install_lib_dynamic install_lib_static install_include \
24 install_pkgconfig install_dmeventd_dynamic install_dmeventd_static \
25 install_lib install_dmeventd
27 INSTALL_DMEVENTD_TARGETS = install_dmeventd_dynamic
28 INSTALL_LIB_TARGETS = install_lib_dynamic
30 LIB_NAME = libdevmapper-event
31 ifeq ("@STATIC_LINK@", "yes")
32 LIB_STATIC = $(LIB_NAME).a
33 TARGETS += $(LIB_STATIC) dmeventd.static
34 INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
35 INSTALL_LIB_TARGETS += install_lib_static
38 LIB_VERSION = $(LIB_VERSION_DM)
39 LIB_SHARED = $(LIB_NAME).$(LIB_SUFFIX)
41 CLEAN_TARGETS = dmeventd.static $(LIB_NAME).a
43 ifneq ($(MAKECMDGOALS),device-mapper)
47 CFLOW_LIST = $(SOURCES)
48 CFLOW_LIST_TARGET = $(LIB_NAME).cflow
49 CFLOW_TARGET = dmeventd
51 EXPORTED_HEADER = $(srcdir)/libdevmapper-event.h
52 EXPORTED_FN_PREFIX = dm_event
54 include $(top_builddir)/make.tmpl
57 device-mapper: $(TARGETS)
60 LVMLIBS += -ldevmapper-event $(PTHREAD_LIBS)
62 dmeventd: $(LIB_SHARED) dmeventd.o
63 $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dmeventd.o \
64 $(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
66 dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
67 $(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
68 dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
70 ifeq ("@PKGCONFIG@", "yes")
71 INSTALL_LIB_TARGETS += install_pkgconfig
74 ifneq ("$(CFLOW_CMD)", "")
75 CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES))
76 -include $(top_builddir)/libdm/libdevmapper.cflow
77 -include $(top_builddir)/lib/liblvm-internal.cflow
78 -include $(top_builddir)/lib/liblvm2cmd.cflow
79 -include $(top_builddir)/daemons/dmeventd/$(LIB_NAME).cflow
80 -include $(top_builddir)/daemons/dmeventd/plugins/mirror/$(LIB_NAME)-lvm2mirror.cflow
83 install_include: $(srcdir)/libdevmapper-event.h
84 $(INSTALL_DATA) -D $< $(includedir)/$(<F)
86 install_pkgconfig: libdevmapper-event.pc
87 $(INSTALL_DATA) -D $< $(pkgconfigdir)/devmapper-event.pc
89 install_lib_dynamic: install_lib_shared
91 install_lib_static: $(LIB_STATIC)
92 $(INSTALL_DATA) -D $< $(usrlibdir)/$(<F)
94 install_lib: $(INSTALL_LIB_TARGETS)
96 install_dmeventd_dynamic: dmeventd
97 $(INSTALL_PROGRAM) -D $< $(sbindir)/$(<F)
99 install_dmeventd_static: dmeventd.static
100 $(INSTALL_PROGRAM) -D $< $(staticdir)/$(<F)
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 DISTCLEAN_TARGETS += libdevmapper-event.pc .exported_symbols_generated