Imported Upstream version 2.02.79
[platform/upstream/device-mapper.git] / daemons / dmeventd / Makefile.in
1 #
2 # Copyright (C) 2005-2010 Red Hat, Inc. All rights reserved.
3 #
4 # This file is part of the device-mapper userspace tools.
5 #
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.
9 #
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
13
14 srcdir = @srcdir@
15 top_srcdir = @top_srcdir@
16 top_builddir = @top_builddir@
17
18 SOURCES = libdevmapper-event.c
19 SOURCES2 = dmeventd.c
20
21 TARGETS = dmeventd
22
23 .PHONY: install_lib_dynamic install_lib_static install_include \
24         install_pkgconfig install_dmeventd_dynamic install_dmeventd_static \
25         install_lib install_dmeventd
26
27 INSTALL_DMEVENTD_TARGETS = install_dmeventd_dynamic
28 INSTALL_LIB_TARGETS = install_lib_dynamic
29
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
36 endif
37
38 LIB_VERSION = $(LIB_VERSION_DM)
39 LIB_SHARED = $(LIB_NAME).$(LIB_SUFFIX)
40
41 CLEAN_TARGETS = dmeventd.static $(LIB_NAME).a
42
43 ifneq ($(MAKECMDGOALS),device-mapper)
44   SUBDIRS+=plugins
45 endif
46
47 CFLOW_LIST = $(SOURCES)
48 CFLOW_LIST_TARGET = $(LIB_NAME).cflow
49 CFLOW_TARGET = dmeventd
50
51 EXPORTED_HEADER = $(srcdir)/libdevmapper-event.h
52 EXPORTED_FN_PREFIX = dm_event
53
54 include $(top_builddir)/make.tmpl
55
56 all: device-mapper
57 device-mapper: $(TARGETS)
58
59 LIBS += -ldevmapper
60 LVMLIBS += -ldevmapper-event $(PTHREAD_LIBS)
61
62 dmeventd: $(LIB_SHARED) dmeventd.o
63         $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dmeventd.o \
64         $(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
65
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)
69
70 ifeq ("@PKGCONFIG@", "yes")
71   INSTALL_LIB_TARGETS += install_pkgconfig
72 endif
73
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
81 endif
82
83 install_include: $(srcdir)/libdevmapper-event.h
84         $(INSTALL_DATA) -D $< $(includedir)/$(<F)
85
86 install_pkgconfig: libdevmapper-event.pc
87         $(INSTALL_DATA) -D $< $(pkgconfigdir)/devmapper-event.pc
88
89 install_lib_dynamic: install_lib_shared
90
91 install_lib_static: $(LIB_STATIC)
92         $(INSTALL_DATA) -D $< $(usrlibdir)/$(<F)
93
94 install_lib: $(INSTALL_LIB_TARGETS)
95
96 install_dmeventd_dynamic: dmeventd
97         $(INSTALL_PROGRAM) -D $< $(sbindir)/$(<F)
98
99 install_dmeventd_static: dmeventd.static
100         $(INSTALL_PROGRAM) -D $< $(staticdir)/$(<F)
101
102 install_dmeventd: $(INSTALL_DMEVENTD_TARGETS)
103
104 install: install_include install_lib install_dmeventd
105
106 install_device-mapper: install_include install_lib install_dmeventd
107
108 DISTCLEAN_TARGETS += libdevmapper-event.pc .exported_symbols_generated