2005-04-27 22:32:00 +00:00
#
2011-09-24 21:00:52 +00:00
# Copyright (C) 2005-2011 Red Hat, Inc. All rights reserved.
2005-04-27 22:32:00 +00:00
#
# This file is part of the device-mapper userspace tools.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
2005-12-02 15:39:16 +00:00
# of the GNU Lesser General Public License v.2.1.
2005-04-27 22:32:00 +00:00
#
2005-12-02 15:39:16 +00:00
# You should have received a copy of the GNU Lesser General Public License
2005-04-27 22:32:00 +00:00
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
srcdir = @srcdir@
top_srcdir = @top_srcdir@
2009-10-02 19:10:31 +00:00
top_builddir = @top_builddir@
2005-04-27 22:32:00 +00:00
2007-01-08 15:18:52 +00:00
SOURCES = libdevmapper-event.c
2010-03-29 14:17:59 +00:00
SOURCES2 = dmeventd.c
2009-10-13 02:35:26 +00:00
TARGETS = dmeventd
.PHONY : install_lib_dynamic install_lib_static install_include \
install_pkgconfig install_dmeventd_dynamic install_dmeventd_static \
install_lib install_dmeventd
INSTALL_DMEVENTD_TARGETS = install_dmeventd_dynamic
INSTALL_LIB_TARGETS = install_lib_dynamic
2005-04-27 22:32:00 +00:00
2010-03-29 14:07:01 +00:00
LIB_NAME = libdevmapper-event
2009-04-08 14:04:35 +00:00
i f e q ( "@STATIC_LINK@" , "yes" )
2010-03-29 14:07:01 +00:00
LIB_STATIC = $( LIB_NAME) .a
TARGETS += $( LIB_STATIC) dmeventd.static
2009-10-13 02:35:26 +00:00
INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
INSTALL_LIB_TARGETS += install_lib_static
2009-04-08 14:04:35 +00:00
e n d i f
2009-10-13 02:35:26 +00:00
2008-11-03 23:01:21 +00:00
LIB_VERSION = $( LIB_VERSION_DM)
2010-04-09 21:42:48 +00:00
LIB_SHARED = $( LIB_NAME) .$( LIB_SUFFIX)
2005-12-02 15:39:16 +00:00
2010-03-29 14:11:17 +00:00
CLEAN_TARGETS = dmeventd.static $( LIB_NAME) .a
2007-01-08 15:18:52 +00:00
2008-11-03 23:01:21 +00:00
i f n e q ( $( MAKECMDGOALS ) , d e v i c e - m a p p e r )
SUBDIRS += plugins
e n d i f
2010-03-29 14:11:17 +00:00
CFLOW_LIST = $( SOURCES)
CFLOW_LIST_TARGET = $( LIB_NAME) .cflow
CFLOW_TARGET = dmeventd
2010-08-16 22:54:35 +00:00
EXPORTED_HEADER = $( srcdir) /libdevmapper-event.h
EXPORTED_FN_PREFIX = dm_event
2010-03-04 09:51:37 +00:00
i n c l u d e $( top_builddir ) / m a k e . t m p l
2008-11-03 23:01:21 +00:00
2009-10-13 02:35:26 +00:00
all : device -mapper
device-mapper : $( TARGETS )
2005-04-27 22:32:00 +00:00
2010-05-11 08:38:10 +00:00
LIBS += -ldevmapper
LVMLIBS += -ldevmapper-event $( PTHREAD_LIBS)
2009-10-13 02:35:26 +00:00
2013-12-05 14:03:10 +01:00
CFLAGS_dmeventd.o += $( EXTRA_EXEC_CFLAGS)
2013-12-04 10:16:15 +01:00
2010-04-09 21:42:48 +00:00
dmeventd : $( LIB_SHARED ) dmeventd .o
2013-12-05 14:03:10 +01:00
$( CC) $( CFLAGS) $( LDFLAGS) $( EXTRA_EXEC_LDFLAGS) $( ELDFLAGS) -L. -o $@ dmeventd.o \
2010-03-04 12:10:40 +00:00
$( DL_LIBS) $( LVMLIBS) $( LIBS) -rdynamic
2007-01-08 15:18:52 +00:00
2010-01-19 01:10:46 +00:00
dmeventd.static : $( LIB_STATIC ) dmeventd .o $( interfacebuilddir ) /libdevmapper .a
2011-11-14 21:30:35 +00:00
$( CC) $( CFLAGS) $( LDFLAGS) $( ELDFLAGS) -static -L. -L$( interfacebuilddir) -o $@ \
2010-05-14 13:36:56 +00:00
dmeventd.o $( DL_LIBS) $( LVMLIBS) $( LIBS) $( STATIC_LIBS)
2005-04-27 22:32:00 +00:00
2006-04-19 16:38:56 +00:00
i f e q ( "@PKGCONFIG@" , "yes" )
2009-10-13 02:35:26 +00:00
INSTALL_LIB_TARGETS += install_pkgconfig
2006-04-19 16:38:56 +00:00
e n d i f
2010-03-29 14:11:17 +00:00
i f n e q ( "$(CFLOW_CMD)" , "" )
CFLOW_SOURCES = $( addprefix $( srcdir) /, $( SOURCES) )
- i n c l u d e $( top_builddir ) / l i b d m / l i b d e v m a p p e r . c f l o w
- i n c l u d e $( top_builddir ) / l i b / l i b l v m - i n t e r n a l . c f l o w
- i n c l u d e $( top_builddir ) / l i b / l i b l v m 2 c m d . c f l o w
- i n c l u d e $( top_builddir ) / d a e m o n s / d m e v e n t d / $( LIB_NAME ) . c f l o w
- i n c l u d e $( top_builddir ) / d a e m o n s / d m e v e n t d / p l u g i n s / m i r r o r / $( LIB_NAME ) - l v m 2 m i r r o r . c f l o w
e n d i f
2010-04-09 21:42:48 +00:00
install_include : $( srcdir ) /libdevmapper -event .h
$( INSTALL_DATA) -D $< $( includedir) /$( <F)
2006-04-19 15:23:10 +00:00
2010-04-09 21:42:48 +00:00
install_pkgconfig : libdevmapper -event .pc
2010-05-11 08:57:02 +00:00
$( INSTALL_DATA) -D $< $( pkgconfigdir) /devmapper-event.pc
2009-10-13 02:35:26 +00:00
2010-04-09 21:42:48 +00:00
install_lib_dynamic : install_lib_shared
2006-04-19 16:38:56 +00:00
2010-04-09 21:42:48 +00:00
install_lib_static : $( LIB_STATIC )
$( INSTALL_DATA) -D $< $( usrlibdir) /$( <F)
2005-04-27 22:32:00 +00:00
2009-10-13 02:35:26 +00:00
install_lib : $( INSTALL_LIB_TARGETS )
install_dmeventd_dynamic : dmeventd
2010-04-09 21:42:48 +00:00
$( INSTALL_PROGRAM) -D $< $( sbindir) /$( <F)
2009-10-13 02:35:26 +00:00
install_dmeventd_static : dmeventd .static
2010-04-09 21:42:48 +00:00
$( INSTALL_PROGRAM) -D $< $( staticdir) /$( <F)
2009-10-13 02:35:26 +00:00
install_dmeventd : $( INSTALL_DMEVENTD_TARGETS )
install : install_include install_lib install_dmeventd
2009-11-13 12:48:01 +00:00
install_device-mapper : install_include install_lib install_dmeventd
2008-06-27 15:36:51 +00:00
2011-09-24 21:00:52 +00:00
DISTCLEAN_TARGETS += libdevmapper-event.pc