mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-25 01:34:38 +03:00
1967fd2429
to obtain sources. Create make.tmpl target for simplier generation of cflow files with the help of CFLOW_LIST, CFLOW_LIST_TARGET, CFLOW_TARGET. Still cflow usage is not perfect.
128 lines
3.8 KiB
Makefile
128 lines
3.8 KiB
Makefile
#
|
|
# Copyright (C) 2005-2010 Red Hat, Inc. All rights reserved.
|
|
#
|
|
# 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
|
|
# of the GNU Lesser General Public License v.2.1.
|
|
#
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
# 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@
|
|
top_builddir = @top_builddir@
|
|
VPATH = @srcdir@
|
|
|
|
SOURCES = libdevmapper-event.c
|
|
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
|
|
|
|
LIB_NAME = libdevmapper-event
|
|
ifeq ("@STATIC_LINK@", "yes")
|
|
LIB_STATIC = $(LIB_NAME).a
|
|
TARGETS += $(LIB_STATIC) dmeventd.static
|
|
INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
|
|
INSTALL_LIB_TARGETS += install_lib_static
|
|
endif
|
|
|
|
LIB_VERSION = $(LIB_VERSION_DM)
|
|
|
|
ifeq ("@LIB_SUFFIX@","dylib")
|
|
LIB_SHARED = $(LIB_NAME).dylib
|
|
else
|
|
LIB_SHARED = $(LIB_NAME).so
|
|
VERSIONED_SHLIB = $(LIB_SHARED).$(LIB_VERSION)
|
|
endif
|
|
|
|
CLEAN_TARGETS = dmeventd.static $(LIB_NAME).a
|
|
|
|
ifneq ($(MAKECMDGOALS),device-mapper)
|
|
SUBDIRS+=plugins
|
|
endif
|
|
|
|
CFLOW_LIST = $(SOURCES)
|
|
CFLOW_LIST_TARGET = $(LIB_NAME).cflow
|
|
CFLOW_TARGET = dmeventd
|
|
|
|
include $(top_builddir)/make.tmpl
|
|
|
|
all: device-mapper
|
|
device-mapper: $(TARGETS)
|
|
|
|
LVMLIBS += -ldevmapper-event -ldevmapper $(PTHREAD_LIBS)
|
|
|
|
$(VERSIONED_SHLIB): $(LIB_SHARED)
|
|
$(RM) -f $@
|
|
$(LN_S) $(LIB_SHARED) $@
|
|
|
|
dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dmeventd.o \
|
|
$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
|
|
|
|
dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
|
|
dmeventd.o $(DL_LIBS) $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
|
|
|
|
ifeq ("@PKGCONFIG@", "yes")
|
|
INSTALL_LIB_TARGETS += install_pkgconfig
|
|
endif
|
|
|
|
ifneq ("$(CFLOW_CMD)", "")
|
|
CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES))
|
|
-include $(top_builddir)/libdm/libdevmapper.cflow
|
|
-include $(top_builddir)/lib/liblvm-internal.cflow
|
|
-include $(top_builddir)/lib/liblvm2cmd.cflow
|
|
-include $(top_builddir)/daemons/dmeventd/$(LIB_NAME).cflow
|
|
-include $(top_builddir)/daemons/dmeventd/plugins/mirror/$(LIB_NAME)-lvm2mirror.cflow
|
|
endif
|
|
|
|
install_include:
|
|
$(INSTALL) -D $(OWNER) $(GROUP) -m 444 $(srcdir)/libdevmapper-event.h \
|
|
$(includedir)/libdevmapper-event.h
|
|
|
|
install_pkgconfig:
|
|
$(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.pc \
|
|
$(usrlibdir)/pkgconfig/devmapper-event.pc
|
|
|
|
install_lib_dynamic: libdevmapper-event.$(LIB_SUFFIX)
|
|
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
|
|
$(libdir)/libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION)
|
|
$(LN_S) -f libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION) \
|
|
$(libdir)/libdevmapper-event.$(LIB_SUFFIX)
|
|
|
|
install_lib_static: libdevmapper-event.a
|
|
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
|
|
$(libdir)/libdevmapper-event.a.$(LIB_VERSION)
|
|
$(LN_S) -f libdevmapper-event.a.$(LIB_VERSION) $(libdir)/libdevmapper-event.a
|
|
|
|
install_lib: $(INSTALL_LIB_TARGETS)
|
|
|
|
install_dmeventd_dynamic: dmeventd
|
|
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$<
|
|
|
|
install_dmeventd_static: dmeventd.static
|
|
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$<
|
|
|
|
install_dmeventd: $(INSTALL_DMEVENTD_TARGETS)
|
|
|
|
install: install_include install_lib install_dmeventd
|
|
|
|
install_device-mapper: install_include install_lib install_dmeventd
|
|
|
|
.PHONY: distclean_lib distclean
|
|
|
|
distclean_lib:
|
|
$(RM) libdevmapper-event.pc
|
|
|
|
distclean: distclean_lib
|
|
|