2005-04-28 02:32:00 +04:00
#
2011-09-25 01:00:52 +04:00
# Copyright (C) 2005-2011 Red Hat, Inc. All rights reserved.
2005-04-28 02:32:00 +04: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 18:39:16 +03:00
# of the GNU Lesser General Public License v.2.1.
2005-04-28 02:32:00 +04:00
#
2005-12-02 18:39:16 +03:00
# You should have received a copy of the GNU Lesser General Public License
2005-04-28 02:32:00 +04:00
# along with this program; if not, write to the Free Software Foundation,
2016-01-21 13:49:46 +03:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2005-04-28 02:32:00 +04:00
srcdir = @srcdir@
top_srcdir = @top_srcdir@
2009-10-02 23:10:31 +04:00
top_builddir = @top_builddir@
2005-04-28 02:32:00 +04:00
2007-01-08 18:18:52 +03:00
SOURCES = libdevmapper-event.c
2010-03-29 18:17:59 +04:00
SOURCES2 = dmeventd.c
2009-10-13 06:35:26 +04: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-28 02:32:00 +04:00
2010-03-29 18:07:01 +04:00
LIB_NAME = libdevmapper-event
2009-04-08 18:04:35 +04:00
i f e q ( "@STATIC_LINK@" , "yes" )
2010-03-29 18:07:01 +04:00
LIB_STATIC = $( LIB_NAME) .a
TARGETS += $( LIB_STATIC) dmeventd.static
2009-10-13 06:35:26 +04:00
INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
INSTALL_LIB_TARGETS += install_lib_static
2009-04-08 18:04:35 +04:00
e n d i f
2009-10-13 06:35:26 +04:00
2008-11-04 02:01:21 +03:00
LIB_VERSION = $( LIB_VERSION_DM)
2010-04-10 01:42:48 +04:00
LIB_SHARED = $( LIB_NAME) .$( LIB_SUFFIX)
2005-12-02 18:39:16 +03:00
2010-03-29 18:11:17 +04:00
CLEAN_TARGETS = dmeventd.static $( LIB_NAME) .a
2007-01-08 18:18:52 +03:00
2008-11-04 02:01:21 +03: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 18:11:17 +04:00
CFLOW_LIST = $( SOURCES)
CFLOW_LIST_TARGET = $( LIB_NAME) .cflow
CFLOW_TARGET = dmeventd
2010-08-17 02:54:35 +04:00
EXPORTED_HEADER = $( srcdir) /libdevmapper-event.h
EXPORTED_FN_PREFIX = dm_event
2010-03-04 12:51:37 +03:00
i n c l u d e $( top_builddir ) / m a k e . t m p l
2008-11-04 02:01:21 +03:00
2009-10-13 06:35:26 +04:00
all : device -mapper
device-mapper : $( TARGETS )
2005-04-28 02:32:00 +04:00
2013-12-05 17:03:10 +04:00
CFLAGS_dmeventd.o += $( EXTRA_EXEC_CFLAGS)
2018-12-14 18:28:26 +03:00
LIBS += $( PTHREAD_LIBS) -L$( top_builddir) /libdm -ldevmapper
2013-12-04 13:16:15 +04:00
2010-04-10 01:42:48 +04:00
dmeventd : $( LIB_SHARED ) dmeventd .o
2018-11-29 19:09:27 +03:00
@echo " [CC] $@ "
$( Q) $( CC) $( CFLAGS) -L. $( LDFLAGS) $( EXTRA_EXEC_LDFLAGS) $( ELDFLAGS) dmeventd.o \
2018-12-12 12:50:36 +03:00
-o $@ $( DL_LIBS) $( DMEVENT_LIBS) $( LIBS) -lm
2007-01-08 18:18:52 +03:00
2018-05-14 14:16:43 +03:00
dmeventd.static : $( LIB_STATIC ) dmeventd .o
2018-11-29 19:09:27 +03:00
@echo " [CC] $@ "
$( Q) $( CC) $( CFLAGS) $( LDFLAGS) -static -L. -L$( interfacebuilddir) dmeventd.o \
2017-08-01 01:01:07 +03:00
-o $@ $( DL_LIBS) $( DMEVENT_LIBS) $( LIBS) $( STATIC_LIBS)
2005-04-28 02:32:00 +04:00
2006-04-19 20:38:56 +04:00
i f e q ( "@PKGCONFIG@" , "yes" )
2009-10-13 06:35:26 +04:00
INSTALL_LIB_TARGETS += install_pkgconfig
2006-04-19 20:38:56 +04:00
e n d i f
2010-03-29 18:11:17 +04: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 / 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-10 01:42:48 +04:00
install_include : $( srcdir ) /libdevmapper -event .h
2018-11-29 19:09:27 +03:00
@echo " [INSTALL] $< "
$( Q) $( INSTALL_DATA) -D $< $( includedir) /$( <F)
2006-04-19 19:23:10 +04:00
2010-04-10 01:42:48 +04:00
install_pkgconfig : libdevmapper -event .pc
2018-11-29 19:09:27 +03:00
@echo " [INSTALL] $< "
$( Q) $( INSTALL_DATA) -D $< $( pkgconfigdir) /devmapper-event.pc
2009-10-13 06:35:26 +04:00
2010-04-10 01:42:48 +04:00
install_lib_dynamic : install_lib_shared
2006-04-19 20:38:56 +04:00
2010-04-10 01:42:48 +04:00
install_lib_static : $( LIB_STATIC )
2018-11-29 19:09:27 +03:00
@echo " [INSTALL] $< "
$( Q) $( INSTALL_DATA) -D $< $( usrlibdir) /$( <F)
2005-04-28 02:32:00 +04:00
2009-10-13 06:35:26 +04:00
install_lib : $( INSTALL_LIB_TARGETS )
install_dmeventd_dynamic : dmeventd
2018-11-29 19:09:27 +03:00
@echo " [INSTALL] $< "
$( Q) $( INSTALL_PROGRAM) -D $< $( sbindir) /$( <F)
2009-10-13 06:35:26 +04:00
install_dmeventd_static : dmeventd .static
2018-11-29 19:09:27 +03:00
@echo " [INSTALL] $< "
$( Q) $( INSTALL_PROGRAM) -D $< $( staticdir) /$( <F)
2009-10-13 06:35:26 +04:00
install_dmeventd : $( INSTALL_DMEVENTD_TARGETS )
install : install_include install_lib install_dmeventd
2009-11-13 15:48:01 +03:00
install_device-mapper : install_include install_lib install_dmeventd
2008-06-27 19:36:51 +04:00
2011-09-25 01:00:52 +04:00
DISTCLEAN_TARGETS += libdevmapper-event.pc